eservices-core 1.3.124 → 1.3.125

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,11 +1,11 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px;color:#4f4f4f}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number{text-align:right}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.es-list-container{overflow:auto}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.widget-table__head-cell[data-v-25198f4a]{padding:18px;text-align:start}.widget-table__head-label[data-v-25198f4a]{font-weight:600;font-size:14px;line-height:19px}[dir=rtl] .icon[data-v-e287c8d9]{transform:scaleX(-1)}.widget-spinner[data-v-0ef9ae88],.widget-spinner[data-v-0ef9ae88]:after{border-radius:50%;width:14px;height:14px}.widget-spinner[data-v-0ef9ae88]{font-size:2px;position:relative;text-indent:-9999em;border-top:1.1em solid rgba(255,255,255,.2);border-right:1.1em solid rgba(255,255,255,.2);border-bottom:1.1em solid rgba(255,255,255,.2);border-left:1.1em solid #ffffff;transform:translateZ(0);animation:spinnerAnimation-0ef9ae88 1.1s infinite linear}@keyframes spinnerAnimation-0ef9ae88{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.widget-button[data-v-450dc564]{position:relative}.widget-button-spinner[data-v-450dc564]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.widget-multi-button-wrap[data-v-a8d711d1]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-a8d711d1]{grid-template-columns:1fr var(--button-size);background-color:var(--primary);grid-template-rows:var(--button-size);transition:var(--fast)}.widget-multi-button_active[data-v-a8d711d1]{grid-template-rows:calc(var(--button-size) * var(--7025434e))}.widget-multi-button-body[data-v-a8d711d1]{min-width:80px}.widget-multi-button-body-label[data-v-a8d711d1]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-a8d711d1]:hover{background-color:#223296}.widget-multi-button-side[data-v-a8d711d1]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-a8d711d1]{transform:rotate(180deg)}.widget-multi-button-side[data-v-a8d711d1]:hover{background-color:#223296}tr[data-v-344a8cc1]{border:1px solid #F3F4FC;height:30px}th[data-v-344a8cc1],td[data-v-344a8cc1]{position:relative;padding:0 11px}th[data-v-344a8cc1]{text-align:left}p[data-v-344a8cc1]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.widget-list-head-cell[data-v-bf495d6a]{padding:0 0 0 10px;display:flex}.widget-list-head-cell[data-v-bf495d6a]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-bf495d6a]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-bf495d6a]{position:absolute;inset-inline-end:22px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-bf495d6a]{transform:rotate(180deg)}.head-cell-resize[data-v-bf495d6a]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-bf495d6a]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-bf495d6a]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-ccffc6bd]{position:sticky;top:-1px;z-index:1}.test-block[data-v-ccffc6bd]{position:absolute;z-index:2;display:none;height:calc(100% + 1px);place-content:center;inset-block-start:-1px;padding-inline:10px;background-color:#e7f2ff;-webkit-user-select:none;user-select:none;white-space:nowrap}.widget-list-head th[data-v-ccffc6bd]{position:sticky;top:0;z-index:2;-webkit-user-select:none;user-select:none}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
2
  "use strict";/*!
3
- * eservices-core v1.3.124
3
+ * eservices-core v1.3.125
4
4
  * (c) 2024 ESERVICES
5
5
  */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("jenesius-vue-form"),o=require("vue"),je=require("vue-router"),Te=require("debug"),ct=require("date-and-time"),fe=require("jenesius-vue-modal");let G={};function X(t,...e){if(typeof t!="string")return console.trace(`Label is not provided for translation: ${t}`),"undefined";let n=B.utils.getPropFromObject((this==null?void 0:this.vocabulary)||G,t);if(typeof n=="string")return Oe(n,e);const r=B.utils.getPropFromObject(G==null?void 0:G.root,t);return typeof r=="string"?Oe(r,e):(typeof n===void 0&&console.warn(`Translation for label "${t}" is not founded.`),t)}function Oe(t,e){return e.forEach((n,r)=>{t=t.replaceAll(new RegExp(`\\{${r}}`,"g"),n)}),t}X.setGlobalVocabulary=function(t){G=t};X.getScope=function(t){const e=typeof t=="string"?t:"root";return typeof t!="string"&&console.warn(`SCOPE ${t} for translate is not string.`),X.bind({vocabulary:B.utils.getPropFromObject(G,e.toLowerCase())})};X.setVocabulary=function(t){return typeof t=="string"&&(t=B.utils.getPropFromObject(G,t)),X.bind({vocabulary:t})};const We=class v extends Error{constructor(e,n=null){super(),this.message=e,this.details=n,this.id=v.ID++}static ParentFormNotFound(){return new v("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new v("Composite object name is undefined",e)}static EntityWithoutName(e){return new v("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new v(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new v("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new v("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new v(`${e} (id) is not a number`)}static UndefinedErrorId(e,n){return v.ApiNotAvailable()}static ApiError(e){return new v("Request error",e)}static ApiNotAvailable(){return new v(`Sorry, we experience difficulties here.
6
6
  Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,n){return!e&&!n?v.ApiNotAvailable():new v(e||"Authorization Error",n)}static ApiResponseParseFailed(){return v.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new v("Object doesn't have id",e)}static ObjectWithIdNotFound(e,n){return new v(`Can't find object with id: ${e}`,n)}static ObjectWithoutConnectToPresentArray(e,n){return new v("Object is not found.",{object:e,array:n})}static EntityWithoutId(e){return new v("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,n){return new v(`Can't find the element with tableIndex ${e}`,n)}static UndefinedError(e,n=[]){return new v(e,n)}static TableArrayAlreadyIncludeProvidedIndexValue(e,n,r){return new v(`Array already includes the element with value ${e}`,{array:n,table:r})}static MetadataEntityIsNotAvailable(e){return new v(`Metadata for the ${e} is not currently available.`)}static RequestTookToLong(){return new v("The request took too long to complete. Try again later.")}};We.ID=0;let Y=We;const lt="Please try again later or submit a feedback if problem doesn't go.",ut=new class{constructor(){this.store=o.reactive([])}add(e,n,{children:r,timeout:i=10,click:s=()=>{}}={}){const u=new dt(e,n,i,r||[],s);return this.store.push(u),i&&setTimeout(this.remove.bind(this,u.id),i*1e3),u}remove(e){const n=this.store.findIndex(r=>r.id===e);if(n===-1)return!1;this.store.splice(n,1)}removeChild(e,n){throw new Error("Removing children error.")}},qe=class ze{constructor(e,n,r,i,s){this.type=e,this.msg=n,this.timeout=r,this.children=i,this.click=s,this.id=ze.cardId++}};qe.cardId=1;let dt=qe;/*!
7
7
  * jenesius-event-emitter v1.0.2
8
8
  * (c) 2022 Jenesius
9
9
  * @license MIT
10
- */const Le=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},$e=function(t,e){t in this.events&&this.events[t].forEach(n=>n(e))},Pe=function(t,e){const n=this.events[t];if(!n)return;const r=n.indexOf(e);r!==-1&&n.splice(r,1)},De=function(){this.events={}};class j{constructor(){this.events={}}on(e,n){return Le.call(this,e,n)}emit(e,n){return $e.call(this,e,n)}off(e,n){return Pe.call(this,e,n)}cleanEvents(){De.call(this)}static on(e,n){return Le.call(j,e,n)}static emit(e,n){return $e.call(j,e,n)}static off(e,n){return Pe.call(j,e,n)}static cleanEvents(){De.call(j)}}j.events={};var Ge=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},ie=(t,e,n)=>(Ge(t,e,"read from private field"),n?n.call(t):e.get(t)),we=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},_e=(t,e,n,r)=>(Ge(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Q,ae,ce;const H=class L extends j{constructor(){super(...arguments),we(this,Q,void 0),we(this,ae,"front"),this.organizations=[],we(this,ce,!1)}set language(e){localStorage.setItem(L.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(L.LOCALSTORAGE_LANGUAGE_KEY)||L.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(L.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){_e(this,Q,e)}get router(){if(!ie(this,Q))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return ie(this,Q)}set type(e){_e(this,ae,e)}get type(){return ie(this,ae)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){_e(this,ce,e),this.emit(L.EVENT_READY_UPDATE,e)}get ready(){return ie(this,ce)}onReady(e){return this.on(L.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(L.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(L.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(L.CURRENT_CONTEXT_KEY,String(e)),this.emit(L.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(n=>n.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const n=Number.parseInt(localStorage.getItem(L.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(n)&&this.validateContextId(Number(n))?this.setCurrentContext(n):this.setCurrentContext(Number(e.id))}catch{ut.add("error",Y.ApiNotAvailable().message)}}loadCustomerData(){return Ye.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var n;return((n=this.person)==null?void 0:n.id)==e?!0:!!this.organizations.find(r=>r.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const n=localStorage.getItem(this.getListKeyById(e));return n&&JSON.parse(n)}setListInformationToLocalStorage(e,n){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(n))}};Q=new WeakMap;ae=new WeakMap;ce=new WeakMap;H.DEFAULT_LANGUAGE="en";H.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage";H.EVENT_CONTEXT_UPDATE="event:context-update";H.EVENT_READY_UPDATE="event:ready-update";H.EVENT_DATA_UPDATE="event:data-update";H.CURRENT_CONTEXT_KEY="CurrentContext";let ft=H;const xe=new ft;function pt(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return lt}})}function P(t,e={}){return xe.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=xe.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw Y.ApiNotAvailable()}).then(n=>pt(n).then(r=>{if(!n.ok)throw r;return r}))}class ht{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,n,r)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[n]=r,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}new ht;class Ye{static getClientData(){return P("/close-api/client-content")}static getNavigation(){return P("/close-api/client/navigation")}}class gt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return P(`/open-api/internationalization/language/${e}`)}}function Be(t){return{...t,createdEntities:t.createdEntites}}const He=class le{static async getStartConfig(e,n){return P([le.url,e,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,n){return P([le.url,e,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(Be)}static async runStep(e,n,r,i,s){return P([le.url,e,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(Be)}};He.url="/close-api/views/process-wizard";let ue=He;class mt{static async upload(e,n){const r=new FormData;r.append("file",e);const i=`/close-api/files?entityName=${n}`;return await fetch(i,{method:"POST",body:r}).then(s=>s.json()).then(s=>(s.filename=e.name,s))}}class yt{static invite(e,n,r){return P("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:n,relatedRoleCode:r})})}static accept(e,n){return P("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!0})})}static decline(e,n){return P("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!1})})}}class Et{static getRequiredDocuments(e,n,r){const i=new URLSearchParams({entity:e,primaryKey:n,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(s=>s.json())}}class K{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${K.url()}/calculator/${e}`)}static calculate(e,n){return P(`/${K.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:n})}).then(r=>{if(r&&r.status===1)return r;throw Array.isArray(r.notes)?new Error(r.notes[0]):Y.ApiNotAvailable()})}static parseMetadataField(e){function n(r){switch(r.type){case"ValueType":switch(r.dataType){case"Integer":return"number";default:return r.dataType}case"EntityReference":return r.dataType}}return{name:e.name,label:e.title,required:e.required,type:n(e)}}static createOnlinePayment(e,n){return P(`/${K.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:n})})}static applyOnlinePayment(e){return P(`/${K.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}function vt(t){return t.statusName==="Completed"}function wt(t){return t.statusName==="FinalStepWithConfirmation"}function _t(t){return t.statusName==="ValidationError"}function Ct(t,e,n){let r=null;const i=o.reactive({wait:null});let s=[],u=null;const l=o.ref(null);function a(){l.value=s.find(c=>c.name===u)||null}function d(){var c;return u?((c=s.find(h=>h.name===u))==null?void 0:c.fields)||[]:[]}function f(c){if(a(),_t(c))return void n.onValidation(c.validationResults);if((c.statusName==="FinalStep"||c.statusName==="NextStep")&&(!d().length||Tt(d(),n.presets)))return y(n.presets||{});vt(c)&&n.onCompleted(c),wt(c)&&n.onConfirmation(c)}async function A(){try{await N(),await _()}catch(c){const{message:h}=pe(c);te.add("error",h)}}function N(){return i.wait="Loading process information.",ue.getStartConfig(e,t).then(c=>{s=c.steps.map(h=>({label:h.title,name:h.stepName,number:h.number,fields:h.frontendEntity.objectTypes.reduce((m,R)=>(R.properties.forEach(p=>{m.push({name:p.name,label:p.title,type:p.refEntityName||p.dataType})}),m),[])}))}).then(c=>(i.wait=!1,c))}function w(c){return u=c.nextStepName,r=c.token,c}function C(c){const h=pe(c);te.add("error",h.message)}function _(){return i.wait="Starting process",ue.startProcess(e,t).then(w).then(f).catch(C).finally(()=>{i.wait=null})}function y(c={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Waiting for result...",ue.runStep(e,t,u,r,c).then(w).then(f).catch(C).finally(()=>{i.wait=!1}))}return{initialize:A,state:i,currentStepConfig:o.readonly(l),next:y}}function Tt(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(!B.utils.getPropFromObject(e,r.name))return!1}return!0}const At={class:"widget-table__head"},St={class:"widget-table__head-label margin_0 text_overflow"},bt=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("tr",At,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.config,(r,i)=>(o.openBlock(),o.createElementBlock("th",{class:"widget-table__head-cell",key:i},[o.createElementVNode("p",St,o.toDisplayString(r.label),1)]))),128))]))}});const q=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},kt=q(bt,[["__scopeId","data-v-25198f4a"]]);function Je(t){return typeof t.name=="string"?t.name:Array.isArray(t.name)?t.name[0]:null}function Nt(t){const e=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let r;for(;(r=e.exec(t))!==null;)n.push(r[1]);return n}function It(t,e){return Nt(t).forEach(r=>{t=t.replace(new RegExp("\\$\\{"+r+"}","g"),B.utils.getPropFromObject(e,r))}),t}function Ae(t,e){if(typeof t.value=="string")return It(t.value,e);const n=Je(t);let r=n?B.utils.getPropFromObject(e,n):null;return r===void 0&&(r=null),t.value?t.value(r,e):t.value===null?null:r}const T={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",TIME_TO_LIVE_SOCKET_REQUEST:3e4,CORE_DEBUG_LABEL:"eservices-core"};function Se(t){return[T.CORE_DEBUG_LABEL,t].join(":")}function Ke(t){return be(t,"YYYY/MM/DD HH:mm:ss")}function be(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return ct.format(n,e)}catch(n){return console.log(n),"Invalid date"}}const Rt={props:{name:String},setup(t,e){let n="unknown";try{n=e.slots.default()[0].children}catch{n=t.name}typeof n!="string"&&console.warn(`Name for Icon.vue is not string. ${n}`);try{n=n.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${n}`})}},ee=q(Rt,[["__scopeId","data-v-e287c8d9"]]);function Ce(t){return e=>typeof e=="string"||typeof e=="number"?`${e} ${t}`:""}const Ot=Te(Se("setup-list-row"));function Lt(t,e){const n=t.config.map(r=>$t(r,t,e));return o.h("tr",{class:"widget-table__row widget-table-row"},n)}function $t(t,e,n){const r=e.values;let i=Ae(t,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(f){s.onClick.push(()=>f(r))}function l(f){Array.isArray(f)?s.class.push(...f):s.class.push(f)}const a=[],d=[];if(t.unitValue&&(i=Ce(t.unitValue)(i)),t.unit&&(i=Ce(t.unit)(i)),t.hide&&t.hide(r))return[o.h("td")];if(t.type)switch(l(`widget-table-cell_${t.type}`),t.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=be(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Ke(typeof i=="string"?i:null);break}case"money":{i=Ze(i);break}case"multi-select":{d.push(o.h(B.FormField,{type:"single-checkbox",modelValue:e.selected})),u(Ve.bind(null,n,!0));break}case"select":{d.push(o.h(B.FormField,{type:"single-radio",modelValue:e.selected})),u(Ve.bind(null,n,!1));break}}if(t.onClick&&u(t.onClick),t.link)try{const f=t.link(r);if(f){const A=o.h(je.RouterLink,{to:f});d.push(A),l("widget-table-cell_link")}}catch(f){Ot("Can't add router link",f)}if(t.href&&(d.push(o.h("a",{href:t.href(r),target:"_blank"})),l("widget-table-cell_link")),t.formatter&&(i=ye(t.formatter).exec(i,r)),typeof i=="boolean"&&(i=i?"✓":"—"),(typeof i=="string"||typeof i=="number")&&d.push(o.h("p",{class:"widget-list-cell-text"},i)),t.icon&&(typeof t.icon=="string"&&d.push(o.h(ee,{name:t.icon})),typeof t.icon=="function")){const f=t.icon(r);f!==null&&d.push(o.h(ee,{name:f}))}return t.class&&(typeof t.class=="function"?l(t.class(r)):l(t.class)),a.push(o.h("td",s,d)),a}function Ve(t,e){t.emit("select",e)}function Xe(t,e){return()=>{try{return Lt(t,e)}catch(n){return console.warn(n),null}}}const Pt={props:{values:Object,config:Object,selected:Boolean},setup:Xe},Dt=["colspan"],Fe=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(t,{emit:e}){const n=o.ref();return o.onMounted(()=>{setTimeout(()=>{n.value&&n.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:n},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=s=>e("close")),onSave:i[1]||(i[1]=s=>e("save",s))}),null,16,["values","new"]))],8,Dt)],512))}}),xt={class:"widget-table"},Me="update:selectedRows",Bt=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1}},emits:["update:activeRow","save"],setup(t,{emit:e}){const n=t,r=o.useSlots(),i=o.computed(()=>{var a;return(a=r==null?void 0:r.default)==null?void 0:a.call(r)[0]});function s(a,d=!0){if(!n.selectedRows)return;if(!d)return e(Me,n.selectedRows.includes(a)?[]:[a]);const f=[...n.selectedRows],A=f.indexOf(a);return A===-1?f.push(a):f.splice(A,1),e(Me,f)}function u(a){e("save",a),e("update:activeRow",null)}const l=o.computed(()=>n.shortcut?n.config.filter(a=>a.name?!!n.array.find(f=>![null,""].includes(Ae(a,f))):!0):n.config);return(a,d)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",xt,[o.createVNode(kt,{config:l.value},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(f,A)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:A},[o.createVNode(Pt,{config:l.value,values:f,selected:a.selectedRows.includes(f),onSelect:N=>s(f,N),class:o.normalizeClass(a.classCallback?a.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&a.activeRow===f?(o.openBlock(),o.createBlock(Fe,{key:0,component:i.value,"row-length":a.config.length,values:f,onClose:d[0]||(d[0]=N=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),a.activeRow===o.unref(T).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(Fe,{key:0,component:i.value,"row-length":l.value.length,onClose:d[1]||(d[1]=f=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),Vt=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}});const me=q(Vt,[["__scopeId","data-v-0ef9ae88"]]),Ft={class:"widget-button"},Mt=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("button",Ft,[e.wait?(o.openBlock(),o.createBlock(me,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const Ut=q(Mt,[["__scopeId","data-v-450dc564"]]),jt={class:"widget-multi-button-wrap position_relative cursor_pointer"},Wt={class:"widget-multi-button-body grid"},qt=["onClick"],zt={class:"widget-multi-button-side-wrap"},Gt=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(t){const e=t;o.useCssVars(u=>({"7025434e":r.value}));const n=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(u){if(!(typeof u!="function"||n.wait))return n.wait=!0,Promise.resolve().then(u).finally(()=>{n.wait=!1})}function s(u=!n.active){n.active=u}return(u,l)=>(o.openBlock(),o.createElementBlock("div",jt,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[o.createElementVNode("div",Wt,[u.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:l[0]||(l[0]=a=>s())},o.toDisplayString(u.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(a,d)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:d,onClick:f=>{i(a.callback),s(!1)}},o.toDisplayString(a.label),9,qt))),128))]),o.createElementVNode("div",zt,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:l[1]||(l[1]=a=>s())},[n.wait?(o.openBlock(),o.createBlock(o.unref(me),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(o.openBlock(),o.createBlock(o.unref(ee),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}});const Yt=q(Gt,[["__scopeId","data-v-a8d711d1"]]),Ht={class:"widget-loader flex flex-align_center gap_10 padding_15"},Jt={class:"text_md"},Kt=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",Ht,[o.createVNode(me,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",Jt,o.toDisplayString(e.label),1)]))}}),Xt=["alt","src"],Zt=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(t){const e=t,n=o.ref();return o.onMounted(()=>{n.value&&(n.value.src=e.src),n.value.onerror=function(){e.default&&(n.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:n,src:r.src||r.$props.default},null,8,Xt))}}),Qt={props:{config:Array,values:Object,selected:Boolean},setup:Xe};const en=q(Qt,[["__scopeId","data-v-344a8cc1"]]),tn=t=>(o.pushScopeId("data-v-bf495d6a"),t=t(),o.popScopeId(),t),nn={class:"widget-list-head-cell"},rn=tn(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),on=o.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(t,{emit:e}){const n=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(r,i)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",nn,[o.createElementVNode("div",{class:"head-cell-content flex_grow",style:o.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(o.openBlock(),o.createBlock(o.unref(B.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(s=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=s=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(ee),{key:0,class:o.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:o.withCtx(()=>[o.createTextVNode("core-arrow-up")]),_:1},8,["class"])):o.createCommentVNode("",!0),rn])]))}});const sn=q(on,[["__scopeId","data-v-bf495d6a"]]),an=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const n=t,r=o.ref(),i=o.ref();o.onMounted(()=>{function a(w,C){let _=-1;do _++,C-=w[_];while(C>0&&_<w.length);return _}function d(w,C){let _=0;for(;C>0&&C>w[_]&&_<w.length;)C-=w[_],_++;return console.log(C,_),_>0?_:0}function f(w){try{i.value.style.insetInlineStart=w+"px"}catch(C){console.log(C)}}function A(w){try{i.value.style.width=w+"px",i.value.style.minWidth=w+"px",i.value.style.maxWidth=w+"px"}catch(C){console.log(C)}}function N(w){return w===null?!1:w.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(C){var Re;function _(O){return O.screenX+h-p}const y=r.value,c=[...y.children].filter(O=>O.localName==="th"),h=((Re=y.offsetParent)==null?void 0:Re.scrollLeft)||0,m=c.map(O=>O.clientWidth),R=N(C.target),p=y.getBoundingClientRect().left,E=_(C),g=a(m,E),b=m.slice(0,g).reduce((O,F)=>O+F,0),I=E-b,V=y.offsetWidth,W=c[g].clientWidth;if(n.config[g].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",C.screenX),console.log("Widths",m),console.log("max width",V),console.log("Start Position",E),console.log("Position From",g),console.log("Start Position",g),console.log("Global offset (Отступ самой таблицы от края экрана)",p),console.log("Del",I),console.groupEnd(),i.value.innerText=c[g].textContent||"",i.value.style.display="grid",i.value.style.width=W+"px",i.value.style.cursor="grabbing",f(b),A(W),document.addEventListener("pointermove",Ie,{passive:!0}),document.addEventListener("pointerup",re);function re(O){if(console.group("END"),document.removeEventListener("pointermove",Ie),document.removeEventListener("pointerup",re),R&&(n.config[g].width=i.value.style.width,n.config[g].minWidth=i.value.style.width,n.config[g].maxWidth=i.value.style.width,s(n.config)),!R){const F=O.screenX+h-p;console.log("ENP Position",F);const oe=d(m,F);if(console.log(g,"->",oe),oe!==g){const Z=n.config[g],ve=n.config;ve.splice(g,1),ve.splice(oe,0,Z),s(ve)}else{const Z=n.config[g].name;u(Z)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Ie(O){if(R){const Z=_(O)-E+W;A(Z);return}let F=O.screenX+h-p-I;F<0&&(F=0),F+W>V&&(F=V-W),f(F)}})});function s(a){e("update:config",a)}function u(a){if(!a)return;if(Array.isArray(a)){if(a.length<1)return;a=a[0]}if(n.order.length===0||n.order[0]!==a)return void l([a]);const d=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([a,d==="asc"?"desc":"asc"])}function l(a){e("update:order",a)}return(a,d)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.config,(f,A)=>(o.openBlock(),o.createBlock(sn,o.mergeProps({key:f},f,{onOrder:N=>u(f.name),onSelect:d[0]||(d[0]=N=>e("select")),order:a.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}});const cn=q(an,[["__scopeId","data-v-ccffc6bd"]]),ln={class:"widget-list"},un={class:"widget-list-body position_relative"},dn=50,fn=o.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(t,{emit:e}){const n=t;function r(l,a=!0){if(n.selectedRows)if(!a)s(n.selectedRows.includes(l)?[]:[l]);else{const d=[...n.selectedRows],f=d.indexOf(l);f===-1?d.push(l):d==null||d.splice(f,1),s(d)}}function i(){var l;if(((l=n.selectedRows)==null?void 0:l.length)!==n.array.length)return s([...n.array]);s([])}function s(l){e("update:selectedRows",l)}function u(l){if(!l)return;const a=l.target;a.scrollTop+a.clientHeight+dn>a.scrollHeight&&e("scrollEnd")}return(l,a)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[o.createElementVNode("table",ln,[o.createElementVNode("thead",null,[o.createVNode(cn,{onSelect:a[0]||(a[0]=d=>i()),"onUpdate:order":a[1]||(a[1]=d=>e("update:order",d)),"onUpdate:config":a[2]||(a[2]=d=>e("update:config",d)),config:l.config,order:l.order},null,8,["config","order"])]),o.createElementVNode("tbody",un,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.array,(d,f)=>{var A;return o.openBlock(),o.createBlock(en,{key:f,class:"widget-list-row",values:d,config:l.config,selected:(A=l.selectedRows)==null?void 0:A.includes(d),onSelect:N=>r(d,N)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),M={};function pn(t){for(let e in t)M[e]=t[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function hn(t){function e(...r){return n.wait?Promise.reject("The process has already started."):(n.wait=!0,Promise.resolve().then(()=>t(...r)).finally(()=>{n.wait=!1}))}const n=o.reactive({wait:!1,call:e});return n}function pe(t){return typeof t=="string"?se(t):gn(t)?se(t.message,t.children||t.details||[]):mn(t)?se(t.title,[t.detail||""]):se(T.DEFAULT_ERROR_MESSAGE)}function gn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"message"))}function mn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"title"))}function se(t,e=[]){return{message:t,children:e}}function x(t="error"){return function(e){const{message:n,children:r}=pe(e);te.add(t,n,{children:r})}}function he(t,e={}){return S().emit("entity:read",{...e,entity:t})}function ke(t,e){return S().emit("entity:update",{...e,entity:t})}function yn(t){return t.reduce((e,n)=>(n.name&&(typeof n.name=="string"?e.push(n.name):e.push(...n.name)),e),[])}function Ze(t,e=2){if(!(typeof t=="string"||typeof t=="number"))return"";let r=String(t).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}function En(t,e){const n=new Map;return t.forEach(r=>{var s;const i=e(r);n.has(i)||n.set(i,[]),(s=n.get(i))==null||s.push(r)}),n}function vn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function wn(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return T.DEFAULT_ERROR_MESSAGE}})}function $(t,e={}){return D.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=D.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw new Error(T.DEFAULT_ERROR_MESSAGE)}).then(n=>wn(n).then(r=>{if(!n.ok)throw r;return r}))}function _n(t,e=1e3){let n=0;return(...r)=>{clearTimeout(n),n=setTimeout(()=>t(...r),e)}}function Cn(t,e){let n=!1;return(...r)=>{if(!n)return n=!0,setTimeout(()=>n=!1,e),t(...r)}}const Tn=Te(Se("pretty-value-field-by-entity"));function An(t,e,n){try{const r=ge.get(t);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${t} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(r){return Tn('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,t,e,n),n}}const Sn=1,bn=5e3,kn="static-folder",Qe="request-error",Nn="Distinguisher",z=Te(Se("use-socket"));function S(){return Rn}function In(t){return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Blob]"}const Rn=function(){let t=1,e,n;const r=new Set;let i=0;const s=new Set;function u(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},bn*2);const c=new Uint8Array(1);c[0]=Sn,e.send(c)}setInterval(()=>{Array.from(r).forEach(c=>{y(c)&&(z("Handler for event %s requestId %d was expired",c.event,c.requestId),c.requestId?a({requestId:c.requestId,event:Qe,data:{message:Y.RequestTookToLong().message}}):r.delete(c))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&d()},T.DELAY_SOCKET_RECONNECT);function l(){return{safeQueue:s,requestId:t,handlers:r,socketInstance:e}}function a(c){const h=[...r.values()];z("Handlers array length is %d. Response event: %s. Request id: %d",r.size,c.event,c.requestId),h.forEach(m=>{const R=c.requestId;(m.requestId&&m.requestId===R||!m.requestId&&m.event===c.event)&&(z("Find appropriated handler: %d, event: %s",t,m.event),m.callback(c.data,c),m.once&&(r.delete(m),z("Handler was removed by *once* params was passed. %o",m)))})}function d(){if(typeof n!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${n}`,"color: purple","color: black"),e=new WebSocket(n),e.onclose=function(c){z("Connection to server was stopped: %d %s",c.code,c.reason),Array.from(r).forEach(h=>{h.guaranteedAnswer&&h.serializeString&&s.add(h.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(c=>{f(c),s.delete(c)})},e.onerror=function(c){console.warn(c)},e.onmessage=c=>{var h;try{if(In(c.data)){u();return}const m=JSON.parse(c.data);if(!et(m)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(m);return}(h=m==null?void 0:m.data)!=null&&h.refresh&&location.reload(),a(m)}catch(m){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(m)}}}function f(c){e.send(c)}function A(c,h){_({event:c,callback:h})}function N(c,h){_({event:c,callback:h,once:!0})}function w(){return e&&(e==null?void 0:e.readyState)===1}function C(c,h,m){const R=++t,p=JSON.stringify({requestId:R,event:c,data:h,contextId:D.contextId,url:window.location.href});return w()?f(p):(s.add(p),z("Socket is not connected. Message was send to save-queue")),new Promise((E,g)=>{_({event:c,requestId:R,once:!0,guaranteedAnswer:!0,serializeString:p,callback:(b,I)=>{if(z("Promise was resolve with next data:",b),On(I))return void g(b);m&&m(b,I),E(b)},timeToLive:T.TIME_TO_LIVE_SOCKET_REQUEST})})}function _(c){const h={timeToLive:0,...c,created:new Date().getTime()};r.add(h)}function y(c){return c.timeToLive===0||typeof c.timeToLive!="number"?!1:new Date().getTime()-c.created>c.timeToLive}return{get socket(){return e},on:A,once:N,emit:C,initialization(c){n=c},getDevInfo:l}}(),On=t=>!!et(t)&&t.event===Qe,et=t=>typeof t=="object"&&t!==null&&"event"in t&&typeof t.event=="string"&&"requestId"in t&&typeof t.requestId=="number"&&"data"in t;function Ln(t,e){return S().emit("list-setting:read",{entity:t,mark:e})}function $n(t,e){return S().emit("metadata-field:treat",{entity:t,fieldName:e})}function tt(t,e){return S().emit("entity:create",{...e,entity:t})}function nt(t,e){return S().emit("entity:delete",{...e,entity:t})}function Pn(t,e){return S().emit("usage-context:read",{...e,entity:t})}function rt(t={}){return S().emit("tool:read",t)}function Dn(t,e={},n={}){const r=o.inject(T.PROVIDE_NAME_ACTIONS,null),i=typeof t=="string"?t:e,s=typeof e=="string"?n:e;return o.computed(()=>{var a;const l=((typeof t=="string"?(a=r==null?void 0:r.actions)==null?void 0:a.value:o.unref(t))||[]).find(d=>d.name===i);return l?{...l,...s}:null})}function xn(t){return S().emit("history:read",t)}function Bn(t,e){return S().emit("entity:count",{...e,entity:t})}function Vn(t){return`/${kn}/${t}`}function ye(t){return{exec(e,n){switch(t.name){case"replace-boolean":return ye.replaceBoolean(e,t.values)}}}}ye.replaceBoolean=Fn;function Fn(t,e){return t?e[1]:e[0]}function Mn(){const t=o.ref(null);function e(n){t.value=n}return{activeRow:t,activateRow:e}}function Ue(t,e){return typeof t!="object"||t===null?!1:Object.values(t).join().toLowerCase().includes(e)}async function ot(t,e){t()&&(await e(),await ot(t,e))}function Un(t,e,n={}){const r=o.ref(""),i=o.computed(()=>s.filter(p=>Ue(p,r.value))),s=o.reactive([]);let u=0;const l=o.ref(!1);function a(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function d(){if(l.value)return Promise.reject("The process has already started.");const p=h();return l.value=!0,typeof p.limit!="number"&&(p.limit=100),p.offset=u,(n.request||he)(t,p).then(g=>(u+=g.length,g)).finally(()=>{l.value=!1})}function f(p,E){var b;return typeof p.Version=="number"?p.Version:(b=s.find(I=>I.Id===E))==null?void 0:b.Version}function A(p,E){const g=s.findIndex(b=>b.Id===p);if(g===-1)throw new Error(`Can't found item with Id ${p}`);s.splice(g,1,E)}function N(p){const E=s.findIndex(g=>g.Id===p);if(E===-1)throw new Error(`Can't found item with Id ${p}`);s.splice(E,1)}async function w(p,E){try{const g=h(),b=f(E,p);delete E.Version,await ke(t,{id:p,values:E,version:b,masterEntities:a()});const I=await he(t,{fields:g.fields||"",id:p});A(p,I)}catch(g){x()(g)}}async function C(p,E={}){try{const g=h(),b=f(E,p);delete E.Version,await nt(t,{id:p,version:b,masterEntities:a()}),N(p)}catch(g){x()(g)}}async function _(p){try{await tt(t,{values:p,masterEntities:a()}),await m()}catch(E){x()(E)}}let y;async function c(){try{const p=y==null?void 0:y.signal;y!=null&&y.signal&&!y.signal.aborted&&y.abort(),y=new AbortController;let E=0,g=!1;const I=h().limit||0;if(r.value&&!I){console.warn("Using textSearch assumes the use of limit.");return}await ot(()=>{var V;return E<I&&!g&&!((V=y==null?void 0:y.signal)!=null&&V.aborted)},async()=>{var W;console.log("Step read data. Count for filter %d",E);const V=await d();(W=y==null?void 0:y.signal)!=null&&W.aborted||(s.push(...V),E+=V.filter(re=>Ue(re,r.value)).length,V.length<I&&(g=!0))})}catch(p){x()(p)}}function h(){return typeof e=="function"?e():e}async function m(){try{u=0,s.splice(0,s.length),await c()}catch(p){x()(p)}}function R(){if(y)return y.abort()}return{array:s,updateById:w,next:c,reload:m,wait:l,create:_,deleteById:C,textSearch:r,filteredArray:i,abort:R}}function jn(){function t(){return{organizations:D.organizations,currentContextId:D.contextId,person:D.person,context:D.context,contextType:D.contextType,userId:D.userId}}const e=o.reactive(t());return D.onupdateContext(()=>{Object.assign(e,t())}),e}function Wn(t,e,n){return S().emit("communication:create",{entityName:t,entityCatalogId:e,targetCode:n})}function qn(t,e,n){return S().emit("communication:read",{entityName:t,entityCatalogId:e,targetCode:n})}function zn(t,e){return S().emit("communication-message:create",{communicationId:t,text:e})}function Gn(t){return S().emit("communication-message:read",{communicationId:t})}function Yn(t){const e=B.Form.getParentForm(),n=o.reactive([]);return e&&e.subscribe(t),t.read=()=>Gn(t.id).then(r=>(n.splice(0,n.length,...r),r)),{array:n}}function Hn(t,e){t.read=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw Y.EntityWithoutName(t);return he(t.name,r)}).then(Ne).then(i=>(i.hasOwnProperty("Version")&&(t.version=i.Version),t.setValues(i),i)).catch(x())},t.save=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw Y.EntityWithoutName(t);return ke(t.name,{id:r.id,values:t.changes,version:t.version})}).then(i=>{t.version=i.version}).catch(i=>{throw x()(i),i})};function n(){return typeof e=="function"?e():e}}function Jn(t){if(!t)return o.inject(T.PROVIDE_NAME_METADATA);ge.initEntity(t);const e=o.computed(()=>ge.state[t]);return o.provide(T.PROVIDE_NAME_METADATA,e),e}function Kn(t,e={}){if(!t)return o.inject(T.PROVIDE_NAME_USAGE_CONTEXT);const n=o.ref(null);return o.provide(T.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await Pn(t,Xn(e||{}))}}}function Xn(t){return typeof t=="function"?t():t}function Zn(t={}){return S().emit("tool:execute",t)}function Qn(t){if(!t)return o.inject(T.PROVIDE_NAME_ACTIONS);const e=o.reactive([]),n=o.computed(()=>e.map(s=>er(t,s))),r={actions:n,update:i};o.provide(T.PROVIDE_NAME_ACTIONS,r),t.router=je.useRouter(),t.handleConfirmation||(t.handleConfirmation=nr),t.handleAffectedEntity||(t.handleAffectedEntity=or),t.handleCloseForm||(t.handleCloseForm=ir),t.handleValidationResult||(t.handleValidationResult=rr);function i(s={}){return e.splice(0,e.length),rt(s).then(u=>e.splice(0,0,...u)).catch(x("error"))}return{actions:n,update:i}}function er(t,e){return{...e,label:e.title,callback(){var i;const n=typeof t.values=="function"?t.values(e,t):t.values,r=()=>Zn({name:e.name,values:n}).then(async s=>{var u,l;if(!sr(s))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(t.handlers))for await(const a of t.handlers)await a(e,s,t);if(!s.success)throw t.handleValidationResult&&s.validationEffect&&((l=(u=s.validationEffect)==null?void 0:u.results)!=null&&l.length)&&t.handleValidationResult(e,s.validationEffect,t),new Error(s.message);return s.message&&te.add("info",s.message),Array.isArray(s.affectedEntities)&&t.handleAffectedEntity&&s.affectedEntities.forEach(a=>{var d;return(d=t.handleAffectedEntity)==null?void 0:d.call(t,e,a,t)}),e.closeHostForm&&t.handleCloseForm&&t.handleCloseForm(e,t),s}).catch(x("error"));return(i=t.overrides)!=null&&i[e.name]?t.overrides[e.name](e,t):e.requireSave&&t.form&&t.form.changed?t.form.save().then(r):!e.confirmation||!t.handleConfirmation?r():t.handleConfirmation(e,r)}}}function tr(t){const e="Are you sure?";return t===!0||typeof t=="string"&&t.toLowerCase()==="true"||t==="1"?e:typeof t=="string"?t:e}async function nr(t,e){const n=tr(t.confirmation);if(!fe.getComponentFromStore(T.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await fe.promptModal(T.MODAL_CONFIRM,{message:n}))return e()}function rr(t,e){const n=T.MODAL_VALIDATION_EFFECT;if(!fe.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{fe.pushModal(n,e)})}function or(t,e,n){var u;const{router:r,form:i}=n,s=(u=e.primaryKey)==null?void 0:u.Id;if(r&&e&&e.name===t.redirectEntity)return r.push({name:e.name,params:{id:s}});i&&e.name===i.name&&e.updated&&s===i.id&&i.read()}function ir(t,e){const{router:n}=e;n&&t.closeHostForm&&n.back()}function sr(t){return!!(t&&typeof t=="object"&&"affectedEntities"in t&&"success"in t)}function ar(t){function e(n){n.key==="Enter"&&t()}o.onMounted(()=>{document.addEventListener("keypress",e)}),o.onUnmounted(()=>{document.removeEventListener("keypress",e)})}function cr(t,e={}){const n=o.reactive([]),r=a=>{const d=o.unref(t);if(a===void 0){n.length===0?d.forEach(s):d.forEach(u);return}i(a)?u(a):s(a)},i=a=>n.includes(a),s=a=>{e.handleSelect&&!e.handleSelect(a)||i(a)||n.push(a)},u=a=>{const d=n.findIndex(f=>f===a);d!==-1&&n.splice(d,1)},l=o.computed(()=>{const a=o.unref(t);return n.length===a.length&&a.length!==0});return[n,r,l,s,u]}function lr(t){const e=o.ref(""),n=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(t).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:n}}const te=new class{constructor(){this.store=o.reactive([])}add(e,n,r={}){const i=ur(r),s=new dr(e,n,i.timeout,i.children,i.click);return this.store.push(s),i.timeout&&setTimeout(this.remove.bind(this,s.id),i.timeout*1e3),s}remove(e){const n=this.store.findIndex(r=>r.id===e);if(n===-1)return!1;this.store.splice(n,1)}};function ur(t){function e(r){return!!r&&typeof r=="object"}const n={timeout:10,click:()=>null,children:[]};return e(t)?{timeout:t.timeout||n.timeout,click:t.click||n.click,children:t.children||n.children}:n}const it=class st{constructor(e,n,r,i,s){this.type=e,this.message=n,this.timeout=r,this.children=i,this.click=s,this.id=st.cardId++}};it.cardId=1;let dr=it;class fr extends j{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return zn(this.id,e)}static checkAndGenerate(e,n,r){return qn(e,n,r).then(i=>i.length===0?Wn(e,n,r):i[0])}}function pr(){return S().emit("client:read",{})}var at=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},hr=(t,e,n)=>(at(t,e,"read from private field"),n?n.call(t):e.get(t)),gr=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},mr=(t,e,n,r)=>(at(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),de;const Ee=class J extends j{constructor(){super(...arguments),this.type="front",this.organizations=[],gr(this,de,!1)}set language(e){localStorage.setItem(T.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(T.LOCALSTORAGE_LANGUAGE_KEY)||J.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){mr(this,de,e),this.emit(J.EVENT_READY_UPDATE,e)}get ready(){return hr(this,de)}onReady(e){return this.on(J.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(J.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(T.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(J.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(n=>n.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.userId=e.userId,this.restoreCurrentContext(),this.ready=!0}catch(e){x()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(T.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return pr()}validateContextId(e){var n;try{return((n=this.person)==null?void 0:n.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};de=new WeakMap;Ee.DEFAULT_LANGUAGE="en";Ee.EVENT_CONTEXT_UPDATE="event:context-update";Ee.EVENT_READY_UPDATE="event:ready-update";let yr=Ee;function Er(t){return S().emit("metadata:read",{entity:t})}const ge=function(){const e=o.reactive({}),n=new Map;function r(l){return e[l]}async function i(l){if(n.has(l)&&await n.get(l),e[l])return;const a=await s(l);u(l,a)}function s(l){const a=Er(l).finally(()=>{n.delete(l)});return n.set(l,a),a}function u(l,a){e[l]=a}return{state:e,initEntity:i,get:r}}();class U{static login(e){return $(M.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:M.applicationName})})}static parseProcessAnswer(e){if(e.statusCode>4)throw new Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return U.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return U.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return U.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return U.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,n){return $(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(e){return U.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return U.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return U.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,n){return $(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(U.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startPasswordReset(e,n){return $(`${M.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:n,AppName:e})})}static confirmPhoneNumberByAccessRecovery(e,n,r,i){return $(`${M.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:i})})}static confirmEmailByAccessRecovery(e,n,r,i){return $(`${M.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:i})})}static finishAccessRecovery(e,n,r){return $(`${M.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Password:r,ConfirmedPassword:r})})}}class vr{static readHistoryById(e,n){return $(`/close-api/audits/history/${e}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class wr{static readLicences(e){const n=`/close-api/proxy/Dashboard/Licenses?organizationId=${e.toString()}`;return $(n).then(r=>{const i={};return r.byOrganization.licenses.forEach(s=>{const u=s.licenseTypeCode;i[u]||(i[u]={licenseTypeCode:u}),i[u][s.statisticName]=s.value}),Object.values(i)})}}class _r{static getConfiguration(){return $("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(e){return await $(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}function Cr(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function k(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];if(Array.isArray(r)){const i=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${n} in (${i})`),e}if(Cr(r)){let i=function(s){var u;return((u=s.match(/([^Z]*)/))==null?void 0:u[0])+"0000Z"};return r.start&&e.push(`@${n} ge ${i(r.start)}`),r.end&&e.push(`@${n} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${n} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${n} eq '${r}'`),e):(r===null&&e.push(k.is(n,r)),e)},[]).join(" and ")}function ne(t){return typeof t=="string"?`'${t}'`:`${t}`}k.includes=function(e,n){return`@${e} Contains ${ne(n)}`};k.beginWith=function(e,n){return`@${e} BeginWith ${ne(n)}`};k.notEq=function(e,n){return`@${e} nq ${ne(n)}`};k.eq=function(e,n){return Array.isArray(n)?k.in(e,n):`@${e} eq ${ne(n)}`};k.in=function(e,n){const r=n.map(ne).join(", ");return`@${e} in (${r})`};k.notIn=function(e,n){return!Array.isArray(n)||n.length===0?"":k.and(...n.map(r=>k.notEq(e,r)))};k.and=function(...e){return e.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(k.wrap).join(" and ")};k.wrap=function(e){return`(${e})`};k.is=function(e,n){return`@${e} is ${n}`};k.or=function(...e){return e.join(" or ")};function Ne(t){return Object.keys(t).reduce((e,n)=>{let r=t[n];const i=n.charAt(0).toUpperCase()+n.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Ne(r)),e[i]=r,e},{})}const D=new yr;exports.Communication=fr;exports.CoreError=Y;exports.Filter=k;exports.Manager=D;exports.MetadataStore=ge;exports.NotificationSystem=te;exports.OBJECT_TYPE_NAME_FIELD=Nn;exports.WidgetButton=Ut;exports.WidgetIcon=ee;exports.WidgetImage=Zt;exports.WidgetList=fn;exports.WidgetLoader=Kt;exports.WidgetMultiButton=Yt;exports.WidgetSpinner=me;exports.WidgetTable=Bt;exports.asyncProcess=hn;exports.authService=U;exports.billingService=K;exports.catchUniversal=x;exports.clientService=Ye;exports.config=pn;exports.configuration=M;exports.constants=T;exports.dashboardService=wr;exports.debounce=_n;exports.documentsService=Et;exports.fileService=mt;exports.formatter=ye;exports.getCellName=Je;exports.getCellValue=Ae;exports.getNamesFromListConfig=yn;exports.getUnitValue=Ce;exports.groupArrayByField=En;exports.historyService=vr;exports.injectAction=Dn;exports.internationalizationService=gt;exports.invitationService=yt;exports.openService=_r;exports.parseError=pe;exports.prettyDate=be;exports.prettyDateWithTime=Ke;exports.prettyMoney=Ze;exports.prettyValueFieldByEntity=An;exports.processWizardService=ue;exports.request=$;exports.staticLink=Vn;exports.t=X;exports.throttle=Cn;exports.universalEntityCount=Bn;exports.universalEntityCreate=tt;exports.universalEntityDelete=nt;exports.universalEntityRead=he;exports.universalEntityUpdate=ke;exports.universalHistoryRead=xn;exports.universalListSettingRead=Ln;exports.universalMetadataFieldTreat=$n;exports.universalToolRead=rt;exports.useActions=Qn;exports.useCommunication=Yn;exports.useEnter=ar;exports.useFormEntity=Hn;exports.useListActiveRow=Mn;exports.useListEntity=Un;exports.useListSearch=lr;exports.useListSelect=cr;exports.useManagerState=jn;exports.useMetadata=Jn;exports.useSocket=S;exports.useUsageContext=Kn;exports.useWizard=Ct;exports.uuidv4=vn;exports.valuesToUpperCase=Ne;
10
+ */const Le=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},$e=function(t,e){t in this.events&&this.events[t].forEach(n=>n(e))},Pe=function(t,e){const n=this.events[t];if(!n)return;const r=n.indexOf(e);r!==-1&&n.splice(r,1)},De=function(){this.events={}};class j{constructor(){this.events={}}on(e,n){return Le.call(this,e,n)}emit(e,n){return $e.call(this,e,n)}off(e,n){return Pe.call(this,e,n)}cleanEvents(){De.call(this)}static on(e,n){return Le.call(j,e,n)}static emit(e,n){return $e.call(j,e,n)}static off(e,n){return Pe.call(j,e,n)}static cleanEvents(){De.call(j)}}j.events={};var Ge=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},ie=(t,e,n)=>(Ge(t,e,"read from private field"),n?n.call(t):e.get(t)),we=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},_e=(t,e,n,r)=>(Ge(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Q,ae,ce;const H=class L extends j{constructor(){super(...arguments),we(this,Q,void 0),we(this,ae,"front"),this.organizations=[],we(this,ce,!1)}set language(e){localStorage.setItem(L.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(L.LOCALSTORAGE_LANGUAGE_KEY)||L.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(L.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){_e(this,Q,e)}get router(){if(!ie(this,Q))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return ie(this,Q)}set type(e){_e(this,ae,e)}get type(){return ie(this,ae)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){_e(this,ce,e),this.emit(L.EVENT_READY_UPDATE,e)}get ready(){return ie(this,ce)}onReady(e){return this.on(L.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(L.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(L.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(L.CURRENT_CONTEXT_KEY,String(e)),this.emit(L.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(n=>n.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const n=Number.parseInt(localStorage.getItem(L.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(n)&&this.validateContextId(Number(n))?this.setCurrentContext(n):this.setCurrentContext(Number(e.id))}catch{ut.add("error",Y.ApiNotAvailable().message)}}loadCustomerData(){return Ye.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var n;return((n=this.person)==null?void 0:n.id)==e?!0:!!this.organizations.find(r=>r.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const n=localStorage.getItem(this.getListKeyById(e));return n&&JSON.parse(n)}setListInformationToLocalStorage(e,n){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(n))}};Q=new WeakMap;ae=new WeakMap;ce=new WeakMap;H.DEFAULT_LANGUAGE="en";H.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage";H.EVENT_CONTEXT_UPDATE="event:context-update";H.EVENT_READY_UPDATE="event:ready-update";H.EVENT_DATA_UPDATE="event:data-update";H.CURRENT_CONTEXT_KEY="CurrentContext";let ft=H;const xe=new ft;function pt(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return lt}})}function P(t,e={}){return xe.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=xe.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw Y.ApiNotAvailable()}).then(n=>pt(n).then(r=>{if(!n.ok)throw r;return r}))}class ht{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,n,r)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[n]=r,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}new ht;class Ye{static getClientData(){return P("/close-api/client-content")}static getNavigation(){return P("/close-api/client/navigation")}}class gt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return P(`/open-api/internationalization/language/${e}`)}}function Be(t){return{...t,createdEntities:t.createdEntites}}const He=class le{static async getStartConfig(e,n){return P([le.url,e,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,n){return P([le.url,e,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(Be)}static async runStep(e,n,r,i,s){return P([le.url,e,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(Be)}};He.url="/close-api/views/process-wizard";let ue=He;class mt{static async upload(e,n){const r=new FormData;r.append("file",e);const i=`/close-api/files?entityName=${n}`;return await fetch(i,{method:"POST",body:r}).then(s=>s.json()).then(s=>(s.filename=e.name,s))}}class yt{static invite(e,n,r){return P("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:n,relatedRoleCode:r})})}static accept(e,n){return P("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!0})})}static decline(e,n){return P("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!1})})}}class Et{static getRequiredDocuments(e,n,r){const i=new URLSearchParams({entity:e,primaryKey:n,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(s=>s.json())}}class K{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${K.url()}/calculator/${e}`)}static calculate(e,n){return P(`/${K.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:n})}).then(r=>{if(r&&r.status===1)return r;throw Array.isArray(r.notes)?new Error(r.notes[0]):Y.ApiNotAvailable()})}static parseMetadataField(e){function n(r){switch(r.type){case"ValueType":switch(r.dataType){case"Integer":return"number";default:return r.dataType}case"EntityReference":return r.dataType}}return{name:e.name,label:e.title,required:e.required,type:n(e)}}static createOnlinePayment(e,n){return P(`/${K.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:n})})}static applyOnlinePayment(e){return P(`/${K.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}function vt(t){return t.statusName==="Completed"}function wt(t){return t.statusName==="FinalStepWithConfirmation"}function _t(t){return t.statusName==="ValidationError"}function Ct(t,e,n){let r=null;const i=o.reactive({wait:null});let s=[],u=null;const l=o.ref(null);function a(){l.value=s.find(c=>c.name===u)||null}function d(){var c;return u?((c=s.find(h=>h.name===u))==null?void 0:c.fields)||[]:[]}function f(c){if(a(),_t(c))return void n.onValidation(c.validationResults);if((c.statusName==="FinalStep"||c.statusName==="NextStep")&&(!d().length||Tt(d(),n.presets)))return y(n.presets||{});vt(c)&&n.onCompleted(c),wt(c)&&n.onConfirmation(c)}async function A(){try{await N(),await _()}catch(c){const{message:h}=pe(c);te.add("error",h)}}function N(){return i.wait="Loading process information.",ue.getStartConfig(e,t).then(c=>{s=c.steps.map(h=>({label:h.title,name:h.stepName,number:h.number,fields:h.frontendEntity.objectTypes.reduce((m,R)=>(R.properties.forEach(p=>{m.push({name:p.name,label:p.title,type:p.refEntityName||p.dataType})}),m),[])}))}).then(c=>(i.wait=!1,c))}function w(c){return u=c.nextStepName,r=c.token,c}function C(c){const h=pe(c);te.add("error",h.message)}function _(){return i.wait="Starting process",ue.startProcess(e,t).then(w).then(f).catch(C).finally(()=>{i.wait=null})}function y(c={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Waiting for result...",ue.runStep(e,t,u,r,c).then(w).then(f).catch(C).finally(()=>{i.wait=!1}))}return{initialize:A,state:i,currentStepConfig:o.readonly(l),next:y}}function Tt(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(!B.utils.getPropFromObject(e,r.name))return!1}return!0}const At={class:"widget-table__head"},St={class:"widget-table__head-label margin_0 text_overflow"},bt=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("tr",At,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.config,(r,i)=>(o.openBlock(),o.createElementBlock("th",{class:"widget-table__head-cell",key:i},[o.createElementVNode("p",St,o.toDisplayString(r.label),1)]))),128))]))}});const q=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},kt=q(bt,[["__scopeId","data-v-25198f4a"]]);function Je(t){return typeof t.name=="string"?t.name:Array.isArray(t.name)?t.name[0]:null}function Nt(t){const e=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let r;for(;(r=e.exec(t))!==null;)n.push(r[1]);return n}function It(t,e){return Nt(t).forEach(r=>{t=t.replace(new RegExp("\\$\\{"+r+"}","g"),B.utils.getPropFromObject(e,r))}),t}function Ae(t,e){if(typeof t.value=="string")return It(t.value,e);const n=Je(t);let r=n?B.utils.getPropFromObject(e,n):null;return r===void 0&&(r=null),t.value?t.value(r,e):t.value===null?null:r}const T={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",TIME_TO_LIVE_SOCKET_REQUEST:3e4,CORE_DEBUG_LABEL:"eservices-core"};function Se(t){return[T.CORE_DEBUG_LABEL,t].join(":")}function Ke(t){return be(t,"YYYY/MM/DD HH:mm:ss")}function be(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return ct.format(n,e)}catch(n){return console.log(n),"Invalid date"}}const Rt={props:{name:String},setup(t,e){let n="unknown";try{n=e.slots.default()[0].children}catch{n=t.name}typeof n!="string"&&console.warn(`Name for Icon.vue is not string. ${n}`);try{n=n.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${n}`})}},ee=q(Rt,[["__scopeId","data-v-e287c8d9"]]);function Ce(t){return e=>typeof e=="string"||typeof e=="number"?`${e} ${t}`:""}const Ot=Te(Se("setup-list-row"));function Lt(t,e){const n=t.config.map(r=>$t(r,t,e));return o.h("tr",{class:"widget-table__row widget-table-row"},n)}function $t(t,e,n){const r=e.values;let i=Ae(t,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(f){s.onClick.push(()=>f(r))}function l(f){Array.isArray(f)?s.class.push(...f):s.class.push(f)}const a=[],d=[];if(t.unitValue&&(i=Ce(t.unitValue)(i)),t.unit&&(i=Ce(t.unit)(i)),t.hide&&t.hide(r))return[o.h("td")];if(t.type)switch(l(`widget-table-cell_${t.type}`),t.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=be(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Ke(typeof i=="string"?i:null);break}case"money":{i=Ze(i);break}case"multi-select":{d.push(o.h(B.FormField,{type:"single-checkbox",modelValue:e.selected})),u(Ve.bind(null,n,!0));break}case"select":{d.push(o.h(B.FormField,{type:"single-radio",modelValue:e.selected})),u(Ve.bind(null,n,!1));break}}if(t.onClick&&u(t.onClick),t.link)try{const f=t.link(r);if(f){const A=o.h(je.RouterLink,{to:f});d.push(A),l("widget-table-cell_link")}}catch(f){Ot("Can't add router link",f)}if(t.href&&(d.push(o.h("a",{href:t.href(r),target:"_blank"})),l("widget-table-cell_link")),t.formatter&&(i=ye(t.formatter).exec(i,r)),typeof i=="boolean"&&(i=i?"✓":"—"),(typeof i=="string"||typeof i=="number")&&d.push(o.h("p",{class:"widget-list-cell-text"},i)),t.icon&&(typeof t.icon=="string"&&d.push(o.h(ee,{name:t.icon})),typeof t.icon=="function")){const f=t.icon(r);f!==null&&d.push(o.h(ee,{name:f}))}return t.class&&(typeof t.class=="function"?l(t.class(r)):l(t.class)),a.push(o.h("td",s,d)),a}function Ve(t,e){t.emit("select",e)}function Xe(t,e){return()=>{try{return Lt(t,e)}catch(n){return console.warn(n),null}}}const Pt={props:{values:Object,config:Object,selected:Boolean},setup:Xe},Dt=["colspan"],Fe=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(t,{emit:e}){const n=o.ref();return o.onMounted(()=>{setTimeout(()=>{n.value&&n.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:n},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=s=>e("close")),onSave:i[1]||(i[1]=s=>e("save",s))}),null,16,["values","new"]))],8,Dt)],512))}}),xt={class:"widget-table"},Me="update:selectedRows",Bt=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1}},emits:["update:activeRow","save"],setup(t,{emit:e}){const n=t,r=o.useSlots(),i=o.computed(()=>{var a;return(a=r==null?void 0:r.default)==null?void 0:a.call(r)[0]});function s(a,d=!0){if(!n.selectedRows)return;if(!d)return e(Me,n.selectedRows.includes(a)?[]:[a]);const f=[...n.selectedRows],A=f.indexOf(a);return A===-1?f.push(a):f.splice(A,1),e(Me,f)}function u(a){e("save",a),e("update:activeRow",null)}const l=o.computed(()=>n.shortcut?n.config.filter(a=>a.name?!!n.array.find(f=>![null,""].includes(Ae(a,f))):!0):n.config);return(a,d)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",xt,[o.createVNode(kt,{config:l.value},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(f,A)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:A},[o.createVNode(Pt,{config:l.value,values:f,selected:a.selectedRows.includes(f),onSelect:N=>s(f,N),class:o.normalizeClass(a.classCallback?a.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&a.activeRow===f?(o.openBlock(),o.createBlock(Fe,{key:0,component:i.value,"row-length":a.config.length,values:f,onClose:d[0]||(d[0]=N=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),a.activeRow===o.unref(T).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(Fe,{key:0,component:i.value,"row-length":l.value.length,onClose:d[1]||(d[1]=f=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),Vt=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}});const me=q(Vt,[["__scopeId","data-v-0ef9ae88"]]),Ft={class:"widget-button"},Mt=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("button",Ft,[e.wait?(o.openBlock(),o.createBlock(me,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const Ut=q(Mt,[["__scopeId","data-v-450dc564"]]),jt={class:"widget-multi-button-wrap position_relative cursor_pointer"},Wt={class:"widget-multi-button-body grid"},qt=["onClick"],zt={class:"widget-multi-button-side-wrap"},Gt=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(t){const e=t;o.useCssVars(u=>({"7025434e":r.value}));const n=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(u){if(!(typeof u!="function"||n.wait))return n.wait=!0,Promise.resolve().then(u).finally(()=>{n.wait=!1})}function s(u=!n.active){n.active=u}return(u,l)=>(o.openBlock(),o.createElementBlock("div",jt,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[o.createElementVNode("div",Wt,[u.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:l[0]||(l[0]=a=>s())},o.toDisplayString(u.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(a,d)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:d,onClick:f=>{i(a.callback),s(!1)}},o.toDisplayString(a.label),9,qt))),128))]),o.createElementVNode("div",zt,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:l[1]||(l[1]=a=>s())},[n.wait?(o.openBlock(),o.createBlock(o.unref(me),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(o.openBlock(),o.createBlock(o.unref(ee),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}});const Yt=q(Gt,[["__scopeId","data-v-a8d711d1"]]),Ht={class:"widget-loader flex flex-align_center gap_10 padding_15"},Jt={class:"text_md"},Kt=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",Ht,[o.createVNode(me,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",Jt,o.toDisplayString(e.label),1)]))}}),Xt=["alt","src"],Zt=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(t){const e=t,n=o.ref();return o.onMounted(()=>{n.value&&(n.value.src=e.src),n.value.onerror=function(){e.default&&(n.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:n,src:r.src||r.$props.default},null,8,Xt))}}),Qt={props:{config:Array,values:Object,selected:Boolean},setup:Xe};const en=q(Qt,[["__scopeId","data-v-344a8cc1"]]),tn=t=>(o.pushScopeId("data-v-bf495d6a"),t=t(),o.popScopeId(),t),nn={class:"widget-list-head-cell"},rn=tn(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),on=o.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(t,{emit:e}){const n=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(r,i)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",nn,[o.createElementVNode("div",{class:"head-cell-content flex_grow",style:o.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(o.openBlock(),o.createBlock(o.unref(B.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(s=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=s=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(ee),{key:0,class:o.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:o.withCtx(()=>[o.createTextVNode("core-arrow-up")]),_:1},8,["class"])):o.createCommentVNode("",!0),rn])]))}});const sn=q(on,[["__scopeId","data-v-bf495d6a"]]),an=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const n=t,r=o.ref(),i=o.ref();o.onMounted(()=>{function a(w,C){let _=-1;do _++,C-=w[_];while(C>0&&_<w.length);return _}function d(w,C){let _=0;for(;C>0&&C>w[_]&&_<w.length;)C-=w[_],_++;return console.log(C,_),_>0?_:0}function f(w){try{i.value.style.insetInlineStart=w+"px"}catch(C){console.log(C)}}function A(w){try{i.value.style.width=w+"px",i.value.style.minWidth=w+"px",i.value.style.maxWidth=w+"px"}catch(C){console.log(C)}}function N(w){return w===null?!1:w.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(C){var Re;function _(O){return O.screenX+h-p}const y=r.value,c=[...y.children].filter(O=>O.localName==="th"),h=((Re=y.offsetParent)==null?void 0:Re.scrollLeft)||0,m=c.map(O=>O.clientWidth),R=N(C.target),p=y.getBoundingClientRect().left,E=_(C),g=a(m,E),b=m.slice(0,g).reduce((O,F)=>O+F,0),I=E-b,V=y.offsetWidth,W=c[g].clientWidth;if(n.config[g].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",C.screenX),console.log("Widths",m),console.log("max width",V),console.log("Start Position",E),console.log("Position From",g),console.log("Start Position",g),console.log("Global offset (Отступ самой таблицы от края экрана)",p),console.log("Del",I),console.groupEnd(),i.value.innerText=c[g].textContent||"",i.value.style.display="grid",i.value.style.width=W+"px",i.value.style.cursor="grabbing",f(b),A(W),document.addEventListener("pointermove",Ie,{passive:!0}),document.addEventListener("pointerup",re);function re(O){if(console.group("END"),document.removeEventListener("pointermove",Ie),document.removeEventListener("pointerup",re),R&&(n.config[g].width=i.value.style.width,n.config[g].minWidth=i.value.style.width,n.config[g].maxWidth=i.value.style.width,s(n.config)),!R){const F=O.screenX+h-p;console.log("ENP Position",F);const oe=d(m,F);if(console.log(g,"->",oe),oe!==g){const Z=n.config[g],ve=n.config;ve.splice(g,1),ve.splice(oe,0,Z),s(ve)}else{const Z=n.config[g].name;u(Z)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Ie(O){if(R){const Z=_(O)-E+W;A(Z);return}let F=O.screenX+h-p-I;F<0&&(F=0),F+W>V&&(F=V-W),f(F)}})});function s(a){e("update:config",a)}function u(a){if(!a)return;if(Array.isArray(a)){if(a.length<1)return;a=a[0]}if(n.order.length===0||n.order[0]!==a)return void l([a]);const d=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([a,d==="asc"?"desc":"asc"])}function l(a){e("update:order",a)}return(a,d)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.config,(f,A)=>(o.openBlock(),o.createBlock(sn,o.mergeProps({key:f},f,{onOrder:N=>u(f.name),onSelect:d[0]||(d[0]=N=>e("select")),order:a.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}});const cn=q(an,[["__scopeId","data-v-ccffc6bd"]]),ln={class:"widget-list"},un={class:"widget-list-body position_relative"},dn=50,fn=o.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(t,{emit:e}){const n=t;function r(l,a=!0){if(n.selectedRows)if(!a)s(n.selectedRows.includes(l)?[]:[l]);else{const d=[...n.selectedRows],f=d.indexOf(l);f===-1?d.push(l):d==null||d.splice(f,1),s(d)}}function i(){var l;if(((l=n.selectedRows)==null?void 0:l.length)!==n.array.length)return s([...n.array]);s([])}function s(l){e("update:selectedRows",l)}function u(l){if(!l)return;const a=l.target;a.scrollTop+a.clientHeight+dn>a.scrollHeight&&e("scrollEnd")}return(l,a)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[o.createElementVNode("table",ln,[o.createElementVNode("thead",null,[o.createVNode(cn,{onSelect:a[0]||(a[0]=d=>i()),"onUpdate:order":a[1]||(a[1]=d=>e("update:order",d)),"onUpdate:config":a[2]||(a[2]=d=>e("update:config",d)),config:l.config,order:l.order},null,8,["config","order"])]),o.createElementVNode("tbody",un,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.array,(d,f)=>{var A;return o.openBlock(),o.createBlock(en,{key:f,class:"widget-list-row",values:d,config:l.config,selected:(A=l.selectedRows)==null?void 0:A.includes(d),onSelect:N=>r(d,N)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),M={};function pn(t){for(let e in t)M[e]=t[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function hn(t){function e(...r){return n.wait?Promise.reject("The process has already started."):(n.wait=!0,Promise.resolve().then(()=>t(...r)).finally(()=>{n.wait=!1}))}const n=o.reactive({wait:!1,call:e});return n}function pe(t){return typeof t=="string"?se(t):gn(t)?se(t.message,t.children||t.details||[]):mn(t)?se(t.title,[t.detail||""]):se(T.DEFAULT_ERROR_MESSAGE)}function gn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"message"))}function mn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"title"))}function se(t,e=[]){return{message:t,children:e}}function x(t="error"){return function(e){const{message:n,children:r}=pe(e);te.add(t,n,{children:r})}}function he(t,e={}){return S().emit("entity:read",{...e,entity:t})}function ke(t,e){return S().emit("entity:update",{...e,entity:t})}function yn(t){return t.reduce((e,n)=>(n.name&&(typeof n.name=="string"?e.push(n.name):e.push(...n.name)),e),[])}function Ze(t,e=2){if(!(typeof t=="string"||typeof t=="number"))return"";let r=String(t).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}function En(t,e){const n=new Map;return t.forEach(r=>{var s;const i=e(r);n.has(i)||n.set(i,[]),(s=n.get(i))==null||s.push(r)}),n}function vn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function wn(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return T.DEFAULT_ERROR_MESSAGE}})}function $(t,e={}){return D.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=D.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw new Error(T.DEFAULT_ERROR_MESSAGE)}).then(n=>wn(n).then(r=>{if(!n.ok)throw r;return r}))}function _n(t,e=1e3){let n=0;return(...r)=>{clearTimeout(n),n=setTimeout(()=>t(...r),e)}}function Cn(t,e){let n=!1;return(...r)=>{if(!n)return n=!0,setTimeout(()=>n=!1,e),t(...r)}}const Tn=Te(Se("pretty-value-field-by-entity"));function An(t,e,n){try{const r=ge.get(t);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${t} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(r){return Tn('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,t,e,n),n}}const Sn=1,bn=5e3,kn="static-folder",Qe="request-error",Nn="Distinguisher",z=Te(Se("use-socket"));function S(){return Rn}function In(t){return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Blob]"}const Rn=function(){let t=1,e,n;const r=new Set;let i=0;const s=new Set;function u(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},bn*2);const c=new Uint8Array(1);c[0]=Sn,e.send(c)}setInterval(()=>{Array.from(r).forEach(c=>{y(c)&&(z("Handler for event %s requestId %d was expired",c.event,c.requestId),c.requestId?a({requestId:c.requestId,event:Qe,data:{message:Y.RequestTookToLong().message}}):r.delete(c))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&d()},T.DELAY_SOCKET_RECONNECT);function l(){return{safeQueue:s,requestId:t,handlers:r,socketInstance:e}}function a(c){const h=[...r.values()];z("Handlers array length is %d. Response event: %s. Request id: %d",r.size,c.event,c.requestId),h.forEach(m=>{const R=c.requestId;(m.requestId&&m.requestId===R||!m.requestId&&m.event===c.event)&&(z("Find appropriated handler: %d, event: %s",t,m.event),m.callback(c.data,c),m.once&&(r.delete(m),z("Handler was removed by *once* params was passed. %o",m)))})}function d(){if(typeof n!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${n}`,"color: purple","color: black"),e=new WebSocket(n),e.onclose=function(c){z("Connection to server was stopped: %d %s",c.code,c.reason),Array.from(r).forEach(h=>{h.guaranteedAnswer&&h.serializeString&&s.add(h.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(c=>{f(c),s.delete(c)})},e.onerror=function(c){console.warn(c)},e.onmessage=c=>{var h;try{if(In(c.data)){u();return}const m=JSON.parse(c.data);if(!et(m)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(m);return}(h=m==null?void 0:m.data)!=null&&h.refresh&&location.reload(),a(m)}catch(m){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(m)}}}function f(c){e.send(c)}function A(c,h){_({event:c,callback:h})}function N(c,h){_({event:c,callback:h,once:!0})}function w(){return e&&(e==null?void 0:e.readyState)===1}function C(c,h,m){const R=++t,p=JSON.stringify({requestId:R,event:c,data:h,contextId:D.contextId,url:window.location.href});return w()?f(p):(s.add(p),z("Socket is not connected. Message was send to save-queue")),new Promise((E,g)=>{_({event:c,requestId:R,once:!0,guaranteedAnswer:!0,serializeString:p,callback:(b,I)=>{if(z("Promise was resolve with next data:",b),On(I))return void g(b);m&&m(b,I),E(b)},timeToLive:T.TIME_TO_LIVE_SOCKET_REQUEST})})}function _(c){const h={timeToLive:0,...c,created:new Date().getTime()};r.add(h)}function y(c){return c.timeToLive===0||typeof c.timeToLive!="number"?!1:new Date().getTime()-c.created>c.timeToLive}return{get socket(){return e},on:A,once:N,emit:C,initialization(c){n=c},getDevInfo:l}}(),On=t=>!!et(t)&&t.event===Qe,et=t=>typeof t=="object"&&t!==null&&"event"in t&&typeof t.event=="string"&&"requestId"in t&&typeof t.requestId=="number"&&"data"in t;function Ln(t,e){return S().emit("list-setting:read",{entity:t,mark:e})}function $n(t,e){return S().emit("metadata-field:treat",{entity:t,fieldName:e})}function tt(t,e){return S().emit("entity:create",{...e,entity:t})}function nt(t,e){return S().emit("entity:delete",{...e,entity:t})}function Pn(t,e){return S().emit("usage-context:read",{...e,entity:t})}function rt(t={}){return S().emit("tool:read",t)}function Dn(t,e={},n={}){const r=o.inject(T.PROVIDE_NAME_ACTIONS,null),i=typeof t=="string"?t:e,s=typeof e=="string"?n:e;return o.computed(()=>{var a;const l=((typeof t=="string"?(a=r==null?void 0:r.actions)==null?void 0:a.value:o.unref(t))||[]).find(d=>d.name===i);return l?{...l,...s}:null})}function xn(t){return S().emit("history:read",t)}function Bn(t,e){return S().emit("entity:count",{...e,entity:t})}function Vn(t){return`/${kn}/${t}`}function ye(t){return{exec(e,n){switch(t.name){case"replace-boolean":return ye.replaceBoolean(e,t.values)}}}}ye.replaceBoolean=Fn;function Fn(t,e){return t?e[1]:e[0]}function Mn(){const t=o.ref(null);function e(n){t.value=n}return{activeRow:t,activateRow:e}}function Ue(t,e){return typeof t!="object"||t===null?!1:Object.values(t).join().toLowerCase().includes(e)}async function ot(t,e){t()&&(await e(),await ot(t,e))}function Un(t,e,n={}){const r=o.ref(""),i=o.computed(()=>s.filter(p=>Ue(p,r.value))),s=o.reactive([]);let u=0;const l=o.ref(!1);function a(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function d(){const p=h();return typeof p.limit!="number"&&(p.limit=100),p.offset=u,(n.request||he)(t,p).then(g=>(u+=g.length,g))}function f(p,E){var b;return typeof p.Version=="number"?p.Version:(b=s.find(I=>I.Id===E))==null?void 0:b.Version}function A(p,E){const g=s.findIndex(b=>b.Id===p);if(g===-1)throw new Error(`Can't found item with Id ${p}`);s.splice(g,1,E)}function N(p){const E=s.findIndex(g=>g.Id===p);if(E===-1)throw new Error(`Can't found item with Id ${p}`);s.splice(E,1)}async function w(p,E){try{const g=h(),b=f(E,p);delete E.Version,await ke(t,{id:p,values:E,version:b,masterEntities:a()});const I=await he(t,{fields:g.fields||"",id:p});A(p,I)}catch(g){x()(g)}}async function C(p,E={}){try{const g=h(),b=f(E,p);delete E.Version,await nt(t,{id:p,version:b,masterEntities:a()}),N(p)}catch(g){x()(g)}}async function _(p){try{await tt(t,{values:p,masterEntities:a()}),await m()}catch(E){x()(E)}}let y;async function c(){l.value=!0;try{const p=y==null?void 0:y.signal;y!=null&&y.signal&&!y.signal.aborted&&y.abort(),y=new AbortController;let E=0,g=!1;const I=h().limit||0;if(r.value&&!I){console.warn("Using textSearch assumes the use of limit.");return}await ot(()=>{var V;return E<I&&!g&&!((V=y==null?void 0:y.signal)!=null&&V.aborted)},async()=>{var W;console.log("Step read data. Count for filter %d",E);const V=await d();(W=y==null?void 0:y.signal)!=null&&W.aborted||(s.push(...V),E+=V.filter(re=>Ue(re,r.value)).length,V.length<I&&(g=!0))})}catch(p){x()(p)}l.value=!1}function h(){return typeof e=="function"?e():e}async function m(){try{u=0,s.splice(0,s.length),await c()}catch(p){x()(p)}}function R(){if(y)return y.abort();l.value=!1}return{array:s,updateById:w,next:c,reload:m,wait:l,create:_,deleteById:C,textSearch:r,filteredArray:i,abort:R}}function jn(){function t(){return{organizations:D.organizations,currentContextId:D.contextId,person:D.person,context:D.context,contextType:D.contextType,userId:D.userId}}const e=o.reactive(t());return D.onupdateContext(()=>{Object.assign(e,t())}),e}function Wn(t,e,n){return S().emit("communication:create",{entityName:t,entityCatalogId:e,targetCode:n})}function qn(t,e,n){return S().emit("communication:read",{entityName:t,entityCatalogId:e,targetCode:n})}function zn(t,e){return S().emit("communication-message:create",{communicationId:t,text:e})}function Gn(t){return S().emit("communication-message:read",{communicationId:t})}function Yn(t){const e=B.Form.getParentForm(),n=o.reactive([]);return e&&e.subscribe(t),t.read=()=>Gn(t.id).then(r=>(n.splice(0,n.length,...r),r)),{array:n}}function Hn(t,e){t.read=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw Y.EntityWithoutName(t);return he(t.name,r)}).then(Ne).then(i=>(i.hasOwnProperty("Version")&&(t.version=i.Version),t.setValues(i),i)).catch(x())},t.save=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw Y.EntityWithoutName(t);return ke(t.name,{id:r.id,values:t.changes,version:t.version})}).then(i=>{t.version=i.version}).catch(i=>{throw x()(i),i})};function n(){return typeof e=="function"?e():e}}function Jn(t){if(!t)return o.inject(T.PROVIDE_NAME_METADATA);ge.initEntity(t);const e=o.computed(()=>ge.state[t]);return o.provide(T.PROVIDE_NAME_METADATA,e),e}function Kn(t,e={}){if(!t)return o.inject(T.PROVIDE_NAME_USAGE_CONTEXT);const n=o.ref(null);return o.provide(T.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await Pn(t,Xn(e||{}))}}}function Xn(t){return typeof t=="function"?t():t}function Zn(t={}){return S().emit("tool:execute",t)}function Qn(t){if(!t)return o.inject(T.PROVIDE_NAME_ACTIONS);const e=o.reactive([]),n=o.computed(()=>e.map(s=>er(t,s))),r={actions:n,update:i};o.provide(T.PROVIDE_NAME_ACTIONS,r),t.router=je.useRouter(),t.handleConfirmation||(t.handleConfirmation=nr),t.handleAffectedEntity||(t.handleAffectedEntity=or),t.handleCloseForm||(t.handleCloseForm=ir),t.handleValidationResult||(t.handleValidationResult=rr);function i(s={}){return e.splice(0,e.length),rt(s).then(u=>e.splice(0,0,...u)).catch(x("error"))}return{actions:n,update:i}}function er(t,e){return{...e,label:e.title,callback(){var i;const n=typeof t.values=="function"?t.values(e,t):t.values,r=()=>Zn({name:e.name,values:n}).then(async s=>{var u,l;if(!sr(s))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(t.handlers))for await(const a of t.handlers)await a(e,s,t);if(!s.success)throw t.handleValidationResult&&s.validationEffect&&((l=(u=s.validationEffect)==null?void 0:u.results)!=null&&l.length)&&t.handleValidationResult(e,s.validationEffect,t),new Error(s.message);return s.message&&te.add("info",s.message),Array.isArray(s.affectedEntities)&&t.handleAffectedEntity&&s.affectedEntities.forEach(a=>{var d;return(d=t.handleAffectedEntity)==null?void 0:d.call(t,e,a,t)}),e.closeHostForm&&t.handleCloseForm&&t.handleCloseForm(e,t),s}).catch(x("error"));return(i=t.overrides)!=null&&i[e.name]?t.overrides[e.name](e,t):e.requireSave&&t.form&&t.form.changed?t.form.save().then(r):!e.confirmation||!t.handleConfirmation?r():t.handleConfirmation(e,r)}}}function tr(t){const e="Are you sure?";return t===!0||typeof t=="string"&&t.toLowerCase()==="true"||t==="1"?e:typeof t=="string"?t:e}async function nr(t,e){const n=tr(t.confirmation);if(!fe.getComponentFromStore(T.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await fe.promptModal(T.MODAL_CONFIRM,{message:n}))return e()}function rr(t,e){const n=T.MODAL_VALIDATION_EFFECT;if(!fe.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{fe.pushModal(n,e)})}function or(t,e,n){var u;const{router:r,form:i}=n,s=(u=e.primaryKey)==null?void 0:u.Id;if(r&&e&&e.name===t.redirectEntity)return r.push({name:e.name,params:{id:s}});i&&e.name===i.name&&e.updated&&s===i.id&&i.read()}function ir(t,e){const{router:n}=e;n&&t.closeHostForm&&n.back()}function sr(t){return!!(t&&typeof t=="object"&&"affectedEntities"in t&&"success"in t)}function ar(t){function e(n){n.key==="Enter"&&t()}o.onMounted(()=>{document.addEventListener("keypress",e)}),o.onUnmounted(()=>{document.removeEventListener("keypress",e)})}function cr(t,e={}){const n=o.reactive([]),r=a=>{const d=o.unref(t);if(a===void 0){n.length===0?d.forEach(s):d.forEach(u);return}i(a)?u(a):s(a)},i=a=>n.includes(a),s=a=>{e.handleSelect&&!e.handleSelect(a)||i(a)||n.push(a)},u=a=>{const d=n.findIndex(f=>f===a);d!==-1&&n.splice(d,1)},l=o.computed(()=>{const a=o.unref(t);return n.length===a.length&&a.length!==0});return[n,r,l,s,u]}function lr(t){const e=o.ref(""),n=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(t).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:n}}const te=new class{constructor(){this.store=o.reactive([])}add(e,n,r={}){const i=ur(r),s=new dr(e,n,i.timeout,i.children,i.click);return this.store.push(s),i.timeout&&setTimeout(this.remove.bind(this,s.id),i.timeout*1e3),s}remove(e){const n=this.store.findIndex(r=>r.id===e);if(n===-1)return!1;this.store.splice(n,1)}};function ur(t){function e(r){return!!r&&typeof r=="object"}const n={timeout:10,click:()=>null,children:[]};return e(t)?{timeout:t.timeout||n.timeout,click:t.click||n.click,children:t.children||n.children}:n}const it=class st{constructor(e,n,r,i,s){this.type=e,this.message=n,this.timeout=r,this.children=i,this.click=s,this.id=st.cardId++}};it.cardId=1;let dr=it;class fr extends j{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return zn(this.id,e)}static checkAndGenerate(e,n,r){return qn(e,n,r).then(i=>i.length===0?Wn(e,n,r):i[0])}}function pr(){return S().emit("client:read",{})}var at=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},hr=(t,e,n)=>(at(t,e,"read from private field"),n?n.call(t):e.get(t)),gr=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},mr=(t,e,n,r)=>(at(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),de;const Ee=class J extends j{constructor(){super(...arguments),this.type="front",this.organizations=[],gr(this,de,!1)}set language(e){localStorage.setItem(T.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(T.LOCALSTORAGE_LANGUAGE_KEY)||J.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){mr(this,de,e),this.emit(J.EVENT_READY_UPDATE,e)}get ready(){return hr(this,de)}onReady(e){return this.on(J.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(J.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(T.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(J.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(n=>n.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.userId=e.userId,this.restoreCurrentContext(),this.ready=!0}catch(e){x()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(T.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return pr()}validateContextId(e){var n;try{return((n=this.person)==null?void 0:n.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};de=new WeakMap;Ee.DEFAULT_LANGUAGE="en";Ee.EVENT_CONTEXT_UPDATE="event:context-update";Ee.EVENT_READY_UPDATE="event:ready-update";let yr=Ee;function Er(t){return S().emit("metadata:read",{entity:t})}const ge=function(){const e=o.reactive({}),n=new Map;function r(l){return e[l]}async function i(l){if(n.has(l)&&await n.get(l),e[l])return;const a=await s(l);u(l,a)}function s(l){const a=Er(l).finally(()=>{n.delete(l)});return n.set(l,a),a}function u(l,a){e[l]=a}return{state:e,initEntity:i,get:r}}();class U{static login(e){return $(M.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:M.applicationName})})}static parseProcessAnswer(e){if(e.statusCode>4)throw new Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return U.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return U.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return U.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return U.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,n){return $(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(e){return U.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return U.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return U.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,n){return $(`${M.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(U.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startPasswordReset(e,n){return $(`${M.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:n,AppName:e})})}static confirmPhoneNumberByAccessRecovery(e,n,r,i){return $(`${M.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:i})})}static confirmEmailByAccessRecovery(e,n,r,i){return $(`${M.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:i})})}static finishAccessRecovery(e,n,r){return $(`${M.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Password:r,ConfirmedPassword:r})})}}class vr{static readHistoryById(e,n){return $(`/close-api/audits/history/${e}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class wr{static readLicences(e){const n=`/close-api/proxy/Dashboard/Licenses?organizationId=${e.toString()}`;return $(n).then(r=>{const i={};return r.byOrganization.licenses.forEach(s=>{const u=s.licenseTypeCode;i[u]||(i[u]={licenseTypeCode:u}),i[u][s.statisticName]=s.value}),Object.values(i)})}}class _r{static getConfiguration(){return $("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(e){return await $(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}function Cr(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function k(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];if(Array.isArray(r)){const i=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${n} in (${i})`),e}if(Cr(r)){let i=function(s){var u;return((u=s.match(/([^Z]*)/))==null?void 0:u[0])+"0000Z"};return r.start&&e.push(`@${n} ge ${i(r.start)}`),r.end&&e.push(`@${n} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${n} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${n} eq '${r}'`),e):(r===null&&e.push(k.is(n,r)),e)},[]).join(" and ")}function ne(t){return typeof t=="string"?`'${t}'`:`${t}`}k.includes=function(e,n){return`@${e} Contains ${ne(n)}`};k.beginWith=function(e,n){return`@${e} BeginWith ${ne(n)}`};k.notEq=function(e,n){return`@${e} nq ${ne(n)}`};k.eq=function(e,n){return Array.isArray(n)?k.in(e,n):`@${e} eq ${ne(n)}`};k.in=function(e,n){const r=n.map(ne).join(", ");return`@${e} in (${r})`};k.notIn=function(e,n){return!Array.isArray(n)||n.length===0?"":k.and(...n.map(r=>k.notEq(e,r)))};k.and=function(...e){return e.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(k.wrap).join(" and ")};k.wrap=function(e){return`(${e})`};k.is=function(e,n){return`@${e} is ${n}`};k.or=function(...e){return e.join(" or ")};function Ne(t){return Object.keys(t).reduce((e,n)=>{let r=t[n];const i=n.charAt(0).toUpperCase()+n.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Ne(r)),e[i]=r,e},{})}const D=new yr;exports.Communication=fr;exports.CoreError=Y;exports.Filter=k;exports.Manager=D;exports.MetadataStore=ge;exports.NotificationSystem=te;exports.OBJECT_TYPE_NAME_FIELD=Nn;exports.WidgetButton=Ut;exports.WidgetIcon=ee;exports.WidgetImage=Zt;exports.WidgetList=fn;exports.WidgetLoader=Kt;exports.WidgetMultiButton=Yt;exports.WidgetSpinner=me;exports.WidgetTable=Bt;exports.asyncProcess=hn;exports.authService=U;exports.billingService=K;exports.catchUniversal=x;exports.clientService=Ye;exports.config=pn;exports.configuration=M;exports.constants=T;exports.dashboardService=wr;exports.debounce=_n;exports.documentsService=Et;exports.fileService=mt;exports.formatter=ye;exports.getCellName=Je;exports.getCellValue=Ae;exports.getNamesFromListConfig=yn;exports.getUnitValue=Ce;exports.groupArrayByField=En;exports.historyService=vr;exports.injectAction=Dn;exports.internationalizationService=gt;exports.invitationService=yt;exports.openService=_r;exports.parseError=pe;exports.prettyDate=be;exports.prettyDateWithTime=Ke;exports.prettyMoney=Ze;exports.prettyValueFieldByEntity=An;exports.processWizardService=ue;exports.request=$;exports.staticLink=Vn;exports.t=X;exports.throttle=Cn;exports.universalEntityCount=Bn;exports.universalEntityCreate=tt;exports.universalEntityDelete=nt;exports.universalEntityRead=he;exports.universalEntityUpdate=ke;exports.universalHistoryRead=xn;exports.universalListSettingRead=Ln;exports.universalMetadataFieldTreat=$n;exports.universalToolRead=rt;exports.useActions=Qn;exports.useCommunication=Yn;exports.useEnter=ar;exports.useFormEntity=Hn;exports.useListActiveRow=Mn;exports.useListEntity=Un;exports.useListSearch=lr;exports.useListSelect=cr;exports.useManagerState=jn;exports.useMetadata=Jn;exports.useSocket=S;exports.useUsageContext=Kn;exports.useWizard=Ct;exports.uuidv4=vn;exports.valuesToUpperCase=Ne;
11
11
  //# sourceMappingURL=eservices-core.cjs.js.map
@@ -6,7 +6,7 @@ import Me from "debug";
6
6
  import Dt from "date-and-time";
7
7
  import { getComponentFromStore as st, promptModal as xt, pushModal as Ft } from "jenesius-vue-modal";
8
8
  /*!
9
- * eservices-core v1.3.124
9
+ * eservices-core v1.3.125
10
10
  * (c) 2024 ESERVICES
11
11
  */
12
12
  let ee = {};
@@ -1694,12 +1694,8 @@ function Zr(t, e, n = {}) {
1694
1694
  return n.masterEntities ? typeof n.masterEntities == "function" ? n.masterEntities() : n.masterEntities : [];
1695
1695
  }
1696
1696
  function l() {
1697
- if (c.value)
1698
- return Promise.reject("The process has already started.");
1699
1697
  const f = p();
1700
- return c.value = !0, typeof f.limit != "number" && (f.limit = 100), f.offset = u, (n.request || De)(t, f).then((h) => (u += h.length, h)).finally(() => {
1701
- c.value = !1;
1702
- });
1698
+ return typeof f.limit != "number" && (f.limit = 100), f.offset = u, (n.request || De)(t, f).then((h) => (u += h.length, h));
1703
1699
  }
1704
1700
  function d(f, E) {
1705
1701
  var S;
@@ -1747,6 +1743,7 @@ function Zr(t, e, n = {}) {
1747
1743
  }
1748
1744
  let y;
1749
1745
  async function a() {
1746
+ c.value = !0;
1750
1747
  try {
1751
1748
  const f = y == null ? void 0 : y.signal;
1752
1749
  y != null && y.signal && !y.signal.aborted && y.abort(), y = new AbortController();
@@ -1768,6 +1765,7 @@ function Zr(t, e, n = {}) {
1768
1765
  } catch (f) {
1769
1766
  q()(f);
1770
1767
  }
1768
+ c.value = !1;
1771
1769
  }
1772
1770
  function p() {
1773
1771
  return typeof e == "function" ? e() : e;
@@ -1782,6 +1780,7 @@ function Zr(t, e, n = {}) {
1782
1780
  function L() {
1783
1781
  if (y)
1784
1782
  return y.abort();
1783
+ c.value = !1;
1785
1784
  }
1786
1785
  return {
1787
1786
  array: i,
@@ -1,11 +1,11 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px;color:#4f4f4f}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number{text-align:right}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.es-list-container{overflow:auto}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.widget-table__head-cell[data-v-25198f4a]{padding:18px;text-align:start}.widget-table__head-label[data-v-25198f4a]{font-weight:600;font-size:14px;line-height:19px}[dir=rtl] .icon[data-v-e287c8d9]{transform:scaleX(-1)}.widget-spinner[data-v-0ef9ae88],.widget-spinner[data-v-0ef9ae88]:after{border-radius:50%;width:14px;height:14px}.widget-spinner[data-v-0ef9ae88]{font-size:2px;position:relative;text-indent:-9999em;border-top:1.1em solid rgba(255,255,255,.2);border-right:1.1em solid rgba(255,255,255,.2);border-bottom:1.1em solid rgba(255,255,255,.2);border-left:1.1em solid #ffffff;transform:translateZ(0);animation:spinnerAnimation-0ef9ae88 1.1s infinite linear}@keyframes spinnerAnimation-0ef9ae88{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.widget-button[data-v-450dc564]{position:relative}.widget-button-spinner[data-v-450dc564]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.widget-multi-button-wrap[data-v-a8d711d1]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-a8d711d1]{grid-template-columns:1fr var(--button-size);background-color:var(--primary);grid-template-rows:var(--button-size);transition:var(--fast)}.widget-multi-button_active[data-v-a8d711d1]{grid-template-rows:calc(var(--button-size) * var(--7025434e))}.widget-multi-button-body[data-v-a8d711d1]{min-width:80px}.widget-multi-button-body-label[data-v-a8d711d1]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-a8d711d1]:hover{background-color:#223296}.widget-multi-button-side[data-v-a8d711d1]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-a8d711d1]{transform:rotate(180deg)}.widget-multi-button-side[data-v-a8d711d1]:hover{background-color:#223296}tr[data-v-344a8cc1]{border:1px solid #F3F4FC;height:30px}th[data-v-344a8cc1],td[data-v-344a8cc1]{position:relative;padding:0 11px}th[data-v-344a8cc1]{text-align:left}p[data-v-344a8cc1]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.widget-list-head-cell[data-v-bf495d6a]{padding:0 0 0 10px;display:flex}.widget-list-head-cell[data-v-bf495d6a]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-bf495d6a]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-bf495d6a]{position:absolute;inset-inline-end:22px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-bf495d6a]{transform:rotate(180deg)}.head-cell-resize[data-v-bf495d6a]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-bf495d6a]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-bf495d6a]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-ccffc6bd]{position:sticky;top:-1px;z-index:1}.test-block[data-v-ccffc6bd]{position:absolute;z-index:2;display:none;height:calc(100% + 1px);place-content:center;inset-block-start:-1px;padding-inline:10px;background-color:#e7f2ff;-webkit-user-select:none;user-select:none;white-space:nowrap}.widget-list-head th[data-v-ccffc6bd]{position:sticky;top:0;z-index:2;-webkit-user-select:none;user-select:none}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
2
  (function(c,R){typeof exports=="object"&&typeof module<"u"?R(exports,require("jenesius-vue-form"),require("vue"),require("vue-router"),require("debug"),require("date-and-time"),require("jenesius-vue-modal")):typeof define=="function"&&define.amd?define(["exports","jenesius-vue-form","vue","vue-router","debug","date-and-time","jenesius-vue-modal"],R):(c=typeof globalThis<"u"?globalThis:c||self,R(c["eservices-core"]={},c.JenesiusVueForm,c.Vue,c.VueRouter,c.Debug,c.DateAndTime,c.JenesiusVueModal))})(this,function(c,R,o,Oe,_e,lt,oe){"use strict";/*!
3
- * eservices-core v1.3.124
3
+ * eservices-core v1.3.125
4
4
  * (c) 2024 ESERVICES
5
5
  */const Ar="";let G={};function K(t,...e){if(typeof t!="string")return console.trace(`Label is not provided for translation: ${t}`),"undefined";let n=R.utils.getPropFromObject((this==null?void 0:this.vocabulary)||G,t);if(typeof n=="string")return ve(n,e);const r=R.utils.getPropFromObject(G==null?void 0:G.root,t);return typeof r=="string"?ve(r,e):(typeof n===void 0&&console.warn(`Translation for label "${t}" is not founded.`),t)}function ve(t,e){return e.forEach((n,r)=>{t=t.replaceAll(new RegExp(`\\{${r}}`,"g"),n)}),t}K.setGlobalVocabulary=function(t){G=t},K.getScope=function(t){const e=typeof t=="string"?t:"root";return typeof t!="string"&&console.warn(`SCOPE ${t} for translate is not string.`),K.bind({vocabulary:R.utils.getPropFromObject(G,e.toLowerCase())})},K.setVocabulary=function(t){return typeof t=="string"&&(t=R.utils.getPropFromObject(G,t)),K.bind({vocabulary:t})};const Le=class _ extends Error{constructor(e,n=null){super(),this.message=e,this.details=n,this.id=_.ID++}static ParentFormNotFound(){return new _("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new _("Composite object name is undefined",e)}static EntityWithoutName(e){return new _("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new _(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new _("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new _("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new _(`${e} (id) is not a number`)}static UndefinedErrorId(e,n){return _.ApiNotAvailable()}static ApiError(e){return new _("Request error",e)}static ApiNotAvailable(){return new _(`Sorry, we experience difficulties here.
6
6
  Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,n){return!e&&!n?_.ApiNotAvailable():new _(e||"Authorization Error",n)}static ApiResponseParseFailed(){return _.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new _("Object doesn't have id",e)}static ObjectWithIdNotFound(e,n){return new _(`Can't find object with id: ${e}`,n)}static ObjectWithoutConnectToPresentArray(e,n){return new _("Object is not found.",{object:e,array:n})}static EntityWithoutId(e){return new _("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,n){return new _(`Can't find the element with tableIndex ${e}`,n)}static UndefinedError(e,n=[]){return new _(e,n)}static TableArrayAlreadyIncludeProvidedIndexValue(e,n,r){return new _(`Array already includes the element with value ${e}`,{array:n,table:r})}static MetadataEntityIsNotAvailable(e){return new _(`Metadata for the ${e} is not currently available.`)}static RequestTookToLong(){return new _("The request took too long to complete. Try again later.")}};Le.ID=0;let Y=Le;const ut="Please try again later or submit a feedback if problem doesn't go.",dt=new class{constructor(){this.store=o.reactive([])}add(e,n,{children:r,timeout:i=10,click:a=()=>{}}={}){const d=new ft(e,n,i,r||[],a);return this.store.push(d),i&&setTimeout(this.remove.bind(this,d.id),i*1e3),d}remove(e){const n=this.store.findIndex(r=>r.id===e);if(n===-1)return!1;this.store.splice(n,1)}removeChild(e,n){throw new Error("Removing children error.")}},$e=class st{constructor(e,n,r,i,a){this.type=e,this.msg=n,this.timeout=r,this.children=i,this.click=a,this.id=st.cardId++}};$e.cardId=1;let ft=$e;/*!
7
7
  * jenesius-event-emitter v1.0.2
8
8
  * (c) 2022 Jenesius
9
9
  * @license MIT
10
- */const Pe=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},De=function(t,e){t in this.events&&this.events[t].forEach(n=>n(e))},Be=function(t,e){const n=this.events[t];if(!n)return;const r=n.indexOf(e);r!==-1&&n.splice(r,1)},Me=function(){this.events={}};class q{constructor(){this.events={}}on(e,n){return Pe.call(this,e,n)}emit(e,n){return De.call(this,e,n)}off(e,n){return Be.call(this,e,n)}cleanEvents(){Me.call(this)}static on(e,n){return Pe.call(q,e,n)}static emit(e,n){return De.call(q,e,n)}static off(e,n){return Be.call(q,e,n)}static cleanEvents(){Me.call(q)}}q.events={};var Ve=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},ie=(t,e,n)=>(Ve(t,e,"read from private field"),n?n.call(t):e.get(t)),Ce=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Te=(t,e,n,r)=>(Ve(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Q,ae,se;const J=class B extends q{constructor(){super(...arguments),Ce(this,Q,void 0),Ce(this,ae,"front"),this.organizations=[],Ce(this,se,!1)}set language(e){localStorage.setItem(B.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(B.LOCALSTORAGE_LANGUAGE_KEY)||B.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(B.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){Te(this,Q,e)}get router(){if(!ie(this,Q))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return ie(this,Q)}set type(e){Te(this,ae,e)}get type(){return ie(this,ae)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Te(this,se,e),this.emit(B.EVENT_READY_UPDATE,e)}get ready(){return ie(this,se)}onReady(e){return this.on(B.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(B.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(B.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(B.CURRENT_CONTEXT_KEY,String(e)),this.emit(B.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(n=>n.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const n=Number.parseInt(localStorage.getItem(B.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(n)&&this.validateContextId(Number(n))?this.setCurrentContext(n):this.setCurrentContext(Number(e.id))}catch{dt.add("error",Y.ApiNotAvailable().message)}}loadCustomerData(){return Ue.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var n;return((n=this.person)==null?void 0:n.id)==e?!0:!!this.organizations.find(r=>r.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const n=localStorage.getItem(this.getListKeyById(e));return n&&JSON.parse(n)}setListInformationToLocalStorage(e,n){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(n))}};Q=new WeakMap,ae=new WeakMap,se=new WeakMap,J.DEFAULT_LANGUAGE="en",J.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",J.EVENT_CONTEXT_UPDATE="event:context-update",J.EVENT_READY_UPDATE="event:ready-update",J.EVENT_DATA_UPDATE="event:data-update",J.CURRENT_CONTEXT_KEY="CurrentContext";let ht=J;const Fe=new ht;function pt(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return ut}})}function L(t,e={}){return Fe.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=Fe.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw Y.ApiNotAvailable()}).then(n=>pt(n).then(r=>{if(!n.ok)throw r;return r}))}class gt{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,n,r)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[n]=r,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}new gt;class Ue{static getClientData(){return L("/close-api/client-content")}static getNavigation(){return L("/close-api/client/navigation")}}class mt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return L(`/open-api/internationalization/language/${e}`)}}function We(t){return{...t,createdEntities:t.createdEntites}}const je=class we{static async getStartConfig(e,n){return L([we.url,e,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,n){return L([we.url,e,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(We)}static async runStep(e,n,r,i,a){return L([we.url,e,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:a})}).then(We)}};je.url="/close-api/views/process-wizard";let ce=je;class yt{static async upload(e,n){const r=new FormData;r.append("file",e);const i=`/close-api/files?entityName=${n}`;return await fetch(i,{method:"POST",body:r}).then(a=>a.json()).then(a=>(a.filename=e.name,a))}}class Et{static invite(e,n,r){return L("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:n,relatedRoleCode:r})})}static accept(e,n){return L("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!0})})}static decline(e,n){return L("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!1})})}}class wt{static getRequiredDocuments(e,n,r){const i=new URLSearchParams({entity:e,primaryKey:n,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(a=>a.json())}}class X{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${X.url()}/calculator/${e}`)}static calculate(e,n){return L(`/${X.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:n})}).then(r=>{if(r&&r.status===1)return r;throw Array.isArray(r.notes)?new Error(r.notes[0]):Y.ApiNotAvailable()})}static parseMetadataField(e){function n(r){switch(r.type){case"ValueType":switch(r.dataType){case"Integer":return"number";default:return r.dataType}case"EntityReference":return r.dataType}}return{name:e.name,label:e.title,required:e.required,type:n(e)}}static createOnlinePayment(e,n){return L(`/${X.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:n})})}static applyOnlinePayment(e){return L(`/${X.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}function _t(t){return t.statusName==="Completed"}function Ct(t){return t.statusName==="FinalStepWithConfirmation"}function Tt(t){return t.statusName==="ValidationError"}function At(t,e,n){let r=null;const i=o.reactive({wait:null});let a=[],d=null;const u=o.ref(null);function s(){u.value=a.find(l=>l.name===d)||null}function f(){var l;return d?((l=a.find(g=>g.name===d))==null?void 0:l.fields)||[]:[]}function h(l){if(s(),Tt(l))return void n.onValidation(l.validationResults);if((l.statusName==="FinalStep"||l.statusName==="NextStep")&&(!f().length||St(f(),n.presets)))return E(n.presets||{});_t(l)&&n.onCompleted(l),Ct(l)&&n.onConfirmation(l)}async function b(){try{await O(),await T()}catch(l){const{message:g}=ue(l);te.add("error",g)}}function O(){return i.wait="Loading process information.",ce.getStartConfig(e,t).then(l=>{a=l.steps.map(g=>({label:g.title,name:g.stepName,number:g.number,fields:g.frontendEntity.objectTypes.reduce((y,P)=>(P.properties.forEach(p=>{y.push({name:p.name,label:p.title,type:p.refEntityName||p.dataType})}),y),[])}))}).then(l=>(i.wait=!1,l))}function C(l){return d=l.nextStepName,r=l.token,l}function S(l){const g=ue(l);te.add("error",g.message)}function T(){return i.wait="Starting process",ce.startProcess(e,t).then(C).then(h).catch(S).finally(()=>{i.wait=null})}function E(l={}){return!r||!d?Promise.reject("Not step or token."):(i.wait="Waiting for result...",ce.runStep(e,t,d,r,l).then(C).then(h).catch(S).finally(()=>{i.wait=!1}))}return{initialize:b,state:i,currentStepConfig:o.readonly(u),next:E}}function St(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(!R.utils.getPropFromObject(e,r.name))return!1}return!0}const bt={class:"widget-table__head"},kt={class:"widget-table__head-label margin_0 text_overflow"},Nt=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("tr",bt,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.config,(r,i)=>(o.openBlock(),o.createElementBlock("th",{class:"widget-table__head-cell",key:i},[o.createElementVNode("p",kt,o.toDisplayString(r.label),1)]))),128))]))}}),Sr="",z=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},It=z(Nt,[["__scopeId","data-v-25198f4a"]]);function qe(t){return typeof t.name=="string"?t.name:Array.isArray(t.name)?t.name[0]:null}function Rt(t){const e=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let r;for(;(r=e.exec(t))!==null;)n.push(r[1]);return n}function Ot(t,e){return Rt(t).forEach(r=>{t=t.replace(new RegExp("\\$\\{"+r+"}","g"),R.utils.getPropFromObject(e,r))}),t}function Ae(t,e){if(typeof t.value=="string")return Ot(t.value,e);const n=qe(t);let r=n?R.utils.getPropFromObject(e,n):null;return r===void 0&&(r=null),t.value?t.value(r,e):t.value===null?null:r}const A={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",TIME_TO_LIVE_SOCKET_REQUEST:3e4,CORE_DEBUG_LABEL:"eservices-core"};function Se(t){return[A.CORE_DEBUG_LABEL,t].join(":")}function ze(t){return be(t,"YYYY/MM/DD HH:mm:ss")}function be(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return lt.format(n,e)}catch(n){return console.log(n),"Invalid date"}}const br="",ee=z({props:{name:String},setup(t,e){let n="unknown";try{n=e.slots.default()[0].children}catch{n=t.name}typeof n!="string"&&console.warn(`Name for Icon.vue is not string. ${n}`);try{n=n.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${n}`})}},[["__scopeId","data-v-e287c8d9"]]);function ke(t){return e=>typeof e=="string"||typeof e=="number"?`${e} ${t}`:""}const vt=_e(Se("setup-list-row"));function Lt(t,e){const n=t.config.map(r=>$t(r,t,e));return o.h("tr",{class:"widget-table__row widget-table-row"},n)}function $t(t,e,n){const r=e.values;let i=Ae(t,r);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function d(h){a.onClick.push(()=>h(r))}function u(h){Array.isArray(h)?a.class.push(...h):a.class.push(h)}const s=[],f=[];if(t.unitValue&&(i=ke(t.unitValue)(i)),t.unit&&(i=ke(t.unit)(i)),t.hide&&t.hide(r))return[o.h("td")];if(t.type)switch(u(`widget-table-cell_${t.type}`),t.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=be(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=ze(typeof i=="string"?i:null);break}case"money":{i=He(i);break}case"multi-select":{f.push(o.h(R.FormField,{type:"single-checkbox",modelValue:e.selected})),d(xe.bind(null,n,!0));break}case"select":{f.push(o.h(R.FormField,{type:"single-radio",modelValue:e.selected})),d(xe.bind(null,n,!1));break}}if(t.onClick&&d(t.onClick),t.link)try{const h=t.link(r);if(h){const b=o.h(Oe.RouterLink,{to:h});f.push(b),u("widget-table-cell_link")}}catch(h){vt("Can't add router link",h)}if(t.href&&(f.push(o.h("a",{href:t.href(r),target:"_blank"})),u("widget-table-cell_link")),t.formatter&&(i=he(t.formatter).exec(i,r)),typeof i=="boolean"&&(i=i?"✓":"—"),(typeof i=="string"||typeof i=="number")&&f.push(o.h("p",{class:"widget-list-cell-text"},i)),t.icon&&(typeof t.icon=="string"&&f.push(o.h(ee,{name:t.icon})),typeof t.icon=="function")){const h=t.icon(r);h!==null&&f.push(o.h(ee,{name:h}))}return t.class&&(typeof t.class=="function"?u(t.class(r)):u(t.class)),s.push(o.h("td",a,f)),s}function xe(t,e){t.emit("select",e)}function Ge(t,e){return()=>{try{return Lt(t,e)}catch(n){return console.warn(n),null}}}const Pt={props:{values:Object,config:Object,selected:Boolean},setup:Ge},Dt=["colspan"],Ye=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(t,{emit:e}){const n=o.ref();return o.onMounted(()=>{setTimeout(()=>{n.value&&n.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:n},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=a=>e("close")),onSave:i[1]||(i[1]=a=>e("save",a))}),null,16,["values","new"]))],8,Dt)],512))}}),Bt={class:"widget-table"},Je="update:selectedRows",Mt=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1}},emits:["update:activeRow","save"],setup(t,{emit:e}){const n=t,r=o.useSlots(),i=o.computed(()=>{var s;return(s=r==null?void 0:r.default)==null?void 0:s.call(r)[0]});function a(s,f=!0){if(!n.selectedRows)return;if(!f)return e(Je,n.selectedRows.includes(s)?[]:[s]);const h=[...n.selectedRows],b=h.indexOf(s);return b===-1?h.push(s):h.splice(b,1),e(Je,h)}function d(s){e("save",s),e("update:activeRow",null)}const u=o.computed(()=>n.shortcut?n.config.filter(s=>s.name?!!n.array.find(h=>![null,""].includes(Ae(s,h))):!0):n.config);return(s,f)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",Bt,[o.createVNode(It,{config:u.value},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.array,(h,b)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:b},[o.createVNode(Pt,{config:u.value,values:h,selected:s.selectedRows.includes(h),onSelect:O=>a(h,O),class:o.normalizeClass(s.classCallback?s.classCallback(h):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&s.activeRow===h?(o.openBlock(),o.createBlock(Ye,{key:0,component:i.value,"row-length":s.config.length,values:h,onClose:f[0]||(f[0]=O=>e("update:activeRow",null)),onSave:d,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),s.activeRow===o.unref(A).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(Ye,{key:0,component:i.value,"row-length":u.value.length,onClose:f[1]||(f[1]=h=>e("update:activeRow",null)),onSave:d,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),Vt=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}}),Nr="",le=z(Vt,[["__scopeId","data-v-0ef9ae88"]]),Ft={class:"widget-button"},Ut=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("button",Ft,[e.wait?(o.openBlock(),o.createBlock(le,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),Ir="",Wt=z(Ut,[["__scopeId","data-v-450dc564"]]),jt={class:"widget-multi-button-wrap position_relative cursor_pointer"},qt={class:"widget-multi-button-body grid"},zt=["onClick"],xt={class:"widget-multi-button-side-wrap"},Gt=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(t){const e=t;o.useCssVars(d=>({"7025434e":r.value}));const n=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(d){if(!(typeof d!="function"||n.wait))return n.wait=!0,Promise.resolve().then(d).finally(()=>{n.wait=!1})}function a(d=!n.active){n.active=d}return(d,u)=>(o.openBlock(),o.createElementBlock("div",jt,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[o.createElementVNode("div",qt,[d.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:u[0]||(u[0]=s=>a())},o.toDisplayString(d.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.array,(s,f)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:f,onClick:h=>{i(s.callback),a(!1)}},o.toDisplayString(s.label),9,zt))),128))]),o.createElementVNode("div",xt,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:u[1]||(u[1]=s=>a())},[n.wait?(o.openBlock(),o.createBlock(o.unref(le),{key:0,class:"widget-multi-button-side-spinner"})):d.array.length>1?(o.openBlock(),o.createBlock(o.unref(ee),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}}),Rr="",Yt=z(Gt,[["__scopeId","data-v-a8d711d1"]]),Jt={class:"widget-loader flex flex-align_center gap_10 padding_15"},Ht={class:"text_md"},Kt=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",Jt,[o.createVNode(le,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",Ht,o.toDisplayString(e.label),1)]))}}),Xt=["alt","src"],Zt=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(t){const e=t,n=o.ref();return o.onMounted(()=>{n.value&&(n.value.src=e.src),n.value.onerror=function(){e.default&&(n.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:n,src:r.src||r.$props.default},null,8,Xt))}}),Qt={props:{config:Array,values:Object,selected:Boolean},setup:Ge},Or="",en=z(Qt,[["__scopeId","data-v-344a8cc1"]]),tn=t=>(o.pushScopeId("data-v-bf495d6a"),t=t(),o.popScopeId(),t),nn={class:"widget-list-head-cell"},rn=tn(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),on=o.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(t,{emit:e}){const n=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(r,i)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",nn,[o.createElementVNode("div",{class:"head-cell-content flex_grow",style:o.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(o.openBlock(),o.createBlock(o.unref(R.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(a=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=a=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(ee),{key:0,class:o.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:o.withCtx(()=>[o.createTextVNode("core-arrow-up")]),_:1},8,["class"])):o.createCommentVNode("",!0),rn])]))}}),vr="",an=z(on,[["__scopeId","data-v-bf495d6a"]]),sn=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const n=t,r=o.ref(),i=o.ref();o.onMounted(()=>{function s(C,S){let T=-1;do T++,S-=C[T];while(S>0&&T<C.length);return T}function f(C,S){let T=0;for(;S>0&&S>C[T]&&T<C.length;)S-=C[T],T++;return console.log(S,T),T>0?T:0}function h(C){try{i.value.style.insetInlineStart=C+"px"}catch(S){console.log(S)}}function b(C){try{i.value.style.width=C+"px",i.value.style.minWidth=C+"px",i.value.style.maxWidth=C+"px"}catch(S){console.log(S)}}function O(C){return C===null?!1:C.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(S){var at;function T(D){return D.screenX+g-p}const E=r.value,l=[...E.children].filter(D=>D.localName==="th"),g=((at=E.offsetParent)==null?void 0:at.scrollLeft)||0,y=l.map(D=>D.clientWidth),P=O(S.target),p=E.getBoundingClientRect().left,w=T(S),m=s(y,w),N=y.slice(0,m).reduce((D,j)=>D+j,0),v=w-N,W=E.offsetWidth,x=l[m].clientWidth;if(n.config[m].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",S.screenX),console.log("Widths",y),console.log("max width",W),console.log("Start Position",w),console.log("Position From",m),console.log("Start Position",m),console.log("Global offset (Отступ самой таблицы от края экрана)",p),console.log("Del",v),console.groupEnd(),i.value.innerText=l[m].textContent||"",i.value.style.display="grid",i.value.style.width=x+"px",i.value.style.cursor="grabbing",h(N),b(x),document.addEventListener("pointermove",it,{passive:!0}),document.addEventListener("pointerup",ye);function ye(D){if(console.group("END"),document.removeEventListener("pointermove",it),document.removeEventListener("pointerup",ye),P&&(n.config[m].width=i.value.style.width,n.config[m].minWidth=i.value.style.width,n.config[m].maxWidth=i.value.style.width,a(n.config)),!P){const j=D.screenX+g-p;console.log("ENP Position",j);const Ee=f(y,j);if(console.log(m,"->",Ee),Ee!==m){const re=n.config[m],Re=n.config;Re.splice(m,1),Re.splice(Ee,0,re),a(Re)}else{const re=n.config[m].name;d(re)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function it(D){if(P){const re=T(D)-w+x;b(re);return}let j=D.screenX+g-p-v;j<0&&(j=0),j+x>W&&(j=W-x),h(j)}})});function a(s){e("update:config",s)}function d(s){if(!s)return;if(Array.isArray(s)){if(s.length<1)return;s=s[0]}if(n.order.length===0||n.order[0]!==s)return void u([s]);const f=n.order.length===1||n.order[1]==="asc"?"asc":"desc";u([s,f==="asc"?"desc":"asc"])}function u(s){e("update:order",s)}return(s,f)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.config,(h,b)=>(o.openBlock(),o.createBlock(an,o.mergeProps({key:h},h,{onOrder:O=>d(h.name),onSelect:f[0]||(f[0]=O=>e("select")),order:s.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),Lr="",cn=z(sn,[["__scopeId","data-v-ccffc6bd"]]),ln={class:"widget-list"},un={class:"widget-list-body position_relative"},dn=50,fn=o.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(t,{emit:e}){const n=t;function r(u,s=!0){if(n.selectedRows)if(!s)a(n.selectedRows.includes(u)?[]:[u]);else{const f=[...n.selectedRows],h=f.indexOf(u);h===-1?f.push(u):f==null||f.splice(h,1),a(f)}}function i(){var u;if(((u=n.selectedRows)==null?void 0:u.length)!==n.array.length)return a([...n.array]);a([])}function a(u){e("update:selectedRows",u)}function d(u){if(!u)return;const s=u.target;s.scrollTop+s.clientHeight+dn>s.scrollHeight&&e("scrollEnd")}return(u,s)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:d},[o.createElementVNode("table",ln,[o.createElementVNode("thead",null,[o.createVNode(cn,{onSelect:s[0]||(s[0]=f=>i()),"onUpdate:order":s[1]||(s[1]=f=>e("update:order",f)),"onUpdate:config":s[2]||(s[2]=f=>e("update:config",f)),config:u.config,order:u.order},null,8,["config","order"])]),o.createElementVNode("tbody",un,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(f,h)=>{var b;return o.openBlock(),o.createBlock(en,{key:h,class:"widget-list-row",values:f,config:u.config,selected:(b=u.selectedRows)==null?void 0:b.includes(f),onSelect:O=>r(f,O)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),F={};function hn(t){for(let e in t)F[e]=t[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function pn(t){function e(...r){return n.wait?Promise.reject("The process has already started."):(n.wait=!0,Promise.resolve().then(()=>t(...r)).finally(()=>{n.wait=!1}))}const n=o.reactive({wait:!1,call:e});return n}function ue(t){return typeof t=="string"?de(t):gn(t)?de(t.message,t.children||t.details||[]):mn(t)?de(t.title,[t.detail||""]):de(A.DEFAULT_ERROR_MESSAGE)}function gn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"message"))}function mn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"title"))}function de(t,e=[]){return{message:t,children:e}}function M(t="error"){return function(e){const{message:n,children:r}=ue(e);te.add(t,n,{children:r})}}function fe(t,e={}){return k().emit("entity:read",{...e,entity:t})}function Ne(t,e){return k().emit("entity:update",{...e,entity:t})}function yn(t){return t.reduce((e,n)=>(n.name&&(typeof n.name=="string"?e.push(n.name):e.push(...n.name)),e),[])}function He(t,e=2){if(!(typeof t=="string"||typeof t=="number"))return"";let r=String(t).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}function En(t,e){const n=new Map;return t.forEach(r=>{var a;const i=e(r);n.has(i)||n.set(i,[]),(a=n.get(i))==null||a.push(r)}),n}function wn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function _n(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return A.DEFAULT_ERROR_MESSAGE}})}function $(t,e={}){return V.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=V.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw new Error(A.DEFAULT_ERROR_MESSAGE)}).then(n=>_n(n).then(r=>{if(!n.ok)throw r;return r}))}function Cn(t,e=1e3){let n=0;return(...r)=>{clearTimeout(n),n=setTimeout(()=>t(...r),e)}}function Tn(t,e){let n=!1;return(...r)=>{if(!n)return n=!0,setTimeout(()=>n=!1,e),t(...r)}}const An=_e(Se("pretty-value-field-by-entity"));function Sn(t,e,n){try{const r=me.get(t);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${t} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(r){return An('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,t,e,n),n}}const bn=1,kn=5e3,Nn="static-folder",Ke="request-error",In="Distinguisher",H=_e(Se("use-socket"));function k(){return On}function Rn(t){return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Blob]"}const On=function(){let t=1,e,n;const r=new Set;let i=0;const a=new Set;function d(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},kn*2);const l=new Uint8Array(1);l[0]=bn,e.send(l)}setInterval(()=>{Array.from(r).forEach(l=>{E(l)&&(H("Handler for event %s requestId %d was expired",l.event,l.requestId),l.requestId?s({requestId:l.requestId,event:Ke,data:{message:Y.RequestTookToLong().message}}):r.delete(l))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&f()},A.DELAY_SOCKET_RECONNECT);function u(){return{safeQueue:a,requestId:t,handlers:r,socketInstance:e}}function s(l){const g=[...r.values()];H("Handlers array length is %d. Response event: %s. Request id: %d",r.size,l.event,l.requestId),g.forEach(y=>{const P=l.requestId;(y.requestId&&y.requestId===P||!y.requestId&&y.event===l.event)&&(H("Find appropriated handler: %d, event: %s",t,y.event),y.callback(l.data,l),y.once&&(r.delete(y),H("Handler was removed by *once* params was passed. %o",y)))})}function f(){if(typeof n!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${n}`,"color: purple","color: black"),e=new WebSocket(n),e.onclose=function(l){H("Connection to server was stopped: %d %s",l.code,l.reason),Array.from(r).forEach(g=>{g.guaranteedAnswer&&g.serializeString&&a.add(g.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(l=>{h(l),a.delete(l)})},e.onerror=function(l){console.warn(l)},e.onmessage=l=>{var g;try{if(Rn(l.data)){d();return}const y=JSON.parse(l.data);if(!Xe(y)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(y);return}(g=y==null?void 0:y.data)!=null&&g.refresh&&location.reload(),s(y)}catch(y){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(y)}}}function h(l){e.send(l)}function b(l,g){T({event:l,callback:g})}function O(l,g){T({event:l,callback:g,once:!0})}function C(){return e&&(e==null?void 0:e.readyState)===1}function S(l,g,y){const P=++t,p=JSON.stringify({requestId:P,event:l,data:g,contextId:V.contextId,url:window.location.href});return C()?h(p):(a.add(p),H("Socket is not connected. Message was send to save-queue")),new Promise((w,m)=>{T({event:l,requestId:P,once:!0,guaranteedAnswer:!0,serializeString:p,callback:(N,v)=>{if(H("Promise was resolve with next data:",N),vn(v))return void m(N);y&&y(N,v),w(N)},timeToLive:A.TIME_TO_LIVE_SOCKET_REQUEST})})}function T(l){const g={timeToLive:0,...l,created:new Date().getTime()};r.add(g)}function E(l){return l.timeToLive===0||typeof l.timeToLive!="number"?!1:new Date().getTime()-l.created>l.timeToLive}return{get socket(){return e},on:b,once:O,emit:S,initialization(l){n=l},getDevInfo:u}}(),vn=t=>!!Xe(t)&&t.event===Ke,Xe=t=>typeof t=="object"&&t!==null&&"event"in t&&typeof t.event=="string"&&"requestId"in t&&typeof t.requestId=="number"&&"data"in t;function Ln(t,e){return k().emit("list-setting:read",{entity:t,mark:e})}function $n(t,e){return k().emit("metadata-field:treat",{entity:t,fieldName:e})}function Ze(t,e){return k().emit("entity:create",{...e,entity:t})}function Qe(t,e){return k().emit("entity:delete",{...e,entity:t})}function Pn(t,e){return k().emit("usage-context:read",{...e,entity:t})}function et(t={}){return k().emit("tool:read",t)}function Dn(t,e={},n={}){const r=o.inject(A.PROVIDE_NAME_ACTIONS,null),i=typeof t=="string"?t:e,a=typeof e=="string"?n:e;return o.computed(()=>{var s;const u=((typeof t=="string"?(s=r==null?void 0:r.actions)==null?void 0:s.value:o.unref(t))||[]).find(f=>f.name===i);return u?{...u,...a}:null})}function Bn(t){return k().emit("history:read",t)}function Mn(t,e){return k().emit("entity:count",{...e,entity:t})}function Vn(t){return`/${Nn}/${t}`}function he(t){return{exec(e,n){switch(t.name){case"replace-boolean":return he.replaceBoolean(e,t.values)}}}}he.replaceBoolean=Fn;function Fn(t,e){return t?e[1]:e[0]}function Un(){const t=o.ref(null);function e(n){t.value=n}return{activeRow:t,activateRow:e}}function tt(t,e){return typeof t!="object"||t===null?!1:Object.values(t).join().toLowerCase().includes(e)}async function nt(t,e){t()&&(await e(),await nt(t,e))}function Wn(t,e,n={}){const r=o.ref(""),i=o.computed(()=>a.filter(p=>tt(p,r.value))),a=o.reactive([]);let d=0;const u=o.ref(!1);function s(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function f(){if(u.value)return Promise.reject("The process has already started.");const p=g();return u.value=!0,typeof p.limit!="number"&&(p.limit=100),p.offset=d,(n.request||fe)(t,p).then(m=>(d+=m.length,m)).finally(()=>{u.value=!1})}function h(p,w){var N;return typeof p.Version=="number"?p.Version:(N=a.find(v=>v.Id===w))==null?void 0:N.Version}function b(p,w){const m=a.findIndex(N=>N.Id===p);if(m===-1)throw new Error(`Can't found item with Id ${p}`);a.splice(m,1,w)}function O(p){const w=a.findIndex(m=>m.Id===p);if(w===-1)throw new Error(`Can't found item with Id ${p}`);a.splice(w,1)}async function C(p,w){try{const m=g(),N=h(w,p);delete w.Version,await Ne(t,{id:p,values:w,version:N,masterEntities:s()});const v=await fe(t,{fields:m.fields||"",id:p});b(p,v)}catch(m){M()(m)}}async function S(p,w={}){try{const m=g(),N=h(w,p);delete w.Version,await Qe(t,{id:p,version:N,masterEntities:s()}),O(p)}catch(m){M()(m)}}async function T(p){try{await Ze(t,{values:p,masterEntities:s()}),await y()}catch(w){M()(w)}}let E;async function l(){try{const p=E==null?void 0:E.signal;E!=null&&E.signal&&!E.signal.aborted&&E.abort(),E=new AbortController;let w=0,m=!1;const v=g().limit||0;if(r.value&&!v){console.warn("Using textSearch assumes the use of limit.");return}await nt(()=>{var W;return w<v&&!m&&!((W=E==null?void 0:E.signal)!=null&&W.aborted)},async()=>{var x;console.log("Step read data. Count for filter %d",w);const W=await f();(x=E==null?void 0:E.signal)!=null&&x.aborted||(a.push(...W),w+=W.filter(ye=>tt(ye,r.value)).length,W.length<v&&(m=!0))})}catch(p){M()(p)}}function g(){return typeof e=="function"?e():e}async function y(){try{d=0,a.splice(0,a.length),await l()}catch(p){M()(p)}}function P(){if(E)return E.abort()}return{array:a,updateById:C,next:l,reload:y,wait:u,create:T,deleteById:S,textSearch:r,filteredArray:i,abort:P}}function jn(){function t(){return{organizations:V.organizations,currentContextId:V.contextId,person:V.person,context:V.context,contextType:V.contextType,userId:V.userId}}const e=o.reactive(t());return V.onupdateContext(()=>{Object.assign(e,t())}),e}function qn(t,e,n){return k().emit("communication:create",{entityName:t,entityCatalogId:e,targetCode:n})}function zn(t,e,n){return k().emit("communication:read",{entityName:t,entityCatalogId:e,targetCode:n})}function xn(t,e){return k().emit("communication-message:create",{communicationId:t,text:e})}function Gn(t){return k().emit("communication-message:read",{communicationId:t})}function Yn(t){const e=R.Form.getParentForm(),n=o.reactive([]);return e&&e.subscribe(t),t.read=()=>Gn(t.id).then(r=>(n.splice(0,n.length,...r),r)),{array:n}}function Jn(t,e){t.read=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw Y.EntityWithoutName(t);return fe(t.name,r)}).then(Ie).then(i=>(i.hasOwnProperty("Version")&&(t.version=i.Version),t.setValues(i),i)).catch(M())},t.save=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw Y.EntityWithoutName(t);return Ne(t.name,{id:r.id,values:t.changes,version:t.version})}).then(i=>{t.version=i.version}).catch(i=>{throw M()(i),i})};function n(){return typeof e=="function"?e():e}}function Hn(t){if(!t)return o.inject(A.PROVIDE_NAME_METADATA);me.initEntity(t);const e=o.computed(()=>me.state[t]);return o.provide(A.PROVIDE_NAME_METADATA,e),e}function Kn(t,e={}){if(!t)return o.inject(A.PROVIDE_NAME_USAGE_CONTEXT);const n=o.ref(null);return o.provide(A.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await Pn(t,Xn(e||{}))}}}function Xn(t){return typeof t=="function"?t():t}function Zn(t={}){return k().emit("tool:execute",t)}function Qn(t){if(!t)return o.inject(A.PROVIDE_NAME_ACTIONS);const e=o.reactive([]),n=o.computed(()=>e.map(a=>er(t,a))),r={actions:n,update:i};o.provide(A.PROVIDE_NAME_ACTIONS,r),t.router=Oe.useRouter(),t.handleConfirmation||(t.handleConfirmation=nr),t.handleAffectedEntity||(t.handleAffectedEntity=or),t.handleCloseForm||(t.handleCloseForm=ir),t.handleValidationResult||(t.handleValidationResult=rr);function i(a={}){return e.splice(0,e.length),et(a).then(d=>e.splice(0,0,...d)).catch(M("error"))}return{actions:n,update:i}}function er(t,e){return{...e,label:e.title,callback(){var i;const n=typeof t.values=="function"?t.values(e,t):t.values,r=()=>Zn({name:e.name,values:n}).then(async a=>{var d,u;if(!ar(a))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(t.handlers))for await(const s of t.handlers)await s(e,a,t);if(!a.success)throw t.handleValidationResult&&a.validationEffect&&((u=(d=a.validationEffect)==null?void 0:d.results)!=null&&u.length)&&t.handleValidationResult(e,a.validationEffect,t),new Error(a.message);return a.message&&te.add("info",a.message),Array.isArray(a.affectedEntities)&&t.handleAffectedEntity&&a.affectedEntities.forEach(s=>{var f;return(f=t.handleAffectedEntity)==null?void 0:f.call(t,e,s,t)}),e.closeHostForm&&t.handleCloseForm&&t.handleCloseForm(e,t),a}).catch(M("error"));return(i=t.overrides)!=null&&i[e.name]?t.overrides[e.name](e,t):e.requireSave&&t.form&&t.form.changed?t.form.save().then(r):!e.confirmation||!t.handleConfirmation?r():t.handleConfirmation(e,r)}}}function tr(t){const e="Are you sure?";return t===!0||typeof t=="string"&&t.toLowerCase()==="true"||t==="1"?e:typeof t=="string"?t:e}async function nr(t,e){const n=tr(t.confirmation);if(!oe.getComponentFromStore(A.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await oe.promptModal(A.MODAL_CONFIRM,{message:n}))return e()}function rr(t,e){const n=A.MODAL_VALIDATION_EFFECT;if(!oe.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{oe.pushModal(n,e)})}function or(t,e,n){var d;const{router:r,form:i}=n,a=(d=e.primaryKey)==null?void 0:d.Id;if(r&&e&&e.name===t.redirectEntity)return r.push({name:e.name,params:{id:a}});i&&e.name===i.name&&e.updated&&a===i.id&&i.read()}function ir(t,e){const{router:n}=e;n&&t.closeHostForm&&n.back()}function ar(t){return!!(t&&typeof t=="object"&&"affectedEntities"in t&&"success"in t)}function sr(t){function e(n){n.key==="Enter"&&t()}o.onMounted(()=>{document.addEventListener("keypress",e)}),o.onUnmounted(()=>{document.removeEventListener("keypress",e)})}function cr(t,e={}){const n=o.reactive([]),r=s=>{const f=o.unref(t);if(s===void 0){n.length===0?f.forEach(a):f.forEach(d);return}i(s)?d(s):a(s)},i=s=>n.includes(s),a=s=>{e.handleSelect&&!e.handleSelect(s)||i(s)||n.push(s)},d=s=>{const f=n.findIndex(h=>h===s);f!==-1&&n.splice(f,1)},u=o.computed(()=>{const s=o.unref(t);return n.length===s.length&&s.length!==0});return[n,r,u,a,d]}function lr(t){const e=o.ref(""),n=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(t).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:n}}const te=new class{constructor(){this.store=o.reactive([])}add(e,n,r={}){const i=ur(r),a=new dr(e,n,i.timeout,i.children,i.click);return this.store.push(a),i.timeout&&setTimeout(this.remove.bind(this,a.id),i.timeout*1e3),a}remove(e){const n=this.store.findIndex(r=>r.id===e);if(n===-1)return!1;this.store.splice(n,1)}};function ur(t){function e(r){return!!r&&typeof r=="object"}const n={timeout:10,click:()=>null,children:[]};return e(t)?{timeout:t.timeout||n.timeout,click:t.click||n.click,children:t.children||n.children}:n}const rt=class ct{constructor(e,n,r,i,a){this.type=e,this.message=n,this.timeout=r,this.children=i,this.click=a,this.id=ct.cardId++}};rt.cardId=1;let dr=rt;class fr extends q{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return xn(this.id,e)}static checkAndGenerate(e,n,r){return zn(e,n,r).then(i=>i.length===0?qn(e,n,r):i[0])}}function hr(){return k().emit("client:read",{})}var ot=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},pr=(t,e,n)=>(ot(t,e,"read from private field"),n?n.call(t):e.get(t)),gr=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},mr=(t,e,n,r)=>(ot(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),pe;const ge=class Z extends q{constructor(){super(...arguments),this.type="front",this.organizations=[],gr(this,pe,!1)}set language(e){localStorage.setItem(A.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(A.LOCALSTORAGE_LANGUAGE_KEY)||Z.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){mr(this,pe,e),this.emit(Z.EVENT_READY_UPDATE,e)}get ready(){return pr(this,pe)}onReady(e){return this.on(Z.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(Z.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(A.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(Z.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(n=>n.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.userId=e.userId,this.restoreCurrentContext(),this.ready=!0}catch(e){M()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(A.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return hr()}validateContextId(e){var n;try{return((n=this.person)==null?void 0:n.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};pe=new WeakMap,ge.DEFAULT_LANGUAGE="en",ge.EVENT_CONTEXT_UPDATE="event:context-update",ge.EVENT_READY_UPDATE="event:ready-update";let yr=ge;function Er(t){return k().emit("metadata:read",{entity:t})}const me=function(){const e=o.reactive({}),n=new Map;function r(u){return e[u]}async function i(u){if(n.has(u)&&await n.get(u),e[u])return;const s=await a(u);d(u,s)}function a(u){const s=Er(u).finally(()=>{n.delete(u)});return n.set(u,s),s}function d(u,s){e[u]=s}return{state:e,initEntity:i,get:r}}();class U{static login(e){return $(F.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:F.applicationName})})}static parseProcessAnswer(e){if(e.statusCode>4)throw new Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return U.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return U.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return U.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return U.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,n){return $(`${F.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(e){return U.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return U.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return U.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,n){return $(`${F.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(U.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startPasswordReset(e,n){return $(`${F.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:n,AppName:e})})}static confirmPhoneNumberByAccessRecovery(e,n,r,i){return $(`${F.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:i})})}static confirmEmailByAccessRecovery(e,n,r,i){return $(`${F.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:i})})}static finishAccessRecovery(e,n,r){return $(`${F.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Password:r,ConfirmedPassword:r})})}}class wr{static readHistoryById(e,n){return $(`/close-api/audits/history/${e}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class _r{static readLicences(e){const n=`/close-api/proxy/Dashboard/Licenses?organizationId=${e.toString()}`;return $(n).then(r=>{const i={};return r.byOrganization.licenses.forEach(a=>{const d=a.licenseTypeCode;i[d]||(i[d]={licenseTypeCode:d}),i[d][a.statisticName]=a.value}),Object.values(i)})}}class Cr{static getConfiguration(){return $("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(e){return await $(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}function Tr(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function I(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];if(Array.isArray(r)){const i=r.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return r.length&&e.push(`@${n} in (${i})`),e}if(Tr(r)){let i=function(a){var d;return((d=a.match(/([^Z]*)/))==null?void 0:d[0])+"0000Z"};return r.start&&e.push(`@${n} ge ${i(r.start)}`),r.end&&e.push(`@${n} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${n} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${n} eq '${r}'`),e):(r===null&&e.push(I.is(n,r)),e)},[]).join(" and ")}function ne(t){return typeof t=="string"?`'${t}'`:`${t}`}I.includes=function(e,n){return`@${e} Contains ${ne(n)}`},I.beginWith=function(e,n){return`@${e} BeginWith ${ne(n)}`},I.notEq=function(e,n){return`@${e} nq ${ne(n)}`},I.eq=function(e,n){return Array.isArray(n)?I.in(e,n):`@${e} eq ${ne(n)}`},I.in=function(e,n){const r=n.map(ne).join(", ");return`@${e} in (${r})`},I.notIn=function(e,n){return!Array.isArray(n)||n.length===0?"":I.and(...n.map(r=>I.notEq(e,r)))},I.and=function(...e){return e.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(I.wrap).join(" and ")},I.wrap=function(e){return`(${e})`},I.is=function(e,n){return`@${e} is ${n}`},I.or=function(...e){return e.join(" or ")};function Ie(t){return Object.keys(t).reduce((e,n)=>{let r=t[n];const i=n.charAt(0).toUpperCase()+n.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Ie(r)),e[i]=r,e},{})}const V=new yr;c.Communication=fr,c.CoreError=Y,c.Filter=I,c.Manager=V,c.MetadataStore=me,c.NotificationSystem=te,c.OBJECT_TYPE_NAME_FIELD=In,c.WidgetButton=Wt,c.WidgetIcon=ee,c.WidgetImage=Zt,c.WidgetList=fn,c.WidgetLoader=Kt,c.WidgetMultiButton=Yt,c.WidgetSpinner=le,c.WidgetTable=Mt,c.asyncProcess=pn,c.authService=U,c.billingService=X,c.catchUniversal=M,c.clientService=Ue,c.config=hn,c.configuration=F,c.constants=A,c.dashboardService=_r,c.debounce=Cn,c.documentsService=wt,c.fileService=yt,c.formatter=he,c.getCellName=qe,c.getCellValue=Ae,c.getNamesFromListConfig=yn,c.getUnitValue=ke,c.groupArrayByField=En,c.historyService=wr,c.injectAction=Dn,c.internationalizationService=mt,c.invitationService=Et,c.openService=Cr,c.parseError=ue,c.prettyDate=be,c.prettyDateWithTime=ze,c.prettyMoney=He,c.prettyValueFieldByEntity=Sn,c.processWizardService=ce,c.request=$,c.staticLink=Vn,c.t=K,c.throttle=Tn,c.universalEntityCount=Mn,c.universalEntityCreate=Ze,c.universalEntityDelete=Qe,c.universalEntityRead=fe,c.universalEntityUpdate=Ne,c.universalHistoryRead=Bn,c.universalListSettingRead=Ln,c.universalMetadataFieldTreat=$n,c.universalToolRead=et,c.useActions=Qn,c.useCommunication=Yn,c.useEnter=sr,c.useFormEntity=Jn,c.useListActiveRow=Un,c.useListEntity=Wn,c.useListSearch=lr,c.useListSelect=cr,c.useManagerState=jn,c.useMetadata=Hn,c.useSocket=k,c.useUsageContext=Kn,c.useWizard=At,c.uuidv4=wn,c.valuesToUpperCase=Ie,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
10
+ */const Pe=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},De=function(t,e){t in this.events&&this.events[t].forEach(n=>n(e))},Be=function(t,e){const n=this.events[t];if(!n)return;const r=n.indexOf(e);r!==-1&&n.splice(r,1)},Me=function(){this.events={}};class j{constructor(){this.events={}}on(e,n){return Pe.call(this,e,n)}emit(e,n){return De.call(this,e,n)}off(e,n){return Be.call(this,e,n)}cleanEvents(){Me.call(this)}static on(e,n){return Pe.call(j,e,n)}static emit(e,n){return De.call(j,e,n)}static off(e,n){return Be.call(j,e,n)}static cleanEvents(){Me.call(j)}}j.events={};var Ve=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},ie=(t,e,n)=>(Ve(t,e,"read from private field"),n?n.call(t):e.get(t)),Ce=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Te=(t,e,n,r)=>(Ve(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Q,ae,se;const J=class B extends j{constructor(){super(...arguments),Ce(this,Q,void 0),Ce(this,ae,"front"),this.organizations=[],Ce(this,se,!1)}set language(e){localStorage.setItem(B.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(B.LOCALSTORAGE_LANGUAGE_KEY)||B.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(B.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){Te(this,Q,e)}get router(){if(!ie(this,Q))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return ie(this,Q)}set type(e){Te(this,ae,e)}get type(){return ie(this,ae)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Te(this,se,e),this.emit(B.EVENT_READY_UPDATE,e)}get ready(){return ie(this,se)}onReady(e){return this.on(B.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(B.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(B.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(B.CURRENT_CONTEXT_KEY,String(e)),this.emit(B.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(n=>n.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const n=Number.parseInt(localStorage.getItem(B.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(n)&&this.validateContextId(Number(n))?this.setCurrentContext(n):this.setCurrentContext(Number(e.id))}catch{dt.add("error",Y.ApiNotAvailable().message)}}loadCustomerData(){return Ue.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var n;return((n=this.person)==null?void 0:n.id)==e?!0:!!this.organizations.find(r=>r.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const n=localStorage.getItem(this.getListKeyById(e));return n&&JSON.parse(n)}setListInformationToLocalStorage(e,n){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(n))}};Q=new WeakMap,ae=new WeakMap,se=new WeakMap,J.DEFAULT_LANGUAGE="en",J.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage",J.EVENT_CONTEXT_UPDATE="event:context-update",J.EVENT_READY_UPDATE="event:ready-update",J.EVENT_DATA_UPDATE="event:data-update",J.CURRENT_CONTEXT_KEY="CurrentContext";let ht=J;const Fe=new ht;function pt(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return ut}})}function L(t,e={}){return Fe.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=Fe.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw Y.ApiNotAvailable()}).then(n=>pt(n).then(r=>{if(!n.ok)throw r;return r}))}class gt{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,n,r)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[n]=r,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}new gt;class Ue{static getClientData(){return L("/close-api/client-content")}static getNavigation(){return L("/close-api/client/navigation")}}class mt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return L(`/open-api/internationalization/language/${e}`)}}function We(t){return{...t,createdEntities:t.createdEntites}}const qe=class we{static async getStartConfig(e,n){return L([we.url,e,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,n){return L([we.url,e,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(We)}static async runStep(e,n,r,i,a){return L([we.url,e,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:a})}).then(We)}};qe.url="/close-api/views/process-wizard";let ce=qe;class yt{static async upload(e,n){const r=new FormData;r.append("file",e);const i=`/close-api/files?entityName=${n}`;return await fetch(i,{method:"POST",body:r}).then(a=>a.json()).then(a=>(a.filename=e.name,a))}}class Et{static invite(e,n,r){return L("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:n,relatedRoleCode:r})})}static accept(e,n){return L("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!0})})}static decline(e,n){return L("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!1})})}}class wt{static getRequiredDocuments(e,n,r){const i=new URLSearchParams({entity:e,primaryKey:n,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(a=>a.json())}}class X{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${X.url()}/calculator/${e}`)}static calculate(e,n){return L(`/${X.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:n})}).then(r=>{if(r&&r.status===1)return r;throw Array.isArray(r.notes)?new Error(r.notes[0]):Y.ApiNotAvailable()})}static parseMetadataField(e){function n(r){switch(r.type){case"ValueType":switch(r.dataType){case"Integer":return"number";default:return r.dataType}case"EntityReference":return r.dataType}}return{name:e.name,label:e.title,required:e.required,type:n(e)}}static createOnlinePayment(e,n){return L(`/${X.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:n})})}static applyOnlinePayment(e){return L(`/${X.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}function _t(t){return t.statusName==="Completed"}function Ct(t){return t.statusName==="FinalStepWithConfirmation"}function Tt(t){return t.statusName==="ValidationError"}function At(t,e,n){let r=null;const i=o.reactive({wait:null});let a=[],d=null;const u=o.ref(null);function s(){u.value=a.find(l=>l.name===d)||null}function f(){var l;return d?((l=a.find(g=>g.name===d))==null?void 0:l.fields)||[]:[]}function h(l){if(s(),Tt(l))return void n.onValidation(l.validationResults);if((l.statusName==="FinalStep"||l.statusName==="NextStep")&&(!f().length||St(f(),n.presets)))return E(n.presets||{});_t(l)&&n.onCompleted(l),Ct(l)&&n.onConfirmation(l)}async function b(){try{await O(),await T()}catch(l){const{message:g}=ue(l);te.add("error",g)}}function O(){return i.wait="Loading process information.",ce.getStartConfig(e,t).then(l=>{a=l.steps.map(g=>({label:g.title,name:g.stepName,number:g.number,fields:g.frontendEntity.objectTypes.reduce((y,P)=>(P.properties.forEach(p=>{y.push({name:p.name,label:p.title,type:p.refEntityName||p.dataType})}),y),[])}))}).then(l=>(i.wait=!1,l))}function C(l){return d=l.nextStepName,r=l.token,l}function S(l){const g=ue(l);te.add("error",g.message)}function T(){return i.wait="Starting process",ce.startProcess(e,t).then(C).then(h).catch(S).finally(()=>{i.wait=null})}function E(l={}){return!r||!d?Promise.reject("Not step or token."):(i.wait="Waiting for result...",ce.runStep(e,t,d,r,l).then(C).then(h).catch(S).finally(()=>{i.wait=!1}))}return{initialize:b,state:i,currentStepConfig:o.readonly(u),next:E}}function St(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(!R.utils.getPropFromObject(e,r.name))return!1}return!0}const bt={class:"widget-table__head"},kt={class:"widget-table__head-label margin_0 text_overflow"},Nt=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("tr",bt,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.config,(r,i)=>(o.openBlock(),o.createElementBlock("th",{class:"widget-table__head-cell",key:i},[o.createElementVNode("p",kt,o.toDisplayString(r.label),1)]))),128))]))}}),Sr="",z=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},It=z(Nt,[["__scopeId","data-v-25198f4a"]]);function je(t){return typeof t.name=="string"?t.name:Array.isArray(t.name)?t.name[0]:null}function Rt(t){const e=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let r;for(;(r=e.exec(t))!==null;)n.push(r[1]);return n}function Ot(t,e){return Rt(t).forEach(r=>{t=t.replace(new RegExp("\\$\\{"+r+"}","g"),R.utils.getPropFromObject(e,r))}),t}function Ae(t,e){if(typeof t.value=="string")return Ot(t.value,e);const n=je(t);let r=n?R.utils.getPropFromObject(e,n):null;return r===void 0&&(r=null),t.value?t.value(r,e):t.value===null?null:r}const A={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",TIME_TO_LIVE_SOCKET_REQUEST:3e4,CORE_DEBUG_LABEL:"eservices-core"};function Se(t){return[A.CORE_DEBUG_LABEL,t].join(":")}function ze(t){return be(t,"YYYY/MM/DD HH:mm:ss")}function be(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return lt.format(n,e)}catch(n){return console.log(n),"Invalid date"}}const br="",ee=z({props:{name:String},setup(t,e){let n="unknown";try{n=e.slots.default()[0].children}catch{n=t.name}typeof n!="string"&&console.warn(`Name for Icon.vue is not string. ${n}`);try{n=n.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${n}`})}},[["__scopeId","data-v-e287c8d9"]]);function ke(t){return e=>typeof e=="string"||typeof e=="number"?`${e} ${t}`:""}const vt=_e(Se("setup-list-row"));function Lt(t,e){const n=t.config.map(r=>$t(r,t,e));return o.h("tr",{class:"widget-table__row widget-table-row"},n)}function $t(t,e,n){const r=e.values;let i=Ae(t,r);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function d(h){a.onClick.push(()=>h(r))}function u(h){Array.isArray(h)?a.class.push(...h):a.class.push(h)}const s=[],f=[];if(t.unitValue&&(i=ke(t.unitValue)(i)),t.unit&&(i=ke(t.unit)(i)),t.hide&&t.hide(r))return[o.h("td")];if(t.type)switch(u(`widget-table-cell_${t.type}`),t.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=be(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=ze(typeof i=="string"?i:null);break}case"money":{i=He(i);break}case"multi-select":{f.push(o.h(R.FormField,{type:"single-checkbox",modelValue:e.selected})),d(xe.bind(null,n,!0));break}case"select":{f.push(o.h(R.FormField,{type:"single-radio",modelValue:e.selected})),d(xe.bind(null,n,!1));break}}if(t.onClick&&d(t.onClick),t.link)try{const h=t.link(r);if(h){const b=o.h(Oe.RouterLink,{to:h});f.push(b),u("widget-table-cell_link")}}catch(h){vt("Can't add router link",h)}if(t.href&&(f.push(o.h("a",{href:t.href(r),target:"_blank"})),u("widget-table-cell_link")),t.formatter&&(i=he(t.formatter).exec(i,r)),typeof i=="boolean"&&(i=i?"✓":"—"),(typeof i=="string"||typeof i=="number")&&f.push(o.h("p",{class:"widget-list-cell-text"},i)),t.icon&&(typeof t.icon=="string"&&f.push(o.h(ee,{name:t.icon})),typeof t.icon=="function")){const h=t.icon(r);h!==null&&f.push(o.h(ee,{name:h}))}return t.class&&(typeof t.class=="function"?u(t.class(r)):u(t.class)),s.push(o.h("td",a,f)),s}function xe(t,e){t.emit("select",e)}function Ge(t,e){return()=>{try{return Lt(t,e)}catch(n){return console.warn(n),null}}}const Pt={props:{values:Object,config:Object,selected:Boolean},setup:Ge},Dt=["colspan"],Ye=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(t,{emit:e}){const n=o.ref();return o.onMounted(()=>{setTimeout(()=>{n.value&&n.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:n},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=a=>e("close")),onSave:i[1]||(i[1]=a=>e("save",a))}),null,16,["values","new"]))],8,Dt)],512))}}),Bt={class:"widget-table"},Je="update:selectedRows",Mt=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1}},emits:["update:activeRow","save"],setup(t,{emit:e}){const n=t,r=o.useSlots(),i=o.computed(()=>{var s;return(s=r==null?void 0:r.default)==null?void 0:s.call(r)[0]});function a(s,f=!0){if(!n.selectedRows)return;if(!f)return e(Je,n.selectedRows.includes(s)?[]:[s]);const h=[...n.selectedRows],b=h.indexOf(s);return b===-1?h.push(s):h.splice(b,1),e(Je,h)}function d(s){e("save",s),e("update:activeRow",null)}const u=o.computed(()=>n.shortcut?n.config.filter(s=>s.name?!!n.array.find(h=>![null,""].includes(Ae(s,h))):!0):n.config);return(s,f)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",Bt,[o.createVNode(It,{config:u.value},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.array,(h,b)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:b},[o.createVNode(Pt,{config:u.value,values:h,selected:s.selectedRows.includes(h),onSelect:O=>a(h,O),class:o.normalizeClass(s.classCallback?s.classCallback(h):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&s.activeRow===h?(o.openBlock(),o.createBlock(Ye,{key:0,component:i.value,"row-length":s.config.length,values:h,onClose:f[0]||(f[0]=O=>e("update:activeRow",null)),onSave:d,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),s.activeRow===o.unref(A).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(Ye,{key:0,component:i.value,"row-length":u.value.length,onClose:f[1]||(f[1]=h=>e("update:activeRow",null)),onSave:d,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),Vt=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}}),Nr="",le=z(Vt,[["__scopeId","data-v-0ef9ae88"]]),Ft={class:"widget-button"},Ut=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("button",Ft,[e.wait?(o.openBlock(),o.createBlock(le,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),Ir="",Wt=z(Ut,[["__scopeId","data-v-450dc564"]]),qt={class:"widget-multi-button-wrap position_relative cursor_pointer"},jt={class:"widget-multi-button-body grid"},zt=["onClick"],xt={class:"widget-multi-button-side-wrap"},Gt=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(t){const e=t;o.useCssVars(d=>({"7025434e":r.value}));const n=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(d){if(!(typeof d!="function"||n.wait))return n.wait=!0,Promise.resolve().then(d).finally(()=>{n.wait=!1})}function a(d=!n.active){n.active=d}return(d,u)=>(o.openBlock(),o.createElementBlock("div",qt,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[o.createElementVNode("div",jt,[d.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:u[0]||(u[0]=s=>a())},o.toDisplayString(d.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.array,(s,f)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:f,onClick:h=>{i(s.callback),a(!1)}},o.toDisplayString(s.label),9,zt))),128))]),o.createElementVNode("div",xt,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:u[1]||(u[1]=s=>a())},[n.wait?(o.openBlock(),o.createBlock(o.unref(le),{key:0,class:"widget-multi-button-side-spinner"})):d.array.length>1?(o.openBlock(),o.createBlock(o.unref(ee),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}}),Rr="",Yt=z(Gt,[["__scopeId","data-v-a8d711d1"]]),Jt={class:"widget-loader flex flex-align_center gap_10 padding_15"},Ht={class:"text_md"},Kt=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",Jt,[o.createVNode(le,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",Ht,o.toDisplayString(e.label),1)]))}}),Xt=["alt","src"],Zt=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(t){const e=t,n=o.ref();return o.onMounted(()=>{n.value&&(n.value.src=e.src),n.value.onerror=function(){e.default&&(n.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:n,src:r.src||r.$props.default},null,8,Xt))}}),Qt={props:{config:Array,values:Object,selected:Boolean},setup:Ge},Or="",en=z(Qt,[["__scopeId","data-v-344a8cc1"]]),tn=t=>(o.pushScopeId("data-v-bf495d6a"),t=t(),o.popScopeId(),t),nn={class:"widget-list-head-cell"},rn=tn(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),on=o.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(t,{emit:e}){const n=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(r,i)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",nn,[o.createElementVNode("div",{class:"head-cell-content flex_grow",style:o.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(o.openBlock(),o.createBlock(o.unref(R.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(a=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=a=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(ee),{key:0,class:o.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:o.withCtx(()=>[o.createTextVNode("core-arrow-up")]),_:1},8,["class"])):o.createCommentVNode("",!0),rn])]))}}),vr="",an=z(on,[["__scopeId","data-v-bf495d6a"]]),sn=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const n=t,r=o.ref(),i=o.ref();o.onMounted(()=>{function s(C,S){let T=-1;do T++,S-=C[T];while(S>0&&T<C.length);return T}function f(C,S){let T=0;for(;S>0&&S>C[T]&&T<C.length;)S-=C[T],T++;return console.log(S,T),T>0?T:0}function h(C){try{i.value.style.insetInlineStart=C+"px"}catch(S){console.log(S)}}function b(C){try{i.value.style.width=C+"px",i.value.style.minWidth=C+"px",i.value.style.maxWidth=C+"px"}catch(S){console.log(S)}}function O(C){return C===null?!1:C.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(S){var at;function T(D){return D.screenX+g-p}const E=r.value,l=[...E.children].filter(D=>D.localName==="th"),g=((at=E.offsetParent)==null?void 0:at.scrollLeft)||0,y=l.map(D=>D.clientWidth),P=O(S.target),p=E.getBoundingClientRect().left,w=T(S),m=s(y,w),N=y.slice(0,m).reduce((D,q)=>D+q,0),v=w-N,W=E.offsetWidth,x=l[m].clientWidth;if(n.config[m].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",S.screenX),console.log("Widths",y),console.log("max width",W),console.log("Start Position",w),console.log("Position From",m),console.log("Start Position",m),console.log("Global offset (Отступ самой таблицы от края экрана)",p),console.log("Del",v),console.groupEnd(),i.value.innerText=l[m].textContent||"",i.value.style.display="grid",i.value.style.width=x+"px",i.value.style.cursor="grabbing",h(N),b(x),document.addEventListener("pointermove",it,{passive:!0}),document.addEventListener("pointerup",ye);function ye(D){if(console.group("END"),document.removeEventListener("pointermove",it),document.removeEventListener("pointerup",ye),P&&(n.config[m].width=i.value.style.width,n.config[m].minWidth=i.value.style.width,n.config[m].maxWidth=i.value.style.width,a(n.config)),!P){const q=D.screenX+g-p;console.log("ENP Position",q);const Ee=f(y,q);if(console.log(m,"->",Ee),Ee!==m){const re=n.config[m],Re=n.config;Re.splice(m,1),Re.splice(Ee,0,re),a(Re)}else{const re=n.config[m].name;d(re)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function it(D){if(P){const re=T(D)-w+x;b(re);return}let q=D.screenX+g-p-v;q<0&&(q=0),q+x>W&&(q=W-x),h(q)}})});function a(s){e("update:config",s)}function d(s){if(!s)return;if(Array.isArray(s)){if(s.length<1)return;s=s[0]}if(n.order.length===0||n.order[0]!==s)return void u([s]);const f=n.order.length===1||n.order[1]==="asc"?"asc":"desc";u([s,f==="asc"?"desc":"asc"])}function u(s){e("update:order",s)}return(s,f)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.config,(h,b)=>(o.openBlock(),o.createBlock(an,o.mergeProps({key:h},h,{onOrder:O=>d(h.name),onSelect:f[0]||(f[0]=O=>e("select")),order:s.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),Lr="",cn=z(sn,[["__scopeId","data-v-ccffc6bd"]]),ln={class:"widget-list"},un={class:"widget-list-body position_relative"},dn=50,fn=o.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(t,{emit:e}){const n=t;function r(u,s=!0){if(n.selectedRows)if(!s)a(n.selectedRows.includes(u)?[]:[u]);else{const f=[...n.selectedRows],h=f.indexOf(u);h===-1?f.push(u):f==null||f.splice(h,1),a(f)}}function i(){var u;if(((u=n.selectedRows)==null?void 0:u.length)!==n.array.length)return a([...n.array]);a([])}function a(u){e("update:selectedRows",u)}function d(u){if(!u)return;const s=u.target;s.scrollTop+s.clientHeight+dn>s.scrollHeight&&e("scrollEnd")}return(u,s)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:d},[o.createElementVNode("table",ln,[o.createElementVNode("thead",null,[o.createVNode(cn,{onSelect:s[0]||(s[0]=f=>i()),"onUpdate:order":s[1]||(s[1]=f=>e("update:order",f)),"onUpdate:config":s[2]||(s[2]=f=>e("update:config",f)),config:u.config,order:u.order},null,8,["config","order"])]),o.createElementVNode("tbody",un,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(f,h)=>{var b;return o.openBlock(),o.createBlock(en,{key:h,class:"widget-list-row",values:f,config:u.config,selected:(b=u.selectedRows)==null?void 0:b.includes(f),onSelect:O=>r(f,O)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),F={};function hn(t){for(let e in t)F[e]=t[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function pn(t){function e(...r){return n.wait?Promise.reject("The process has already started."):(n.wait=!0,Promise.resolve().then(()=>t(...r)).finally(()=>{n.wait=!1}))}const n=o.reactive({wait:!1,call:e});return n}function ue(t){return typeof t=="string"?de(t):gn(t)?de(t.message,t.children||t.details||[]):mn(t)?de(t.title,[t.detail||""]):de(A.DEFAULT_ERROR_MESSAGE)}function gn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"message"))}function mn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"title"))}function de(t,e=[]){return{message:t,children:e}}function M(t="error"){return function(e){const{message:n,children:r}=ue(e);te.add(t,n,{children:r})}}function fe(t,e={}){return k().emit("entity:read",{...e,entity:t})}function Ne(t,e){return k().emit("entity:update",{...e,entity:t})}function yn(t){return t.reduce((e,n)=>(n.name&&(typeof n.name=="string"?e.push(n.name):e.push(...n.name)),e),[])}function He(t,e=2){if(!(typeof t=="string"||typeof t=="number"))return"";let r=String(t).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}function En(t,e){const n=new Map;return t.forEach(r=>{var a;const i=e(r);n.has(i)||n.set(i,[]),(a=n.get(i))==null||a.push(r)}),n}function wn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function _n(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return A.DEFAULT_ERROR_MESSAGE}})}function $(t,e={}){return V.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=V.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw new Error(A.DEFAULT_ERROR_MESSAGE)}).then(n=>_n(n).then(r=>{if(!n.ok)throw r;return r}))}function Cn(t,e=1e3){let n=0;return(...r)=>{clearTimeout(n),n=setTimeout(()=>t(...r),e)}}function Tn(t,e){let n=!1;return(...r)=>{if(!n)return n=!0,setTimeout(()=>n=!1,e),t(...r)}}const An=_e(Se("pretty-value-field-by-entity"));function Sn(t,e,n){try{const r=me.get(t);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${t} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(r){return An('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,t,e,n),n}}const bn=1,kn=5e3,Nn="static-folder",Ke="request-error",In="Distinguisher",H=_e(Se("use-socket"));function k(){return On}function Rn(t){return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Blob]"}const On=function(){let t=1,e,n;const r=new Set;let i=0;const a=new Set;function d(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},kn*2);const l=new Uint8Array(1);l[0]=bn,e.send(l)}setInterval(()=>{Array.from(r).forEach(l=>{E(l)&&(H("Handler for event %s requestId %d was expired",l.event,l.requestId),l.requestId?s({requestId:l.requestId,event:Ke,data:{message:Y.RequestTookToLong().message}}):r.delete(l))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&f()},A.DELAY_SOCKET_RECONNECT);function u(){return{safeQueue:a,requestId:t,handlers:r,socketInstance:e}}function s(l){const g=[...r.values()];H("Handlers array length is %d. Response event: %s. Request id: %d",r.size,l.event,l.requestId),g.forEach(y=>{const P=l.requestId;(y.requestId&&y.requestId===P||!y.requestId&&y.event===l.event)&&(H("Find appropriated handler: %d, event: %s",t,y.event),y.callback(l.data,l),y.once&&(r.delete(y),H("Handler was removed by *once* params was passed. %o",y)))})}function f(){if(typeof n!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${n}`,"color: purple","color: black"),e=new WebSocket(n),e.onclose=function(l){H("Connection to server was stopped: %d %s",l.code,l.reason),Array.from(r).forEach(g=>{g.guaranteedAnswer&&g.serializeString&&a.add(g.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(l=>{h(l),a.delete(l)})},e.onerror=function(l){console.warn(l)},e.onmessage=l=>{var g;try{if(Rn(l.data)){d();return}const y=JSON.parse(l.data);if(!Xe(y)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(y);return}(g=y==null?void 0:y.data)!=null&&g.refresh&&location.reload(),s(y)}catch(y){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(y)}}}function h(l){e.send(l)}function b(l,g){T({event:l,callback:g})}function O(l,g){T({event:l,callback:g,once:!0})}function C(){return e&&(e==null?void 0:e.readyState)===1}function S(l,g,y){const P=++t,p=JSON.stringify({requestId:P,event:l,data:g,contextId:V.contextId,url:window.location.href});return C()?h(p):(a.add(p),H("Socket is not connected. Message was send to save-queue")),new Promise((w,m)=>{T({event:l,requestId:P,once:!0,guaranteedAnswer:!0,serializeString:p,callback:(N,v)=>{if(H("Promise was resolve with next data:",N),vn(v))return void m(N);y&&y(N,v),w(N)},timeToLive:A.TIME_TO_LIVE_SOCKET_REQUEST})})}function T(l){const g={timeToLive:0,...l,created:new Date().getTime()};r.add(g)}function E(l){return l.timeToLive===0||typeof l.timeToLive!="number"?!1:new Date().getTime()-l.created>l.timeToLive}return{get socket(){return e},on:b,once:O,emit:S,initialization(l){n=l},getDevInfo:u}}(),vn=t=>!!Xe(t)&&t.event===Ke,Xe=t=>typeof t=="object"&&t!==null&&"event"in t&&typeof t.event=="string"&&"requestId"in t&&typeof t.requestId=="number"&&"data"in t;function Ln(t,e){return k().emit("list-setting:read",{entity:t,mark:e})}function $n(t,e){return k().emit("metadata-field:treat",{entity:t,fieldName:e})}function Ze(t,e){return k().emit("entity:create",{...e,entity:t})}function Qe(t,e){return k().emit("entity:delete",{...e,entity:t})}function Pn(t,e){return k().emit("usage-context:read",{...e,entity:t})}function et(t={}){return k().emit("tool:read",t)}function Dn(t,e={},n={}){const r=o.inject(A.PROVIDE_NAME_ACTIONS,null),i=typeof t=="string"?t:e,a=typeof e=="string"?n:e;return o.computed(()=>{var s;const u=((typeof t=="string"?(s=r==null?void 0:r.actions)==null?void 0:s.value:o.unref(t))||[]).find(f=>f.name===i);return u?{...u,...a}:null})}function Bn(t){return k().emit("history:read",t)}function Mn(t,e){return k().emit("entity:count",{...e,entity:t})}function Vn(t){return`/${Nn}/${t}`}function he(t){return{exec(e,n){switch(t.name){case"replace-boolean":return he.replaceBoolean(e,t.values)}}}}he.replaceBoolean=Fn;function Fn(t,e){return t?e[1]:e[0]}function Un(){const t=o.ref(null);function e(n){t.value=n}return{activeRow:t,activateRow:e}}function tt(t,e){return typeof t!="object"||t===null?!1:Object.values(t).join().toLowerCase().includes(e)}async function nt(t,e){t()&&(await e(),await nt(t,e))}function Wn(t,e,n={}){const r=o.ref(""),i=o.computed(()=>a.filter(p=>tt(p,r.value))),a=o.reactive([]);let d=0;const u=o.ref(!1);function s(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function f(){const p=g();return typeof p.limit!="number"&&(p.limit=100),p.offset=d,(n.request||fe)(t,p).then(m=>(d+=m.length,m))}function h(p,w){var N;return typeof p.Version=="number"?p.Version:(N=a.find(v=>v.Id===w))==null?void 0:N.Version}function b(p,w){const m=a.findIndex(N=>N.Id===p);if(m===-1)throw new Error(`Can't found item with Id ${p}`);a.splice(m,1,w)}function O(p){const w=a.findIndex(m=>m.Id===p);if(w===-1)throw new Error(`Can't found item with Id ${p}`);a.splice(w,1)}async function C(p,w){try{const m=g(),N=h(w,p);delete w.Version,await Ne(t,{id:p,values:w,version:N,masterEntities:s()});const v=await fe(t,{fields:m.fields||"",id:p});b(p,v)}catch(m){M()(m)}}async function S(p,w={}){try{const m=g(),N=h(w,p);delete w.Version,await Qe(t,{id:p,version:N,masterEntities:s()}),O(p)}catch(m){M()(m)}}async function T(p){try{await Ze(t,{values:p,masterEntities:s()}),await y()}catch(w){M()(w)}}let E;async function l(){u.value=!0;try{const p=E==null?void 0:E.signal;E!=null&&E.signal&&!E.signal.aborted&&E.abort(),E=new AbortController;let w=0,m=!1;const v=g().limit||0;if(r.value&&!v){console.warn("Using textSearch assumes the use of limit.");return}await nt(()=>{var W;return w<v&&!m&&!((W=E==null?void 0:E.signal)!=null&&W.aborted)},async()=>{var x;console.log("Step read data. Count for filter %d",w);const W=await f();(x=E==null?void 0:E.signal)!=null&&x.aborted||(a.push(...W),w+=W.filter(ye=>tt(ye,r.value)).length,W.length<v&&(m=!0))})}catch(p){M()(p)}u.value=!1}function g(){return typeof e=="function"?e():e}async function y(){try{d=0,a.splice(0,a.length),await l()}catch(p){M()(p)}}function P(){if(E)return E.abort();u.value=!1}return{array:a,updateById:C,next:l,reload:y,wait:u,create:T,deleteById:S,textSearch:r,filteredArray:i,abort:P}}function qn(){function t(){return{organizations:V.organizations,currentContextId:V.contextId,person:V.person,context:V.context,contextType:V.contextType,userId:V.userId}}const e=o.reactive(t());return V.onupdateContext(()=>{Object.assign(e,t())}),e}function jn(t,e,n){return k().emit("communication:create",{entityName:t,entityCatalogId:e,targetCode:n})}function zn(t,e,n){return k().emit("communication:read",{entityName:t,entityCatalogId:e,targetCode:n})}function xn(t,e){return k().emit("communication-message:create",{communicationId:t,text:e})}function Gn(t){return k().emit("communication-message:read",{communicationId:t})}function Yn(t){const e=R.Form.getParentForm(),n=o.reactive([]);return e&&e.subscribe(t),t.read=()=>Gn(t.id).then(r=>(n.splice(0,n.length,...r),r)),{array:n}}function Jn(t,e){t.read=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw Y.EntityWithoutName(t);return fe(t.name,r)}).then(Ie).then(i=>(i.hasOwnProperty("Version")&&(t.version=i.Version),t.setValues(i),i)).catch(M())},t.save=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw Y.EntityWithoutName(t);return Ne(t.name,{id:r.id,values:t.changes,version:t.version})}).then(i=>{t.version=i.version}).catch(i=>{throw M()(i),i})};function n(){return typeof e=="function"?e():e}}function Hn(t){if(!t)return o.inject(A.PROVIDE_NAME_METADATA);me.initEntity(t);const e=o.computed(()=>me.state[t]);return o.provide(A.PROVIDE_NAME_METADATA,e),e}function Kn(t,e={}){if(!t)return o.inject(A.PROVIDE_NAME_USAGE_CONTEXT);const n=o.ref(null);return o.provide(A.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await Pn(t,Xn(e||{}))}}}function Xn(t){return typeof t=="function"?t():t}function Zn(t={}){return k().emit("tool:execute",t)}function Qn(t){if(!t)return o.inject(A.PROVIDE_NAME_ACTIONS);const e=o.reactive([]),n=o.computed(()=>e.map(a=>er(t,a))),r={actions:n,update:i};o.provide(A.PROVIDE_NAME_ACTIONS,r),t.router=Oe.useRouter(),t.handleConfirmation||(t.handleConfirmation=nr),t.handleAffectedEntity||(t.handleAffectedEntity=or),t.handleCloseForm||(t.handleCloseForm=ir),t.handleValidationResult||(t.handleValidationResult=rr);function i(a={}){return e.splice(0,e.length),et(a).then(d=>e.splice(0,0,...d)).catch(M("error"))}return{actions:n,update:i}}function er(t,e){return{...e,label:e.title,callback(){var i;const n=typeof t.values=="function"?t.values(e,t):t.values,r=()=>Zn({name:e.name,values:n}).then(async a=>{var d,u;if(!ar(a))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(t.handlers))for await(const s of t.handlers)await s(e,a,t);if(!a.success)throw t.handleValidationResult&&a.validationEffect&&((u=(d=a.validationEffect)==null?void 0:d.results)!=null&&u.length)&&t.handleValidationResult(e,a.validationEffect,t),new Error(a.message);return a.message&&te.add("info",a.message),Array.isArray(a.affectedEntities)&&t.handleAffectedEntity&&a.affectedEntities.forEach(s=>{var f;return(f=t.handleAffectedEntity)==null?void 0:f.call(t,e,s,t)}),e.closeHostForm&&t.handleCloseForm&&t.handleCloseForm(e,t),a}).catch(M("error"));return(i=t.overrides)!=null&&i[e.name]?t.overrides[e.name](e,t):e.requireSave&&t.form&&t.form.changed?t.form.save().then(r):!e.confirmation||!t.handleConfirmation?r():t.handleConfirmation(e,r)}}}function tr(t){const e="Are you sure?";return t===!0||typeof t=="string"&&t.toLowerCase()==="true"||t==="1"?e:typeof t=="string"?t:e}async function nr(t,e){const n=tr(t.confirmation);if(!oe.getComponentFromStore(A.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await oe.promptModal(A.MODAL_CONFIRM,{message:n}))return e()}function rr(t,e){const n=A.MODAL_VALIDATION_EFFECT;if(!oe.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{oe.pushModal(n,e)})}function or(t,e,n){var d;const{router:r,form:i}=n,a=(d=e.primaryKey)==null?void 0:d.Id;if(r&&e&&e.name===t.redirectEntity)return r.push({name:e.name,params:{id:a}});i&&e.name===i.name&&e.updated&&a===i.id&&i.read()}function ir(t,e){const{router:n}=e;n&&t.closeHostForm&&n.back()}function ar(t){return!!(t&&typeof t=="object"&&"affectedEntities"in t&&"success"in t)}function sr(t){function e(n){n.key==="Enter"&&t()}o.onMounted(()=>{document.addEventListener("keypress",e)}),o.onUnmounted(()=>{document.removeEventListener("keypress",e)})}function cr(t,e={}){const n=o.reactive([]),r=s=>{const f=o.unref(t);if(s===void 0){n.length===0?f.forEach(a):f.forEach(d);return}i(s)?d(s):a(s)},i=s=>n.includes(s),a=s=>{e.handleSelect&&!e.handleSelect(s)||i(s)||n.push(s)},d=s=>{const f=n.findIndex(h=>h===s);f!==-1&&n.splice(f,1)},u=o.computed(()=>{const s=o.unref(t);return n.length===s.length&&s.length!==0});return[n,r,u,a,d]}function lr(t){const e=o.ref(""),n=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(t).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:n}}const te=new class{constructor(){this.store=o.reactive([])}add(e,n,r={}){const i=ur(r),a=new dr(e,n,i.timeout,i.children,i.click);return this.store.push(a),i.timeout&&setTimeout(this.remove.bind(this,a.id),i.timeout*1e3),a}remove(e){const n=this.store.findIndex(r=>r.id===e);if(n===-1)return!1;this.store.splice(n,1)}};function ur(t){function e(r){return!!r&&typeof r=="object"}const n={timeout:10,click:()=>null,children:[]};return e(t)?{timeout:t.timeout||n.timeout,click:t.click||n.click,children:t.children||n.children}:n}const rt=class ct{constructor(e,n,r,i,a){this.type=e,this.message=n,this.timeout=r,this.children=i,this.click=a,this.id=ct.cardId++}};rt.cardId=1;let dr=rt;class fr extends j{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return xn(this.id,e)}static checkAndGenerate(e,n,r){return zn(e,n,r).then(i=>i.length===0?jn(e,n,r):i[0])}}function hr(){return k().emit("client:read",{})}var ot=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},pr=(t,e,n)=>(ot(t,e,"read from private field"),n?n.call(t):e.get(t)),gr=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},mr=(t,e,n,r)=>(ot(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),pe;const ge=class Z extends j{constructor(){super(...arguments),this.type="front",this.organizations=[],gr(this,pe,!1)}set language(e){localStorage.setItem(A.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(A.LOCALSTORAGE_LANGUAGE_KEY)||Z.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){mr(this,pe,e),this.emit(Z.EVENT_READY_UPDATE,e)}get ready(){return pr(this,pe)}onReady(e){return this.on(Z.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(Z.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(A.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(Z.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(n=>n.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.userId=e.userId,this.restoreCurrentContext(),this.ready=!0}catch(e){M()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(A.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return hr()}validateContextId(e){var n;try{return((n=this.person)==null?void 0:n.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};pe=new WeakMap,ge.DEFAULT_LANGUAGE="en",ge.EVENT_CONTEXT_UPDATE="event:context-update",ge.EVENT_READY_UPDATE="event:ready-update";let yr=ge;function Er(t){return k().emit("metadata:read",{entity:t})}const me=function(){const e=o.reactive({}),n=new Map;function r(u){return e[u]}async function i(u){if(n.has(u)&&await n.get(u),e[u])return;const s=await a(u);d(u,s)}function a(u){const s=Er(u).finally(()=>{n.delete(u)});return n.set(u,s),s}function d(u,s){e[u]=s}return{state:e,initEntity:i,get:r}}();class U{static login(e){return $(F.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:F.applicationName})})}static parseProcessAnswer(e){if(e.statusCode>4)throw new Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return U.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return U.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return U.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return U.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,n){return $(`${F.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(e){return U.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return U.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return U.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,n){return $(`${F.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(U.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw Error(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startPasswordReset(e,n){return $(`${F.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:n,AppName:e})})}static confirmPhoneNumberByAccessRecovery(e,n,r,i){return $(`${F.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:i})})}static confirmEmailByAccessRecovery(e,n,r,i){return $(`${F.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:i})})}static finishAccessRecovery(e,n,r){return $(`${F.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Password:r,ConfirmedPassword:r})})}}class wr{static readHistoryById(e,n){return $(`/close-api/audits/history/${e}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class _r{static readLicences(e){const n=`/close-api/proxy/Dashboard/Licenses?organizationId=${e.toString()}`;return $(n).then(r=>{const i={};return r.byOrganization.licenses.forEach(a=>{const d=a.licenseTypeCode;i[d]||(i[d]={licenseTypeCode:d}),i[d][a.statisticName]=a.value}),Object.values(i)})}}class Cr{static getConfiguration(){return $("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(e){return await $(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}function Tr(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function I(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];if(Array.isArray(r)){const i=r.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return r.length&&e.push(`@${n} in (${i})`),e}if(Tr(r)){let i=function(a){var d;return((d=a.match(/([^Z]*)/))==null?void 0:d[0])+"0000Z"};return r.start&&e.push(`@${n} ge ${i(r.start)}`),r.end&&e.push(`@${n} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${n} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${n} eq '${r}'`),e):(r===null&&e.push(I.is(n,r)),e)},[]).join(" and ")}function ne(t){return typeof t=="string"?`'${t}'`:`${t}`}I.includes=function(e,n){return`@${e} Contains ${ne(n)}`},I.beginWith=function(e,n){return`@${e} BeginWith ${ne(n)}`},I.notEq=function(e,n){return`@${e} nq ${ne(n)}`},I.eq=function(e,n){return Array.isArray(n)?I.in(e,n):`@${e} eq ${ne(n)}`},I.in=function(e,n){const r=n.map(ne).join(", ");return`@${e} in (${r})`},I.notIn=function(e,n){return!Array.isArray(n)||n.length===0?"":I.and(...n.map(r=>I.notEq(e,r)))},I.and=function(...e){return e.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(I.wrap).join(" and ")},I.wrap=function(e){return`(${e})`},I.is=function(e,n){return`@${e} is ${n}`},I.or=function(...e){return e.join(" or ")};function Ie(t){return Object.keys(t).reduce((e,n)=>{let r=t[n];const i=n.charAt(0).toUpperCase()+n.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Ie(r)),e[i]=r,e},{})}const V=new yr;c.Communication=fr,c.CoreError=Y,c.Filter=I,c.Manager=V,c.MetadataStore=me,c.NotificationSystem=te,c.OBJECT_TYPE_NAME_FIELD=In,c.WidgetButton=Wt,c.WidgetIcon=ee,c.WidgetImage=Zt,c.WidgetList=fn,c.WidgetLoader=Kt,c.WidgetMultiButton=Yt,c.WidgetSpinner=le,c.WidgetTable=Mt,c.asyncProcess=pn,c.authService=U,c.billingService=X,c.catchUniversal=M,c.clientService=Ue,c.config=hn,c.configuration=F,c.constants=A,c.dashboardService=_r,c.debounce=Cn,c.documentsService=wt,c.fileService=yt,c.formatter=he,c.getCellName=je,c.getCellValue=Ae,c.getNamesFromListConfig=yn,c.getUnitValue=ke,c.groupArrayByField=En,c.historyService=wr,c.injectAction=Dn,c.internationalizationService=mt,c.invitationService=Et,c.openService=Cr,c.parseError=ue,c.prettyDate=be,c.prettyDateWithTime=ze,c.prettyMoney=He,c.prettyValueFieldByEntity=Sn,c.processWizardService=ce,c.request=$,c.staticLink=Vn,c.t=K,c.throttle=Tn,c.universalEntityCount=Mn,c.universalEntityCreate=Ze,c.universalEntityDelete=Qe,c.universalEntityRead=fe,c.universalEntityUpdate=Ne,c.universalHistoryRead=Bn,c.universalListSettingRead=Ln,c.universalMetadataFieldTreat=$n,c.universalToolRead=et,c.useActions=Qn,c.useCommunication=Yn,c.useEnter=sr,c.useFormEntity=Jn,c.useListActiveRow=Un,c.useListEntity=Wn,c.useListSearch=lr,c.useListSelect=cr,c.useManagerState=qn,c.useMetadata=Hn,c.useSocket=k,c.useUsageContext=Kn,c.useWizard=At,c.uuidv4=wn,c.valuesToUpperCase=Ie,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
11
11
  //# sourceMappingURL=eservices-core.umd.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eservices-core",
3
- "version": "1.3.124",
3
+ "version": "1.3.125",
4
4
  "description": "Core library",
5
5
  "author": "",
6
6
  "scripts": {