halov 0.26.415 → 0.26.513

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode("img[data-v-f7799232]{display:block;max-width:100%}.app-tab-item[data-v-df170cc3]{border-top-width:2px}[data-v-e7319d81] .n-upload-trigger{display:block}.item-box[data-v-e7319d81]{display:block;flex-grow:1}.form-input[data-v-e7319d81]{display:block}.text-input[data-v-e7319d81]{font-size:small;display:block;text-align:end;padding-right:4px}div[data-v-8b391a0f] div.n-form-item-feedback-wrapper{display:none}div[data-v-8b391a0f] .n-form-item-blank{margin-bottom:4px}.n-form-item.n-form-item--left-labelled.n-form-item--auto-label-width>label{min-width:8em}[data-v-18129d6e] .n-upload-trigger{display:block}.edit-title-btn{visibility:hidden}.grid-config-global-mode .edit-title-btn{visibility:visible}.main-detail-panel[data-v-ca4664e2]{display:flex;width:100%;height:100%;overflow:hidden;--n-resize-trigger-color: rgb(224, 224, 230, .24);--n-resize-trigger-color-hover: #36ad6a}.dark .main-detail-panel[data-v-ca4664e2]{--n-resize-trigger-color: rgba(255, 255, 255, .24);--n-resize-trigger-color-hover: #7fe7c4}.main-detail-panel.horizontal[data-v-ca4664e2]{flex-direction:row}.main-detail-panel.vertical[data-v-ca4664e2]{flex-direction:column}.panel[data-v-ca4664e2]{overflow:auto;display:flex;flex-direction:column}.divider[data-v-ca4664e2]{background-color:var(--n-resize-trigger-color);cursor:col-resize;transition:background .2s}.main-detail-panel.horizontal .divider[data-v-ca4664e2]{width:4px;height:100%}.main-detail-panel.vertical .divider[data-v-ca4664e2]{height:4px;width:100%;cursor:row-resize}.divider.dragging[data-v-ca4664e2],.divider[data-v-ca4664e2]:hover{background-color:var(--n-resize-trigger-color-hover)}.icon-container[data-v-ff87aac6]{display:flex;flex-direction:row;flex-wrap:wrap;padding-right:4px;padding-bottom:4px}.icon-button[data-v-ff87aac6]{max-width:100px;height:90px;width:80px;margin:4px 0 0 4px}.menu-spin>.n-spin-content{height:100%;display:flex;flex-direction:column}.user-name-box[data-v-0d4b7b61]{background:#abf3;position:relative;z-index:1;width:6rem;height:27px;line-height:27px;border-radius:0 27px 27px 0;left:20px;top:6px}.user-name-label[data-v-0d4b7b61]{padding-left:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-transform:uppercase;text-align:center}.app-tabs{margin-bottom:0}.app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type{--n-tab-color: #D1D5DB;--n-tab-text-color: #1E1B4B;--n-tab-text-color-active: #1E1B4B;--n-tab-border-color: #A3A3A3}.dark .app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type{--n-tab-color: #27272A;--n-tab-text-color: #71717A;--n-tab-text-color-active: #D4D4D8;--n-tab-border-color: #525252}.app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type .n-tabs-tab.n-tabs-tab--active{background-color:#f4f4f5;border-bottom-color:#f4f4f5;font-weight:bolder;border-top-color:#1e40af}.dark .app-tabs.n-tabs .n-tabs-nav.n-tabs-nav--card-type .n-tabs-tab.n-tabs-tab--active{background-color:#171717;border-bottom-color:#171717;border-top-color:#e2e8f0}.app-tab-label{padding:0 1em}.d-block{display:block}.d-none{display:none}.d-flex{display:flex}.d-inline{display:inline}.d-inline-block{display:inline-block}.n-form .n-form-item .n-form-item-feedback-wrapper:empty{display:none}.n-form .n-form-item{margin-bottom:4px}.n-data-table-td,.n-data-table-th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.n-dropdown-menu.n-dropdown{min-width:150px}.text-monospace,.halo-form-code input,.halo-form-code-u input,.halo-form-code-l input{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace}.halo-form-code-u input,.halo-form-code-u{text-transform:uppercase}.halo-form-code-l input,.halo-form-code-l{text-transform:lowercase}.halo-form-wrap{white-space:wrap;overflow-wrap:break-word;display:inline-block}.h-100{height:100%}.h-50{height:50%}td .halo-form-code,td .halo-form-code-u,td .halo-form-code-l{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace}td.text-num{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace;text-align:right}td.text-date,td.text-time,td.text-datetime{font-family:Monaco,Consolas,Liberation Mono,SimHei,Courier New,monospace}td .percent-mark{margin-left:4px;margin-right:2px}td .percent-mark svg{margin:0 auto;display:block}td .status-tag{border-radius:2px;border-width:0 0 0 4px;border-style:solid;padding:0 4px;font-size:smaller;border-color:#9999}td .status-New,td .status-Created,td .status-Standby{border-color:#8bc34a99}td .status-True,td .status-true,td .status-Success,td .status-Succeeded,td .status-Succeed,td .status-Good,td .status-InStock,td .status-Passed,td .status-Resolved,td .status-Processing,td .status-InProduction,td .status-Allowed,td .status-Qualified,td .status-Loaded{border-color:#18a05899}td .status-False,td .status-false,td .status-NonGood,td .status-Failed,td .status-Rejected,td .status-Abnormal,td .status-Forbidden,td .status-Defective{border-color:#d0305099}td .status-Confirmed,td .status-Dispatched,td .status-Inspected{border-color:#3f51b599}td .status-Consumed,td .status-Finished,td .status-Unloaded{border-color:#607d8b99}td .status-Ignored{border-color:#79554899}td .status-OutStock,td .status-Cancelled{border-color:#9e9e9e99}td .status-InTransit{border-color:#78909c99}td .status-InFactory{border-color:#43a04799}td .status-InGarage{border-color:#673ab799}td .status-Doubt,td .status-Paused{border-color:#ffc10799}td .status-Read{border-color:#ffc107cc}td .status-Write{border-color:#673ab7cc}.n-data-table .n-data-table-th .n-data-table-sorter:not(.n-data-table-sorter--asc):not(.n-data-table-sorter--desc){display:none}.n-data-table .btn-cell-ref .n-button__content{opacity:.2}.n-data-table .btn-cell-ref:hover .n-button__content{opacity:1;color:#673ab7}.n-data-table .btn-cell-qr .n-button__content{opacity:.2}.n-data-table .btn-cell-qr:hover .n-button__content{opacity:1;color:#673ab7}.n-data-table-td:not(.check-mark) .cell-unchecked{display:none}.draging-ghost{opacity:.5;background:#c8ebfb}.drag-sorting-handle{cursor:row-resize}.pg-item{margin:1px;border:1px solid transparent;padding:2px;border-radius:3px}.pg-item:hover{border-color:#eee}.dark .pg-item:hover{border-color:#fff6}.pg-label{padding:0 2px;white-space:nowrap;max-width:50%;text-overflow:clip}.pg-value{padding-left:.5em;padding-right:1em;position:relative}.menu-icon{border-radius:2px}.menu-icon-blank{width:16px;height:16px}.text-positive{color:#00c853}.text-negative,.text-danger{color:#b71c1c}ul,li{list-style:none}html,body,#app,.n-config-provider{height:100%;margin:0;padding:0}.flex-column{display:flex;flex-direction:column}.flex-row{display:flex;flex-direction:row}.flex-1{flex:1 1 0}.flex-grow-1{flex-grow:1}.flex-shrink-1{flex-shrink:1}.flex-wrap{flex-wrap:wrap}.gap1{gap:1em}.gap05{gap:.5em}.gap025{gap:.25em}.gap015{gap:.15em}.gap01{gap:.1em}.gap-x-1{column-gap:1em}.gap-x-05{column-gap:.5em}.gap-x-25{column-gap:.25em}.gap-y-1{row-gap:1em}.gap-y-05{row-gap:.5em}.gap-y-25{row-gap:.25em}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.week-0{background-color:#a5d6a7}input.ime-off,.ime-off input{ime-mode:disabled}.h-scroll{overflow-x:scroll}.v-scroll{overflow-y:scroll}.tabs-card.n-card>.n-card__content{padding:0}.tabs-card.n-card>.n-card__content .n-tab-pane{padding:0}.tabs-card.n-card>.n-card__content .n-tab-pane>.n-card{border-top:0}.info-card{flex-grow:1;margin-top:1em}.info-card>.n-card__content{display:flex;flex-direction:column}.info-card>.n-card__content>.n-tabs{flex-grow:1}.info-card>.n-card__content>.n-tabs>.n-tab-pane{flex-grow:1;display:flex;flex-direction:column}.info-card>.n-card__content>.n-tabs>.n-tab-pane>div{flex-grow:1;display:flex;flex-direction:column}.page-component.n-space>div:first-child{flex-grow:1;display:flex;flex-direction:column}.form-create .n-input--disabled .n-input__input-el,.form-create .n-input--disabled .n-input__placeholder,.form-create .n-input--disabled .n-input__textarea-el,.form-create .n-base-selection--disabled .n-base-selection-overlay__wrapper{color:#000;font-weight:700}.bordered{border:1px solid var(--n-border-color);border-radius:var(--n-border-radius)}.n-dialog__content .line,.n-message__content .line{display:block}.n-tree-node-content__text{white-space:nowrap}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- (function(M,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("axios"),require("vue-router"),require("naive-ui"),require("pinia"),require("moment"),require("mustache"),require("vue-draggable-plus")):typeof define=="function"&&define.amd?define(["exports","vue","axios","vue-router","naive-ui","pinia","moment","mustache","vue-draggable-plus"],e):(M=typeof globalThis<"u"?globalThis:M||self,e(M.halov={},M.Vue,M.axios,M.VueRouter,M.NaiveUI,M.Pinia,M.moment,M.Mustache,M.VueDraggablePlus))})(this,function(M,e,le,ce,u,Ae,se,Ce,Wt){"use strict";var kd=Object.defineProperty;var Nd=(M,e,le)=>e in M?kd(M,e,{enumerable:!0,configurable:!0,writable:!0,value:le}):M[e]=le;var J=(M,e,le)=>Nd(M,typeof e!="symbol"?e+"":e,le);var et=typeof document<"u"?document.currentScript:null;const tt=window,Zt="halo-lang";class dl{constructor(l,o=!0){J(this,"langCode","");J(this,"ignoreCase",!1);this.ignoreCase=o,this.swtichLang(l)}loadScript(l){const o=document.createElement("script");return o.src=l,o.id=Zt,document.head.appendChild(o),o}unloadScript(){const l=document.getElementById(Zt);return l&&l.parentNode?(l.parentNode.removeChild(l),!0):!1}swtichLang(l){if(this.langCode!=l){this.langCode=l;const o=`/api/core/Languages/embed.js?code=${encodeURIComponent(l)}&caseType=lowercase`;this.unloadScript(),this.loadScript(o)}}t(l){var n;if(!l)return"";const o=(n=tt.lang)==null?void 0:n.words;return o&&o[this.ignoreCase?l.toLowerCase():l]||l}t2(l,o){var r;if(!l&&!o)return"";const n=(r=tt.lang)==null?void 0:r.words;if(n){if(l){const a=n[this.ignoreCase?l.toLowerCase():l];if(a)return a}if(o){const a=n[this.ignoreCase?o.toLowerCase():o];if(a)return a}}return l||o}info(){const l=tt.lang;if(l)return{code:l.code,name:l.name,displayName:l.displayName,nativeName:l.nativeName,revision:l.revision,rtl:l.rtl}}}const Yt=Symbol("halo-i18n");let ot=null;function Qt(t,l){return ot||(ot=new dl(t,l)),ot}function Xt(t,l,o=!0){const n=Qt(l,o);t.config.globalProperties.$t=r=>n.t(r),t.provide(Yt,n)}function Z(){const t=e.inject(Yt);if(!t)throw new Error("I18n not initialized. Ensure I18nPlugin is installed.");return{i18n:t,t:t.t.bind(t),switchLang:t.swtichLang.bind(t),lang:t.info}}const fl=()=>{let t=localStorage.getItem("Client-Device-Id");return t||(typeof crypto<"u"&&typeof crypto.randomUUID=="function"?t=crypto.randomUUID():t="c-"+Math.random().toString(36).substring(2)+Date.now().toString(36),localStorage.setItem("Client-Device-Id",t)),t};le.defaults.headers["Client-Device-Id"]=fl(),le.defaults.headers["Content-type"]="application/json",le.defaults.timeout=1e3*60,le.interceptors.request.use(t=>{const l=localStorage.getItem("sessionToken");return l&&t.headers&&(t.headers.Authorization=`Bearer ${l}`),t},t=>(console.log(t),Promise.reject(t))),le.interceptors.response.use(t=>t.status==200?t.data:Promise.reject(t.statusText),t=>{if(t&&t.response&&t.response.status){const l=ce.useRouter();switch(t.response.status){case 401:l==null||l.push({name:"Unauthorized"});break}}return Promise.reject(t)});const ul=["src"],pl=e.defineComponent({__name:"AppLogoBox",props:{src:{type:String,required:!0},height:{type:String,default:"40px"},defaultSrc:{type:String,default:new URL("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4xIChjNjhlMjJjMzg3LCAyMDIxLTA1LTIzKSIKICAgaW5rc2NhcGU6ZXhwb3J0LXlkcGk9IjUuNjExNzEyIgogICBpbmtzY2FwZTpleHBvcnQteGRwaT0iNS42MTE3MTIiCiAgIGlua3NjYXBlOmV4cG9ydC1maWxlbmFtZT0iRDpcQ29kZXNcSk1DX0ZyYW1lX0FuZG9uXEFydHNcbG9nb18yMC5wbmciCiAgIHNvZGlwb2RpOmRvY25hbWU9ImxvZ28uc3ZnIgogICB3aWR0aD0iODAuNjk3OTE0bW0iCiAgIGhlaWdodD0iNzYuOTQ2MjEzbW0iCiAgIHZpZXdCb3g9IjAgMCA4MC42OTc5MTQgNzYuOTQ2MjEzIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmc4IgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgaW5rc2NhcGU6ZG9jdW1lbnQtcm90YXRpb249IjAiCiAgICAgaW5rc2NhcGU6Y3VycmVudC1sYXllcj0iZzQ1NDMiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMSIKICAgICBpbmtzY2FwZTp3aW5kb3cteT0iLTgiCiAgICAgaW5rc2NhcGU6d2luZG93LXg9Ii04IgogICAgIGlua3NjYXBlOmN5PSIxNDQuOTI4NiIKICAgICBpbmtzY2FwZTpjeD0iNjcuMDg0ODUzIgogICAgIGlua3NjYXBlOnpvb209IjAuNzkwMDQ0MjIiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlkPSJuYW1lZHZpZXc4NTMiCiAgICAgaW5rc2NhcGU6d2luZG93LWhlaWdodD0iMTAxNyIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjE5MjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTpwYWdlb3BhY2l0eT0iMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgZ3JpZHRvbGVyYW5jZT0iMTAiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBib3JkZXJvcGFjaXR5PSIxIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIHBhZ2Vjb2xvcj0iI2ZmZmZmZiIKICAgICBpbmtzY2FwZTpwYWdlY2hlY2tlcmJvYXJkPSIwIgogICAgIGlua3NjYXBlOmRvY3VtZW50LXVuaXRzPSJtbSIgLz4KICA8ZGVmcwogICAgIGlkPSJkZWZzMiI+CiAgICA8Y2xpcFBhdGgKICAgICAgIGNsaXBQYXRoVW5pdHM9InVzZXJTcGFjZU9uVXNlIgogICAgICAgaWQ9ImNsaXBQYXRoNDU2MyI+CiAgICAgIDxyZWN0CiAgICAgICAgIHN0eWxlPSJvcGFjaXR5OjE7ZmlsbDojZmYyYTJhO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDozLjQyNzE2NjQ2O3N0cm9rZS1taXRlcmxpbWl0OjQ7c3Ryb2tlLWRhc2hhcnJheTpub25lO3N0cm9rZS1vcGFjaXR5OjEiCiAgICAgICAgIGlkPSJyZWN0NDU2NSIKICAgICAgICAgd2lkdGg9IjgwLjY5NzkxNCIKICAgICAgICAgaGVpZ2h0PSI3Ni45OTM3NTIiCiAgICAgICAgIHg9Ijg0Ljc1ODIxNyIKICAgICAgICAgeT0iNjUuMTk2NjQ4IgogICAgICAgICByeD0iMTAiCiAgICAgICAgIHJ5PSIxMCIgLz4KICAgIDwvY2xpcFBhdGg+CiAgPC9kZWZzPgogIDxtZXRhZGF0YQogICAgIGlkPSJtZXRhZGF0YTUiPgogICAgPHJkZjpSREY+CiAgICAgIDxjYzpXb3JrCiAgICAgICAgIHJkZjphYm91dD0iIj4KICAgICAgICA8ZGM6Zm9ybWF0PmltYWdlL3N2Zyt4bWw8L2RjOmZvcm1hdD4KICAgICAgICA8ZGM6dHlwZQogICAgICAgICAgIHJkZjpyZXNvdXJjZT0iaHR0cDovL3B1cmwub3JnL2RjL2RjbWl0eXBlL1N0aWxsSW1hZ2UiIC8+CiAgICAgIDwvY2M6V29yaz4KICAgIDwvcmRmOlJERj4KICA8L21ldGFkYXRhPgogIDxnCiAgICAgaWQ9ImxheWVyMSIKICAgICB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtODQuNzU4MjE3LC02NS4yNDQxODMpIj4KICAgIDxnCiAgICAgICBpZD0iZzQ1NDMiCiAgICAgICBjbGlwLXBhdGg9InVybCgjY2xpcFBhdGg0NTYzKSI+CiAgICAgIDxwYXRoCiAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgIGlkPSJwYXRoNDUzMiIKICAgICAgICAgZD0ibSAxMjIuNjcxMDEsOTkuMDkwNTY2IDM0LjY3MTkyLC0zMy44NDYzODMgaCAyMy41NjQ0NSBsIC0zOC44NjA2OCwzNS44MTE3NjcgMjMuNDA5NDIsNDEuMTM0NDQgdiAwIEggMTQzLjU5NyBsIC0xNy4zMTE2MSwtMzEuMTYwODkgLTcuNDE0MDgsNi40NTc0MiIKICAgICAgICAgc3R5bGU9ImZvbnQtc3R5bGU6aXRhbGljO2ZvbnQtdmFyaWFudDpub3JtYWw7Zm9udC13ZWlnaHQ6Ym9sZDtmb250LXN0cmV0Y2g6bm9ybWFsO2ZvbnQtc2l6ZToxMDUuODMzcHg7bGluZS1oZWlnaHQ6MS4yNTtmb250LWZhbWlseTpzYW5zLXNlcmlmOy1pbmtzY2FwZS1mb250LXNwZWNpZmljYXRpb246J3NhbnMtc2VyaWYgQm9sZCBJdGFsaWMnO2xldHRlci1zcGFjaW5nOjBweDt3b3JkLXNwYWNpbmc6MHB4O2ZpbGw6IzVlMzViMTtmaWxsLW9wYWNpdHk6MTtzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MC4yNjQ1ODMiIC8+CiAgICAgIDxwYXRoCiAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgIGQ9Im0gMTE5LjkyOTY1LDExNi44MTcyNyBjIC0yLjEwMTUxLDkuMDI2MTUgLTYuMDQ2MTMsMTUuNzA5NjMgLTExLjgzMzkxLDIwLjA1MDQ1IC01Ljc4Nzc2LDQuMzQwODIgLTEzLjcxMTQ4LDYuNTExMjMgLTIzLjc3MTE1OSw2LjUxMTIzIC0zLjY4NjI1MiwwIC03LjAxMDc2OSwtMC4xMzc4IC05Ljk3MzU1MSwtMC40MTM0MSAtMi45NjI3ODMsLTAuMjQxMTUgLTUuNjE1NTA2LC0wLjYwMjg5IC03Ljk1ODE3MSwtMS4wODUyIGwgMy42NjkwMjcsLTE1LjI4NjUxIGMgNC41Njc1NzYsMC42NTExNyA5LjIxNjI0OSwxLjg4Njg3IDEzLjI4MDg0MywxLjkwMjMxIDUuMjcwOTk2LDAgOS4yMTU2MywtMS4yNTc0NiAxMS44MzM5MDUsLTMuNzcyMzggMi42MTgyNywtMi41MTQ5MiA0Ljc1NDIzLC03LjQwNjk2IDYuNDA3ODc2LC0xNC42NzYxMSBsIDcuMDc5NjgsLTMwLjY0NDEyNCBIIDkxLjA5NDE5NCBMIDk0LjM0OTgwOSw2NS4yNDQxODMgSCAxMzEuODY2OSBaIgogICAgICAgICBzdHlsZT0iZm9udC1zdHlsZTppdGFsaWM7Zm9udC12YXJpYW50Om5vcm1hbDtmb250LXdlaWdodDpib2xkO2ZvbnQtc3RyZXRjaDpub3JtYWw7Zm9udC1zaXplOjEwNS44MzNweDtsaW5lLWhlaWdodDoxLjI1O2ZvbnQtZmFtaWx5OnNhbnMtc2VyaWY7LWlua3NjYXBlLWZvbnQtc3BlY2lmaWNhdGlvbjonc2Fucy1zZXJpZiBCb2xkIEl0YWxpYyc7bGV0dGVyLXNwYWNpbmc6MHB4O3dvcmQtc3BhY2luZzowcHg7ZGlzcGxheTppbmxpbmU7ZmlsbDojMzExYjkyO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDowLjI2NDU4MyIKICAgICAgICAgaWQ9InBhdGg0NDg5IiAvPgogICAgPC9nPgogIDwvZz4KPC9zdmc+Cg==",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:et&&et.tagName.toUpperCase()==="SCRIPT"&&et.src||new URL("halov.umd.cjs",document.baseURI).href).href}},setup(t){const l=t,o=e.ref(l.src);e.watch(()=>l.src,r=>{o.value=r});function n(){o.value=l.defaultSrc}return(r,a)=>(e.openBlock(),e.createElementBlock("img",{src:o.value,style:e.normalizeStyle({height:t.height,objectFit:"contain"}),onError:n,alt:"App Logo"},null,44,ul))}}),re=(t,l)=>{const o=t.__vccOpts||t;for(const[n,r]of l)o[n]=r;return o},Jt=re(pl,[["__scopeId","data-v-f7799232"]]);function ml(){try{const t=sessionStorage.getItem("tabs");return t?JSON.parse(t):null}catch{return null}}const nt=Ae.defineStore("tabs",{state:()=>({tabs:ml(),selectedTab:sessionStorage.getItem("selectedTab")}),actions:{setTabs(t){this.tabs=t,t?(sessionStorage.setItem("tabs",JSON.stringify(t)),t.length||this.setSelectedTab(null)):(sessionStorage.removeItem("tabs"),this.setSelectedTab(null))},setSelectedTab(t){this.selectedTab=t,t?sessionStorage.setItem("selectedTab",t):sessionStorage.removeItem("selectedTab")},addTab(t){let l=this.tabs;l?l.find(o=>o.id==t.id)||l.push(t):l=[t],this.setTabs(l),this.setSelectedTab(t.id)},selectTab(t){this.setSelectedTab(t)},closeTab(t){const l=this.tabs;if(l){const o=l.findIndex(n=>n.id==t);o>-1&&(l.splice(o,1),this.setTabs(l))}},changeTabId(t,l){const o=this.tabs;if(o){const n=o.find(r=>r.id==t);n&&!o.find(r=>r.id==l)&&(n.id=l,this.setTabs(o))}},clearTabs(){this.setTabs([]),this.setSelectedTab(null)}}});var hl=typeof global=="object"&&global&&global.Object===Object&&global,gl=typeof self=="object"&&self&&self.Object===Object&&self,yl=hl||gl||Function("return this")(),be=yl.Symbol,qt=Object.prototype,wl=qt.hasOwnProperty,Cl=qt.toString,Ee=be?be.toStringTag:void 0;function bl(t){var l=wl.call(t,Ee),o=t[Ee];try{t[Ee]=void 0;var n=!0}catch{}var r=Cl.call(t);return n&&(l?t[Ee]=o:delete t[Ee]),r}var kl=Object.prototype,Nl=kl.toString;function xl(t){return Nl.call(t)}var Sl="[object Null]",Il="[object Undefined]",Ut=be?be.toStringTag:void 0;function Bl(t){return t==null?t===void 0?Il:Sl:Ut&&Ut in Object(t)?bl(t):xl(t)}function Vl(t){return t!=null&&typeof t=="object"}var Ml="[object Symbol]";function Tl(t){return typeof t=="symbol"||Vl(t)&&Bl(t)==Ml}function Al(t,l){for(var o=-1,n=t==null?0:t.length,r=Array(n);++o<n;)r[o]=l(t[o],o,t);return r}var El=Array.isArray,vt=be?be.prototype:void 0,eo=vt?vt.toString:void 0;function to(t){if(typeof t=="string")return t;if(El(t))return Al(t,to)+"";if(Tl(t))return eo?eo.call(t):"";var l=t+"";return l=="0"&&1/t==-1/0?"-0":l}function lt(t){return t==null?"":to(t)}function _l(t,l,o){var n=-1,r=t.length;l<0&&(l=-l>r?0:r+l),o=o>r?r:o,o<0&&(o+=r),r=l>o?0:o-l>>>0,l>>>=0;for(var a=Array(r);++n<r;)a[n]=t[n+l];return a}function Ll(t,l,o){var n=t.length;return o=o===void 0?n:o,!l&&o>=n?t:_l(t,l,o)}var zl="\\ud800-\\udfff",Dl="\\u0300-\\u036f",$l="\\ufe20-\\ufe2f",Rl="\\u20d0-\\u20ff",Ol=Dl+$l+Rl,jl="\\ufe0e\\ufe0f",Pl="\\u200d",Fl=RegExp("["+Pl+zl+Ol+jl+"]");function oo(t){return Fl.test(t)}function Hl(t){return t.split("")}var no="\\ud800-\\udfff",Gl="\\u0300-\\u036f",Kl="\\ufe20-\\ufe2f",Wl="\\u20d0-\\u20ff",Zl=Gl+Kl+Wl,Yl="\\ufe0e\\ufe0f",Ql="["+no+"]",rt="["+Zl+"]",at="\\ud83c[\\udffb-\\udfff]",Xl="(?:"+rt+"|"+at+")",lo="[^"+no+"]",ro="(?:\\ud83c[\\udde6-\\uddff]){2}",ao="[\\ud800-\\udbff][\\udc00-\\udfff]",Jl="\\u200d",so=Xl+"?",io="["+Yl+"]?",ql="(?:"+Jl+"(?:"+[lo,ro,ao].join("|")+")"+io+so+")*",Ul=io+so+ql,vl="(?:"+[lo+rt+"?",rt,ro,ao,Ql].join("|")+")",er=RegExp(at+"(?="+at+")|"+vl+Ul,"g");function tr(t){return t.match(er)||[]}function or(t){return oo(t)?tr(t):Hl(t)}function nr(t){return function(l){l=lt(l);var o=oo(l)?or(l):void 0,n=o?o[0]:l.charAt(0),r=o?Ll(o,1).join(""):l.slice(1);return n[t]()+r}}var lr=nr("toUpperCase");function rr(t,l,o,n){for(var r=-1,a=t==null?0:t.length;++r<a;)o=l(o,t[r],r,t);return o}function ar(t){return function(l){return t==null?void 0:t[l]}}var sr={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},ir=ar(sr),cr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,dr="\\u0300-\\u036f",fr="\\ufe20-\\ufe2f",ur="\\u20d0-\\u20ff",pr=dr+fr+ur,mr="["+pr+"]",hr=RegExp(mr,"g");function gr(t){return t=lt(t),t&&t.replace(cr,ir).replace(hr,"")}var yr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function wr(t){return t.match(yr)||[]}var Cr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function br(t){return Cr.test(t)}var co="\\ud800-\\udfff",kr="\\u0300-\\u036f",Nr="\\ufe20-\\ufe2f",xr="\\u20d0-\\u20ff",Sr=kr+Nr+xr,fo="\\u2700-\\u27bf",uo="a-z\\xdf-\\xf6\\xf8-\\xff",Ir="\\xac\\xb1\\xd7\\xf7",Br="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Vr="\\u2000-\\u206f",Mr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",po="A-Z\\xc0-\\xd6\\xd8-\\xde",Tr="\\ufe0e\\ufe0f",mo=Ir+Br+Vr+Mr,ho="['’]",go="["+mo+"]",Ar="["+Sr+"]",yo="\\d+",Er="["+fo+"]",wo="["+uo+"]",Co="[^"+co+mo+yo+fo+uo+po+"]",_r="\\ud83c[\\udffb-\\udfff]",Lr="(?:"+Ar+"|"+_r+")",zr="[^"+co+"]",bo="(?:\\ud83c[\\udde6-\\uddff]){2}",ko="[\\ud800-\\udbff][\\udc00-\\udfff]",ke="["+po+"]",Dr="\\u200d",No="(?:"+wo+"|"+Co+")",$r="(?:"+ke+"|"+Co+")",xo="(?:"+ho+"(?:d|ll|m|re|s|t|ve))?",So="(?:"+ho+"(?:D|LL|M|RE|S|T|VE))?",Io=Lr+"?",Bo="["+Tr+"]?",Rr="(?:"+Dr+"(?:"+[zr,bo,ko].join("|")+")"+Bo+Io+")*",Or="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Pr=Bo+Io+Rr,Fr="(?:"+[Er,bo,ko].join("|")+")"+Pr,Hr=RegExp([ke+"?"+wo+"+"+xo+"(?="+[go,ke,"$"].join("|")+")",$r+"+"+So+"(?="+[go,ke+No,"$"].join("|")+")",ke+"?"+No+"+"+xo,ke+"+"+So,jr,Or,yo,Fr].join("|"),"g");function Gr(t){return t.match(Hr)||[]}function Kr(t,l,o){return t=lt(t),l=l,l===void 0?br(t)?Gr(t):wr(t):t.match(l)||[]}var Wr="['’]",Zr=RegExp(Wr,"g");function Yr(t){return function(l){return rr(Kr(gr(l).replace(Zr,"")),t,"")}}var Qr=Yr(function(t,l,o){return t+(o?" ":"")+lr(l)});const _e="YYYY/MM/DD HH:mm:ss",ge="YYYY/MM/DD",Le="HH:mm:ss";function te(t){return t.length?Qr(t):t}function de(t){if(t!=null){if(typeof t=="boolean"||t instanceof Boolean)return t;if(typeof t=="number"||typeof t=="bigint")return t>0;if(typeof t=="string"||typeof t=="object")switch(t==null?void 0:t.toString().toLowerCase().trim()){case"true":case"yes":case"1":case"y":return!0;case"false":case"no":case"0":case"n":return!1}else if(typeof t=="function"){const l=t.call(null);if(l)return de(l)}}}function Re(t,l){const o=de(t);return o===void 0?l||!1:o}function Vo(t,l){if(t!=null){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t);if(typeof t=="string")return se(t,l||_e).toDate()}}function Mo(t){return typeof t=="object"&&t!==null&&"hour"in t&&"minute"in t}function Xr(t){const l=t%1e3;t/=1e3;const o=t%60;t/=60;const n=t%60;return t/=60,{hour:t%24,minute:n,second:o,millisecond:l}}function To(t){const l=t%60;t/=60;const o=t%60;return t/=60,{hour:t%24,minute:o,second:l,millisecond:0}}function Ao(t,l){const o=se(t,l||Le);if(o)return{hour:o.hour(),minute:o.minute(),second:o.second(),millisecond:o.millisecond()}}function Eo(t,l){var o,n;if(t){if(typeof t=="string")return(n=(o=se(t,l||_e))==null?void 0:o.toDate())==null?void 0:n.getTime();if(typeof t=="number")return t;if(t instanceof Date)return t.getTime()}}function _o(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return se(new Date(t)).format(l||Le);if(t instanceof Date)return se(t).format(l||Le);if(Mo(t))return se(new Date(2e3,1,1,t.hour,t.minute,t.second)).format(l||Le);if(typeof t=="object")return t==null?void 0:t.toString()}}function Lo(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return se(new Date(t)).format(l||ge);if(t instanceof Date)return se(t).format(l||ge);if(typeof t=="object")return t==null?void 0:t.toString()}}function st(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return se(new Date(t)).format(l||_e);if(t instanceof Date)return se(t).format(l||_e);if(typeof t=="object")return t==null?void 0:t.toString()}}function zo(t){if(t){const l=t.lastIndexOf(":");if(l>-1&&l<t.length-1)return t.substring(0,l+1)+Math.round(Number(t.substring(l+1,t.length)))}return t}function Do(t){const l={},o=t.split("&").map(n=>n.trim()).filter(n=>n);for(const n of o){let r,a;const c=n.indexOf("=");if(c>-1?(r=n.substring(0,c),a=n.substring(c+1)):r=n,r in l){if(a){const f=l[r];Array.isArray(f)?f.push(a):f?l[r]=[f,a]:l[r]=a}}else l[r]=a}return l}function Jr(t,l){let o=t;if(l){const n=[];for(const r in l){const a=l[r];if(Array.isArray(a))for(const c of a)n.push(`${r}=${encodeURIComponent(c)}`);else a?n.push(`${r}=${encodeURIComponent(a)}`):n.push(r)}n.length&&(o+="?"+n.join("&"))}return o}function U(t,l,o=!0){if(!l||Object.keys(l).length==0)return t;let n=t,r={};const a=t.indexOf("?");a>-1&&(n=t.substring(0,a),r=Do(t.substring(a+1)));let c={};const f=Array.isArray(l)?l:[l];for(let g of f)if(g)if(typeof g=="string")c=Do(g);else for(const i in g){const s=g[i];Array.isArray(s)?c[i]=s.map(m=>m==null?void 0:m.toString()):s!=null?c[i]=s.toString():c[i]=void 0}else continue;if(Object.keys(c).length==0)return t;if(r.length)for(const g in c)if(g in r&&!o){const i=r[g],s=c[g];Array.isArray(i)?Array.isArray(s)?i.push(...s):i.push(s):i?Array.isArray(s)?r[g]=[i,...s]:r[g]=[i,s]:r[g]=c[g]}else r[g]=c[g];else for(const g in c)r[g]=c[g];return Jr(n,r)}function Oe(t,l,o){if(t==null)return t;switch(l){case"number":return Number(t);case"boolean":case"bool":return de(t);case"date":case"datetime":return st(t);default:return o&&typeof t=="string"&&(o.includes("code-u")?t=t.toUpperCase():o.includes("code-l")&&(t=t.toLowerCase())),t}}function $o(t){switch(t){case"number":return 0;case"boolean":case"bool":return!1;case"date":case"datetime":return new Date}}function qr(){return new Date().getTime().toString()}function Ur(t,l){const o={};if(t)if(l)for(const n of l)typeof n=="string"?o[te(n)]=t[n]:o[te(n.name)]=t[n.name];else for(const n in t)o[te(n)]=t[n];return o}function vr(t,l){return se(t,ge).add(l,"days").format(ge)}function ea(t,l){if(!t||!l){const o=new Date;t||(t=o.getFullYear()),l||(l=o.getMonth())}return new Date(t,l,1)}function ta(t,l){if(!t||!l){const o=new Date;t||(t=o.getFullYear()),l||(l=o.getMonth())}return new Date(t,l+1,0)}function oa(t,l=!0,o=!0){var r,a;let n=(a=(r=t==null?void 0:t.split(/\s*,\s*|\r?\n+/))==null?void 0:r.map(c=>c.trim()))==null?void 0:a.filter(c=>!l||c.length>0);return n&&o&&(n=n.filter((c,f,g)=>c&&g.indexOf(c)==f)),n}function na(t,l=!0,o=!0){var r,a;let n=(a=(r=t==null?void 0:t.split(/\r?\n/))==null?void 0:r.map(c=>c.trim()))==null?void 0:a.filter(c=>!l||c.length>0);return n&&o&&(n=n.filter((c,f,g)=>c&&g.indexOf(c)==f)),n}function la(t){const l=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return!!t.toLowerCase().match(l)}function Ro(t,l=!1){switch(typeof t){case"number":return l?Math.max(0,Math.max(100,t*100)):t*100;case"string":const o=t.indexOf("%");if(o>-1){t=t.substring(0,o-1);const n=Number(t);if(!Number.isNaN(n))return l?Math.max(0,Math.max(100,n)):n}else{const n=Number(t);if(!Number.isNaN(n))return l?Math.max(0,Math.max(100,n*100)):n*100}}}function Oo(t){return t==null?!0:/^\s*$/.test(t)}function ra(t,l){return Oo(t)?l:t}const Ne=Ae.defineStore("common",{state:()=>({themeName:localStorage.getItem("theme"),menuCollapsed:Re(localStorage.getItem("menu-collapsed")),isFullscreen:!1,sharedData:{}}),getters:{isDarkTheme:t=>t.themeName=="darkTheme"},actions:{toggleTheme(){this.themeName=="darkTheme"?this.setThemeName(null):this.setThemeName("darkTheme")},setThemeName(t){this.themeName=t,t?localStorage.setItem("theme",t):localStorage.removeItem("theme")},setMenuCollapsed(t){this.menuCollapsed=t,localStorage.setItem("menu-collapsed",t.toString())},setIsFullscreen(t){this.isFullscreen=t},async fetchSharedData(t,l){let o=this.sharedData[t];if(o||(o={key:t,isLoading:!1,data:void 0,error:void 0,promise:void 0},this.sharedData[t]=o),o.data!==void 0)return o.data;if(o.isLoading&&o.promise)return o.promise;try{o.isLoading=!0,o.promise=l();const n=await o.promise;return o.data=n,o.isLoading=!1,o.promise=void 0,n}catch(n){throw o.isLoading=!1,o.error=n,o.promise=void 0,n}}}}),aa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},sa=e.defineComponent({name:"ArrowDropDownOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",aa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M7 10l5 5l5-5H7z",fill:"currentColor"},null,-1)]))}}),ia={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ca=e.defineComponent({name:"CheckFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ia,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z",fill:"currentColor"},null,-1)]))}}),da={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},jo=e.defineComponent({name:"ClearFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",da,o[0]||(o[0]=[e.createElementVNode("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z",fill:"currentColor"},null,-1)]))}}),fa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ua=e.defineComponent({name:"CloseOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",fa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z",fill:"currentColor"},null,-1)]))}}),pa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ma=e.defineComponent({name:"ColorizeFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",pa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M20.71 5.63l-2.34-2.34a.996.996 0 0 0-1.41 0l-3.12 3.12l-1.93-1.91l-1.41 1.41l1.42 1.42L3 16.25V21h4.75l8.92-8.92l1.42 1.42l1.41-1.41l-1.92-1.92l3.12-3.12c.4-.4.4-1.03.01-1.42zM6.92 19L5 17.08l8.06-8.06l1.92 1.92L6.92 19z",fill:"currentColor"},null,-1)]))}}),ha={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ga=e.defineComponent({name:"DarkModeOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ha,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9.37 5.51A7.35 7.35 0 0 0 9.1 7.5c0 4.08 3.32 7.4 7.4 7.4c.68 0 1.35-.09 1.99-.27A7.014 7.014 0 0 1 12 19c-3.86 0-7-3.14-7-7c0-2.93 1.81-5.45 4.37-6.49zM12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 0 1-4.4 2.26a5.403 5.403 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z",fill:"currentColor"},null,-1)]))}}),ya={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Po=e.defineComponent({name:"EditFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ya,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a.996.996 0 0 0 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83l3.75 3.75l1.83-1.83z",fill:"currentColor"},null,-1)]))}}),wa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ca=e.defineComponent({name:"ExpandLessFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",wa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 8l-6 6l1.41 1.41L12 10.83l4.59 4.58L18 14z",fill:"currentColor"},null,-1)]))}}),ba={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ka=e.defineComponent({name:"ExpandMoreFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ba,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16.59 8.59L12 13.17L7.41 8.59L6 10l6 6l6-6z",fill:"currentColor"},null,-1)]))}}),Na={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Fo=e.defineComponent({name:"FolderTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Na,o[0]||(o[0]=[e.createElementVNode("path",{opacity:".3",d:"M11.17 8l-.58-.59L9.17 6H4v12h16V8h-8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l1.41 1.41l.59.59H20v10z",fill:"currentColor"},null,-1)]))}}),xa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Sa=e.defineComponent({name:"FullscreenExitFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",xa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z",fill:"currentColor"},null,-1)]))}}),Ia={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ba=e.defineComponent({name:"FullscreenFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ia,o[0]||(o[0]=[e.createElementVNode("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",fill:"currentColor"},null,-1)]))}}),Va={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ma=e.defineComponent({name:"ImportExportFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Va,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z",fill:"currentColor"},null,-1)]))}}),Ta={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Aa=e.defineComponent({name:"LogOutFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ta,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 2h9a2 2 0 0 1 2 2v2h-2V4H6v16h9v-2h2v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M16.09 15.59L17.5 17l5-5l-5-5l-1.41 1.41L18.67 11H9v2h9.67z",fill:"currentColor"},null,-1)]))}}),Ea={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},_a=e.defineComponent({name:"ManageAccountsOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ea,o[0]||(o[0]=[e.createElementVNode("path",{d:"M4 18v-.65c0-.34.16-.66.41-.81C6.1 15.53 8.03 15 10 15c.03 0 .05 0 .08.01c.1-.7.3-1.37.59-1.98c-.22-.02-.44-.03-.67-.03c-2.42 0-4.68.67-6.61 1.82c-.88.52-1.39 1.5-1.39 2.53V20h9.26c-.42-.6-.75-1.28-.97-2H4zm6-6c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2s-2-.9-2-2s.9-2 2-2zm10.75 10c0-.22-.03-.42-.06-.63l1.14-1.01l-1-1.73l-1.45.49c-.32-.27-.68-.48-1.08-.63L18 11h-2l-.3 1.49c-.4.15-.76.36-1.08.63l-1.45-.49l-1 1.73l1.14 1.01c-.03.21-.06.41-.06.63s.03.42.06.63l-1.14 1.01l1 1.73l1.45-.49c.32.27.68.48 1.08.63L16 21h2l.3-1.49c.4-.15.76-.36 1.08-.63l1.45.49l1-1.73l-1.14-1.01c.03-.21.06-.41.06-.63zM17 18c-1.1 0-2-.9-2-2s.9-2 2-2s2 .9 2 2s-.9 2-2 2z",fill:"currentColor"},null,-1)]))}}),La={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},it=e.defineComponent({name:"MenuFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",La,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z",fill:"currentColor"},null,-1)]))}}),za={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Da=e.defineComponent({name:"MenuOpenFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",za,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 18h13v-2H3v2zm0-5h10v-2H3v2zm0-7v2h13V6H3zm18 9.59L17.42 12L21 8.41L19.59 7l-5 5l5 5L21 15.59z",fill:"currentColor"},null,-1)]))}}),$a={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ra=e.defineComponent({name:"MoreHorizFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",$a,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z",fill:"currentColor"},null,-1)]))}}),Oa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ja=e.defineComponent({name:"NotificationsNoneTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Oa,o[0]||(o[0]=[e.createElementVNode("path",{opacity:".3",d:"M12 6.5c-2.49 0-4 2.02-4 4.5v6h8v-6c0-2.48-1.51-4.5-4-4.5z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 16v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5v6zm-4 5c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2z",fill:"currentColor"},null,-1)]))}}),Pa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Fa=e.defineComponent({name:"PasswordFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Pa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M2 17h20v2H2v-2zm1.15-4.05L4 11.47l.85 1.48l1.3-.75l-.85-1.48H7v-1.5H5.3l.85-1.47L4.85 7L4 8.47L3.15 7l-1.3.75l.85 1.47H1v1.5h1.7l-.85 1.48l1.3.75zm6.7-.75l1.3.75l.85-1.48l.85 1.48l1.3-.75l-.85-1.48H15v-1.5h-1.7l.85-1.47l-1.3-.75L12 8.47L11.15 7l-1.3.75l.85 1.47H9v1.5h1.7l-.85 1.48zM23 9.22h-1.7l.85-1.47l-1.3-.75L20 8.47L19.15 7l-1.3.75l.85 1.47H17v1.5h1.7l-.85 1.48l1.3.75l.85-1.48l.85 1.48l1.3-.75l-.85-1.48H23v-1.5z",fill:"currentColor"},null,-1)]))}}),Ha={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ga=e.defineComponent({name:"PlaylistAddCheckTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ha,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 10h11v2H3zm0-4h11v2H3zm0 8h7v2H3zm17.59-2.07l-4.25 4.24l-2.12-2.12l-1.41 1.41L16.34 19L22 13.34z",fill:"currentColor"},null,-1)]))}}),Ka={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Wa=e.defineComponent({name:"PlaylistAddFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ka,o[0]||(o[0]=[e.createElementVNode("path",{d:"M14 10H3v2h11v-2zm0-4H3v2h11V6zm4 8v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM3 16h7v-2H3v2z",fill:"currentColor"},null,-1)]))}}),Za={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ya=e.defineComponent({name:"PrintTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Za,o[0]||(o[0]=[e.createElementVNode("path",{opacity:".3",d:"M8 5h8v3H8z",fill:"currentColor"},null,-1),e.createElementVNode("circle",{cx:"18",cy:"11.5",r:"1",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M19 8h-1V3H6v5H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zM8 5h8v3H8V5zm8 14H8v-4h8v4zm4-4h-2v-2H6v2H4v-4c0-.55.45-1 1-1h14c.55 0 1 .45 1 1v4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{opacity:".3",d:"M6 13h12v2h2v-4c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1v4h2v-2zm12-2.5c.55 0 1 .45 1 1s-.45 1-1 1s-1-.45-1-1s.45-1 1-1z",fill:"currentColor"},null,-1)]))}}),Qa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Xa=e.defineComponent({name:"ReadMoreFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Qa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 7h9v2h-9zm0 8h9v2h-9zm3-4h6v2h-6zm-3 1L8 7v4H2v2h6v4z",fill:"currentColor"},null,-1)]))}}),Ja={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},je=e.defineComponent({name:"RefreshFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ja,o[0]||(o[0]=[e.createElementVNode("path",{d:"M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",fill:"currentColor"},null,-1)]))}}),qa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},pe=e.defineComponent({name:"SearchFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",qa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z",fill:"currentColor"},null,-1)]))}}),Ua={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},va=e.defineComponent({name:"UnarchiveOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ua,o[0]||(o[0]=[e.createElementVNode("path",{d:"M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM6.24 5h11.52l.83 1H5.42l.82-1zM5 19V8h14v11H5zm3-5h2.55v3h2.9v-3H16l-4-4z",fill:"currentColor"},null,-1)]))}}),Ho={rootMenuName:"MainMenu",menuPosition:"side"},ct=Symbol("HalovConfig");function dt(){return e.inject(ct)}const es=["src"],xe=e.defineComponent({__name:"MenuIcon",props:{path:{},size:{default:16}},setup(t){const l=t,o=e.ref(n(l.path));function n(r){if(r)return`/api/core/SystemIcons/Icons?path=${encodeURIComponent(r)}`}return e.watch(()=>l.path,r=>o.value=n(r)),(r,a)=>o.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"menu-icon",src:o.value,style:e.normalizeStyle({width:r.size+"px",height:r.size+"px"})},null,12,es)):e.createCommentVNode("",!0)}}),Go=re(e.defineComponent({__name:"AppTabs",props:{tabs:{default:()=>[]},currentTab:{}},emits:["update:currentTab","closeTab","closeAll","closeOthers"],setup(t,{emit:l}){var x;const o=t,n=l,{t:r}=Z(),a=nt(),c=Ne(),f=e.computed(()=>c.menuCollapsed),g=((x=dt())==null?void 0:x.menuPosition)??"side",i=()=>c.setMenuCollapsed(!c.menuCollapsed),s=e.ref(o.currentTab),m=e.computed(()=>[{label:r("Close"),key:"close-current"},{label:r("Close All"),key:"close-all"},{label:r("Close Others"),key:"close-others"},{type:"divider",key:"------------1"},...o.tabs.map(S=>({label:r(S.title),key:S.id,url:S.url}))]);function d(S){o.tabs.find(T=>T.id==S)&&a.closeTab(S),n("closeTab",S)}function h(S){if(S.key=="close-current"||S.key=="close-all"||S.key=="close-others")return e.h(u.NIcon,null,{default:()=>e.h(ua)});if(S.key&&S.key==s.value)return e.h(u.NIcon,null,{default:()=>e.h(ca)})}function b(S){if(typeof S=="string"&&S)switch(S){case"close-current":n("closeTab",s.value);break;case"close-all":n("closeAll");break;case"close-others":n("closeOthers",s.value);break;default:s.value=S;break}}return e.watch(()=>o.currentTab,S=>{s.value=S}),e.watch(s,S=>{S!=o.currentTab&&n("update:currentTab",S)}),(S,P)=>S.tabs.length?(e.openBlock(),e.createBlock(e.unref(u.NTabs),{key:0,type:"card",closable:"",onClose:d,"tab-style":"min-width: 80px;",value:s.value,"onUpdate:value":P[0]||(P[0]=T=>s.value=T)},{prefix:e.withCtx(()=>[e.renderSlot(S.$slots,"prefix",{},()=>[e.unref(g)=="side"?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,text:"",style:{"margin-left":"8px"},onClick:i,title:f.value?e.unref(r)("Expand Menu"):e.unref(r)("Collapse Menu")},{icon:e.withCtx(()=>[f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(Da),{key:0})),f.value?(e.openBlock(),e.createBlock(e.unref(it),{key:1})):e.createCommentVNode("",!0)]),_:1},8,["title"])):e.createCommentVNode("",!0)],!0)]),suffix:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{text:"",style:{"font-size":"24px"}},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NDropdown),{trigger:"click",options:m.value,placement:"bottom-end",onSelect:b,"render-icon":h},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(sa))]),_:1})]),_:1},8,["options"])]),_:1})]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.tabs,T=>(e.openBlock(),e.createBlock(e.unref(u.NTab),{key:T.id,name:T.id,title:T.id,closable:T.closable,class:"app-tab-item",style:e.normalizeStyle({"border-top-color":T.color})},{default:e.withCtx(()=>[T.icon?(e.openBlock(),e.createBlock(xe,{key:0,path:T.icon,style:{"margin-right":"4px"}},null,8,["path"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(r)(T.title)),1)]),_:2},1032,["name","title","closable","style"]))),128))]),_:3},8,["value"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-df170cc3"]]),ts=e.defineComponent({props:{direction:{type:String,default:"Right"},step:{type:Number,default:1},intervalFrames:{type:Number,default:1}},setup(t){const l=e.ref(void 0);let o=0;function n(){const c=l.value;if(c){const f=t.step||1;switch(t.direction){case"Left":c.scrollWidth>c.clientWidth&&(c.scrollLeft+c.clientWidth>c.scrollWidth-3?c.scrollLeft=0:c.scrollLeft+=f);break;case"Bottom":c.scrollHeight>c.clientHeight&&(c.scrollTop<3?c.scrollTop=c.scrollHeight:c.scrollTop-=f);break;case"Top":c.scrollHeight>c.clientHeight&&(c.scrollTop+c.clientHeight>c.scrollHeight-3?c.scrollTop=0:c.scrollTop+=f);break;case"Right":default:c.scrollWidth>c.clientWidth&&(c.scrollLeft<3?c.scrollLeft=c.scrollWidth:c.scrollLeft-=f);break}}}function r(){o++,o>1e8&&(o=0);let c=t.intervalFrames||1;c<=0&&(c=1),o%c==0&&n(),l.value&&requestAnimationFrame(r)}function a(){const c=l.value;if(c){switch(t.direction){case"Left":c.scrollLeft=0;break;case"Bottom":c.scrollTop=c.scrollHeight;break;case"Top":c.scrollTop=0;break;case"Right":default:c.scrollLeft=c.scrollWidth;break}c.addEventListener("resize",()=>{console.log("resize me.")})}}return e.onMounted(()=>{a(),requestAnimationFrame(r)}),e.watch(()=>t.direction,()=>a()),{areaRef:l}}}),os={ref:"areaRef",style:{overflow:"hidden"}};function ns(t,l,o,n,r,a){return e.openBlock(),e.createElementBlock("div",os,[e.renderSlot(t.$slots,"default")],512)}const Ko=re(ts,[["render",ns]]);function Wo(t,l){let o=`/api/core/Barcode/${l.render=="svg"?"Svg":"Image"}?code=${encodeURIComponent(t)}&format=${l.format||"QR_CODE"}`;return l.width&&(o+=`&width=${l.width}`),l.height&&(o+=`&height=${l.height}`),l.showText&&(o+=`&showText=${l.showText}`),l.base64&&(o+=`&base64=${l.base64}`),l.backColor&&(o+=`&backColor=${encodeURIComponent(l.backColor)}`),l.foreColor&&(o+=`&foreColor=${encodeURIComponent(l.foreColor)}`),l.fontSize&&(o+=`&fontSize=${l.fontSize}`),l.margin&&(o+=`&margin=${encodeURIComponent(l.margin)}`),l.gs1Format&&(o+=`&gs1Format=${l.gs1Format}`),o}const Zo=e.defineComponent({__name:"BarcodeImage",props:{code:{},render:{},format:{},width:{},height:{},showText:{type:Boolean},base64:{type:Boolean},backColor:{},foreColor:{},fontSize:{},margin:{},gs1Format:{type:Boolean}},setup(t){const l=t,o=e.ref(void 0),n=()=>{o.value=Wo(l.code||"",{render:l.render,format:l.format,width:l.width,height:l.height,showText:l.showText,base64:l.base64,backColor:l.backColor,foreColor:l.foreColor,fontSize:l.fontSize,margin:l.margin,gs1Format:l.gs1Format})};return e.watch([l.render,l.code,l.format,l.width,l.height,l.showText,l.base64,l.backColor,l.foreColor,l.fontSize,l.margin,l.gs1Format],()=>n()),e.onMounted(()=>n()),(r,a)=>(e.openBlock(),e.createBlock(e.unref(u.NImage),{src:o.value,width:r.width,height:r.height},null,8,["src","width","height"]))}});function Yo(t){for(const l of t)l.guid&&(l.guid=l.guid.toLowerCase()),l.items&&Yo(l.items)}function ls(){try{const t=localStorage.getItem("userInfo");return t?JSON.parse(t):null}catch{return null}}const Se=Ae.defineStore("account",()=>{const t=e.reactive({userInfo:ls(),lastUserName:localStorage.getItem("lastUserName"),sessionToken:localStorage.getItem("sessionToken"),isLoadingMenu:!1,menus:null,messages:JSON.parse(localStorage.getItem("_msgs")??"[]")}),l=m=>{t.sessionToken=m,m?localStorage.setItem("sessionToken",m):localStorage.removeItem("sessionToken")},o=m=>{t.lastUserName=m,m?localStorage.setItem("lastUserName",m):localStorage.removeItem("lastUserName")},n=m=>{t.userInfo=m,m?localStorage.setItem("userInfo",JSON.stringify(m)):localStorage.removeItem("userInfo")},r=m=>{t.userInfo&&(t.userInfo.avatar=m,localStorage.setItem("userInfo",JSON.stringify(t.userInfo)))},a=()=>{t.userInfo=null,localStorage.removeItem("userInfo"),localStorage.removeItem("_msgs")},c=m=>{t.menus=m},f=m=>{t.isLoadingMenu=m},g=()=>{localStorage.removeItem("userInfo"),localStorage.removeItem("sessionToken"),a(),c(null),localStorage.removeItem("_msgs")},i=async m=>{var d;f(!0);try{m||(m=((d=dt())==null?void 0:d.rootMenuName)??"MainMenu");const h=await le.get(`/api/core/account/menus?rootName=${encodeURIComponent(m)}`);if(h.isSuccess){const b=h.value||[];Yo(b),c(b)}else console.log(h.errorMessage||"get remote menus error.")}catch(h){console.log(h)}finally{f(!1)}},s=m=>{t.messages.push(m),localStorage.setItem("_msgs",JSON.stringify(t.messages))};return{...e.toRefs(t),setSession:l,setLastUserName:o,setUser:n,setAvatar:r,clearUser:a,setMenus:c,setIsLoadingMenu:f,logout:g,loadMenus:i,addMessage:s}}),rs={key:0,style:{"padding-left":"1rem"}},ft=e.defineComponent({__name:"ChangePassword",props:{show:{type:Boolean}},emits:["close"],setup(t,{emit:l}){const o=l,{t:n}=Z(),r=u.useMessage(),a=e.inject("axios"),c=Se(),f=e.ref({oldPassword:"",newPassword:"",confirmPassword:""}),g=e.ref(!1),i=e.ref(null),s=e.computed(()=>{var S;return(S=c.userInfo)==null?void 0:S.userName}),m=e.ref([]),d={oldPassword:[{required:!0,message:n("Required here.")}],newPassword:[{required:!0,message:n("Required here.")}],confirmPassword:[{required:!0,message:n("Required here.")}]};function h(){var S;s.value&&!g.value&&i.value&&((S=i.value)==null||S.validate(P=>{if(!P)if(f.value.confirmPassword!=f.value.newPassword){r.error(n("Confirm the password is inconsistent, please check and re-enter."));return}else if(f.value.newPassword==f.value.oldPassword){r.error(n("The new password must not be the same as the old password!"));return}else b(s.value,f.value.oldPassword,f.value.newPassword)}))}async function b(S,P,T){try{const k={userName:S,oldPassword:P,newPassword:T},N=await a.post("/api/core/account/changePassword",k);N.isSuccess?(r.success(n("Password has been successfully modified!")),o("close")):r.error(n(N.errorMessage||"Error"))}catch(k){r.error((k==null?void 0:k.toString())||n("Error"))}}async function x(){try{const S=await a.get("/api/core/system/passwordOptions");S.isSuccess&&S.value!=null?m.value=S.value:r.error(n(S.errorMessage||"Error"))}catch(S){console.error(S),r.error((S==null?void 0:S.toString())||n("Error"))}}return e.onMounted(()=>{x()}),(S,P)=>{const T=e.resolveComponent("n-input"),k=e.resolveComponent("n-form-item"),N=e.resolveComponent("n-spin"),V=e.resolveComponent("n-text"),E=e.resolveComponent("n-button"),O=e.resolveComponent("n-modal");return e.openBlock(),e.createBlock(O,{show:S.show,onClose:P[3]||(P[3]=()=>S.$emit("close")),class:"custom-card",title:e.unref(n)("Change Password"),style:{width:"300px"},preset:"card",size:"medium"},{footer:e.withCtx(()=>[m.value.length?(e.openBlock(),e.createElementBlock("ul",rs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,j=>(e.openBlock(),e.createElementBlock("li",{key:j},[e.createVNode(V,{depth:"3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(j),1)]),_:2},1024)]))),128))])):e.createCommentVNode("",!0)]),action:e.withCtx(()=>[e.createVNode(E,{type:"primary",block:"",onClick:h},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("OK")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NForm),{model:f.value,ref_key:"formRef",ref:i,rules:d},{default:e.withCtx(()=>[e.createVNode(N,{show:g.value},{default:e.withCtx(()=>[e.createVNode(k,{label:e.unref(n)("User Name")},{default:e.withCtx(()=>[e.createVNode(T,{value:s.value,readonly:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(k,{path:"oldPassword",label:e.unref(n)("Old Password")},{default:e.withCtx(()=>[e.createVNode(T,{value:f.value.oldPassword,"onUpdate:value":P[0]||(P[0]=j=>f.value.oldPassword=j),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(k,{path:"newPassword",label:e.unref(n)("New Password")},{default:e.withCtx(()=>[e.createVNode(T,{value:f.value.newPassword,"onUpdate:value":P[1]||(P[1]=j=>f.value.newPassword=j),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(k,{path:"confirmPassword",label:e.unref(n)("Confirm New Password")},{default:e.withCtx(()=>[e.createVNode(T,{value:f.value.confirmPassword,"onUpdate:value":P[2]||(P[2]=j=>f.value.confirmPassword=j),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["show"])]),_:1},8,["model"])]),_:1},8,["show","title"])}}}),ut=e.defineComponent({__name:"ColorInput",props:{value:{},label:{},readonly:{type:Boolean},placeholder:{},clearable:{type:Boolean}},emits:["update:value"],setup(t){return(l,o)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{readonly:l.readonly,value:l.value,placeholder:l.placeholder,clearable:l.clearable,"onUpdate:value":o[0]||(o[0]=n=>l.$emit("update:value",n))},null,8,["readonly","value","placeholder","clearable"]),e.createVNode(e.unref(u.NColorPicker),{value:l.value,"show-preview":"",modes:["hex"],placeholder:"",disabled:l.readonly,style:{"max-width":"80px"},"onUpdate:value":o[1]||(o[1]=n=>l.$emit("update:value",n))},{label:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ma))]),_:1})]),_:1},8,["value","disabled"])]),_:1}))}});function Qo(t){return typeof t=="object"&&t!==null&&"source"in t}function Ie(t){return typeof t=="object"&&t!==null&&"name"in t}function as(t){for(const l in t)delete t[l]}function Xo(t){const l={};for(const o of t){const n=o.name,r=l[n];if(o.nullable==!1)switch(o.dataType){case"number":l[n]=Number(r)||0;break;case"boolean":case"bool":l[n]=de(r)||!1;break;default:const a=$o(o.dataType);a!=null&&(l[n]=a)}}return l}function Jo(t,l,o){for(const n of l){const r=n.name,a=t[r];switch(n.dataType){case"number":n.nullable==!1?o[r]=Number(a)||0:o[r]=Number(a)||null;break;case"boolean":case"bool":n.nullable==!1?o[r]=de(a)||!1:o[r]=de(a)||null;break;default:o[r]=a||null;break}}}function qo(t,l){const o={};return Object.assign(o,t),Jo(t,l,o),o}function ss(t){if(!t)return!0;switch(t){case"number":case"boolean":return!1;default:return!0}}function Uo(t,l){const o=l||(r=>r.toString()),n=[];if(t.length){for(const r of t)if(typeof r=="string"&&r)n.push({name:r,label:o(te(r)),visibility:!0,editor:"text"});else if(Ie(r)&&r.editing!="hidden"&&r.name){const a={name:r.name,role:r.role&&!Array.isArray(r.role)?[r.role]:r.role,dataType:r.dataType,minValue:r.minValue,maxValue:r.maxValue,group:r.group,nullable:r.required==null?ss(r.dataType):!r.required,label:r.title?o(r.title):o(te(r.name)),visibility:!0,readonly:r.readonly,sortable:r.sortable,editor:r.editor||r.dataType||"text",editorConfig:r.editorConfig,tagSource:r.tagSource,description:r.description};r.editing=="readonly"?a.readonly=!0:(r.editing=="create"||r.editing=="edit")&&(a.visibility=[r.editing]),r.required!=null&&(a.nullable=!r.required),r.values&&(Array.isArray(r.values)?(a.values=r.values,a.valueSource={type:"static",isLoading:!1,values:r.values.map(c=>{if(typeof c=="string"){let f=c;return f&&(r.prefix&&(f=r.prefix+f),r.suffix&&(f=f+r.suffix)),{value:c,label:o(f)}}else return c})}):typeof r.values=="function"?a.valueSource={type:"function",func:r.values,isLoading:!1}:Array.isArray(r.values.source)?a.valueSource={type:"static",isLoading:!1,values:r.values.source.map(c=>{if(typeof c=="string"){let f=c;return f&&(r.prefix&&(f=r.prefix+f),r.suffix&&(f=f+r.suffix)),{value:c,label:o(f)}}else return c})}:a.valueSource={type:"remote",isLoading:!1,key:r.values.key,label:r.values.label,subLabel:r.values.subLabel,renderLabel:r.values.renderLabel,labelTemplate:r.values.labelTemplate,prefix:r.values.prefix,suffix:r.values.suffix,i18n:r.i18n,filterable:r.values.filterable,sourceUrl:r.values.source,values:[]}),n.push(a)}}return n}function pt(t){if(t){if(typeof t=="number")return t;switch(t){case"x-large":return 480;case"large":return 300;case"medium":return 160;case"small":return 60;case"x-small":return 30;default:return t}}else return t}function Be(t){const l=new Array;for(const o of t)if(typeof o=="string")l.push({name:o,title:te(o),sortIndex:0,visible:!0});else if(Ie(o)&&o.grid!="none"){if(o.visible!=null&&(typeof o.visible=="boolean"&&!o.visible||typeof o.visible=="function"&&!o.visible.call(null)))continue;const n={name:o.name,title:o.title,role:o.role&&!Array.isArray(o.role)?[o.role]:o.role,behavior:o.grid,align:o.align,fixed:o.gridFixed,dataType:o.dataType,href:o.href,i18n:o.i18n,template:o.template,prefix:o.prefix,suffix:o.suffix,formatter:o.formatter,display:o.display,values:o.values,width:pt(o.size),minWidth:pt(o.minWidth),textOverflow:o.textOverflow,sortIndex:0,sortable:o.sortable==null?!0:o.sortable,referencePage:o.referencePage,tagSource:o.tagSource,visible:!0,className:o.className,render:o.render,click:o.click};o.children&&o.children.length&&(n.children=Be(o.children)),l.push(n)}return l.sort((o,n)=>(o.sortIndex||0)-(n.sortIndex||0)),l}function is(t,l){return Ce.render(t,l)}function vo(t,l){var r;const o=l||(a=>a.toString()),n=new Array;for(const a of t)if(Ie(a)&&a.search){const c={name:a.name,role:a.role&&!Array.isArray(a.role)?[a.role]:a.role,label:a.title?o(a.title):o(te(a.name)),editor:a.editor||a.dataType||"text",dataType:a.dataType,nullable:!0,searchMethod:"normal",template:a.template,prefix:a.prefix,suffix:a.suffix};if(typeof a.search=="boolean")c.searchMethod="normal";else if(typeof a.search=="string")a.search=="range"&&(c.searchMethod=a.search);else{if(a.search.editor&&(c.editor=a.search.editor),a.search.method=="range"?c.searchMethod="range":c.searchMethod="normal",a.search.required&&(c.nullable=!1),a.search.role){const f=Array.isArray(a.search.role)?a.search.role:[a.search.role];if(c.role)for(let g of f)c.role.includes(g)||c.role.push(g);else c.role=f}a.search.field&&(c.searchField=a.search.field),c.defaultValue=a.search.default}if(a.values&&(Array.isArray(a.values)?c.valueSource={type:"static",isLoading:!1,values:a.values.map(f=>{if(typeof f=="string"){let g=f;return a.formatter&&(g=a.formatter.call(null,g,null)??g),g&&(c.prefix&&(g=c.prefix+g),c.suffix&&(g=g+c.suffix)),{value:f,label:o(g)}}else return f})}:typeof a.values=="function"?c.valueSource={type:"function",func:a.values,isLoading:!1}:Array.isArray(a.values.source)?c.valueSource={type:"static",isLoading:!1,values:a.values.source.map(f=>{var g;return typeof f=="string"?{value:f,label:o(((g=a.formatter)==null?void 0:g.call(null,f,null))||f)}:f})}:c.valueSource={type:"remote",isLoading:!1,key:a.values.key,label:a.values.label,subLabel:a.values.subLabel,renderLabel:a.values.renderLabel,labelTemplate:a.values.labelTemplate,prefix:a.values.prefix,suffix:a.values.suffix,filterable:a.values.filterable,i18n:a.values.i18n,sourceUrl:a.values.source,values:[]},c.dataType=="boolean"&&Array.isArray((r=c.valueSource)==null?void 0:r.values))){const f=c.valueSource.values;f.length<=2&&f.splice(0,0,{value:"",label:""})}n.push(c)}return n}async function Pe(t,l,o,n,r){if(l.sourceUrl){l.isLoading=!0,l.values?l.values.length=0:l.values=[];try{let a=l.sourceUrl;o&&(a=U(a,o));const c=await t.get(a);if(c.isSuccess&&c.value!=null){let f=c.value;if(!Array.isArray(f)&&"rows"in f&&Array.isArray(f.rows)&&(f=f.rows),Array.isArray(f)){const g=f.filter(i=>i&&!0).map(i=>{if(typeof i=="string")return{value:i,label:n?n(i):i};{let s;if(l.renderLabel)s=l.renderLabel(i);else if(l.labelTemplate)s=Ce.render(l.labelTemplate,i);else{if(s=i[l.label||"label"],n&&(s=n(s)),l.subLabel){const m=i[l.subLabel];typeof m=="string"&&(s+=" "+(n?n(m):m))}s&&(l.prefix&&(s=l.prefix+s),l.suffix&&(s=s+l.suffix))}return{value:i[l.key||"value"],label:s}}});r&&g.splice(0,0,{value:void 0,label:""}),l.values.length=0,l.values.push(...g)}}}finally{l.isLoading=!1}}}function mt(t,l){return()=>e.h(u.NIcon,l?{color:l}:null,{default:()=>e.h(t)})}function cs(t,l,o){if(t)return e.h(u.NIcon,o?{color:o}:null,{default:()=>e.h(l)})}function ds(t,l,o){return e.h(u.NButton,Object.assign({text:!0,onClick:l},o),{default:()=>e.h(u.NIcon,{size:20},{default:()=>e.h(t)})})}function fs(t,l){const o=t[l];let n="";return typeof o=="number"&&(o>0?n="text-positive":o<0&&(n="text-negative")),e.h("span",{class:n},o==null?void 0:o.toString())}const Fe=e.defineComponent({__name:"HaloDatePicker",props:{value:{},type:{},readonly:{type:Boolean},clearable:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=f=>{const g=Eo(f);return g===void 0?null:g},a=e.ref(r(o.value)),c=f=>{if(f!=null){a.value=f;const g=st(f);n("update:value",g,f)}else n("update:value",null,f)};return e.watch(()=>o.value,f=>a.value=r(f)),(f,g)=>(e.openBlock(),e.createBlock(e.unref(u.NDatePicker),{value:a.value,type:f.type,placeholder:"",disabled:f.readonly,"onUpdate:value":c,clearable:f.clearable},null,8,["value","type","disabled","clearable"]))}}),ht=e.defineComponent({__name:"HaloTimePicker",props:{value:{},type:{},readonly:{type:Boolean},clearable:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=f=>{if(f==null)return null;if(typeof f=="number"){const g=new Date(2e3,1,1);return g.setSeconds(f),g.getTime()}else if(typeof f=="string"){const g=Ao(f);if(!g)return null;const i=new Date(2e3,1,1);return i.setMilliseconds(g.millisecond+g.second*1e3+g.minute*60*1e3+g.hour*60*60*1e3),i.getTime()}else return f instanceof Date?f.getTime():null},a=f=>{if(f!=null){c.value=f;const g=new Date;g.setTime(f);const i=g.getSeconds()+g.getMinutes()*60+g.getHours()*60*60;n("update:value",i)}else n("update:value",null)},c=e.ref(r(o.value));return e.watch(()=>o.value,f=>c.value=r(f)),(f,g)=>(e.openBlock(),e.createBlock(e.unref(u.NTimePicker),{value:c.value,type:f.type,placeholder:"",disabled:f.readonly,"onUpdate:value":a,clearable:f.clearable},null,8,["value","type","disabled","clearable"]))}}),gt=e.defineComponent({__name:"NullableBooleanInput",props:{value:{type:Boolean},readonly:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref(typeof o.value=="boolean"?o.value.toString():""),c=[{value:null,label:""},{value:"true",label:r("Yes")},{value:"false",label:r("No")}],f=g=>{const i=de(g);i==null?n("update:value",null):n("update:value",i)};return e.watch(()=>o.value,()=>a.value=typeof o.value=="boolean"?o.value.toString():""),(g,i)=>(e.openBlock(),e.createBlock(e.unref(u.NSelect),{value:a.value,options:c,placeholder:"",disabled:g.readonly,clearable:"","onUpdate:value":i[0]||(i[0]=s=>f(s))},null,8,["value","disabled"]))}}),yt=()=>{const{t}=Z(),l=u.useMessage(),o=u.useDialog(),n=u.useModal(),r=b=>b&&t(b),a=b=>e.h("div",{},b.split(`
3
- `).map(x=>e.h("span",{class:"line"},t(x))));return{t:r,message:(b,x)=>{switch(x){case"create":l.create(()=>a(b));break;case"error":l.error(()=>a(b));break;case"loading":l.loading(t(b));break;case"success":l.success(t(b));break;case"warning":l.warning(t(b));break;default:case"info":l.info(t(b));break}},confirm:(b,x,S)=>{o.warning({title:t(b??"Confirm"),draggable:!0,content:()=>a(x),positiveText:t("OK"),negativeText:t("Cancel"),onPositiveClick:()=>S()})},error:b=>l.error(t(b)),success:b=>l.success(t(b)),warning:b=>l.warning(t(b)),info:b=>l.info(t(b)),errorDialog:(b,x,S)=>{o.error({title:t(x??"Error"),draggable:!0,content:()=>a(b),positiveText:t("OK"),onPositiveClick:()=>S==null?void 0:S()})},successDialog:(b,x,S)=>{o.success({title:t(x??"Success"),draggable:!0,content:()=>a(b),positiveText:t("OK"),onPositiveClick:()=>S==null?void 0:S()})},warningDialog:(b,x,S)=>{o.warning({title:t(x??"Warning"),draggable:!0,content:()=>a(b),positiveText:t("OK"),onPositiveClick:()=>S==null?void 0:S()})},infoDialog:(b,x,S)=>{o.info({title:t(x??"Information"),draggable:!0,content:()=>a(b),positiveText:t("OK"),onPositiveClick:()=>S==null?void 0:S()})},showSearchModal:b=>{let x=[];const S=n.create({title:t(b.title??"Search"),preset:"card",style:{width:b.width??"800px",height:b.height??"600px"},contentClass:"flex-column",draggable:b.draggable,content:()=>e.h(e.resolveComponent("SearchPanel"),{class:"flex-grow-1",config:b.config,multiSelect:b.multiSelect==!0,onSearchBack:P=>{b.callback.call(null,P)},onResultSelected:(P,T)=>{x=T??[]}}),footer:()=>e.h("div",{class:"flex-row",style:"justify-content:space-between"},[e.h(u.NButton,{type:"primary",style:"min-width: 100px",onClick:()=>{x.length&&(b.callback.call(null,x),S.destroy())}},()=>t("OK")),e.h(u.NButton,{ghost:!0,style:"min-width: 100px",onClick:()=>S.destroy()},()=>t("Close"))])})},showQrModal:(b,x)=>{const S=n.create({title:x,preset:"card",style:{width:"300px"},draggable:!0,content:()=>e.h("div",{class:"flex-column",style:"align-items: center"},[e.h(u.NQrCode,{value:b,size:160}),e.h("div",{class:"text-monospace",style:"font-size: large; margin: 0.25em"},b),e.h(u.NButton,{type:"primary",onClick:()=>S.destroy(),style:"align-self: center; min-width: 100px; margin-top: 1em;"},()=>t("Close"))])})}}};var He=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ge={exports:{}},us=Ge.exports,en;function ps(){return en||(en=1,function(t,l){(function(o,n){n()})(us,function(){function o(i,s){return typeof s>"u"?s={autoBom:!1}:typeof s!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),s={autoBom:!s}),s.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\uFEFF",i],{type:i.type}):i}function n(i,s,m){var d=new XMLHttpRequest;d.open("GET",i),d.responseType="blob",d.onload=function(){g(d.response,s,m)},d.onerror=function(){console.error("could not download file")},d.send()}function r(i){var s=new XMLHttpRequest;s.open("HEAD",i,!1);try{s.send()}catch{}return 200<=s.status&&299>=s.status}function a(i){try{i.dispatchEvent(new MouseEvent("click"))}catch{var s=document.createEvent("MouseEvents");s.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),i.dispatchEvent(s)}}var c=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof He=="object"&&He.global===He?He:void 0,f=c.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=c.saveAs||(typeof window!="object"||window!==c?function(){}:"download"in HTMLAnchorElement.prototype&&!f?function(i,s,m){var d=c.URL||c.webkitURL,h=document.createElement("a");s=s||i.name||"download",h.download=s,h.rel="noopener",typeof i=="string"?(h.href=i,h.origin===location.origin?a(h):r(h.href)?n(i,s,m):a(h,h.target="_blank")):(h.href=d.createObjectURL(i),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){a(h)},0))}:"msSaveOrOpenBlob"in navigator?function(i,s,m){if(s=s||i.name||"download",typeof i!="string")navigator.msSaveOrOpenBlob(o(i,m),s);else if(r(i))n(i,s,m);else{var d=document.createElement("a");d.href=i,d.target="_blank",setTimeout(function(){a(d)})}}:function(i,s,m,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof i=="string")return n(i,s,m);var h=i.type==="application/octet-stream",b=/constructor/i.test(c.HTMLElement)||c.safari,x=/CriOS\/[\d]+/.test(navigator.userAgent);if((x||h&&b||f)&&typeof FileReader<"u"){var S=new FileReader;S.onloadend=function(){var k=S.result;k=x?k:k.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=k:location=k,d=null},S.readAsDataURL(i)}else{var P=c.URL||c.webkitURL,T=P.createObjectURL(i);d?d.location=T:location.href=T,d=null,setTimeout(function(){P.revokeObjectURL(T)},4e4)}});c.saveAs=g.saveAs=g,t.exports=g})}(Ge)),Ge.exports}var ms=ps();function tn(){const t=le.create({headers:{"Content-type":"application/json"},timeout:3e5});return t.interceptors.request.use(l=>{const o=localStorage.getItem("sessionToken");return o&&l.headers&&(l.headers.Authorization=`Bearer ${o}`),l},l=>(console.log(l),Promise.reject(l))),t}function hs(t){if(t){const l=t.match(/filename\*=UTF-8'(?:.*)'(.*)/);if(l&&l.length>1)return decodeURIComponent(l[1]);const o=t.match(/filename=(.*)/);if(o&&o.length>1)return o[1]}}async function me(t,l,o,n){const r=tn();let a;(n==null?void 0:n.toLowerCase())=="post"?a=await r.post(t,{responseType:"blob"}):a=await r.get(t,{responseType:"blob"});const{data:c,headers:f,status:g,statusText:i}=a;if(g==200||c.length){f&&(o||(o=f["content-type"]),l||(l=hs(f["content-disposition"])));const s=new Blob([c],{type:o||"application/octet-stream"});ms.saveAs(s,l)}else throw`[${g}] ${i}`}async function on(t,l,o){const n=tn();let r;(o==null?void 0:o.toLowerCase())=="post"?r=await n.post(t,{responseType:"blob"}):r=await n.get(t,{responseType:"blob"});const{data:a,headers:c,status:f,statusText:g}=r;if(f==200||a.length){c&&(l||(l=c["content-type"]));const i=new Blob([a],{type:l||"application/octet-stream"}),s=URL.createObjectURL(i);window.open(s)}else throw`[${f}] ${g}`}function nn(t,l){let o=t.length,n=0;for(;o--;)l(t[o],o)&&(t.splice(o,1),n++);return n}function gs(t,l){var o={};for(let n of t){const r=l(n);o[r]?o[r].push(n):o[r]=[]}return o}function ln(t,l,o){l<0||l>=t.length||o<0||o>=t.length||l==o||t.splice(o,0,...t.splice(l,1))}function ys(t,l,o,n,r,a){const c={name:t,label:l||te(t),editor:o||"text",dataType:o,nullable:!0,visibility:!0,searchMethod:n||"normal"},f=a??(g=>g);return r&&(typeof r=="string"?c.valueSource={type:"remote",isLoading:!1,key:"key",label:"label",sourceUrl:r}:Array.isArray(r)?c.dataType=="boolean"&&r.length==2&&typeof r[0]=="string"?c.valueSource={type:"static",isLoading:!1,values:[{value:"",label:""},{value:"true",label:f(r[0])},{value:"false",label:f(r[1])}]}:c.valueSource={type:"static",isLoading:!1,values:r.map(g=>typeof g=="string"?{value:g,label:f(g)}:g)}:Qo(r)?Array.isArray(r.source)?c.valueSource={type:"static",isLoading:!1,filterable:r.filterable,values:[{value:"",label:""},...r.source.map(g=>typeof g=="string"?{value:g,label:f(g)}:g)]}:c.valueSource={type:"remote",isLoading:!1,key:r.key,label:r.label,subLabel:r.subLabel,labelTemplate:r.labelTemplate,i18n:r.i18n,sourceUrl:r.source,filterable:r.filterable,values:[]}:c.valueSource={type:"static",isLoading:!1,values:Object.keys(r).map(g=>({value:r[g],label:f(g)}))}),c}function ws(...t){const l=new Map;return t.forEach(o=>{o.forEach(n=>{n.name?l.set(n.name.toString(),n):l.set(n.path,n)})}),Array.from(l.values())}function Cs(t,l,o){if(t<=0||l<=0||o<0||!Number.isInteger(l)||!Number.isInteger(o)){console.error("Invalid arguments.");return}const n=Math.pow(10,o);let r=Math.floor(t*n);const a=[],c=Math.max(1,Math.floor(r/l));let f=r;for(let g=0;g<l;g++){let i;g==l-1?i=Math.max(0,f):(i=Math.min(c,f),f=Math.max(0,f-c)),i=parseFloat((i/n).toFixed(o)),a.push(i)}return a}function bs(t,l,o){if(t<=0||l<=0||o<0||!Number.isInteger(o)){console.error("Invalid arguments.");return}const n=Math.pow(10,o),r=Math.round(t*n),a=Math.round(l*n),c=[];let f=r;for(;f>0;){let g=Math.min(a,f);f-=a,c.push(parseFloat((g/n).toFixed(o)))}return c}function ks(t,l){if(l<0||!Number.isInteger(l)){console.error("Invalid arguments.");return}const o=Math.pow(10,l);let n=0;for(const r of t)n+=Math.round(r*o);return n/o}function Ns(){const t=e.ref(new Map),l=i=>(t.value.has(i)||t.value.set(i,{isLocked:!1,waitingQueue:[]}),t.value.get(i));async function o(i){const s=l(i);return s.isLocked?new Promise(m=>{s.waitingQueue.push(()=>{s.isLocked=!0,m(()=>r(i))})}):(s.isLocked=!0,()=>r(i))}function n(i){const s=l(i);return s.isLocked?null:(s.isLocked=!0,()=>r(i))}function r(i){const s=l(i);if(!s.isLocked)return;s.isLocked=!1;const m=s.waitingQueue.shift();m&&m(),!s.isLocked&&s.waitingQueue.length===0&&t.value.delete(i)}async function a(i,s){const m=await o(i);try{return await Promise.resolve(s())}finally{m()}}async function c(i,s,m="Failed to acquire the operation lock."){const d=n(i);if(!d)throw console.error(`Failed to acquire the operation lock.(key: ${i})`),m;try{return await Promise.resolve(s())}finally{d()}}function f(i){return l(i).isLocked}function g(i){t.value.delete(i)}return{runExclusive:a,lock:o,unlock:r,tryLock:n,runExclusiveOrThrow:c,isLocked:f,clearLock:g}}const ie=()=>{const t=yt(),l=e.inject("axios"),o=Ns();async function n(s,m="Error"){if(s)if(s.response){let d=t.t(s.response.statusText);return s.response.data&&(s.response.data instanceof Blob?d+=`
2
+ (function(M,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("axios"),require("vue-router"),require("naive-ui"),require("pinia"),require("moment"),require("mustache"),require("vue-draggable-plus")):typeof define=="function"&&define.amd?define(["exports","vue","axios","vue-router","naive-ui","pinia","moment","mustache","vue-draggable-plus"],e):(M=typeof globalThis<"u"?globalThis:M||self,e(M.halov={},M.Vue,M.axios,M.VueRouter,M.NaiveUI,M.Pinia,M.moment,M.Mustache,M.VueDraggablePlus))})(this,function(M,e,le,ce,u,Ae,se,Ce,Zt){"use strict";var kd=Object.defineProperty;var Nd=(M,e,le)=>e in M?kd(M,e,{enumerable:!0,configurable:!0,writable:!0,value:le}):M[e]=le;var J=(M,e,le)=>Nd(M,typeof e!="symbol"?e+"":e,le);var et=typeof document<"u"?document.currentScript:null;const tt=window,Yt="halo-lang";class dl{constructor(l,o=!0){J(this,"langCode","");J(this,"ignoreCase",!1);this.ignoreCase=o,this.swtichLang(l)}loadScript(l){const o=document.createElement("script");return o.src=l,o.id=Yt,document.head.appendChild(o),o}unloadScript(){const l=document.getElementById(Yt);return l&&l.parentNode?(l.parentNode.removeChild(l),!0):!1}swtichLang(l){if(this.langCode!=l){this.langCode=l;const o=`/api/core/Languages/embed.js?code=${encodeURIComponent(l)}&caseType=lowercase`;this.unloadScript(),this.loadScript(o)}}t(l){var n;if(!l)return"";const o=(n=tt.lang)==null?void 0:n.words;return o&&o[this.ignoreCase?l.toLowerCase():l]||l}t2(l,o){var r;if(!l&&!o)return"";const n=(r=tt.lang)==null?void 0:r.words;if(n){if(l){const a=n[this.ignoreCase?l.toLowerCase():l];if(a)return a}if(o){const a=n[this.ignoreCase?o.toLowerCase():o];if(a)return a}}return l||o}info(){const l=tt.lang;if(l)return{code:l.code,name:l.name,displayName:l.displayName,nativeName:l.nativeName,revision:l.revision,rtl:l.rtl}}}const Qt=Symbol("halo-i18n");let ot=null;function Xt(t,l){return ot||(ot=new dl(t,l)),ot}function Jt(t,l,o=!0){const n=Xt(l,o);t.config.globalProperties.$t=r=>n.t(r),t.provide(Qt,n)}function Z(){const t=e.inject(Qt);if(!t)throw new Error("I18n not initialized. Ensure I18nPlugin is installed.");return{i18n:t,t:t.t.bind(t),switchLang:t.swtichLang.bind(t),lang:t.info}}const fl=()=>{let t=localStorage.getItem("Client-Device-Id");return t||(typeof crypto<"u"&&typeof crypto.randomUUID=="function"?t=crypto.randomUUID():t="c-"+Math.random().toString(36).substring(2)+Date.now().toString(36),localStorage.setItem("Client-Device-Id",t)),t};le.defaults.headers["Client-Device-Id"]=fl(),le.defaults.headers["Content-type"]="application/json",le.defaults.timeout=1e3*60,le.interceptors.request.use(t=>{const l=localStorage.getItem("sessionToken");return l&&t.headers&&(t.headers.Authorization=`Bearer ${l}`),t},t=>(console.log(t),Promise.reject(t))),le.interceptors.response.use(t=>t.status==200?t.data:Promise.reject(t.statusText),t=>{if(t&&t.response&&t.response.status){const l=ce.useRouter();switch(t.response.status){case 401:l==null||l.push({name:"Unauthorized"});break}}return Promise.reject(t)});const ul=["src"],pl=e.defineComponent({__name:"AppLogoBox",props:{src:{type:String,required:!0},height:{type:String,default:"40px"},defaultSrc:{type:String,default:new URL("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgaW5rc2NhcGU6dmVyc2lvbj0iMS4xIChjNjhlMjJjMzg3LCAyMDIxLTA1LTIzKSIKICAgaW5rc2NhcGU6ZXhwb3J0LXlkcGk9IjUuNjExNzEyIgogICBpbmtzY2FwZTpleHBvcnQteGRwaT0iNS42MTE3MTIiCiAgIGlua3NjYXBlOmV4cG9ydC1maWxlbmFtZT0iRDpcQ29kZXNcSk1DX0ZyYW1lX0FuZG9uXEFydHNcbG9nb18yMC5wbmciCiAgIHNvZGlwb2RpOmRvY25hbWU9ImxvZ28uc3ZnIgogICB3aWR0aD0iODAuNjk3OTE0bW0iCiAgIGhlaWdodD0iNzYuOTQ2MjEzbW0iCiAgIHZpZXdCb3g9IjAgMCA4MC42OTc5MTQgNzYuOTQ2MjEzIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmc4IgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj4KICA8c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgaW5rc2NhcGU6ZG9jdW1lbnQtcm90YXRpb249IjAiCiAgICAgaW5rc2NhcGU6Y3VycmVudC1sYXllcj0iZzQ1NDMiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMSIKICAgICBpbmtzY2FwZTp3aW5kb3cteT0iLTgiCiAgICAgaW5rc2NhcGU6d2luZG93LXg9Ii04IgogICAgIGlua3NjYXBlOmN5PSIxNDQuOTI4NiIKICAgICBpbmtzY2FwZTpjeD0iNjcuMDg0ODUzIgogICAgIGlua3NjYXBlOnpvb209IjAuNzkwMDQ0MjIiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlkPSJuYW1lZHZpZXc4NTMiCiAgICAgaW5rc2NhcGU6d2luZG93LWhlaWdodD0iMTAxNyIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjE5MjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTpwYWdlb3BhY2l0eT0iMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgZ3JpZHRvbGVyYW5jZT0iMTAiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBib3JkZXJvcGFjaXR5PSIxIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIHBhZ2Vjb2xvcj0iI2ZmZmZmZiIKICAgICBpbmtzY2FwZTpwYWdlY2hlY2tlcmJvYXJkPSIwIgogICAgIGlua3NjYXBlOmRvY3VtZW50LXVuaXRzPSJtbSIgLz4KICA8ZGVmcwogICAgIGlkPSJkZWZzMiI+CiAgICA8Y2xpcFBhdGgKICAgICAgIGNsaXBQYXRoVW5pdHM9InVzZXJTcGFjZU9uVXNlIgogICAgICAgaWQ9ImNsaXBQYXRoNDU2MyI+CiAgICAgIDxyZWN0CiAgICAgICAgIHN0eWxlPSJvcGFjaXR5OjE7ZmlsbDojZmYyYTJhO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDozLjQyNzE2NjQ2O3N0cm9rZS1taXRlcmxpbWl0OjQ7c3Ryb2tlLWRhc2hhcnJheTpub25lO3N0cm9rZS1vcGFjaXR5OjEiCiAgICAgICAgIGlkPSJyZWN0NDU2NSIKICAgICAgICAgd2lkdGg9IjgwLjY5NzkxNCIKICAgICAgICAgaGVpZ2h0PSI3Ni45OTM3NTIiCiAgICAgICAgIHg9Ijg0Ljc1ODIxNyIKICAgICAgICAgeT0iNjUuMTk2NjQ4IgogICAgICAgICByeD0iMTAiCiAgICAgICAgIHJ5PSIxMCIgLz4KICAgIDwvY2xpcFBhdGg+CiAgPC9kZWZzPgogIDxtZXRhZGF0YQogICAgIGlkPSJtZXRhZGF0YTUiPgogICAgPHJkZjpSREY+CiAgICAgIDxjYzpXb3JrCiAgICAgICAgIHJkZjphYm91dD0iIj4KICAgICAgICA8ZGM6Zm9ybWF0PmltYWdlL3N2Zyt4bWw8L2RjOmZvcm1hdD4KICAgICAgICA8ZGM6dHlwZQogICAgICAgICAgIHJkZjpyZXNvdXJjZT0iaHR0cDovL3B1cmwub3JnL2RjL2RjbWl0eXBlL1N0aWxsSW1hZ2UiIC8+CiAgICAgIDwvY2M6V29yaz4KICAgIDwvcmRmOlJERj4KICA8L21ldGFkYXRhPgogIDxnCiAgICAgaWQ9ImxheWVyMSIKICAgICB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtODQuNzU4MjE3LC02NS4yNDQxODMpIj4KICAgIDxnCiAgICAgICBpZD0iZzQ1NDMiCiAgICAgICBjbGlwLXBhdGg9InVybCgjY2xpcFBhdGg0NTYzKSI+CiAgICAgIDxwYXRoCiAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgIGlkPSJwYXRoNDUzMiIKICAgICAgICAgZD0ibSAxMjIuNjcxMDEsOTkuMDkwNTY2IDM0LjY3MTkyLC0zMy44NDYzODMgaCAyMy41NjQ0NSBsIC0zOC44NjA2OCwzNS44MTE3NjcgMjMuNDA5NDIsNDEuMTM0NDQgdiAwIEggMTQzLjU5NyBsIC0xNy4zMTE2MSwtMzEuMTYwODkgLTcuNDE0MDgsNi40NTc0MiIKICAgICAgICAgc3R5bGU9ImZvbnQtc3R5bGU6aXRhbGljO2ZvbnQtdmFyaWFudDpub3JtYWw7Zm9udC13ZWlnaHQ6Ym9sZDtmb250LXN0cmV0Y2g6bm9ybWFsO2ZvbnQtc2l6ZToxMDUuODMzcHg7bGluZS1oZWlnaHQ6MS4yNTtmb250LWZhbWlseTpzYW5zLXNlcmlmOy1pbmtzY2FwZS1mb250LXNwZWNpZmljYXRpb246J3NhbnMtc2VyaWYgQm9sZCBJdGFsaWMnO2xldHRlci1zcGFjaW5nOjBweDt3b3JkLXNwYWNpbmc6MHB4O2ZpbGw6IzVlMzViMTtmaWxsLW9wYWNpdHk6MTtzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MC4yNjQ1ODMiIC8+CiAgICAgIDxwYXRoCiAgICAgICAgIGlua3NjYXBlOmNvbm5lY3Rvci1jdXJ2YXR1cmU9IjAiCiAgICAgICAgIGQ9Im0gMTE5LjkyOTY1LDExNi44MTcyNyBjIC0yLjEwMTUxLDkuMDI2MTUgLTYuMDQ2MTMsMTUuNzA5NjMgLTExLjgzMzkxLDIwLjA1MDQ1IC01Ljc4Nzc2LDQuMzQwODIgLTEzLjcxMTQ4LDYuNTExMjMgLTIzLjc3MTE1OSw2LjUxMTIzIC0zLjY4NjI1MiwwIC03LjAxMDc2OSwtMC4xMzc4IC05Ljk3MzU1MSwtMC40MTM0MSAtMi45NjI3ODMsLTAuMjQxMTUgLTUuNjE1NTA2LC0wLjYwMjg5IC03Ljk1ODE3MSwtMS4wODUyIGwgMy42NjkwMjcsLTE1LjI4NjUxIGMgNC41Njc1NzYsMC42NTExNyA5LjIxNjI0OSwxLjg4Njg3IDEzLjI4MDg0MywxLjkwMjMxIDUuMjcwOTk2LDAgOS4yMTU2MywtMS4yNTc0NiAxMS44MzM5MDUsLTMuNzcyMzggMi42MTgyNywtMi41MTQ5MiA0Ljc1NDIzLC03LjQwNjk2IDYuNDA3ODc2LC0xNC42NzYxMSBsIDcuMDc5NjgsLTMwLjY0NDEyNCBIIDkxLjA5NDE5NCBMIDk0LjM0OTgwOSw2NS4yNDQxODMgSCAxMzEuODY2OSBaIgogICAgICAgICBzdHlsZT0iZm9udC1zdHlsZTppdGFsaWM7Zm9udC12YXJpYW50Om5vcm1hbDtmb250LXdlaWdodDpib2xkO2ZvbnQtc3RyZXRjaDpub3JtYWw7Zm9udC1zaXplOjEwNS44MzNweDtsaW5lLWhlaWdodDoxLjI1O2ZvbnQtZmFtaWx5OnNhbnMtc2VyaWY7LWlua3NjYXBlLWZvbnQtc3BlY2lmaWNhdGlvbjonc2Fucy1zZXJpZiBCb2xkIEl0YWxpYyc7bGV0dGVyLXNwYWNpbmc6MHB4O3dvcmQtc3BhY2luZzowcHg7ZGlzcGxheTppbmxpbmU7ZmlsbDojMzExYjkyO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDowLjI2NDU4MyIKICAgICAgICAgaWQ9InBhdGg0NDg5IiAvPgogICAgPC9nPgogIDwvZz4KPC9zdmc+Cg==",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:et&&et.tagName.toUpperCase()==="SCRIPT"&&et.src||new URL("halov.umd.cjs",document.baseURI).href).href}},setup(t){const l=t,o=e.ref(l.src);e.watch(()=>l.src,r=>{o.value=r});function n(){o.value=l.defaultSrc}return(r,a)=>(e.openBlock(),e.createElementBlock("img",{src:o.value,style:e.normalizeStyle({height:t.height,objectFit:"contain"}),onError:n,alt:"App Logo"},null,44,ul))}}),re=(t,l)=>{const o=t.__vccOpts||t;for(const[n,r]of l)o[n]=r;return o},qt=re(pl,[["__scopeId","data-v-f7799232"]]);function ml(){try{const t=sessionStorage.getItem("tabs");return t?JSON.parse(t):null}catch{return null}}const nt=Ae.defineStore("tabs",{state:()=>({tabs:ml(),selectedTab:sessionStorage.getItem("selectedTab")}),actions:{setTabs(t){this.tabs=t,t?(sessionStorage.setItem("tabs",JSON.stringify(t)),t.length||this.setSelectedTab(null)):(sessionStorage.removeItem("tabs"),this.setSelectedTab(null))},setSelectedTab(t){this.selectedTab=t,t?sessionStorage.setItem("selectedTab",t):sessionStorage.removeItem("selectedTab")},addTab(t){let l=this.tabs;l?l.find(o=>o.id==t.id)||l.push(t):l=[t],this.setTabs(l),this.setSelectedTab(t.id)},selectTab(t){this.setSelectedTab(t)},closeTab(t){const l=this.tabs;if(l){const o=l.findIndex(n=>n.id==t);o>-1&&(l.splice(o,1),this.setTabs(l))}},changeTabId(t,l){const o=this.tabs;if(o){const n=o.find(r=>r.id==t);n&&!o.find(r=>r.id==l)&&(n.id=l,this.setTabs(o))}},clearTabs(){this.setTabs([]),this.setSelectedTab(null)}}});var hl=typeof global=="object"&&global&&global.Object===Object&&global,gl=typeof self=="object"&&self&&self.Object===Object&&self,yl=hl||gl||Function("return this")(),be=yl.Symbol,Ut=Object.prototype,wl=Ut.hasOwnProperty,Cl=Ut.toString,Ee=be?be.toStringTag:void 0;function bl(t){var l=wl.call(t,Ee),o=t[Ee];try{t[Ee]=void 0;var n=!0}catch{}var r=Cl.call(t);return n&&(l?t[Ee]=o:delete t[Ee]),r}var kl=Object.prototype,Nl=kl.toString;function xl(t){return Nl.call(t)}var Sl="[object Null]",Il="[object Undefined]",vt=be?be.toStringTag:void 0;function Bl(t){return t==null?t===void 0?Il:Sl:vt&&vt in Object(t)?bl(t):xl(t)}function Vl(t){return t!=null&&typeof t=="object"}var Ml="[object Symbol]";function Tl(t){return typeof t=="symbol"||Vl(t)&&Bl(t)==Ml}function Al(t,l){for(var o=-1,n=t==null?0:t.length,r=Array(n);++o<n;)r[o]=l(t[o],o,t);return r}var El=Array.isArray,eo=be?be.prototype:void 0,to=eo?eo.toString:void 0;function oo(t){if(typeof t=="string")return t;if(El(t))return Al(t,oo)+"";if(Tl(t))return to?to.call(t):"";var l=t+"";return l=="0"&&1/t==-1/0?"-0":l}function lt(t){return t==null?"":oo(t)}function _l(t,l,o){var n=-1,r=t.length;l<0&&(l=-l>r?0:r+l),o=o>r?r:o,o<0&&(o+=r),r=l>o?0:o-l>>>0,l>>>=0;for(var a=Array(r);++n<r;)a[n]=t[n+l];return a}function Ll(t,l,o){var n=t.length;return o=o===void 0?n:o,!l&&o>=n?t:_l(t,l,o)}var zl="\\ud800-\\udfff",Dl="\\u0300-\\u036f",$l="\\ufe20-\\ufe2f",Rl="\\u20d0-\\u20ff",Ol=Dl+$l+Rl,jl="\\ufe0e\\ufe0f",Pl="\\u200d",Fl=RegExp("["+Pl+zl+Ol+jl+"]");function no(t){return Fl.test(t)}function Hl(t){return t.split("")}var lo="\\ud800-\\udfff",Gl="\\u0300-\\u036f",Kl="\\ufe20-\\ufe2f",Wl="\\u20d0-\\u20ff",Zl=Gl+Kl+Wl,Yl="\\ufe0e\\ufe0f",Ql="["+lo+"]",rt="["+Zl+"]",at="\\ud83c[\\udffb-\\udfff]",Xl="(?:"+rt+"|"+at+")",ro="[^"+lo+"]",ao="(?:\\ud83c[\\udde6-\\uddff]){2}",so="[\\ud800-\\udbff][\\udc00-\\udfff]",Jl="\\u200d",io=Xl+"?",co="["+Yl+"]?",ql="(?:"+Jl+"(?:"+[ro,ao,so].join("|")+")"+co+io+")*",Ul=co+io+ql,vl="(?:"+[ro+rt+"?",rt,ao,so,Ql].join("|")+")",er=RegExp(at+"(?="+at+")|"+vl+Ul,"g");function tr(t){return t.match(er)||[]}function or(t){return no(t)?tr(t):Hl(t)}function nr(t){return function(l){l=lt(l);var o=no(l)?or(l):void 0,n=o?o[0]:l.charAt(0),r=o?Ll(o,1).join(""):l.slice(1);return n[t]()+r}}var lr=nr("toUpperCase");function rr(t,l,o,n){for(var r=-1,a=t==null?0:t.length;++r<a;)o=l(o,t[r],r,t);return o}function ar(t){return function(l){return t==null?void 0:t[l]}}var sr={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},ir=ar(sr),cr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,dr="\\u0300-\\u036f",fr="\\ufe20-\\ufe2f",ur="\\u20d0-\\u20ff",pr=dr+fr+ur,mr="["+pr+"]",hr=RegExp(mr,"g");function gr(t){return t=lt(t),t&&t.replace(cr,ir).replace(hr,"")}var yr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function wr(t){return t.match(yr)||[]}var Cr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function br(t){return Cr.test(t)}var fo="\\ud800-\\udfff",kr="\\u0300-\\u036f",Nr="\\ufe20-\\ufe2f",xr="\\u20d0-\\u20ff",Sr=kr+Nr+xr,uo="\\u2700-\\u27bf",po="a-z\\xdf-\\xf6\\xf8-\\xff",Ir="\\xac\\xb1\\xd7\\xf7",Br="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Vr="\\u2000-\\u206f",Mr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",mo="A-Z\\xc0-\\xd6\\xd8-\\xde",Tr="\\ufe0e\\ufe0f",ho=Ir+Br+Vr+Mr,go="['’]",yo="["+ho+"]",Ar="["+Sr+"]",wo="\\d+",Er="["+uo+"]",Co="["+po+"]",bo="[^"+fo+ho+wo+uo+po+mo+"]",_r="\\ud83c[\\udffb-\\udfff]",Lr="(?:"+Ar+"|"+_r+")",zr="[^"+fo+"]",ko="(?:\\ud83c[\\udde6-\\uddff]){2}",No="[\\ud800-\\udbff][\\udc00-\\udfff]",ke="["+mo+"]",Dr="\\u200d",xo="(?:"+Co+"|"+bo+")",$r="(?:"+ke+"|"+bo+")",So="(?:"+go+"(?:d|ll|m|re|s|t|ve))?",Io="(?:"+go+"(?:D|LL|M|RE|S|T|VE))?",Bo=Lr+"?",Vo="["+Tr+"]?",Rr="(?:"+Dr+"(?:"+[zr,ko,No].join("|")+")"+Vo+Bo+")*",Or="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Pr=Vo+Bo+Rr,Fr="(?:"+[Er,ko,No].join("|")+")"+Pr,Hr=RegExp([ke+"?"+Co+"+"+So+"(?="+[yo,ke,"$"].join("|")+")",$r+"+"+Io+"(?="+[yo,ke+xo,"$"].join("|")+")",ke+"?"+xo+"+"+So,ke+"+"+Io,jr,Or,wo,Fr].join("|"),"g");function Gr(t){return t.match(Hr)||[]}function Kr(t,l,o){return t=lt(t),l=l,l===void 0?br(t)?Gr(t):wr(t):t.match(l)||[]}var Wr="['’]",Zr=RegExp(Wr,"g");function Yr(t){return function(l){return rr(Kr(gr(l).replace(Zr,"")),t,"")}}var Qr=Yr(function(t,l,o){return t+(o?" ":"")+lr(l)});const _e="YYYY/MM/DD HH:mm:ss",ge="YYYY/MM/DD",Le="HH:mm:ss";function te(t){return t.length?Qr(t):t}function de(t){if(t!=null){if(typeof t=="boolean"||t instanceof Boolean)return t;if(typeof t=="number"||typeof t=="bigint")return t>0;if(typeof t=="string"||typeof t=="object")switch(t==null?void 0:t.toString().toLowerCase().trim()){case"true":case"yes":case"1":case"y":return!0;case"false":case"no":case"0":case"n":return!1}else if(typeof t=="function"){const l=t.call(null);if(l)return de(l)}}}function Re(t,l){const o=de(t);return o===void 0?l||!1:o}function Mo(t,l){if(t!=null){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t);if(typeof t=="string")return se(t,l||_e).toDate()}}function To(t){return typeof t=="object"&&t!==null&&"hour"in t&&"minute"in t}function Xr(t){const l=t%1e3;t/=1e3;const o=t%60;t/=60;const n=t%60;return t/=60,{hour:t%24,minute:n,second:o,millisecond:l}}function Ao(t){const l=t%60;t/=60;const o=t%60;return t/=60,{hour:t%24,minute:o,second:l,millisecond:0}}function Eo(t,l){const o=se(t,l||Le);if(o)return{hour:o.hour(),minute:o.minute(),second:o.second(),millisecond:o.millisecond()}}function _o(t,l){var o,n;if(t){if(typeof t=="string")return(n=(o=se(t,l||_e))==null?void 0:o.toDate())==null?void 0:n.getTime();if(typeof t=="number")return t;if(t instanceof Date)return t.getTime()}}function Lo(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return se(new Date(t)).format(l||Le);if(t instanceof Date)return se(t).format(l||Le);if(To(t))return se(new Date(2e3,1,1,t.hour,t.minute,t.second)).format(l||Le);if(typeof t=="object")return t==null?void 0:t.toString()}}function st(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return se(new Date(t)).format(l||ge);if(t instanceof Date)return se(t).format(l||ge);if(typeof t=="object")return t==null?void 0:t.toString()}}function it(t,l){if(t!=null){if(typeof t=="string")return t;if(typeof t=="number")return se(new Date(t)).format(l||_e);if(t instanceof Date)return se(t).format(l||_e);if(typeof t=="object")return t==null?void 0:t.toString()}}function zo(t){if(t){const l=t.lastIndexOf(":");if(l>-1&&l<t.length-1)return t.substring(0,l+1)+Math.round(Number(t.substring(l+1,t.length)))}return t}function Do(t){const l={},o=t.split("&").map(n=>n.trim()).filter(n=>n);for(const n of o){let r,a;const c=n.indexOf("=");if(c>-1?(r=n.substring(0,c),a=n.substring(c+1)):r=n,r in l){if(a){const f=l[r];Array.isArray(f)?f.push(a):f?l[r]=[f,a]:l[r]=a}}else l[r]=a}return l}function Jr(t,l){let o=t;if(l){const n=[];for(const r in l){const a=l[r];if(Array.isArray(a))for(const c of a)n.push(`${r}=${encodeURIComponent(c)}`);else a?n.push(`${r}=${encodeURIComponent(a)}`):n.push(r)}n.length&&(o+="?"+n.join("&"))}return o}function U(t,l,o=!0){if(!l||Object.keys(l).length==0)return t;let n=t,r={};const a=t.indexOf("?");a>-1&&(n=t.substring(0,a),r=Do(t.substring(a+1)));let c={};const f=Array.isArray(l)?l:[l];for(let g of f)if(g)if(typeof g=="string")c=Do(g);else for(const i in g){const s=g[i];Array.isArray(s)?c[i]=s.map(m=>m==null?void 0:m.toString()):s!=null?c[i]=s.toString():c[i]=void 0}else continue;if(Object.keys(c).length==0)return t;if(r.length)for(const g in c)if(g in r&&!o){const i=r[g],s=c[g];Array.isArray(i)?Array.isArray(s)?i.push(...s):i.push(s):i?Array.isArray(s)?r[g]=[i,...s]:r[g]=[i,s]:r[g]=c[g]}else r[g]=c[g];else for(const g in c)r[g]=c[g];return Jr(n,r)}function Oe(t,l,o){if(t==null)return t;switch(l){case"number":return Number(t);case"boolean":case"bool":return de(t);case"date":case"datetime":return it(t);default:return o&&typeof t=="string"&&(o.includes("code-u")?t=t.toUpperCase():o.includes("code-l")&&(t=t.toLowerCase())),t}}function $o(t){switch(t){case"number":return 0;case"boolean":case"bool":return!1;case"date":case"datetime":return new Date}}function qr(){return new Date().getTime().toString()}function Ur(t,l){const o={};if(t)if(l)for(const n of l)typeof n=="string"?o[te(n)]=t[n]:o[te(n.name)]=t[n.name];else for(const n in t)o[te(n)]=t[n];return o}function vr(t,l){return se(t,ge).add(l,"days").format(ge)}function ea(t,l){if(!t||!l){const o=new Date;t||(t=o.getFullYear()),l||(l=o.getMonth())}return new Date(t,l,1)}function ta(t,l){if(!t||!l){const o=new Date;t||(t=o.getFullYear()),l||(l=o.getMonth())}return new Date(t,l+1,0)}function oa(t,l=!0,o=!0){var r,a;let n=(a=(r=t==null?void 0:t.split(/\s*,\s*|\r?\n+/))==null?void 0:r.map(c=>c.trim()))==null?void 0:a.filter(c=>!l||c.length>0);return n&&o&&(n=n.filter((c,f,g)=>c&&g.indexOf(c)==f)),n}function na(t,l=!0,o=!0){var r,a;let n=(a=(r=t==null?void 0:t.split(/\r?\n/))==null?void 0:r.map(c=>c.trim()))==null?void 0:a.filter(c=>!l||c.length>0);return n&&o&&(n=n.filter((c,f,g)=>c&&g.indexOf(c)==f)),n}function la(t){const l=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return!!t.toLowerCase().match(l)}function Ro(t,l=!1){switch(typeof t){case"number":return l?Math.max(0,Math.max(100,t*100)):t*100;case"string":const o=t.indexOf("%");if(o>-1){t=t.substring(0,o-1);const n=Number(t);if(!Number.isNaN(n))return l?Math.max(0,Math.max(100,n)):n}else{const n=Number(t);if(!Number.isNaN(n))return l?Math.max(0,Math.max(100,n*100)):n*100}}}function Oo(t){return t==null?!0:/^\s*$/.test(t)}function ra(t,l){return Oo(t)?l:t}const Ne=Ae.defineStore("common",{state:()=>({themeName:localStorage.getItem("theme"),menuCollapsed:Re(localStorage.getItem("menu-collapsed")),isFullscreen:!1,sharedData:{}}),getters:{isDarkTheme:t=>t.themeName=="darkTheme"},actions:{toggleTheme(){this.themeName=="darkTheme"?this.setThemeName(null):this.setThemeName("darkTheme")},setThemeName(t){this.themeName=t,t?localStorage.setItem("theme",t):localStorage.removeItem("theme")},setMenuCollapsed(t){this.menuCollapsed=t,localStorage.setItem("menu-collapsed",t.toString())},setIsFullscreen(t){this.isFullscreen=t},async fetchSharedData(t,l){let o=this.sharedData[t];if(o||(o={key:t,isLoading:!1,data:void 0,error:void 0,promise:void 0},this.sharedData[t]=o),o.data!==void 0)return o.data;if(o.isLoading&&o.promise)return o.promise;try{o.isLoading=!0,o.promise=l();const n=await o.promise;return o.data=n,o.isLoading=!1,o.promise=void 0,n}catch(n){throw o.isLoading=!1,o.error=n,o.promise=void 0,n}}}}),aa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},sa=e.defineComponent({name:"ArrowDropDownOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",aa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M7 10l5 5l5-5H7z",fill:"currentColor"},null,-1)]))}}),ia={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ca=e.defineComponent({name:"CheckFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ia,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z",fill:"currentColor"},null,-1)]))}}),da={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},jo=e.defineComponent({name:"ClearFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",da,o[0]||(o[0]=[e.createElementVNode("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z",fill:"currentColor"},null,-1)]))}}),fa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ua=e.defineComponent({name:"CloseOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",fa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z",fill:"currentColor"},null,-1)]))}}),pa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ma=e.defineComponent({name:"ColorizeFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",pa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M20.71 5.63l-2.34-2.34a.996.996 0 0 0-1.41 0l-3.12 3.12l-1.93-1.91l-1.41 1.41l1.42 1.42L3 16.25V21h4.75l8.92-8.92l1.42 1.42l1.41-1.41l-1.92-1.92l3.12-3.12c.4-.4.4-1.03.01-1.42zM6.92 19L5 17.08l8.06-8.06l1.92 1.92L6.92 19z",fill:"currentColor"},null,-1)]))}}),ha={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ga=e.defineComponent({name:"DarkModeOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ha,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9.37 5.51A7.35 7.35 0 0 0 9.1 7.5c0 4.08 3.32 7.4 7.4 7.4c.68 0 1.35-.09 1.99-.27A7.014 7.014 0 0 1 12 19c-3.86 0-7-3.14-7-7c0-2.93 1.81-5.45 4.37-6.49zM12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 0 1-4.4 2.26a5.403 5.403 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z",fill:"currentColor"},null,-1)]))}}),ya={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Po=e.defineComponent({name:"EditFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ya,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a.996.996 0 0 0 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83l3.75 3.75l1.83-1.83z",fill:"currentColor"},null,-1)]))}}),wa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ca=e.defineComponent({name:"ExpandLessFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",wa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 8l-6 6l1.41 1.41L12 10.83l4.59 4.58L18 14z",fill:"currentColor"},null,-1)]))}}),ba={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ka=e.defineComponent({name:"ExpandMoreFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ba,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16.59 8.59L12 13.17L7.41 8.59L6 10l6 6l6-6z",fill:"currentColor"},null,-1)]))}}),Na={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Fo=e.defineComponent({name:"FolderTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Na,o[0]||(o[0]=[e.createElementVNode("path",{opacity:".3",d:"M11.17 8l-.58-.59L9.17 6H4v12h16V8h-8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l1.41 1.41l.59.59H20v10z",fill:"currentColor"},null,-1)]))}}),xa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Sa=e.defineComponent({name:"FullscreenExitFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",xa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z",fill:"currentColor"},null,-1)]))}}),Ia={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ba=e.defineComponent({name:"FullscreenFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ia,o[0]||(o[0]=[e.createElementVNode("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",fill:"currentColor"},null,-1)]))}}),Va={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ma=e.defineComponent({name:"ImportExportFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Va,o[0]||(o[0]=[e.createElementVNode("path",{d:"M9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z",fill:"currentColor"},null,-1)]))}}),Ta={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Aa=e.defineComponent({name:"LogOutFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ta,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 2h9a2 2 0 0 1 2 2v2h-2V4H6v16h9v-2h2v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M16.09 15.59L17.5 17l5-5l-5-5l-1.41 1.41L18.67 11H9v2h9.67z",fill:"currentColor"},null,-1)]))}}),Ea={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},_a=e.defineComponent({name:"ManageAccountsOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ea,o[0]||(o[0]=[e.createElementVNode("path",{d:"M4 18v-.65c0-.34.16-.66.41-.81C6.1 15.53 8.03 15 10 15c.03 0 .05 0 .08.01c.1-.7.3-1.37.59-1.98c-.22-.02-.44-.03-.67-.03c-2.42 0-4.68.67-6.61 1.82c-.88.52-1.39 1.5-1.39 2.53V20h9.26c-.42-.6-.75-1.28-.97-2H4zm6-6c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2s-2-.9-2-2s.9-2 2-2zm10.75 10c0-.22-.03-.42-.06-.63l1.14-1.01l-1-1.73l-1.45.49c-.32-.27-.68-.48-1.08-.63L18 11h-2l-.3 1.49c-.4.15-.76.36-1.08.63l-1.45-.49l-1 1.73l1.14 1.01c-.03.21-.06.41-.06.63s.03.42.06.63l-1.14 1.01l1 1.73l1.45-.49c.32.27.68.48 1.08.63L16 21h2l.3-1.49c.4-.15.76-.36 1.08-.63l1.45.49l1-1.73l-1.14-1.01c.03-.21.06-.41.06-.63zM17 18c-1.1 0-2-.9-2-2s.9-2 2-2s2 .9 2 2s-.9 2-2 2z",fill:"currentColor"},null,-1)]))}}),La={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ct=e.defineComponent({name:"MenuFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",La,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z",fill:"currentColor"},null,-1)]))}}),za={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Da=e.defineComponent({name:"MenuOpenFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",za,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 18h13v-2H3v2zm0-5h10v-2H3v2zm0-7v2h13V6H3zm18 9.59L17.42 12L21 8.41L19.59 7l-5 5l5 5L21 15.59z",fill:"currentColor"},null,-1)]))}}),$a={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ra=e.defineComponent({name:"MoreHorizFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",$a,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z",fill:"currentColor"},null,-1)]))}}),Oa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},ja=e.defineComponent({name:"NotificationsNoneTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Oa,o[0]||(o[0]=[e.createElementVNode("path",{opacity:".3",d:"M12 6.5c-2.49 0-4 2.02-4 4.5v6h8v-6c0-2.48-1.51-4.5-4-4.5z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 16v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5v6zm-4 5c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2z",fill:"currentColor"},null,-1)]))}}),Pa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Fa=e.defineComponent({name:"PasswordFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Pa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M2 17h20v2H2v-2zm1.15-4.05L4 11.47l.85 1.48l1.3-.75l-.85-1.48H7v-1.5H5.3l.85-1.47L4.85 7L4 8.47L3.15 7l-1.3.75l.85 1.47H1v1.5h1.7l-.85 1.48l1.3.75zm6.7-.75l1.3.75l.85-1.48l.85 1.48l1.3-.75l-.85-1.48H15v-1.5h-1.7l.85-1.47l-1.3-.75L12 8.47L11.15 7l-1.3.75l.85 1.47H9v1.5h1.7l-.85 1.48zM23 9.22h-1.7l.85-1.47l-1.3-.75L20 8.47L19.15 7l-1.3.75l.85 1.47H17v1.5h1.7l-.85 1.48l1.3.75l.85-1.48l.85 1.48l1.3-.75l-.85-1.48H23v-1.5z",fill:"currentColor"},null,-1)]))}}),Ha={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ga=e.defineComponent({name:"PlaylistAddCheckTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ha,o[0]||(o[0]=[e.createElementVNode("path",{d:"M3 10h11v2H3zm0-4h11v2H3zm0 8h7v2H3zm17.59-2.07l-4.25 4.24l-2.12-2.12l-1.41 1.41L16.34 19L22 13.34z",fill:"currentColor"},null,-1)]))}}),Ka={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Wa=e.defineComponent({name:"PlaylistAddFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ka,o[0]||(o[0]=[e.createElementVNode("path",{d:"M14 10H3v2h11v-2zm0-4H3v2h11V6zm4 8v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM3 16h7v-2H3v2z",fill:"currentColor"},null,-1)]))}}),Za={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Ya=e.defineComponent({name:"PrintTwotone",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Za,o[0]||(o[0]=[e.createElementVNode("path",{opacity:".3",d:"M8 5h8v3H8z",fill:"currentColor"},null,-1),e.createElementVNode("circle",{cx:"18",cy:"11.5",r:"1",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M19 8h-1V3H6v5H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zM8 5h8v3H8V5zm8 14H8v-4h8v4zm4-4h-2v-2H6v2H4v-4c0-.55.45-1 1-1h14c.55 0 1 .45 1 1v4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{opacity:".3",d:"M6 13h12v2h2v-4c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1v4h2v-2zm12-2.5c.55 0 1 .45 1 1s-.45 1-1 1s-1-.45-1-1s.45-1 1-1z",fill:"currentColor"},null,-1)]))}}),Qa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},Xa=e.defineComponent({name:"ReadMoreFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Qa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 7h9v2h-9zm0 8h9v2h-9zm3-4h6v2h-6zm-3 1L8 7v4H2v2h6v4z",fill:"currentColor"},null,-1)]))}}),Ja={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},je=e.defineComponent({name:"RefreshFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ja,o[0]||(o[0]=[e.createElementVNode("path",{d:"M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",fill:"currentColor"},null,-1)]))}}),qa={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},pe=e.defineComponent({name:"SearchFilled",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",qa,o[0]||(o[0]=[e.createElementVNode("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z",fill:"currentColor"},null,-1)]))}}),Ua={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 24 24"},va=e.defineComponent({name:"UnarchiveOutlined",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ua,o[0]||(o[0]=[e.createElementVNode("path",{d:"M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM6.24 5h11.52l.83 1H5.42l.82-1zM5 19V8h14v11H5zm3-5h2.55v3h2.9v-3H16l-4-4z",fill:"currentColor"},null,-1)]))}}),Ho={rootMenuName:"MainMenu",menuPosition:"side"},dt=Symbol("HalovConfig");function ft(){return e.inject(dt)}const es=["src"],xe=e.defineComponent({__name:"MenuIcon",props:{path:{},size:{default:16}},setup(t){const l=t,o=e.ref(n(l.path));function n(r){if(r)return`/api/core/SystemIcons/Icons?path=${encodeURIComponent(r)}`}return e.watch(()=>l.path,r=>o.value=n(r)),(r,a)=>o.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"menu-icon",src:o.value,style:e.normalizeStyle({width:r.size+"px",height:r.size+"px"})},null,12,es)):e.createCommentVNode("",!0)}}),Go=re(e.defineComponent({__name:"AppTabs",props:{tabs:{default:()=>[]},currentTab:{}},emits:["update:currentTab","closeTab","closeAll","closeOthers"],setup(t,{emit:l}){var x;const o=t,n=l,{t:r}=Z(),a=nt(),c=Ne(),f=e.computed(()=>c.menuCollapsed),g=((x=ft())==null?void 0:x.menuPosition)??"side",i=()=>c.setMenuCollapsed(!c.menuCollapsed),s=e.ref(o.currentTab),m=e.computed(()=>[{label:r("Close"),key:"close-current"},{label:r("Close All"),key:"close-all"},{label:r("Close Others"),key:"close-others"},{type:"divider",key:"------------1"},...o.tabs.map(S=>({label:r(S.title),key:S.id,url:S.url}))]);function d(S){o.tabs.find(T=>T.id==S)&&a.closeTab(S),n("closeTab",S)}function h(S){if(S.key=="close-current"||S.key=="close-all"||S.key=="close-others")return e.h(u.NIcon,null,{default:()=>e.h(ua)});if(S.key&&S.key==s.value)return e.h(u.NIcon,null,{default:()=>e.h(ca)})}function b(S){if(typeof S=="string"&&S)switch(S){case"close-current":n("closeTab",s.value);break;case"close-all":n("closeAll");break;case"close-others":n("closeOthers",s.value);break;default:s.value=S;break}}return e.watch(()=>o.currentTab,S=>{s.value=S}),e.watch(s,S=>{S!=o.currentTab&&n("update:currentTab",S)}),(S,P)=>S.tabs.length?(e.openBlock(),e.createBlock(e.unref(u.NTabs),{key:0,type:"card",closable:"",onClose:d,"tab-style":"min-width: 80px;",value:s.value,"onUpdate:value":P[0]||(P[0]=T=>s.value=T)},{prefix:e.withCtx(()=>[e.renderSlot(S.$slots,"prefix",{},()=>[e.unref(g)=="side"?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,text:"",style:{"margin-left":"8px"},onClick:i,title:f.value?e.unref(r)("Expand Menu"):e.unref(r)("Collapse Menu")},{icon:e.withCtx(()=>[f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(Da),{key:0})),f.value?(e.openBlock(),e.createBlock(e.unref(ct),{key:1})):e.createCommentVNode("",!0)]),_:1},8,["title"])):e.createCommentVNode("",!0)],!0)]),suffix:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{text:"",style:{"font-size":"24px"}},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NDropdown),{trigger:"click",options:m.value,placement:"bottom-end",onSelect:b,"render-icon":h},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(sa))]),_:1})]),_:1},8,["options"])]),_:1})]),default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.tabs,T=>(e.openBlock(),e.createBlock(e.unref(u.NTab),{key:T.id,name:T.id,title:T.id,closable:T.closable,class:"app-tab-item",style:e.normalizeStyle({"border-top-color":T.color})},{default:e.withCtx(()=>[T.icon?(e.openBlock(),e.createBlock(xe,{key:0,path:T.icon,style:{"margin-right":"4px"}},null,8,["path"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(e.unref(r)(T.title)),1)]),_:2},1032,["name","title","closable","style"]))),128))]),_:3},8,["value"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-df170cc3"]]),ts=e.defineComponent({props:{direction:{type:String,default:"Right"},step:{type:Number,default:1},intervalFrames:{type:Number,default:1}},setup(t){const l=e.ref(void 0);let o=0;function n(){const c=l.value;if(c){const f=t.step||1;switch(t.direction){case"Left":c.scrollWidth>c.clientWidth&&(c.scrollLeft+c.clientWidth>c.scrollWidth-3?c.scrollLeft=0:c.scrollLeft+=f);break;case"Bottom":c.scrollHeight>c.clientHeight&&(c.scrollTop<3?c.scrollTop=c.scrollHeight:c.scrollTop-=f);break;case"Top":c.scrollHeight>c.clientHeight&&(c.scrollTop+c.clientHeight>c.scrollHeight-3?c.scrollTop=0:c.scrollTop+=f);break;case"Right":default:c.scrollWidth>c.clientWidth&&(c.scrollLeft<3?c.scrollLeft=c.scrollWidth:c.scrollLeft-=f);break}}}function r(){o++,o>1e8&&(o=0);let c=t.intervalFrames||1;c<=0&&(c=1),o%c==0&&n(),l.value&&requestAnimationFrame(r)}function a(){const c=l.value;if(c){switch(t.direction){case"Left":c.scrollLeft=0;break;case"Bottom":c.scrollTop=c.scrollHeight;break;case"Top":c.scrollTop=0;break;case"Right":default:c.scrollLeft=c.scrollWidth;break}c.addEventListener("resize",()=>{console.log("resize me.")})}}return e.onMounted(()=>{a(),requestAnimationFrame(r)}),e.watch(()=>t.direction,()=>a()),{areaRef:l}}}),os={ref:"areaRef",style:{overflow:"hidden"}};function ns(t,l,o,n,r,a){return e.openBlock(),e.createElementBlock("div",os,[e.renderSlot(t.$slots,"default")],512)}const Ko=re(ts,[["render",ns]]);function Wo(t,l){let o=`/api/core/Barcode/${l.render=="svg"?"Svg":"Image"}?code=${encodeURIComponent(t)}&format=${l.format||"QR_CODE"}`;return l.width&&(o+=`&width=${l.width}`),l.height&&(o+=`&height=${l.height}`),l.showText&&(o+=`&showText=${l.showText}`),l.base64&&(o+=`&base64=${l.base64}`),l.backColor&&(o+=`&backColor=${encodeURIComponent(l.backColor)}`),l.foreColor&&(o+=`&foreColor=${encodeURIComponent(l.foreColor)}`),l.fontSize&&(o+=`&fontSize=${l.fontSize}`),l.margin&&(o+=`&margin=${encodeURIComponent(l.margin)}`),l.gs1Format&&(o+=`&gs1Format=${l.gs1Format}`),o}const Zo=e.defineComponent({__name:"BarcodeImage",props:{code:{},render:{},format:{},width:{},height:{},showText:{type:Boolean},base64:{type:Boolean},backColor:{},foreColor:{},fontSize:{},margin:{},gs1Format:{type:Boolean}},setup(t){const l=t,o=e.ref(void 0),n=()=>{o.value=Wo(l.code||"",{render:l.render,format:l.format,width:l.width,height:l.height,showText:l.showText,base64:l.base64,backColor:l.backColor,foreColor:l.foreColor,fontSize:l.fontSize,margin:l.margin,gs1Format:l.gs1Format})};return e.watch([l.render,l.code,l.format,l.width,l.height,l.showText,l.base64,l.backColor,l.foreColor,l.fontSize,l.margin,l.gs1Format],()=>n()),e.onMounted(()=>n()),(r,a)=>(e.openBlock(),e.createBlock(e.unref(u.NImage),{src:o.value,width:r.width,height:r.height},null,8,["src","width","height"]))}});function Yo(t){for(const l of t)l.guid&&(l.guid=l.guid.toLowerCase()),l.items&&Yo(l.items)}function ls(){try{const t=localStorage.getItem("userInfo");return t?JSON.parse(t):null}catch{return null}}const Se=Ae.defineStore("account",()=>{const t=e.reactive({userInfo:ls(),lastUserName:localStorage.getItem("lastUserName"),sessionToken:localStorage.getItem("sessionToken"),isLoadingMenu:!1,menus:null,messages:JSON.parse(localStorage.getItem("_msgs")??"[]")}),l=m=>{t.sessionToken=m,m?localStorage.setItem("sessionToken",m):localStorage.removeItem("sessionToken")},o=m=>{t.lastUserName=m,m?localStorage.setItem("lastUserName",m):localStorage.removeItem("lastUserName")},n=m=>{t.userInfo=m,m?localStorage.setItem("userInfo",JSON.stringify(m)):localStorage.removeItem("userInfo")},r=m=>{t.userInfo&&(t.userInfo.avatar=m,localStorage.setItem("userInfo",JSON.stringify(t.userInfo)))},a=()=>{t.userInfo=null,localStorage.removeItem("userInfo"),localStorage.removeItem("_msgs")},c=m=>{t.menus=m},f=m=>{t.isLoadingMenu=m},g=()=>{localStorage.removeItem("userInfo"),localStorage.removeItem("sessionToken"),a(),c(null),localStorage.removeItem("_msgs")},i=async m=>{var d;f(!0);try{m||(m=((d=ft())==null?void 0:d.rootMenuName)??"MainMenu");const h=await le.get(`/api/core/account/menus?rootName=${encodeURIComponent(m)}`);if(h.isSuccess){const b=h.value||[];Yo(b),c(b)}else console.log(h.errorMessage||"get remote menus error.")}catch(h){console.log(h)}finally{f(!1)}},s=m=>{t.messages.push(m),localStorage.setItem("_msgs",JSON.stringify(t.messages))};return{...e.toRefs(t),setSession:l,setLastUserName:o,setUser:n,setAvatar:r,clearUser:a,setMenus:c,setIsLoadingMenu:f,logout:g,loadMenus:i,addMessage:s}}),rs={key:0,style:{"padding-left":"1rem"}},ut=e.defineComponent({__name:"ChangePassword",props:{show:{type:Boolean}},emits:["close"],setup(t,{emit:l}){const o=l,{t:n}=Z(),r=u.useMessage(),a=e.inject("axios"),c=Se(),f=e.ref({oldPassword:"",newPassword:"",confirmPassword:""}),g=e.ref(!1),i=e.ref(null),s=e.computed(()=>{var S;return(S=c.userInfo)==null?void 0:S.userName}),m=e.ref([]),d={oldPassword:[{required:!0,message:n("Required here.")}],newPassword:[{required:!0,message:n("Required here.")}],confirmPassword:[{required:!0,message:n("Required here.")}]};function h(){var S;s.value&&!g.value&&i.value&&((S=i.value)==null||S.validate(P=>{if(!P)if(f.value.confirmPassword!=f.value.newPassword){r.error(n("Confirm the password is inconsistent, please check and re-enter."));return}else if(f.value.newPassword==f.value.oldPassword){r.error(n("The new password must not be the same as the old password!"));return}else b(s.value,f.value.oldPassword,f.value.newPassword)}))}async function b(S,P,T){try{const k={userName:S,oldPassword:P,newPassword:T},N=await a.post("/api/core/account/changePassword",k);N.isSuccess?(r.success(n("Password has been successfully modified!")),o("close")):r.error(n(N.errorMessage||"Error"))}catch(k){r.error((k==null?void 0:k.toString())||n("Error"))}}async function x(){try{const S=await a.get("/api/core/system/passwordOptions");S.isSuccess&&S.value!=null?m.value=S.value:r.error(n(S.errorMessage||"Error"))}catch(S){console.error(S),r.error((S==null?void 0:S.toString())||n("Error"))}}return e.onMounted(()=>{x()}),(S,P)=>{const T=e.resolveComponent("n-input"),k=e.resolveComponent("n-form-item"),N=e.resolveComponent("n-spin"),V=e.resolveComponent("n-text"),E=e.resolveComponent("n-button"),O=e.resolveComponent("n-modal");return e.openBlock(),e.createBlock(O,{show:S.show,onClose:P[3]||(P[3]=()=>S.$emit("close")),class:"custom-card",title:e.unref(n)("Change Password"),style:{width:"300px"},preset:"card",size:"medium"},{footer:e.withCtx(()=>[m.value.length?(e.openBlock(),e.createElementBlock("ul",rs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,j=>(e.openBlock(),e.createElementBlock("li",{key:j},[e.createVNode(V,{depth:"3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(j),1)]),_:2},1024)]))),128))])):e.createCommentVNode("",!0)]),action:e.withCtx(()=>[e.createVNode(E,{type:"primary",block:"",onClick:h},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("OK")),1)]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NForm),{model:f.value,ref_key:"formRef",ref:i,rules:d},{default:e.withCtx(()=>[e.createVNode(N,{show:g.value},{default:e.withCtx(()=>[e.createVNode(k,{label:e.unref(n)("User Name")},{default:e.withCtx(()=>[e.createVNode(T,{value:s.value,readonly:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(k,{path:"oldPassword",label:e.unref(n)("Old Password")},{default:e.withCtx(()=>[e.createVNode(T,{value:f.value.oldPassword,"onUpdate:value":P[0]||(P[0]=j=>f.value.oldPassword=j),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(k,{path:"newPassword",label:e.unref(n)("New Password")},{default:e.withCtx(()=>[e.createVNode(T,{value:f.value.newPassword,"onUpdate:value":P[1]||(P[1]=j=>f.value.newPassword=j),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"]),e.createVNode(k,{path:"confirmPassword",label:e.unref(n)("Confirm New Password")},{default:e.withCtx(()=>[e.createVNode(T,{value:f.value.confirmPassword,"onUpdate:value":P[2]||(P[2]=j=>f.value.confirmPassword=j),type:"password",placeholder:""},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["show"])]),_:1},8,["model"])]),_:1},8,["show","title"])}}}),pt=e.defineComponent({__name:"ColorInput",props:{value:{},label:{},readonly:{type:Boolean},placeholder:{},clearable:{type:Boolean}},emits:["update:value"],setup(t){return(l,o)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{readonly:l.readonly,value:l.value,placeholder:l.placeholder,clearable:l.clearable,"onUpdate:value":o[0]||(o[0]=n=>l.$emit("update:value",n))},null,8,["readonly","value","placeholder","clearable"]),e.createVNode(e.unref(u.NColorPicker),{value:l.value,"show-preview":"",modes:["hex"],placeholder:"",disabled:l.readonly,style:{"max-width":"80px"},"onUpdate:value":o[1]||(o[1]=n=>l.$emit("update:value",n))},{label:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ma))]),_:1})]),_:1},8,["value","disabled"])]),_:1}))}});function Qo(t){return typeof t=="object"&&t!==null&&"source"in t}function Ie(t){return typeof t=="object"&&t!==null&&"name"in t}function as(t){for(const l in t)delete t[l]}function Xo(t){const l={};for(const o of t){const n=o.name,r=l[n];if(o.nullable==!1)switch(o.dataType){case"number":l[n]=Number(r)||0;break;case"boolean":case"bool":l[n]=de(r)||!1;break;default:const a=$o(o.dataType);a!=null&&(l[n]=a)}}return l}function Jo(t,l,o){for(const n of l){const r=n.name,a=t[r];switch(n.dataType){case"number":n.nullable==!1?o[r]=Number(a)||0:o[r]=Number(a)||null;break;case"boolean":case"bool":n.nullable==!1?o[r]=de(a)||!1:o[r]=de(a)||null;break;default:o[r]=a||null;break}}}function qo(t,l){const o={};return Object.assign(o,t),Jo(t,l,o),o}function ss(t){if(!t)return!0;switch(t){case"number":case"boolean":return!1;default:return!0}}function Uo(t,l){const o=l||(r=>r.toString()),n=[];if(t.length){for(const r of t)if(typeof r=="string"&&r)n.push({name:r,label:o(te(r)),visibility:!0,editor:"text"});else if(Ie(r)&&r.editing!="hidden"&&r.name){const a={name:r.name,role:r.role&&!Array.isArray(r.role)?[r.role]:r.role,dataType:r.dataType,minValue:r.minValue,maxValue:r.maxValue,group:r.group,nullable:r.required==null?ss(r.dataType):!r.required,label:r.title?o(r.title):o(te(r.name)),visibility:!0,readonly:r.readonly,sortable:r.sortable,editor:r.editor||r.dataType||"text",editorConfig:r.editorConfig,tagSource:r.tagSource,description:r.description};r.editing=="readonly"?a.readonly=!0:(r.editing=="create"||r.editing=="edit")&&(a.visibility=[r.editing]),r.required!=null&&(a.nullable=!r.required),r.values&&(Array.isArray(r.values)?(a.values=r.values,a.valueSource={type:"static",isLoading:!1,values:r.values.map(c=>{if(typeof c=="string"){let f=c;return f&&(r.prefix&&(f=r.prefix+f),r.suffix&&(f=f+r.suffix)),{value:c,label:o(f)}}else return c})}):typeof r.values=="function"?a.valueSource={type:"function",func:r.values,isLoading:!1}:Array.isArray(r.values.source)?a.valueSource={type:"static",isLoading:!1,values:r.values.source.map(c=>{if(typeof c=="string"){let f=c;return f&&(r.prefix&&(f=r.prefix+f),r.suffix&&(f=f+r.suffix)),{value:c,label:o(f)}}else return c})}:a.valueSource={type:"remote",isLoading:!1,key:r.values.key,label:r.values.label,subLabel:r.values.subLabel,renderLabel:r.values.renderLabel,labelTemplate:r.values.labelTemplate,prefix:r.values.prefix,suffix:r.values.suffix,i18n:r.i18n,filterable:r.values.filterable,sourceUrl:r.values.source,values:[]}),n.push(a)}}return n}function mt(t){if(t){if(typeof t=="number")return t;switch(t){case"x-large":return 480;case"large":return 300;case"medium":return 160;case"small":return 60;case"x-small":return 30;default:return t}}else return t}function Be(t){const l=new Array;for(const o of t)if(typeof o=="string")l.push({name:o,title:te(o),sortIndex:0,visible:!0});else if(Ie(o)&&o.grid!="none"){if(o.visible!=null&&(typeof o.visible=="boolean"&&!o.visible||typeof o.visible=="function"&&!o.visible.call(null)))continue;const n={name:o.name,title:o.title,role:o.role&&!Array.isArray(o.role)?[o.role]:o.role,behavior:o.grid,align:o.align,fixed:o.gridFixed,dataType:o.dataType,href:o.href,i18n:o.i18n,template:o.template,prefix:o.prefix,suffix:o.suffix,formatter:o.formatter,display:o.display,values:o.values,width:mt(o.size),minWidth:mt(o.minWidth),textOverflow:o.textOverflow,sortIndex:0,sortable:o.sortable==null?!0:o.sortable,referencePage:o.referencePage,tagSource:o.tagSource,visible:!0,className:o.className,render:o.render,click:o.click};o.children&&o.children.length&&(n.children=Be(o.children)),l.push(n)}return l.sort((o,n)=>(o.sortIndex||0)-(n.sortIndex||0)),l}function is(t,l){return Ce.render(t,l)}function vo(t,l){var r;const o=l||(a=>a.toString()),n=new Array;for(const a of t)if(Ie(a)&&a.search){const c={name:a.name,role:a.role&&!Array.isArray(a.role)?[a.role]:a.role,label:a.title?o(a.title):o(te(a.name)),editor:a.editor||a.dataType||"text",dataType:a.dataType,nullable:!0,searchMethod:"normal",template:a.template,prefix:a.prefix,suffix:a.suffix};if(typeof a.search=="boolean")c.searchMethod="normal";else if(typeof a.search=="string")a.search=="range"&&(c.searchMethod=a.search);else{if(a.search.editor&&(c.editor=a.search.editor),a.search.method=="range"?c.searchMethod="range":c.searchMethod="normal",a.search.required&&(c.nullable=!1),a.search.role){const f=Array.isArray(a.search.role)?a.search.role:[a.search.role];if(c.role)for(let g of f)c.role.includes(g)||c.role.push(g);else c.role=f}a.search.field&&(c.searchField=a.search.field),c.defaultValue=a.search.default}if(a.values&&(Array.isArray(a.values)?c.valueSource={type:"static",isLoading:!1,values:a.values.map(f=>{if(typeof f=="string"){let g=f;return a.formatter&&(g=a.formatter.call(null,g,null)??g),g&&(c.prefix&&(g=c.prefix+g),c.suffix&&(g=g+c.suffix)),{value:f,label:o(g)}}else return f})}:typeof a.values=="function"?c.valueSource={type:"function",func:a.values,isLoading:!1}:Array.isArray(a.values.source)?c.valueSource={type:"static",isLoading:!1,values:a.values.source.map(f=>{var g;return typeof f=="string"?{value:f,label:o(((g=a.formatter)==null?void 0:g.call(null,f,null))||f)}:f})}:c.valueSource={type:"remote",isLoading:!1,key:a.values.key,label:a.values.label,subLabel:a.values.subLabel,renderLabel:a.values.renderLabel,labelTemplate:a.values.labelTemplate,prefix:a.values.prefix,suffix:a.values.suffix,filterable:a.values.filterable,i18n:a.values.i18n,sourceUrl:a.values.source,values:[]},c.dataType=="boolean"&&Array.isArray((r=c.valueSource)==null?void 0:r.values))){const f=c.valueSource.values;f.length<=2&&f.splice(0,0,{value:"",label:""})}n.push(c)}return n}async function Pe(t,l,o,n,r){if(l.sourceUrl){l.isLoading=!0,l.values?l.values.length=0:l.values=[];try{let a=l.sourceUrl;o&&(a=U(a,o));const c=await t.get(a);if(c.isSuccess&&c.value!=null){let f=c.value;if(!Array.isArray(f)&&"rows"in f&&Array.isArray(f.rows)&&(f=f.rows),Array.isArray(f)){const g=f.filter(i=>i&&!0).map(i=>{if(typeof i=="string")return{value:i,label:n?n(i):i};{let s;if(l.renderLabel)s=l.renderLabel(i);else if(l.labelTemplate)s=Ce.render(l.labelTemplate,i);else{if(s=i[l.label||"label"],n&&(s=n(s)),l.subLabel){const m=i[l.subLabel];typeof m=="string"&&(s+=" "+(n?n(m):m))}s&&(l.prefix&&(s=l.prefix+s),l.suffix&&(s=s+l.suffix))}return{value:i[l.key||"value"],label:s}}});r&&g.splice(0,0,{value:void 0,label:""}),l.values.length=0,l.values.push(...g)}}}finally{l.isLoading=!1}}}function ht(t,l){return()=>e.h(u.NIcon,l?{color:l}:null,{default:()=>e.h(t)})}function cs(t,l,o){if(t)return e.h(u.NIcon,o?{color:o}:null,{default:()=>e.h(l)})}function ds(t,l,o){return e.h(u.NButton,Object.assign({text:!0,onClick:l},o),{default:()=>e.h(u.NIcon,{size:20},{default:()=>e.h(t)})})}function fs(t,l){const o=t[l];let n="";return typeof o=="number"&&(o>0?n="text-positive":o<0&&(n="text-negative")),e.h("span",{class:n},o==null?void 0:o.toString())}const Fe=e.defineComponent({__name:"HaloDatePicker",props:{value:{},type:{},readonly:{type:Boolean},clearable:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=f=>{const g=_o(f);return g===void 0?null:g},a=e.ref(r(o.value)),c=f=>{if(f!=null){a.value=f;const g=o.type=="date"?st(f):it(f);n("update:value",g,f)}else n("update:value",null,f)};return e.watch(()=>o.value,f=>a.value=r(f)),(f,g)=>(e.openBlock(),e.createBlock(e.unref(u.NDatePicker),{value:a.value,type:f.type,placeholder:"",disabled:f.readonly,"onUpdate:value":c,clearable:f.clearable},null,8,["value","type","disabled","clearable"]))}}),gt=e.defineComponent({__name:"HaloTimePicker",props:{value:{},type:{},readonly:{type:Boolean},clearable:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=f=>{if(f==null)return null;if(typeof f=="number"){const g=new Date(2e3,1,1);return g.setSeconds(f),g.getTime()}else if(typeof f=="string"){const g=Eo(f);if(!g)return null;const i=new Date(2e3,1,1);return i.setMilliseconds(g.millisecond+g.second*1e3+g.minute*60*1e3+g.hour*60*60*1e3),i.getTime()}else return f instanceof Date?f.getTime():null},a=f=>{if(f!=null){c.value=f;const g=new Date;g.setTime(f);const i=g.getSeconds()+g.getMinutes()*60+g.getHours()*60*60;n("update:value",i)}else n("update:value",null)},c=e.ref(r(o.value));return e.watch(()=>o.value,f=>c.value=r(f)),(f,g)=>(e.openBlock(),e.createBlock(e.unref(u.NTimePicker),{value:c.value,type:f.type,placeholder:"",disabled:f.readonly,"onUpdate:value":a,clearable:f.clearable},null,8,["value","type","disabled","clearable"]))}}),yt=e.defineComponent({__name:"NullableBooleanInput",props:{value:{type:Boolean},readonly:{type:Boolean}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref(typeof o.value=="boolean"?o.value.toString():""),c=[{value:null,label:""},{value:"true",label:r("Yes")},{value:"false",label:r("No")}],f=g=>{const i=de(g);i==null?n("update:value",null):n("update:value",i)};return e.watch(()=>o.value,()=>a.value=typeof o.value=="boolean"?o.value.toString():""),(g,i)=>(e.openBlock(),e.createBlock(e.unref(u.NSelect),{value:a.value,options:c,placeholder:"",disabled:g.readonly,clearable:"","onUpdate:value":i[0]||(i[0]=s=>f(s))},null,8,["value","disabled"]))}}),wt=()=>{const{t}=Z(),l=u.useMessage(),o=u.useDialog(),n=u.useModal(),r=b=>b&&t(b),a=b=>e.h("div",{},b.split(`
3
+ `).map(x=>e.h("span",{class:"line"},t(x))));return{t:r,message:(b,x)=>{switch(x){case"create":l.create(()=>a(b));break;case"error":l.error(()=>a(b));break;case"loading":l.loading(t(b));break;case"success":l.success(t(b));break;case"warning":l.warning(t(b));break;default:case"info":l.info(t(b));break}},confirm:(b,x,S)=>{o.warning({title:t(b??"Confirm"),draggable:!0,content:()=>a(x),positiveText:t("OK"),negativeText:t("Cancel"),onPositiveClick:()=>S()})},error:b=>l.error(t(b)),success:b=>l.success(t(b)),warning:b=>l.warning(t(b)),info:b=>l.info(t(b)),errorDialog:(b,x,S)=>{o.error({title:t(x??"Error"),draggable:!0,content:()=>a(b),positiveText:t("OK"),onPositiveClick:()=>S==null?void 0:S()})},successDialog:(b,x,S)=>{o.success({title:t(x??"Success"),draggable:!0,content:()=>a(b),positiveText:t("OK"),onPositiveClick:()=>S==null?void 0:S()})},warningDialog:(b,x,S)=>{o.warning({title:t(x??"Warning"),draggable:!0,content:()=>a(b),positiveText:t("OK"),onPositiveClick:()=>S==null?void 0:S()})},infoDialog:(b,x,S)=>{o.info({title:t(x??"Information"),draggable:!0,content:()=>a(b),positiveText:t("OK"),onPositiveClick:()=>S==null?void 0:S()})},showSearchModal:b=>{let x=[];const S=n.create({title:t(b.title??"Search"),preset:"card",style:{width:b.width??"800px",height:b.height??"600px"},contentClass:"flex-column",draggable:b.draggable,content:()=>e.h(e.resolveComponent("SearchPanel"),{class:"flex-grow-1",config:b.config,multiSelect:b.multiSelect==!0,onSearchBack:P=>{b.callback.call(null,P)},onResultSelected:(P,T)=>{x=T??[]}}),footer:()=>e.h("div",{class:"flex-row",style:"justify-content:space-between"},[e.h(u.NButton,{type:"primary",style:"min-width: 100px",onClick:()=>{x.length&&(b.callback.call(null,x),S.destroy())}},()=>t("OK")),e.h(u.NButton,{ghost:!0,style:"min-width: 100px",onClick:()=>S.destroy()},()=>t("Close"))])})},showQrModal:(b,x)=>{const S=n.create({title:x,preset:"card",style:{width:"300px"},draggable:!0,content:()=>e.h("div",{class:"flex-column",style:"align-items: center"},[e.h(u.NQrCode,{value:b,size:160}),e.h("div",{class:"text-monospace",style:"font-size: large; margin: 0.25em"},b),e.h(u.NButton,{type:"primary",onClick:()=>S.destroy(),style:"align-self: center; min-width: 100px; margin-top: 1em;"},()=>t("Close"))])})}}};var He=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ge={exports:{}},us=Ge.exports,en;function ps(){return en||(en=1,function(t,l){(function(o,n){n()})(us,function(){function o(i,s){return typeof s>"u"?s={autoBom:!1}:typeof s!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),s={autoBom:!s}),s.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\uFEFF",i],{type:i.type}):i}function n(i,s,m){var d=new XMLHttpRequest;d.open("GET",i),d.responseType="blob",d.onload=function(){g(d.response,s,m)},d.onerror=function(){console.error("could not download file")},d.send()}function r(i){var s=new XMLHttpRequest;s.open("HEAD",i,!1);try{s.send()}catch{}return 200<=s.status&&299>=s.status}function a(i){try{i.dispatchEvent(new MouseEvent("click"))}catch{var s=document.createEvent("MouseEvents");s.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),i.dispatchEvent(s)}}var c=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof He=="object"&&He.global===He?He:void 0,f=c.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=c.saveAs||(typeof window!="object"||window!==c?function(){}:"download"in HTMLAnchorElement.prototype&&!f?function(i,s,m){var d=c.URL||c.webkitURL,h=document.createElement("a");s=s||i.name||"download",h.download=s,h.rel="noopener",typeof i=="string"?(h.href=i,h.origin===location.origin?a(h):r(h.href)?n(i,s,m):a(h,h.target="_blank")):(h.href=d.createObjectURL(i),setTimeout(function(){d.revokeObjectURL(h.href)},4e4),setTimeout(function(){a(h)},0))}:"msSaveOrOpenBlob"in navigator?function(i,s,m){if(s=s||i.name||"download",typeof i!="string")navigator.msSaveOrOpenBlob(o(i,m),s);else if(r(i))n(i,s,m);else{var d=document.createElement("a");d.href=i,d.target="_blank",setTimeout(function(){a(d)})}}:function(i,s,m,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof i=="string")return n(i,s,m);var h=i.type==="application/octet-stream",b=/constructor/i.test(c.HTMLElement)||c.safari,x=/CriOS\/[\d]+/.test(navigator.userAgent);if((x||h&&b||f)&&typeof FileReader<"u"){var S=new FileReader;S.onloadend=function(){var k=S.result;k=x?k:k.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=k:location=k,d=null},S.readAsDataURL(i)}else{var P=c.URL||c.webkitURL,T=P.createObjectURL(i);d?d.location=T:location.href=T,d=null,setTimeout(function(){P.revokeObjectURL(T)},4e4)}});c.saveAs=g.saveAs=g,t.exports=g})}(Ge)),Ge.exports}var ms=ps();function tn(){const t=le.create({headers:{"Content-type":"application/json"},timeout:3e5});return t.interceptors.request.use(l=>{const o=localStorage.getItem("sessionToken");return o&&l.headers&&(l.headers.Authorization=`Bearer ${o}`),l},l=>(console.log(l),Promise.reject(l))),t}function hs(t){if(t){const l=t.match(/filename\*=UTF-8'(?:.*)'(.*)/);if(l&&l.length>1)return decodeURIComponent(l[1]);const o=t.match(/filename=(.*)/);if(o&&o.length>1)return o[1]}}async function me(t,l,o,n){var s;const r=tn();let a;(n==null?void 0:n.toLowerCase())=="post"?a=await r.post(t,{responseType:"blob"}):a=await r.get(t,{responseType:"blob"});const{data:c,headers:f,status:g,statusText:i}=a;if(g==200||c.length){f&&(o||(o=(s=f["content-type"])==null?void 0:s.toString()),l||(l=hs(f["content-disposition"])));const m=new Blob([c],{type:o||"application/octet-stream"});ms.saveAs(m,l)}else throw`[${g}] ${i}`}async function on(t,l,o){var i;const n=tn();let r;(o==null?void 0:o.toLowerCase())=="post"?r=await n.post(t,{responseType:"blob"}):r=await n.get(t,{responseType:"blob"});const{data:a,headers:c,status:f,statusText:g}=r;if(f==200||a.length){c&&(l||(l=(i=c["content-type"])==null?void 0:i.toString()));const s=new Blob([a],{type:l||"application/octet-stream"}),m=URL.createObjectURL(s);window.open(m)}else throw`[${f}] ${g}`}function nn(t,l){let o=t.length,n=0;for(;o--;)l(t[o],o)&&(t.splice(o,1),n++);return n}function gs(t,l){var o={};for(let n of t){const r=l(n);o[r]?o[r].push(n):o[r]=[]}return o}function ln(t,l,o){l<0||l>=t.length||o<0||o>=t.length||l==o||t.splice(o,0,...t.splice(l,1))}function ys(t,l,o,n,r,a){const c={name:t,label:l||te(t),editor:o||"text",dataType:o,nullable:!0,visibility:!0,searchMethod:n||"normal"},f=a??(g=>g);return r&&(typeof r=="string"?c.valueSource={type:"remote",isLoading:!1,key:"key",label:"label",sourceUrl:r}:Array.isArray(r)?c.dataType=="boolean"&&r.length==2&&typeof r[0]=="string"?c.valueSource={type:"static",isLoading:!1,values:[{value:"",label:""},{value:"true",label:f(r[0])},{value:"false",label:f(r[1])}]}:c.valueSource={type:"static",isLoading:!1,values:r.map(g=>typeof g=="string"?{value:g,label:f(g)}:g)}:Qo(r)?Array.isArray(r.source)?c.valueSource={type:"static",isLoading:!1,filterable:r.filterable,values:[{value:"",label:""},...r.source.map(g=>typeof g=="string"?{value:g,label:f(g)}:g)]}:c.valueSource={type:"remote",isLoading:!1,key:r.key,label:r.label,subLabel:r.subLabel,labelTemplate:r.labelTemplate,i18n:r.i18n,sourceUrl:r.source,filterable:r.filterable,values:[]}:c.valueSource={type:"static",isLoading:!1,values:Object.keys(r).map(g=>({value:r[g],label:f(g)}))}),c}function ws(...t){const l=new Map;return t.forEach(o=>{o.forEach(n=>{n.name?l.set(n.name.toString(),n):l.set(n.path,n)})}),Array.from(l.values())}function Cs(t,l,o){if(t<=0||l<=0||o<0||!Number.isInteger(l)||!Number.isInteger(o)){console.error("Invalid arguments.");return}const n=Math.pow(10,o);let r=Math.floor(t*n);const a=[],c=Math.max(1,Math.floor(r/l));let f=r;for(let g=0;g<l;g++){let i;g==l-1?i=Math.max(0,f):(i=Math.min(c,f),f=Math.max(0,f-c)),i=parseFloat((i/n).toFixed(o)),a.push(i)}return a}function bs(t,l,o){if(t<=0||l<=0||o<0||!Number.isInteger(o)){console.error("Invalid arguments.");return}const n=Math.pow(10,o),r=Math.round(t*n),a=Math.round(l*n),c=[];let f=r;for(;f>0;){let g=Math.min(a,f);f-=a,c.push(parseFloat((g/n).toFixed(o)))}return c}function ks(t,l){if(l<0||!Number.isInteger(l)){console.error("Invalid arguments.");return}const o=Math.pow(10,l);let n=0;for(const r of t)n+=Math.round(r*o);return n/o}function Ns(){const t=e.ref(new Map),l=i=>(t.value.has(i)||t.value.set(i,{isLocked:!1,waitingQueue:[]}),t.value.get(i));async function o(i){const s=l(i);return s.isLocked?new Promise(m=>{s.waitingQueue.push(()=>{s.isLocked=!0,m(()=>r(i))})}):(s.isLocked=!0,()=>r(i))}function n(i){const s=l(i);return s.isLocked?null:(s.isLocked=!0,()=>r(i))}function r(i){const s=l(i);if(!s.isLocked)return;s.isLocked=!1;const m=s.waitingQueue.shift();m&&m(),!s.isLocked&&s.waitingQueue.length===0&&t.value.delete(i)}async function a(i,s){const m=await o(i);try{return await Promise.resolve(s())}finally{m()}}async function c(i,s,m="Failed to acquire the operation lock."){const d=n(i);if(!d)throw console.error(`Failed to acquire the operation lock.(key: ${i})`),m;try{return await Promise.resolve(s())}finally{d()}}function f(i){return l(i).isLocked}function g(i){t.value.delete(i)}return{runExclusive:a,lock:o,unlock:r,tryLock:n,runExclusiveOrThrow:c,isLocked:f,clearLock:g}}const ie=()=>{const t=wt(),l=e.inject("axios"),o=Ns();async function n(s,m="Error"){if(s)if(s.response){let d=t.t(s.response.statusText);return s.response.data&&(s.response.data instanceof Blob?d+=`
4
4
  `+t.t(await s.response.data.text()):d+=`
5
- `+t.t(s.response.data.toString()),console.log(d)),d}else return s.toString();else return m}function r(s,m,d){d.mutexKey==null&&(d.mutexKey=d.url),t.confirm(s,m,()=>{c(d)})}async function a(s){var m,d,h,b,x,S;try{(m=s.loadingStatus)==null||m.call(null,!0);let P;s.data?P=await l.post(s.url,s.data):P=await l.post(s.url),(d=s.callback)==null||d.call(null,P),P.isSuccess?((h=s.success)==null||h.call(null,P.value),s.successMessage===!0?t.message("Successful operation.","success"):typeof s.successMessage=="string"&&t.message(s.successMessage,"success")):((b=s.fail)==null||b.call(null,P),P.errorMessage&&console.error(P.errorMessage),s.failMessage?t.message(s.failMessage,"error"):t.message(P.errorMessage??((x=P.value)==null?void 0:x.toString())??"Error","error"))}catch(P){t.message(await n(P)??s.failMessage??"Error")}finally{(S=s.loadingStatus)==null||S.call(null,!1)}}async function c(s){if(s.mutexKey)try{const m=typeof s.mutexKey=="boolean"?s.url:s.mutexKey;await o.runExclusiveOrThrow(m,()=>a(s))}catch(m){t.message(await n(m)??s.failMessage??"Error")}else await a(s)}async function f(s){var m,d,h,b;try{(m=s.loadingStatus)==null||m.call(null,!0);let x=await l.get(s.url);if(x.isSuccess)return(d=s.callback)==null||d.call(null,x.value),x.value;s.quiet!=!0&&t.message(x.errorMessage??((h=x.value)==null?void 0:h.toString())??"Error","error")}catch(x){t.message(await n(x)??"Error","error")}finally{(b=s.loadingStatus)==null||b.call(null,!1)}}async function g(s){var m,d,h;try{(m=s.loadingStatus)==null||m.call(null,!0),await on(s.url,s.contentType,s.method),(d=s.callback)==null||d.call(null)}catch(b){t.message(await n(b)??"Error","error")}finally{(h=s.loadingStatus)==null||h.call(null,!1)}}async function i(s){var m,d,h;try{(m=s.loadingStatus)==null||m.call(null,!0),await me(s.url,s.filename,s.contentType,s.method),(d=s.callback)==null||d.call(null)}catch(b){t.message(await n(b)??"Error","error")}finally{(h=s.loadingStatus)==null||h.call(null,!1)}}return{post:c,get:f,confirmToPost:r,getHttpErrorMessage:n,openFile:g,downloadFile:i}},wt=e.defineComponent({__name:"HaloTagsInput",props:{value:{},disabled:{type:Boolean,default:!1},tagSource:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=Ne(),a=ie(),c=e.ref(i(o.value)),f=e.ref([]);async function g(){if(o.tagSource){const m=await r.fetchSharedData(`tags:${o.tagSource}`,async()=>await a.get({url:`/api/core/CommonCodeItems/list?commonCode=${o.tagSource}`})??[]);f.value=m.map(d=>({value:d.code,label:`[${d.code}] ${d.name}`}))}else f.value=[]}function i(m){return m?m.split(","):[]}function s(m){o.disabled||(Array.isArray(m)?n("update:value",m.join(",")):n("update:value",m))}return e.watch(()=>o.value,m=>c.value=i(m)),e.watch(()=>o.tagSource,()=>g()),e.onMounted(()=>g()),(m,d)=>m.tagSource?(e.openBlock(),e.createBlock(e.unref(u.NSelect),{key:0,value:c.value,multiple:"",options:f.value,"onUpdate:value":s},null,8,["value","options"])):(e.openBlock(),e.createBlock(e.unref(u.NDynamicTags),{key:1,value:c.value,"onUpdate:value":s},null,8,["value"]))}}),Ct=e.defineComponent({__name:"ListInputModal",props:{title:{},message:{},value:{},placeholder:{default:""},maxLength:{},show:{type:Boolean},readonly:{type:Boolean}},emits:["update:show","update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=()=>{o.readonly||n("update:value",f()),n("update:show",!1)},c=()=>{var i,s,m,d;return o.value?Array.isArray(o.value)?o.value.join(`
5
+ `+t.t(s.response.data.toString()),console.log(d)),d}else return s.toString();else return m}function r(s,m,d){d.mutexKey==null&&(d.mutexKey=d.url),t.confirm(s,m,()=>{c(d)})}async function a(s){var m,d,h,b,x,S;try{(m=s.loadingStatus)==null||m.call(null,!0);let P;s.data?P=await l.post(s.url,s.data):P=await l.post(s.url),(d=s.callback)==null||d.call(null,P),P.isSuccess?((h=s.success)==null||h.call(null,P.value),s.successMessage===!0?t.message("Successful operation.","success"):typeof s.successMessage=="string"&&t.message(s.successMessage,"success")):((b=s.fail)==null||b.call(null,P),P.errorMessage&&console.error(P.errorMessage),s.failMessage?t.message(s.failMessage,"error"):t.message(P.errorMessage??((x=P.value)==null?void 0:x.toString())??"Error","error"))}catch(P){t.message(await n(P)??s.failMessage??"Error")}finally{(S=s.loadingStatus)==null||S.call(null,!1)}}async function c(s){if(s.mutexKey)try{const m=typeof s.mutexKey=="boolean"?s.url:s.mutexKey;await o.runExclusiveOrThrow(m,()=>a(s))}catch(m){t.message(await n(m)??s.failMessage??"Error")}else await a(s)}async function f(s){var m,d,h,b;try{(m=s.loadingStatus)==null||m.call(null,!0);let x=await l.get(s.url);if(x.isSuccess)return(d=s.callback)==null||d.call(null,x.value),x.value;s.quiet!=!0&&t.message(x.errorMessage??((h=x.value)==null?void 0:h.toString())??"Error","error")}catch(x){t.message(await n(x)??"Error","error")}finally{(b=s.loadingStatus)==null||b.call(null,!1)}}async function g(s){var m,d,h;try{(m=s.loadingStatus)==null||m.call(null,!0),await on(s.url,s.contentType,s.method),(d=s.callback)==null||d.call(null)}catch(b){t.message(await n(b)??"Error","error")}finally{(h=s.loadingStatus)==null||h.call(null,!1)}}async function i(s){var m,d,h;try{(m=s.loadingStatus)==null||m.call(null,!0),await me(s.url,s.filename,s.contentType,s.method),(d=s.callback)==null||d.call(null)}catch(b){t.message(await n(b)??"Error","error")}finally{(h=s.loadingStatus)==null||h.call(null,!1)}}return{post:c,get:f,confirmToPost:r,getHttpErrorMessage:n,openFile:g,downloadFile:i}},Ct=e.defineComponent({__name:"HaloTagsInput",props:{value:{},disabled:{type:Boolean,default:!1},tagSource:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=Ne(),a=ie(),c=e.ref(i(o.value)),f=e.ref([]);async function g(){if(o.tagSource){const m=await r.fetchSharedData(`tags:${o.tagSource}`,async()=>await a.get({url:`/api/core/CommonCodeItems/list?commonCode=${o.tagSource}`})??[]);f.value=m.map(d=>({value:d.code,label:`[${d.code}] ${d.name}`}))}else f.value=[]}function i(m){return m?m.split(","):[]}function s(m){o.disabled||(Array.isArray(m)?n("update:value",m.join(",")):n("update:value",m))}return e.watch(()=>o.value,m=>c.value=i(m)),e.watch(()=>o.tagSource,()=>g()),e.onMounted(()=>g()),(m,d)=>m.tagSource?(e.openBlock(),e.createBlock(e.unref(u.NSelect),{key:0,value:c.value,multiple:"",options:f.value,"onUpdate:value":s},null,8,["value","options"])):(e.openBlock(),e.createBlock(e.unref(u.NDynamicTags),{key:1,value:c.value,"onUpdate:value":s},null,8,["value"]))}}),bt=e.defineComponent({__name:"ListInputModal",props:{title:{},message:{},value:{},placeholder:{default:""},maxLength:{},show:{type:Boolean},readonly:{type:Boolean}},emits:["update:show","update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=()=>{o.readonly||n("update:value",f()),n("update:show",!1)},c=()=>{var i,s,m,d;return o.value?Array.isArray(o.value)?o.value.join(`
6
6
  `):((d=(m=(s=(i=o.value)==null?void 0:i.replace(/\n/g,","))==null?void 0:s.split(","))==null?void 0:m.map(b=>b.trim()))==null?void 0:d.filter((b,x,S)=>b&&S.indexOf(b)==x)).join(`
7
- `):o.value},f=()=>{var s,m,d;return g.value?((d=(m=(s=g.value)==null?void 0:s.split(/\r?\n/))==null?void 0:m.map(h=>h.trim()))==null?void 0:d.filter((h,b,x)=>h&&x.indexOf(h)==b)).join(","):""},g=e.ref(c());return e.watch(()=>o.value,()=>{g.value=c()}),(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{title:i.title,show:i.show,preset:"card",style:{width:"350px"},draggable:"",onClose:s[2]||(s[2]=()=>i.$emit("update:show",!1))},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:a,disabled:i.readonly},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["disabled"]),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:s[1]||(s[1]=()=>i.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.message),1)]),_:1}),e.createVNode(e.unref(u.NInput),{value:g.value,"onUpdate:value":s[0]||(s[0]=m=>g.value=m),placeholder:i.placeholder,maxlength:i.maxLength,type:"textarea",readonly:i.readonly,rows:16,class:"halo-form-code"},null,8,["value","placeholder","maxlength","readonly"])]),_:1})]),_:1},8,["title","show"]))}}),bt=e.defineComponent({__name:"HaloModalInput",props:{value:{},label:{},inputReadOnly:{type:Boolean},placeholder:{},config:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref(!1),c=o.config;function f(){a.value=!a.value}function g(i){i!=null&&(n("update:value",i),a.value=!1)}return e.watch(()=>o.value,i=>{console.log(`value changed: [${i}]`)}),e.onMounted(()=>{console.log("Modal-Input onMounted")}),(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{readonly:i.inputReadOnly,value:i.value,placeholder:i.placeholder,"onUpdate:value":s[0]||(s[0]=m=>i.$emit("update:value",m))},null,8,["readonly","value","placeholder"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:f},{default:e.withCtx(()=>s[4]||(s[4]=[e.createTextVNode(" … ",-1)])),_:1,__:[4]}),e.createVNode(e.unref(u.NModal),{show:a.value,"onUpdate:show":s[2]||(s[2]=m=>a.value=m),title:e.unref(r)(e.unref(c).title??i.label??""),onClose:s[3]||(s[3]=()=>a.value=!1),preset:"card",style:e.normalizeStyle(e.unref(c).modalStyle),"content-style":"display: flex; flex-direction: column;"},{default:e.withCtx(()=>[e.unref(c).componentType?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(c).componentType),{key:0,style:e.normalizeStyle(e.unref(c).style),"onUpdate:selected":s[1]||(s[1]=m=>g(m))},null,40,["style"])):e.createCommentVNode("",!0)]),_:1},8,["show","title","style"])]),_:1}))}}),xs={key:0,style:{"flex-grow":"1"}},Ss={key:0,style:{"text-align":"right"}},Is=["readonly","disabled"],Bs=["readonly","disabled"],Ve=e.defineComponent({__name:"FormInput",props:{value:{},readonly:{type:Boolean},formItem:{},label:{},placeholder:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=e.ref(o.value),{t:a}=Z(),c=e.inject("axios"),f=e.ref(void 0),g=e.ref(!1),i=e.ref(!1);function s(d){if(d.target instanceof HTMLInputElement){const h=d.target.files;h!=null&&h.length?r.value=h[0]:r.value=null}}async function m(d){var b,x;const h=(b=o.formItem)==null?void 0:b.valueSource;h&&h.type=="remote"&&h.sourceUrl&&h.filterable&&Pe(c,h,{searchWords:d},S=>h.i18n?a(S):S,((x=o.formItem)==null?void 0:x.nullable)!=!1)}return e.watch(r,d=>{n("update:value",d)}),e.watch(()=>o.value,d=>{r.value=d}),e.onMounted(()=>{var d,h;(h=(d=o.formItem)==null?void 0:d.role)!=null&&h.length&&(g.value=o.formItem.role.includes("list"),f.value=o.formItem.role.map(b=>`halo-form-${b}`).join(" "))}),(d,h)=>{var E,O,j,z,H,I,y,B,A,D,L,F,Y,v,ee,oe,ne,W;const b=e.resolveComponent("n-switch"),x=e.resolveComponent("n-text"),S=e.resolveComponent("n-select"),P=e.resolveComponent("n-input-number"),T=e.resolveComponent("n-checkbox"),k=e.resolveComponent("n-input"),N=e.resolveComponent("n-icon"),V=e.resolveComponent("n-button");return d.formItem?(e.openBlock(),e.createElementBlock("div",xs,[typeof d.formItem.editor=="function"?(e.openBlock(),e.createBlock(e.KeepAlive,{key:0},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.formItem.editor),{value:r.value,"onUpdate:value":h[0]||(h[0]=K=>r.value=K)},null,40,["value"]))],1024)):((E=d.formItem.editor)==null?void 0:E.startsWith("@"))==!0?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.formItem.editor.substring(1)),{key:1,value:r.value,"onUpdate:value":h[1]||(h[1]=K=>r.value=K),config:d.formItem.editorConfig,label:d.formItem.label,readonly:d.readonly,disabled:d.readonly},null,40,["value","config","label","readonly","disabled"])):d.formItem.editor=="modal"?(e.openBlock(),e.createBlock(bt,{key:2,value:r.value,"onUpdate:value":h[2]||(h[2]=K=>r.value=K),config:d.formItem.editorConfig,label:d.formItem.label},null,8,["value","config","label"])):d.formItem.editor=="boolean"&&Array.isArray(d.formItem.values)&&d.formItem.values.length>1?(e.openBlock(),e.createBlock(b,{key:3,value:r.value,"onUpdate:value":h[3]||(h[3]=K=>r.value=K),style:e.normalizeStyle((O=d.formItem.editorConfig)==null?void 0:O.style)},{checked:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.formItem.values[0]),1)]),unchecked:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.formItem.values[1]),1)]),_:1},8,["value","style"])):d.formItem.valueSource?(e.openBlock(),e.createBlock(S,{key:4,value:r.value,"onUpdate:value":h[4]||(h[4]=K=>r.value=K),remote:d.formItem.valueSource.type=="remote",loading:d.formItem.valueSource.isLoading,options:d.formItem.valueSource.values,filterable:d.formItem.valueSource.filterable,multiple:((j=d.formItem.role)==null?void 0:j.includes("list"))==!0,placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((z=d.formItem.editorConfig)==null?void 0:z.style),onSearch:m},{action:e.withCtx(()=>[d.formItem.valueSource.filterable?(e.openBlock(),e.createElementBlock("div",Ss,[e.createVNode(x,{depth:"3",italic:""},{default:e.withCtx(()=>[e.createElementVNode("small",null,e.toDisplayString(e.unref(a)("Enter text to filter the result list.")),1)]),_:1})])):e.createCommentVNode("",!0)]),_:1},8,["value","remote","loading","options","filterable","multiple","disabled","clearable","style"])):d.formItem.editor=="number"?(e.openBlock(),e.createBlock(P,{key:5,value:r.value,"onUpdate:value":h[5]||(h[5]=K=>r.value=K),min:d.formItem.minValue,max:d.formItem.maxValue,clearable:d.formItem.nullable,readonly:d.readonly,placeholder:d.placeholder,style:e.normalizeStyle((H=d.formItem.editorConfig)==null?void 0:H.style)},null,8,["value","min","max","clearable","readonly","placeholder","style"])):d.formItem.editor=="boolean"&&d.formItem.nullable?(e.openBlock(),e.createBlock(gt,{key:6,value:r.value,"onUpdate:value":h[6]||(h[6]=K=>r.value=K),placeholder:"",disabled:d.readonly,style:e.normalizeStyle((I=d.formItem.editorConfig)==null?void 0:I.style)},null,8,["value","disabled","style"])):d.formItem.editor=="boolean"?(e.openBlock(),e.createBlock(T,{key:7,checked:r.value,"onUpdate:checked":h[7]||(h[7]=K=>r.value=K),disabled:d.readonly,style:e.normalizeStyle((y=d.formItem.editorConfig)==null?void 0:y.style)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:1},8,["checked","disabled","style"])):d.formItem.editor=="datetime"?(e.openBlock(),e.createBlock(Fe,{key:8,value:r.value,"onUpdate:value":h[8]||(h[8]=K=>r.value=K),type:"datetime",placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((B=d.formItem.editorConfig)==null?void 0:B.style)},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="date"?(e.openBlock(),e.createBlock(Fe,{key:9,value:r.value,"onUpdate:value":h[9]||(h[9]=K=>r.value=K),type:"date",placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((A=d.formItem.editorConfig)==null?void 0:A.style)},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="time"?(e.openBlock(),e.createBlock(ht,{key:10,value:r.value,"onUpdate:value":h[10]||(h[10]=K=>r.value=K),placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((D=d.formItem.editorConfig)==null?void 0:D.style)},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="color"?(e.openBlock(),e.createBlock(ut,{key:11,value:r.value,"onUpdate:value":h[11]||(h[11]=K=>r.value=K),placeholder:"",disabled:d.readonly,readonly:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((L=d.formItem.editorConfig)==null?void 0:L.style)},null,8,["value","disabled","readonly","clearable","style"])):d.formItem.editor=="tags"?(e.openBlock(),e.createBlock(wt,{key:12,value:r.value,"onUpdate:value":h[12]||(h[12]=K=>r.value=K),tagSource:d.formItem.tagSource,placeholder:"",disabled:d.readonly,style:e.normalizeStyle((F=d.formItem.editorConfig)==null?void 0:F.style)},null,8,["value","tagSource","disabled","style"])):d.formItem.editor=="image"?(e.openBlock(),e.createElementBlock("input",{key:13,type:"file",onChange:s,readonly:d.readonly,disabled:d.readonly,style:e.normalizeStyle((Y=d.formItem.editorConfig)==null?void 0:Y.style)},null,44,Is)):d.formItem.editor=="file"?(e.openBlock(),e.createElementBlock("input",{key:14,type:"file",onChange:s,readonly:d.readonly,disabled:d.readonly,style:e.normalizeStyle((v=d.formItem.editorConfig)==null?void 0:v.style)},null,44,Bs)):d.formItem.editor=="password"?(e.openBlock(),e.createBlock(k,{key:15,value:r.value,"onUpdate:value":h[13]||(h[13]=K=>r.value=K),class:e.normalizeClass(f.value),placeholder:d.placeholder??"",type:"password",readonly:d.readonly,style:e.normalizeStyle((ee=d.formItem.editorConfig)==null?void 0:ee.style)},null,8,["value","class","placeholder","readonly","style"])):d.formItem.editor=="textarea"?(e.openBlock(),e.createBlock(k,{key:16,value:r.value,"onUpdate:value":h[14]||(h[14]=K=>r.value=K),class:e.normalizeClass(f.value),type:"textarea",placeholder:d.placeholder??"",readonly:d.readonly,style:e.normalizeStyle((oe=d.formItem.editorConfig)==null?void 0:oe.style)},null,8,["value","class","placeholder","readonly","style"])):(e.openBlock(),e.createBlock(k,{key:17,value:r.value,"onUpdate:value":h[16]||(h[16]=K=>r.value=K),class:e.normalizeClass(f.value),placeholder:d.placeholder??"",readonly:d.readonly,clearable:d.formItem.nullable,type:d.formItem.editor,style:e.normalizeStyle((ne=d.formItem.editorConfig)==null?void 0:ne.style)},{suffix:e.withCtx(()=>[g.value?(e.openBlock(),e.createBlock(V,{key:0,text:"",title:e.unref(a)("If there are multiple items, separate them with commas."),onClick:h[15]||(h[15]=()=>i.value=!0)},{default:e.withCtx(()=>[e.createVNode(N,null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ga))]),_:1})]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1},8,["value","class","placeholder","readonly","clearable","type","style"])),g.value?(e.openBlock(),e.createBlock(Ct,{key:18,show:i.value,"onUpdate:show":h[17]||(h[17]=K=>i.value=K),title:d.formItem.label,readonly:d.readonly,message:e.unref(a)("Please enter a list, separated by lines or commas."),value:r.value,"onUpdate:value":h[18]||(h[18]=K=>r.value=K),style:e.normalizeStyle((W=d.formItem.editorConfig)==null?void 0:W.style)},null,8,["show","title","readonly","message","value","style"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}}),Vs=e.defineComponent({name:"DefaultPropertyForm",components:{FormInput:Ve,NForm:u.NForm,NFormItem:u.NFormItem},props:{readOnly:{type:Boolean,default:!1},method:String,columns:Number,groupLayout:String,formItems:Array,data:Object,original:Object},emits:["itemChange"],setup(t,l){const{t:o}=Z(),n=e.inject("axios"),r=e.ref(null),a=e.ref([]),c=e.ref(t.columns||1),f=e.ref({}),g=e.ref(m(t.formItems)),i=h(t.formItems),s=e.ref(void 0);function m(k){return k?[...new Set(k.map(V=>V.group))].map(V=>({label:V||"General",items:k.filter(E=>E.group==V)})):[]}function d(k){return k.dataType=="boolean"&&!k.nullable?" ":k.label}function h(k){const N={};if(k&&k.length)for(const V of k){const E=[];V.nullable==!1&&V.dataType!="boolean"&&E.push({required:!0,message:o("Must be filled here.")}),E.length&&(N[V.name]=E)}return N}async function b(k,N){var V;if(N.type=="remote"&&N.sourceUrl)Pe(n,N,null,E=>N.i18n?o(E):E,k.nullable);else if(N.type=="function"&&N.func){N.isLoading=!0;try{const E=(V=N.func)==null?void 0:V.call(void 0);E&&(N.values=E)}finally{N.isLoading=!1}}}function x(){var k;(k=t.formItems)==null||k.forEach(N=>{N.valueSource&&(N.valueSource.type=="remote"||N.valueSource.type=="function")&&b(N,N.valueSource)})}function S(k,N){l.emit("itemChange",{item:k,data:t.data,value:N})}function P(k){return!!(k.readonly==!0||t.readOnly==!0||t.method&&Array.isArray(k.readonly)&&k.readonly.includes(t.method))}function T(k){return!!(k.visibility==!0||t.method&&Array.isArray(k.visibility)&&k.visibility.includes(t.method))}return e.onMounted(()=>{x(),t.data&&(f.value=t.data)}),e.watch(()=>t.data,k=>f.value=k||{}),{t:o,formRef:r,formItemsRef:a,getItemLabel:d,originalModel:s,model:f,rules:i,formColumns:c,updateValue:S,formGroups:g,isReadonly:P,isVisible:T}}}),Ms={class:"item-box"},Ts={class:"item-box"},As={class:"item-box"};function Es(t,l,o,n,r,a){const c=e.resolveComponent("form-input"),f=e.resolveComponent("n-text"),g=e.resolveComponent("n-form-item-grid-item"),i=e.resolveComponent("n-grid"),s=e.resolveComponent("n-tab-pane"),m=e.resolveComponent("n-tabs"),d=e.resolveComponent("n-grid-item"),h=e.resolveComponent("n-form");return e.openBlock(),e.createBlock(h,{ref:"formRef",model:t.model,rules:t.rules,"label-placement":"left","label-width":160},{default:e.withCtx(()=>[t.groupLayout=="tab"?(e.openBlock(),e.createBlock(m,{key:0,type:"line"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formGroups,b=>(e.openBlock(),e.createBlock(s,{key:b,name:b.label,tab:t.t(b.label)},{default:e.withCtx(()=>[e.createVNode(i,{cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.items,x=>e.withDirectives((e.openBlock(),e.createBlock(g,{ref_for:!0,ref:"formItemsRef",key:x.name,label:t.getItemLabel(x),path:x.name,feedback:x.errorMessage,"validation-status":x.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",Ms,[e.createVNode(c,{"form-item":x,value:t.model[x.name],"onUpdate:value":[S=>t.model[x.name]=S,S=>t.updateValue(x,S)],readonly:t.isReadonly(x),label:x.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),x.description?(e.openBlock(),e.createBlock(f,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(x.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(x)]])),128))]),_:2},1032,["cols"])]),_:2},1032,["name","tab"]))),128)),e.renderSlot(t.$slots,"more-tabs",{},void 0,!0)]),_:3})):t.groupLayout=="column"?(e.openBlock(),e.createBlock(i,{key:1,cols:t.formGroups.length,"x-gap":"8"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formGroups,b=>(e.openBlock(),e.createBlock(d,{key:b},{default:e.withCtx(()=>[e.createVNode(i,{cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.items,x=>e.withDirectives((e.openBlock(),e.createBlock(g,{ref_for:!0,ref:"formItemsRef",key:x.name,label:t.getItemLabel(x),path:x.name,feedback:x.errorMessage,"validation-status":x.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",Ts,[e.createVNode(c,{"form-item":x,value:t.model[x.name],"onUpdate:value":[S=>t.model[x.name]=S,S=>t.updateValue(x,S)],readonly:t.isReadonly(x),label:x.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),x.description?(e.openBlock(),e.createBlock(f,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(x.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(x)]])),128))]),_:2},1032,["cols"])]),_:2},1024))),128))]),_:1},8,["cols"])):(e.openBlock(),e.createBlock(i,{key:2,cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formItems,b=>e.withDirectives((e.openBlock(),e.createBlock(g,{ref_for:!0,ref:"formItemsRef",key:b.name,label:t.getItemLabel(b),path:b.name,feedback:b.errorMessage,"validation-status":b.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",As,[e.createVNode(c,{"form-item":b,value:t.model[b.name],"onUpdate:value":[x=>t.model[b.name]=x,x=>t.updateValue(b,x)],readonly:t.isReadonly(b),label:b.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),b.description?(e.openBlock(),e.createBlock(f,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(b.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(b)]])),128))]),_:1},8,["cols"]))]),_:3},8,["model","rules"])}const kt=re(Vs,[["render",Es],["__scopeId","data-v-e7319d81"]]),_s={class:"pg-value flex-grow-1"},Nt=e.defineComponent({__name:"PropertyGrid",props:{columns:{default:1},hideEmpty:{type:Boolean},data:{},names:{},justify:{}},setup(t){const l=t,{t:o}=Z(),n=e.ref(a());function r(){n.value=a()}function a(){var s;const c=new Array,f=l.data,g=l.names,i=l.hideEmpty;if(f)if(g)for(const m of g)if(typeof m=="string")(!i||f[m])&&c.push({label:o(te(m)),value:f[m],span:1});else{const d={label:o(m.label||te(m.name)),value:f[m.name],span:m.span||1,dataType:m.dataType,role:m.role};d.value!=null&&(d.dataType=="boolean"?d.value=de(d.value)?o("Yes"):o("No"):m.i18n&&(d.value=o((s=d.value)==null?void 0:s.toString()))),(!i||d.value)&&c.push(d)}else if(Array.isArray(f))for(const m of f)(!i||m.value)&&c.push({label:o(te(m.label)),value:m.value,span:1});else for(const m in f)(!i||f[m])&&c.push({label:o(te(m)),value:f[m],span:1});return c}return e.watch(()=>l.data,()=>r()),e.watch(()=>l.hideEmpty,()=>r()),(c,f)=>(e.openBlock(),e.createBlock(e.unref(u.NGrid),{cols:c.columns,"item-responsive":""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value.filter(g=>!c.hideEmpty||g.value),g=>(e.openBlock(),e.createBlock(e.unref(u.NGridItem),{class:"pg-item",key:g.label,span:g.span},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default",{label:g.label,value:g.value},()=>[e.createElementVNode("div",{class:"flex-row justify",style:e.normalizeStyle({"justify-content":c.justify})},[e.createVNode(e.unref(u.NText),{class:"pg-label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.label)+":",1)]),_:2},1024),e.createElementVNode("div",_s,[g.role=="percent"?(e.openBlock(),e.createBlock(e.unref(u.NProgress),{key:0,type:"line",percentage:Number(g.value),title:g.value+"%",style:{"margin-top":"auto","max-width":"80%"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value)+" % ",1)]),_:2},1032,["percentage","title"])):(e.openBlock(),e.createBlock(e.unref(u.NText),{key:1},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value),1)]),_:2},1024))])],4)])]),_:2},1032,["span"]))),128))]),_:3},8,["cols"]))}}),Ls={key:0},zs={class:"flex-column gap1 flex-grow-1"},Ds={class:"flex-row",style:{"justify-content":"space-between"}},$s={class:"text-monospace",style:{"font-size":"24pt"}},Rs={key:0},Os=["src"],js=["src"],Ps={style:{"text-align":"right"}},rn=e.defineComponent({__name:"DetailPage",props:{loading:{type:Boolean},title:{},subject:{},data:{},properties:{},showBarcode:{type:Boolean,default:!0},columns:{default:3}},emits:["refresh"],setup(t){const{t:l}=Z(),o=e.ref(!0);return(n,r)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(u.NSpin),{show:n.loading,style:{"align-self":"center",margin:"1em"},class:"flex-grow-1 flex-column","content-class":"flex-column flex-grow-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NCard),{embedded:"",style:{width:"1080px"},segmented:{content:!0,footer:"soft"},class:"flex-grow-1","content-class":"flex-column"},{header:e.withCtx(()=>[e.createVNode(e.unref(u.NH2),{style:{"margin-bottom":"2px"}},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"icon"),n.title?(e.openBlock(),e.createElementBlock("span",Ls,e.toDisplayString(e.unref(l)(n.title)),1)):e.createCommentVNode("",!0)]),_:3})]),"header-extra":e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{text:"",onClick:r[0]||(r[0]=()=>n.$emit("refresh"))},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(je))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(l)("Refresh")),1)]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",zs,[e.createElementVNode("div",Ds,[e.createElementVNode("div",null,[e.createElementVNode("div",$s,e.toDisplayString(n.subject),1),n.showBarcode?(e.openBlock(),e.createElementBlock("div",Rs,[e.createElementVNode("img",{src:"/api/core/Barcode/Image?code="+n.subject+"&format=CODE_128&height=30&margin=4,2"},null,8,Os)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[n.showBarcode?(e.openBlock(),e.createElementBlock("img",{key:0,src:"/api/core/QR/Image?code="+n.subject+"&format=CODE_128&width=100&height=100"},null,8,js)):e.createCommentVNode("",!0)])]),e.createVNode(e.unref(u.NCollapse),{"display-directive":"show","default-expanded-names":"info"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NCollapseItem),{name:"info",title:e.unref(l)("Property")},{default:e.withCtx(()=>[e.createVNode(Nt,{data:n.data,columns:n.columns,names:n.properties,"hide-empty":o.value},null,8,["data","columns","names","hide-empty"]),e.createElementVNode("div",Ps,[e.createVNode(e.unref(u.NButton),{text:"",onClick:r[1]||(r[1]=a=>o.value=!o.value),title:e.unref(l)("More")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ra))]),_:1})]),_:1},8,["title"])])]),_:1},8,["title"])]),_:1}),e.renderSlot(n.$slots,"default")])]),_:3})]),_:3},8,["show"])]))}}),Fs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Hs=e.defineComponent({name:"ArrowDown",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Fs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M24.59 16.59L17 24.17V4h-2v20.17l-7.59-7.58L6 18l10 10l10-10l-1.41-1.41z",fill:"currentColor"},null,-1)]))}}),Gs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ks=e.defineComponent({name:"ArrowLeft",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Gs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M14 26l1.41-1.41L7.83 17H28v-2H7.83l7.58-7.59L14 6L4 16l10 10z",fill:"currentColor"},null,-1)]))}}),Ws={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Zs=e.defineComponent({name:"ArrowRight",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ws,o[0]||(o[0]=[e.createElementVNode("path",{d:"M18 6l-1.43 1.393L24.15 15H4v2h20.15l-7.58 7.573L18 26l10-10L18 6z",fill:"currentColor"},null,-1)]))}}),Ys={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Qs=e.defineComponent({name:"ArrowUp",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ys,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16 4L6 14l1.41 1.41L15 7.83V28h2V7.83l7.59 7.58L26 14L16 4z",fill:"currentColor"},null,-1)]))}}),Xs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},an=e.defineComponent({name:"Checkbox",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Xs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 4H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM6 26V6h20v20z",fill:"currentColor"},null,-1)]))}}),Js={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},sn=e.defineComponent({name:"CheckboxChecked",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Js,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 4H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM6 26V6h20v20z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M14 21.5l-5-4.96L10.59 15L14 18.35L21.41 11L23 12.58l-9 8.92z",fill:"currentColor"},null,-1)]))}}),qs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Us=e.defineComponent({name:"Checkmark",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",qs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 24l-9-9l1.414-1.414L13 21.171L26.586 7.586L28 9L13 24z",fill:"currentColor"},null,-1)]))}}),vs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},xt=e.defineComponent({name:"ChevronDown",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",vs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16 22L6 12l1.4-1.4l8.6 8.6l8.6-8.6L26 12z",fill:"currentColor"},null,-1)]))}}),ei={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ti=e.defineComponent({name:"CollapseAll",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ei,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 15h-2V7H13V5h15a2.002 2.002 0 0 1 2 2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M25 20h-2v-8H8v-2h15a2.002 2.002 0 0 1 2 2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 27H4a2.002 2.002 0 0 1-2-2v-8a2.002 2.002 0 0 1 2-2h14a2.002 2.002 0 0 1 2 2v8a2.002 2.002 0 0 1-2 2zM4 17v8h14.001L18 17z",fill:"currentColor"},null,-1)]))}}),oi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},cn=e.defineComponent({name:"Cube",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",oi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28.504 8.136l-12-7a1 1 0 0 0-1.008 0l-12 7A1 1 0 0 0 3 9v14a1 1 0 0 0 .496.864l12 7a1 1 0 0 0 1.008 0l12-7A1 1 0 0 0 29 23V9a1 1 0 0 0-.496-.864zM16 3.158L26.016 9L16 14.842L5.984 9zM5 10.74l10 5.833V28.26L5 22.426zM17 28.26V16.574l10-5.833v11.685z",fill:"currentColor"},null,-1)]))}}),ni={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},dn=e.defineComponent({name:"DocumentDownload",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ni,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 25l-1.414-1.414L26 26.172V18h-2v8.172l-2.586-2.586L20 25l5 5l5-5z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 28H8V4h8v6a2.006 2.006 0 0 0 2 2h6v3h2v-5a.91.91 0 0 0-.3-.7l-7-7A.909.909 0 0 0 18 2H8a2.006 2.006 0 0 0-2 2v24a2.006 2.006 0 0 0 2 2h10zm0-23.6l5.6 5.6H18z",fill:"currentColor"},null,-1)]))}}),li={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},St=e.defineComponent({name:"DocumentExport",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",li,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 21h13.17l-2.58 2.59L25 25l5-5l-5-5l-1.41 1.41L26.17 19H13v2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M22 14v-4a1 1 0 0 0-.29-.71l-7-7A1 1 0 0 0 14 2H4a2 2 0 0 0-2 2v24a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2h-2v2H4V4h8v6a2 2 0 0 0 2 2h6v2zm-8-4V4.41L19.59 10z",fill:"currentColor"},null,-1)]))}}),ri={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},It=e.defineComponent({name:"DocumentImport",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ri,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 19H14.83l2.58-2.59L16 15l-5 5l5 5l1.41-1.41L14.83 21H28v-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M24 14v-4a1 1 0 0 0-.29-.71l-7-7A1 1 0 0 0 16 2H6a2 2 0 0 0-2 2v24a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2h-2v2H6V4h8v6a2 2 0 0 0 2 2h6v2zm-8-4V4.41L21.59 10z",fill:"currentColor"},null,-1)]))}}),ai={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},fn=e.defineComponent({name:"Draggable",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ai,o[0]||(o[0]=[e.createStaticVNode('<path d="M10 6h4v4h-4z" fill="currentColor"></path><path d="M18 6h4v4h-4z" fill="currentColor"></path><path d="M10 14h4v4h-4z" fill="currentColor"></path><path d="M18 14h4v4h-4z" fill="currentColor"></path><path d="M10 22h4v4h-4z" fill="currentColor"></path><path d="M18 22h4v4h-4z" fill="currentColor"></path>',6)]))}}),si={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ii=e.defineComponent({name:"ExpandAll",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",si,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 10h14a2.002 2.002 0 0 0 2-2V4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6V2H4v23a2.002 2.002 0 0 0 2 2h4v1a2.002 2.002 0 0 0 2 2h14a2.002 2.002 0 0 0 2-2v-4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6v-8h4v1a2.002 2.002 0 0 0 2 2h14a2.002 2.002 0 0 0 2-2v-4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6V7h4v1a2.002 2.002 0 0 0 2 2zm0-6h14l.001 4H12zm0 20h14l.001 4H12zm0-10h14l.001 4H12z",fill:"currentColor"},null,-1)]))}}),ci={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Bt=e.defineComponent({name:"Folder",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ci,o[0]||(o[0]=[e.createElementVNode("path",{d:"M11.17 6l3.42 3.41l.58.59H28v16H4V6h7.17m0-2H4a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h24a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2H16l-3.41-3.41A2 2 0 0 0 11.17 4z",fill:"currentColor"},null,-1)]))}}),di={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},fi=e.defineComponent({name:"FolderOpen",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",di,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 8h-7.172l-3.414-3.414A2 2 0 0 0 16 4H4a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h24a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2zM8 26V14h8v6.17l-2.59-2.58L12 19l5 5l5-5l-1.41-1.41L18 20.17V14a2.002 2.002 0 0 0-2-2H8a2.002 2.002 0 0 0-2 2v12H4V6h12l4 4h8v2h-6v2h6v12z",fill:"currentColor"},null,-1)]))}}),ui={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},pi=e.defineComponent({name:"IbmCloudPakApplications",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ui,o[0]||(o[0]=[e.createElementVNode("path",{d:"M21 22h-6a2.002 2.002 0 0 1-2-2v-4a2.002 2.002 0 0 1 2-2h6a2.002 2.002 0 0 1 2 2v4a2.002 2.002 0 0 1-2 2zm-6-6v4h6v-4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M11 17H9v-5a2.002 2.002 0 0 1 2-2h6v2h-6z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M16 31a.999.999 0 0 1-.504-.136l-12-7A1 1 0 0 1 3 23V9a1 1 0 0 1 .496-.864l12-7a1 1 0 0 1 1.008 0l12 7l-1.008 1.728L16 3.158L5 9.574v12.852l11 6.417l11-6.417V15h2v8a1 1 0 0 1-.496.864l-12 7A.999.999 0 0 1 16 31z",fill:"currentColor"},null,-1)]))}}),mi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},hi=e.defineComponent({name:"NewTab",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",mi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 26H6V6h10V4H6a2.002 2.002 0 0 0-2 2v20a2.002 2.002 0 0 0 2 2h20a2.002 2.002 0 0 0 2-2V16h-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M26 26H6V6h10V4H6a2.002 2.002 0 0 0-2 2v20a2.002 2.002 0 0 0 2 2h20a2.002 2.002 0 0 0 2-2V16h-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M26 6V2h-2v4h-4v2h4v4h2V8h4V6h-4z",fill:"currentColor"},null,-1)]))}}),gi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},yi=e.defineComponent({name:"NotAvailable",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",gi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M4 15h10v2H4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 15h10v2H18z",fill:"currentColor"},null,-1)]))}}),wi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ci=e.defineComponent({name:"QrCode",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",wi,o[0]||(o[0]=[e.createStaticVNode('<path d="M24 28v-2h2v2z" fill="currentColor"></path><path d="M18 24v-2h2v2z" fill="currentColor"></path><path d="M18 30h4v-2h-2v-2h-2v4z" fill="currentColor"></path><path d="M26 26v-4h2v4z" fill="currentColor"></path><path d="M28 26h2v4h-4v-2h2v-2z" fill="currentColor"></path><path d="M26 20v-2h4v4h-2v-2h-2z" fill="currentColor"></path><path d="M24 20h-2v4h-2v2h4v-6z" fill="currentColor"></path><path d="M18 20v-2h4v2z" fill="currentColor"></path><path d="M6 22h4v4H6z" fill="currentColor"></path><path d="M14 30H2V18h12zM4 28h8v-8H4z" fill="currentColor"></path><path d="M22 6h4v4h-4z" fill="currentColor"></path><path d="M30 14H18V2h12zm-10-2h8V4h-8z" fill="currentColor"></path><path d="M6 6h4v4H6z" fill="currentColor"></path><path d="M14 14H2V2h12zM4 12h8V4H4z" fill="currentColor"></path>',14)]))}}),bi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},un=e.defineComponent({name:"Search",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",bi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M29 27.586l-7.552-7.552a11.018 11.018 0 1 0-1.414 1.414L27.586 29zM4 13a9 9 0 1 1 9 9a9.01 9.01 0 0 1-9-9z",fill:"currentColor"},null,-1)]))}}),ki={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},pn=e.defineComponent({name:"SearchLocate",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ki,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 28.586l-4.689-4.688a8.028 8.028 0 1 0-1.414 1.414L28.586 30zM19 25a6 6 0 1 1 6-6a6.007 6.007 0 0 1-6 6z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 12h8v2H2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 2h16v2H2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 7h16v2H2z",fill:"currentColor"},null,-1)]))}}),Ni={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},xi=e.defineComponent({name:"SelectWindow",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ni,o[0]||(o[0]=[e.createStaticVNode('<path d="M8 26H4a2.002 2.002 0 0 1-2-2v-4h2v4h4z" fill="currentColor"></path><path d="M2 12h2v4H2z" fill="currentColor"></path><path d="M26 8h-2V4h-4V2h4a2.002 2.002 0 0 1 2 2z" fill="currentColor"></path><path d="M12 2h4v2h-4z" fill="currentColor"></path><path d="M4 8H2V4a2.002 2.002 0 0 1 2-2h4v2H4z" fill="currentColor"></path><path d="M27 32a.997.997 0 0 1-.707-.293l-6.138-6.138l-3.323 4.986a1 1 0 0 1-1.79-.268l-6-20a1 1 0 0 1 1.245-1.245l20 6a1 1 0 0 1 .268 1.79l-4.986 3.323l6.138 6.138a1 1 0 0 1 0 1.414l-4 4A.997.997 0 0 1 27 32zm0-2.414L29.586 27l-7.155-7.155l5.246-3.498l-16.185-4.855l4.855 16.185l3.498-5.246z" fill="currentColor"></path>',6)]))}}),Si={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ii=e.defineComponent({name:"TableBuilt",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Si,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 8h-4V4a2.002 2.002 0 0 0-2-2H4a2.002 2.002 0 0 0-2 2v18a2.002 2.002 0 0 0 2 2h4v4a2.002 2.002 0 0 0 2 2h18a2.002 2.002 0 0 0 2-2V10a2.002 2.002 0 0 0-2-2zm-6 14h-8v-5h8zm0-7h-8v-5h8zm-10 0H4v-5h8zM22 4v4H4V4zM4 22v-5h8v5zm24 6H10v-4h12a2.002 2.002 0 0 0 2-2V10h4z",fill:"currentColor"},null,-1)]))}}),Bi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Vi=e.defineComponent({name:"TagEdit",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Bi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M29.707 7.293l-3-3a1 1 0 0 0-1.414 0L16 13.586V18h4.414l9.293-9.293a1 1 0 0 0 0-1.414zM19.586 16H18v-1.586l5-5L24.586 11zM26 9.586L24.414 8L26 6.414L27.586 8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M10 14a4 4 0 1 1 4-4a4.005 4.005 0 0 1-4 4zm0-6a2 2 0 1 0 1.998 2.004A2.002 2.002 0 0 0 10 8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M27.006 14.235l-1.414 1.414L28 18.058L18.058 28L4 13.941V4h9.942l4.406 4.407l1.415-1.415l-4.407-4.406A2 2 0 0 0 13.94 2H4a2 2 0 0 0-2 2v9.941a2 2 0 0 0 .586 1.414l14.058 14.06a2.001 2.001 0 0 0 2.828 0l9.943-9.943a2.001 2.001 0 0 0 0-2.828z",fill:"currentColor"},null,-1)]))}}),Mi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ti=e.defineComponent({name:"Upload",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Mi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 18l1.41 1.41L15 11.83V30h2V11.83l7.59 7.58L26 18L16 8L6 18z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M6 8V4h20v4h2V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4z",fill:"currentColor"},null,-1)]))}}),Ai={style:{"min-height":"50px"}},Vt=e.defineComponent({__name:"ExportModal",props:{show:{type:Boolean},range:{},supportedFormats:{},supportedRanges:{}},emits:["export","close"],setup(t){const l=t,{t:o}=Z(),n=e.ref(null),r=e.ref(f()),a=e.ref(null),c=e.ref(g());function f(){let i=[{label:o("Excel"),value:"excel"},{label:o("Json"),value:"json"},{label:o("Text"),value:"text"},{label:o("XML"),value:"xml"}];const s=l.supportedFormats;return s&&(i=i.filter(m=>s.includes(m.value))),n.value=i.length?i[0].value:null,i}function g(){const i=l.supportedRanges||["empty","selection","page","all"],s=[{label:o("Selection"),value:"selection"},{label:o("Current Page"),value:"page"},{label:o("Search"),value:"search"},{label:o("All"),value:"all"},{label:o("Empty(Template)"),value:"empty"}].filter(m=>i.includes(m.value));return l.range?a.value=l.range:a.value=s.length?s[0].value:null,s}return e.watch(()=>l.range,i=>{i&&(a.value=i)}),(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:i.show,preset:"card",title:e.unref(o)("Export Options"),style:{"max-width":"400px"},draggable:"",onClose:s[4]||(s[4]=()=>i.$emit("close"))},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{onClick:s[2]||(s[2]=()=>i.$emit("export",n.value,a.value)),style:{"min-width":"100px"},type:"primary"},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(dn))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(o)("Export")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:s[3]||(s[3]=()=>i.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",Ai,[r.value.length>1?(e.openBlock(),e.createBlock(e.unref(u.NFormItem),{key:0,label:e.unref(o)("File Format")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSelect),{options:r.value,value:n.value,"onUpdate:value":s[0]||(s[0]=m=>n.value=m)},null,8,["options","value"])]),_:1},8,["label"])):e.createCommentVNode("",!0),c.value.length>1?(e.openBlock(),e.createBlock(e.unref(u.NFormItem),{key:1,label:e.unref(o)("Data Range")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSelect),{options:c.value,value:a.value,"onUpdate:value":s[1]||(s[1]=m=>a.value=m)},null,8,["options","value"])]),_:1},8,["label"])):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"options")])]),_:3},8,["show","title"]))}}),Ei={class:"flex-column gap1",style:{"justify-content":"center","align-items":"center"}},mn=e.defineComponent({__name:"EmptyDetailView",props:{message:{default:"Please select a object."}},setup(t){const{t:l}=Z();return(o,n)=>(e.openBlock(),e.createElementBlock("div",Ei,[e.createVNode(e.unref(u.NIcon),{depth:5,size:48},{default:e.withCtx(()=>[e.createVNode(e.unref(xi))]),_:1}),e.createVNode(e.unref(u.NText),{depth:"3",style:{opacity:"0.6"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)(o.message)),1)]),_:1})]))}}),_i=e.defineComponent({components:{FullscreenIcon:Ba,ExitFullscreenIcon:Sa},emits:["change"],setup(t,l){const{t:o}=Z(),n=Ne(),r=e.computed(()=>n.isFullscreen);function a(i){i||(i=document.body),i.requestFullscreen&&i.requestFullscreen()}function c(){document.exitFullscreen&&document.exitFullscreen()}function f(i){var s;if(r.value)c();else{const m=(s=i.target)==null?void 0:s.closest(".fullscreen-view");a(m)}}function g(){const i=!!document.fullscreenElement;n.setIsFullscreen(i),l.emit("change",i)}return e.onMounted(()=>{document.addEventListener("fullscreenchange",g),document.addEventListener("mozfullscreenchange",g),document.addEventListener("webkitfullscreenchange",g),document.addEventListener("msfullscreenchange",g)}),{t:o,isFullscreen:r,toggleFullscreen:f}}});function Li(t,l,o,n,r,a){const c=e.resolveComponent("fullscreen-icon"),f=e.resolveComponent("exit-fullscreen-icon"),g=e.resolveComponent("n-icon"),i=e.resolveComponent("n-button");return e.openBlock(),e.createBlock(i,{onClick:t.toggleFullscreen},{icon:e.withCtx(()=>[e.createVNode(g,null,{default:e.withCtx(()=>[t.isFullscreen?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(c,{key:0})),t.isFullscreen?(e.openBlock(),e.createBlock(f,{key:1})):e.createCommentVNode("",!0)]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(t.t("Toggle Fullscreen")),1)]),_:1},8,["onClick"])}const hn=re(_i,[["render",Li]]),Mt=t=>{const l=e.inject("axios"),o={},n=[],r=[];t.forEach(m=>{typeof m=="string"?(o[m]=!1,n.push(m)):(o[m.id]=!1,o[m.name]=!1,n.push(m.id),r.push(m))});let a=0;async function c(m){a||await g(m)}function f(){for(let m in o)o[m]=!1}async function g(m){f();const d=n.filter(h=>(h==null?void 0:h.length)==32);if(d.length)try{let h=await l.get(`/api/core/Account/CheckPermissions?permissions=${encodeURIComponent(d.join())}`);h.isSuccess&&h.value!=null?(a++,h.value.forEach(b=>{o[b]=!0;const x=r.find(S=>S.id==b);x&&(o[x.name]=!0)}),m==null||m.call(null,o)):console.error(h.errorMessage)}catch(h){console.error(h)}}function i(){for(let m in o)if(!o[m])return!1;return!0}function s(){for(let m in o)if(o[m])return!0;return!1}return{flags:o,check:g,checkOnce:c,all:i,any:s}},zi={key:0,class:"flex-row",style:{"align-items":"center","justify-content":"space-between",gap:"0.25em","margin-bottom":"1em"}},Di={style:{display:"grid","grid-template-columns":"auto 1fr",gap:"0.5em","margin-top":"1em","align-items":"center"}},gn=200,Tt=e.defineComponent({__name:"GridConfigModal",props:{gridId:{},show:{type:Boolean},pageSize:{},gridColumns:{}},emits:["close","update:pageSize","update:config"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=ie(),c=e.inject("axios"),f=u.useMessage(),g=Mt(["2E2466DDD34847C8B33460E4277A6528"]),i=e.ref(o.pageSize),s=e.ref(!1),m=e.ref(!1),d=N=>N?N.map((V,E)=>({columnId:V.name,title:V.title?r(V.title):r(te(V.name)),visible:!0,sortIndex:E})).sort((V,E)=>V.sortIndex-E.sortIndex):[],h=N=>(V,E)=>{let O=null;if(N=="visible"){const j=Re(V[N]);O=e.h(u.NIcon,{size:"20"},{default:()=>j?e.h(sn):e.h(an)})}else N=="move_up"?O=e.h(u.NIcon,{size:"20"},{default:()=>e.h(Qs)}):N=="move_down"&&(O=e.h(u.NIcon,{size:"20"},{default:()=>e.h(Hs)}));return e.h(u.NButton,{text:!0,onClick:j=>{b(V,E,N),j.stopPropagation()}},{default:()=>O})};function b(N,V,E){switch(E){case"visible":N.visible=!N.visible;break;case"move_up":if(V>0&&T.value){const O=T.value.splice(V,1);T.value.splice(V-1,0,O[0])}break;case"move_down":if(T.value&&V<T.value.length-1){const O=T.value.splice(V,1);T.value.splice(V+1,0,O[0])}break}}const x=()=>{const N=o.gridId;N&&a.confirmToPost("Reset","Are you sure reset the configuration of this data grid?",{url:`/api/core/UserDataGrids/Reset?dataGridId=${N}`,successMessage:"The configuration has been reset, please refresh the page.",success:()=>{n("update:config",null)}})};async function S(){if(!o.gridId)return;const N={dataGridId:o.gridId,pageSize:i.value,columns:T.value.filter(V=>V.columnId).map((V,E)=>({columnId:V.columnId,visible:V.visible,sortIndex:E}))};N.pageSize&&(N.pageSize=Math.max(1,Math.min(gn,N.pageSize)));try{const V=s.value&&m.value,E=await c.post(`/api/core/UserDataGrids/Save?isDefault=${V}`,N);(E==null?void 0:E.isSuccess)==!0?(f.success(r("The configuration has been saved, please refresh the page.")),n("update:pageSize",i.value),n("update:config",N)):f.error((E==null?void 0:E.errorMessage)||r("Error"))}catch(V){f.error((V==null?void 0:V.toString())||r("Error"))}}async function P(){if(o.gridId&&T.value.length)try{const N=s.value&&m.value,V=await c.get(`/api/core/UserDataGrids/Entity?dataGridId=${encodeURIComponent(o.gridId)}?isDefault=${N}`);if(V!=null&&V.isSuccess)if(V.value){i.value=V.value.pageSize;for(const E of V.value.columns){const O=T.value.find(j=>j.columnId==E.columnId);O&&(O.visible=E.visible,O.sortIndex=E.sortIndex),T.value.sort((j,z)=>j.sortIndex-z.sortIndex)}}else T.value=d(o.gridColumns),i.value=o.pageSize;else console.log(V==null?void 0:V.errorMessage)}catch(N){console.log(N)}}e.watch(()=>o.show,N=>{N&&(g.checkOnce(V=>{m.value=V["2E2466DDD34847C8B33460E4277A6528"]}),P())}),e.watch(()=>o.gridColumns,()=>T.value=d(o.gridColumns)),e.watch(s,()=>P());const T=e.ref(d(o.gridColumns)),k=[{title:r("Name"),key:"title"},{title:r("Visible"),key:"visible",width:80,align:"center",fixed:"right",render:h("visible")},{key:"move_up",width:30,align:"center",fixed:"right",render:h("move_up")},{key:"move_down",width:30,align:"center",fixed:"right",render:h("move_down")},{key:"empty",width:20,fixed:"right"}];return(N,V)=>{const E=e.resolveComponent("n-space");return e.openBlock(),e.createBlock(e.unref(u.NModal),{show:N.show,preset:"card",title:e.unref(r)("Config Data Grid"),style:{"max-width":"500px"},draggable:"",onClose:V[3]||(V[3]=()=>N.$emit("close"))},{action:e.withCtx(()=>[e.createVNode(E,{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{onClick:S,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Save")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:x,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Reset")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:V[2]||(V[2]=()=>N.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("div",zi,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("System Default")),1),e.createVNode(e.unref(u.NSwitch),{value:s.value,"onUpdate:value":V[0]||(V[0]=O=>s.value=O)},null,8,["value"])])):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NDataTable),{columns:k,data:T.value,"max-height":450,size:"small"},null,8,["data"]),e.createElementVNode("div",Di,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Page Size")),1),e.createVNode(e.unref(u.NInputNumber),{value:i.value,"onUpdate:value":V[1]||(V[1]=O=>i.value=O),max:gn,min:1,style:{"max-width":"200px"}},null,8,["value"])])]),_:1},8,["show","title"])}}}),yn=e.defineComponent({__name:"HaloButtonSelect",props:{value:{},sourceUrl:{},additionalQuery:{},labelFormatter:{type:Function},keyField:{},labelField:{},subLabelField:{},size:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.inject("axios"),c=e.ref(!1),f=e.ref([]);async function g(s){let m=o.sourceUrl;if(m){const d=o.labelFormatter,h=o.keyField,b=o.labelField,x=o.subLabelField,S=o.additionalQuery;c.value=!0,f.value=[];try{S&&(m=U(m,S,!0));const P=await a.get(m);if(P.isSuccess&&P.value!=null){let T=P.value;if(!Array.isArray(T)&&"rows"in T&&Array.isArray(T.rows)&&(T=T.rows),Array.isArray(T)){const k=T.filter(N=>N&&!0).map(N=>{if(typeof N=="string")return{value:N,label:d?d(N):r(N)};{let V=N[b||"label"];if(d&&(V=d(V)),x){const E=N[x];typeof E=="string"&&(V+=" "+(d?d(E):E))}return{value:N[h||"value"],label:V}}});f.value=k}}}finally{c.value=!1}}}function i(s,m){n("update:value",s,m)}return e.watch(()=>o.sourceUrl,()=>g()),e.onMounted(()=>{g()}),(s,m)=>{const d=e.resolveComponent("n-radio-button"),h=e.resolveComponent("n-radio-group");return e.openBlock(),e.createBlock(h,{value:s.value,size:s.size,"onUpdate:value":i},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,b=>(e.openBlock(),e.createBlock(d,{key:b.value,value:b.value,label:b.label},null,8,["value","label"]))),128))]),_:1},8,["value","size"])}}}),Ke=re(e.defineComponent({__name:"SearchForm",props:{searchItems:{},searchArgs:{},groupOptions:{},groupBy:{}},emits:["update:searchArgs","update:groupBy"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=Z(),c=e.inject("axios"),f=T=>T==null?void 0:T.map(k=>typeof k=="string"?{label:a(k),value:k}:k),g=()=>{const T=new Array;if(n.searchItems)for(const k of n.searchItems)if(typeof k=="string")T.push({name:k,label:te(k),editor:"text",nullable:!0,visibility:!0,searchMethod:"normal"});else{let N=k;k.searchField&&(N=Object.assign({},k),N.name=k.searchField),T.push(N)}return T},i=()=>{const T={};if(x.forEach(k=>{T[k.name]=null,k.searchMethod=="range"&&(T[k.name+"From"]=null,T[k.name+"To"]=null)}),n.searchArgs)for(const k in T)n.searchArgs[k]!=null&&(T[k]=n.searchArgs[k]);return T},s=()=>{for(const T in S)S[T]=null},m=async T=>{var N,V;const k=T.valueSource;if(k){if(k.type=="remote"&&k.sourceUrl)await Pe(c,k,null,E=>k.i18n?a(E):E,!1),T.nullable==!1&&((N=k.values)!=null&&N.length)&&(S[T.name]=k.values[0].value);else if(k.type=="function"&&k.func){k.isLoading=!0;try{const E=(V=k.func)==null?void 0:V.call(void 0);E&&(k.values=E)}finally{k.isLoading=!1}}}},d=()=>{var k;const T={};for(const N of x){const V=N.searchField??N.name;if(N.searchMethod=="range"){const E=h(V+"From",N);E!=null&&(T[V+"From"]=E);let O=h(V+"To",N);O!=null&&(N.editor=="date"&&typeof O=="string"&&(O=se(O,ge).add(1,"days").format(ge)),T[V+"To"]=O)}else{const E=h(V,N);E!=null&&(((k=N.role)==null?void 0:k.includes("list"))==!0&&typeof E=="string"?E.includes(",")?T[V]=E.split(","):T[V]=[E]:T[V]=E)}}return T},h=(T,k)=>{var V,E;let N=S[T];if(!(typeof N=="string"&&(N=N.trim(),N==""&&!k.valueSource))){if(Array.isArray((V=k.valueSource)==null?void 0:V.values)){const O=(E=k.valueSource)==null?void 0:E.values;if(O){if(O.some(j=>j.value==S[T]))N=S[T];else if(N=="")return;if(k.dataType=="boolean"){if(typeof N=="boolean")return N;const j=O.findIndex(z=>z.value==N);return j>-1&&(O.length==2?N=j==0:O.length==3&&j>0&&(N=j==1)),typeof N=="boolean"?N:Oe(N,k.dataType,k.role)}}}return Oe(N,k.dataType,k.role)}},b=()=>{r("update:searchArgs",d())},x=g(),S=e.reactive(i()),P=e.ref(f(n.groupOptions));return e.watch(()=>n.groupOptions,()=>P.value=f(n.groupOptions)),e.onMounted(()=>{i(),x.forEach(T=>{T.valueSource&&(T.valueSource.type=="remote"||T.valueSource.type=="function"?m(T):T.valueSource.type=="static")})}),l({reset:s,updateValues:b,pickValues:d}),(T,k)=>(e.openBlock(),e.createBlock(e.unref(u.NForm),{model:S,"label-placement":"left","label-width":"auto"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NGrid),{"x-gap":"12",cols:"1 700:2 1200:3"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(x),N=>(e.openBlock(),e.createBlock(e.unref(u.NGridItem),{key:N.name},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NFormItem),{label:e.unref(a)(N.label==null?N.name:N.label),path:N.name},{default:e.withCtx(()=>[N.searchMethod=="range"?(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),{key:0},{default:e.withCtx(()=>[e.createVNode(Ve,{"form-item":N,value:S[N.name+"From"],"onUpdate:value":V=>S[N.name+"From"]=V,style:{"flex-grow":"1"},onInput:k[0]||(k[0]=()=>b())},null,8,["form-item","value","onUpdate:value"]),e.createVNode(e.unref(u.NInputGroupLabel),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("to")),1)]),_:1}),e.createVNode(Ve,{"form-item":N,value:S[N.name+"To"],"onUpdate:value":V=>S[N.name+"To"]=V,style:{"flex-grow":"1"},onInput:k[1]||(k[1]=()=>b())},null,8,["form-item","value","onUpdate:value"])]),_:2},1024)):(e.openBlock(),e.createBlock(Ve,{key:1,"form-item":N,value:S[N.name],"onUpdate:value":V=>S[N.name]=V,onInput:k[2]||(k[2]=()=>b())},null,8,["form-item","value","onUpdate:value"]))]),_:2},1032,["label","path"])]),_:2},1024))),128))]),_:1}),P.value?(e.openBlock(),e.createBlock(e.unref(u.NGrid),{key:0,"x-gap":"12",cols:"1 700:2 1200:3"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NGridItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NFormItem),{label:e.unref(a)("Group By")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSelect),{value:T.groupBy,options:P.value,"onUpdate:value":k[3]||(k[3]=N=>T.$emit("update:groupBy",N))},null,8,["value","options"])]),_:1},8,["label"])]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["model"]))}}),[["__scopeId","data-v-8b391a0f"]]),$i={class:"flex-row gap05"},At=e.defineComponent({__name:"TagsView",props:{tags:{},tagSource:{},size:{default:"small"}},setup(t){const l=t,o=Ne(),n=ie(),r=e.ref([]);async function a(){var f;const c=((f=l.tags)==null?void 0:f.map(g=>({value:g,text:g})))??[];if(r.value=c,l.tagSource){const g=await o.fetchSharedData(`tags:${l.tagSource}`,async()=>await n.get({url:`/api/core/CommonCodeItems/list?commonCode=${l.tagSource}`})??[]);for(const i of c){const s=g.find(m=>m.code==i.value);s&&(i.desc=s.name,i.color=s.color)}r.value=[...c]}}return e.watch(()=>l.tags,()=>a()),e.onMounted(()=>a()),(c,f)=>(e.openBlock(),e.createElementBlock("div",$i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,g=>(e.openBlock(),e.createBlock(e.unref(u.NTag),{key:g.value,title:g.desc,color:{borderColor:g.color},size:c.size},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.text),1)]),_:2},1032,["title","color","size"]))),128))]))}}),We=e.defineComponent({__name:"HaloGrid",props:{keyField:{default:"__key__"},checkable:{type:Boolean,default:!0},dragSorting:{type:Boolean},columns:{},data:{},withEdit:{type:Boolean,default:!1},withDelete:{type:Boolean,default:!1},withDetails:{type:Boolean,default:!1},multiSelect:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},maxHeight:{},height:{},selectedId:{},selectedIds:{},flexHeight:{type:Boolean,default:!0}},emits:["editRow","deleteRow","showDetails","columnButtonClick","update:selectedIds","update:selectedId","update:sorter","rowSorting"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=Z(),c=ce.useRouter(),f=yt(),g=e.ref(void 0),i=e.ref(P()),s=e.ref([]),m=e.ref(void 0),d=e.ref(h());function h(){const y={};return typeof n.height=="number"?y.height=`${n.height}px`:typeof n.height=="string"&&(y.height=n.height),y}function b(){var A;const y=s.value,B=(A=n.data)==null?void 0:A.filter(D=>y.includes(D[n.keyField]));r("update:selectedIds",y,B),y.length&&r("update:selectedId",y[0])}function x(y){return y[n.keyField]}function S(y,B){let A=0,D=0;for(const L of B){let F,Y;if(typeof L=="string")F={key:L,title:a(te(L))};else if(!(L.behavior=="none"||L.visible==!1))if(L.behavior=="link"||L.behavior=="router-link")F={key:L.name||`column_${A}`,title:L.title?a(L.title):void 0,align:L.align,fixed:L.fixed||void 0,width:L.width,sorter:L.sortable==!0,render:L.render||T(L)};else if(L.behavior=="button")F={key:L.name||`column_${A}`,title:L.title?a(L.title):void 0,align:L.align||"center",fixed:L.fixed||void 0,width:L.width,sorter:L.sortable==!0,render:L.render||T(L)};else{let v=L.align,ee=[];if(!L.display)switch(L.dataType){case"number":v=v||"right",Y=60,ee.push("text-num");break;case"boolean":v=v||"center",Y=60;break;case"date":Y=100;break;case"datetime":Y=180;break;case"timespan":v=v||"center",Y=80;break;case"time":Y=80,ee.push(`text-${L.dataType}`);break}if(F={key:L.name||`column_${A}`,title:L.title==null?a(te(L.name)):L?a(L.title):void 0,titleAlign:"center",align:v,width:L.width||Y,sorter:L.sortable==!0,minWidth:L.minWidth,resizable:!0,fixed:L.fixed,render:L.render||T(L)},typeof L.className=="string"?ee.push(L.className):Array.isArray(L.className)&&ee.push(...L.className),ee.length&&(F.className=ee.join(" ")),!F.width&&F.minWidth&&(F.width=F.minWidth),L.referencePage&&typeof F.width=="number"&&(F.width+=30),L.role&&L.role.includes("qr")&&typeof F.width=="number"&&(F.width+=30),L.role&&L.role.includes("percent")&&typeof F.width=="number"&&(F.width+=30,F.align||(F.align="right")),(L.textOverflow=="ellipsis"||L.textOverflow=="clip")&&(F.ellipsis={tooltip:!0},F.resizable=!0,Y||(Y=400)),L.children&&L.children.length){const oe=[];S(oe,L.children),F.children=oe,oe.some(ne=>ne.width)&&(F.width=void 0)}}F&&(y.push(F),typeof L=="object"&&typeof L.width=="number"?D+=L.width:D+=Y||150)}return D}function P(){if(n.columns){const y=[];let B=0;return n.checkable&&(y.push({type:"selection",fixed:"left"}),B+=30),B+=S(y,n.columns),n.withEdit&&(y.push({key:"btn-edit",width:30,fixed:"right",render(A,D){return e.h(u.NButton,{text:!0,titie:a("Edit"),onClick:L=>{r("editRow",A,D),L.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#5C6BC0",size:"20"},{default:()=>e.h(Po)})})}}),B+=30),n.withDelete&&(y.push({key:"btn-delete",width:30,fixed:"right",render(A,D){return e.h(u.NButton,{text:!0,titie:a("Delete"),onClick:L=>{r("deleteRow",A,D),L.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#f44336",size:"20"},{default:()=>e.h(jo)})})}}),B+=30),n.withDetails&&(y.push({key:"btn-details",width:30,fixed:"right",render(A,D){return e.h(u.NButton,{text:!0,titie:a("Details"),onClick:L=>{r("showDetails",A,D),L.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#4CAF50",size:"20"},{default:()=>e.h(Xa)})})}}),B+=30),n.dragSorting&&(y.push({key:"drag-sorting-handler",width:30,fixed:"right",render(){return e.h(u.NIcon,{color:"#90A4AE",size:"20",class:"drag-sorting-handle"},{default:()=>e.h(fn)})}}),B+=30),g.value=B,y}else return[]}function T(y){return(B,A)=>{var ee,oe,ne;let D=null;const L=y.display||y.name;if(y.template&&typeof y.template=="function")D=y.template.call(null,B,A);else if(y.dataType=="bool"||y.dataType=="boolean"){const W=Re(B[L]);if(y.values&&y.values.length>1)return y.i18n?a(W?y.values[0]:y.values[1]):W?y.values[0]:y.values[1];W!=null?D=e.h(u.NIcon,{size:"20",class:W?"cell-checked":"cell-unchecked"},{default:()=>W?e.h(Us):e.h(yi)}):D=e.h("span")}else if(y.dataType=="date")D=Lo(Vo(B[L]));else if(y.dataType=="time")D=_o(To(B[L]));else if(y.dataType=="timespan")D=zo(B[L]);else{let W=B[L];y.formatter?W=y.formatter(W,B):y.template&&(W=Ce.render(y.template,B)),typeof W=="string"&&(y.prefix&&(W=y.prefix+W),y.suffix&&(W=W+y.suffix),y.i18n&&(W=a(W))),D=W}let F=y.role;if(F&&!Array.isArray(F)&&(F=[F]),F!=null&&F.length)if(F.includes("tag")){let W;Array.isArray(B[L])?W=B[L]:W=(ne=(oe=(ee=B[L])==null?void 0:ee.toString())==null?void 0:oe.split(","))==null?void 0:ne.filter(K=>K.length),W&&W.length&&(D=e.h(At,{tags:W,tagSource:y.tagSource},{}))}else D&&(D=e.h("span",{class:F.map(W=>{switch(W){case"status":return`status-tag status-${B[L]}`;default:return`halo-form-${W}`}}).join(" ")},[D]));const Y=typeof y.href=="function"?y.href(B):y.href;if(y.behavior=="link")Y?D=e.h("a",{href:Ce.render(Y,B),target:"_blank"},[D]):D=e.h("a",{href:"#",onClick:W=>{var K;r("columnButtonClick",y.name,B,A),(K=y==null?void 0:y.click)==null||K.call(null,B,A),W.stopPropagation()}},[D]);else if(y.behavior=="router-link"&&Y){const W=D;D=e.h(ce.RouterLink,{to:Ce.render(Y,B)},{default:()=>W})}else if(y.behavior=="button"){const W=D;D=e.h(u.NButton,{size:"tiny",tag:"a",onClick:K=>{var fe;r("columnButtonClick",y.name,B,A),(fe=y==null?void 0:y.click)==null||fe.call(null,B,A),K.stopPropagation()}},{default:()=>W})}const v=[];if(y.role&&(y.role.includes("qr")&&v.push(e.h(u.NButton,{quaternary:!0,size:"tiny",class:"btn-cell-qr",title:a("QR Code"),onClick:()=>N(y,A)},{default:()=>e.h(u.NIcon,{},{default:()=>e.h(Ci)})})),y.role.includes("percent"))){const W=Ro(B[L]);v.push(e.h(u.NProgress,{showIndicator:!1,type:"circle",status:W&&W>100?"error":"success",percentage:W||0,class:"percent-mark",style:"width: 1em; margin-bottom: auto; margin-top: auto"}))}return y.referencePage&&v.push(e.h(u.NButton,{quaternary:!0,size:"tiny",class:"btn-cell-ref",title:a("Details"),onClick:()=>k(y,A)},{default:()=>e.h(u.NIcon,{},{default:()=>e.h(un)})})),v.length?e.h("div",{style:"display: flex; justify-content: space-between;"},[e.h("div",{style:"flex-shrink: 1; flex-grow: 1; overflow: hidden;"},[D]),e.h("div",{},...v)]):D}}function k(y,B){if(Array.isArray(n.data)&&B!=null&&B>=0&&B<n.data.length&&y.referencePage){const A=n.data[B],D=Ce.render(y.referencePage,A);D.startsWith("/")&&c.push({path:D})}}function N(y,B){if(Array.isArray(n.data)&&B!=null&&B>=0&&B<n.data.length){const A=n.data[B][y.name];if(typeof A=="string"){const D=a(y.title??te(y.name));f.showQrModal(A,D)}}}function V(y,B){return{onClick:A=>{if(A.target instanceof HTMLElement&&A.target.classList.contains("n-checkbox-box__border")==!1){const D=x(y);D!==void 0&&!s.value.includes(D)&&(s.value=[D],b())}},ondblclick:A=>{A.target instanceof HTMLTableCellElement&&r("editRow",y,B)}}}function E(y,B){B!=!1||!n.multiSelect?(s.value=[y],b()):s.value.includes(y)||(s.value.push(y),b())}function O(y,B){if(B!=!1||!n.multiSelect)s.value=y,b();else{const A=s.value.slice();for(const D of y)A.includes(D)||A.push(D);s.value.length<A.length&&(s.value=A,b())}}function j(y){n.multiSelect?s.value=y:s.value=y.slice(0,1),b()}function z(){return s.value}function H(y,B){Array.isArray(n.data)&&y>-1&&ln(n.data,y,B)}function I(){var A;const y=(A=m.value)==null?void 0:A.$el,B=y==null?void 0:y.querySelector("tbody.n-data-table-tbody");if(B&&Array.isArray(n.data)){const D=e.ref(n.data);Wt.useDraggable(B,D,{animation:150,ghostClass:"draging-ghost",handle:".drag-sorting-handle",onUpdate(L){var v;const F=L.oldIndex,Y=L.newIndex;if(F!=null&&Y!=null&&n.data&&F<((v=n.data)==null?void 0:v.length)){const ee=n.data[F];console.log(F,Y,ee==null?void 0:ee.id),r("rowSorting",{oldIndex:F,newIndex:Y,source:ee,updateGrid:()=>H(F,Y)})}}})}}return e.watch(()=>n.data,y=>{const A=y.map(D=>D[n.keyField]);s.value=s.value.filter(D=>A.includes(D)),b()}),e.watch(()=>n.columns,()=>i.value=P()),e.watch(()=>n.height,()=>d.value=h()),e.onMounted(()=>{n.dragSorting&&setTimeout(()=>{I()},500)}),l({selectRow:E,selectRows:O,getSelectedRowKeys:z}),(y,B)=>(e.openBlock(),e.createBlock(e.unref(u.NDataTable),{ref_key:"nTableRef",ref:m,columns:i.value,data:y.data,size:"small","row-key":x,"row-props":V,loading:y.loading,"single-line":!1,"max-height":y.maxHeight,"scroll-x":g.value,striped:"",remote:"","flex-height":y.flexHeight,style:e.normalizeStyle(d.value),"checked-row-keys":s.value,"onUpdate:checkedRowKeys":[B[0]||(B[0]=A=>s.value=A),j],"scrollbar-props":{trigger:"none"},"onUpdate:sorter":B[1]||(B[1]=A=>y.$emit("update:sorter",A))},null,8,["columns","data","loading","max-height","scroll-x","flex-height","style","checked-row-keys"]))}}),Ri={class:"flex-column gap05"},Oi={class:"flex-row gap05",style:{"justify-content":"space-between"}},Ze=e.defineComponent({__name:"SearchPanel",props:{title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean},additionQuery:{}},emits:["searchBack","resultSelected"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=Z(),c=u.useMessage(),f=e.inject("axios"),g=e.ref(null),i=e.ref(1),s=e.ref(0),m=e.ref(!1),d=e.ref(Array()),h=e.ref(Array());let b=!0;function x(V){if(V){const E=V.rows;E.forEach((O,j)=>{O.__key__=j}),d.value=E,s.value=V.pageCount||1,i.value=V.pageIndex+1}}function S(){d.value=[],s.value=0,i.value=1}function P(V){T(V)}async function T(V){var j,z,H;const E=((j=g.value)==null?void 0:j.pickValues())||{},O=(z=n.config)==null?void 0:z.searchAction;if(E&&O){const I={pageSize:((H=n.config)==null?void 0:H.pageSize)||10,pageIndex:(V||i.value)-1};Object.assign(I,E),n.additionQuery&&(typeof n.additionQuery=="function"?Object.assign(I,n.additionQuery.call(null)):Object.assign(I,n.additionQuery));try{m.value=!0;const y=await f.post(O,I);y.isSuccess&&y.value!=null?(b=!1,x(y.value)):c.error(a(y.errorMessage||"Error"))}catch(y){c.error(y==null?void 0:y.toString())}finally{m.value=!1}}}function k(){const V=h.value;if(V!=null&&V.length){const E=d.value.filter(O=>V.includes(O.__key__));r("searchBack",E,n.config),n.autoClose==!0&&close()}}function N(){n.searchOnMounted&&b&&T(1)}return e.watch(()=>n.config,V=>{V&&(b=!0),S()}),e.onMounted(()=>N()),l({searchPage:T,returnAndClose:k}),(V,E)=>(e.openBlock(),e.createElementBlock("div",Ri,[e.createVNode(Ke,{ref_key:"searchFormRef",ref:g,cols:2,"search-items":V.config.searchFields},null,8,["search-items"]),e.createElementVNode("div",Oi,[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:E[0]||(E[0]=()=>T(1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Search")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:E[1]||(E[1]=()=>{var O;return(O=g.value)==null?void 0:O.reset()})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Reset")),1)]),_:1})]),e.createVNode(We,{class:"flex-grow-1",style:{height:"200px"},columns:V.config.gridColumns,loading:m.value,data:d.value,multiSelect:V.multiSelect,selectedIds:h.value,"onUpdate:selectedIds":[E[2]||(E[2]=O=>h.value=O),E[3]||(E[3]=(O,j)=>V.$emit("resultSelected",O,j))],onDblclickRow:E[4]||(E[4]=O=>V.$emit("searchBack",[O]))},null,8,["columns","loading","data","multiSelect","selectedIds"]),e.createVNode(e.unref(u.NPagination),{page:i.value,"onUpdate:page":[E[5]||(E[5]=O=>i.value=O),P],"page-count":s.value,"show-quick-jumper":"",style:{"align-self":"self-end"}},null,8,["page","page-count"])]))}}),ji={key:0,class:"flex-column flex-grow-1"},Pi={class:"flex-row",style:{"align-items":"center"}},Fi={style:{"margin-left":"0.5em"}},Hi={class:"flex-row",style:{"justify-content":"space-between"}},Et=e.defineComponent({__name:"SearchModal",props:{show:{type:Boolean},width:{},height:{},title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean,default:!1},additionQuery:{}},emits:["searchBack","update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref(void 0);let c=!0;const f=e.ref([]);function g(d,h){f.value=h??[]}function i(d){d&&d.length&&n("searchBack",d,o.config)}function s(){f.value&&f.value.length&&(n("searchBack",f.value,o.config),o.autoClose==!0&&m())}function m(){n("update:show",!1)}return e.watch(()=>o.config,d=>{d&&(c=!0)}),e.watch(a,()=>{var d;o.searchOnMounted&&c&&(c=!1,(d=a.value)==null||d.searchPage(1))}),e.watch(()=>o.show,d=>{var h;d&&o.searchOnMounted&&c&&(c=!1,(h=a.value)==null||h.searchPage(1))}),(d,h)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:d.show,style:e.normalizeStyle({width:d.width??"900px",height:d.height??"650px"}),preset:"card","display-directive":"show","content-class":"flex-column",onClose:h[0]||(h[0]=()=>m())},{header:e.withCtx(()=>[e.createElementVNode("div",Pi,[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5",size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1}),e.createElementVNode("span",Fi,e.toDisplayString(e.unref(r)(d.title)),1)])]),action:e.withCtx(()=>[e.createElementVNode("div",Hi,[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:s},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:m},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})])]),default:e.withCtx(()=>[d.config?(e.openBlock(),e.createElementBlock("div",ji,[e.createVNode(Ze,{ref_key:"searchPanelRef",ref:a,class:"flex-grow-1",config:d.config,"multi-select":d.multiSelect,"auto-close":d.autoClose,"addition-query":d.additionQuery,onResultSelected:g,onSearchBack:i},null,8,["config","multi-select","auto-close","addition-query"])])):e.createCommentVNode("",!0)]),_:1},8,["show","style"]))}}),Gi={style:{"margin-bottom":"12px","min-height":"100px"}},Ye=re(e.defineComponent({__name:"ImportModal",props:{title:{default:"Import File"},multiple:{type:Boolean},action:{},accept:{},show:{type:Boolean},timeout:{},additionParams:{},templateCode:{},templateUrl:{},beforeUpload:{},disabled:{type:Boolean}},emits:["uploaded","update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=u.useMessage(),c=u.useLoadingBar(),f=e.inject("axios"),g=ie(),i=e.reactive({}),s=e.ref(!1),m=e.ref(new Array),d=e.ref(!1),h=e.ref(void 0),b=e.ref(x());function x(){if(o.templateUrl)return o.templateUrl;if(o.templateCode)return`/api/core/DataExchangeTemplates/ImportTemplate?templateCode=${o.templateCode}`}async function S(){var N;if(d.value)return a.warning("Is uploading..."),!1;let k=typeof o.action=="function"?o.action.call(void 0):o.action;if(k&&o.templateCode&&(k=U(k,{templateCode:o.templateCode})),(N=m.value)!=null&&N.length&&k){if(!o.multiple&&m.value.length>1)return a.error("Only one file can be uploaded."),!1;if(o.beforeUpload&&o.beforeUpload.call(null,{files:m})==!1)return!1;try{d.value=!0;const V=m.value.filter(E=>E.status=="pending"||E.status=="error").map(E=>P(E,k));await Promise.all(V),m.value.every(E=>E.status=="finished")&&(m.value.length=0,a.success(r("Upload Success.")),s.value=!1)}catch(V){h.value=(V==null?void 0:V.toString())||r("Error")}finally{d.value=!1}}}async function P(k,N){const V=new FormData;V.append("file",k.file);const E={timeout:o.timeout||1e3*60*10,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:j=>{k.percentage=Math.round(j.loaded*100/j.total)}};k.percentage=0,k.status="uploading";let O=N;o.additionParams&&(O=U(N,o.additionParams)),i&&(O=U(O,i));try{const j=await f.post(O,V,E);j.isSuccess?(k.status="finished",n("uploaded",j.value),n("update:show",!1)):(k.status="error",k.errorMessage=j.errorMessage,h.value=r(j.errorMessage||"Error"))}catch(j){k.status="error",k.errorMessage=j==null?void 0:j.toString(),h.value=(j==null?void 0:j.toString())||r("Error")}}async function T(){const k=b.value;if(k)try{c.start(),await me(k)}catch(N){a.error(await g.getHttpErrorMessage(N,"Error"))}finally{c.finish()}}return e.watch(()=>o.show,()=>{h.value=void 0,m.value=[]}),(k,N)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:k.show,"onUpdate:show":N[3]||(N[3]=V=>k.$emit("update:show",V)),preset:"card",title:e.unref(r)(k.title),style:{"max-width":"600px"},draggable:""},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px"},onClick:S,disabled:k.disabled||!k.action||d.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ti))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Upload")),1)]),_:1},8,["disabled"]),e.createVNode(e.unref(u.NSpace),null,{default:e.withCtx(()=>[b.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,style:{"min-width":"100px"},onClick:T},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(dn))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Download Template")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:N[2]||(N[2]=()=>k.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:d.value},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NUpload),{multiple:k.multiple,"default-upload":!1,"file-list":m.value,"onUpdate:fileList":N[0]||(N[0]=V=>m.value=V),accept:k.accept,disabled:!k.action,"show-retry-button":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NUploadDragger),null,{default:e.withCtx(()=>[e.createElementVNode("div",Gi,[e.createVNode(e.unref(u.NIcon),{size:"48",depth:3},{default:e.withCtx(()=>[e.createVNode(e.unref(va))]),_:1})]),e.createVNode(e.unref(u.NText),{style:{"font-size":"16px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Click or drag files to this area to upload.")),1)]),_:1})]),_:1})]),_:1},8,["multiple","file-list","accept","disabled"]),e.renderSlot(k.$slots,"options",{options:i},void 0,!0)]),_:3})]),_:3},8,["show"]),h.value?(e.openBlock(),e.createBlock(e.unref(u.NAlert),{key:0,type:"error",class:"my-1",closable:"",onClose:N[1]||(N[1]=()=>h.value=void 0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.value),1)]),_:1})):e.createCommentVNode("",!0)]),_:3},8,["show","title"]))}}),[["__scopeId","data-v-18129d6e"]]),_t=e.defineComponent({__name:"InputModal",props:{title:{},message:{},value:{},placeholder:{},maxLength:{},type:{},lines:{},clearable:{type:Boolean},show:{type:Boolean},submitting:{type:Boolean}},emits:["close","commit","update:show","update:value"],setup(t,{emit:l}){var g;const o=t,n=l,{t:r}=Z(),a=e.ref((g=o.value)==null?void 0:g.toString()),c=()=>{n("close"),n("update:show",!1)},f=()=>{n("commit",a.value),n("update:value",a.value)};return e.watch(()=>o.value,i=>a.value=i==null?void 0:i.toString()),(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{title:i.title,show:i.show,preset:"card",style:{width:"400px"},onClose:c},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},loading:i.submitting,onClick:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["loading"]),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:c},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:i.submitting},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.message),1)]),_:1}),e.createVNode(e.unref(u.NInput),{value:a.value,"onUpdate:value":s[0]||(s[0]=m=>a.value=m),placeholder:i.placeholder,maxlength:i.maxLength,type:i.type,rows:i.lines,clearable:i.clearable},null,8,["value","placeholder","maxlength","type","rows","clearable"])]),_:1})]),_:1},8,["show"])]),_:1},8,["title","show"]))}}),Ki={key:0,class:"flex-row",style:{"align-items":"center","justify-content":"space-between",gap:"0.25em","margin-bottom":"1em"}},Wi={key:1},Zi={class:"flex-row gap05"},Yi={style:{display:"grid","grid-template-columns":"auto 1fr",gap:"0.5em","align-items":"center"}},Qi={class:"flex-row gap05",style:{"justify-content":"space-between"}},wn=200,Xi=e.defineComponent({__name:"GridConfigBox",props:{gridId:{},pageSize:{},gridColumns:{}},emits:["close","reset","update:pageSize","update:config"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=ie(),c=Mt(["2E2466DDD34847C8B33460E4277A6528"]),f=ce.useRouter(),g=e.ref(o.pageSize),i=e.ref(!1),s=e.ref(!1),m=e.ref(void 0),d=e.ref(void 0),h=e.ref(!1),b=e.ref(!1),x=I=>I?I.map((y,B)=>({columnId:y.name,title:y.title?r(y.title):r(te(y.name)),visible:!0,sortIndex:B})).sort((y,B)=>y.sortIndex-B.sortIndex):[],S=e.ref(x(o.gridColumns)),P=()=>{const I=o.gridId;if(!I)return;const B=i.value&&s.value?`/api/core/UserDataGrids/ResetGlobal?dataGridId=${I}`:`/api/core/UserDataGrids/Reset?dataGridId=${I}`;a.confirmToPost("Reset","Are you sure reset the configuration of this data grid?",{url:B,successMessage:"The configuration has been reset, please refresh the page.",success:()=>{n("reset")}})},T=()=>{if(!o.gridId)return;const I={dataGridId:o.gridId,pageSize:g.value,columns:S.value.filter(A=>A.columnId).map(A=>({columnId:A.columnId,visible:A.visible,customTitle:A.customTitle,sortIndex:A.sortIndex}))};I.pageSize&&(I.pageSize=Math.max(1,Math.min(wn,I.pageSize)));const y=i.value&&s.value,B=y?`/api/core/UserDataGrids/SaveGlobal?isDefault=${y}`:`/api/core/UserDataGrids/Save?isDefault=${y}`;a.post({url:B,data:I,successMessage:"The configuration has been saved, please refresh the page.",success:()=>{n("update:pageSize",g.value),n("update:config",I)}})},k=()=>{if(!o.gridId||!S.value.length)return;const I=i.value&&s.value;a.get({url:`/api/core/UserDataGrids/${encodeURIComponent(o.gridId)}?isDefault=${I}`,callback:y=>{if(y){g.value=y.pageSize;for(const B of y.columns){const A=S.value.find(D=>D.columnId==B.columnId);A&&(A.visible=B.visible,A.sortIndex=B.sortIndex,A.customTitle=B.customTitle),S.value.sort((D,L)=>D.sortIndex-L.sortIndex)}}else S.value=x(o.gridColumns),g.value=o.pageSize}})},N=()=>{var B;const I=(B=m.value)==null?void 0:B.$el,y=I==null?void 0:I.querySelector("tbody.n-data-table-tbody");y&&S&&Wt.useDraggable(y,S,{animation:150,ghostClass:"draging-ghost",handle:".drag-sorting-handle",onUpdate:()=>{const A=S.value;for(let D=0;D<A.length;D++)A[D].sortIndex=D;console.log(S.value)}})},V=I=>{var y;h.value=!1,d.value&&(d.value.customTitle=I,i.value&&a.post({url:"/api/core/UserDataGrids/UpdateCustomTitleGlobal",data:{dataGridId:o.gridId,columnId:(y=d.value)==null?void 0:y.columnId,customTitle:I}}))},E=()=>{o.gridId&&a.downloadFile({url:`/api/core/UserDataGrids/export?dataGridId=${encodeURIComponent(o.gridId)}`})},O=I=>e.h("div",{class:"flex-row gap05"},[I.customTitle?e.h("span",null,`${I.customTitle} (${I.title})`):e.h("span",null,`${I.title}`),e.h(u.NButton,{text:!0,title:r("Edit"),class:"edit-title-btn",onClick:()=>{d.value=I,h.value=!0}},{default:()=>e.h(u.NIcon,{size:16},{default:()=>e.h(Vi)})})]),j=I=>e.h(u.NButton,{text:!0,onClick:y=>{I.visible=!I.visible,y.stopPropagation()}},{default:()=>e.h(u.NIcon,{size:20},{default:()=>I.visible?e.h(sn):e.h(an)})}),z=()=>{var y;const I={dataGridId:o.gridId,pageSize:o.pageSize,columns:(y=o.gridColumns)==null?void 0:y.map(B=>({columnId:B.name,sortIndex:B.sortIndex,visible:B.visible,title:B.title}))};I.dataGridId&&a.post({url:"/api/core/DataGrids/getOrCreate",data:I,success:B=>{B&&f.push({name:"DataGrid",params:{id:B}})}})},H=[{title:r("Name"),key:"title",render:O},{title:r("Visible"),key:"visible",width:80,align:"center",fixed:"right",render:j},{width:30,align:"center",fixed:"right",render:()=>e.h(u.NIcon,{color:"#90A4AE",size:"20",class:"drag-sorting-handle"},{default:()=>e.h(fn)})},{key:"empty",width:20,fixed:"right"}];return e.watch(()=>o.gridColumns,()=>S.value=x(o.gridColumns)),e.watch(i,()=>k()),e.watch(S,()=>N()),e.onMounted(()=>{setTimeout(()=>{N()},500),c.checkOnce(I=>{s.value=I["2E2466DDD34847C8B33460E4277A6528"]})}),(I,y)=>{var B;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([{"grid-config-global-mode":i.value},"flex-column gap05"])},[s.value?(e.openBlock(),e.createElementBlock("div",Ki,[e.createVNode(e.unref(u.NButton),{onClick:z},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("System Default")),1)]),_:1})])):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("div",Wi,[e.createElementVNode("div",Zi,[e.createVNode(e.unref(u.NButton),{onClick:y[0]||(y[0]=()=>b.value=!0)},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{size:"16"},{default:e.withCtx(()=>[e.createVNode(e.unref(It))]),_:1}),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Import")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:E},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{size:"16"},{default:e.withCtx(()=>[e.createVNode(e.unref(St))]),_:1}),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Export")),1)]),_:1})])])):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NDataTable),{ref_key:"nTableRef",ref:m,columns:H,data:S.value,"max-height":"60vh",size:"small"},null,8,["data"]),e.createElementVNode("div",Yi,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Page Size")),1),e.createVNode(e.unref(u.NInputNumber),{value:g.value,"onUpdate:value":y[1]||(y[1]=A=>g.value=A),max:wn,min:1,style:{"max-width":"200px"}},null,8,["value"])]),e.createVNode(_t,{show:h.value,"onUpdate:show":y[2]||(y[2]=A=>h.value=A),value:((B=d.value)==null?void 0:B.customTitle)??"",title:e.unref(r)("Custom Title"),clearable:"","onUpdate:value":V},null,8,["show","value","title"]),e.createVNode(Ye,{show:b.value,"onUpdate:show":y[3]||(y[3]=A=>b.value=A),action:"/api/UserDataGrids/Import",onUploaded:y[4]||(y[4]=()=>k())},null,8,["show"]),e.createElementVNode("div",Qi,[e.createVNode(e.unref(u.NButton),{onClick:T,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Save")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:P,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Reset")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:y[5]||(y[5]=()=>I.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})])],2)}}}),Ji=t=>{const l=u.useModal(),{t:o}=Z(),n=ie();return{showConfigModal:c=>{const f=t.gridId??c.gridId;if(!f)return;const g=l.create({title:o("Config Data Grid"),preset:"card",contentClass:"flex-column",style:"width: 500px;",draggable:!0,content:()=>e.h(Xi,{gridId:f,pageSize:c.pageSize,gridColumns:c.gridColumns,class:"flex-grow-1",onClose:()=>g.destroy(),onReset:()=>{var i;(i=t.onReset)==null||i.call(null),g.destroy()},"onUpdate:pageSize":i=>{var s;i>0&&((s=t.onPageSizeChanged)==null||s.call(null,i))},"onUpdate:config":i=>{var s;(s=t.onConfigChanged)==null||s.call(null,i),g.destroy()}})})},loadGridConfig:c=>{t.gridId&&n.get({url:`/api/core/UserDataGrids/Entity?dataGridId=${encodeURIComponent(t.gridId)}`,callback:f=>{var g;(g=t.onConfigChanged)==null||g.call(null,f),c==null||c.call(null,f)}})}}},qi={class:"flex-column flex-grow-1",style:{gap:"0.25em"}},Ui={key:0,class:"flex-row",style:{"justify-content":"space-between"}},vi={style:{"margin-left":"8px"}},ec={style:{display:"flex"}},tc={style:{"flex-grow":"1"}},Cn=e.defineComponent({__name:"HaloForm",props:{name:{},autoLoad:{type:Boolean,default:!0},columns:{},keys:{default:"id"},allowNew:{type:Boolean,default:!0},allowEdit:{type:Boolean,default:!0},searchAction:{},getListAction:{},getEntityAction:{},initEntityAction:{},deleteAction:{},deleteBatchAction:{},deleteMethod:{default:"DELETE"},saveAction:{},exportAction:{},importAction:{},detailsPage:{},detailsPageName:{},detailsKeys:{},dataExchangeCode:{},exportFormats:{},exportRanges:{},exportOptions:{},importOptions:{},importTimeout:{},importTemplateCode:{},gridMaxHeight:{},gridHeight:{},gridCheckable:{type:Boolean,default:!0},gridDragSorting:{type:Boolean},chainCreating:{type:Boolean,default:!0},readOnly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},pageSize:{default:20},multiSelect:{type:Boolean,default:!0},quickSearch:{type:Boolean,default:!0},gridFlexHeight:{type:Boolean,default:!0},parentKey:{},parentValue:{},verifyParentKey:{type:[Boolean,Function]},selectedId:{},selectedIds:{},modalColumns:{},modalStyle:{},formGroupLayout:{},enctype:{},batchAdds:{},beforeSave:{},defaultSearchArgs:{},extendedMenus:{},additionKeys:{},searchGroupOptions:{},defaultSortBy:{},defaultSortDirection:{},propertyModal:{}},emits:["update:selectedIds","update:selectedId","update:data","columnButtonClick","saved","beforeShow","itemChange","commitEdit","extendedMenuSelect","beforeRenderPage","searchReturn","rowSorting"],setup(t,{expose:l,emit:o}){var cl;const n=t,r=o,{t:a}=Z(),c=e.inject("axios"),f=e.ref(Array()),g=u.useDialog(),i=u.useMessage(),s=u.useLoadingBar(),m=ce.useRouter(),d=e.ref(Uo(n.columns||[],a)),h=e.ref(Be(n.columns||[])),b=e.ref(vo(n.columns||[],a));let x=1;const S=e.ref(1),P=e.ref(0),T=e.ref(0),k=e.ref(n.pageSize),N=e.ref(!0),V=e.ref(!1),E=e.ref(!1),O=e.ref(""),j=e.ref(n.searchAction&&((cl=n.columns)==null?void 0:cl.some(p=>Ie(p)&&p.search))),z=e.ref(j.value&&!n.getListAction),H=e.ref(z.value&&!0),I=e.ref(!1),y=e.ref(null),B=e.ref(null),A=e.ref(new Array),D=e.ref(!1),L=e.ref(void 0),F=e.ref(void 0),Y=e.ref(void 0),v=e.ref(!1),ee=e.ref(n.readOnly),oe=e.ref(a("Property")),ne=e.ref(!1),W=e.ref(!1);let K;const fe=e.ref([]),Dt=e.ref(Rt("page")),Hn=e.ref(Qc()),$t=e.ref(void 0),he=e.ref([]),Me=e.ref(void 0),Xe=e.ref(!1);let ye;const Gn=e.ref(void 0),we=e.ref(void 0),Te=e.ref(void 0);let ze=[],De=0;const Yc=e.ref({width:Xc(n.modalColumns)});function Qc(){var w;const p={};if(n.defaultSearchArgs)for(const C in n.defaultSearchArgs)p[C]=n.defaultSearchArgs[C];return(w=b.value)==null||w.forEach(C=>{C.defaultValue!=null&&(C.searchMethod=="range"?Array.isArray(C.defaultValue)&&(C.defaultValue.length>0&&C.defaultValue[0]!=null&&(p[`${C.name}From`]=C.defaultValue[0]),C.defaultValue.length>1&&C.defaultValue[1]!=null&&(p[`${C.name}To`]=C.defaultValue[1])):p[C.name]=C.defaultValue)}),p}function Rt(p){return n.exportRanges&&n.exportRanges.length&&!n.exportRanges.includes(p)?n.exportRanges[0]:p}function Xc(p){return p?p>4?"100%":p>1?450*p+"px":"600px":"600px"}function Je(p){if(n.keys){if(typeof n.keys=="string")return p[n.keys];if(n.keys.length==1&&typeof n.keys[0]=="string")return p[n.keys[0]];if(n.keys.length>1)return n.keys.map(w=>p[w]).join()}return""}function qe(p){if(p.__key__=Je(p),n.columns)for(const w of n.columns){let C;if(typeof w=="string")C=w;else if(Ie(w))C=w.name;else continue;C&&!(C in p)&&(p[C]=null)}}function Kn(p){if(p){r("beforeRenderPage",{data:p});const C=p.rows;C.forEach(_=>qe(_)),f.value=C,r("update:data",f.value),T.value=p.totalRecords||0,P.value=p.pageCount||1,S.value=p.pageIndex+1,N.value=!0}}function Wn(p){if(p){const w={data:p};r("beforeRenderPage",w),p=w.data,p.forEach(C=>qe(C)),f.value=p,r("update:data",f.value),P.value=1,S.value=1,N.value=!1}}async function ue(p){var w,C;if(!(V.value||n.disabled)&&n.getListAction){const _={pageSize:k.value,pageIndex:p},$=(w=O.value)==null?void 0:w.trim();if(n.quickSearch&&$&&(_.searchWords=$),n.additionKeys&&Object.assign(_,n.additionKeys),n.parentKey&&!ae(_))return;(we.value||n.defaultSortBy)&&(_.sortBy=we.value??n.defaultSortBy,_.sortDirection=Te.value??n.defaultSortDirection);try{V.value=!0;let G=n.getListAction;typeof G=="function"&&(G=G.call(void 0));const X=U(G,_),R=await c.get(X);R!=null&&R.isSuccess&&R.value?(De++,R.value&&(Array.isArray(R.value)?Wn(R.value):Kn(R.value))):i.error(a((R==null?void 0:R.errorMessage)??((C=R==null?void 0:R.value)==null?void 0:C.toString())??"Error"))}catch(G){i.error((G==null?void 0:G.toString())??a("Error")),console.error(G)}finally{V.value=!1}}}function $e(p){if(!n.disabled)if(H.value&&ye){const w=Object.assign({},ye);w.sortBy=we.value,w.sortDirection=Te.value,Pt(w)}else p!=null?ue(p):ue(S.value-1)}function Ot(){ue(0)}function Jc(){O.value="",ue(0)}function qc(p){if(n.additionKeys)for(const w in n.additionKeys){const C=n.additionKeys[w];C!=null&&(p[w]=C)}}function Zn(){if(!n.parentKey||!n.verifyParentKey)return!0;if(n.verifyParentKey==!0)return!(n.parentValue==null||Array.isArray(n.parentKey)&&Array.isArray(n.parentValue)&&n.parentValue.some(p=>p==null));if(typeof n.verifyParentKey=="function"){const p=n.verifyParentKey({key:n.parentKey,value:n.parentValue});if(typeof p=="boolean")return p}return!0}function ae(p){if(n.verifyParentKey&&Zn()==!1)return!1;if(n.parentKey){const w={};if(Array.isArray(n.parentKey))if(Array.isArray(n.parentValue))for(let C=0;C<n.parentKey.length;C++){const _=n.parentKey[C];(typeof _=="string"||typeof _=="number")&&n.parentValue.length>C&&(w[_]=n.parentValue[C])}else for(let C=0;C<n.parentKey.length;C++){const _=n.parentKey[C];(typeof _=="string"||typeof _=="number")&&(w[_]=n.parentValue)}else n.parentKey&&(w[n.parentKey]=n.parentValue);p&&Object.assign(p,w)}return!0}async function jt(){var w;if(n.disabled)return;const p=(w=y.value)==null?void 0:w.pickValues();if(p&&n.searchAction){const C={};Object.assign(C,p),qc(C),C.pageSize=k.value,C.pageIndex=0,C.sortBy=we.value??n.defaultSortBy,C.sortDirection=Te.value??n.defaultSortDirection,C.groupBy=$t.value,Pt(C)}}async function Pt(p){if(!V.value)try{V.value=!0;let w=n.searchAction;if(typeof w=="function"&&(w=w.call(void 0,p)),!w)return;const C={};if(!ae(C))return;w=U(w,C);const _=await c.post(w,p);_.isSuccess&&_.value!=null?(De++,ye=p,r("searchReturn",{data:_.value,query:p,action:w}),Array.isArray(_.value)?Wn(_.value):Kn(_.value)):i.error(a(_.errorMessage||"Error"))}catch(w){i.error(w==null?void 0:w.toString())}finally{V.value=!1}}function Yn(p,w){const C={};if(ae(C)){if(typeof n.keys=="string"?C[n.keys]=p[n.keys]:n.keys.forEach($=>C[$]=p[$]),Array.isArray(n.detailsKeys))n.detailsKeys.map($=>$.toString()).forEach($=>C[$]=p[$]);else if(typeof n.detailsKeys=="object"){const $=n.detailsKeys;for(const G in $){var _=$[G];_&&(C[G]=p[_])}}else typeof n.detailsKeys=="function"?n.detailsKeys.call(null,C):n.detailsKeys&&(C[n.detailsKeys]=p[n.detailsKeys]);if(n.detailsPageName)m.push({name:n.detailsPageName,params:C});else if(n.detailsPage)if(typeof n.detailsPage=="function"){const $=n.detailsPage(p,w);(typeof $=="string"||typeof $=="object")&&m.push($)}else m.push({path:n.detailsPage,query:C})}}async function Ft(p,w){var C;if(!n.disabled)if(n.getEntityAction){const _={};if(n.additionKeys&&Object.assign(_,n.additionKeys),!ae(_))return;typeof n.keys=="string"?_[n.keys]=p[n.keys]:n.keys.forEach($=>_[$]=p[$]);try{let $=n.getEntityAction;typeof $=="function"&&($=$.call(void 0,p,w));const G=U($,_),X=await c.get(G);X.isSuccess&&X.value!=null?Ue(X.value,n.readOnly||!n.saveAction||!n.allowEdit?"view":"edit"):i.error(a((X==null?void 0:X.errorMessage)??((C=X==null?void 0:X.value)==null?void 0:C.toString())??"Error"))}catch($){i.error(($==null?void 0:$.toString())??a("Error")),console.error($)}}else Ue(p,n.readOnly||!n.saveAction||!n.allowEdit?"view":"edit")}function Ht(p,w){n.readOnly||n.disabled||n.deleteAction&&p&&p.__key__&&g.warning({title:a("Delete"),content:a("Are you sure you want to delete this row?"),positiveText:a("Delete"),negativeText:a("Cancel"),onPositiveClick:()=>{Uc(p,w)}})}async function Uc(p,w){var C;if(n.deleteAction&&n.keys.length)try{const _={};if(n.additionKeys&&Object.assign(_,n.additionKeys),!ae(_))return;typeof n.keys=="string"?_[n.keys]=p[n.keys]:n.keys.forEach(q=>_[q]=p[q]);const $=p.__key__;let G=n.deleteAction;typeof G=="function"&&(G=G.call(void 0,p,w));const X=U(G,_);let R;if(n.deleteMethod=="POST"?R=await c.post(X):R=await c.delete(X),R.isSuccess){let q=f.value.indexOf(p);if(q>-1&&(f.value.splice(q,1),i.success(a("The data has been deleted."))),A.value&&(q=A.value.findIndex(Q=>Q==$),q>-1)){A.value.splice(q,1);const Q=(C=f.value)==null?void 0:C.filter(bd=>A.value.includes(bd["__key__]"]));r("update:selectedIds",A.value,Q),A.value.length?r("update:selectedId",A.value[0],Q!=null&&Q.length?Q[0]:void 0):r("update:selectedId",void 0,void 0)}}else i.error(a(R.errorMessage||"Error"))}catch(_){console.error(_),i.error(_==null?void 0:_.toString())}}function vc(p){n.readOnly||n.disabled||n.deleteBatchAction&&p&&p.length&&g.warning({title:a("Delete"),content:a("Are you sure you want to delete selected rows?"),positiveText:a("Delete"),negativeText:a("Cancel"),onPositiveClick:()=>{ed(p)}})}async function ed(p){if(n.deleteBatchAction&&p.length)try{const w={ids:p.join()};if(n.additionKeys&&Object.assign(w,n.additionKeys),!ae(w))return;let C=n.deleteBatchAction;typeof C=="function"&&(C=C.call(void 0));const _=U(C,w);let $;if(n.deleteMethod=="POST"?$=await c.post(_):$=await c.delete(_),$.isSuccess){for(const G of p){const X=f.value.findIndex(R=>R.__key__==G);X>-1&&f.value.splice(X,1)}A.value=A.value.filter(G=>!p.includes(G)),i.success(a("The data has been deleted."))}else i.error(a($.errorMessage||"Error"))}catch(w){i.error(w),console.error(w==null?void 0:w.toString())}}function Qn(){if(A.value.length){const p=f.value.find(w=>w.__key__==A.value[0]);p&&Ft(p,f.value.indexOf(p))}}function Xn(){if(A.value.length>1&&n.deleteBatchAction)vc(A.value);else if(A.value.length){const p=f.value.find(w=>w.__key__==A.value[0]);p&&Ht(p,f.value.indexOf(p))}}function Ue(p,w){const C={method:w,original:p,value:qo(p,d.value)};switch(r("beforeShow",C),Y.value=p,L.value=C.value,F.value=w,v.value=!0,ee.value=w!="create"&&w!="edit",w){case"create":oe.value=a("New");break;case"edit":oe.value=a("Edit");break;default:oe.value=a("Property");break}}function Jn(){Y.value=void 0,L.value=void 0,F.value=void 0,v.value=!1,oe.value=a("Property")}async function Gt(){var p;if(!(n.readOnly||n.disabled||!n.saveAction))if(n.initEntityAction){let w=n.initEntityAction;typeof w=="function"&&(w=w.call(void 0));let C=w;const _={};if(n.additionKeys&&Object.assign(_,n.additionKeys),!ae(_))return;C=U(C,_);try{const $=await c.get(C);$!=null&&$.isSuccess&&$.value?Ue($.value||{},"create"):i.error(a(($==null?void 0:$.errorMessage)??((p=$==null?void 0:$.value)==null?void 0:p.toString())??"Error"))}catch($){i.error(a(($==null?void 0:$.toString())??"Error")),console.error($)}}else{const w=Xo(d.value);Ue(w,"create")}}async function td(p,w){var $;if(n.readOnly||n.disabled)return;const C=Me.value;if(!C||C.searchConfig!=w||!C.actionUrl)return;let _;if(C.dataBuilder)_=C.dataBuilder(p);else{let G;if(C.keyPicker?G=C.keyPicker(p):G=p.map(X=>X.id),!G||!G.length)return;_={},_[C.keyName||"ids"]=G}if(_){let G=C.actionUrl;n.additionKeys&&Object.assign(_,n.additionKeys);const X={};ae(X)&&(G=U(G,X),Object.assign(_,X));try{const R=await c.post(G,_);if(R.isSuccess){if(R.value){for(const Q of R.value)ve(Q);const q=R.value.map(Q=>Je(Q));($=B.value)==null||$.selectRows(q),Xe.value=!1}}else i.error(a(R.errorMessage||"Error"))}catch(R){i.error(a((R==null?void 0:R.toString())||"Error")),console.error(R)}}}function qn(p){Me.value=p,Xe.value=!0}function od(p){const w=d.value;if(!w||!w.length)return!1;w.forEach(C=>{C.validationStatus=void 0,C.errorMessage=void 0});for(const C of w)C.nullable===!1&&!C.readonly&&(p[C.name]==null||p[C.name]===null||!C.dataType&&(p[C.name]==null||p[C.name]==null)?(C.validationStatus="error",C.errorMessage=a("Required here.")):(C.validationStatus="success",C.errorMessage=void 0));return!w.some(C=>C.validationStatus=="error"||C.validationStatus=="warning")}function nd(){if(n.readOnly||n.disabled)return;const p=d.value;if(!p||!p.length)return;const w=F.value;if(w!="create"&&w!="edit")return;const C=L.value,_=Y.value;if(C&&_){const $=Object.assign({},_);for(let G of p){if(G.readonly==!0||Array.isArray(G.readonly)&&G.readonly.includes(w))continue;let X=Oe(C[G.name],G.dataType,G.role);$[G.name]=X}if(r("commitEdit",{data:$,current:C,original:_,method:w}),n.beforeSave&&n.beforeSave($,w)===!1)return;od($)?Un({data:$,original:_,method:w}):i.error(a("Form validation failed."))}}async function Un(p){var w;if(!(n.readOnly||n.disabled||!n.saveAction))try{let C;const _={};if(n.additionKeys)for(const q in n.additionKeys)n.additionKeys[q]!=null&&(p.data[q]=n.additionKeys[q]);const $={};if(!ae($))return;if(Object.assign(p.data,$),n.enctype=="multipart/form-data"){C=new FormData;const q=Object.keys(p.data);for(const Q of q)p.data[Q]&&C.set(Q,p.data[Q]);_["Content-Type"]="multipart/form-data"}else C=p.data,_["Content-Type"]="application/json;charset=utf-8";let G=n.saveAction;typeof G=="function"&&(G=G.call(void 0));let X=U(G,$);E.value=!0;const R=await c.post(X,C,{headers:_});if(R.isSuccess){if(i.success(a("The data is saved.")),R.value){p.method=="create"?ve(R.value):p.method=="edit"&&vn(R.value),(w=B.value)==null||w.selectRow(Je(R.value)),p.method=="create"&&n.chainCreating?Gt():Jn();try{r("saved",{value:R.value,method:p.method})}catch(q){console.error("emit(saved) fail."+(q==null?void 0:q.toString()))}}}else i.error(a(R.errorMessage||"Error")),R.errors&&ld(d.value,R.errors)}catch(C){i.error((C==null?void 0:C.toString())||a("Error")),console.error(C)}finally{E.value=!1}}function ld(p,w){if(p&&p.length)for(const C of w){const _=p.find($=>$.name.toLowerCase()==C.key.toLowerCase());_&&(_.validationStatus="error",_.errorMessage=C.value)}}function ve(p){qe(p);const w=p.__key__,C=f.value.findIndex(_=>_.__key__==w);C>-1?f.value.splice(C,1,p):f.value.push(p)}function vn(p){qe(p);const w=p.__key__,C=f.value.find(_=>_.__key__==w);if(C)for(const _ in p)C[_]=p[_]}function rd(p){if(H.value&&ye){const w=Object.assign({},ye);w.pageIndex=Math.max(0,p-1),Pt(w)}else p>0?ue(p-1):ue(0)}function ad(p){p&&(k.value=p)}function sd(p,w){A.value=p,r("update:selectedIds",p,w),r("update:selectedId",p.length?p[0]:void 0,w.length?w[0]:void 0)}async function id(p,w){n.exportAction?await cd(p,w)&&(ne.value=!1):n.dataExchangeCode&&(tl(p,w),ne.value=!1)}function el(p,w,C){const _={outputType:p,dataRange:w,searchArgs:JSON.stringify(ye)};if(n.importTemplateCode&&(_.templateCode=n.importTemplateCode),!ye&&(n.additionKeys||n.parentKey)){const $={pageSize:k.value,pageIndex:S.value,sortBy:we.value,sortDirection:Te.value};n.additionKeys&&Object.assign($,n.additionKeys),ae($),_.searchArgs=JSON.stringify($)}switch(C&&Object.assign(_,C),w){case"selection":if(!A.value||!A.value.length)throw a("Please select the rows to be exported.");_.selectedKeys=A.value;break;case"page":_.pageSize=k.value,_.pageIndex=Math.max(0,S.value-1);break}return _}async function cd(p,w){let C=n.exportAction;if(typeof C=="function"&&(C=C.call(void 0)),C){try{if(!Zn())return console.log("Invalid parent key."),!1;const _=el(p,w,n.exportOptions);ae(_),s.start(),C=U(C,_),await me(C)}catch(_){console.log(_),i.error((_==null?void 0:_.toString())||a("Error"))}finally{s.finish()}return!0}else return!1}function dd(){n.importAction&&(D.value=!0)}async function fd(){const p=n.importTemplateCode;if(p){const w=`/api/core/DataExchangeTemplates/ImportTemplate?templateCode=${p}`;try{s.start(),await me(w)}finally{s.finish()}}}async function tl(p,w,C=!1){var q;const _=n.dataExchangeCode;if(!_)return;if(w.toLowerCase()=="empty"){const Q=`/api/core/dataExchange/importTemplate?templateCode=${_}&engineName=${p}`;try{s.start(),await me(Q)}finally{s.finish()}return}const $={name:_,engineName:p,dataRange:w};n.importTemplateCode&&($.templateCode=n.importTemplateCode);const G={pageSize:k.value,pageIndex:S.value-1};switch(w.toLowerCase()){case"empty":G.pageSize=0,G.pageIndex=0;break;case"all":G.pageSize=2e3,G.pageIndex=0;break}if(!ae(G)){console.log("Invalid parent key.");return}let X=n.exportAction||n.getListAction;typeof X=="function"&&(X=X.call(void 0));let R=X;if(C)try{const Q=await c.post("/api/core/tempData/add",{value:JSON.stringify($)});if(Q.isSuccess){if(G.exportOptionId=Q.value,R){R=U(R,G);try{s.start(),await me(R)}finally{s.finish()}}}else i.error((Q==null?void 0:Q.errorMessage)??((q=Q==null?void 0:Q.value)==null?void 0:q.toString())??a("Error"))}catch(Q){i.error((Q==null?void 0:Q.toString())??a("Error")),console.error(Q)}else if(G.exportOption=btoa(JSON.stringify($)),R){R=U(R,G);try{s.start(),await me(R)}finally{s.finish()}}}function ol(p){if(p)switch(p){case"menu_export_action":A.value&&A.value.length?Dt.value=Rt("selection"):Dt.value=Rt("page"),ne.value=!0;break;case"menu_export_template_action":fd();break;case"menu_import_action":dd();break;case"menu_export":ne.value=!0;break;case"menu_export_template":tl("Excel","Empty");break;case"menu_import":break;default:{const w=ze.find(C=>C.key==p);w&&nl(w)}break}}function nl(p){var _;const w=A.value,C={selectedId:w!=null&&w.length?w[0]:void 0,selectedIds:w?[...w]:void 0,data:f.value};typeof p!="string"&&((_=p.click)==null||_.call(null,C)),r("extendedMenuSelect",C)}function ud(p){const w=[];n.exportAction&&w.push({label:a("Export")+"…",key:"menu_export_action",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(St)})}),n.importTemplateCode&&w.push({label:a("Download Template")+"…",key:"menu_export_template_action"}),n.importAction&&!n.readOnly&&w.push({label:a("Import"),key:"menu_import_action",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(It)})}),n.dataExchangeCode&&(w.push({label:a("Export")+"…",key:"menu_export",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(St)})}),w.push({label:a("Export Template"),key:"menu_export_template"}),n.readOnly||(w.push({type:"divider",key:"------------1"}),w.push({label:a("Import"),key:"menu_import",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(It)})}))),p&&p.length&&(w.push({type:"divider",key:"----------e--1"}),p.forEach(C=>{const _={label:C.label,key:C.key};C.icon?_.icon=mt(C.icon):C.renderIcon&&(_.icon=C.renderIcon),w.push(_)})),fe.value=w}const ll=Ji({gridId:n.name,onConfigChanged:p=>Kt(p),onPageSizeChanged:p=>k.value=p,onReset:()=>md});ll.loadGridConfig();const Kt=(p,w)=>{if(p){K=p,k.value=p.pageSize,w||(w=[...h.value]),w.forEach(C=>{C.sortIndex=99999});for(const C of p.columns){const _=w.find($=>$.name==C.columnId);_&&(_.visible=C.visible,_.sortIndex=C.sortIndex,C.title&&(_.title=C.title))}w.sort((C,_)=>(C.sortIndex||0)-(_.sortIndex||0)),h.value=w}};function pd(p){p?Kt(p):(h.value=Be(n.columns||[]),k.value=n.pageSize||20),W.value=!1}const md=()=>{h.value=Be(n.columns||[]),k.value=n.pageSize||20},hd=()=>{n.name&&ll.showConfigModal({gridId:n.name,gridColumns:h.value,pageSize:k.value})};function gd(p,w){var C;for(const _ of p)ve(_);if(w){const _=p.map($=>Je($));(C=B.value)==null||C.selectRows(_)}}function rl(p){if(!p)return;const w=ze==null?void 0:ze.find(C=>C.key==p);w&&nl(w)}function yd(p){var w,C;Array.isArray(p)?(we.value=(w=p[0].columnKey)==null?void 0:w.toString(),Te.value=p[0].order=="ascend"?"Asc":"Desc"):p&&(we.value=(C=p.columnKey)==null?void 0:C.toString(),Te.value=p.order=="ascend"?"Asc":"Desc"),$e()}function al(){const p=new Array;if(n.extendedMenus)for(const C of n.extendedMenus)typeof C=="string"?p.push({label:a(C),key:x++}):(C.key||(C.key=x++),p.push(C));ze=p,wd(p);const w=p.filter(C=>C.group=="import"||C.group=="export");ud(w)}function wd(p){if(p){const w=p.filter(C=>!C.group).map(C=>C.label=="-"?{type:"divider"}:C.icon?{label:C.label,key:C.key,icon:mt(C.icon)}:C.renderIcon?{label:C.label,key:C.key,icon:C.renderIcon()}:{label:C.label,key:C.key});he.value=w}else he.value=[]}function sl(){const p={};return n.parentKey&&ae(p),n.additionKeys&&Object.assign(p,n.additionKeys),p}function il(){const p=Object.assign({},sl(),n.importOptions);Gn.value=Object.keys(p).length?p:void 0}function Cd(){z?I.value=!I.value:I.value=!1}return e.onMounted(()=>{il(),n.autoLoad!=!1&&(z.value?n.autoLoad&&jt():ue(0)),al()}),e.watch(e.computed(sl),(p,w)=>{JSON.stringify(p)!=JSON.stringify(w)&&(il(),n.autoLoad!=!1&&De>0&&$e())}),e.watch(()=>n.extendedMenus,()=>al()),e.watch(()=>n.parentValue,()=>{(n.autoLoad!=!1||De>0)&&ue(0)}),e.watch(()=>n.getListAction,(p,w)=>{w&&(n.autoLoad!=!1||De>0)&&ue(0)}),e.watch(k,(p,w)=>{if(p&&w){var C=void 0,_=S.value,$=T.value;if(_>0&&$){const G=Math.ceil($/p);G<_&&(C=Math.max(0,G-1))}$e(C)}}),e.watch(()=>n.columns,()=>{const p=Be(n.columns||[]);K?Kt(K,p):h.value=p}),l({reloadPage:$e,addRow:Gt,addBatch:qn,editSelectedRow:Qn,deleteSelectedRows:Xn,saveData:Un,doQuickSearch:Ot,clearQuickSearch:Jc,advancedSerach:jt,checkedRowKeys:A,editRow:Ft,deleteRow:Ht,showDetails:Yn,insertRow:ve,updateRow:vn,appendRows:gd,buildExportArgs:el}),(p,w)=>{var C,_,$,G,X;return e.openBlock(),e.createElementBlock("div",qi,[e.renderSlot(p.$slots,"header"),z.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ui,[e.createVNode(e.unref(u.NButtonGroup),null,{default:e.withCtx(()=>[e.renderSlot(p.$slots,"prefix-tools"),p.readOnly?e.createCommentVNode("",!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(p.batchAdds,R=>(e.openBlock(),e.createBlock(e.unref(u.NButton),{onClick:()=>qn(R),disabled:p.readOnly||p.disabled,key:R.id},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#388e3c"},{default:e.withCtx(()=>[e.createVNode(e.unref(Wa))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)(R.label||"Batch Add")),1)]),_:2},1032,["onClick","disabled"]))),128)),p.saveAction&&!p.readOnly&&p.allowNew?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:1,onClick:Gt,disabled:p.readOnly||p.disabled},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#388e3c"},{default:e.withCtx(()=>[e.createVNode(e.unref(hi))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("New")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),p.saveAction&&!p.readOnly&&p.allowEdit?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:2,onClick:Qn,disabled:p.readOnly||p.disabled||!A.value.length},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#5c6bc0"},{default:e.withCtx(()=>[e.createVNode(e.unref(Po))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Edit")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),(p.deleteAction||p.deleteBatchAction)&&!p.readOnly?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:3,onClick:Xn,disabled:p.readOnly||p.disabled||!A.value.length},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#f44336"},{default:e.withCtx(()=>[e.createVNode(e.unref(jo))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Delete")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NButton),{onClick:w[0]||(w[0]=()=>$e()),disabled:p.disabled},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#689f38"},{default:e.withCtx(()=>[e.createVNode(e.unref(je))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Refresh")),1)]),_:1},8,["disabled"]),e.renderSlot(p.$slots,"suffix-tools"),fe.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:4,options:fe.value,disabled:p.disabled,onSelect:ol},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#009688"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ma))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Import/Export"))+" ",1),e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(xt))]),_:1})]),_:1})]),_:1},8,["options","disabled"])):e.createCommentVNode("",!0),he.value&&he.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:5,options:he.value,disabled:p.disabled,onSelect:rl},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5"},{default:e.withCtx(()=>[e.createVNode(e.unref(it))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Advanced"))+" ",1),e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(xt))]),_:1})]),_:1})]),_:1},8,["options","disabled"])):e.createCommentVNode("",!0)]),_:3}),e.renderSlot(p.$slots,"tools"),p.quickSearch?(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),{key:0,class:"flex-row quick-search-box",style:{width:"inherit"}},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref(u.NInput),{class:"flex-grow-1",style:{width:"260px"},value:O.value,"onUpdate:value":w[1]||(w[1]=R=>O.value=R),placeholder:e.unref(a)("Quick Search"),clearable:"",onChange:Ot},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),_:1},8,["value","placeholder"]),[[e.vShow,!H.value]]),e.withDirectives(e.createVNode(e.unref(u.NButton),{title:e.unref(a)("Search"),onClick:w[2]||(w[2]=()=>Ot()),style:{padding:"0 8px"}},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),_:1},8,["title"]),[[e.vShow,!H.value]]),j.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,title:e.unref(a)("More"),style:{padding:"0 8px"},onClick:w[3]||(w[3]=()=>H.value=!H.value)},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[H.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(ka),{key:0})),H.value?(e.openBlock(),e.createBlock(e.unref(Ca),{key:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0)])),e.renderSlot(p.$slots,"neck"),j.value?e.withDirectives((e.openBlock(),e.createBlock(e.unref(u.NCard),{key:1,size:"small",hoverable:"",closable:!z.value,onClose:w[8]||(w[8]=()=>H.value=!1)},{header:e.withCtx(()=>[e.createElementVNode("div",{class:"flex-row",style:e.normalizeStyle([{"align-items":"center"},{cursor:z.value?"pointer":"unset"}]),onClick:Cd},[e.createVNode(e.unref(u.NIcon),{size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1}),e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Search"))+" ",1),e.withDirectives(e.createElementVNode("span",vi," … ",512),[[e.vShow,I.value]])],4)]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px"},onClick:jt},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Search")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:w[6]||(w[6]=()=>{var R;return(R=y.value)==null?void 0:R.reset()})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Reset")),1)]),_:1}),fe.value.length==1&&z.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,style:{"min-width":"100px"},onClick:w[7]||(w[7]=()=>ne.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Export")),1)]),_:1})):e.createCommentVNode("",!0),fe.value.length>1&&z.value?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:1,options:fe.value,onSelect:ol},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Export")),1)]),_:1})]),_:1},8,["options"])):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"search-tools"),z.value&&he.value&&he.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:2,options:he.value,onSelect:rl},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5"},{default:e.withCtx(()=>[e.createVNode(e.unref(it))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Advanced"))+" ",1),e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(xt))]),_:1})]),_:1})]),_:1},8,["options"])):e.createCommentVNode("",!0)]),_:3})]),_:3})]),default:e.withCtx(()=>[e.withDirectives(e.createVNode(Ke,{"search-items":b.value,ref_key:"searchFormRef",ref:y,"search-args":Hn.value,"onUpdate:searchArgs":w[4]||(w[4]=R=>Hn.value=R),"group-options":p.searchGroupOptions,"group-by":$t.value,"onUpdate:groupBy":w[5]||(w[5]=R=>$t.value=R)},null,8,["search-items","search-args","group-options","group-by"]),[[e.vShow,!I.value]])]),_:3},8,["closable"])),[[e.vShow,H.value]]):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"grid",{data:f.value,columns:h.value,loading:V.value,style:"background-color: chartreuse;"},()=>[e.createVNode(We,{ref_key:"dataGridRef",ref:B,data:f.value,columns:h.value,loading:V.value,class:"halo-form-grid flex-grow-1",style:{height:"80px","min-height":"80px"},"drag-sorting":p.gridDragSorting,"flex-height":p.gridFlexHeight,"with-edit":!!p.saveAction&&!p.readOnly&&p.allowEdit,"with-delete":(!!p.deleteAction||!!p.deleteBatchAction)&&!p.readOnly,"with-details":!!p.detailsPage||!!p.detailsPageName,"multi-select":p.multiSelect,"max-height":p.gridMaxHeight,height:p.gridHeight,checkable:p.gridCheckable,onEditRow:Ft,onDeleteRow:Ht,onShowDetails:Yn,"onUpdate:selectedIds":sd,onColumnButtonClick:w[9]||(w[9]=(R,q,Q)=>p.$emit("columnButtonClick",R,q,Q)),"onUpdate:sorter":w[10]||(w[10]=R=>yd(R)),onRowSorting:w[11]||(w[11]=R=>p.$emit("rowSorting",R))},null,8,["data","columns","loading","drag-sorting","flex-height","with-edit","with-delete","with-details","multi-select","max-height","height","checkable"])]),e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[N.value?(e.openBlock(),e.createBlock(e.unref(u.NPagination),{key:0,page:S.value,"onUpdate:page":[w[12]||(w[12]=R=>S.value=R),rd],"item-count":T.value,"page-size":k.value,"page-sizes":[10,20,30,40,50,100],"show-quick-jumper":"","show-size-picker":"","onUpdate:pageSize":ad},{suffix:e.withCtx(({startIndex:R,endIndex:q,itemCount:Q})=>[Q?(e.openBlock(),e.createBlock(e.unref(u.NText),{key:0,italic:"",depth:"3"},{default:e.withCtx(()=>[e.createTextVNode("["+e.toDisplayString(R+1)+"~"+e.toDisplayString(q+1)+"] / "+e.toDisplayString(Q),1)]),_:2},1024)):e.createCommentVNode("",!0)]),_:1},8,["page","item-count","page-size"])):e.createCommentVNode("",!0),p.name?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:1,text:"",onClick:w[13]||(w[13]=()=>hd())},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ii))]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.renderSlot(p.$slots,"default"),e.renderSlot(p.$slots,"bottom",{formItems:d.value,currentData:L.value,list:f.value,selectedKeys:A.value}),e.createVNode(e.unref(u.NModal),{class:"custom-card",show:v.value,"onUpdate:show":w[15]||(w[15]=R=>v.value=R),preset:"card",draggable:"",style:e.normalizeStyle([Yc.value,p.modalStyle]),title:oe.value,"close-on-esc":!1,"mask-closable":!1},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[F.value=="create"||F.value=="edit"?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,onClick:nd,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Save")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NButton),{onClick:Jn,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Close")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:E.value},{default:e.withCtx(()=>[e.createElementVNode("div",ec,[e.createElementVNode("div",null,[e.renderSlot(p.$slots,"entity-form-left",{data:L.value,original:Y.value,method:F.value})]),e.createElementVNode("div",tc,[e.renderSlot(p.$slots,"entity-form",{formItems:d.value,data:L.value,original:Y.value,method:F.value},()=>[e.createVNode(kt,{"form-items":d.value,columns:p.modalColumns,data:L.value,original:Y.value,method:F.value,"group-layout":p.formGroupLayout,"read-only":ee.value,onItemChange:w[14]||(w[14]=R=>p.$emit("itemChange",R))},null,8,["form-items","columns","data","original","method","group-layout","read-only"])])]),e.createElementVNode("div",null,[e.renderSlot(p.$slots,"entity-form-right",{data:L.value,original:Y.value,method:F.value})])])]),_:3},8,["show"])]),_:3},8,["show","style","title"]),(C=p.batchAdds)!=null&&C.length?(e.openBlock(),e.createBlock(Et,{key:2,show:Xe.value,"onUpdate:show":w[16]||(w[16]=R=>Xe.value=R),draggable:"",config:(_=Me.value)==null?void 0:_.searchConfig,title:($=Me.value)==null?void 0:$.searchTitle,"multi-select":((G=Me.value)==null?void 0:G.singleOne)!=!0,"addition-query":(X=Me.value)==null?void 0:X.additionQuery,onSearchBack:td},null,8,["show","config","title","multi-select","addition-query"])):e.createCommentVNode("",!0),p.importAction?(e.openBlock(),e.createBlock(Ye,{key:3,show:D.value,"onUpdate:show":w[17]||(w[17]=R=>D.value=R),draggable:"",action:p.importAction,"addition-params":Gn.value,timeout:p.importTimeout,"template-code":p.importTemplateCode},{options:e.withCtx(({options:R})=>[e.renderSlot(p.$slots,"import-options",{options:R})]),_:3},8,["show","action","addition-params","timeout","template-code"])):e.createCommentVNode("",!0),p.dataExchangeCode||p.exportAction?(e.openBlock(),e.createBlock(Vt,{key:4,show:ne.value,draggable:"","supported-formats":p.exportFormats,"supported-ranges":p.exportRanges,onClose:w[18]||(w[18]=()=>ne.value=!1),onExport:id,range:Dt.value,"template-code":p.importTemplateCode},{options:e.withCtx(()=>[e.renderSlot(p.$slots,"export-options")]),_:3},8,["show","supported-formats","supported-ranges","range","template-code"])):e.createCommentVNode("",!0),p.name?(e.openBlock(),e.createBlock(Tt,{key:5,"grid-id":p.name,draggable:"","grid-columns":h.value,pageSize:k.value,"onUpdate:pageSize":w[19]||(w[19]=R=>k.value=R),show:W.value,onClose:w[20]||(w[20]=()=>W.value=!1),"onUpdate:config":pd},null,8,["grid-id","grid-columns","pageSize","show"])):e.createCommentVNode("",!0)])}}}),oc={class:"flex-row gap05",style:{"align-items":"center"}},bn=e.defineComponent({__name:"HaloModal",props:{show:{type:Boolean},title:{},submitting:{type:Boolean},hideOkButton:{type:Boolean},width:{default:"600px"}},emits:["submit","update:show"],setup(t){const{t:l}=Z();return(o,n)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{class:"custom-card",show:o.show,preset:"card",style:e.normalizeStyle({width:o.width}),draggable:"",onClose:n[2]||(n[2]=()=>o.$emit("update:show",!1))},{header:e.withCtx(()=>[e.createElementVNode("div",oc,[e.renderSlot(o.$slots,"icon"),e.createElementVNode("div",null,e.toDisplayString(o.title),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[o.hideOkButton?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,onClick:n[0]||(n[0]=r=>o.$emit("submit")),style:{"min-width":"100px"},type:"primary",loading:o.submitting},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("OK")),1)]),_:1},8,["loading"])),e.createVNode(e.unref(u.NButton),{onClick:n[1]||(n[1]=()=>o.$emit("update:show",!1)),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["show","style"]))}}),nc={key:0,style:{"text-align":"right"}},kn=e.defineComponent({__name:"HaloSelect",props:{multiple:{type:Boolean},filterable:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},value:{},sourceUrl:{},additionalQuery:{},labelFormatter:{},keyField:{},labelField:{},subLabelField:{},prefix:{},suffix:{},insertBlank:{type:Boolean},autoSelect:{type:Boolean},i18n:{type:Boolean,default:!0}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.inject("axios"),c=e.ref(!1),f=e.ref([]);let g;const i=d=>{(!g||g!=d)&&(g=d,s(d))},s=async d=>{let h=o.sourceUrl;if(h){const b=o.labelFormatter,x=o.keyField,S=o.labelField,P=o.subLabelField,T=o.insertBlank,k=o.additionalQuery;c.value=!0,f.value=[];try{d&&(h=U(h,{searchWords:d})),k&&(h=U(h,k,!0));const N=await a.get(h);if(N.isSuccess&&N.value!=null){let V=N.value;if(!Array.isArray(V)&&"rows"in V&&Array.isArray(V.rows)&&(V=V.rows),Array.isArray(V)){const E=V.filter(O=>O&&!0).map(O=>{if(typeof O=="string")return{value:O,label:b?b(O):r(O)};{let j=O[S||"label"];if(b&&(j=b(j)),o.prefix&&(j=o.prefix+j),o.suffix&&(j=j+o.suffix),o.i18n&&(j=r(j)),P){let z=O[P];typeof z=="string"&&(b&&(z=b(z)),o.i18n&&(z=r(z)),z&&(j+=" "+z))}return{value:O[x||"value"],label:j,data:O}}});T&&E.splice(0,0,{value:"",label:""}),f.value=E,o.autoSelect&&!o.value&&E.length&&n("update:value",E[0].value,E[0],E[0].data)}}}finally{c.value=!1}}},m=(d,h)=>{var x;const b=(x=f.value.find(S=>S.value==d))==null?void 0:x.data;n("update:value",d,h,b)};return e.watch(()=>o.sourceUrl,()=>s()),e.watch(()=>o.additionalQuery,(d,h)=>{JSON.stringify(h)!=JSON.stringify(d)&&s()}),e.onMounted(()=>s()),(d,h)=>(e.openBlock(),e.createBlock(e.unref(u.NSelect),{value:d.value,remote:"",loading:c.value,options:f.value,filterable:d.filterable,multiple:d.multiple,placeholder:"",disabled:d.readonly,clearable:d.clearable,onSearch:i,"onUpdate:value":m},{action:e.withCtx(()=>[d.filterable?(e.openBlock(),e.createElementBlock("div",nc,[e.createVNode(e.unref(u.NText),{depth:"3",italic:""},{default:e.withCtx(()=>[e.createElementVNode("small",null,e.toDisplayString(e.unref(r)("Enter text to filter the result list.")),1)]),_:1})])):e.createCommentVNode("",!0)]),_:1},8,["value","loading","options","filterable","multiple","disabled","clearable"]))}}),lc=e.defineComponent({components:{SearchIcon:un,LeftIcon:Ks,RightIcon:Zs},props:{sourceList:Object,selectedItems:Object,loading:Boolean,placeholder:{type:String,default:"Search"}},emits:["search","update:selectedItems"],setup(t,l){const{t:o}=Z(),n=e.ref(void 0),r=e.ref(c(t.sourceList)),a=e.ref([]);function c(d){return d?d.map(h=>({isSelected:!1,value:h})):[]}function f(){n.value&&l.emit("search",n.value)}function g(){nn(a.value,d=>d.isSelected)>0&&l.emit("update:selectedItems",a.value.map(d=>d.value))}function i(){a.value.forEach(h=>h.isSelected=!1);let d=!1;r.value.forEach(h=>{h.isSelected&&!a.value.some(b=>b.value==h.value)&&(a.value.push({value:h.value,isSelected:!1}),d=!0)}),d&&l.emit("update:selectedItems",a.value.map(h=>h.value))}function s(d){d.forEach(h=>h.isSelected=!0)}function m(d){d.forEach(h=>h.isSelected=!h.isSelected)}return e.watch(()=>t.sourceList,d=>r.value=c(d)),{t:o,searchWords:n,searchMaterials:f,source:r,target:a,moveRight:i,moveLeft:g,selectAll:s,inverseSelect:m}}}),rc={class:"flex-row gap1"},ac={class:"flex-column flex-grow-1 gap25",style:{width:"100px",height:"400px"}},sc={class:"flex-row gap1",style:{"justify-content":"flex-end"}},ic={class:"flex-column gap1",style:{width:"60px","justify-content":"center"}},cc={class:"flex-column flex-grow-1 gap25",style:{width:"100px",height:"400px"}},dc={class:"flex-row gap1",style:{"justify-content":"flex-end"}};function fc(t,l,o,n,r,a){const c=e.resolveComponent("search-icon"),f=e.resolveComponent("n-icon"),g=e.resolveComponent("n-input"),i=e.resolveComponent("n-checkbox"),s=e.resolveComponent("n-scrollbar"),m=e.resolveComponent("n-spin"),d=e.resolveComponent("n-button"),h=e.resolveComponent("right-icon"),b=e.resolveComponent("left-icon");return e.openBlock(),e.createElementBlock("div",rc,[e.createElementVNode("div",ac,[e.createVNode(g,{placeholder:t.placeholder,value:t.searchWords,"onUpdate:value":l[0]||(l[0]=x=>t.searchWords=x),onInput:t.searchMaterials},{suffix:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(c)]),_:1})]),_:1},8,["placeholder","value","onInput"]),e.createVNode(m,{show:t.loading,class:"flex-grow-1 flex-column","content-class":"flex-column flex-grow-1"},{default:e.withCtx(()=>[e.createVNode(s,{class:"flex-grow-1 bordered",style:{height:"50px"},"content-class":"flex-column gap25","content-style":"padding: 4px"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.source,x=>(e.openBlock(),e.createBlock(i,{checked:x.isSelected,"onUpdate:checked":S=>x.isSelected=S,style:{"align-items":"center"}},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"source",{item:x.value,isSelected:x.isSelected},()=>[e.createTextVNode(e.toDisplayString(x.value),1)])]),_:2},1032,["checked","onUpdate:checked"]))),256))]),_:3})]),_:3},8,["show"]),e.createElementVNode("div",sc,[e.createVNode(d,{text:"",onClick:l[1]||(l[1]=()=>t.selectAll(t.source))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Select All")),1)]),_:1}),e.createVNode(d,{text:"",onClick:l[2]||(l[2]=()=>t.inverseSelect(t.source))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Inverse Selection")),1)]),_:1})])]),e.createElementVNode("div",ic,[e.createVNode(d,{onClick:t.moveRight},{default:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(h)]),_:1})]),_:1},8,["onClick"]),e.createVNode(d,{onClick:t.moveLeft},{default:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(b)]),_:1})]),_:1},8,["onClick"])]),e.createElementVNode("div",cc,[e.createVNode(s,{class:"flex-grow-1 bordered","content-class":"flex-column gap25","content-style":"padding: 4px"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.target,x=>(e.openBlock(),e.createBlock(i,{checked:x.isSelected,"onUpdate:checked":S=>x.isSelected=S,style:{"align-items":"center"}},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"target",{item:x.value,isSelected:x.isSelected},()=>[e.createTextVNode(e.toDisplayString(x.value),1)])]),_:2},1032,["checked","onUpdate:checked"]))),256))]),_:3}),e.createElementVNode("div",dc,[e.createVNode(d,{text:"",onClick:l[3]||(l[3]=()=>t.selectAll(t.target))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Select All")),1)]),_:1}),e.createVNode(d,{text:"",onClick:l[4]||(l[4]=()=>t.inverseSelect(t.target))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Inverse Selection")),1)]),_:1})])])])}const Nn=re(lc,[["render",fc]]),xn=re(e.defineComponent({__name:"MainDetailPanel",props:{direction:{default:"vertical"},initialRatio:{default:.618},minSize:{default:100},mainPanelStyle:{},mainPanelClass:{},detailPanelStyle:{},detailPanelClass:{},detailFolded:{type:Boolean,default:!1}},setup(t){const l=t,o=e.ref(l.initialRatio),n=e.ref(!1),r=e.ref(void 0),a=e.computed(()=>l.detailFolded?{[l.direction==="horizontal"?"width":"height"]:"100%",[l.direction==="horizontal"?"height":"width"]:"100%"}:{[l.direction==="horizontal"?"width":"height"]:`${o.value*100}%`,[l.direction==="horizontal"?"height":"width"]:"100%"}),c=e.computed(()=>l.detailFolded?{[l.direction==="horizontal"?"width":"height"]:"100%",[l.direction==="horizontal"?"height":"width"]:"100%"}:{[l.direction==="horizontal"?"width":"height"]:`${(1-o.value)*100}%`,[l.direction==="horizontal"?"height":"width"]:"100%"}),f=s=>{s.preventDefault(),l.detailFolded||(n.value=!0)},g=s=>{if(!n.value||!r.value||l.detailFolded)return;const m=r.value.getBoundingClientRect();let d;l.direction==="horizontal"?d=(s.clientX-m.left)/m.width:d=(s.clientY-m.top)/m.height;const h=l.minSize/(l.direction==="horizontal"?m.width:m.height),b=1-h;o.value=Math.max(h,Math.min(b,d))},i=()=>{n.value=!1};return e.onMounted(()=>{document.addEventListener("mousemove",g),document.addEventListener("mouseup",i)}),e.onUnmounted(()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",i)}),(s,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["main-detail-panel",[s.direction]]),ref_key:"container",ref:r},[e.createElementVNode("div",{class:e.normalizeClass(["panel main-panel",s.mainPanelClass]),style:e.normalizeStyle([[s.mainPanelStyle,a.value],{}])},[e.renderSlot(s.$slots,"main",{},void 0,!0)],6),s.detailFolded?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["divider",{dragging:n.value}]),onMousedown:f},null,34)),s.detailFolded?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["panel detail-panel",s.detailPanelClass]),style:e.normalizeStyle([[s.detailPanelStyle,c.value],{}])},[e.renderSlot(s.$slots,"detail",{},void 0,!0)],6))],2))}}),[["__scopeId","data-v-ca4664e2"]]),Sn=e.defineComponent({__name:"NumberInputModal",props:{title:{},message:{},value:{},show:{type:Boolean}},emits:["update:show","commit"],setup(t,{emit:l}){const o=t,{t:n}=Z(),r=e.ref(o.value);return e.watch(()=>o.value,()=>r.value=o.value),(a,c)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{title:a.title,show:a.show,preset:"card",style:{width:"400px"},draggable:"",onClose:c[3]||(c[3]=()=>a.$emit("update:show",!1))},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:c[1]||(c[1]=()=>a.$emit("commit",r.value))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("OK")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:c[2]||(c[2]=()=>a.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NForm),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NGrid),{cols:24,"x-gap":24},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NFormItemGi),{span:24,label:a.message},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInputNumber),{value:r.value,"onUpdate:value":c[0]||(c[0]=f=>r.value=f)},null,8,["value"])]),_:1},8,["label"])]),_:1})]),_:1})]),_:1},8,["title","show"]))}}),uc={class:"flex-column"},In=e.defineComponent({__name:"ObjectTreeView",props:{selectedId:{},rootId:{default:"0"},rootName:{default:"root"},data:{},loadTreeAction:{},moveAction:{},sortAction:{},treeNodeMapper:{},labelRender:{},searchWords:{},iconRender:{},additionKeys:{}},emits:["update:selectedId","update:path"],setup(t,{emit:l}){var H;const o=t,n=l,{t:r}=Z(),a=ie(),c=e.ref(new Array),f=e.ref(void 0),g=(I,y)=>{for(const B of I){if(B.key==y)return[B];if(B.key!=null&&B.key!=null&&B.children&&!B.isLeaf){const A=g(B.children,y);if(A.length)return A.push(B),A}}return[]},i=(I,y)=>{for(let B=0;B<I.length;B++){const A=I[B];if(A.key==y)return{nodes:I,index:B};if(A.children){const D=i(A.children,y);if(D)return D}}return null},s=I=>{const y=g(j.value,I);return y?y.reverse():[]},m=I=>I,d=(I,y=!0)=>{let B=[];if(Array.isArray(I)){const A=(o==null?void 0:o.treeNodeMapper)??m;B=I.map(A)}return y?[{key:o.rootId,label:r(o.rootName),isLeaf:!Array.isArray(B)||B.length==0,children:B}]:B},h=()=>{let I=o.loadTreeAction;I&&(o.additionKeys&&(I=U(I,o.additionKeys)),a.get({url:I,callback:y=>{if(y){const B=d(y);j.value=B,z.value=B.map(A=>A.key)}}}))},b=I=>{const y=j.value;if(y){const B=y.map(A=>A.children?S(A.children):[]);z.value=B.flat()}},x=I=>{const y=j.value;y&&(z.value=y.map(B=>B.key))},S=(I,y)=>{const B=new Array;for(const A of I)if(A.key&&B.push(A.key),A.children){const D=S(A.children);D.length&&B.push(...D)}return B},P=I=>{c.value=I;const y=I.length?I[0]:void 0;n("update:selectedId",y==o.rootId?void 0:y);const B=y?s(y):[];n("update:path",B)},T=I=>e.h("span",null,I.option.label),k=I=>o.iconRender?e.h(u.NIcon,null,{default:()=>{var y;return(y=o.iconRender)==null?void 0:y.call(null,I)}}):I.option.isLeaf?e.h(u.NIcon,null,{default:()=>e.h(cn)}):e.h(u.NIcon,null,{default:()=>e.h(Bt)}),N=I=>{!o.moveAction&&!o.sortAction||(I.dropPosition=="before"||I.dropPosition=="after"?I.dragNode.key&&typeof I.node.key&&E(I.dragNode,I.node,I.dropPosition):I.dropPosition=="inside"&&typeof I.dragNode.key=="number"&&typeof I.node.key=="number"&&V(I.dragNode,I.node))},V=(I,y)=>{const B=o.moveAction;if(!B)return;const A=I.key,D=[I.key],L=y.key;!A||!L||I==y||a.post({url:B,data:{menuItemIds:D,targetId:L},successMessage:"Successful operation.",success:()=>{const F=i(j.value,A);F&&(F.nodes.splice(F.index,1),y.children&&y.children.push(I))}})};async function E(I,y,B){const A=o.sortAction;if(!A)return;const D=I.key;let L=y.key;if(!D||!L||D==L)return;const F=i(j.value,D);if(F){if(B=="after"){const Y=F.nodes.indexOf(y);if(Y>-1&&Y<F.nodes.length-1&&(y=F.nodes[Y+1],L=y.key,!L||D==L))return}a.post({url:A,data:{menuId:D,nextSiblingId:L},successMessage:"Successful operation.",success:()=>{F.nodes.splice(F.index,1);const Y=F.nodes.indexOf(y);Y>-1?F.nodes.splice(Y,0,I):F.nodes.push(I)}})}}const O=I=>{if(I==null&&(I=o.rootId),c.value.includes(I))return;const y=g(j.value,I);y.length&&(z.value=y.map(B=>B.key),c.value=[I])},j=e.ref(d(o.data??[])),z=e.ref(((H=j.value)==null?void 0:H.map(I=>I.key))??[]);return e.watch(()=>o.additionKeys,()=>h()),e.watch(()=>o.loadTreeAction,()=>h()),e.watch(()=>o.data,I=>{I?j.value=d(I):j.value=[]}),e.watch(()=>o.selectedId,I=>{O(I)}),e.onMounted(()=>{h()}),(I,y)=>(e.openBlock(),e.createElementBlock("div",uc,[e.createVNode(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{placeholder:e.unref(r)("Search"),clearable:"",onChange:y[0]||(y[0]=B=>f.value=B)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pn))]),_:1})]),_:1},8,["placeholder"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:h,title:e.unref(r)("Refresh")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(je))]),_:1})]),_:1},8,["title"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:y[1]||(y[1]=()=>b()),title:e.unref(r)("Expand All")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ii))]),_:1})]),_:1},8,["title"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:y[2]||(y[2]=()=>x()),title:e.unref(r)("Collapse All")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ti))]),_:1})]),_:1},8,["title"])]),_:1}),e.createVNode(e.unref(u.NTree),{class:"flex-grow-1",style:{height:"10px"},"virtual-scroll":"","show-line":"","block-node":"",draggable:I.sortAction!=null||I.moveAction!=null,data:j.value,pattern:f.value,"render-label":T,"render-prefix":k,onDrop:N,"selected-keys":c.value,"default-expanded-keys":z.value,"onUpdate:selectedKeys":P},null,8,["draggable","data","pattern","selected-keys","default-expanded-keys"])]))}}),pc=["src"],Bn=e.defineComponent({__name:"PhotoBox",props:{src:{},fallbackSrc:{}},setup(t){const l=t,n="/img/no_photo.png";let r=!1;function a(c){if(!r){var f=c.target;f instanceof HTMLImageElement&&(r=!0,f.src=l.fallbackSrc??n)}}return e.watch(()=>l.src,()=>{r=!1}),(c,f)=>(e.openBlock(),e.createElementBlock("img",{src:c.src,style:{"border-radius":"0.8em","object-fit":"cover"},onError:a},null,40,pc))}}),mc={class:"flex-column gap05"},hc={key:0},gc={class:"flex-row gap05",style:{"align-items":"center"}},Vn=e.defineComponent({__name:"PrintModal",props:{show:{type:Boolean},title:{default:"Print"},name:{},action:{},additionParams:{},width:{default:"300px"},disabled:{type:Boolean},beforePrint:{}},emits:["update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=ie(),c=e.ref(!1),f=e.ref(s()),g=e.ref(m()),i=[{label:r("Collated (123-123-123)"),value:"Collated"},{label:r("Uncollated (111-222-333)"),value:"Uncollated"}];function s(){if(o.name){const h=Number(localStorage.getItem(`${o.name}:print-copies`));if(h&&h>0)return h}return 1}function m(){if(o.name){const h=localStorage.getItem(`${o.name}:print-collate`);if(h&&(h=="Collated"||h=="Uncollated"))return h}return"Collated"}function d(){if(o.disabled||c.value)return;const h={action:o.action,collate:g.value,copies:f.value,additionParams:o.additionParams};if(o.beforePrint&&o.beforePrint(h)==!1)return;let b=h.action;b&&(b=U(b,[{collate:h.collate,copies:h.copies},h.additionParams]),o.name&&(localStorage.setItem(`${o.name}:print-collate`,g.value),localStorage.setItem(`${o.name}:print-copies`,f.value.toString())),c.value=!1,a.openFile({url:b,loadingStatus:x=>c.value=x,callback:()=>{c.value=!1,n("update:show",!1)}}))}return(h,b)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{class:"custom-card",show:h.show,preset:"card",style:e.normalizeStyle({width:h.width}),onClose:b[3]||(b[3]=()=>h.$emit("update:show",!1))},{header:e.withCtx(()=>[e.createElementVNode("div",gc,[e.createVNode(e.unref(u.NIcon),{size:"16"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ya))]),_:1}),e.createElementVNode("div",null,e.toDisplayString(e.unref(r)(h.title)),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{onClick:d,style:{"min-width":"100px"},type:"primary",loading:c.value,disable:!h.action||h.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Print")),1)]),_:1},8,["loading","disable"]),e.createVNode(e.unref(u.NButton),{onClick:b[2]||(b[2]=()=>h.$emit("update:show",!1)),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.renderSlot(h.$slots,"default"),e.createElementVNode("div",mc,[e.createElementVNode("div",null,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Number of print copies"))+":",1),e.createVNode(e.unref(u.NInputNumber),{value:f.value,"onUpdate:value":b[0]||(b[0]=x=>f.value=x),min:"1"},null,8,["value"])]),f.value>1?(e.openBlock(),e.createElementBlock("div",hc,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Copies print order")),1),e.createVNode(e.unref(u.NSelect),{options:i,value:g.value,"onUpdate:value":b[1]||(b[1]=x=>g.value=x)},null,8,["value"])])):e.createCommentVNode("",!0)])]),_:3},8,["show","style"]))}}),yc={key:0,style:{"text-align":"center"}},wc=["src"],Cc={key:1,style:{"text-align":"center"}},Mn=e.defineComponent({__name:"QrModal",props:{title:{default:"QR Code"},code:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:l}){const o=t,{t:n}=Z(),r=e.computed(()=>`/api/core/QR/Image?code=${encodeURIComponent(o.code||"")}&format=CODE_128&width=200&height=200`);return(a,c)=>{const f=e.resolveComponent("n-text");return e.openBlock(),e.createBlock(e.unref(u.NModal),{show:a.show,"onUpdate:show":c[1]||(c[1]=g=>a.$emit("update:show",g)),preset:"card",title:e.unref(n)(a.title),style:{"max-width":"350px"}},{default:e.withCtx(()=>[a.code?(e.openBlock(),e.createElementBlock("div",yc,[e.createElementVNode("img",{src:r.value},null,8,wc),e.createVNode(e.unref(u.NH3),{style:{margin:"1em"}},{default:e.withCtx(()=>[e.createVNode(f,{class:"text-monospace"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.code),1)]),_:1})]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:c[0]||(c[0]=()=>a.$emit("update:show",!1)),type:"primary",style:{width:"200px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("Close")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",Cc,[e.createVNode(e.unref(u.NEmpty))]))]),_:1},8,["show","title"])}}}),bc={class:"flex-row",style:{"align-items":"center"}},kc={style:{"margin-left":"0.5em"}},Tn=e.defineComponent({__name:"SearchCard",props:{title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean},additionQuery:{}},emits:["searchBack"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref([]),c=(i,s)=>{a.value=s??[]},f=()=>{a&&n("searchBack",a.value,o.config)},g=i=>{i&&i.length&&n("searchBack",i,o.config)};return(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NCard),{class:"flex-grow-1","content-class":"flex-column"},{header:e.withCtx(()=>[e.createElementVNode("div",bc,[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5",size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1}),e.createElementVNode("span",kc,e.toDisplayString(e.unref(r)(i.title)),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px"},disabled:a.value.length==0,onClick:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["disabled"])]),default:e.withCtx(()=>[e.createVNode(Ze,{class:"flex-grow-1",config:i.config,"multi-select":i.multiSelect,"auto-close":i.autoClose,"addition-query":i.additionQuery,onResultSelected:c,onSearchBack:g},null,8,["config","multi-select","auto-close","addition-query"])]),_:1}))}});class Nc{constructor(){J(this,"rows",Array());J(this,"totalRecords",null);J(this,"pageIndex",0);J(this,"pageSize",10);J(this,"pageCount",null);J(this,"noTotal",!1);J(this,"message",null);J(this,"summary",null);J(this,"currentPageRecords",0);J(this,"meta")}}const xc={class:"flex-grow-1 flex-column"},Sc={class:"icon-container"},Ic=["title"],Qe="browse_icon_directory",An="page_index",En="search_words",_n=32,Lt=re(e.defineComponent({__name:"SelectIconBox",emits:["update:selected"],setup(t,{emit:l}){const o=l,{t:n}=Z(),r=ie(),a=e.ref(sessionStorage.getItem(Qe)),c=e.ref(d(void 0)),f=e.ref([]),g=e.ref(1),i=e.ref(0),s=e.ref(!1),m=e.ref(sessionStorage.getItem(En));function d(T){const k=[{name:n("Root"),path:"/"}];if(T){for(;T.startsWith("/")||T.startsWith("\\");)T=T.substring(1);const N=T.split(/[\\/]+/);let V="/";for(const E of N){V+=E;const O={name:E,path:V};k.push(O),V+="/"}}return k}function h(T){T.isDirectory?a.value=T.path:T.path&&o("update:selected",T.path)}function b(){S(0)}function x(T){S(T-1)}function S(T){T=Math.max(0,T);let k=`/api/core/SystemIcons/page?pageSize=${_n}&pageIndex=${T}`;var N=m.value;N&&(k+=`&searchWords=${encodeURIComponent(N)}`);const V=a.value;V&&(k+=`&directory=${encodeURIComponent(V)}`),r.get({url:k,callback:E=>{E&&(f.value=E.rows,i.value=E.totalRecords,g.value=E.pageIndex+1,P(E.pageIndex,V,N))},loadingStatus:E=>s.value=E})}function P(T,k,N){sessionStorage.setItem(An,T.toString()),k?sessionStorage.setItem(Qe,k):sessionStorage.removeItem(Qe),N?sessionStorage.setItem(En,N):sessionStorage.removeItem(Qe)}return e.watch(a,T=>{c.value=d(T),S(0)}),e.onMounted(()=>{c.value=d(a.value);let T=Number(sessionStorage.getItem(An));S(T||0)}),(T,k)=>(e.openBlock(),e.createElementBlock("div",xc,[e.createElementVNode("div",null,[e.createVNode(e.unref(u.NBreadcrumb),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,N=>(e.openBlock(),e.createBlock(e.unref(u.NBreadcrumbItem),{key:N.path},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{text:"",onClick:()=>a.value=N.path,title:N.path},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Fo))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(N.name)+" ",1)]),_:2},1032,["onClick","title"])]),_:2},1024))),128))]),_:1})]),e.createVNode(e.unref(u.NCard),{class:"flex-grow-1","content-class":"flex-column"},{header:e.withCtx(()=>[e.createVNode(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{style:{width:"250px"},placeholder:e.unref(n)("Quick Search"),clearable:"",onChange:b,value:m.value,"onUpdate:value":k[0]||(k[0]=N=>m.value=N)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),_:1},8,["placeholder","value"]),e.createVNode(e.unref(u.NButton),{title:e.unref(n)("Search"),onClick:b,style:{padding:"0 8px"}},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(n)("Search")),1)]),_:1},8,["title"])]),_:1})]),footer:e.withCtx(()=>[e.createVNode(e.unref(u.NPagination),{page:g.value,"onUpdate:page":[k[1]||(k[1]=N=>g.value=N),x],"item-count":i.value??0,"page-size":_n},{suffix:e.withCtx(({startIndex:N,endIndex:V,itemCount:E})=>[E?(e.openBlock(),e.createBlock(e.unref(u.NText),{key:0,italic:"",depth:"3"},{default:e.withCtx(()=>[e.createTextVNode("["+e.toDisplayString(N+1)+"~"+e.toDisplayString(V+1)+"] / "+e.toDisplayString(E),1)]),_:2},1024)):e.createCommentVNode("",!0)]),_:1},8,["page","item-count"])]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:s.value,class:"flex-grow-1 flex-column","content-class":"flex-grow-1 flex-column"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NScrollbar),{"x-scrollable":"",class:"flex-grow-1",style:{"min-height":"100%","min-width":"100%",overflow:"auto",height:"1px",width:"1px"}},{default:e.withCtx(()=>[e.createElementVNode("div",Sc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,N=>(e.openBlock(),e.createBlock(e.unref(u.NButton),{quaternary:"",class:"icon-button",onClick:()=>h(N)},{default:e.withCtx(()=>[e.createElementVNode("div",{style:{overflow:"hidden"},title:N.name},[e.createElementVNode("div",null,[N.isDirectory?(e.openBlock(),e.createBlock(e.unref(u.NIcon),{key:0,size:"48",color:"#FFCA28"},{default:e.withCtx(()=>[e.createVNode(e.unref(Fo))]),_:1})):(e.openBlock(),e.createBlock(e.unref(u.NImage),{key:1,width:"48",height:"48","preview-disabled":"",src:"/api/core/SystemIcons/Icons?path="+N.path},null,8,["src"]))]),e.createElementVNode("div",null,e.toDisplayString(N.name),1)],8,Ic)]),_:2},1032,["onClick"]))),256))])]),_:1})]),_:1},8,["show"])]),_:1})]))}}),[["__scopeId","data-v-ff87aac6"]]),Ln=e.defineComponent({__name:"SelectObjectModal",props:{show:{type:Boolean},title:{default:"Select Object"},items:{},getListAction:{},width:{default:300},keyName:{default:"id"},selectedValue:{},message:{},description:{}},emits:["update:show","valueSelected"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=u.useMessage(),c=e.inject("axios"),f=e.ref(s(o.items)),g=e.ref(!1),i=e.ref(o.selectedValue);function s(h){if(h){if(!h.length||typeof h[0]=="object")return h}else return[];const b=[];for(let x of h)typeof x=="string"||typeof x=="number"?b.push({id:x.toString(),code:r(x.toString())}):b.push(x);return b}async function m(){var b;if(g.value)return;const h=o.getListAction;if(!h){f.value=[];return}try{g.value=!0;const x=await c.get(h);x.isSuccess&&x.value!=null?Array.isArray(x.value)?f.value=x.value:Array.isArray((b=x.value)==null?void 0:b.rows)?f.value=x.value.rows:f.value=[]:a.error(r(x.errorMessage||"Error"))}catch(x){console.log(x),a.error((x==null?void 0:x.toString())||r("Error"))}finally{g.value=!1}}function d(){i.value&&n("valueSelected",i.value)}return e.onMounted(()=>{o.getListAction&&m()}),e.watch(()=>o.getListAction,()=>{m()}),(h,b)=>(e.openBlock(),e.createBlock(e.unref(u.NSpin),{show:g.value},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NModal),{show:h.show,style:e.normalizeStyle({width:h.width+"px",minWidth:"100px"}),preset:"card",title:e.unref(r)(h.title),onClose:b[2]||(b[2]=()=>h.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:"",align:"stretch"},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"header"),e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)),1)]),_:1}),e.createVNode(e.unref(u.NRadioGroup),{value:i.value,"onUpdate:value":b[0]||(b[0]=x=>i.value=x),name:"valueList",style:{display:"block"}},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,x=>(e.openBlock(),e.createBlock(e.unref(u.NRadio),{key:x[h.keyName],value:x[h.keyName]},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"default",{data:x},()=>[e.createTextVNode(e.toDisplayString(x.code)+" "+e.toDisplayString(x.name),1)])]),_:2},1032,["value"]))),128))]),_:3})]),_:3},8,["value"]),e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.description),1)]),_:1}),e.renderSlot(h.$slots,"bottom"),e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:b[1]||(b[1]=()=>h.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),_:3})]),_:3},8,["show","style","title"])]),_:3},8,["show"]))}});function zn(t,l){for(let o of t){if(o.guid==l)return o;if(Array.isArray(o.items)){const n=zn(o.items,l);if(n)return n}}}const zt=()=>{const t={};function l(n,r,a){return!!(r&&r.includes(a)||n.title&&n.title.includes(a)||n.url&&n.url.includes(a))}function o(n,r,a,c){var g;const f=new Array;if(r){let i=0,s=!1;for(const m of r)if(m.isEnabled!==!1)if(m.isSeparator)s||(f.push({type:"divider",key:`_${a}_${i++}`}),s=!0);else{const d=n(m.title),h={key:m.guid,id:m.guid,label:d,disabled:!m.isEnabled,href:m.url,tabBehavior:m.tabBehavior};if(m.items&&m.items.length)h.children=o(n,m.items,m.guid,c);else if(c&&!l(m,d,c))continue;m.guid&&m.icon&&(t[m.guid]={icon:m.icon,color:m.color}),((g=h.children)!=null&&g.length||h.href)&&f.push(h),s=!1}}return f.every(i=>i.type=="divider")?[]:f}return{menuLooks:t,systemMenuToNaiveMenu:o}},Dn=e.defineComponent({__name:"SideMenu",props:{collapsed:{type:Boolean},currentMenuId:{}},setup(t){const{t:l}=Z(),o=e.inject("axios"),n=Se(),r=/^https?:\/\//i,a=e.ref([]),c=e.ref(void 0),f=zt(),g=e.computed(()=>f.systemMenuToNaiveMenu(l,n.menus,void 0,c.value)),i=e.computed(()=>n.isLoadingMenu);function s(h){if(typeof h.href=="string"&&h.href&&!h.children){let b=h.href.startsWith("~")?h.href.substring(1):h.href;h.id&&(b=U(b,{_menuid:h.id}));let x;return h.tabBehavior=="NewTab"?x="_blank":h.tabBehavior=="NamedTab"&&(x=h.id),r.test(b)?e.h("a",{href:b,target:"_blank"},{default:()=>h.label}):e.h(ce.RouterLink,{to:b,target:x},{default:()=>h.label})}else return typeof h.label=="string"?h.label:""}function m(h){var b,x,S;if(h.key){const P=(b=f.menuLooks[h.key])==null?void 0:b.icon;if(P)return e.h(xe,{path:P,class:"menu-icon"});if((x=h.children)!=null&&x.length){const T=(S=h.key)==null?void 0:S.toString();return T&&a.value.includes(T)?e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(fi)}):e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(Bt)})}else return e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(cn)})}}function d(h){if(h)try{o.post(`/api/core/UserRecentMenus/add?menuId=${encodeURIComponent(h)}`)}catch(b){console.error(b)}}return e.onMounted(()=>{!n.menus&&!n.isLoadingMenu&&n.sessionToken&&n.loadMenus()}),e.watch(()=>n.sessionToken,()=>n.loadMenus()),(h,b)=>{const x=e.resolveComponent("n-scrollbar"),S=e.resolveComponent("n-input");return e.openBlock(),e.createBlock(e.unref(u.NSpin),{show:i.value,class:"h-100 menu-spin","content-class":"flex-column h-100"},{default:e.withCtx(()=>[e.createVNode(x,null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NMenu),{collapsed:h.collapsed,"collapsed-width":64,"collapsed-icon-size":22,options:g.value,"root-indent":16,indent:16,"render-label":s,"render-icon":m,value:h.currentMenuId,accordion:!0,"onUpdate:expandedKeys":b[0]||(b[0]=P=>a.value=P),"onUpdate:value":d},null,8,["collapsed","options","value"])]),_:1}),e.withDirectives(e.createVNode(S,{style:{width:"250px"},placeholder:e.unref(l)("Search Menu"),clearable:"",onChange:b[1]||(b[1]=P=>c.value=P)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pn))]),_:1})]),_:1},8,["placeholder"]),[[e.vShow,!h.collapsed]])]),_:1},8,["show"])}}}),Bc=["src"],$n=e.defineComponent({__name:"SystemIconInput",props:{value:{},label:{},placeholder:{},readonly:{type:Boolean},clearable:{type:Boolean,default:!0}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref(!1),c=e.ref(void 0);function f(){a.value=!a.value}function g(i){i!=null&&!o.readonly&&(n("update:value",i),a.value=!1)}return e.watch(()=>o.value,i=>{i?c.value=`/api/core/SystemIcons/Icons?path=${encodeURIComponent(i)}`:c.value=void 0}),(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInputGroupLabel),{style:{display:"flex","justify-content":"center","align-items":"center",width:"40px"}},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:c.value,style:{height:"16px",width:"16px","align-self":"center"}},null,8,Bc)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.unref(u.NInput),{readonly:i.readonly,value:i.value,placeholder:i.placeholder,"onUpdate:value":s[0]||(s[0]=m=>i.$emit("update:value",m)),clearable:i.clearable},null,8,["readonly","value","placeholder","clearable"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:f,disabled:i.readonly},{default:e.withCtx(()=>s[4]||(s[4]=[e.createTextVNode(" … ",-1)])),_:1,__:[4]},8,["disabled"]),e.createVNode(e.unref(u.NModal),{show:a.value,"onUpdate:show":s[2]||(s[2]=m=>a.value=m),title:e.unref(r)("Select Icon"),onClose:s[3]||(s[3]=()=>a.value=!1),preset:"card",style:{width:"730px",height:"600px"},"content-style":"display: flex; flex-direction: column;"},{default:e.withCtx(()=>[e.createVNode(Lt,{"onUpdate:selected":s[1]||(s[1]=m=>g(m))})]),_:1},8,["show","title"])]),_:1}))}}),Vc=e.defineComponent({components:{NButton:u.NButton,NIcon:u.NIcon},props:{title:String,iconColor:String,icon:Object},setup(){const{t}=Z();return{t}}});function Mc(t,l,o,n,r,a){const c=e.resolveComponent("n-icon"),f=e.resolveComponent("n-button");return e.openBlock(),e.createBlock(f,null,e.createSlots({default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(t.title?t.t(t.title):""),1)]),_:2},[t.icon?{name:"icon",fn:e.withCtx(()=>[e.createVNode(c,{color:t.iconColor},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.icon),1)]),_:1},8,["color"])]),key:"0"}:void 0]),1024)}const Rn=re(Vc,[["render",Mc]]),Tc=e.defineComponent({name:"TopMenu",components:{NMenu:u.NMenu,NSpin:u.NSpin},setup(){const{t}=Z(),l=e.inject("axios"),o=Se(),n=/^https?:\/\//i,r=zt(),a=e.computed(()=>r.systemMenuToNaiveMenu(t,o.menus)),c=e.computed(()=>o.isLoadingMenu);function f(s){if(typeof s.href=="string"&&s.href&&!s.children){let m=s.href.startsWith("~")?s.href.substr(1):s.href;s.id&&(m=U(m,{_menuid:s.id}));let d;return s.tabBehavior=="NewTab"?d="_blank":s.tabBehavior=="NamedTab"&&(d=s.id),n.test(m)?e.h("a",{href:m,target:"_blank"},{default:()=>s.label}):e.h(ce.RouterLink,{to:m,target:d},{default:()=>s.label})}else return s.label}function g(s){var m,d;if(s.key){const h=(m=r.menuLooks[s.key])==null?void 0:m.icon;return h?e.h(xe,{path:h,class:"menu-icon"}):(d=s.children)!=null&&d.length?void 0:e.h("div",{class:"menu-icon-blank"},[])}}function i(s){if(s)try{l.post(`/api/core/UserRecentMenus/add?menuId=${encodeURIComponent(s)}`)}catch(m){console.error(m)}}return e.onMounted(()=>{!o.menus&&!o.isLoadingMenu&&o.sessionToken&&o.loadMenus()}),e.watch(()=>o.sessionToken,()=>o.loadMenus()),{menuOptions:a,isLoadingMenu:c,renderMenuLabel:f,renderMenuIcon:g,onMenuSelected:i}}});function Ac(t,l,o,n,r,a){const c=e.resolveComponent("n-menu"),f=e.resolveComponent("n-spin");return e.openBlock(),e.createBlock(f,{show:t.isLoadingMenu},{default:e.withCtx(()=>[e.createVNode(c,{mode:"horizontal",options:t.menuOptions,"render-label":t.renderMenuLabel,"render-icon":t.renderMenuIcon,"onUpdate:value":t.onMenuSelected},null,8,["options","render-label","render-icon","onUpdate:value"])]),_:1},8,["show"])}const On=re(Tc,[["render",Ac]]),Ec=e.defineComponent({name:"TreeView",emits:["update:selectedId","update:path"],props:{selectedId:[Number,String],path:Array,rootId:{type:[Number,String],default:""},rootName:{type:String,default:"Root"},parentKey:{type:String,default:"parentId"},childrenAction:String,moveAction:String,sortAction:String,treeNodeMapper:Function,labelRender:Function},setup(t,l){const o=u.useMessage(),n=e.inject("axios"),{t:r}=Z(),a=e.ref(new Array),c=e.ref(new Array),f=e.ref(new Array);function g(z,H){for(const I of z){if(I.key==H)return{node:I,path:[I.key]};if(I.key!=null&&I.key!=null&&I.children&&!I.isLeaf){const y=g(I.children,H);if(y)return{node:y,path:[I.key,...y.path]}}}return null}function i(z,H){for(let I=0;I<z.length;I++){const y=z[I];if(y.key==H)return{nodes:z,index:I};if(y.children){const B=i(y.children,H);if(B)return B}}return null}function s(z){const H=g(a.value,z);return H?H.path:[]}function m(z,H){const I=new Array;for(const y of z)if(y.key&&(!H||H(y.key))&&I.push(y.key),y.children){const B=m(y.children,H);B.length&&I.push(...B)}return I}function d(z){c.value=z}function h(z){f.value=z;const H=z.length?z[0]:null;l.emit("update:selectedId",H);const I=H?s(H):[];l.emit("update:path",I)}function b(z){return t.treeNodeMapper?t.treeNodeMapper.call(void 0,z):{key:z.id,label:z.title,isLeaf:!z.hasSubitems}}async function x(z){const H=t.childrenAction,I=t.parentKey;if(!(!H||!I))try{const y=U(H,{parentKey:I,parentId:z}),B=await n.get(y);if(B.isSuccess&&B.value!=null)return B.value.map(b);o.error(r(B.errorMessage||"Error"))}catch(y){console.log(y),o.error((y==null?void 0:y.toString())||r("Error"))}}async function S(){a.value=[{key:t.rootId,label:r(t.rootName||"Root"),isLeaf:!1,children:await x(null)}],t.selectedId==null?f.value=[t.rootId]:t.selectedId?f.value=[t.selectedId]:f.value=[],c.value=[t.rootId]}async function P(z){const H=z.key;if(H!=null){if(z.children){const y=c.value,B=m(z.children,A=>y.includes(A));c.value=c.value.filter(A=>!B.includes(A))}const I=await x(H);I&&(z.isLeaf=!I.length,z.children=I.length?I:void 0)}}function T(z){return e.h("span",null,z.option.label)}function k(z){if(!z.option.isLeaf)return e.h(u.NIcon,null,{default:()=>e.h(Bt)})}function N(z){const H=z.option.key;if(H!=null&&f.value.includes(H))return e.h(u.NButton,{text:!0,onClick:I=>{I.stopPropagation(),P(z.option)}},{default:()=>e.h(u.NIcon,null,{default:()=>e.h(je)})})}function V(z){!t.moveAction&&!t.sortAction||(z.dropPosition=="before"||z.dropPosition=="after"?z.dragNode.key&&typeof z.node.key&&O(z.dragNode,z.node,z.dropPosition):z.dropPosition=="inside"&&typeof z.dragNode.key=="number"&&typeof z.node.key=="number"&&E(z.dragNode,z.node))}async function E(z,H){const I=t.moveAction;if(!I)return;const y=z.key,B=[z.key],A=H.key;if(!(!y||!A||z==H))try{const D=await n.post(I,{menuItemIds:B,targetId:A});if(D.isSuccess){o.success(r("Successful operation."));const L=i(a.value,y);L&&(L.nodes.splice(L.index,1),H.children?H.children.push(z):P(H))}else o.error(r(D.errorMessage||"Error"))}catch(D){console.log(D),o.error((D==null?void 0:D.toString())||"Error")}}async function O(z,H,I){const y=t.sortAction;if(!y)return;console.log(`dragNode: ${z.key} ${z.label}, targetNode: ${H.key} ${H.label}, dropPosition: ${I}`);const B=z.key;let A=H.key;if(!B||!A||B==A)return;const D=i(a.value,B);if(D){if(I=="after"){const L=D.nodes.indexOf(H);if(L>-1&&L<D.nodes.length-1&&(H=D.nodes[L+1],A=H.key,!A||B==A))return}try{const L=await n.post(y,{menuId:B,nextSiblingId:A});if(L.isSuccess){o.success(r("Successful operation.")),D.nodes.splice(D.index,1);const F=D.nodes.indexOf(H);F>-1?D.nodes.splice(F,0,z):D.nodes.push(z)}else o.error(r(L.errorMessage||"Error"))}catch(L){console.log(L),o.error((L==null?void 0:L.toString())||"Error")}}}async function j(z){var H;if(z.length){let I=(H=a.value)==null?void 0:H.find(D=>D.key==z[0]);I==null&&(I={key:z[0],label:r(t.rootName||"Root"),isLeaf:!1},a.value.push(I));let y=z[0],B=I;for(let D=1;D<z.length-1&&B;D++)if(B.children||(B.children=await x(y)),B.children){const L=z[D];B=B.children.find(F=>F.key==L),y=L}const A=c.value;for(let D=0;D<z.length-1;D++)A.includes(z[D])||A.push(z[D]);c.value=A,f.value=[z[z.length-1]]}}return e.onMounted(()=>{S()}),e.watch(()=>t.childrenAction,()=>{S()}),e.watch(()=>t.path,z=>{z&&j(z)}),{data:a,expandedKeys:c,expandedKeysChanged:d,loadChildren:P,dragDrop:V,renderLabel:T,renderPrefix:k,renderSuffix:N,selectedKeys:f,selectedKeysChanged:h}}});function _c(t,l,o,n,r,a){const c=e.resolveComponent("n-tree");return e.openBlock(),e.createBlock(c,{"block-line":"",remote:t.childrenAction!=null,draggable:t.sortAction!=null||t.moveAction!=null,data:t.data,"render-label":t.renderLabel,"render-prefix":t.renderPrefix,"render-suffix":t.renderSuffix,onLoad:t.loadChildren,onDrop:t.dragDrop,"expanded-keys":t.expandedKeys,"onUpdate:expandedKeys":t.expandedKeysChanged,"selected-keys":t.selectedKeys,"onUpdate:selectedKeys":t.selectedKeysChanged},null,8,["remote","draggable","data","render-label","render-prefix","render-suffix","onLoad","onDrop","expanded-keys","onUpdate:expandedKeys","selected-keys","onUpdate:selectedKeys"])}const jn=re(Ec,[["render",_c]]),Lc=e.defineComponent({components:{ChangePassword:ft,NotificationIcon:ja},setup(){var d;const t=ce.useRouter(),{t:l}=Z(),o=u.useDialog(),n=Ne(),r=Se(),a=nt(),c=e.computed(()=>r.userInfo),f=e.ref(!1),g="/img/user_avatar.png";function i(){o.warning({title:l("Logout"),content:l("Are you sure log out?"),positiveText:l("OK"),negativeText:l("Cancel"),onPositiveClick:()=>{r.logout(),a.clearTabs(),t.push({path:"/login"})}})}function s(h){switch(h){case"preferences":t.push({path:"/core/preferences"});break;case"change_password":f.value=!0;break;case"logout":i();break;case"toggle_theme":n.toggleTheme();break}}const m=[{label:(d=c.value)==null?void 0:d.userName,type:"group",key:"user_group",children:[{label:l("Preferences"),key:"preferences",icon(){return e.h(u.NIcon,null,{default:()=>e.h(_a)})}},{label:l("Change Password"),key:"change_password",icon(){return e.h(u.NIcon,null,{default:()=>e.h(Fa)})}}]},{label:l("Toggle Theme"),key:"toggle_theme",icon(){return e.h(u.NIcon,null,{default:()=>e.h(ga)})}},{type:"divider"},{label:l("Logout"),key:"logout",icon(){return e.h(u.NIcon,null,{default:()=>e.h(Aa)})}}];return{userInfo:c,options:m,onMenuSelected:s,changePwdBoxShow:f,defaultAvatarPath:g}}}),zc={style:{margin:"0 20px 10px 0",cursor:"pointer"}},Dc={class:"user-name-box"},$c={class:"user-name-label"};function Rc(t,l,o,n,r,a){const c=e.resolveComponent("n-avatar"),f=e.resolveComponent("n-dropdown"),g=e.resolveComponent("change-password"),i=e.resolveComponent("n-space");return e.openBlock(),e.createBlock(i,{style:{"align-items":"center"}},{default:e.withCtx(()=>[e.createVNode(f,{trigger:"click",options:t.options,placement:"bottom-end",onSelect:t.onMenuSelected,size:"medium"},{default:e.withCtx(()=>{var s,m,d;return[e.createElementVNode("div",zc,[e.createVNode(c,{round:"",size:"medium",title:(s=t.userInfo)==null?void 0:s.userName,src:`/api/core/avatar?id=${(m=t.userInfo)==null?void 0:m.avatar}`,"fallback-src":t.defaultAvatarPath,bordered:"",style:{position:"absolute","z-index":"10"}},null,8,["title","src","fallback-src"]),e.createElementVNode("div",Dc,[e.createElementVNode("div",$c,e.toDisplayString((d=t.userInfo)==null?void 0:d.name),1)])])]}),_:1},8,["options","onSelect"]),e.createVNode(g,{show:t.changePwdBoxShow,onClose:l[0]||(l[0]=()=>t.changePwdBoxShow=!1)},null,8,["show"])]),_:1})}const Pn=re(Lc,[["render",Rc],["__scopeId","data-v-0d4b7b61"]]),Oc={class:"flex-row"},jc={class:"app-tab-label"},Pc={style:{"margin-left":"4px"}},Fn=e.defineComponent({__name:"TabMenu",props:{type:{default:"card"}},setup(t){const l=ce.useRouter(),o=Se(),n=e.computed(()=>o.menus),r=e.ref(void 0);l.afterEach(f=>{!f.path||f.path=="/"||f.name=="blank"||(r.value=a(f.path))});function a(f){var i;const g=(i=o.menus)==null?void 0:i.find(s=>{var m;return((m=s.url)==null?void 0:m.toLowerCase())==f.toLowerCase()});if(g)return g.guid}function c(f){var g;if(f){const i=(g=o.menus)==null?void 0:g.find(s=>s.guid==f);i&&i.url&&(l.push(i.url),r.value=i.guid)}}return e.watch(()=>o.sessionToken,()=>o.loadMenus()),e.onMounted(()=>{!o.menus&&!o.isLoadingMenu&&o.sessionToken&&o.loadMenus()}),(f,g)=>n.value&&n.value.length?(e.openBlock(),e.createBlock(e.unref(u.NTabs),{key:0,class:"app-tabs",type:f.type,"justify-content":"space-evenly",animated:"","tab-class":"tab-item","tabs-padding":8,value:r.value,"onUpdate:value":c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,i=>(e.openBlock(),e.createBlock(e.unref(u.NTab),{key:i.guid,name:i.guid},{default:e.withCtx(()=>[e.createElementVNode("div",Oc,[e.createElementVNode("div",null,[i.icon?(e.openBlock(),e.createBlock(xe,{key:0,path:i.icon},null,8,["path"])):(e.openBlock(),e.createBlock(e.unref(u.NIcon),{key:1},{default:e.withCtx(()=>[e.createVNode(e.unref(pi))]),_:1}))]),e.createElementVNode("div",jc,[e.createElementVNode("span",Pc,e.toDisplayString(i.title),1)])])]),_:2},1032,["name"]))),128))]),_:1},8,["type","value"])):e.createCommentVNode("",!0)}});class Fc{constructor(){J(this,"token");J(this,"userId");J(this,"startupTime")}}class Hc{constructor(){J(this,"guid","");J(this,"title","");J(this,"icon");J(this,"color");J(this,"url");J(this,"isSeparator",!1);J(this,"isEnabled",!0);J(this,"groupName");J(this,"description");J(this,"items");J(this,"tabBehavior");J(this,"closable")}}const Gc=Ae.defineStore("fontSize",()=>{const t={small:"14px",medium:"16px",large:"20px"},l="medium",o=()=>{var c;const a=(c=localStorage.getItem("fontSizeMode"))==null?void 0:c.toString();return a&&t[a]?a:l},n=e.ref(o());return{fontSizeMode:n,fontSizeOptions:t,setFontSize:a=>{t[a]&&(n.value=a,localStorage.setItem("fontSizeMode",a))},getFontSize:()=>t[n.value??l]}}),Kc=Ae.defineStore("userConfig",()=>{const t=e.reactive({}),l=e.computed(()=>s=>t[s]),o=e.computed(()=>({...t}));function n(s,m){t[s]=m,g()}function r(s){Object.assign(t,s),g()}function a(s,m=null){return t[s]!==void 0?t[s]:m}function c(s){delete t[s],g()}function f(){Object.keys(t).forEach(s=>delete t[s]),localStorage.removeItem("user_config")}function g(){try{localStorage.setItem("user_config",JSON.stringify(t))}catch(s){console.error("保存配置失败:",s)}}function i(){try{const s=localStorage.getItem("user_config");if(s){const m=JSON.parse(s);Object.assign(t,m)}}catch(s){console.error("加载配置失败:",s)}}return{config:t,getConfig:l,getAllConfig:o,setConfig:n,setMultipleConfig:r,getConfigValue:a,removeConfig:c,clearAllConfig:f,loadFromLocalStorage:i}}),Wc={AppLogoBox:Jt,AppTabs:Go,AutoScrollView:Ko,BarcodeImage:Zo,ChangePassword:ft,ColorInput:ut,DefaultPropertyForm:kt,DetailPage:rn,ExportModal:Vt,EmptyDetailView:mn,FormInput:Ve,FullscreenSwitch:hn,GridConfigModal:Tt,HaloButtonSelect:yn,HaloDatePicker:Fe,HaloForm:Cn,HaloGrid:We,HaloModal:bn,HaloModalInput:bt,HaloSelect:kn,HaloTagsInput:wt,HaloTimePicker:ht,HaloTransfer:Nn,ImportModal:Ye,InputModal:_t,ListInputModal:Ct,MainDetailPanel:xn,MenuIcon:xe,NullableBooleanInput:gt,NumberInputModal:Sn,ObjectTreeView:In,PhotoBox:Bn,PrintModal:Vn,PropertyGrid:Nt,QrModal:Mn,SearchCard:Tn,SearchForm:Ke,SearchModal:Et,SearchPanel:Ze,SelectIconBox:Lt,SelectObjectModal:Ln,SideMenu:Dn,SystemIconInput:$n,TagsView:At,ToolButton:Rn,TopMenu:On,TreeView:jn,UserMenu:Pn,TabMenu:Fn},Zc={install(t,l){const o={...Ho,...l};for(const[n,r]of Object.entries(Wc))t.component(n,r);l!=null&&l.langCode&&t.use(Xt,l==null?void 0:l.langCode,!0),t.provide("axios",le),t.provide(ct,o)}};M.axios=le,M.AppLogoBox=Jt,M.AppTabs=Go,M.AutoScrollView=Ko,M.BarcodeImage=Zo,M.ChangePassword=ft,M.ColorInput=ut,M.DataPage=Nc,M.DateFormat=ge,M.DateTimeFormat=_e,M.DefaultPropertyForm=kt,M.DetailPage=rn,M.EmptyDetailView=mn,M.ExportModal=Vt,M.FormInput=Ve,M.FullscreenSwitch=hn,M.GridConfigModal=Tt,M.HaloButtonSelect=yn,M.HaloDatePicker=Fe,M.HaloForm=Cn,M.HaloGrid=We,M.HaloModal=bn,M.HaloModalInput=bt,M.HaloSelect=kn,M.HaloTagsInput=wt,M.HaloTimePicker=ht,M.HaloTransfer=Nn,M.HalovConfigKey=ct,M.I18nPlugin=Xt,M.ImportModal=Ye,M.InputModal=_t,M.ListInputModal=Ct,M.MainDetailPanel=xn,M.MenuIcon=xe,M.NullableBooleanInput=gt,M.NumberInputModal=Sn,M.ObjectTreeView=In,M.PhotoBox=Bn,M.PrintModal=Vn,M.PropertyGrid=Nt,M.QrModal=Mn,M.SearchCard=Tn,M.SearchForm=Ke,M.SearchModal=Et,M.SearchPanel=Ze,M.SelectIconBox=Lt,M.SelectObjectModal=Ln,M.SessionSummary=Fc,M.SideMenu=Dn,M.SystemIconInput=$n,M.SystemMenu=Hc,M.TabMenu=Fn,M.TagsView=At,M.TimeFormat=Le,M.ToolButton=Rn,M.TopMenu=On,M.TreeView=jn,M.UserMenu=Pn,M.addDays=vr,M.appendParamsToUrl=U,M.arrayGroupBy=gs,M.arrayMove=ln,M.arrayRemoveIf=nn,M.buildBarcodeUrl=Wo,M.buildSearchItems=vo,M.camelToWords=te,M.clearObject=as,M.convertItems=Uo,M.convertPercentValue=Ro,M.convertTo=Oe,M.copyEntity=qo,M.copyToEntity=Jo,M.createGridColumns=Be,M.createI18n=Qt,M.dateTimeToString=st,M.dateToNumber=Eo,M.dateToString=Lo,M.default=Zc,M.defaultHalovOptions=Ho,M.defaultValue=$o,M.downloadFile=me,M.findMenuById=zn,M.firstDayOfMonth=ea,M.formatTimespan=zo,M.getColumnWidth=pt,M.getConfig=dt,M.iconRender=mt,M.iconRenderIf=cs,M.initEntity=Xo,M.instanceOfColumnValueSource=Qo,M.instanceOfHaloColumn=Ie,M.instanceOfTime=Mo,M.isNullOrWhiteSpace=Oo,M.lastDayOfMonth=ta,M.linesToArray=na,M.loadItemSources=Pe,M.mergeRoutes=ws,M.msToTime=Xr,M.onNullOrWhiteSpace=ra,M.openFile=on,M.renderDifference=fs,M.renderIconButton=ds,M.renderLabel=is,M.searchField=ys,M.secondsToTime=To,M.splitNumberByCount=Cs,M.splitNumberBySize=bs,M.stringToArray=oa,M.stringToTime=Ao,M.sumNumbers=ks,M.timeToString=_o,M.timestamp=qr,M.toBool=de,M.toBoolDefault=Re,M.toDate=Vo,M.toViewModel=Ur,M.useAccountStore=Se,M.useCommonStore=Ne,M.useFontSizeStore=Gc,M.useHttpTools=ie,M.useI18n=Z,M.useMenus=zt,M.usePermissions=Mt,M.useTabsStore=nt,M.useUiTools=yt,M.useUserConfigStore=Kc,M.validateEmail=la,Object.defineProperties(M,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
7
+ `):o.value},f=()=>{var s,m,d;return g.value?((d=(m=(s=g.value)==null?void 0:s.split(/\r?\n/))==null?void 0:m.map(h=>h.trim()))==null?void 0:d.filter((h,b,x)=>h&&x.indexOf(h)==b)).join(","):""},g=e.ref(c());return e.watch(()=>o.value,()=>{g.value=c()}),(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{title:i.title,show:i.show,preset:"card",style:{width:"350px"},draggable:"",onClose:s[2]||(s[2]=()=>i.$emit("update:show",!1))},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:a,disabled:i.readonly},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["disabled"]),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:s[1]||(s[1]=()=>i.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.message),1)]),_:1}),e.createVNode(e.unref(u.NInput),{value:g.value,"onUpdate:value":s[0]||(s[0]=m=>g.value=m),placeholder:i.placeholder,maxlength:i.maxLength,type:"textarea",readonly:i.readonly,rows:16,class:"halo-form-code"},null,8,["value","placeholder","maxlength","readonly"])]),_:1})]),_:1},8,["title","show"]))}}),kt=e.defineComponent({__name:"HaloModalInput",props:{value:{},label:{},inputReadOnly:{type:Boolean},placeholder:{},config:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref(!1),c=o.config;function f(){a.value=!a.value}function g(i){i!=null&&(n("update:value",i),a.value=!1)}return e.watch(()=>o.value,i=>{console.log(`value changed: [${i}]`)}),e.onMounted(()=>{console.log("Modal-Input onMounted")}),(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{readonly:i.inputReadOnly,value:i.value,placeholder:i.placeholder,"onUpdate:value":s[0]||(s[0]=m=>i.$emit("update:value",m))},null,8,["readonly","value","placeholder"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:f},{default:e.withCtx(()=>s[4]||(s[4]=[e.createTextVNode(" … ",-1)])),_:1,__:[4]}),e.createVNode(e.unref(u.NModal),{show:a.value,"onUpdate:show":s[2]||(s[2]=m=>a.value=m),title:e.unref(r)(e.unref(c).title??i.label??""),onClose:s[3]||(s[3]=()=>a.value=!1),preset:"card",style:e.normalizeStyle(e.unref(c).modalStyle),"content-style":"display: flex; flex-direction: column;"},{default:e.withCtx(()=>[e.unref(c).componentType?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(c).componentType),{key:0,style:e.normalizeStyle(e.unref(c).style),"onUpdate:selected":s[1]||(s[1]=m=>g(m))},null,40,["style"])):e.createCommentVNode("",!0)]),_:1},8,["show","title","style"])]),_:1}))}}),xs={key:0,style:{"flex-grow":"1"}},Ss={key:0,style:{"text-align":"right"}},Is=["readonly","disabled"],Bs=["readonly","disabled"],Ve=e.defineComponent({__name:"FormInput",props:{value:{},readonly:{type:Boolean},formItem:{},label:{},placeholder:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,r=e.ref(o.value),{t:a}=Z(),c=e.inject("axios"),f=e.ref(void 0),g=e.ref(!1),i=e.ref(!1);function s(d){if(d.target instanceof HTMLInputElement){const h=d.target.files;h!=null&&h.length?r.value=h[0]:r.value=null}}async function m(d){var b,x;const h=(b=o.formItem)==null?void 0:b.valueSource;h&&h.type=="remote"&&h.sourceUrl&&h.filterable&&Pe(c,h,{searchWords:d},S=>h.i18n?a(S):S,((x=o.formItem)==null?void 0:x.nullable)!=!1)}return e.watch(r,d=>{n("update:value",d)}),e.watch(()=>o.value,d=>{r.value=d}),e.onMounted(()=>{var d,h;(h=(d=o.formItem)==null?void 0:d.role)!=null&&h.length&&(g.value=o.formItem.role.includes("list"),f.value=o.formItem.role.map(b=>`halo-form-${b}`).join(" "))}),(d,h)=>{var E,O,j,z,H,I,y,B,A,D,L,F,Y,v,ee,oe,ne,W;const b=e.resolveComponent("n-switch"),x=e.resolveComponent("n-text"),S=e.resolveComponent("n-select"),P=e.resolveComponent("n-input-number"),T=e.resolveComponent("n-checkbox"),k=e.resolveComponent("n-input"),N=e.resolveComponent("n-icon"),V=e.resolveComponent("n-button");return d.formItem?(e.openBlock(),e.createElementBlock("div",xs,[typeof d.formItem.editor=="function"?(e.openBlock(),e.createBlock(e.KeepAlive,{key:0},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.formItem.editor),{value:r.value,"onUpdate:value":h[0]||(h[0]=K=>r.value=K)},null,40,["value"]))],1024)):((E=d.formItem.editor)==null?void 0:E.startsWith("@"))==!0?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.formItem.editor.substring(1)),{key:1,value:r.value,"onUpdate:value":h[1]||(h[1]=K=>r.value=K),config:d.formItem.editorConfig,label:d.formItem.label,readonly:d.readonly,disabled:d.readonly},null,40,["value","config","label","readonly","disabled"])):d.formItem.editor=="modal"?(e.openBlock(),e.createBlock(kt,{key:2,value:r.value,"onUpdate:value":h[2]||(h[2]=K=>r.value=K),config:d.formItem.editorConfig,label:d.formItem.label},null,8,["value","config","label"])):d.formItem.editor=="boolean"&&Array.isArray(d.formItem.values)&&d.formItem.values.length>1?(e.openBlock(),e.createBlock(b,{key:3,value:r.value,"onUpdate:value":h[3]||(h[3]=K=>r.value=K),style:e.normalizeStyle((O=d.formItem.editorConfig)==null?void 0:O.style)},{checked:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.formItem.values[0]),1)]),unchecked:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.formItem.values[1]),1)]),_:1},8,["value","style"])):d.formItem.valueSource?(e.openBlock(),e.createBlock(S,{key:4,value:r.value,"onUpdate:value":h[4]||(h[4]=K=>r.value=K),remote:d.formItem.valueSource.type=="remote",loading:d.formItem.valueSource.isLoading,options:d.formItem.valueSource.values,filterable:d.formItem.valueSource.filterable,multiple:((j=d.formItem.role)==null?void 0:j.includes("list"))==!0,placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((z=d.formItem.editorConfig)==null?void 0:z.style),onSearch:m},{action:e.withCtx(()=>[d.formItem.valueSource.filterable?(e.openBlock(),e.createElementBlock("div",Ss,[e.createVNode(x,{depth:"3",italic:""},{default:e.withCtx(()=>[e.createElementVNode("small",null,e.toDisplayString(e.unref(a)("Enter text to filter the result list.")),1)]),_:1})])):e.createCommentVNode("",!0)]),_:1},8,["value","remote","loading","options","filterable","multiple","disabled","clearable","style"])):d.formItem.editor=="number"?(e.openBlock(),e.createBlock(P,{key:5,value:r.value,"onUpdate:value":h[5]||(h[5]=K=>r.value=K),min:d.formItem.minValue,max:d.formItem.maxValue,clearable:d.formItem.nullable,readonly:d.readonly,placeholder:d.placeholder,style:e.normalizeStyle((H=d.formItem.editorConfig)==null?void 0:H.style)},null,8,["value","min","max","clearable","readonly","placeholder","style"])):d.formItem.editor=="boolean"&&d.formItem.nullable?(e.openBlock(),e.createBlock(yt,{key:6,value:r.value,"onUpdate:value":h[6]||(h[6]=K=>r.value=K),placeholder:"",disabled:d.readonly,style:e.normalizeStyle((I=d.formItem.editorConfig)==null?void 0:I.style)},null,8,["value","disabled","style"])):d.formItem.editor=="boolean"?(e.openBlock(),e.createBlock(T,{key:7,checked:r.value,"onUpdate:checked":h[7]||(h[7]=K=>r.value=K),disabled:d.readonly,style:e.normalizeStyle((y=d.formItem.editorConfig)==null?void 0:y.style)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:1},8,["checked","disabled","style"])):d.formItem.editor=="datetime"?(e.openBlock(),e.createBlock(Fe,{key:8,value:r.value,"onUpdate:value":h[8]||(h[8]=K=>r.value=K),type:"datetime",placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((B=d.formItem.editorConfig)==null?void 0:B.style)},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="date"?(e.openBlock(),e.createBlock(Fe,{key:9,value:r.value,"onUpdate:value":h[9]||(h[9]=K=>r.value=K),type:"date",placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((A=d.formItem.editorConfig)==null?void 0:A.style)},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="time"?(e.openBlock(),e.createBlock(gt,{key:10,value:r.value,"onUpdate:value":h[10]||(h[10]=K=>r.value=K),placeholder:"",disabled:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((D=d.formItem.editorConfig)==null?void 0:D.style)},null,8,["value","disabled","clearable","style"])):d.formItem.editor=="color"?(e.openBlock(),e.createBlock(pt,{key:11,value:r.value,"onUpdate:value":h[11]||(h[11]=K=>r.value=K),placeholder:"",disabled:d.readonly,readonly:d.readonly,clearable:d.formItem.nullable,style:e.normalizeStyle((L=d.formItem.editorConfig)==null?void 0:L.style)},null,8,["value","disabled","readonly","clearable","style"])):d.formItem.editor=="tags"?(e.openBlock(),e.createBlock(Ct,{key:12,value:r.value,"onUpdate:value":h[12]||(h[12]=K=>r.value=K),tagSource:d.formItem.tagSource,placeholder:"",disabled:d.readonly,style:e.normalizeStyle((F=d.formItem.editorConfig)==null?void 0:F.style)},null,8,["value","tagSource","disabled","style"])):d.formItem.editor=="image"?(e.openBlock(),e.createElementBlock("input",{key:13,type:"file",onChange:s,readonly:d.readonly,disabled:d.readonly,style:e.normalizeStyle((Y=d.formItem.editorConfig)==null?void 0:Y.style)},null,44,Is)):d.formItem.editor=="file"?(e.openBlock(),e.createElementBlock("input",{key:14,type:"file",onChange:s,readonly:d.readonly,disabled:d.readonly,style:e.normalizeStyle((v=d.formItem.editorConfig)==null?void 0:v.style)},null,44,Bs)):d.formItem.editor=="password"?(e.openBlock(),e.createBlock(k,{key:15,value:r.value,"onUpdate:value":h[13]||(h[13]=K=>r.value=K),class:e.normalizeClass(f.value),placeholder:d.placeholder??"",type:"password",readonly:d.readonly,style:e.normalizeStyle((ee=d.formItem.editorConfig)==null?void 0:ee.style)},null,8,["value","class","placeholder","readonly","style"])):d.formItem.editor=="textarea"?(e.openBlock(),e.createBlock(k,{key:16,value:r.value,"onUpdate:value":h[14]||(h[14]=K=>r.value=K),class:e.normalizeClass(f.value),type:"textarea",placeholder:d.placeholder??"",readonly:d.readonly,style:e.normalizeStyle((oe=d.formItem.editorConfig)==null?void 0:oe.style)},null,8,["value","class","placeholder","readonly","style"])):(e.openBlock(),e.createBlock(k,{key:17,value:r.value,"onUpdate:value":h[16]||(h[16]=K=>r.value=K),class:e.normalizeClass(f.value),placeholder:d.placeholder??"",readonly:d.readonly,clearable:d.formItem.nullable,type:d.formItem.editor,style:e.normalizeStyle((ne=d.formItem.editorConfig)==null?void 0:ne.style)},{suffix:e.withCtx(()=>[g.value?(e.openBlock(),e.createBlock(V,{key:0,text:"",title:e.unref(a)("If there are multiple items, separate them with commas."),onClick:h[15]||(h[15]=()=>i.value=!0)},{default:e.withCtx(()=>[e.createVNode(N,null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ga))]),_:1})]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1},8,["value","class","placeholder","readonly","clearable","type","style"])),g.value?(e.openBlock(),e.createBlock(bt,{key:18,show:i.value,"onUpdate:show":h[17]||(h[17]=K=>i.value=K),title:d.formItem.label,readonly:d.readonly,message:e.unref(a)("Please enter a list, separated by lines or commas."),value:r.value,"onUpdate:value":h[18]||(h[18]=K=>r.value=K),style:e.normalizeStyle((W=d.formItem.editorConfig)==null?void 0:W.style)},null,8,["show","title","readonly","message","value","style"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}}),Vs=e.defineComponent({name:"DefaultPropertyForm",components:{FormInput:Ve,NForm:u.NForm,NFormItem:u.NFormItem},props:{readOnly:{type:Boolean,default:!1},method:String,columns:Number,groupLayout:String,formItems:Array,data:Object,original:Object},emits:["itemChange"],setup(t,l){const{t:o}=Z(),n=e.inject("axios"),r=e.ref(null),a=e.ref([]),c=e.ref(t.columns||1),f=e.ref({}),g=e.ref(m(t.formItems)),i=h(t.formItems),s=e.ref(void 0);function m(k){return k?[...new Set(k.map(V=>V.group))].map(V=>({label:V||"General",items:k.filter(E=>E.group==V)})):[]}function d(k){return k.dataType=="boolean"&&!k.nullable?" ":k.label}function h(k){const N={};if(k&&k.length)for(const V of k){const E=[];V.nullable==!1&&V.dataType!="boolean"&&E.push({required:!0,message:o("Must be filled here.")}),E.length&&(N[V.name]=E)}return N}async function b(k,N){var V;if(N.type=="remote"&&N.sourceUrl)Pe(n,N,null,E=>N.i18n?o(E):E,k.nullable);else if(N.type=="function"&&N.func){N.isLoading=!0;try{const E=(V=N.func)==null?void 0:V.call(void 0);E&&(N.values=E)}finally{N.isLoading=!1}}}function x(){var k;(k=t.formItems)==null||k.forEach(N=>{N.valueSource&&(N.valueSource.type=="remote"||N.valueSource.type=="function")&&b(N,N.valueSource)})}function S(k,N){l.emit("itemChange",{item:k,data:t.data,value:N})}function P(k){return!!(k.readonly==!0||t.readOnly==!0||t.method&&Array.isArray(k.readonly)&&k.readonly.includes(t.method))}function T(k){return!!(k.visibility==!0||t.method&&Array.isArray(k.visibility)&&k.visibility.includes(t.method))}return e.onMounted(()=>{x(),t.data&&(f.value=t.data)}),e.watch(()=>t.data,k=>f.value=k||{}),{t:o,formRef:r,formItemsRef:a,getItemLabel:d,originalModel:s,model:f,rules:i,formColumns:c,updateValue:S,formGroups:g,isReadonly:P,isVisible:T}}}),Ms={class:"item-box"},Ts={class:"item-box"},As={class:"item-box"};function Es(t,l,o,n,r,a){const c=e.resolveComponent("form-input"),f=e.resolveComponent("n-text"),g=e.resolveComponent("n-form-item-grid-item"),i=e.resolveComponent("n-grid"),s=e.resolveComponent("n-tab-pane"),m=e.resolveComponent("n-tabs"),d=e.resolveComponent("n-grid-item"),h=e.resolveComponent("n-form");return e.openBlock(),e.createBlock(h,{ref:"formRef",model:t.model,rules:t.rules,"label-placement":"left","label-width":160},{default:e.withCtx(()=>[t.groupLayout=="tab"?(e.openBlock(),e.createBlock(m,{key:0,type:"line"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formGroups,b=>(e.openBlock(),e.createBlock(s,{key:b,name:b.label,tab:t.t(b.label)},{default:e.withCtx(()=>[e.createVNode(i,{cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.items,x=>e.withDirectives((e.openBlock(),e.createBlock(g,{ref_for:!0,ref:"formItemsRef",key:x.name,label:t.getItemLabel(x),path:x.name,feedback:x.errorMessage,"validation-status":x.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",Ms,[e.createVNode(c,{"form-item":x,value:t.model[x.name],"onUpdate:value":[S=>t.model[x.name]=S,S=>t.updateValue(x,S)],readonly:t.isReadonly(x),label:x.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),x.description?(e.openBlock(),e.createBlock(f,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(x.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(x)]])),128))]),_:2},1032,["cols"])]),_:2},1032,["name","tab"]))),128)),e.renderSlot(t.$slots,"more-tabs",{},void 0,!0)]),_:3})):t.groupLayout=="column"?(e.openBlock(),e.createBlock(i,{key:1,cols:t.formGroups.length,"x-gap":"8"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formGroups,b=>(e.openBlock(),e.createBlock(d,{key:b},{default:e.withCtx(()=>[e.createVNode(i,{cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.items,x=>e.withDirectives((e.openBlock(),e.createBlock(g,{ref_for:!0,ref:"formItemsRef",key:x.name,label:t.getItemLabel(x),path:x.name,feedback:x.errorMessage,"validation-status":x.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",Ts,[e.createVNode(c,{"form-item":x,value:t.model[x.name],"onUpdate:value":[S=>t.model[x.name]=S,S=>t.updateValue(x,S)],readonly:t.isReadonly(x),label:x.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),x.description?(e.openBlock(),e.createBlock(f,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(x.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(x)]])),128))]),_:2},1032,["cols"])]),_:2},1024))),128))]),_:1},8,["cols"])):(e.openBlock(),e.createBlock(i,{key:2,cols:t.formColumns,"x-gap":8,class:"flex-grow-1"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.formItems,b=>e.withDirectives((e.openBlock(),e.createBlock(g,{ref_for:!0,ref:"formItemsRef",key:b.name,label:t.getItemLabel(b),path:b.name,feedback:b.errorMessage,"validation-status":b.validationStatus},{default:e.withCtx(()=>[e.createElementVNode("div",As,[e.createVNode(c,{"form-item":b,value:t.model[b.name],"onUpdate:value":[x=>t.model[b.name]=x,x=>t.updateValue(b,x)],readonly:t.isReadonly(b),label:b.label,class:"form-input"},null,8,["form-item","value","onUpdate:value","readonly","label"]),b.description?(e.openBlock(),e.createBlock(f,{key:0,italic:"",depth:"3",class:"text-input"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t(b.description)),1)]),_:2},1024)):e.createCommentVNode("",!0)])]),_:2},1032,["label","path","feedback","validation-status"])),[[e.vShow,t.isVisible(b)]])),128))]),_:1},8,["cols"]))]),_:3},8,["model","rules"])}const Nt=re(Vs,[["render",Es],["__scopeId","data-v-e7319d81"]]),_s={class:"pg-value flex-grow-1"},xt=e.defineComponent({__name:"PropertyGrid",props:{columns:{default:1},hideEmpty:{type:Boolean},data:{},names:{},justify:{}},setup(t){const l=t,{t:o}=Z(),n=e.ref(a());function r(){n.value=a()}function a(){var s;const c=new Array,f=l.data,g=l.names,i=l.hideEmpty;if(f)if(g)for(const m of g)if(typeof m=="string")(!i||f[m])&&c.push({label:o(te(m)),value:f[m],span:1});else{const d={label:o(m.label||te(m.name)),value:f[m.name],span:m.span||1,dataType:m.dataType,role:m.role};d.value!=null&&(d.dataType=="boolean"?d.value=de(d.value)?o("Yes"):o("No"):m.i18n&&(d.value=o((s=d.value)==null?void 0:s.toString()))),(!i||d.value)&&c.push(d)}else if(Array.isArray(f))for(const m of f)(!i||m.value)&&c.push({label:o(te(m.label)),value:m.value,span:1});else for(const m in f)(!i||f[m])&&c.push({label:o(te(m)),value:f[m],span:1});return c}return e.watch(()=>l.data,()=>r()),e.watch(()=>l.hideEmpty,()=>r()),(c,f)=>(e.openBlock(),e.createBlock(e.unref(u.NGrid),{cols:c.columns,"item-responsive":""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value.filter(g=>!c.hideEmpty||g.value),g=>(e.openBlock(),e.createBlock(e.unref(u.NGridItem),{class:"pg-item",key:g.label,span:g.span},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default",{label:g.label,value:g.value},()=>[e.createElementVNode("div",{class:"flex-row justify",style:e.normalizeStyle({"justify-content":c.justify})},[e.createVNode(e.unref(u.NText),{class:"pg-label"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.label)+":",1)]),_:2},1024),e.createElementVNode("div",_s,[g.role=="percent"?(e.openBlock(),e.createBlock(e.unref(u.NProgress),{key:0,type:"line",percentage:Number(g.value),title:g.value+"%",style:{"margin-top":"auto","max-width":"80%"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value)+" % ",1)]),_:2},1032,["percentage","title"])):(e.openBlock(),e.createBlock(e.unref(u.NText),{key:1},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.value),1)]),_:2},1024))])],4)])]),_:2},1032,["span"]))),128))]),_:3},8,["cols"]))}}),Ls={key:0},zs={class:"flex-column gap1 flex-grow-1"},Ds={class:"flex-row",style:{"justify-content":"space-between"}},$s={class:"text-monospace",style:{"font-size":"24pt"}},Rs={key:0},Os=["src"],js=["src"],Ps={style:{"text-align":"right"}},rn=e.defineComponent({__name:"DetailPage",props:{loading:{type:Boolean},title:{},subject:{},data:{},properties:{},showBarcode:{type:Boolean,default:!0},columns:{default:3}},emits:["refresh"],setup(t){const{t:l}=Z(),o=e.ref(!0);return(n,r)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(u.NSpin),{show:n.loading,style:{"align-self":"center",margin:"1em"},class:"flex-grow-1 flex-column","content-class":"flex-column flex-grow-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NCard),{embedded:"",style:{width:"1080px"},segmented:{content:!0,footer:"soft"},class:"flex-grow-1","content-class":"flex-column"},{header:e.withCtx(()=>[e.createVNode(e.unref(u.NH2),{style:{"margin-bottom":"2px"}},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"icon"),n.title?(e.openBlock(),e.createElementBlock("span",Ls,e.toDisplayString(e.unref(l)(n.title)),1)):e.createCommentVNode("",!0)]),_:3})]),"header-extra":e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{text:"",onClick:r[0]||(r[0]=()=>n.$emit("refresh"))},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(je))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(l)("Refresh")),1)]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",zs,[e.createElementVNode("div",Ds,[e.createElementVNode("div",null,[e.createElementVNode("div",$s,e.toDisplayString(n.subject),1),n.showBarcode?(e.openBlock(),e.createElementBlock("div",Rs,[e.createElementVNode("img",{src:"/api/core/Barcode/Image?code="+n.subject+"&format=CODE_128&height=30&margin=4,2"},null,8,Os)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[n.showBarcode?(e.openBlock(),e.createElementBlock("img",{key:0,src:"/api/core/QR/Image?code="+n.subject+"&format=CODE_128&width=100&height=100"},null,8,js)):e.createCommentVNode("",!0)])]),e.createVNode(e.unref(u.NCollapse),{"display-directive":"show","default-expanded-names":"info"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NCollapseItem),{name:"info",title:e.unref(l)("Property")},{default:e.withCtx(()=>[e.createVNode(xt,{data:n.data,columns:n.columns,names:n.properties,"hide-empty":o.value},null,8,["data","columns","names","hide-empty"]),e.createElementVNode("div",Ps,[e.createVNode(e.unref(u.NButton),{text:"",onClick:r[1]||(r[1]=a=>o.value=!o.value),title:e.unref(l)("More")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ra))]),_:1})]),_:1},8,["title"])])]),_:1},8,["title"])]),_:1}),e.renderSlot(n.$slots,"default")])]),_:3})]),_:3},8,["show"])]))}}),Fs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Hs=e.defineComponent({name:"ArrowDown",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Fs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M24.59 16.59L17 24.17V4h-2v20.17l-7.59-7.58L6 18l10 10l10-10l-1.41-1.41z",fill:"currentColor"},null,-1)]))}}),Gs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ks=e.defineComponent({name:"ArrowLeft",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Gs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M14 26l1.41-1.41L7.83 17H28v-2H7.83l7.58-7.59L14 6L4 16l10 10z",fill:"currentColor"},null,-1)]))}}),Ws={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Zs=e.defineComponent({name:"ArrowRight",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ws,o[0]||(o[0]=[e.createElementVNode("path",{d:"M18 6l-1.43 1.393L24.15 15H4v2h20.15l-7.58 7.573L18 26l10-10L18 6z",fill:"currentColor"},null,-1)]))}}),Ys={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Qs=e.defineComponent({name:"ArrowUp",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ys,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16 4L6 14l1.41 1.41L15 7.83V28h2V7.83l7.59 7.58L26 14L16 4z",fill:"currentColor"},null,-1)]))}}),Xs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},an=e.defineComponent({name:"Checkbox",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Xs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 4H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM6 26V6h20v20z",fill:"currentColor"},null,-1)]))}}),Js={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},sn=e.defineComponent({name:"CheckboxChecked",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Js,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 4H6a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM6 26V6h20v20z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M14 21.5l-5-4.96L10.59 15L14 18.35L21.41 11L23 12.58l-9 8.92z",fill:"currentColor"},null,-1)]))}}),qs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Us=e.defineComponent({name:"Checkmark",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",qs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 24l-9-9l1.414-1.414L13 21.171L26.586 7.586L28 9L13 24z",fill:"currentColor"},null,-1)]))}}),vs={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},St=e.defineComponent({name:"ChevronDown",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",vs,o[0]||(o[0]=[e.createElementVNode("path",{d:"M16 22L6 12l1.4-1.4l8.6 8.6l8.6-8.6L26 12z",fill:"currentColor"},null,-1)]))}}),ei={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ti=e.defineComponent({name:"CollapseAll",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ei,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 15h-2V7H13V5h15a2.002 2.002 0 0 1 2 2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M25 20h-2v-8H8v-2h15a2.002 2.002 0 0 1 2 2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 27H4a2.002 2.002 0 0 1-2-2v-8a2.002 2.002 0 0 1 2-2h14a2.002 2.002 0 0 1 2 2v8a2.002 2.002 0 0 1-2 2zM4 17v8h14.001L18 17z",fill:"currentColor"},null,-1)]))}}),oi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},cn=e.defineComponent({name:"Cube",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",oi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28.504 8.136l-12-7a1 1 0 0 0-1.008 0l-12 7A1 1 0 0 0 3 9v14a1 1 0 0 0 .496.864l12 7a1 1 0 0 0 1.008 0l12-7A1 1 0 0 0 29 23V9a1 1 0 0 0-.496-.864zM16 3.158L26.016 9L16 14.842L5.984 9zM5 10.74l10 5.833V28.26L5 22.426zM17 28.26V16.574l10-5.833v11.685z",fill:"currentColor"},null,-1)]))}}),ni={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},dn=e.defineComponent({name:"DocumentDownload",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ni,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 25l-1.414-1.414L26 26.172V18h-2v8.172l-2.586-2.586L20 25l5 5l5-5z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 28H8V4h8v6a2.006 2.006 0 0 0 2 2h6v3h2v-5a.91.91 0 0 0-.3-.7l-7-7A.909.909 0 0 0 18 2H8a2.006 2.006 0 0 0-2 2v24a2.006 2.006 0 0 0 2 2h10zm0-23.6l5.6 5.6H18z",fill:"currentColor"},null,-1)]))}}),li={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},It=e.defineComponent({name:"DocumentExport",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",li,o[0]||(o[0]=[e.createElementVNode("path",{d:"M13 21h13.17l-2.58 2.59L25 25l5-5l-5-5l-1.41 1.41L26.17 19H13v2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M22 14v-4a1 1 0 0 0-.29-.71l-7-7A1 1 0 0 0 14 2H4a2 2 0 0 0-2 2v24a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2h-2v2H4V4h8v6a2 2 0 0 0 2 2h6v2zm-8-4V4.41L19.59 10z",fill:"currentColor"},null,-1)]))}}),ri={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Bt=e.defineComponent({name:"DocumentImport",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ri,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 19H14.83l2.58-2.59L16 15l-5 5l5 5l1.41-1.41L14.83 21H28v-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M24 14v-4a1 1 0 0 0-.29-.71l-7-7A1 1 0 0 0 16 2H6a2 2 0 0 0-2 2v24a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2h-2v2H6V4h8v6a2 2 0 0 0 2 2h6v2zm-8-4V4.41L21.59 10z",fill:"currentColor"},null,-1)]))}}),ai={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},fn=e.defineComponent({name:"Draggable",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ai,o[0]||(o[0]=[e.createStaticVNode('<path d="M10 6h4v4h-4z" fill="currentColor"></path><path d="M18 6h4v4h-4z" fill="currentColor"></path><path d="M10 14h4v4h-4z" fill="currentColor"></path><path d="M18 14h4v4h-4z" fill="currentColor"></path><path d="M10 22h4v4h-4z" fill="currentColor"></path><path d="M18 22h4v4h-4z" fill="currentColor"></path>',6)]))}}),si={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ii=e.defineComponent({name:"ExpandAll",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",si,o[0]||(o[0]=[e.createElementVNode("path",{d:"M12 10h14a2.002 2.002 0 0 0 2-2V4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6V2H4v23a2.002 2.002 0 0 0 2 2h4v1a2.002 2.002 0 0 0 2 2h14a2.002 2.002 0 0 0 2-2v-4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6v-8h4v1a2.002 2.002 0 0 0 2 2h14a2.002 2.002 0 0 0 2-2v-4a2.002 2.002 0 0 0-2-2H12a2.002 2.002 0 0 0-2 2v1H6V7h4v1a2.002 2.002 0 0 0 2 2zm0-6h14l.001 4H12zm0 20h14l.001 4H12zm0-10h14l.001 4H12z",fill:"currentColor"},null,-1)]))}}),ci={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Vt=e.defineComponent({name:"Folder",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ci,o[0]||(o[0]=[e.createElementVNode("path",{d:"M11.17 6l3.42 3.41l.58.59H28v16H4V6h7.17m0-2H4a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h24a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2H16l-3.41-3.41A2 2 0 0 0 11.17 4z",fill:"currentColor"},null,-1)]))}}),di={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},fi=e.defineComponent({name:"FolderOpen",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",di,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 8h-7.172l-3.414-3.414A2 2 0 0 0 16 4H4a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h24a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2zM8 26V14h8v6.17l-2.59-2.58L12 19l5 5l5-5l-1.41-1.41L18 20.17V14a2.002 2.002 0 0 0-2-2H8a2.002 2.002 0 0 0-2 2v12H4V6h12l4 4h8v2h-6v2h6v12z",fill:"currentColor"},null,-1)]))}}),ui={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},pi=e.defineComponent({name:"IbmCloudPakApplications",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ui,o[0]||(o[0]=[e.createElementVNode("path",{d:"M21 22h-6a2.002 2.002 0 0 1-2-2v-4a2.002 2.002 0 0 1 2-2h6a2.002 2.002 0 0 1 2 2v4a2.002 2.002 0 0 1-2 2zm-6-6v4h6v-4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M11 17H9v-5a2.002 2.002 0 0 1 2-2h6v2h-6z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M16 31a.999.999 0 0 1-.504-.136l-12-7A1 1 0 0 1 3 23V9a1 1 0 0 1 .496-.864l12-7a1 1 0 0 1 1.008 0l12 7l-1.008 1.728L16 3.158L5 9.574v12.852l11 6.417l11-6.417V15h2v8a1 1 0 0 1-.496.864l-12 7A.999.999 0 0 1 16 31z",fill:"currentColor"},null,-1)]))}}),mi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},hi=e.defineComponent({name:"NewTab",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",mi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 26H6V6h10V4H6a2.002 2.002 0 0 0-2 2v20a2.002 2.002 0 0 0 2 2h20a2.002 2.002 0 0 0 2-2V16h-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M26 26H6V6h10V4H6a2.002 2.002 0 0 0-2 2v20a2.002 2.002 0 0 0 2 2h20a2.002 2.002 0 0 0 2-2V16h-2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M26 6V2h-2v4h-4v2h4v4h2V8h4V6h-4z",fill:"currentColor"},null,-1)]))}}),gi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},yi=e.defineComponent({name:"NotAvailable",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",gi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M4 15h10v2H4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 15h10v2H18z",fill:"currentColor"},null,-1)]))}}),wi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ci=e.defineComponent({name:"QrCode",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",wi,o[0]||(o[0]=[e.createStaticVNode('<path d="M24 28v-2h2v2z" fill="currentColor"></path><path d="M18 24v-2h2v2z" fill="currentColor"></path><path d="M18 30h4v-2h-2v-2h-2v4z" fill="currentColor"></path><path d="M26 26v-4h2v4z" fill="currentColor"></path><path d="M28 26h2v4h-4v-2h2v-2z" fill="currentColor"></path><path d="M26 20v-2h4v4h-2v-2h-2z" fill="currentColor"></path><path d="M24 20h-2v4h-2v2h4v-6z" fill="currentColor"></path><path d="M18 20v-2h4v2z" fill="currentColor"></path><path d="M6 22h4v4H6z" fill="currentColor"></path><path d="M14 30H2V18h12zM4 28h8v-8H4z" fill="currentColor"></path><path d="M22 6h4v4h-4z" fill="currentColor"></path><path d="M30 14H18V2h12zm-10-2h8V4h-8z" fill="currentColor"></path><path d="M6 6h4v4H6z" fill="currentColor"></path><path d="M14 14H2V2h12zM4 12h8V4H4z" fill="currentColor"></path>',14)]))}}),bi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},un=e.defineComponent({name:"Search",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",bi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M29 27.586l-7.552-7.552a11.018 11.018 0 1 0-1.414 1.414L27.586 29zM4 13a9 9 0 1 1 9 9a9.01 9.01 0 0 1-9-9z",fill:"currentColor"},null,-1)]))}}),ki={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},pn=e.defineComponent({name:"SearchLocate",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",ki,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 28.586l-4.689-4.688a8.028 8.028 0 1 0-1.414 1.414L28.586 30zM19 25a6 6 0 1 1 6-6a6.007 6.007 0 0 1-6 6z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 12h8v2H2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 2h16v2H2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 7h16v2H2z",fill:"currentColor"},null,-1)]))}}),Ni={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},xi=e.defineComponent({name:"SelectWindow",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ni,o[0]||(o[0]=[e.createStaticVNode('<path d="M8 26H4a2.002 2.002 0 0 1-2-2v-4h2v4h4z" fill="currentColor"></path><path d="M2 12h2v4H2z" fill="currentColor"></path><path d="M26 8h-2V4h-4V2h4a2.002 2.002 0 0 1 2 2z" fill="currentColor"></path><path d="M12 2h4v2h-4z" fill="currentColor"></path><path d="M4 8H2V4a2.002 2.002 0 0 1 2-2h4v2H4z" fill="currentColor"></path><path d="M27 32a.997.997 0 0 1-.707-.293l-6.138-6.138l-3.323 4.986a1 1 0 0 1-1.79-.268l-6-20a1 1 0 0 1 1.245-1.245l20 6a1 1 0 0 1 .268 1.79l-4.986 3.323l6.138 6.138a1 1 0 0 1 0 1.414l-4 4A.997.997 0 0 1 27 32zm0-2.414L29.586 27l-7.155-7.155l5.246-3.498l-16.185-4.855l4.855 16.185l3.498-5.246z" fill="currentColor"></path>',6)]))}}),Si={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ii=e.defineComponent({name:"TableBuilt",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Si,o[0]||(o[0]=[e.createElementVNode("path",{d:"M28 8h-4V4a2.002 2.002 0 0 0-2-2H4a2.002 2.002 0 0 0-2 2v18a2.002 2.002 0 0 0 2 2h4v4a2.002 2.002 0 0 0 2 2h18a2.002 2.002 0 0 0 2-2V10a2.002 2.002 0 0 0-2-2zm-6 14h-8v-5h8zm0-7h-8v-5h8zm-10 0H4v-5h8zM22 4v4H4V4zM4 22v-5h8v5zm24 6H10v-4h12a2.002 2.002 0 0 0 2-2V10h4z",fill:"currentColor"},null,-1)]))}}),Bi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Vi=e.defineComponent({name:"TagEdit",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Bi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M29.707 7.293l-3-3a1 1 0 0 0-1.414 0L16 13.586V18h4.414l9.293-9.293a1 1 0 0 0 0-1.414zM19.586 16H18v-1.586l5-5L24.586 11zM26 9.586L24.414 8L26 6.414L27.586 8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M10 14a4 4 0 1 1 4-4a4.005 4.005 0 0 1-4 4zm0-6a2 2 0 1 0 1.998 2.004A2.002 2.002 0 0 0 10 8z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M27.006 14.235l-1.414 1.414L28 18.058L18.058 28L4 13.941V4h9.942l4.406 4.407l1.415-1.415l-4.407-4.406A2 2 0 0 0 13.94 2H4a2 2 0 0 0-2 2v9.941a2 2 0 0 0 .586 1.414l14.058 14.06a2.001 2.001 0 0 0 2.828 0l9.943-9.943a2.001 2.001 0 0 0 0-2.828z",fill:"currentColor"},null,-1)]))}}),Mi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ti=e.defineComponent({name:"Upload",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Mi,o[0]||(o[0]=[e.createElementVNode("path",{d:"M6 18l1.41 1.41L15 11.83V30h2V11.83l7.59 7.58L26 18L16 8L6 18z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M6 8V4h20v4h2V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4z",fill:"currentColor"},null,-1)]))}}),Ai={style:{"min-height":"50px"}},Mt=e.defineComponent({__name:"ExportModal",props:{show:{type:Boolean},range:{},supportedFormats:{},supportedRanges:{}},emits:["export","close"],setup(t){const l=t,{t:o}=Z(),n=e.ref(null),r=e.ref(f()),a=e.ref(null),c=e.ref(g());function f(){let i=[{label:o("Excel"),value:"excel"},{label:o("Json"),value:"json"},{label:o("Text"),value:"text"},{label:o("XML"),value:"xml"}];const s=l.supportedFormats;return s&&(i=i.filter(m=>s.includes(m.value))),n.value=i.length?i[0].value:null,i}function g(){const i=l.supportedRanges||["empty","selection","page","all"],s=[{label:o("Selection"),value:"selection"},{label:o("Current Page"),value:"page"},{label:o("Search"),value:"search"},{label:o("All"),value:"all"},{label:o("Empty(Template)"),value:"empty"}].filter(m=>i.includes(m.value));return l.range?a.value=l.range:a.value=s.length?s[0].value:null,s}return e.watch(()=>l.range,i=>{i&&(a.value=i)}),(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:i.show,preset:"card",title:e.unref(o)("Export Options"),style:{"max-width":"400px"},draggable:"",onClose:s[4]||(s[4]=()=>i.$emit("close"))},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{onClick:s[2]||(s[2]=()=>i.$emit("export",n.value,a.value)),style:{"min-width":"100px"},type:"primary"},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(dn))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(o)("Export")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:s[3]||(s[3]=()=>i.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",Ai,[r.value.length>1?(e.openBlock(),e.createBlock(e.unref(u.NFormItem),{key:0,label:e.unref(o)("File Format")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSelect),{options:r.value,value:n.value,"onUpdate:value":s[0]||(s[0]=m=>n.value=m)},null,8,["options","value"])]),_:1},8,["label"])):e.createCommentVNode("",!0),c.value.length>1?(e.openBlock(),e.createBlock(e.unref(u.NFormItem),{key:1,label:e.unref(o)("Data Range")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSelect),{options:c.value,value:a.value,"onUpdate:value":s[1]||(s[1]=m=>a.value=m)},null,8,["options","value"])]),_:1},8,["label"])):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"options")])]),_:3},8,["show","title"]))}}),Ei={class:"flex-column gap1",style:{"justify-content":"center","align-items":"center"}},mn=e.defineComponent({__name:"EmptyDetailView",props:{message:{default:"Please select a object."}},setup(t){const{t:l}=Z();return(o,n)=>(e.openBlock(),e.createElementBlock("div",Ei,[e.createVNode(e.unref(u.NIcon),{depth:5,size:48},{default:e.withCtx(()=>[e.createVNode(e.unref(xi))]),_:1}),e.createVNode(e.unref(u.NText),{depth:"3",style:{opacity:"0.6"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)(o.message)),1)]),_:1})]))}}),_i=e.defineComponent({components:{FullscreenIcon:Ba,ExitFullscreenIcon:Sa},emits:["change"],setup(t,l){const{t:o}=Z(),n=Ne(),r=e.computed(()=>n.isFullscreen);function a(i){i||(i=document.body),i.requestFullscreen&&i.requestFullscreen()}function c(){document.exitFullscreen&&document.exitFullscreen()}function f(i){var s;if(r.value)c();else{const m=(s=i.target)==null?void 0:s.closest(".fullscreen-view");a(m)}}function g(){const i=!!document.fullscreenElement;n.setIsFullscreen(i),l.emit("change",i)}return e.onMounted(()=>{document.addEventListener("fullscreenchange",g),document.addEventListener("mozfullscreenchange",g),document.addEventListener("webkitfullscreenchange",g),document.addEventListener("msfullscreenchange",g)}),{t:o,isFullscreen:r,toggleFullscreen:f}}});function Li(t,l,o,n,r,a){const c=e.resolveComponent("fullscreen-icon"),f=e.resolveComponent("exit-fullscreen-icon"),g=e.resolveComponent("n-icon"),i=e.resolveComponent("n-button");return e.openBlock(),e.createBlock(i,{onClick:t.toggleFullscreen},{icon:e.withCtx(()=>[e.createVNode(g,null,{default:e.withCtx(()=>[t.isFullscreen?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(c,{key:0})),t.isFullscreen?(e.openBlock(),e.createBlock(f,{key:1})):e.createCommentVNode("",!0)]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(t.t("Toggle Fullscreen")),1)]),_:1},8,["onClick"])}const hn=re(_i,[["render",Li]]),Tt=t=>{const l=e.inject("axios"),o={},n=[],r=[];t.forEach(m=>{typeof m=="string"?(o[m]=!1,n.push(m)):(o[m.id]=!1,o[m.name]=!1,n.push(m.id),r.push(m))});let a=0;async function c(m){a||await g(m)}function f(){for(let m in o)o[m]=!1}async function g(m){f();const d=n.filter(h=>(h==null?void 0:h.length)==32);if(d.length)try{let h=await l.get(`/api/core/Account/CheckPermissions?permissions=${encodeURIComponent(d.join())}`);h.isSuccess&&h.value!=null?(a++,h.value.forEach(b=>{o[b]=!0;const x=r.find(S=>S.id==b);x&&(o[x.name]=!0)}),m==null||m.call(null,o)):console.error(h.errorMessage)}catch(h){console.error(h)}}function i(){for(let m in o)if(!o[m])return!1;return!0}function s(){for(let m in o)if(o[m])return!0;return!1}return{flags:o,check:g,checkOnce:c,all:i,any:s}},zi={key:0,class:"flex-row",style:{"align-items":"center","justify-content":"space-between",gap:"0.25em","margin-bottom":"1em"}},Di={style:{display:"grid","grid-template-columns":"auto 1fr",gap:"0.5em","margin-top":"1em","align-items":"center"}},gn=200,At=e.defineComponent({__name:"GridConfigModal",props:{gridId:{},show:{type:Boolean},pageSize:{},gridColumns:{}},emits:["close","update:pageSize","update:config"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=ie(),c=e.inject("axios"),f=u.useMessage(),g=Tt(["2E2466DDD34847C8B33460E4277A6528"]),i=e.ref(o.pageSize),s=e.ref(!1),m=e.ref(!1),d=N=>N?N.map((V,E)=>({columnId:V.name,title:V.title?r(V.title):r(te(V.name)),visible:!0,sortIndex:E})).sort((V,E)=>V.sortIndex-E.sortIndex):[],h=N=>(V,E)=>{let O=null;if(N=="visible"){const j=Re(V[N]);O=e.h(u.NIcon,{size:"20"},{default:()=>j?e.h(sn):e.h(an)})}else N=="move_up"?O=e.h(u.NIcon,{size:"20"},{default:()=>e.h(Qs)}):N=="move_down"&&(O=e.h(u.NIcon,{size:"20"},{default:()=>e.h(Hs)}));return e.h(u.NButton,{text:!0,onClick:j=>{b(V,E,N),j.stopPropagation()}},{default:()=>O})};function b(N,V,E){switch(E){case"visible":N.visible=!N.visible;break;case"move_up":if(V>0&&T.value){const O=T.value.splice(V,1);T.value.splice(V-1,0,O[0])}break;case"move_down":if(T.value&&V<T.value.length-1){const O=T.value.splice(V,1);T.value.splice(V+1,0,O[0])}break}}const x=()=>{const N=o.gridId;N&&a.confirmToPost("Reset","Are you sure reset the configuration of this data grid?",{url:`/api/core/UserDataGrids/Reset?dataGridId=${N}`,successMessage:"The configuration has been reset, please refresh the page.",success:()=>{n("update:config",null)}})};async function S(){if(!o.gridId)return;const N={dataGridId:o.gridId,pageSize:i.value,columns:T.value.filter(V=>V.columnId).map((V,E)=>({columnId:V.columnId,visible:V.visible,sortIndex:E}))};N.pageSize&&(N.pageSize=Math.max(1,Math.min(gn,N.pageSize)));try{const V=s.value&&m.value,E=await c.post(`/api/core/UserDataGrids/Save?isDefault=${V}`,N);(E==null?void 0:E.isSuccess)==!0?(f.success(r("The configuration has been saved, please refresh the page.")),n("update:pageSize",i.value),n("update:config",N)):f.error((E==null?void 0:E.errorMessage)||r("Error"))}catch(V){f.error((V==null?void 0:V.toString())||r("Error"))}}async function P(){if(o.gridId&&T.value.length)try{const N=s.value&&m.value,V=await c.get(`/api/core/UserDataGrids/Entity?dataGridId=${encodeURIComponent(o.gridId)}?isDefault=${N}`);if(V!=null&&V.isSuccess)if(V.value){i.value=V.value.pageSize;for(const E of V.value.columns){const O=T.value.find(j=>j.columnId==E.columnId);O&&(O.visible=E.visible,O.sortIndex=E.sortIndex),T.value.sort((j,z)=>j.sortIndex-z.sortIndex)}}else T.value=d(o.gridColumns),i.value=o.pageSize;else console.log(V==null?void 0:V.errorMessage)}catch(N){console.log(N)}}e.watch(()=>o.show,N=>{N&&(g.checkOnce(V=>{m.value=V["2E2466DDD34847C8B33460E4277A6528"]}),P())}),e.watch(()=>o.gridColumns,()=>T.value=d(o.gridColumns)),e.watch(s,()=>P());const T=e.ref(d(o.gridColumns)),k=[{title:r("Name"),key:"title"},{title:r("Visible"),key:"visible",width:80,align:"center",fixed:"right",render:h("visible")},{key:"move_up",width:30,align:"center",fixed:"right",render:h("move_up")},{key:"move_down",width:30,align:"center",fixed:"right",render:h("move_down")},{key:"empty",width:20,fixed:"right"}];return(N,V)=>{const E=e.resolveComponent("n-space");return e.openBlock(),e.createBlock(e.unref(u.NModal),{show:N.show,preset:"card",title:e.unref(r)("Config Data Grid"),style:{"max-width":"500px"},draggable:"",onClose:V[3]||(V[3]=()=>N.$emit("close"))},{action:e.withCtx(()=>[e.createVNode(E,{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{onClick:S,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Save")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:x,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Reset")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:V[2]||(V[2]=()=>N.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("div",zi,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("System Default")),1),e.createVNode(e.unref(u.NSwitch),{value:s.value,"onUpdate:value":V[0]||(V[0]=O=>s.value=O)},null,8,["value"])])):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NDataTable),{columns:k,data:T.value,"max-height":450,size:"small"},null,8,["data"]),e.createElementVNode("div",Di,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Page Size")),1),e.createVNode(e.unref(u.NInputNumber),{value:i.value,"onUpdate:value":V[1]||(V[1]=O=>i.value=O),max:gn,min:1,style:{"max-width":"200px"}},null,8,["value"])])]),_:1},8,["show","title"])}}}),yn=e.defineComponent({__name:"HaloButtonSelect",props:{value:{},sourceUrl:{},additionalQuery:{},labelFormatter:{type:Function},keyField:{},labelField:{},subLabelField:{},size:{}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.inject("axios"),c=e.ref(!1),f=e.ref([]);async function g(s){let m=o.sourceUrl;if(m){const d=o.labelFormatter,h=o.keyField,b=o.labelField,x=o.subLabelField,S=o.additionalQuery;c.value=!0,f.value=[];try{S&&(m=U(m,S,!0));const P=await a.get(m);if(P.isSuccess&&P.value!=null){let T=P.value;if(!Array.isArray(T)&&"rows"in T&&Array.isArray(T.rows)&&(T=T.rows),Array.isArray(T)){const k=T.filter(N=>N&&!0).map(N=>{if(typeof N=="string")return{value:N,label:d?d(N):r(N)};{let V=N[b||"label"];if(d&&(V=d(V)),x){const E=N[x];typeof E=="string"&&(V+=" "+(d?d(E):E))}return{value:N[h||"value"],label:V}}});f.value=k}}}finally{c.value=!1}}}function i(s,m){n("update:value",s,m)}return e.watch(()=>o.sourceUrl,()=>g()),e.onMounted(()=>{g()}),(s,m)=>{const d=e.resolveComponent("n-radio-button"),h=e.resolveComponent("n-radio-group");return e.openBlock(),e.createBlock(h,{value:s.value,size:s.size,"onUpdate:value":i},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,b=>(e.openBlock(),e.createBlock(d,{key:b.value,value:b.value,label:b.label},null,8,["value","label"]))),128))]),_:1},8,["value","size"])}}}),Ke=re(e.defineComponent({__name:"SearchForm",props:{searchItems:{},searchArgs:{},groupOptions:{},groupBy:{}},emits:["update:searchArgs","update:groupBy"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=Z(),c=e.inject("axios"),f=T=>T==null?void 0:T.map(k=>typeof k=="string"?{label:a(k),value:k}:k),g=()=>{const T=new Array;if(n.searchItems)for(const k of n.searchItems)if(typeof k=="string")T.push({name:k,label:te(k),editor:"text",nullable:!0,visibility:!0,searchMethod:"normal"});else{let N=k;k.searchField&&(N=Object.assign({},k),N.name=k.searchField),T.push(N)}return T},i=()=>{const T={};if(x.forEach(k=>{T[k.name]=null,k.searchMethod=="range"&&(T[k.name+"From"]=null,T[k.name+"To"]=null)}),n.searchArgs)for(const k in T)n.searchArgs[k]!=null&&(T[k]=n.searchArgs[k]);return T},s=()=>{for(const T in S)S[T]=null},m=async T=>{var N,V;const k=T.valueSource;if(k){if(k.type=="remote"&&k.sourceUrl)await Pe(c,k,null,E=>k.i18n?a(E):E,!1),T.nullable==!1&&((N=k.values)!=null&&N.length)&&(S[T.name]=k.values[0].value);else if(k.type=="function"&&k.func){k.isLoading=!0;try{const E=(V=k.func)==null?void 0:V.call(void 0);E&&(k.values=E)}finally{k.isLoading=!1}}}},d=()=>{var k;const T={};for(const N of x){const V=N.searchField??N.name;if(N.searchMethod=="range"){const E=h(V+"From",N);E!=null&&(T[V+"From"]=E);let O=h(V+"To",N);O!=null&&(N.editor=="date"&&typeof O=="string"&&(O=se(O,ge).add(1,"days").format(ge)),T[V+"To"]=O)}else{const E=h(V,N);E!=null&&(((k=N.role)==null?void 0:k.includes("list"))==!0&&typeof E=="string"?E.includes(",")?T[V]=E.split(","):T[V]=[E]:T[V]=E)}}return T},h=(T,k)=>{var V,E;let N=S[T];if(!(typeof N=="string"&&(N=N.trim(),N==""&&!k.valueSource))){if(Array.isArray((V=k.valueSource)==null?void 0:V.values)){const O=(E=k.valueSource)==null?void 0:E.values;if(O){if(O.some(j=>j.value==S[T]))N=S[T];else if(N=="")return;if(k.dataType=="boolean"){if(typeof N=="boolean")return N;const j=O.findIndex(z=>z.value==N);return j>-1&&(O.length==2?N=j==0:O.length==3&&j>0&&(N=j==1)),typeof N=="boolean"?N:Oe(N,k.dataType,k.role)}}}return Oe(N,k.dataType,k.role)}},b=()=>{r("update:searchArgs",d())},x=g(),S=e.reactive(i()),P=e.ref(f(n.groupOptions));return e.watch(()=>n.groupOptions,()=>P.value=f(n.groupOptions)),e.onMounted(()=>{i(),x.forEach(T=>{T.valueSource&&(T.valueSource.type=="remote"||T.valueSource.type=="function"?m(T):T.valueSource.type=="static")})}),l({reset:s,updateValues:b,pickValues:d}),(T,k)=>(e.openBlock(),e.createBlock(e.unref(u.NForm),{model:S,"label-placement":"left","label-width":"auto"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NGrid),{"x-gap":"12",cols:"1 700:2 1200:3"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(x),N=>(e.openBlock(),e.createBlock(e.unref(u.NGridItem),{key:N.name},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NFormItem),{label:e.unref(a)(N.label==null?N.name:N.label),path:N.name},{default:e.withCtx(()=>[N.searchMethod=="range"?(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),{key:0},{default:e.withCtx(()=>[e.createVNode(Ve,{"form-item":N,value:S[N.name+"From"],"onUpdate:value":V=>S[N.name+"From"]=V,style:{"flex-grow":"1"},onInput:k[0]||(k[0]=()=>b())},null,8,["form-item","value","onUpdate:value"]),e.createVNode(e.unref(u.NInputGroupLabel),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("to")),1)]),_:1}),e.createVNode(Ve,{"form-item":N,value:S[N.name+"To"],"onUpdate:value":V=>S[N.name+"To"]=V,style:{"flex-grow":"1"},onInput:k[1]||(k[1]=()=>b())},null,8,["form-item","value","onUpdate:value"])]),_:2},1024)):(e.openBlock(),e.createBlock(Ve,{key:1,"form-item":N,value:S[N.name],"onUpdate:value":V=>S[N.name]=V,onInput:k[2]||(k[2]=()=>b())},null,8,["form-item","value","onUpdate:value"]))]),_:2},1032,["label","path"])]),_:2},1024))),128))]),_:1}),P.value?(e.openBlock(),e.createBlock(e.unref(u.NGrid),{key:0,"x-gap":"12",cols:"1 700:2 1200:3"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NGridItem),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NFormItem),{label:e.unref(a)("Group By")},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSelect),{value:T.groupBy,options:P.value,"onUpdate:value":k[3]||(k[3]=N=>T.$emit("update:groupBy",N))},null,8,["value","options"])]),_:1},8,["label"])]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["model"]))}}),[["__scopeId","data-v-8b391a0f"]]),$i={class:"flex-row gap05"},Et=e.defineComponent({__name:"TagsView",props:{tags:{},tagSource:{},size:{default:"small"}},setup(t){const l=t,o=Ne(),n=ie(),r=e.ref([]);async function a(){var f;const c=((f=l.tags)==null?void 0:f.map(g=>({value:g,text:g})))??[];if(r.value=c,l.tagSource){const g=await o.fetchSharedData(`tags:${l.tagSource}`,async()=>await n.get({url:`/api/core/CommonCodeItems/list?commonCode=${l.tagSource}`})??[]);for(const i of c){const s=g.find(m=>m.code==i.value);s&&(i.desc=s.name,i.color=s.color)}r.value=[...c]}}return e.watch(()=>l.tags,()=>a()),e.onMounted(()=>a()),(c,f)=>(e.openBlock(),e.createElementBlock("div",$i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,g=>(e.openBlock(),e.createBlock(e.unref(u.NTag),{key:g.value,title:g.desc,color:{borderColor:g.color},size:c.size},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.text),1)]),_:2},1032,["title","color","size"]))),128))]))}}),We=e.defineComponent({__name:"HaloGrid",props:{keyField:{default:"__key__"},checkable:{type:Boolean,default:!0},dragSorting:{type:Boolean},columns:{},data:{},withEdit:{type:Boolean,default:!1},withDelete:{type:Boolean,default:!1},withDetails:{type:Boolean,default:!1},multiSelect:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},maxHeight:{},height:{},selectedId:{},selectedIds:{},flexHeight:{type:Boolean,default:!0}},emits:["editRow","deleteRow","showDetails","columnButtonClick","update:selectedIds","update:selectedId","update:sorter","rowSorting"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=Z(),c=ce.useRouter(),f=wt(),g=e.ref(void 0),i=e.ref(P()),s=e.ref([]),m=e.ref(void 0),d=e.ref(h());function h(){const y={};return typeof n.height=="number"?y.height=`${n.height}px`:typeof n.height=="string"&&(y.height=n.height),y}function b(){var A;const y=s.value,B=(A=n.data)==null?void 0:A.filter(D=>y.includes(D[n.keyField]));r("update:selectedIds",y,B),y.length&&r("update:selectedId",y[0])}function x(y){return y[n.keyField]}function S(y,B){let A=0,D=0;for(const L of B){let F,Y;if(typeof L=="string")F={key:L,title:a(te(L))};else if(!(L.behavior=="none"||L.visible==!1))if(L.behavior=="link"||L.behavior=="router-link")F={key:L.name||`column_${A}`,title:L.title?a(L.title):void 0,align:L.align,fixed:L.fixed||void 0,width:L.width,sorter:L.sortable==!0,render:L.render||T(L)};else if(L.behavior=="button")F={key:L.name||`column_${A}`,title:L.title?a(L.title):void 0,align:L.align||"center",fixed:L.fixed||void 0,width:L.width,sorter:L.sortable==!0,render:L.render||T(L)};else{let v=L.align,ee=[];if(!L.display)switch(L.dataType){case"number":v=v||"right",Y=60,ee.push("text-num");break;case"boolean":v=v||"center",Y=60;break;case"date":Y=100;break;case"datetime":Y=180;break;case"timespan":v=v||"center",Y=80;break;case"time":Y=80,ee.push(`text-${L.dataType}`);break}if(F={key:L.name||`column_${A}`,title:L.title==null?a(te(L.name)):L?a(L.title):void 0,titleAlign:"center",align:v,width:L.width||Y,sorter:L.sortable==!0,minWidth:L.minWidth,resizable:!0,fixed:L.fixed,render:L.render||T(L)},typeof L.className=="string"?ee.push(L.className):Array.isArray(L.className)&&ee.push(...L.className),ee.length&&(F.className=ee.join(" ")),!F.width&&F.minWidth&&(F.width=F.minWidth),L.referencePage&&typeof F.width=="number"&&(F.width+=30),L.role&&L.role.includes("qr")&&typeof F.width=="number"&&(F.width+=30),L.role&&L.role.includes("percent")&&typeof F.width=="number"&&(F.width+=30,F.align||(F.align="right")),(L.textOverflow=="ellipsis"||L.textOverflow=="clip")&&(F.ellipsis={tooltip:!0},F.resizable=!0,Y||(Y=400)),L.children&&L.children.length){const oe=[];S(oe,L.children),F.children=oe,oe.some(ne=>ne.width)&&(F.width=void 0)}}F&&(y.push(F),typeof L=="object"&&typeof L.width=="number"?D+=L.width:D+=Y||150)}return D}function P(){if(n.columns){const y=[];let B=0;return n.checkable&&(y.push({type:"selection",fixed:"left"}),B+=30),B+=S(y,n.columns),n.withEdit&&(y.push({key:"btn-edit",width:30,fixed:"right",render(A,D){return e.h(u.NButton,{text:!0,titie:a("Edit"),onClick:L=>{r("editRow",A,D),L.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#5C6BC0",size:"20"},{default:()=>e.h(Po)})})}}),B+=30),n.withDelete&&(y.push({key:"btn-delete",width:30,fixed:"right",render(A,D){return e.h(u.NButton,{text:!0,titie:a("Delete"),onClick:L=>{r("deleteRow",A,D),L.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#f44336",size:"20"},{default:()=>e.h(jo)})})}}),B+=30),n.withDetails&&(y.push({key:"btn-details",width:30,fixed:"right",render(A,D){return e.h(u.NButton,{text:!0,titie:a("Details"),onClick:L=>{r("showDetails",A,D),L.stopPropagation()}},{default:()=>e.h(u.NIcon,{color:"#4CAF50",size:"20"},{default:()=>e.h(Xa)})})}}),B+=30),n.dragSorting&&(y.push({key:"drag-sorting-handler",width:30,fixed:"right",render(){return e.h(u.NIcon,{color:"#90A4AE",size:"20",class:"drag-sorting-handle"},{default:()=>e.h(fn)})}}),B+=30),g.value=B,y}else return[]}function T(y){return(B,A)=>{var ee,oe,ne;let D=null;const L=y.display||y.name;if(y.template&&typeof y.template=="function")D=y.template.call(null,B,A);else if(y.dataType=="bool"||y.dataType=="boolean"){const W=Re(B[L]);if(y.values&&y.values.length>1)return y.i18n?a(W?y.values[0]:y.values[1]):W?y.values[0]:y.values[1];W!=null?D=e.h(u.NIcon,{size:"20",class:W?"cell-checked":"cell-unchecked"},{default:()=>W?e.h(Us):e.h(yi)}):D=e.h("span")}else if(y.dataType=="date")D=st(Mo(B[L]));else if(y.dataType=="time")D=Lo(Ao(B[L]));else if(y.dataType=="timespan")D=zo(B[L]);else{let W=B[L];y.formatter?W=y.formatter(W,B):y.template&&(W=Ce.render(y.template,B)),typeof W=="string"&&(y.prefix&&(W=y.prefix+W),y.suffix&&(W=W+y.suffix),y.i18n&&(W=a(W))),D=W}let F=y.role;if(F&&!Array.isArray(F)&&(F=[F]),F!=null&&F.length)if(F.includes("tag")){let W;Array.isArray(B[L])?W=B[L]:W=(ne=(oe=(ee=B[L])==null?void 0:ee.toString())==null?void 0:oe.split(","))==null?void 0:ne.filter(K=>K.length),W&&W.length&&(D=e.h(Et,{tags:W,tagSource:y.tagSource},{}))}else D&&(D=e.h("span",{class:F.map(W=>{switch(W){case"status":return`status-tag status-${B[L]}`;default:return`halo-form-${W}`}}).join(" ")},[D]));const Y=typeof y.href=="function"?y.href(B):y.href;if(y.behavior=="link")Y?D=e.h("a",{href:Ce.render(Y,B),target:"_blank"},[D]):D=e.h("a",{href:"#",onClick:W=>{var K;r("columnButtonClick",y.name,B,A),(K=y==null?void 0:y.click)==null||K.call(null,B,A),W.stopPropagation()}},[D]);else if(y.behavior=="router-link"&&Y){const W=D;D=e.h(ce.RouterLink,{to:Ce.render(Y,B)},{default:()=>W})}else if(y.behavior=="button"){const W=D;D=e.h(u.NButton,{size:"tiny",tag:"a",onClick:K=>{var fe;r("columnButtonClick",y.name,B,A),(fe=y==null?void 0:y.click)==null||fe.call(null,B,A),K.stopPropagation()}},{default:()=>W})}const v=[];if(y.role&&(y.role.includes("qr")&&v.push(e.h(u.NButton,{quaternary:!0,size:"tiny",class:"btn-cell-qr",title:a("QR Code"),onClick:()=>N(y,A)},{default:()=>e.h(u.NIcon,{},{default:()=>e.h(Ci)})})),y.role.includes("percent"))){const W=Ro(B[L]);v.push(e.h(u.NProgress,{showIndicator:!1,type:"circle",status:W&&W>100?"error":"success",percentage:W||0,class:"percent-mark",style:"width: 1em; margin-bottom: auto; margin-top: auto"}))}return y.referencePage&&v.push(e.h(u.NButton,{quaternary:!0,size:"tiny",class:"btn-cell-ref",title:a("Details"),onClick:()=>k(y,A)},{default:()=>e.h(u.NIcon,{},{default:()=>e.h(un)})})),v.length?e.h("div",{style:"display: flex; justify-content: space-between;"},[e.h("div",{style:"flex-shrink: 1; flex-grow: 1; overflow: hidden;"},[D]),e.h("div",{},...v)]):D}}function k(y,B){if(Array.isArray(n.data)&&B!=null&&B>=0&&B<n.data.length&&y.referencePage){const A=n.data[B],D=Ce.render(y.referencePage,A);D.startsWith("/")&&c.push({path:D})}}function N(y,B){if(Array.isArray(n.data)&&B!=null&&B>=0&&B<n.data.length){const A=n.data[B][y.name];if(typeof A=="string"){const D=a(y.title??te(y.name));f.showQrModal(A,D)}}}function V(y,B){return{onClick:A=>{if(A.target instanceof HTMLElement&&A.target.classList.contains("n-checkbox-box__border")==!1){const D=x(y);D!==void 0&&!s.value.includes(D)&&(s.value=[D],b())}},ondblclick:A=>{A.target instanceof HTMLTableCellElement&&r("editRow",y,B)}}}function E(y,B){B!=!1||!n.multiSelect?(s.value=[y],b()):s.value.includes(y)||(s.value.push(y),b())}function O(y,B){if(B!=!1||!n.multiSelect)s.value=y,b();else{const A=s.value.slice();for(const D of y)A.includes(D)||A.push(D);s.value.length<A.length&&(s.value=A,b())}}function j(y){n.multiSelect?s.value=y:s.value=y.slice(0,1),b()}function z(){return s.value}function H(y,B){Array.isArray(n.data)&&y>-1&&ln(n.data,y,B)}function I(){var A;const y=(A=m.value)==null?void 0:A.$el,B=y==null?void 0:y.querySelector("tbody.n-data-table-tbody");if(B&&Array.isArray(n.data)){const D=e.ref(n.data);Zt.useDraggable(B,D,{animation:150,ghostClass:"draging-ghost",handle:".drag-sorting-handle",onUpdate(L){var v;const F=L.oldIndex,Y=L.newIndex;if(F!=null&&Y!=null&&n.data&&F<((v=n.data)==null?void 0:v.length)){const ee=n.data[F];console.log(F,Y,ee==null?void 0:ee.id),r("rowSorting",{oldIndex:F,newIndex:Y,source:ee,updateGrid:()=>H(F,Y)})}}})}}return e.watch(()=>n.data,y=>{const A=y.map(D=>D[n.keyField]);s.value=s.value.filter(D=>A.includes(D)),b()}),e.watch(()=>n.columns,()=>i.value=P()),e.watch(()=>n.height,()=>d.value=h()),e.onMounted(()=>{n.dragSorting&&setTimeout(()=>{I()},500)}),l({selectRow:E,selectRows:O,getSelectedRowKeys:z}),(y,B)=>(e.openBlock(),e.createBlock(e.unref(u.NDataTable),{ref_key:"nTableRef",ref:m,columns:i.value,data:y.data,size:"small","row-key":x,"row-props":V,loading:y.loading,"single-line":!1,"max-height":y.maxHeight,"scroll-x":g.value,striped:"",remote:"","flex-height":y.flexHeight,style:e.normalizeStyle(d.value),"checked-row-keys":s.value,"onUpdate:checkedRowKeys":[B[0]||(B[0]=A=>s.value=A),j],"scrollbar-props":{trigger:"none"},"onUpdate:sorter":B[1]||(B[1]=A=>y.$emit("update:sorter",A))},null,8,["columns","data","loading","max-height","scroll-x","flex-height","style","checked-row-keys"]))}}),Ri={class:"flex-column gap05"},Oi={class:"flex-row gap05",style:{"justify-content":"space-between"}},Ze=e.defineComponent({__name:"SearchPanel",props:{title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean},additionQuery:{}},emits:["searchBack","resultSelected"],setup(t,{expose:l,emit:o}){const n=t,r=o,{t:a}=Z(),c=u.useMessage(),f=e.inject("axios"),g=e.ref(null),i=e.ref(1),s=e.ref(0),m=e.ref(!1),d=e.ref(Array()),h=e.ref(Array());let b=!0;function x(V){if(V){const E=V.rows;E.forEach((O,j)=>{O.__key__=j}),d.value=E,s.value=V.pageCount||1,i.value=V.pageIndex+1}}function S(){d.value=[],s.value=0,i.value=1}function P(V){T(V)}async function T(V){var j,z,H;const E=((j=g.value)==null?void 0:j.pickValues())||{},O=(z=n.config)==null?void 0:z.searchAction;if(E&&O){const I={pageSize:((H=n.config)==null?void 0:H.pageSize)||10,pageIndex:(V||i.value)-1};Object.assign(I,E),n.additionQuery&&(typeof n.additionQuery=="function"?Object.assign(I,n.additionQuery.call(null)):Object.assign(I,n.additionQuery));try{m.value=!0;const y=await f.post(O,I);y.isSuccess&&y.value!=null?(b=!1,x(y.value)):c.error(a(y.errorMessage||"Error"))}catch(y){c.error(y==null?void 0:y.toString())}finally{m.value=!1}}}function k(){const V=h.value;if(V!=null&&V.length){const E=d.value.filter(O=>V.includes(O.__key__));r("searchBack",E,n.config),n.autoClose==!0&&close()}}function N(){n.searchOnMounted&&b&&T(1)}return e.watch(()=>n.config,V=>{V&&(b=!0),S()}),e.onMounted(()=>N()),l({searchPage:T,returnAndClose:k}),(V,E)=>(e.openBlock(),e.createElementBlock("div",Ri,[e.createVNode(Ke,{ref_key:"searchFormRef",ref:g,cols:2,"search-items":V.config.searchFields},null,8,["search-items"]),e.createElementVNode("div",Oi,[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:E[0]||(E[0]=()=>T(1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Search")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:E[1]||(E[1]=()=>{var O;return(O=g.value)==null?void 0:O.reset()})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Reset")),1)]),_:1})]),e.createVNode(We,{class:"flex-grow-1",style:{height:"200px"},columns:V.config.gridColumns,loading:m.value,data:d.value,multiSelect:V.multiSelect,selectedIds:h.value,"onUpdate:selectedIds":[E[2]||(E[2]=O=>h.value=O),E[3]||(E[3]=(O,j)=>V.$emit("resultSelected",O,j))],onDblclickRow:E[4]||(E[4]=O=>V.$emit("searchBack",[O]))},null,8,["columns","loading","data","multiSelect","selectedIds"]),e.createVNode(e.unref(u.NPagination),{page:i.value,"onUpdate:page":[E[5]||(E[5]=O=>i.value=O),P],"page-count":s.value,"show-quick-jumper":"",style:{"align-self":"self-end"}},null,8,["page","page-count"])]))}}),ji={key:0,class:"flex-column flex-grow-1"},Pi={class:"flex-row",style:{"align-items":"center"}},Fi={style:{"margin-left":"0.5em"}},Hi={class:"flex-row",style:{"justify-content":"space-between"}},_t=e.defineComponent({__name:"SearchModal",props:{show:{type:Boolean},width:{},height:{},title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean,default:!1},additionQuery:{}},emits:["searchBack","update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref(void 0);let c=!0;const f=e.ref([]);function g(d,h){f.value=h??[]}function i(d){d&&d.length&&n("searchBack",d,o.config)}function s(){f.value&&f.value.length&&(n("searchBack",f.value,o.config),o.autoClose==!0&&m())}function m(){n("update:show",!1)}return e.watch(()=>o.config,d=>{d&&(c=!0)}),e.watch(a,()=>{var d;o.searchOnMounted&&c&&(c=!1,(d=a.value)==null||d.searchPage(1))}),e.watch(()=>o.show,d=>{var h;d&&o.searchOnMounted&&c&&(c=!1,(h=a.value)==null||h.searchPage(1))}),(d,h)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:d.show,style:e.normalizeStyle({width:d.width??"900px",height:d.height??"650px"}),preset:"card","display-directive":"show","content-class":"flex-column",onClose:h[0]||(h[0]=()=>m())},{header:e.withCtx(()=>[e.createElementVNode("div",Pi,[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5",size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1}),e.createElementVNode("span",Fi,e.toDisplayString(e.unref(r)(d.title)),1)])]),action:e.withCtx(()=>[e.createElementVNode("div",Hi,[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:s},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:m},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})])]),default:e.withCtx(()=>[d.config?(e.openBlock(),e.createElementBlock("div",ji,[e.createVNode(Ze,{ref_key:"searchPanelRef",ref:a,class:"flex-grow-1",config:d.config,"multi-select":d.multiSelect,"auto-close":d.autoClose,"addition-query":d.additionQuery,onResultSelected:g,onSearchBack:i},null,8,["config","multi-select","auto-close","addition-query"])])):e.createCommentVNode("",!0)]),_:1},8,["show","style"]))}}),Gi={style:{"margin-bottom":"12px","min-height":"100px"}},Ye=re(e.defineComponent({__name:"ImportModal",props:{title:{default:"Import File"},multiple:{type:Boolean},action:{},accept:{},show:{type:Boolean},timeout:{},additionParams:{},templateCode:{},templateUrl:{},beforeUpload:{},disabled:{type:Boolean}},emits:["uploaded","update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=u.useMessage(),c=u.useLoadingBar(),f=e.inject("axios"),g=ie(),i=e.reactive({}),s=e.ref(!1),m=e.ref(new Array),d=e.ref(!1),h=e.ref(void 0),b=e.ref(x());function x(){if(o.templateUrl)return o.templateUrl;if(o.templateCode)return`/api/core/DataExchangeTemplates/ImportTemplate?templateCode=${o.templateCode}`}async function S(){var N;if(d.value)return a.warning("Is uploading..."),!1;let k=typeof o.action=="function"?o.action.call(void 0):o.action;if(k&&o.templateCode&&(k=U(k,{templateCode:o.templateCode})),(N=m.value)!=null&&N.length&&k){if(!o.multiple&&m.value.length>1)return a.error("Only one file can be uploaded."),!1;if(o.beforeUpload&&o.beforeUpload.call(null,{files:m})==!1)return!1;try{d.value=!0;const V=m.value.filter(E=>E.status=="pending"||E.status=="error").map(E=>P(E,k));await Promise.all(V),m.value.every(E=>E.status=="finished")&&(m.value.length=0,a.success(r("Upload Success.")),s.value=!1)}catch(V){h.value=(V==null?void 0:V.toString())||r("Error")}finally{d.value=!1}}}async function P(k,N){const V=new FormData;V.append("file",k.file);const E={timeout:o.timeout||1e3*60*10,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:j=>{k.percentage=Math.round(j.loaded*100/j.total)}};k.percentage=0,k.status="uploading";let O=N;o.additionParams&&(O=U(N,o.additionParams)),i&&(O=U(O,i));try{const j=await f.post(O,V,E);j.isSuccess?(k.status="finished",n("uploaded",j.value),n("update:show",!1)):(k.status="error",k.errorMessage=j.errorMessage,h.value=r(j.errorMessage||"Error"))}catch(j){k.status="error",k.errorMessage=j==null?void 0:j.toString(),h.value=(j==null?void 0:j.toString())||r("Error")}}async function T(){const k=b.value;if(k)try{c.start(),await me(k)}catch(N){a.error(await g.getHttpErrorMessage(N,"Error"))}finally{c.finish()}}return e.watch(()=>o.show,()=>{h.value=void 0,m.value=[]}),(k,N)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{show:k.show,"onUpdate:show":N[3]||(N[3]=V=>k.$emit("update:show",V)),preset:"card",title:e.unref(r)(k.title),style:{"max-width":"600px"},draggable:""},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px"},onClick:S,disabled:k.disabled||!k.action||d.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ti))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Upload")),1)]),_:1},8,["disabled"]),e.createVNode(e.unref(u.NSpace),null,{default:e.withCtx(()=>[b.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,style:{"min-width":"100px"},onClick:T},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(dn))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Download Template")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:N[2]||(N[2]=()=>k.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:d.value},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NUpload),{multiple:k.multiple,"default-upload":!1,"file-list":m.value,"onUpdate:fileList":N[0]||(N[0]=V=>m.value=V),accept:k.accept,disabled:!k.action,"show-retry-button":!1},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NUploadDragger),null,{default:e.withCtx(()=>[e.createElementVNode("div",Gi,[e.createVNode(e.unref(u.NIcon),{size:"48",depth:3},{default:e.withCtx(()=>[e.createVNode(e.unref(va))]),_:1})]),e.createVNode(e.unref(u.NText),{style:{"font-size":"16px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Click or drag files to this area to upload.")),1)]),_:1})]),_:1})]),_:1},8,["multiple","file-list","accept","disabled"]),e.renderSlot(k.$slots,"options",{options:i},void 0,!0)]),_:3})]),_:3},8,["show"]),h.value?(e.openBlock(),e.createBlock(e.unref(u.NAlert),{key:0,type:"error",class:"my-1",closable:"",onClose:N[1]||(N[1]=()=>h.value=void 0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.value),1)]),_:1})):e.createCommentVNode("",!0)]),_:3},8,["show","title"]))}}),[["__scopeId","data-v-18129d6e"]]),Lt=e.defineComponent({__name:"InputModal",props:{title:{},message:{},value:{},placeholder:{},maxLength:{},type:{},lines:{},clearable:{type:Boolean},show:{type:Boolean},submitting:{type:Boolean}},emits:["close","commit","update:show","update:value"],setup(t,{emit:l}){var g;const o=t,n=l,{t:r}=Z(),a=e.ref((g=o.value)==null?void 0:g.toString()),c=()=>{n("close"),n("update:show",!1)},f=()=>{n("commit",a.value),n("update:value",a.value)};return e.watch(()=>o.value,i=>a.value=i==null?void 0:i.toString()),(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{title:i.title,show:i.show,preset:"card",style:{width:"400px"},onClose:c},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},loading:i.submitting,onClick:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["loading"]),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:c},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:i.submitting},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.message),1)]),_:1}),e.createVNode(e.unref(u.NInput),{value:a.value,"onUpdate:value":s[0]||(s[0]=m=>a.value=m),placeholder:i.placeholder,maxlength:i.maxLength,type:i.type,rows:i.lines,clearable:i.clearable},null,8,["value","placeholder","maxlength","type","rows","clearable"])]),_:1})]),_:1},8,["show"])]),_:1},8,["title","show"]))}}),Ki={key:0,class:"flex-row",style:{"align-items":"center","justify-content":"space-between",gap:"0.25em","margin-bottom":"1em"}},Wi={key:1},Zi={class:"flex-row gap05"},Yi={style:{display:"grid","grid-template-columns":"auto 1fr",gap:"0.5em","align-items":"center"}},Qi={class:"flex-row gap05",style:{"justify-content":"space-between"}},wn=200,Xi=e.defineComponent({__name:"GridConfigBox",props:{gridId:{},pageSize:{},gridColumns:{}},emits:["close","reset","update:pageSize","update:config"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=ie(),c=Tt(["2E2466DDD34847C8B33460E4277A6528"]),f=ce.useRouter(),g=e.ref(o.pageSize),i=e.ref(!1),s=e.ref(!1),m=e.ref(void 0),d=e.ref(void 0),h=e.ref(!1),b=e.ref(!1),x=I=>I?I.map((y,B)=>({columnId:y.name,title:y.title?r(y.title):r(te(y.name)),visible:!0,sortIndex:B})).sort((y,B)=>y.sortIndex-B.sortIndex):[],S=e.ref(x(o.gridColumns)),P=()=>{const I=o.gridId;if(!I)return;const B=i.value&&s.value?`/api/core/UserDataGrids/ResetGlobal?dataGridId=${I}`:`/api/core/UserDataGrids/Reset?dataGridId=${I}`;a.confirmToPost("Reset","Are you sure reset the configuration of this data grid?",{url:B,successMessage:"The configuration has been reset, please refresh the page.",success:()=>{n("reset")}})},T=()=>{if(!o.gridId)return;const I={dataGridId:o.gridId,pageSize:g.value,columns:S.value.filter(A=>A.columnId).map(A=>({columnId:A.columnId,visible:A.visible,customTitle:A.customTitle,sortIndex:A.sortIndex}))};I.pageSize&&(I.pageSize=Math.max(1,Math.min(wn,I.pageSize)));const y=i.value&&s.value,B=y?`/api/core/UserDataGrids/SaveGlobal?isDefault=${y}`:`/api/core/UserDataGrids/Save?isDefault=${y}`;a.post({url:B,data:I,successMessage:"The configuration has been saved, please refresh the page.",success:()=>{n("update:pageSize",g.value),n("update:config",I)}})},k=()=>{if(!o.gridId||!S.value.length)return;const I=i.value&&s.value;a.get({url:`/api/core/UserDataGrids/${encodeURIComponent(o.gridId)}?isDefault=${I}`,callback:y=>{if(y){g.value=y.pageSize;for(const B of y.columns){const A=S.value.find(D=>D.columnId==B.columnId);A&&(A.visible=B.visible,A.sortIndex=B.sortIndex,A.customTitle=B.customTitle),S.value.sort((D,L)=>D.sortIndex-L.sortIndex)}}else S.value=x(o.gridColumns),g.value=o.pageSize}})},N=()=>{var B;const I=(B=m.value)==null?void 0:B.$el,y=I==null?void 0:I.querySelector("tbody.n-data-table-tbody");y&&S&&Zt.useDraggable(y,S,{animation:150,ghostClass:"draging-ghost",handle:".drag-sorting-handle",onUpdate:()=>{const A=S.value;for(let D=0;D<A.length;D++)A[D].sortIndex=D;console.log(S.value)}})},V=I=>{var y;h.value=!1,d.value&&(d.value.customTitle=I,i.value&&a.post({url:"/api/core/UserDataGrids/UpdateCustomTitleGlobal",data:{dataGridId:o.gridId,columnId:(y=d.value)==null?void 0:y.columnId,customTitle:I}}))},E=()=>{o.gridId&&a.downloadFile({url:`/api/core/UserDataGrids/export?dataGridId=${encodeURIComponent(o.gridId)}`})},O=I=>e.h("div",{class:"flex-row gap05"},[I.customTitle?e.h("span",null,`${I.customTitle} (${I.title})`):e.h("span",null,`${I.title}`),e.h(u.NButton,{text:!0,title:r("Edit"),class:"edit-title-btn",onClick:()=>{d.value=I,h.value=!0}},{default:()=>e.h(u.NIcon,{size:16},{default:()=>e.h(Vi)})})]),j=I=>e.h(u.NButton,{text:!0,onClick:y=>{I.visible=!I.visible,y.stopPropagation()}},{default:()=>e.h(u.NIcon,{size:20},{default:()=>I.visible?e.h(sn):e.h(an)})}),z=()=>{var y;const I={dataGridId:o.gridId,pageSize:o.pageSize,columns:(y=o.gridColumns)==null?void 0:y.map(B=>({columnId:B.name,sortIndex:B.sortIndex,visible:B.visible,title:B.title}))};I.dataGridId&&a.post({url:"/api/core/DataGrids/getOrCreate",data:I,success:B=>{B&&f.push({name:"DataGrid",params:{id:B}})}})},H=[{title:r("Name"),key:"title",render:O},{title:r("Visible"),key:"visible",width:80,align:"center",fixed:"right",render:j},{width:30,align:"center",fixed:"right",render:()=>e.h(u.NIcon,{color:"#90A4AE",size:"20",class:"drag-sorting-handle"},{default:()=>e.h(fn)})},{key:"empty",width:20,fixed:"right"}];return e.watch(()=>o.gridColumns,()=>S.value=x(o.gridColumns)),e.watch(i,()=>k()),e.watch(S,()=>N()),e.onMounted(()=>{setTimeout(()=>{N()},500),c.checkOnce(I=>{s.value=I["2E2466DDD34847C8B33460E4277A6528"]})}),(I,y)=>{var B;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([{"grid-config-global-mode":i.value},"flex-column gap05"])},[s.value?(e.openBlock(),e.createElementBlock("div",Ki,[e.createVNode(e.unref(u.NButton),{onClick:z},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("System Default")),1)]),_:1})])):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("div",Wi,[e.createElementVNode("div",Zi,[e.createVNode(e.unref(u.NButton),{onClick:y[0]||(y[0]=()=>b.value=!0)},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{size:"16"},{default:e.withCtx(()=>[e.createVNode(e.unref(Bt))]),_:1}),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Import")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:E},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{size:"16"},{default:e.withCtx(()=>[e.createVNode(e.unref(It))]),_:1}),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("Export")),1)]),_:1})])])):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NDataTable),{ref_key:"nTableRef",ref:m,columns:H,data:S.value,"max-height":"60vh",size:"small"},null,8,["data"]),e.createElementVNode("div",Yi,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Page Size")),1),e.createVNode(e.unref(u.NInputNumber),{value:g.value,"onUpdate:value":y[1]||(y[1]=A=>g.value=A),max:wn,min:1,style:{"max-width":"200px"}},null,8,["value"])]),e.createVNode(Lt,{show:h.value,"onUpdate:show":y[2]||(y[2]=A=>h.value=A),value:((B=d.value)==null?void 0:B.customTitle)??"",title:e.unref(r)("Custom Title"),clearable:"","onUpdate:value":V},null,8,["show","value","title"]),e.createVNode(Ye,{show:b.value,"onUpdate:show":y[3]||(y[3]=A=>b.value=A),action:"/api/UserDataGrids/Import",onUploaded:y[4]||(y[4]=()=>k())},null,8,["show"]),e.createElementVNode("div",Qi,[e.createVNode(e.unref(u.NButton),{onClick:T,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Save")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:P,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Reset")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:y[5]||(y[5]=()=>I.$emit("close")),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})])],2)}}}),Ji=t=>{const l=u.useModal(),{t:o}=Z(),n=ie();return{showConfigModal:c=>{const f=t.gridId??c.gridId;if(!f)return;const g=l.create({title:o("Config Data Grid"),preset:"card",contentClass:"flex-column",style:"width: 500px;",draggable:!0,content:()=>e.h(Xi,{gridId:f,pageSize:c.pageSize,gridColumns:c.gridColumns,class:"flex-grow-1",onClose:()=>g.destroy(),onReset:()=>{var i;(i=t.onReset)==null||i.call(null),g.destroy()},"onUpdate:pageSize":i=>{var s;i>0&&((s=t.onPageSizeChanged)==null||s.call(null,i))},"onUpdate:config":i=>{var s;(s=t.onConfigChanged)==null||s.call(null,i),g.destroy()}})})},loadGridConfig:c=>{t.gridId&&n.get({url:`/api/core/UserDataGrids/Entity?dataGridId=${encodeURIComponent(t.gridId)}`,callback:f=>{var g;(g=t.onConfigChanged)==null||g.call(null,f),c==null||c.call(null,f)}})}}},qi={class:"flex-column flex-grow-1",style:{gap:"0.25em"}},Ui={key:0,class:"flex-row",style:{"justify-content":"space-between"}},vi={style:{"margin-left":"8px"}},ec={style:{display:"flex"}},tc={style:{"flex-grow":"1"}},Cn=e.defineComponent({__name:"HaloForm",props:{name:{},autoLoad:{type:Boolean,default:!0},columns:{},keys:{default:"id"},allowNew:{type:Boolean,default:!0},allowEdit:{type:Boolean,default:!0},searchAction:{},getListAction:{},getEntityAction:{},initEntityAction:{},deleteAction:{},deleteBatchAction:{},deleteMethod:{default:"DELETE"},saveAction:{},exportAction:{},importAction:{},detailsPage:{},detailsPageName:{},detailsKeys:{},dataExchangeCode:{},exportFormats:{},exportRanges:{},exportOptions:{},importOptions:{},importTimeout:{},importTemplateCode:{},gridMaxHeight:{},gridHeight:{},gridCheckable:{type:Boolean,default:!0},gridDragSorting:{type:Boolean},chainCreating:{type:Boolean,default:!0},readOnly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},pageSize:{default:20},multiSelect:{type:Boolean,default:!0},quickSearch:{type:Boolean,default:!0},gridFlexHeight:{type:Boolean,default:!0},parentKey:{},parentValue:{},verifyParentKey:{type:[Boolean,Function]},selectedId:{},selectedIds:{},modalColumns:{},modalStyle:{},formGroupLayout:{},enctype:{},batchAdds:{},beforeSave:{},defaultSearchArgs:{},extendedMenus:{},additionKeys:{},searchGroupOptions:{},defaultSortBy:{},defaultSortDirection:{},propertyModal:{}},emits:["update:selectedIds","update:selectedId","update:data","columnButtonClick","saved","beforeShow","itemChange","commitEdit","extendedMenuSelect","beforeRenderPage","searchReturn","rowSorting"],setup(t,{expose:l,emit:o}){var cl;const n=t,r=o,{t:a}=Z(),c=e.inject("axios"),f=e.ref(Array()),g=u.useDialog(),i=u.useMessage(),s=u.useLoadingBar(),m=ce.useRouter(),d=e.ref(Uo(n.columns||[],a)),h=e.ref(Be(n.columns||[])),b=e.ref(vo(n.columns||[],a));let x=1;const S=e.ref(1),P=e.ref(0),T=e.ref(0),k=e.ref(n.pageSize),N=e.ref(!0),V=e.ref(!1),E=e.ref(!1),O=e.ref(""),j=e.ref(n.searchAction&&((cl=n.columns)==null?void 0:cl.some(p=>Ie(p)&&p.search))),z=e.ref(j.value&&!n.getListAction),H=e.ref(z.value&&!0),I=e.ref(!1),y=e.ref(null),B=e.ref(null),A=e.ref(new Array),D=e.ref(!1),L=e.ref(void 0),F=e.ref(void 0),Y=e.ref(void 0),v=e.ref(!1),ee=e.ref(n.readOnly),oe=e.ref(a("Property")),ne=e.ref(!1),W=e.ref(!1);let K;const fe=e.ref([]),$t=e.ref(Ot("page")),Hn=e.ref(Qc()),Rt=e.ref(void 0),he=e.ref([]),Me=e.ref(void 0),Xe=e.ref(!1);let ye;const Gn=e.ref(void 0),we=e.ref(void 0),Te=e.ref(void 0);let ze=[],De=0;const Yc=e.ref({width:Xc(n.modalColumns)});function Qc(){var w;const p={};if(n.defaultSearchArgs)for(const C in n.defaultSearchArgs)p[C]=n.defaultSearchArgs[C];return(w=b.value)==null||w.forEach(C=>{C.defaultValue!=null&&(C.searchMethod=="range"?Array.isArray(C.defaultValue)&&(C.defaultValue.length>0&&C.defaultValue[0]!=null&&(p[`${C.name}From`]=C.defaultValue[0]),C.defaultValue.length>1&&C.defaultValue[1]!=null&&(p[`${C.name}To`]=C.defaultValue[1])):p[C.name]=C.defaultValue)}),p}function Ot(p){return n.exportRanges&&n.exportRanges.length&&!n.exportRanges.includes(p)?n.exportRanges[0]:p}function Xc(p){return p?p>4?"100%":p>1?450*p+"px":"600px":"600px"}function Je(p){if(n.keys){if(typeof n.keys=="string")return p[n.keys];if(n.keys.length==1&&typeof n.keys[0]=="string")return p[n.keys[0]];if(n.keys.length>1)return n.keys.map(w=>p[w]).join()}return""}function qe(p){if(p.__key__=Je(p),n.columns)for(const w of n.columns){let C;if(typeof w=="string")C=w;else if(Ie(w))C=w.name;else continue;C&&!(C in p)&&(p[C]=null)}}function Kn(p){if(p){r("beforeRenderPage",{data:p});const C=p.rows;C.forEach(_=>qe(_)),f.value=C,r("update:data",f.value),T.value=p.totalRecords||0,P.value=p.pageCount||1,S.value=p.pageIndex+1,N.value=!0}}function Wn(p){if(p){const w={data:p};r("beforeRenderPage",w),p=w.data,p.forEach(C=>qe(C)),f.value=p,r("update:data",f.value),P.value=1,S.value=1,N.value=!1}}async function ue(p){var w,C;if(!(V.value||n.disabled)&&n.getListAction){const _={pageSize:k.value,pageIndex:p},$=(w=O.value)==null?void 0:w.trim();if(n.quickSearch&&$&&(_.searchWords=$),n.additionKeys&&Object.assign(_,n.additionKeys),n.parentKey&&!ae(_))return;(we.value||n.defaultSortBy)&&(_.sortBy=we.value??n.defaultSortBy,_.sortDirection=Te.value??n.defaultSortDirection);try{V.value=!0;let G=n.getListAction;typeof G=="function"&&(G=G.call(void 0));const X=U(G,_),R=await c.get(X);R!=null&&R.isSuccess&&R.value?(De++,R.value&&(Array.isArray(R.value)?Wn(R.value):Kn(R.value))):i.error(a((R==null?void 0:R.errorMessage)??((C=R==null?void 0:R.value)==null?void 0:C.toString())??"Error"))}catch(G){i.error((G==null?void 0:G.toString())??a("Error")),console.error(G)}finally{V.value=!1}}}function $e(p){if(!n.disabled)if(H.value&&ye){const w=Object.assign({},ye);w.sortBy=we.value,w.sortDirection=Te.value,Ft(w)}else p!=null?ue(p):ue(S.value-1)}function jt(){ue(0)}function Jc(){O.value="",ue(0)}function qc(p){if(n.additionKeys)for(const w in n.additionKeys){const C=n.additionKeys[w];C!=null&&(p[w]=C)}}function Zn(){if(!n.parentKey||!n.verifyParentKey)return!0;if(n.verifyParentKey==!0)return!(n.parentValue==null||Array.isArray(n.parentKey)&&Array.isArray(n.parentValue)&&n.parentValue.some(p=>p==null));if(typeof n.verifyParentKey=="function"){const p=n.verifyParentKey({key:n.parentKey,value:n.parentValue});if(typeof p=="boolean")return p}return!0}function ae(p){if(n.verifyParentKey&&Zn()==!1)return!1;if(n.parentKey){const w={};if(Array.isArray(n.parentKey))if(Array.isArray(n.parentValue))for(let C=0;C<n.parentKey.length;C++){const _=n.parentKey[C];(typeof _=="string"||typeof _=="number")&&n.parentValue.length>C&&(w[_]=n.parentValue[C])}else for(let C=0;C<n.parentKey.length;C++){const _=n.parentKey[C];(typeof _=="string"||typeof _=="number")&&(w[_]=n.parentValue)}else n.parentKey&&(w[n.parentKey]=n.parentValue);p&&Object.assign(p,w)}return!0}async function Pt(){var w;if(n.disabled)return;const p=(w=y.value)==null?void 0:w.pickValues();if(p&&n.searchAction){const C={};Object.assign(C,p),qc(C),C.pageSize=k.value,C.pageIndex=0,C.sortBy=we.value??n.defaultSortBy,C.sortDirection=Te.value??n.defaultSortDirection,C.groupBy=Rt.value,Ft(C)}}async function Ft(p){if(!V.value)try{V.value=!0;let w=n.searchAction;if(typeof w=="function"&&(w=w.call(void 0,p)),!w)return;const C={};if(!ae(C))return;w=U(w,C);const _=await c.post(w,p);_.isSuccess&&_.value!=null?(De++,ye=p,r("searchReturn",{data:_.value,query:p,action:w}),Array.isArray(_.value)?Wn(_.value):Kn(_.value)):i.error(a(_.errorMessage||"Error"))}catch(w){i.error(w==null?void 0:w.toString())}finally{V.value=!1}}function Yn(p,w){const C={};if(ae(C)){if(typeof n.keys=="string"?C[n.keys]=p[n.keys]:n.keys.forEach($=>C[$]=p[$]),Array.isArray(n.detailsKeys))n.detailsKeys.map($=>$.toString()).forEach($=>C[$]=p[$]);else if(typeof n.detailsKeys=="object"){const $=n.detailsKeys;for(const G in $){var _=$[G];_&&(C[G]=p[_])}}else typeof n.detailsKeys=="function"?n.detailsKeys.call(null,C):n.detailsKeys&&(C[n.detailsKeys]=p[n.detailsKeys]);if(n.detailsPageName)m.push({name:n.detailsPageName,params:C});else if(n.detailsPage)if(typeof n.detailsPage=="function"){const $=n.detailsPage(p,w);(typeof $=="string"||typeof $=="object")&&m.push($)}else m.push({path:n.detailsPage,query:C})}}async function Ht(p,w){var C;if(!n.disabled)if(n.getEntityAction){const _={};if(n.additionKeys&&Object.assign(_,n.additionKeys),!ae(_))return;typeof n.keys=="string"?_[n.keys]=p[n.keys]:n.keys.forEach($=>_[$]=p[$]);try{let $=n.getEntityAction;typeof $=="function"&&($=$.call(void 0,p,w));const G=U($,_),X=await c.get(G);X.isSuccess&&X.value!=null?Ue(X.value,n.readOnly||!n.saveAction||!n.allowEdit?"view":"edit"):i.error(a((X==null?void 0:X.errorMessage)??((C=X==null?void 0:X.value)==null?void 0:C.toString())??"Error"))}catch($){i.error(($==null?void 0:$.toString())??a("Error")),console.error($)}}else Ue(p,n.readOnly||!n.saveAction||!n.allowEdit?"view":"edit")}function Gt(p,w){n.readOnly||n.disabled||n.deleteAction&&p&&p.__key__&&g.warning({title:a("Delete"),content:a("Are you sure you want to delete this row?"),positiveText:a("Delete"),negativeText:a("Cancel"),onPositiveClick:()=>{Uc(p,w)}})}async function Uc(p,w){var C;if(n.deleteAction&&n.keys.length)try{const _={};if(n.additionKeys&&Object.assign(_,n.additionKeys),!ae(_))return;typeof n.keys=="string"?_[n.keys]=p[n.keys]:n.keys.forEach(q=>_[q]=p[q]);const $=p.__key__;let G=n.deleteAction;typeof G=="function"&&(G=G.call(void 0,p,w));const X=U(G,_);let R;if(n.deleteMethod=="POST"?R=await c.post(X):R=await c.delete(X),R.isSuccess){let q=f.value.indexOf(p);if(q>-1&&(f.value.splice(q,1),i.success(a("The data has been deleted."))),A.value&&(q=A.value.findIndex(Q=>Q==$),q>-1)){A.value.splice(q,1);const Q=(C=f.value)==null?void 0:C.filter(bd=>A.value.includes(bd["__key__]"]));r("update:selectedIds",A.value,Q),A.value.length?r("update:selectedId",A.value[0],Q!=null&&Q.length?Q[0]:void 0):r("update:selectedId",void 0,void 0)}}else i.error(a(R.errorMessage||"Error"))}catch(_){console.error(_),i.error(_==null?void 0:_.toString())}}function vc(p){n.readOnly||n.disabled||n.deleteBatchAction&&p&&p.length&&g.warning({title:a("Delete"),content:a("Are you sure you want to delete selected rows?"),positiveText:a("Delete"),negativeText:a("Cancel"),onPositiveClick:()=>{ed(p)}})}async function ed(p){if(n.deleteBatchAction&&p.length)try{const w={ids:p.join()};if(n.additionKeys&&Object.assign(w,n.additionKeys),!ae(w))return;let C=n.deleteBatchAction;typeof C=="function"&&(C=C.call(void 0));const _=U(C,w);let $;if(n.deleteMethod=="POST"?$=await c.post(_):$=await c.delete(_),$.isSuccess){for(const G of p){const X=f.value.findIndex(R=>R.__key__==G);X>-1&&f.value.splice(X,1)}A.value=A.value.filter(G=>!p.includes(G)),i.success(a("The data has been deleted."))}else i.error(a($.errorMessage||"Error"))}catch(w){i.error(w),console.error(w==null?void 0:w.toString())}}function Qn(){if(A.value.length){const p=f.value.find(w=>w.__key__==A.value[0]);p&&Ht(p,f.value.indexOf(p))}}function Xn(){if(A.value.length>1&&n.deleteBatchAction)vc(A.value);else if(A.value.length){const p=f.value.find(w=>w.__key__==A.value[0]);p&&Gt(p,f.value.indexOf(p))}}function Ue(p,w){const C={method:w,original:p,value:qo(p,d.value)};switch(r("beforeShow",C),Y.value=p,L.value=C.value,F.value=w,v.value=!0,ee.value=w!="create"&&w!="edit",w){case"create":oe.value=a("New");break;case"edit":oe.value=a("Edit");break;default:oe.value=a("Property");break}}function Jn(){Y.value=void 0,L.value=void 0,F.value=void 0,v.value=!1,oe.value=a("Property")}async function Kt(){var p;if(!(n.readOnly||n.disabled||!n.saveAction))if(n.initEntityAction){let w=n.initEntityAction;typeof w=="function"&&(w=w.call(void 0));let C=w;const _={};if(n.additionKeys&&Object.assign(_,n.additionKeys),!ae(_))return;C=U(C,_);try{const $=await c.get(C);$!=null&&$.isSuccess&&$.value?Ue($.value||{},"create"):i.error(a(($==null?void 0:$.errorMessage)??((p=$==null?void 0:$.value)==null?void 0:p.toString())??"Error"))}catch($){i.error(a(($==null?void 0:$.toString())??"Error")),console.error($)}}else{const w=Xo(d.value);Ue(w,"create")}}async function td(p,w){var $;if(n.readOnly||n.disabled)return;const C=Me.value;if(!C||C.searchConfig!=w||!C.actionUrl)return;let _;if(C.dataBuilder)_=C.dataBuilder(p);else{let G;if(C.keyPicker?G=C.keyPicker(p):G=p.map(X=>X.id),!G||!G.length)return;_={},_[C.keyName||"ids"]=G}if(_){let G=C.actionUrl;n.additionKeys&&Object.assign(_,n.additionKeys);const X={};ae(X)&&(G=U(G,X),Object.assign(_,X));try{const R=await c.post(G,_);if(R.isSuccess){if(R.value){for(const Q of R.value)ve(Q);const q=R.value.map(Q=>Je(Q));($=B.value)==null||$.selectRows(q),Xe.value=!1}}else i.error(a(R.errorMessage||"Error"))}catch(R){i.error(a((R==null?void 0:R.toString())||"Error")),console.error(R)}}}function qn(p){Me.value=p,Xe.value=!0}function od(p){const w=d.value;if(!w||!w.length)return!1;w.forEach(C=>{C.validationStatus=void 0,C.errorMessage=void 0});for(const C of w)C.nullable===!1&&!C.readonly&&(p[C.name]==null||p[C.name]===null||!C.dataType&&(p[C.name]==null||p[C.name]==null)?(C.validationStatus="error",C.errorMessage=a("Required here.")):(C.validationStatus="success",C.errorMessage=void 0));return!w.some(C=>C.validationStatus=="error"||C.validationStatus=="warning")}function nd(){if(n.readOnly||n.disabled)return;const p=d.value;if(!p||!p.length)return;const w=F.value;if(w!="create"&&w!="edit")return;const C=L.value,_=Y.value;if(C&&_){const $=Object.assign({},_);for(let G of p){if(G.readonly==!0||Array.isArray(G.readonly)&&G.readonly.includes(w))continue;let X=Oe(C[G.name],G.dataType,G.role);$[G.name]=X}if(r("commitEdit",{data:$,current:C,original:_,method:w}),n.beforeSave&&n.beforeSave($,w)===!1)return;od($)?Un({data:$,original:_,method:w}):i.error(a("Form validation failed."))}}async function Un(p){var w;if(!(n.readOnly||n.disabled||!n.saveAction))try{let C;const _={};if(n.additionKeys)for(const q in n.additionKeys)n.additionKeys[q]!=null&&(p.data[q]=n.additionKeys[q]);const $={};if(!ae($))return;if(Object.assign(p.data,$),n.enctype=="multipart/form-data"){C=new FormData;const q=Object.keys(p.data);for(const Q of q)p.data[Q]&&C.set(Q,p.data[Q]);_["Content-Type"]="multipart/form-data"}else C=p.data,_["Content-Type"]="application/json;charset=utf-8";let G=n.saveAction;typeof G=="function"&&(G=G.call(void 0));let X=U(G,$);E.value=!0;const R=await c.post(X,C,{headers:_});if(R.isSuccess){if(i.success(a("The data is saved.")),R.value){p.method=="create"?ve(R.value):p.method=="edit"&&vn(R.value),(w=B.value)==null||w.selectRow(Je(R.value)),p.method=="create"&&n.chainCreating?Kt():Jn();try{r("saved",{value:R.value,method:p.method})}catch(q){console.error("emit(saved) fail."+(q==null?void 0:q.toString()))}}}else i.error(a(R.errorMessage||"Error")),R.errors&&ld(d.value,R.errors)}catch(C){i.error((C==null?void 0:C.toString())||a("Error")),console.error(C)}finally{E.value=!1}}function ld(p,w){if(p&&p.length)for(const C of w){const _=p.find($=>$.name.toLowerCase()==C.key.toLowerCase());_&&(_.validationStatus="error",_.errorMessage=C.value)}}function ve(p){qe(p);const w=p.__key__,C=f.value.findIndex(_=>_.__key__==w);C>-1?f.value.splice(C,1,p):f.value.push(p)}function vn(p){qe(p);const w=p.__key__,C=f.value.find(_=>_.__key__==w);if(C)for(const _ in p)C[_]=p[_]}function rd(p){if(H.value&&ye){const w=Object.assign({},ye);w.pageIndex=Math.max(0,p-1),Ft(w)}else p>0?ue(p-1):ue(0)}function ad(p){p&&(k.value=p)}function sd(p,w){A.value=p,r("update:selectedIds",p,w),r("update:selectedId",p.length?p[0]:void 0,w.length?w[0]:void 0)}async function id(p,w){n.exportAction?await cd(p,w)&&(ne.value=!1):n.dataExchangeCode&&(tl(p,w),ne.value=!1)}function el(p,w,C){const _={outputType:p,dataRange:w,searchArgs:JSON.stringify(ye)};if(n.importTemplateCode&&(_.templateCode=n.importTemplateCode),!ye&&(n.additionKeys||n.parentKey)){const $={pageSize:k.value,pageIndex:S.value,sortBy:we.value,sortDirection:Te.value};n.additionKeys&&Object.assign($,n.additionKeys),ae($),_.searchArgs=JSON.stringify($)}switch(C&&Object.assign(_,C),w){case"selection":if(!A.value||!A.value.length)throw a("Please select the rows to be exported.");_.selectedKeys=A.value;break;case"page":_.pageSize=k.value,_.pageIndex=Math.max(0,S.value-1);break}return _}async function cd(p,w){let C=n.exportAction;if(typeof C=="function"&&(C=C.call(void 0)),C){try{if(!Zn())return console.log("Invalid parent key."),!1;const _=el(p,w,n.exportOptions);ae(_),s.start(),C=U(C,_),await me(C)}catch(_){console.log(_),i.error((_==null?void 0:_.toString())||a("Error"))}finally{s.finish()}return!0}else return!1}function dd(){n.importAction&&(D.value=!0)}async function fd(){const p=n.importTemplateCode;if(p){const w=`/api/core/DataExchangeTemplates/ImportTemplate?templateCode=${p}`;try{s.start(),await me(w)}finally{s.finish()}}}async function tl(p,w,C=!1){var q;const _=n.dataExchangeCode;if(!_)return;if(w.toLowerCase()=="empty"){const Q=`/api/core/dataExchange/importTemplate?templateCode=${_}&engineName=${p}`;try{s.start(),await me(Q)}finally{s.finish()}return}const $={name:_,engineName:p,dataRange:w};n.importTemplateCode&&($.templateCode=n.importTemplateCode);const G={pageSize:k.value,pageIndex:S.value-1};switch(w.toLowerCase()){case"empty":G.pageSize=0,G.pageIndex=0;break;case"all":G.pageSize=2e3,G.pageIndex=0;break}if(!ae(G)){console.log("Invalid parent key.");return}let X=n.exportAction||n.getListAction;typeof X=="function"&&(X=X.call(void 0));let R=X;if(C)try{const Q=await c.post("/api/core/tempData/add",{value:JSON.stringify($)});if(Q.isSuccess){if(G.exportOptionId=Q.value,R){R=U(R,G);try{s.start(),await me(R)}finally{s.finish()}}}else i.error((Q==null?void 0:Q.errorMessage)??((q=Q==null?void 0:Q.value)==null?void 0:q.toString())??a("Error"))}catch(Q){i.error((Q==null?void 0:Q.toString())??a("Error")),console.error(Q)}else if(G.exportOption=btoa(JSON.stringify($)),R){R=U(R,G);try{s.start(),await me(R)}finally{s.finish()}}}function ol(p){if(p)switch(p){case"menu_export_action":A.value&&A.value.length?$t.value=Ot("selection"):$t.value=Ot("page"),ne.value=!0;break;case"menu_export_template_action":fd();break;case"menu_import_action":dd();break;case"menu_export":ne.value=!0;break;case"menu_export_template":tl("Excel","Empty");break;case"menu_import":break;default:{const w=ze.find(C=>C.key==p);w&&nl(w)}break}}function nl(p){var _;const w=A.value,C={selectedId:w!=null&&w.length?w[0]:void 0,selectedIds:w?[...w]:void 0,data:f.value};typeof p!="string"&&((_=p.click)==null||_.call(null,C)),r("extendedMenuSelect",C)}function ud(p){const w=[];n.exportAction&&w.push({label:a("Export")+"…",key:"menu_export_action",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(It)})}),n.importTemplateCode&&w.push({label:a("Download Template")+"…",key:"menu_export_template_action"}),n.importAction&&!n.readOnly&&w.push({label:a("Import"),key:"menu_import_action",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(Bt)})}),n.dataExchangeCode&&(w.push({label:a("Export")+"…",key:"menu_export",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(It)})}),w.push({label:a("Export Template"),key:"menu_export_template"}),n.readOnly||(w.push({type:"divider",key:"------------1"}),w.push({label:a("Import"),key:"menu_import",icon:()=>e.h(u.NIcon,null,{default:()=>e.h(Bt)})}))),p&&p.length&&(w.push({type:"divider",key:"----------e--1"}),p.forEach(C=>{const _={label:C.label,key:C.key};C.icon?_.icon=ht(C.icon):C.renderIcon&&(_.icon=C.renderIcon),w.push(_)})),fe.value=w}const ll=Ji({gridId:n.name,onConfigChanged:p=>Wt(p),onPageSizeChanged:p=>k.value=p,onReset:()=>md});ll.loadGridConfig();const Wt=(p,w)=>{if(p){K=p,k.value=p.pageSize,w||(w=[...h.value]),w.forEach(C=>{C.sortIndex=99999});for(const C of p.columns){const _=w.find($=>$.name==C.columnId);_&&(_.visible=C.visible,_.sortIndex=C.sortIndex,C.title&&(_.title=C.title))}w.sort((C,_)=>(C.sortIndex||0)-(_.sortIndex||0)),h.value=w}};function pd(p){p?Wt(p):(h.value=Be(n.columns||[]),k.value=n.pageSize||20),W.value=!1}const md=()=>{h.value=Be(n.columns||[]),k.value=n.pageSize||20},hd=()=>{n.name&&ll.showConfigModal({gridId:n.name,gridColumns:h.value,pageSize:k.value})};function gd(p,w){var C;for(const _ of p)ve(_);if(w){const _=p.map($=>Je($));(C=B.value)==null||C.selectRows(_)}}function rl(p){if(!p)return;const w=ze==null?void 0:ze.find(C=>C.key==p);w&&nl(w)}function yd(p){var w,C;Array.isArray(p)?(we.value=(w=p[0].columnKey)==null?void 0:w.toString(),Te.value=p[0].order=="ascend"?"Asc":"Desc"):p&&(we.value=(C=p.columnKey)==null?void 0:C.toString(),Te.value=p.order=="ascend"?"Asc":"Desc"),$e()}function al(){const p=new Array;if(n.extendedMenus)for(const C of n.extendedMenus)typeof C=="string"?p.push({label:a(C),key:x++}):(C.key||(C.key=x++),p.push(C));ze=p,wd(p);const w=p.filter(C=>C.group=="import"||C.group=="export");ud(w)}function wd(p){if(p){const w=p.filter(C=>!C.group).map(C=>C.label=="-"?{type:"divider"}:C.icon?{label:C.label,key:C.key,icon:ht(C.icon)}:C.renderIcon?{label:C.label,key:C.key,icon:C.renderIcon()}:{label:C.label,key:C.key});he.value=w}else he.value=[]}function sl(){const p={};return n.parentKey&&ae(p),n.additionKeys&&Object.assign(p,n.additionKeys),p}function il(){const p=Object.assign({},sl(),n.importOptions);Gn.value=Object.keys(p).length?p:void 0}function Cd(){z?I.value=!I.value:I.value=!1}return e.onMounted(()=>{il(),n.autoLoad!=!1&&(z.value?n.autoLoad&&Pt():ue(0)),al()}),e.watch(e.computed(sl),(p,w)=>{JSON.stringify(p)!=JSON.stringify(w)&&(il(),n.autoLoad!=!1&&De>0&&$e())}),e.watch(()=>n.extendedMenus,()=>al()),e.watch(()=>n.parentValue,()=>{(n.autoLoad!=!1||De>0)&&ue(0)}),e.watch(()=>n.getListAction,(p,w)=>{w&&(n.autoLoad!=!1||De>0)&&ue(0)}),e.watch(k,(p,w)=>{if(p&&w){var C=void 0,_=S.value,$=T.value;if(_>0&&$){const G=Math.ceil($/p);G<_&&(C=Math.max(0,G-1))}$e(C)}}),e.watch(()=>n.columns,()=>{const p=Be(n.columns||[]);K?Wt(K,p):h.value=p}),l({reloadPage:$e,addRow:Kt,addBatch:qn,editSelectedRow:Qn,deleteSelectedRows:Xn,saveData:Un,doQuickSearch:jt,clearQuickSearch:Jc,advancedSerach:Pt,checkedRowKeys:A,editRow:Ht,deleteRow:Gt,showDetails:Yn,insertRow:ve,updateRow:vn,appendRows:gd,buildExportArgs:el}),(p,w)=>{var C,_,$,G,X;return e.openBlock(),e.createElementBlock("div",qi,[e.renderSlot(p.$slots,"header"),z.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ui,[e.createVNode(e.unref(u.NButtonGroup),null,{default:e.withCtx(()=>[e.renderSlot(p.$slots,"prefix-tools"),p.readOnly?e.createCommentVNode("",!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(p.batchAdds,R=>(e.openBlock(),e.createBlock(e.unref(u.NButton),{onClick:()=>qn(R),disabled:p.readOnly||p.disabled,key:R.id},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#388e3c"},{default:e.withCtx(()=>[e.createVNode(e.unref(Wa))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)(R.label||"Batch Add")),1)]),_:2},1032,["onClick","disabled"]))),128)),p.saveAction&&!p.readOnly&&p.allowNew?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:1,onClick:Kt,disabled:p.readOnly||p.disabled},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#388e3c"},{default:e.withCtx(()=>[e.createVNode(e.unref(hi))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("New")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),p.saveAction&&!p.readOnly&&p.allowEdit?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:2,onClick:Qn,disabled:p.readOnly||p.disabled||!A.value.length},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#5c6bc0"},{default:e.withCtx(()=>[e.createVNode(e.unref(Po))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Edit")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),(p.deleteAction||p.deleteBatchAction)&&!p.readOnly?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:3,onClick:Xn,disabled:p.readOnly||p.disabled||!A.value.length},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#f44336"},{default:e.withCtx(()=>[e.createVNode(e.unref(jo))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Delete")),1)]),_:1},8,["disabled"])):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NButton),{onClick:w[0]||(w[0]=()=>$e()),disabled:p.disabled},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#689f38"},{default:e.withCtx(()=>[e.createVNode(e.unref(je))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Refresh")),1)]),_:1},8,["disabled"]),e.renderSlot(p.$slots,"suffix-tools"),fe.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:4,options:fe.value,disabled:p.disabled,onSelect:ol},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#009688"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ma))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Import/Export"))+" ",1),e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(St))]),_:1})]),_:1})]),_:1},8,["options","disabled"])):e.createCommentVNode("",!0),he.value&&he.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:5,options:he.value,disabled:p.disabled,onSelect:rl},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5"},{default:e.withCtx(()=>[e.createVNode(e.unref(ct))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Advanced"))+" ",1),e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(St))]),_:1})]),_:1})]),_:1},8,["options","disabled"])):e.createCommentVNode("",!0)]),_:3}),e.renderSlot(p.$slots,"tools"),p.quickSearch?(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),{key:0,class:"flex-row quick-search-box",style:{width:"inherit"}},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref(u.NInput),{class:"flex-grow-1",style:{width:"260px"},value:O.value,"onUpdate:value":w[1]||(w[1]=R=>O.value=R),placeholder:e.unref(a)("Quick Search"),clearable:"",onChange:jt},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),_:1},8,["value","placeholder"]),[[e.vShow,!H.value]]),e.withDirectives(e.createVNode(e.unref(u.NButton),{title:e.unref(a)("Search"),onClick:w[2]||(w[2]=()=>jt()),style:{padding:"0 8px"}},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),_:1},8,["title"]),[[e.vShow,!H.value]]),j.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,title:e.unref(a)("More"),style:{padding:"0 8px"},onClick:w[3]||(w[3]=()=>H.value=!H.value)},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[H.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(ka),{key:0})),H.value?(e.openBlock(),e.createBlock(e.unref(Ca),{key:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"])):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0)])),e.renderSlot(p.$slots,"neck"),j.value?e.withDirectives((e.openBlock(),e.createBlock(e.unref(u.NCard),{key:1,size:"small",hoverable:"",closable:!z.value,onClose:w[8]||(w[8]=()=>H.value=!1)},{header:e.withCtx(()=>[e.createElementVNode("div",{class:"flex-row",style:e.normalizeStyle([{"align-items":"center"},{cursor:z.value?"pointer":"unset"}]),onClick:Cd},[e.createVNode(e.unref(u.NIcon),{size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1}),e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Search"))+" ",1),e.withDirectives(e.createElementVNode("span",vi," … ",512),[[e.vShow,I.value]])],4)]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px"},onClick:Pt},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Search")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:w[6]||(w[6]=()=>{var R;return(R=y.value)==null?void 0:R.reset()})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Reset")),1)]),_:1}),fe.value.length==1&&z.value?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,style:{"min-width":"100px"},onClick:w[7]||(w[7]=()=>ne.value=!0)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Export")),1)]),_:1})):e.createCommentVNode("",!0),fe.value.length>1&&z.value?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:1,options:fe.value,onSelect:ol},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Export")),1)]),_:1})]),_:1},8,["options"])):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"search-tools"),z.value&&he.value&&he.value.length?(e.openBlock(),e.createBlock(e.unref(u.NDropdown),{key:2,options:he.value,onSelect:rl},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),null,{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5"},{default:e.withCtx(()=>[e.createVNode(e.unref(ct))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(a)("Advanced"))+" ",1),e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(St))]),_:1})]),_:1})]),_:1},8,["options"])):e.createCommentVNode("",!0)]),_:3})]),_:3})]),default:e.withCtx(()=>[e.withDirectives(e.createVNode(Ke,{"search-items":b.value,ref_key:"searchFormRef",ref:y,"search-args":Hn.value,"onUpdate:searchArgs":w[4]||(w[4]=R=>Hn.value=R),"group-options":p.searchGroupOptions,"group-by":Rt.value,"onUpdate:groupBy":w[5]||(w[5]=R=>Rt.value=R)},null,8,["search-items","search-args","group-options","group-by"]),[[e.vShow,!I.value]])]),_:3},8,["closable"])),[[e.vShow,H.value]]):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"grid",{data:f.value,columns:h.value,loading:V.value,style:"background-color: chartreuse;"},()=>[e.createVNode(We,{ref_key:"dataGridRef",ref:B,data:f.value,columns:h.value,loading:V.value,class:"halo-form-grid flex-grow-1",style:{height:"80px","min-height":"80px"},"drag-sorting":p.gridDragSorting,"flex-height":p.gridFlexHeight,"with-edit":!!p.saveAction&&!p.readOnly&&p.allowEdit,"with-delete":(!!p.deleteAction||!!p.deleteBatchAction)&&!p.readOnly,"with-details":!!p.detailsPage||!!p.detailsPageName,"multi-select":p.multiSelect,"max-height":p.gridMaxHeight,height:p.gridHeight,checkable:p.gridCheckable,onEditRow:Ht,onDeleteRow:Gt,onShowDetails:Yn,"onUpdate:selectedIds":sd,onColumnButtonClick:w[9]||(w[9]=(R,q,Q)=>p.$emit("columnButtonClick",R,q,Q)),"onUpdate:sorter":w[10]||(w[10]=R=>yd(R)),onRowSorting:w[11]||(w[11]=R=>p.$emit("rowSorting",R))},null,8,["data","columns","loading","drag-sorting","flex-height","with-edit","with-delete","with-details","multi-select","max-height","height","checkable"])]),e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[N.value?(e.openBlock(),e.createBlock(e.unref(u.NPagination),{key:0,page:S.value,"onUpdate:page":[w[12]||(w[12]=R=>S.value=R),rd],"item-count":T.value,"page-size":k.value,"page-sizes":[10,20,30,40,50,100],"show-quick-jumper":"","show-size-picker":"","onUpdate:pageSize":ad},{suffix:e.withCtx(({startIndex:R,endIndex:q,itemCount:Q})=>[Q?(e.openBlock(),e.createBlock(e.unref(u.NText),{key:0,italic:"",depth:"3"},{default:e.withCtx(()=>[e.createTextVNode("["+e.toDisplayString(R+1)+"~"+e.toDisplayString(q+1)+"] / "+e.toDisplayString(Q),1)]),_:2},1024)):e.createCommentVNode("",!0)]),_:1},8,["page","item-count","page-size"])):e.createCommentVNode("",!0),p.name?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:1,text:"",onClick:w[13]||(w[13]=()=>hd())},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ii))]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.renderSlot(p.$slots,"default"),e.renderSlot(p.$slots,"bottom",{formItems:d.value,currentData:L.value,list:f.value,selectedKeys:A.value}),e.createVNode(e.unref(u.NModal),{class:"custom-card",show:v.value,"onUpdate:show":w[15]||(w[15]=R=>v.value=R),preset:"card",draggable:"",style:e.normalizeStyle([Yc.value,p.modalStyle]),title:oe.value,"close-on-esc":!1,"mask-closable":!1},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[F.value=="create"||F.value=="edit"?(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,onClick:nd,style:{"min-width":"100px"},type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Save")),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(u.NButton),{onClick:Jn,style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("Close")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:E.value},{default:e.withCtx(()=>[e.createElementVNode("div",ec,[e.createElementVNode("div",null,[e.renderSlot(p.$slots,"entity-form-left",{data:L.value,original:Y.value,method:F.value})]),e.createElementVNode("div",tc,[e.renderSlot(p.$slots,"entity-form",{formItems:d.value,data:L.value,original:Y.value,method:F.value},()=>[e.createVNode(Nt,{"form-items":d.value,columns:p.modalColumns,data:L.value,original:Y.value,method:F.value,"group-layout":p.formGroupLayout,"read-only":ee.value,onItemChange:w[14]||(w[14]=R=>p.$emit("itemChange",R))},null,8,["form-items","columns","data","original","method","group-layout","read-only"])])]),e.createElementVNode("div",null,[e.renderSlot(p.$slots,"entity-form-right",{data:L.value,original:Y.value,method:F.value})])])]),_:3},8,["show"])]),_:3},8,["show","style","title"]),(C=p.batchAdds)!=null&&C.length?(e.openBlock(),e.createBlock(_t,{key:2,show:Xe.value,"onUpdate:show":w[16]||(w[16]=R=>Xe.value=R),draggable:"",config:(_=Me.value)==null?void 0:_.searchConfig,title:($=Me.value)==null?void 0:$.searchTitle,"multi-select":((G=Me.value)==null?void 0:G.singleOne)!=!0,"addition-query":(X=Me.value)==null?void 0:X.additionQuery,onSearchBack:td},null,8,["show","config","title","multi-select","addition-query"])):e.createCommentVNode("",!0),p.importAction?(e.openBlock(),e.createBlock(Ye,{key:3,show:D.value,"onUpdate:show":w[17]||(w[17]=R=>D.value=R),draggable:"",action:p.importAction,"addition-params":Gn.value,timeout:p.importTimeout,"template-code":p.importTemplateCode},{options:e.withCtx(({options:R})=>[e.renderSlot(p.$slots,"import-options",{options:R})]),_:3},8,["show","action","addition-params","timeout","template-code"])):e.createCommentVNode("",!0),p.dataExchangeCode||p.exportAction?(e.openBlock(),e.createBlock(Mt,{key:4,show:ne.value,draggable:"","supported-formats":p.exportFormats,"supported-ranges":p.exportRanges,onClose:w[18]||(w[18]=()=>ne.value=!1),onExport:id,range:$t.value,"template-code":p.importTemplateCode},{options:e.withCtx(()=>[e.renderSlot(p.$slots,"export-options")]),_:3},8,["show","supported-formats","supported-ranges","range","template-code"])):e.createCommentVNode("",!0),p.name?(e.openBlock(),e.createBlock(At,{key:5,"grid-id":p.name,draggable:"","grid-columns":h.value,pageSize:k.value,"onUpdate:pageSize":w[19]||(w[19]=R=>k.value=R),show:W.value,onClose:w[20]||(w[20]=()=>W.value=!1),"onUpdate:config":pd},null,8,["grid-id","grid-columns","pageSize","show"])):e.createCommentVNode("",!0)])}}}),oc={class:"flex-row gap05",style:{"align-items":"center"}},bn=e.defineComponent({__name:"HaloModal",props:{show:{type:Boolean},title:{},submitting:{type:Boolean},hideOkButton:{type:Boolean},width:{default:"600px"}},emits:["submit","update:show"],setup(t){const{t:l}=Z();return(o,n)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{class:"custom-card",show:o.show,preset:"card",style:e.normalizeStyle({width:o.width}),draggable:"",onClose:n[2]||(n[2]=()=>o.$emit("update:show",!1))},{header:e.withCtx(()=>[e.createElementVNode("div",oc,[e.renderSlot(o.$slots,"icon"),e.createElementVNode("div",null,e.toDisplayString(o.title),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[o.hideOkButton?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(u.NButton),{key:0,onClick:n[0]||(n[0]=r=>o.$emit("submit")),style:{"min-width":"100px"},type:"primary",loading:o.submitting},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("OK")),1)]),_:1},8,["loading"])),e.createVNode(e.unref(u.NButton),{onClick:n[1]||(n[1]=()=>o.$emit("update:show",!1)),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["show","style"]))}}),nc={key:0,style:{"text-align":"right"}},kn=e.defineComponent({__name:"HaloSelect",props:{multiple:{type:Boolean},filterable:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},value:{},sourceUrl:{},additionalQuery:{},labelFormatter:{},keyField:{},labelField:{},subLabelField:{},prefix:{},suffix:{},insertBlank:{type:Boolean},autoSelect:{type:Boolean},i18n:{type:Boolean,default:!0}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.inject("axios"),c=e.ref(!1),f=e.ref([]);let g;const i=d=>{(!g||g!=d)&&(g=d,s(d))},s=async d=>{let h=o.sourceUrl;if(h){const b=o.labelFormatter,x=o.keyField,S=o.labelField,P=o.subLabelField,T=o.insertBlank,k=o.additionalQuery;c.value=!0,f.value=[];try{d&&(h=U(h,{searchWords:d})),k&&(h=U(h,k,!0));const N=await a.get(h);if(N.isSuccess&&N.value!=null){let V=N.value;if(!Array.isArray(V)&&"rows"in V&&Array.isArray(V.rows)&&(V=V.rows),Array.isArray(V)){const E=V.filter(O=>O&&!0).map(O=>{if(typeof O=="string")return{value:O,label:b?b(O):r(O)};{let j=O[S||"label"];if(b&&(j=b(j)),o.prefix&&(j=o.prefix+j),o.suffix&&(j=j+o.suffix),o.i18n&&(j=r(j)),P){let z=O[P];typeof z=="string"&&(b&&(z=b(z)),o.i18n&&(z=r(z)),z&&(j+=" "+z))}return{value:O[x||"value"],label:j,data:O}}});T&&E.splice(0,0,{value:"",label:""}),f.value=E,o.autoSelect&&!o.value&&E.length&&n("update:value",E[0].value,E[0],E[0].data)}}}finally{c.value=!1}}},m=(d,h)=>{var x;const b=(x=f.value.find(S=>S.value==d))==null?void 0:x.data;n("update:value",d,h,b)};return e.watch(()=>o.sourceUrl,()=>s()),e.watch(()=>o.additionalQuery,(d,h)=>{JSON.stringify(h)!=JSON.stringify(d)&&s()}),e.onMounted(()=>s()),(d,h)=>(e.openBlock(),e.createBlock(e.unref(u.NSelect),{value:d.value,remote:"",loading:c.value,options:f.value,filterable:d.filterable,multiple:d.multiple,placeholder:"",disabled:d.readonly,clearable:d.clearable,onSearch:i,"onUpdate:value":m},{action:e.withCtx(()=>[d.filterable?(e.openBlock(),e.createElementBlock("div",nc,[e.createVNode(e.unref(u.NText),{depth:"3",italic:""},{default:e.withCtx(()=>[e.createElementVNode("small",null,e.toDisplayString(e.unref(r)("Enter text to filter the result list.")),1)]),_:1})])):e.createCommentVNode("",!0)]),_:1},8,["value","loading","options","filterable","multiple","disabled","clearable"]))}}),lc=e.defineComponent({components:{SearchIcon:un,LeftIcon:Ks,RightIcon:Zs},props:{sourceList:Object,selectedItems:Object,loading:Boolean,placeholder:{type:String,default:"Search"}},emits:["search","update:selectedItems"],setup(t,l){const{t:o}=Z(),n=e.ref(void 0),r=e.ref(c(t.sourceList)),a=e.ref([]);function c(d){return d?d.map(h=>({isSelected:!1,value:h})):[]}function f(){n.value&&l.emit("search",n.value)}function g(){nn(a.value,d=>d.isSelected)>0&&l.emit("update:selectedItems",a.value.map(d=>d.value))}function i(){a.value.forEach(h=>h.isSelected=!1);let d=!1;r.value.forEach(h=>{h.isSelected&&!a.value.some(b=>b.value==h.value)&&(a.value.push({value:h.value,isSelected:!1}),d=!0)}),d&&l.emit("update:selectedItems",a.value.map(h=>h.value))}function s(d){d.forEach(h=>h.isSelected=!0)}function m(d){d.forEach(h=>h.isSelected=!h.isSelected)}return e.watch(()=>t.sourceList,d=>r.value=c(d)),{t:o,searchWords:n,searchMaterials:f,source:r,target:a,moveRight:i,moveLeft:g,selectAll:s,inverseSelect:m}}}),rc={class:"flex-row gap1"},ac={class:"flex-column flex-grow-1 gap25",style:{width:"100px",height:"400px"}},sc={class:"flex-row gap1",style:{"justify-content":"flex-end"}},ic={class:"flex-column gap1",style:{width:"60px","justify-content":"center"}},cc={class:"flex-column flex-grow-1 gap25",style:{width:"100px",height:"400px"}},dc={class:"flex-row gap1",style:{"justify-content":"flex-end"}};function fc(t,l,o,n,r,a){const c=e.resolveComponent("search-icon"),f=e.resolveComponent("n-icon"),g=e.resolveComponent("n-input"),i=e.resolveComponent("n-checkbox"),s=e.resolveComponent("n-scrollbar"),m=e.resolveComponent("n-spin"),d=e.resolveComponent("n-button"),h=e.resolveComponent("right-icon"),b=e.resolveComponent("left-icon");return e.openBlock(),e.createElementBlock("div",rc,[e.createElementVNode("div",ac,[e.createVNode(g,{placeholder:t.placeholder,value:t.searchWords,"onUpdate:value":l[0]||(l[0]=x=>t.searchWords=x),onInput:t.searchMaterials},{suffix:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(c)]),_:1})]),_:1},8,["placeholder","value","onInput"]),e.createVNode(m,{show:t.loading,class:"flex-grow-1 flex-column","content-class":"flex-column flex-grow-1"},{default:e.withCtx(()=>[e.createVNode(s,{class:"flex-grow-1 bordered",style:{height:"50px"},"content-class":"flex-column gap25","content-style":"padding: 4px"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.source,x=>(e.openBlock(),e.createBlock(i,{checked:x.isSelected,"onUpdate:checked":S=>x.isSelected=S,style:{"align-items":"center"}},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"source",{item:x.value,isSelected:x.isSelected},()=>[e.createTextVNode(e.toDisplayString(x.value),1)])]),_:2},1032,["checked","onUpdate:checked"]))),256))]),_:3})]),_:3},8,["show"]),e.createElementVNode("div",sc,[e.createVNode(d,{text:"",onClick:l[1]||(l[1]=()=>t.selectAll(t.source))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Select All")),1)]),_:1}),e.createVNode(d,{text:"",onClick:l[2]||(l[2]=()=>t.inverseSelect(t.source))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Inverse Selection")),1)]),_:1})])]),e.createElementVNode("div",ic,[e.createVNode(d,{onClick:t.moveRight},{default:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(h)]),_:1})]),_:1},8,["onClick"]),e.createVNode(d,{onClick:t.moveLeft},{default:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(b)]),_:1})]),_:1},8,["onClick"])]),e.createElementVNode("div",cc,[e.createVNode(s,{class:"flex-grow-1 bordered","content-class":"flex-column gap25","content-style":"padding: 4px"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.target,x=>(e.openBlock(),e.createBlock(i,{checked:x.isSelected,"onUpdate:checked":S=>x.isSelected=S,style:{"align-items":"center"}},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"target",{item:x.value,isSelected:x.isSelected},()=>[e.createTextVNode(e.toDisplayString(x.value),1)])]),_:2},1032,["checked","onUpdate:checked"]))),256))]),_:3}),e.createElementVNode("div",dc,[e.createVNode(d,{text:"",onClick:l[3]||(l[3]=()=>t.selectAll(t.target))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Select All")),1)]),_:1}),e.createVNode(d,{text:"",onClick:l[4]||(l[4]=()=>t.inverseSelect(t.target))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.t("Inverse Selection")),1)]),_:1})])])])}const Nn=re(lc,[["render",fc]]),xn=re(e.defineComponent({__name:"MainDetailPanel",props:{direction:{default:"vertical"},initialRatio:{default:.618},minSize:{default:100},mainPanelStyle:{},mainPanelClass:{},detailPanelStyle:{},detailPanelClass:{},detailFolded:{type:Boolean,default:!1}},setup(t){const l=t,o=e.ref(l.initialRatio),n=e.ref(!1),r=e.ref(void 0),a=e.computed(()=>l.detailFolded?{[l.direction==="horizontal"?"width":"height"]:"100%",[l.direction==="horizontal"?"height":"width"]:"100%"}:{[l.direction==="horizontal"?"width":"height"]:`${o.value*100}%`,[l.direction==="horizontal"?"height":"width"]:"100%"}),c=e.computed(()=>l.detailFolded?{[l.direction==="horizontal"?"width":"height"]:"100%",[l.direction==="horizontal"?"height":"width"]:"100%"}:{[l.direction==="horizontal"?"width":"height"]:`${(1-o.value)*100}%`,[l.direction==="horizontal"?"height":"width"]:"100%"}),f=s=>{s.preventDefault(),l.detailFolded||(n.value=!0)},g=s=>{if(!n.value||!r.value||l.detailFolded)return;const m=r.value.getBoundingClientRect();let d;l.direction==="horizontal"?d=(s.clientX-m.left)/m.width:d=(s.clientY-m.top)/m.height;const h=l.minSize/(l.direction==="horizontal"?m.width:m.height),b=1-h;o.value=Math.max(h,Math.min(b,d))},i=()=>{n.value=!1};return e.onMounted(()=>{document.addEventListener("mousemove",g),document.addEventListener("mouseup",i)}),e.onUnmounted(()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",i)}),(s,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["main-detail-panel",[s.direction]]),ref_key:"container",ref:r},[e.createElementVNode("div",{class:e.normalizeClass(["panel main-panel",s.mainPanelClass]),style:e.normalizeStyle([[s.mainPanelStyle,a.value],{}])},[e.renderSlot(s.$slots,"main",{},void 0,!0)],6),s.detailFolded?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["divider",{dragging:n.value}]),onMousedown:f},null,34)),s.detailFolded?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["panel detail-panel",s.detailPanelClass]),style:e.normalizeStyle([[s.detailPanelStyle,c.value],{}])},[e.renderSlot(s.$slots,"detail",{},void 0,!0)],6))],2))}}),[["__scopeId","data-v-ca4664e2"]]),Sn=e.defineComponent({__name:"NumberInputModal",props:{title:{},message:{},value:{},show:{type:Boolean}},emits:["update:show","commit"],setup(t,{emit:l}){const o=t,{t:n}=Z(),r=e.ref(o.value);return e.watch(()=>o.value,()=>r.value=o.value),(a,c)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{title:a.title,show:a.show,preset:"card",style:{width:"400px"},draggable:"",onClose:c[3]||(c[3]=()=>a.$emit("update:show",!1))},{action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:c[1]||(c[1]=()=>a.$emit("commit",r.value))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("OK")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:c[2]||(c[2]=()=>a.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NForm),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NGrid),{cols:24,"x-gap":24},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NFormItemGi),{span:24,label:a.message},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInputNumber),{value:r.value,"onUpdate:value":c[0]||(c[0]=f=>r.value=f)},null,8,["value"])]),_:1},8,["label"])]),_:1})]),_:1})]),_:1},8,["title","show"]))}}),uc={class:"flex-column"},In=e.defineComponent({__name:"ObjectTreeView",props:{selectedId:{},rootId:{default:"0"},rootName:{default:"root"},data:{},loadTreeAction:{},moveAction:{},sortAction:{},treeNodeMapper:{},labelRender:{},searchWords:{},iconRender:{},additionKeys:{}},emits:["update:selectedId","update:path"],setup(t,{emit:l}){var H;const o=t,n=l,{t:r}=Z(),a=ie(),c=e.ref(new Array),f=e.ref(void 0),g=(I,y)=>{for(const B of I){if(B.key==y)return[B];if(B.key!=null&&B.key!=null&&B.children&&!B.isLeaf){const A=g(B.children,y);if(A.length)return A.push(B),A}}return[]},i=(I,y)=>{for(let B=0;B<I.length;B++){const A=I[B];if(A.key==y)return{nodes:I,index:B};if(A.children){const D=i(A.children,y);if(D)return D}}return null},s=I=>{const y=g(j.value,I);return y?y.reverse():[]},m=I=>I,d=(I,y=!0)=>{let B=[];if(Array.isArray(I)){const A=(o==null?void 0:o.treeNodeMapper)??m;B=I.map(A)}return y?[{key:o.rootId,label:r(o.rootName),isLeaf:!Array.isArray(B)||B.length==0,children:B}]:B},h=()=>{let I=o.loadTreeAction;I&&(o.additionKeys&&(I=U(I,o.additionKeys)),a.get({url:I,callback:y=>{if(y){const B=d(y);j.value=B,z.value=B.map(A=>A.key)}}}))},b=I=>{const y=j.value;if(y){const B=y.map(A=>A.children?S(A.children):[]);z.value=B.flat()}},x=I=>{const y=j.value;y&&(z.value=y.map(B=>B.key))},S=(I,y)=>{const B=new Array;for(const A of I)if(A.key&&B.push(A.key),A.children){const D=S(A.children);D.length&&B.push(...D)}return B},P=I=>{c.value=I;const y=I.length?I[0]:void 0;n("update:selectedId",y==o.rootId?void 0:y);const B=y?s(y):[];n("update:path",B)},T=I=>e.h("span",null,I.option.label),k=I=>o.iconRender?e.h(u.NIcon,null,{default:()=>{var y;return(y=o.iconRender)==null?void 0:y.call(null,I)}}):I.option.isLeaf?e.h(u.NIcon,null,{default:()=>e.h(cn)}):e.h(u.NIcon,null,{default:()=>e.h(Vt)}),N=I=>{!o.moveAction&&!o.sortAction||(I.dropPosition=="before"||I.dropPosition=="after"?I.dragNode.key&&typeof I.node.key&&E(I.dragNode,I.node,I.dropPosition):I.dropPosition=="inside"&&typeof I.dragNode.key=="number"&&typeof I.node.key=="number"&&V(I.dragNode,I.node))},V=(I,y)=>{const B=o.moveAction;if(!B)return;const A=I.key,D=[I.key],L=y.key;!A||!L||I==y||a.post({url:B,data:{menuItemIds:D,targetId:L},successMessage:"Successful operation.",success:()=>{const F=i(j.value,A);F&&(F.nodes.splice(F.index,1),y.children&&y.children.push(I))}})};async function E(I,y,B){const A=o.sortAction;if(!A)return;const D=I.key;let L=y.key;if(!D||!L||D==L)return;const F=i(j.value,D);if(F){if(B=="after"){const Y=F.nodes.indexOf(y);if(Y>-1&&Y<F.nodes.length-1&&(y=F.nodes[Y+1],L=y.key,!L||D==L))return}a.post({url:A,data:{menuId:D,nextSiblingId:L},successMessage:"Successful operation.",success:()=>{F.nodes.splice(F.index,1);const Y=F.nodes.indexOf(y);Y>-1?F.nodes.splice(Y,0,I):F.nodes.push(I)}})}}const O=I=>{if(I==null&&(I=o.rootId),c.value.includes(I))return;const y=g(j.value,I);y.length&&(z.value=y.map(B=>B.key),c.value=[I])},j=e.ref(d(o.data??[])),z=e.ref(((H=j.value)==null?void 0:H.map(I=>I.key))??[]);return e.watch(()=>o.additionKeys,()=>h()),e.watch(()=>o.loadTreeAction,()=>h()),e.watch(()=>o.data,I=>{I?j.value=d(I):j.value=[]}),e.watch(()=>o.selectedId,I=>{O(I)}),e.onMounted(()=>{h()}),(I,y)=>(e.openBlock(),e.createElementBlock("div",uc,[e.createVNode(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{placeholder:e.unref(r)("Search"),clearable:"",onChange:y[0]||(y[0]=B=>f.value=B)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pn))]),_:1})]),_:1},8,["placeholder"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:h,title:e.unref(r)("Refresh")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(je))]),_:1})]),_:1},8,["title"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:y[1]||(y[1]=()=>b()),title:e.unref(r)("Expand All")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ii))]),_:1})]),_:1},8,["title"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:y[2]||(y[2]=()=>x()),title:e.unref(r)("Collapse All")},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ti))]),_:1})]),_:1},8,["title"])]),_:1}),e.createVNode(e.unref(u.NTree),{class:"flex-grow-1",style:{height:"10px"},"virtual-scroll":"","show-line":"","block-node":"",draggable:I.sortAction!=null||I.moveAction!=null,data:j.value,pattern:f.value,"render-label":T,"render-prefix":k,onDrop:N,"selected-keys":c.value,"default-expanded-keys":z.value,"onUpdate:selectedKeys":P},null,8,["draggable","data","pattern","selected-keys","default-expanded-keys"])]))}}),pc=["src"],Bn=e.defineComponent({__name:"PhotoBox",props:{src:{},fallbackSrc:{}},setup(t){const l=t,n="/img/no_photo.png";let r=!1;function a(c){if(!r){var f=c.target;f instanceof HTMLImageElement&&(r=!0,f.src=l.fallbackSrc??n)}}return e.watch(()=>l.src,()=>{r=!1}),(c,f)=>(e.openBlock(),e.createElementBlock("img",{src:c.src,style:{"border-radius":"0.8em","object-fit":"cover"},onError:a},null,40,pc))}}),mc={class:"flex-column gap05"},hc={key:0},gc={class:"flex-row gap05",style:{"align-items":"center"}},Vn=e.defineComponent({__name:"PrintModal",props:{show:{type:Boolean},title:{default:"Print"},name:{},action:{},additionParams:{},width:{default:"300px"},disabled:{type:Boolean},beforePrint:{}},emits:["update:show"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=ie(),c=e.ref(!1),f=e.ref(s()),g=e.ref(m()),i=[{label:r("Collated (123-123-123)"),value:"Collated"},{label:r("Uncollated (111-222-333)"),value:"Uncollated"}];function s(){if(o.name){const h=Number(localStorage.getItem(`${o.name}:print-copies`));if(h&&h>0)return h}return 1}function m(){if(o.name){const h=localStorage.getItem(`${o.name}:print-collate`);if(h&&(h=="Collated"||h=="Uncollated"))return h}return"Collated"}function d(){if(o.disabled||c.value)return;const h={action:o.action,collate:g.value,copies:f.value,additionParams:o.additionParams};if(o.beforePrint&&o.beforePrint(h)==!1)return;let b=h.action;b&&(b=U(b,[{collate:h.collate,copies:h.copies},h.additionParams]),o.name&&(localStorage.setItem(`${o.name}:print-collate`,g.value),localStorage.setItem(`${o.name}:print-copies`,f.value.toString())),c.value=!1,a.openFile({url:b,loadingStatus:x=>c.value=x,callback:()=>{c.value=!1,n("update:show",!1)}}))}return(h,b)=>(e.openBlock(),e.createBlock(e.unref(u.NModal),{class:"custom-card",show:h.show,preset:"card",style:e.normalizeStyle({width:h.width}),onClose:b[3]||(b[3]=()=>h.$emit("update:show",!1))},{header:e.withCtx(()=>[e.createElementVNode("div",gc,[e.createVNode(e.unref(u.NIcon),{size:"16"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ya))]),_:1}),e.createElementVNode("div",null,e.toDisplayString(e.unref(r)(h.title)),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{onClick:d,style:{"min-width":"100px"},type:"primary",loading:c.value,disable:!h.action||h.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Print")),1)]),_:1},8,["loading","disable"]),e.createVNode(e.unref(u.NButton),{onClick:b[2]||(b[2]=()=>h.$emit("update:show",!1)),style:{"min-width":"100px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.renderSlot(h.$slots,"default"),e.createElementVNode("div",mc,[e.createElementVNode("div",null,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Number of print copies"))+":",1),e.createVNode(e.unref(u.NInputNumber),{value:f.value,"onUpdate:value":b[0]||(b[0]=x=>f.value=x),min:"1"},null,8,["value"])]),f.value>1?(e.openBlock(),e.createElementBlock("div",hc,[e.createElementVNode("span",null,e.toDisplayString(e.unref(r)("Copies print order")),1),e.createVNode(e.unref(u.NSelect),{options:i,value:g.value,"onUpdate:value":b[1]||(b[1]=x=>g.value=x)},null,8,["value"])])):e.createCommentVNode("",!0)])]),_:3},8,["show","style"]))}}),yc={key:0,style:{"text-align":"center"}},wc=["src"],Cc={key:1,style:{"text-align":"center"}},Mn=e.defineComponent({__name:"QrModal",props:{title:{default:"QR Code"},code:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:l}){const o=t,{t:n}=Z(),r=e.computed(()=>`/api/core/QR/Image?code=${encodeURIComponent(o.code||"")}&format=CODE_128&width=200&height=200`);return(a,c)=>{const f=e.resolveComponent("n-text");return e.openBlock(),e.createBlock(e.unref(u.NModal),{show:a.show,"onUpdate:show":c[1]||(c[1]=g=>a.$emit("update:show",g)),preset:"card",title:e.unref(n)(a.title),style:{"max-width":"350px"}},{default:e.withCtx(()=>[a.code?(e.openBlock(),e.createElementBlock("div",yc,[e.createElementVNode("img",{src:r.value},null,8,wc),e.createVNode(e.unref(u.NH3),{style:{margin:"1em"}},{default:e.withCtx(()=>[e.createVNode(f,{class:"text-monospace"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.code),1)]),_:1})]),_:1}),e.createVNode(e.unref(u.NButton),{onClick:c[0]||(c[0]=()=>a.$emit("update:show",!1)),type:"primary",style:{width:"200px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("Close")),1)]),_:1})])):(e.openBlock(),e.createElementBlock("div",Cc,[e.createVNode(e.unref(u.NEmpty))]))]),_:1},8,["show","title"])}}}),bc={class:"flex-row",style:{"align-items":"center"}},kc={style:{"margin-left":"0.5em"}},Tn=e.defineComponent({__name:"SearchCard",props:{title:{default:"Search"},config:{},multiSelect:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},searchOnMounted:{type:Boolean},additionQuery:{}},emits:["searchBack"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref([]),c=(i,s)=>{a.value=s??[]},f=()=>{a&&n("searchBack",a.value,o.config)},g=i=>{i&&i.length&&n("searchBack",i,o.config)};return(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NCard),{class:"flex-grow-1","content-class":"flex-column"},{header:e.withCtx(()=>[e.createElementVNode("div",bc,[e.createVNode(e.unref(u.NIcon),{color:"#3F51B5",size:"20"},{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1}),e.createElementVNode("span",kc,e.toDisplayString(e.unref(r)(i.title)),1)])]),action:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px"},disabled:a.value.length==0,onClick:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1},8,["disabled"])]),default:e.withCtx(()=>[e.createVNode(Ze,{class:"flex-grow-1",config:i.config,"multi-select":i.multiSelect,"auto-close":i.autoClose,"addition-query":i.additionQuery,onResultSelected:c,onSearchBack:g},null,8,["config","multi-select","auto-close","addition-query"])]),_:1}))}});class Nc{constructor(){J(this,"rows",Array());J(this,"totalRecords",null);J(this,"pageIndex",0);J(this,"pageSize",10);J(this,"pageCount",null);J(this,"noTotal",!1);J(this,"message",null);J(this,"summary",null);J(this,"currentPageRecords",0);J(this,"meta")}}const xc={class:"flex-grow-1 flex-column"},Sc={class:"icon-container"},Ic=["title"],Qe="browse_icon_directory",An="page_index",En="search_words",_n=32,zt=re(e.defineComponent({__name:"SelectIconBox",emits:["update:selected"],setup(t,{emit:l}){const o=l,{t:n}=Z(),r=ie(),a=e.ref(sessionStorage.getItem(Qe)),c=e.ref(d(void 0)),f=e.ref([]),g=e.ref(1),i=e.ref(0),s=e.ref(!1),m=e.ref(sessionStorage.getItem(En));function d(T){const k=[{name:n("Root"),path:"/"}];if(T){for(;T.startsWith("/")||T.startsWith("\\");)T=T.substring(1);const N=T.split(/[\\/]+/);let V="/";for(const E of N){V+=E;const O={name:E,path:V};k.push(O),V+="/"}}return k}function h(T){T.isDirectory?a.value=T.path:T.path&&o("update:selected",T.path)}function b(){S(0)}function x(T){S(T-1)}function S(T){T=Math.max(0,T);let k=`/api/core/SystemIcons/page?pageSize=${_n}&pageIndex=${T}`;var N=m.value;N&&(k+=`&searchWords=${encodeURIComponent(N)}`);const V=a.value;V&&(k+=`&directory=${encodeURIComponent(V)}`),r.get({url:k,callback:E=>{E&&(f.value=E.rows,i.value=E.totalRecords,g.value=E.pageIndex+1,P(E.pageIndex,V,N))},loadingStatus:E=>s.value=E})}function P(T,k,N){sessionStorage.setItem(An,T.toString()),k?sessionStorage.setItem(Qe,k):sessionStorage.removeItem(Qe),N?sessionStorage.setItem(En,N):sessionStorage.removeItem(Qe)}return e.watch(a,T=>{c.value=d(T),S(0)}),e.onMounted(()=>{c.value=d(a.value);let T=Number(sessionStorage.getItem(An));S(T||0)}),(T,k)=>(e.openBlock(),e.createElementBlock("div",xc,[e.createElementVNode("div",null,[e.createVNode(e.unref(u.NBreadcrumb),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,N=>(e.openBlock(),e.createBlock(e.unref(u.NBreadcrumbItem),{key:N.path},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{text:"",onClick:()=>a.value=N.path,title:N.path},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Fo))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(N.name)+" ",1)]),_:2},1032,["onClick","title"])]),_:2},1024))),128))]),_:1})]),e.createVNode(e.unref(u.NCard),{class:"flex-grow-1","content-class":"flex-column"},{header:e.withCtx(()=>[e.createVNode(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInput),{style:{width:"250px"},placeholder:e.unref(n)("Quick Search"),clearable:"",onChange:b,value:m.value,"onUpdate:value":k[0]||(k[0]=N=>m.value=N)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),_:1},8,["placeholder","value"]),e.createVNode(e.unref(u.NButton),{title:e.unref(n)("Search"),onClick:b,style:{padding:"0 8px"}},{icon:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pe))]),_:1})]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(n)("Search")),1)]),_:1},8,["title"])]),_:1})]),footer:e.withCtx(()=>[e.createVNode(e.unref(u.NPagination),{page:g.value,"onUpdate:page":[k[1]||(k[1]=N=>g.value=N),x],"item-count":i.value??0,"page-size":_n},{suffix:e.withCtx(({startIndex:N,endIndex:V,itemCount:E})=>[E?(e.openBlock(),e.createBlock(e.unref(u.NText),{key:0,italic:"",depth:"3"},{default:e.withCtx(()=>[e.createTextVNode("["+e.toDisplayString(N+1)+"~"+e.toDisplayString(V+1)+"] / "+e.toDisplayString(E),1)]),_:2},1024)):e.createCommentVNode("",!0)]),_:1},8,["page","item-count"])]),default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpin),{show:s.value,class:"flex-grow-1 flex-column","content-class":"flex-grow-1 flex-column"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NScrollbar),{"x-scrollable":"",class:"flex-grow-1",style:{"min-height":"100%","min-width":"100%",overflow:"auto",height:"1px",width:"1px"}},{default:e.withCtx(()=>[e.createElementVNode("div",Sc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,N=>(e.openBlock(),e.createBlock(e.unref(u.NButton),{quaternary:"",class:"icon-button",onClick:()=>h(N)},{default:e.withCtx(()=>[e.createElementVNode("div",{style:{overflow:"hidden"},title:N.name},[e.createElementVNode("div",null,[N.isDirectory?(e.openBlock(),e.createBlock(e.unref(u.NIcon),{key:0,size:"48",color:"#FFCA28"},{default:e.withCtx(()=>[e.createVNode(e.unref(Fo))]),_:1})):(e.openBlock(),e.createBlock(e.unref(u.NImage),{key:1,width:"48",height:"48","preview-disabled":"",src:"/api/core/SystemIcons/Icons?path="+N.path},null,8,["src"]))]),e.createElementVNode("div",null,e.toDisplayString(N.name),1)],8,Ic)]),_:2},1032,["onClick"]))),256))])]),_:1})]),_:1},8,["show"])]),_:1})]))}}),[["__scopeId","data-v-ff87aac6"]]),Ln=e.defineComponent({__name:"SelectObjectModal",props:{show:{type:Boolean},title:{default:"Select Object"},items:{},getListAction:{},width:{default:300},keyName:{default:"id"},selectedValue:{},message:{},description:{}},emits:["update:show","valueSelected"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=u.useMessage(),c=e.inject("axios"),f=e.ref(s(o.items)),g=e.ref(!1),i=e.ref(o.selectedValue);function s(h){if(h){if(!h.length||typeof h[0]=="object")return h}else return[];const b=[];for(let x of h)typeof x=="string"||typeof x=="number"?b.push({id:x.toString(),code:r(x.toString())}):b.push(x);return b}async function m(){var b;if(g.value)return;const h=o.getListAction;if(!h){f.value=[];return}try{g.value=!0;const x=await c.get(h);x.isSuccess&&x.value!=null?Array.isArray(x.value)?f.value=x.value:Array.isArray((b=x.value)==null?void 0:b.rows)?f.value=x.value.rows:f.value=[]:a.error(r(x.errorMessage||"Error"))}catch(x){console.log(x),a.error((x==null?void 0:x.toString())||r("Error"))}finally{g.value=!1}}function d(){i.value&&n("valueSelected",i.value)}return e.onMounted(()=>{o.getListAction&&m()}),e.watch(()=>o.getListAction,()=>{m()}),(h,b)=>(e.openBlock(),e.createBlock(e.unref(u.NSpin),{show:g.value},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NModal),{show:h.show,style:e.normalizeStyle({width:h.width+"px",minWidth:"100px"}),preset:"card",title:e.unref(r)(h.title),onClose:b[2]||(b[2]=()=>h.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:"",align:"stretch"},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"header"),e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)),1)]),_:1}),e.createVNode(e.unref(u.NRadioGroup),{value:i.value,"onUpdate:value":b[0]||(b[0]=x=>i.value=x),name:"valueList",style:{display:"block"}},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NSpace),{vertical:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,x=>(e.openBlock(),e.createBlock(e.unref(u.NRadio),{key:x[h.keyName],value:x[h.keyName]},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"default",{data:x},()=>[e.createTextVNode(e.toDisplayString(x.code)+" "+e.toDisplayString(x.name),1)])]),_:2},1032,["value"]))),128))]),_:3})]),_:3},8,["value"]),e.createVNode(e.unref(u.NText),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.description),1)]),_:1}),e.renderSlot(h.$slots,"bottom"),e.createVNode(e.unref(u.NSpace),{justify:"space-between"},{default:e.withCtx(()=>[e.createVNode(e.unref(u.NButton),{type:"primary",style:{"min-width":"100px","margin-right":"1rem"},onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("OK")),1)]),_:1}),e.createVNode(e.unref(u.NButton),{style:{"min-width":"100px"},onClick:b[1]||(b[1]=()=>h.$emit("update:show",!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("Cancel")),1)]),_:1})]),_:1})]),_:3})]),_:3},8,["show","style","title"])]),_:3},8,["show"]))}});function zn(t,l){for(let o of t){if(o.guid==l)return o;if(Array.isArray(o.items)){const n=zn(o.items,l);if(n)return n}}}const Dt=()=>{const t={};function l(n,r,a){return!!(r&&r.includes(a)||n.title&&n.title.includes(a)||n.url&&n.url.includes(a))}function o(n,r,a,c){var g;const f=new Array;if(r){let i=0,s=!1;for(const m of r)if(m.isEnabled!==!1)if(m.isSeparator)s||(f.push({type:"divider",key:`_${a}_${i++}`}),s=!0);else{const d=n(m.title),h={key:m.guid,id:m.guid,label:d,disabled:!m.isEnabled,href:m.url,tabBehavior:m.tabBehavior};if(m.items&&m.items.length)h.children=o(n,m.items,m.guid,c);else if(c&&!l(m,d,c))continue;m.guid&&m.icon&&(t[m.guid]={icon:m.icon,color:m.color}),((g=h.children)!=null&&g.length||h.href)&&f.push(h),s=!1}}return f.every(i=>i.type=="divider")?[]:f}return{menuLooks:t,systemMenuToNaiveMenu:o}},Dn=e.defineComponent({__name:"SideMenu",props:{collapsed:{type:Boolean},currentMenuId:{}},setup(t){const{t:l}=Z(),o=e.inject("axios"),n=Se(),r=/^https?:\/\//i,a=e.ref([]),c=e.ref(void 0),f=Dt(),g=e.computed(()=>f.systemMenuToNaiveMenu(l,n.menus,void 0,c.value)),i=e.computed(()=>n.isLoadingMenu);function s(h){if(typeof h.href=="string"&&h.href&&!h.children){let b=h.href.startsWith("~")?h.href.substring(1):h.href;h.id&&(b=U(b,{_menuid:h.id}));let x;return h.tabBehavior=="NewTab"?x="_blank":h.tabBehavior=="NamedTab"&&(x=h.id),r.test(b)?e.h("a",{href:b,target:"_blank"},{default:()=>h.label}):e.h(ce.RouterLink,{to:b,target:x},{default:()=>h.label})}else return typeof h.label=="string"?h.label:""}function m(h){var b,x,S;if(h.key){const P=(b=f.menuLooks[h.key])==null?void 0:b.icon;if(P)return e.h(xe,{path:P,class:"menu-icon"});if((x=h.children)!=null&&x.length){const T=(S=h.key)==null?void 0:S.toString();return T&&a.value.includes(T)?e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(fi)}):e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(Vt)})}else return e.h(u.NIcon,{class:"menu-icon"},{default:()=>e.h(cn)})}}function d(h){if(h)try{o.post(`/api/core/UserRecentMenus/add?menuId=${encodeURIComponent(h)}`)}catch(b){console.error(b)}}return e.onMounted(()=>{!n.menus&&!n.isLoadingMenu&&n.sessionToken&&n.loadMenus()}),e.watch(()=>n.sessionToken,()=>n.loadMenus()),(h,b)=>{const x=e.resolveComponent("n-scrollbar"),S=e.resolveComponent("n-input");return e.openBlock(),e.createBlock(e.unref(u.NSpin),{show:i.value,class:"h-100 menu-spin","content-class":"flex-column h-100"},{default:e.withCtx(()=>[e.createVNode(x,null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NMenu),{collapsed:h.collapsed,"collapsed-width":64,"collapsed-icon-size":22,options:g.value,"root-indent":16,indent:16,"render-label":s,"render-icon":m,value:h.currentMenuId,accordion:!0,"onUpdate:expandedKeys":b[0]||(b[0]=P=>a.value=P),"onUpdate:value":d},null,8,["collapsed","options","value"])]),_:1}),e.withDirectives(e.createVNode(S,{style:{width:"250px"},placeholder:e.unref(l)("Search Menu"),clearable:"",onChange:b[1]||(b[1]=P=>c.value=P)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(u.NIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(pn))]),_:1})]),_:1},8,["placeholder"]),[[e.vShow,!h.collapsed]])]),_:1},8,["show"])}}}),Bc=["src"],$n=e.defineComponent({__name:"SystemIconInput",props:{value:{},label:{},placeholder:{},readonly:{type:Boolean},clearable:{type:Boolean,default:!0}},emits:["update:value"],setup(t,{emit:l}){const o=t,n=l,{t:r}=Z(),a=e.ref(!1),c=e.ref(void 0);function f(){a.value=!a.value}function g(i){i!=null&&!o.readonly&&(n("update:value",i),a.value=!1)}return e.watch(()=>o.value,i=>{i?c.value=`/api/core/SystemIcons/Icons?path=${encodeURIComponent(i)}`:c.value=void 0}),(i,s)=>(e.openBlock(),e.createBlock(e.unref(u.NInputGroup),null,{default:e.withCtx(()=>[e.createVNode(e.unref(u.NInputGroupLabel),{style:{display:"flex","justify-content":"center","align-items":"center",width:"40px"}},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:c.value,style:{height:"16px",width:"16px","align-self":"center"}},null,8,Bc)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.unref(u.NInput),{readonly:i.readonly,value:i.value,placeholder:i.placeholder,"onUpdate:value":s[0]||(s[0]=m=>i.$emit("update:value",m)),clearable:i.clearable},null,8,["readonly","value","placeholder","clearable"]),e.createVNode(e.unref(u.NButton),{ghost:"",onClick:f,disabled:i.readonly},{default:e.withCtx(()=>s[4]||(s[4]=[e.createTextVNode(" … ",-1)])),_:1,__:[4]},8,["disabled"]),e.createVNode(e.unref(u.NModal),{show:a.value,"onUpdate:show":s[2]||(s[2]=m=>a.value=m),title:e.unref(r)("Select Icon"),onClose:s[3]||(s[3]=()=>a.value=!1),preset:"card",style:{width:"730px",height:"600px"},"content-style":"display: flex; flex-direction: column;"},{default:e.withCtx(()=>[e.createVNode(zt,{"onUpdate:selected":s[1]||(s[1]=m=>g(m))})]),_:1},8,["show","title"])]),_:1}))}}),Vc=e.defineComponent({components:{NButton:u.NButton,NIcon:u.NIcon},props:{title:String,iconColor:String,icon:Object},setup(){const{t}=Z();return{t}}});function Mc(t,l,o,n,r,a){const c=e.resolveComponent("n-icon"),f=e.resolveComponent("n-button");return e.openBlock(),e.createBlock(f,null,e.createSlots({default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(t.title?t.t(t.title):""),1)]),_:2},[t.icon?{name:"icon",fn:e.withCtx(()=>[e.createVNode(c,{color:t.iconColor},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.icon),1)]),_:1},8,["color"])]),key:"0"}:void 0]),1024)}const Rn=re(Vc,[["render",Mc]]),Tc=e.defineComponent({name:"TopMenu",components:{NMenu:u.NMenu,NSpin:u.NSpin},setup(){const{t}=Z(),l=e.inject("axios"),o=Se(),n=/^https?:\/\//i,r=Dt(),a=e.computed(()=>r.systemMenuToNaiveMenu(t,o.menus)),c=e.computed(()=>o.isLoadingMenu);function f(s){if(typeof s.href=="string"&&s.href&&!s.children){let m=s.href.startsWith("~")?s.href.substr(1):s.href;s.id&&(m=U(m,{_menuid:s.id}));let d;return s.tabBehavior=="NewTab"?d="_blank":s.tabBehavior=="NamedTab"&&(d=s.id),n.test(m)?e.h("a",{href:m,target:"_blank"},{default:()=>s.label}):e.h(ce.RouterLink,{to:m,target:d},{default:()=>s.label})}else return s.label}function g(s){var m,d;if(s.key){const h=(m=r.menuLooks[s.key])==null?void 0:m.icon;return h?e.h(xe,{path:h,class:"menu-icon"}):(d=s.children)!=null&&d.length?void 0:e.h("div",{class:"menu-icon-blank"},[])}}function i(s){if(s)try{l.post(`/api/core/UserRecentMenus/add?menuId=${encodeURIComponent(s)}`)}catch(m){console.error(m)}}return e.onMounted(()=>{!o.menus&&!o.isLoadingMenu&&o.sessionToken&&o.loadMenus()}),e.watch(()=>o.sessionToken,()=>o.loadMenus()),{menuOptions:a,isLoadingMenu:c,renderMenuLabel:f,renderMenuIcon:g,onMenuSelected:i}}});function Ac(t,l,o,n,r,a){const c=e.resolveComponent("n-menu"),f=e.resolveComponent("n-spin");return e.openBlock(),e.createBlock(f,{show:t.isLoadingMenu},{default:e.withCtx(()=>[e.createVNode(c,{mode:"horizontal",options:t.menuOptions,"render-label":t.renderMenuLabel,"render-icon":t.renderMenuIcon,"onUpdate:value":t.onMenuSelected},null,8,["options","render-label","render-icon","onUpdate:value"])]),_:1},8,["show"])}const On=re(Tc,[["render",Ac]]),Ec=e.defineComponent({name:"TreeView",emits:["update:selectedId","update:path"],props:{selectedId:[Number,String],path:Array,rootId:{type:[Number,String],default:""},rootName:{type:String,default:"Root"},parentKey:{type:String,default:"parentId"},childrenAction:String,moveAction:String,sortAction:String,treeNodeMapper:Function,labelRender:Function},setup(t,l){const o=u.useMessage(),n=e.inject("axios"),{t:r}=Z(),a=e.ref(new Array),c=e.ref(new Array),f=e.ref(new Array);function g(z,H){for(const I of z){if(I.key==H)return{node:I,path:[I.key]};if(I.key!=null&&I.key!=null&&I.children&&!I.isLeaf){const y=g(I.children,H);if(y)return{node:y,path:[I.key,...y.path]}}}return null}function i(z,H){for(let I=0;I<z.length;I++){const y=z[I];if(y.key==H)return{nodes:z,index:I};if(y.children){const B=i(y.children,H);if(B)return B}}return null}function s(z){const H=g(a.value,z);return H?H.path:[]}function m(z,H){const I=new Array;for(const y of z)if(y.key&&(!H||H(y.key))&&I.push(y.key),y.children){const B=m(y.children,H);B.length&&I.push(...B)}return I}function d(z){c.value=z}function h(z){f.value=z;const H=z.length?z[0]:null;l.emit("update:selectedId",H);const I=H?s(H):[];l.emit("update:path",I)}function b(z){return t.treeNodeMapper?t.treeNodeMapper.call(void 0,z):{key:z.id,label:z.title,isLeaf:!z.hasSubitems}}async function x(z){const H=t.childrenAction,I=t.parentKey;if(!(!H||!I))try{const y=U(H,{parentKey:I,parentId:z}),B=await n.get(y);if(B.isSuccess&&B.value!=null)return B.value.map(b);o.error(r(B.errorMessage||"Error"))}catch(y){console.log(y),o.error((y==null?void 0:y.toString())||r("Error"))}}async function S(){a.value=[{key:t.rootId,label:r(t.rootName||"Root"),isLeaf:!1,children:await x(null)}],t.selectedId==null?f.value=[t.rootId]:t.selectedId?f.value=[t.selectedId]:f.value=[],c.value=[t.rootId]}async function P(z){const H=z.key;if(H!=null){if(z.children){const y=c.value,B=m(z.children,A=>y.includes(A));c.value=c.value.filter(A=>!B.includes(A))}const I=await x(H);I&&(z.isLeaf=!I.length,z.children=I.length?I:void 0)}}function T(z){return e.h("span",null,z.option.label)}function k(z){if(!z.option.isLeaf)return e.h(u.NIcon,null,{default:()=>e.h(Vt)})}function N(z){const H=z.option.key;if(H!=null&&f.value.includes(H))return e.h(u.NButton,{text:!0,onClick:I=>{I.stopPropagation(),P(z.option)}},{default:()=>e.h(u.NIcon,null,{default:()=>e.h(je)})})}function V(z){!t.moveAction&&!t.sortAction||(z.dropPosition=="before"||z.dropPosition=="after"?z.dragNode.key&&typeof z.node.key&&O(z.dragNode,z.node,z.dropPosition):z.dropPosition=="inside"&&typeof z.dragNode.key=="number"&&typeof z.node.key=="number"&&E(z.dragNode,z.node))}async function E(z,H){const I=t.moveAction;if(!I)return;const y=z.key,B=[z.key],A=H.key;if(!(!y||!A||z==H))try{const D=await n.post(I,{menuItemIds:B,targetId:A});if(D.isSuccess){o.success(r("Successful operation."));const L=i(a.value,y);L&&(L.nodes.splice(L.index,1),H.children?H.children.push(z):P(H))}else o.error(r(D.errorMessage||"Error"))}catch(D){console.log(D),o.error((D==null?void 0:D.toString())||"Error")}}async function O(z,H,I){const y=t.sortAction;if(!y)return;console.log(`dragNode: ${z.key} ${z.label}, targetNode: ${H.key} ${H.label}, dropPosition: ${I}`);const B=z.key;let A=H.key;if(!B||!A||B==A)return;const D=i(a.value,B);if(D){if(I=="after"){const L=D.nodes.indexOf(H);if(L>-1&&L<D.nodes.length-1&&(H=D.nodes[L+1],A=H.key,!A||B==A))return}try{const L=await n.post(y,{menuId:B,nextSiblingId:A});if(L.isSuccess){o.success(r("Successful operation.")),D.nodes.splice(D.index,1);const F=D.nodes.indexOf(H);F>-1?D.nodes.splice(F,0,z):D.nodes.push(z)}else o.error(r(L.errorMessage||"Error"))}catch(L){console.log(L),o.error((L==null?void 0:L.toString())||"Error")}}}async function j(z){var H;if(z.length){let I=(H=a.value)==null?void 0:H.find(D=>D.key==z[0]);I==null&&(I={key:z[0],label:r(t.rootName||"Root"),isLeaf:!1},a.value.push(I));let y=z[0],B=I;for(let D=1;D<z.length-1&&B;D++)if(B.children||(B.children=await x(y)),B.children){const L=z[D];B=B.children.find(F=>F.key==L),y=L}const A=c.value;for(let D=0;D<z.length-1;D++)A.includes(z[D])||A.push(z[D]);c.value=A,f.value=[z[z.length-1]]}}return e.onMounted(()=>{S()}),e.watch(()=>t.childrenAction,()=>{S()}),e.watch(()=>t.path,z=>{z&&j(z)}),{data:a,expandedKeys:c,expandedKeysChanged:d,loadChildren:P,dragDrop:V,renderLabel:T,renderPrefix:k,renderSuffix:N,selectedKeys:f,selectedKeysChanged:h}}});function _c(t,l,o,n,r,a){const c=e.resolveComponent("n-tree");return e.openBlock(),e.createBlock(c,{"block-line":"",remote:t.childrenAction!=null,draggable:t.sortAction!=null||t.moveAction!=null,data:t.data,"render-label":t.renderLabel,"render-prefix":t.renderPrefix,"render-suffix":t.renderSuffix,onLoad:t.loadChildren,onDrop:t.dragDrop,"expanded-keys":t.expandedKeys,"onUpdate:expandedKeys":t.expandedKeysChanged,"selected-keys":t.selectedKeys,"onUpdate:selectedKeys":t.selectedKeysChanged},null,8,["remote","draggable","data","render-label","render-prefix","render-suffix","onLoad","onDrop","expanded-keys","onUpdate:expandedKeys","selected-keys","onUpdate:selectedKeys"])}const jn=re(Ec,[["render",_c]]),Lc=e.defineComponent({components:{ChangePassword:ut,NotificationIcon:ja},setup(){var d;const t=ce.useRouter(),{t:l}=Z(),o=u.useDialog(),n=Ne(),r=Se(),a=nt(),c=e.computed(()=>r.userInfo),f=e.ref(!1),g="/img/user_avatar.png";function i(){o.warning({title:l("Logout"),content:l("Are you sure log out?"),positiveText:l("OK"),negativeText:l("Cancel"),onPositiveClick:()=>{r.logout(),a.clearTabs(),t.push({path:"/login"})}})}function s(h){switch(h){case"preferences":t.push({path:"/core/preferences"});break;case"change_password":f.value=!0;break;case"logout":i();break;case"toggle_theme":n.toggleTheme();break}}const m=[{label:(d=c.value)==null?void 0:d.userName,type:"group",key:"user_group",children:[{label:l("Preferences"),key:"preferences",icon(){return e.h(u.NIcon,null,{default:()=>e.h(_a)})}},{label:l("Change Password"),key:"change_password",icon(){return e.h(u.NIcon,null,{default:()=>e.h(Fa)})}}]},{label:l("Toggle Theme"),key:"toggle_theme",icon(){return e.h(u.NIcon,null,{default:()=>e.h(ga)})}},{type:"divider"},{label:l("Logout"),key:"logout",icon(){return e.h(u.NIcon,null,{default:()=>e.h(Aa)})}}];return{userInfo:c,options:m,onMenuSelected:s,changePwdBoxShow:f,defaultAvatarPath:g}}}),zc={style:{margin:"0 20px 10px 0",cursor:"pointer"}},Dc={class:"user-name-box"},$c={class:"user-name-label"};function Rc(t,l,o,n,r,a){const c=e.resolveComponent("n-avatar"),f=e.resolveComponent("n-dropdown"),g=e.resolveComponent("change-password"),i=e.resolveComponent("n-space");return e.openBlock(),e.createBlock(i,{style:{"align-items":"center"}},{default:e.withCtx(()=>[e.createVNode(f,{trigger:"click",options:t.options,placement:"bottom-end",onSelect:t.onMenuSelected,size:"medium"},{default:e.withCtx(()=>{var s,m,d;return[e.createElementVNode("div",zc,[e.createVNode(c,{round:"",size:"medium",title:(s=t.userInfo)==null?void 0:s.userName,src:`/api/core/avatar?id=${(m=t.userInfo)==null?void 0:m.avatar}`,"fallback-src":t.defaultAvatarPath,bordered:"",style:{position:"absolute","z-index":"10"}},null,8,["title","src","fallback-src"]),e.createElementVNode("div",Dc,[e.createElementVNode("div",$c,e.toDisplayString((d=t.userInfo)==null?void 0:d.name),1)])])]}),_:1},8,["options","onSelect"]),e.createVNode(g,{show:t.changePwdBoxShow,onClose:l[0]||(l[0]=()=>t.changePwdBoxShow=!1)},null,8,["show"])]),_:1})}const Pn=re(Lc,[["render",Rc],["__scopeId","data-v-0d4b7b61"]]),Oc={class:"flex-row"},jc={class:"app-tab-label"},Pc={style:{"margin-left":"4px"}},Fn=e.defineComponent({__name:"TabMenu",props:{type:{default:"card"}},setup(t){const l=ce.useRouter(),o=Se(),n=e.computed(()=>o.menus),r=e.ref(void 0);l.afterEach(f=>{!f.path||f.path=="/"||f.name=="blank"||(r.value=a(f.path))});function a(f){var i;const g=(i=o.menus)==null?void 0:i.find(s=>{var m;return((m=s.url)==null?void 0:m.toLowerCase())==f.toLowerCase()});if(g)return g.guid}function c(f){var g;if(f){const i=(g=o.menus)==null?void 0:g.find(s=>s.guid==f);i&&i.url&&(l.push(i.url),r.value=i.guid)}}return e.watch(()=>o.sessionToken,()=>o.loadMenus()),e.onMounted(()=>{!o.menus&&!o.isLoadingMenu&&o.sessionToken&&o.loadMenus()}),(f,g)=>n.value&&n.value.length?(e.openBlock(),e.createBlock(e.unref(u.NTabs),{key:0,class:"app-tabs",type:f.type,"justify-content":"space-evenly",animated:"","tab-class":"tab-item","tabs-padding":8,value:r.value,"onUpdate:value":c},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,i=>(e.openBlock(),e.createBlock(e.unref(u.NTab),{key:i.guid,name:i.guid},{default:e.withCtx(()=>[e.createElementVNode("div",Oc,[e.createElementVNode("div",null,[i.icon?(e.openBlock(),e.createBlock(xe,{key:0,path:i.icon},null,8,["path"])):(e.openBlock(),e.createBlock(e.unref(u.NIcon),{key:1},{default:e.withCtx(()=>[e.createVNode(e.unref(pi))]),_:1}))]),e.createElementVNode("div",jc,[e.createElementVNode("span",Pc,e.toDisplayString(i.title),1)])])]),_:2},1032,["name"]))),128))]),_:1},8,["type","value"])):e.createCommentVNode("",!0)}});class Fc{constructor(){J(this,"token");J(this,"userId");J(this,"startupTime")}}class Hc{constructor(){J(this,"guid","");J(this,"title","");J(this,"icon");J(this,"color");J(this,"url");J(this,"isSeparator",!1);J(this,"isEnabled",!0);J(this,"groupName");J(this,"description");J(this,"items");J(this,"tabBehavior");J(this,"closable")}}const Gc=Ae.defineStore("fontSize",()=>{const t={small:"14px",medium:"16px",large:"20px"},l="medium",o=()=>{var c;const a=(c=localStorage.getItem("fontSizeMode"))==null?void 0:c.toString();return a&&t[a]?a:l},n=e.ref(o());return{fontSizeMode:n,fontSizeOptions:t,setFontSize:a=>{t[a]&&(n.value=a,localStorage.setItem("fontSizeMode",a))},getFontSize:()=>t[n.value??l]}}),Kc=Ae.defineStore("userConfig",()=>{const t=e.reactive({}),l=e.computed(()=>s=>t[s]),o=e.computed(()=>({...t}));function n(s,m){t[s]=m,g()}function r(s){Object.assign(t,s),g()}function a(s,m=null){return t[s]!==void 0?t[s]:m}function c(s){delete t[s],g()}function f(){Object.keys(t).forEach(s=>delete t[s]),localStorage.removeItem("user_config")}function g(){try{localStorage.setItem("user_config",JSON.stringify(t))}catch(s){console.error("保存配置失败:",s)}}function i(){try{const s=localStorage.getItem("user_config");if(s){const m=JSON.parse(s);Object.assign(t,m)}}catch(s){console.error("加载配置失败:",s)}}return{config:t,getConfig:l,getAllConfig:o,setConfig:n,setMultipleConfig:r,getConfigValue:a,removeConfig:c,clearAllConfig:f,loadFromLocalStorage:i}}),Wc={AppLogoBox:qt,AppTabs:Go,AutoScrollView:Ko,BarcodeImage:Zo,ChangePassword:ut,ColorInput:pt,DefaultPropertyForm:Nt,DetailPage:rn,ExportModal:Mt,EmptyDetailView:mn,FormInput:Ve,FullscreenSwitch:hn,GridConfigModal:At,HaloButtonSelect:yn,HaloDatePicker:Fe,HaloForm:Cn,HaloGrid:We,HaloModal:bn,HaloModalInput:kt,HaloSelect:kn,HaloTagsInput:Ct,HaloTimePicker:gt,HaloTransfer:Nn,ImportModal:Ye,InputModal:Lt,ListInputModal:bt,MainDetailPanel:xn,MenuIcon:xe,NullableBooleanInput:yt,NumberInputModal:Sn,ObjectTreeView:In,PhotoBox:Bn,PrintModal:Vn,PropertyGrid:xt,QrModal:Mn,SearchCard:Tn,SearchForm:Ke,SearchModal:_t,SearchPanel:Ze,SelectIconBox:zt,SelectObjectModal:Ln,SideMenu:Dn,SystemIconInput:$n,TagsView:Et,ToolButton:Rn,TopMenu:On,TreeView:jn,UserMenu:Pn,TabMenu:Fn},Zc={install(t,l){const o={...Ho,...l};for(const[n,r]of Object.entries(Wc))t.component(n,r);l!=null&&l.langCode&&t.use(Jt,l==null?void 0:l.langCode,!0),t.provide("axios",le),t.provide(dt,o)}};M.axios=le,M.AppLogoBox=qt,M.AppTabs=Go,M.AutoScrollView=Ko,M.BarcodeImage=Zo,M.ChangePassword=ut,M.ColorInput=pt,M.DataPage=Nc,M.DateFormat=ge,M.DateTimeFormat=_e,M.DefaultPropertyForm=Nt,M.DetailPage=rn,M.EmptyDetailView=mn,M.ExportModal=Mt,M.FormInput=Ve,M.FullscreenSwitch=hn,M.GridConfigModal=At,M.HaloButtonSelect=yn,M.HaloDatePicker=Fe,M.HaloForm=Cn,M.HaloGrid=We,M.HaloModal=bn,M.HaloModalInput=kt,M.HaloSelect=kn,M.HaloTagsInput=Ct,M.HaloTimePicker=gt,M.HaloTransfer=Nn,M.HalovConfigKey=dt,M.I18nPlugin=Jt,M.ImportModal=Ye,M.InputModal=Lt,M.ListInputModal=bt,M.MainDetailPanel=xn,M.MenuIcon=xe,M.NullableBooleanInput=yt,M.NumberInputModal=Sn,M.ObjectTreeView=In,M.PhotoBox=Bn,M.PrintModal=Vn,M.PropertyGrid=xt,M.QrModal=Mn,M.SearchCard=Tn,M.SearchForm=Ke,M.SearchModal=_t,M.SearchPanel=Ze,M.SelectIconBox=zt,M.SelectObjectModal=Ln,M.SessionSummary=Fc,M.SideMenu=Dn,M.SystemIconInput=$n,M.SystemMenu=Hc,M.TabMenu=Fn,M.TagsView=Et,M.TimeFormat=Le,M.ToolButton=Rn,M.TopMenu=On,M.TreeView=jn,M.UserMenu=Pn,M.addDays=vr,M.appendParamsToUrl=U,M.arrayGroupBy=gs,M.arrayMove=ln,M.arrayRemoveIf=nn,M.buildBarcodeUrl=Wo,M.buildSearchItems=vo,M.camelToWords=te,M.clearObject=as,M.convertItems=Uo,M.convertPercentValue=Ro,M.convertTo=Oe,M.copyEntity=qo,M.copyToEntity=Jo,M.createGridColumns=Be,M.createI18n=Xt,M.dateTimeToString=it,M.dateToNumber=_o,M.dateToString=st,M.default=Zc,M.defaultHalovOptions=Ho,M.defaultValue=$o,M.downloadFile=me,M.findMenuById=zn,M.firstDayOfMonth=ea,M.formatTimespan=zo,M.getColumnWidth=mt,M.getConfig=ft,M.iconRender=ht,M.iconRenderIf=cs,M.initEntity=Xo,M.instanceOfColumnValueSource=Qo,M.instanceOfHaloColumn=Ie,M.instanceOfTime=To,M.isNullOrWhiteSpace=Oo,M.lastDayOfMonth=ta,M.linesToArray=na,M.loadItemSources=Pe,M.mergeRoutes=ws,M.msToTime=Xr,M.onNullOrWhiteSpace=ra,M.openFile=on,M.renderDifference=fs,M.renderIconButton=ds,M.renderLabel=is,M.searchField=ys,M.secondsToTime=Ao,M.splitNumberByCount=Cs,M.splitNumberBySize=bs,M.stringToArray=oa,M.stringToTime=Eo,M.sumNumbers=ks,M.timeToString=Lo,M.timestamp=qr,M.toBool=de,M.toBoolDefault=Re,M.toDate=Mo,M.toViewModel=Ur,M.useAccountStore=Se,M.useCommonStore=Ne,M.useFontSizeStore=Gc,M.useHttpTools=ie,M.useI18n=Z,M.useMenus=Dt,M.usePermissions=Tt,M.useTabsStore=nt,M.useUiTools=wt,M.useUserConfigStore=Kc,M.validateEmail=la,Object.defineProperties(M,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});