eservices-core 1.3.104 → 1.3.105

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.104
3
+ * eservices-core v1.3.105
4
4
  * (c) 2024 ESERVICES
5
5
  */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),P=require("jenesius-vue-form"),ze=require("vue-router"),Te=require("debug"),gt=require("date-and-time"),de=require("jenesius-vue-modal");function Se(t,e){if(typeof t!="object"||t===null)return;if(e in t)return t[e];let n=e.indexOf(".");if(n>-1){const r=e.substring(0,n);return r in t?Se(t[r],e.substr(n+1)):void 0}return t[e]}function Je(t,e){if(!t)return console.warn("Element is not provided.");function n(o,s){return o==s.target||o.contains(s.target)}const r=o=>{n(t,o)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function Ye(t){return t.reduce((e,n)=>e.then(r=>n==null?void 0:n(r)),Promise.resolve())}const Ke=class y extends Error{constructor(e,n=null){super(),this.message=e,this.details=n,this.id=y.ID++}static ParentFormNotFound(){return new y("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new y("Composite object name is undefined",e)}static EntityWithoutName(e){return new y("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new y(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new y("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new y("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new y(`${e} (id) is not a number`)}static UndefinedErrorId(e,n){return y.ApiNotAvailable()}static ApiError(e){return new y("Request error",e)}static ApiNotAvailable(){return new y(`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?y.ApiNotAvailable():new y(e||"Authorization Error",n)}static ApiResponseParseFailed(){return y.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new y("Object doesn't have id",e)}static ObjectWithIdNotFound(e,n){return new y(`Can't find object with id: ${e}`,n)}static ObjectWithoutConnectToPresentArray(e,n){return new y("Object is not found.",{object:e,array:n})}static EntityWithoutId(e){return new y("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,n){return new y(`Can't find the element with tableIndex ${e}`,n)}static UndefinedError(e,n=[]){return new y(e,n)}static TableArrayAlreadyIncludeProvidedIndexValue(e,n,r){return new y(`Array already includes the element with value ${e}`,{array:n,table:r})}static MetadataEntityIsNotAvailable(e){return new y(`Metadata for the ${e} is not currently available.`)}static RequestTookToLong(){return new y("The request took too long to complete. Try again later.")}};Ke.ID=0;let q=Ke;const mt="Please try again later or submit a feedback if problem doesn't go.";class He{static getClientData(){return g("/close-api/client-content")}static getNavigation(){return g("/close-api/client/navigation")}}const yt=new class{constructor(){this.store=i.reactive([])}add(e,n,{children:r,timeout:o=10,click:s=()=>{}}={}){const u=new Et(e,n,o,r||[],s);return this.store.push(u),o&&setTimeout(this.remove.bind(this,u.id),o*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.")}},Xe=class Qe{constructor(e,n,r,o,s){this.type=e,this.msg=n,this.timeout=r,this.children=o,this.click=s,this.id=Qe.cardId++}};Xe.cardId=1;let Et=Xe;/*!
7
7
  * jenesius-event-emitter v1.0.2
8
8
  * (c) 2022 Jenesius
9
9
  * @license MIT
10
- */const De=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},xe=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)},Fe=function(){this.events={}};class F{constructor(){this.events={}}on(e,n){return De.call(this,e,n)}emit(e,n){return xe.call(this,e,n)}off(e,n){return Be.call(this,e,n)}cleanEvents(){Fe.call(this)}static on(e,n){return De.call(F,e,n)}static emit(e,n){return xe.call(F,e,n)}static off(e,n){return Be.call(F,e,n)}static cleanEvents(){Fe.call(F)}}F.events={};var Ze=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},ie=(t,e,n)=>(Ze(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)},Ce=(t,e,n,r)=>(Ze(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Q,se,ae;const W=class O extends F{constructor(){super(...arguments),we(this,Q,void 0),we(this,se,"front"),this.organizations=[],we(this,ae,!1)}set language(e){localStorage.setItem(O.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(O.LOCALSTORAGE_LANGUAGE_KEY)||O.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(O.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){Ce(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){Ce(this,se,e)}get type(){return ie(this,se)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Ce(this,ae,e),this.emit(O.EVENT_READY_UPDATE,e)}get ready(){return ie(this,ae)}onReady(e){return this.on(O.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(O.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(O.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(O.CURRENT_CONTEXT_KEY,String(e)),this.emit(O.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(O.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(n)&&this.validateContextId(Number(n))?this.setCurrentContext(n):this.setCurrentContext(Number(e.id))}catch{yt.add("error",q.ApiNotAvailable().message)}}loadCustomerData(){return He.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;se=new WeakMap;ae=new WeakMap;W.DEFAULT_LANGUAGE="en";W.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage";W.EVENT_CONTEXT_UPDATE="event:context-update";W.EVENT_READY_UPDATE="event:ready-update";W.EVENT_DATA_UPDATE="event:data-update";W.CURRENT_CONTEXT_KEY="CurrentContext";let vt=W;const Me=new vt;function wt(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return mt}})}function g(t,e={}){return Me.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=Me.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw q.ApiNotAvailable()}).then(n=>wt(n).then(r=>{if(!n.ok)throw r;return r}))}class ge{constructor(){}static parseNamesFromListConfig(e){let n=ge.parseFieldsToGraphQL(e.reduce((o,s)=>(s.name&&o.push(s.name),o),[]));function r(o){let s="";for(let u in o)typeof o[u]=="boolean"?s+=` ${u} `:s+=` ${u} { ${r(o[u])} }`;return s}return r(n)}static parseSortFromListConfig(e){let n={};for(let r in e)n[r]=e[r]?"ASC":"DESC";return n}static parseFieldsToGraphQL(e){function n(r,o){if(o.includes(".")){const s=o.indexOf("."),u=o.substring(s+1),l=o.substring(0,s);l in r||(r[l]={}),n(r[l],u)}else r[o]=!0;return r}return e.reduce(n,{})}}class Ct{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")}}const _t=new Ct;function et(t){return t&&t[0].toLowerCase()+t.slice(1)}function Ae(t){return Object.keys(t).reduce((e,n)=>{let r=t[n];const o=n.charAt(0).toUpperCase()+n.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Ae(r)),e[o]=r,e},{})}function Tt(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(".")}const St={Request:g,clickOutside:Je,getPropFromObject:Se,runPromiseQueue:Ye,GraphQL:ge,firstChapterToLowerCase:et,valuesToUpperCase:Ae,prettyMoney:Tt},At=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:ge,Journal:_t,Request:g,clickOutside:Je,default:St,firstChapterToLowerCase:et,getPropFromObject:Se,runPromiseQueue:Ye,valuesToUpperCase:Ae},Symbol.toStringTag,{value:"Module"}));class bt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return g(`/open-api/internationalization/language/${e}`)}}let j={};function Y(t,...e){if(typeof t!="string")return console.trace(`Label is not provided for translation: ${t}`),"undefined";let n=P.utils.getPropFromObject((this==null?void 0:this.vocabulary)||j,t);if(typeof n=="string")return Ve(n,e);const r=P.utils.getPropFromObject(j==null?void 0:j.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}Y.setGlobalVocabulary=function(t){j=t};Y.getScope=function(t){const e=typeof t=="string"?t:"root";return typeof t!="string"&&console.warn(`SCOPE ${t} for translate is not string.`),Y.bind({vocabulary:P.utils.getPropFromObject(j,e.toLowerCase())})};Y.setVocabulary=function(t){return typeof t=="string"&&(t=P.utils.getPropFromObject(j,t)),Y.bind({vocabulary:t})};function kt(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&typeof t[1]=="number"}const Nt="masterId",It="masterEntity";function Ue(t,e){if(!Array.isArray(e))return;if(kt(e))return n(e);e.forEach(n);function n(r){t.append(It,r[0]),t.append(Nt,r[1].toString())}}class ee{static async anonymousGetList(e){return await g(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const n=(o,s)=>r.append(o,s),r=new URLSearchParams;if(e.fields){const o=e.fields;typeof o=="string"?n("fields",o):Array.isArray(o)?n("fields",o.join(" ")):typeof o=="object"&&n("fields",Object.keys(o).join(" "))}if(e.order){let o=e.order;const u=(Array.isArray(o)?[o]:Object.entries(o)).map(([l,c="desc"])=>`@${l} ${c}`).join(",");n("order",u)}return e.limit&&n("limit",e.limit.toString()),e.offset&&n("offset",e.offset.toString()),e.filter&&n("filter",e.filter.toString()),e.useUsageContext&&r.append("useUsageContext",e.useUsageContext.toString()),r}static async getList(e,n){const r=ee.getSearchParamsForEntityListRead(n||{});return await g(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,n){const r=ee.getSearchParamsForEntityListRead(n||{});return g(`/close-api/data/entities/${e}/count?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,n,r){const o=new URLSearchParams;return Ue(o,r==null?void 0:r.masterEntities),g(`/close-api/data/${e}?${o.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:n})})}static update(e,n,r,o={}){return g(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static readById(e,n,r={}){const o=new URLSearchParams;if(r.fields){let s=r.fields;typeof s=="string"&&(s=[s]),o.append("fields",s.join(" "))}return g(`/close-api/data/entities/${e}/id/${n}?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,n,r,o){const s=new URLSearchParams;return Ue(s,o==null?void 0:o.masterEntities),g(`/close-api/data/entities/${e}/id/${n}?${s.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r,version:o==null?void 0:o.version})})}static removeById(e,n,r){const o=typeof n=="number"?{Id:n}:n;return ee.removeByKeys(e,o,r)}static removeByKeys(e,n,r){return g(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:n,version:r})})}}const tt=class Z{static async create(e){return g(Z.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const n=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return g(Z.url+"?"+n.toString(),{method:"get"})}static async readMessages(e){return g(`${Z.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return g(`${Z.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};tt.url="/close-api/communications";let Ot=tt;function je(t){return{...t,createdEntities:t.createdEntites}}const nt=class ce{static async getStartConfig(e,n){return g([ce.url,e,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,n){return g([ce.url,e,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(je)}static async runStep(e,n,r,o,s){return g([ce.url,e,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:o,values:s})}).then(je)}};nt.url="/close-api/views/process-wizard";let le=nt;class Rt{static async upload(e,n){const r=new FormData;r.append("file",e);const o=`/close-api/files?entityName=${n}`;return await fetch(o,{method:"POST",body:r}).then(s=>s.json()).then(s=>(s.filename=e.name,s))}}class Lt{static invite(e,n,r){return g("/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 g("/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 g("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!1})})}}class be{static get url(){return"/close-api/rules-validation/"}static validate(e,n){return g(be.url+e,{method:"POST",body:JSON.stringify(n)})}}class $t{static getConfiguration(){return g("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}function Pt(t,e="images"){return`/static-folder/${e}/${t}`}class Dt{static getRequiredDocuments(e,n,r){const o=new URLSearchParams({entity:e,primaryKey:n,statusCode:r});return fetch(`/close-api/views/required-documents?${o.toString()}`).then(s=>s.json())}}class J{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${J.url()}/calculator/${e}`)}static calculate(e,n){return g(`/${J.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]):q.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 g(`/${J.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:n})})}static applyOnlinePayment(e){return g(`/${J.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}function xt(t){return t.statusName==="Completed"}function Bt(t){return t.statusName==="FinalStepWithConfirmation"}function Ft(t){return t.statusName==="ValidationError"}function Mt(t,e,n){let r=null;const o=i.reactive({wait:null});let s=[],u=null;const l=i.ref(null);function c(){l.value=s.find(a=>a.name===u)||null}function d(){var a;return u?((a=s.find(p=>p.name===u))==null?void 0:a.fields)||[]:[]}function f(a){if(c(),Ft(a))return void n.onValidation(a.validationResults);if((a.statusName==="FinalStep"||a.statusName==="NextStep")&&(!d().length||Vt(d(),n.presets)))return N(n.presets||{});xt(a)&&n.onCompleted(a),Bt(a)&&n.onConfirmation(a)}async function C(){try{await k(),await m()}catch(a){const{message:p}=fe(a);ne.add("error",p)}}function k(){return o.wait="Loading process information.",le.getStartConfig(e,t).then(a=>{s=a.steps.map(p=>({label:p.title,name:p.stepName,number:p.number,fields:p.frontendEntity.objectTypes.reduce((h,_)=>(_.properties.forEach(T=>{h.push({name:T.name,label:T.title,type:T.refEntityName||T.dataType})}),h),[])}))}).then(a=>(o.wait=!1,a))}function E(a){return u=a.nextStepName,r=a.token,a}function v(a){const p=fe(a);ne.add("error",p.message)}function m(){return o.wait="Starting process",le.startProcess(e,t).then(E).then(f).catch(v).finally(()=>{o.wait=null})}function N(a={}){return!r||!u?Promise.reject("Not step or token."):(o.wait="Waiting for result...",le.runStep(e,t,u,r,a).then(E).then(f).catch(v).finally(()=>{o.wait=!1}))}return{initialize:C,state:o,currentStepConfig:i.readonly(l),next:N}}function Vt(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(!P.utils.getPropFromObject(e,r.name))return!1}return!0}const Ut={class:"widget-table__head"},jt={class:"widget-table__head-label margin_0 text_overflow"},qt=i.defineComponent({__name:"widget-table-head",props:{config:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("tr",Ut,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.config,(r,o)=>(i.openBlock(),i.createElementBlock("th",{class:"widget-table__head-cell",key:o},[i.createElementVNode("p",jt,i.toDisplayString(r.label),1)]))),128))]))}});const M=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},Wt=M(qt,[["__scopeId","data-v-25198f4a"]]);function rt(t){return typeof t.name=="string"?t.name:Array.isArray(t.name)?t.name[0]:null}function Gt(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 zt(t,e){return Gt(t).forEach(r=>{t.replace(new RegExp("${"+r+"}","g"),P.utils.getPropFromObject(e,r))}),t}function ke(t,e){const n=rt(t);let r=n?P.utils.getPropFromObject(e,n):null;return r===void 0&&(r=null),typeof t.value=="string"?zt(t.value,e):t.value?t.value(r,e):t.value===null?null:r}const w={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 Ne(t){return[w.CORE_DEBUG_LABEL,t].join(":")}function ot(t){return Ie(t,"YYYY/MM/DD HH:mm:ss")}function Ie(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return gt.format(n,e)}catch(n){return console.log(n),"Invalid date"}}const Jt={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()=>i.h("i",{class:`icon icon-${n}`})}},te=M(Jt,[["__scopeId","data-v-e287c8d9"]]);function it(t){return e=>typeof e=="string"||typeof e=="number"?`${e} ${t}`:""}const Yt=Te(Ne("setup-list-row"));function Kt(t,e){const n=t.config.map(r=>Ht(r,t,e));return i.h("tr",{class:"widget-table__row widget-table-row"},n)}function Ht(t,e,n){const r=e.values;let o=ke(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 c=[],d=[];if(t.unitValue&&(o=it(t.unitValue)(o)),t.hide&&t.hide(r))return[i.h("td")];if(t.type)switch(l(`widget-table-cell_${t.type}`),t.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=Ie(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=ot(typeof o=="string"?o:null);break}case"money":{o=at(o);break}case"multi-select":{d.push(i.h(P.FormField,{type:"single-checkbox",modelValue:e.selected})),u(qe.bind(null,n,!0));break}case"select":{d.push(i.h(P.FormField,{type:"single-radio",modelValue:e.selected})),u(qe.bind(null,n,!1));break}}if(t.onClick&&u(t.onClick),t.link)try{const f=t.link(r);if(f){const C=i.h(ze.RouterLink,{to:f});d.push(C),l("widget-table-cell_link")}}catch(f){Yt("Can't add router link",f)}if(t.href&&(d.push(i.h("a",{href:t.href(r),target:"_blank"})),l("widget-table-cell_link")),typeof o=="boolean"&&(o=o?"✓":"—"),(typeof o=="string"||typeof o=="number")&&d.push(i.h("p",{class:"widget-list-cell-text"},o)),t.icon&&(typeof t.icon=="string"&&d.push(i.h(te,{name:t.icon})),typeof t.icon=="function")){const f=t.icon(r);f!==null&&d.push(i.h(te,{name:f}))}return t.class&&(typeof t.class=="function"?l(t.class(r)):l(t.class)),c.push(i.h("td",s,d)),c}function qe(t,e){t.emit("select",e)}function st(t,e){return()=>{try{return Kt(t,e)}catch(n){return console.warn(n),null}}}const Xt={props:{values:Object,config:Object,selected:Boolean},setup:st},Qt=["colspan"],We=i.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(t,{emit:e}){const n=i.ref();return i.onMounted(()=>{setTimeout(()=>{n.value&&n.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,o)=>(i.openBlock(),i.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:n},[i.createElementVNode("td",{colspan:r.rowLength},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(r.component),i.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:o[0]||(o[0]=s=>e("close")),onSave:o[1]||(o[1]=s=>e("save",s))}),null,16,["values","new"]))],8,Qt)],512))}}),Zt={class:"widget-table"},Ge="update:selectedRows",en=i.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=i.useSlots(),o=i.computed(()=>{var c;return(c=r==null?void 0:r.default)==null?void 0:c.call(r)[0]});function s(c,d=!0){if(!n.selectedRows)return;if(!d)return e(Ge,n.selectedRows.includes(c)?[]:[c]);const f=[...n.selectedRows],C=f.indexOf(c);return C===-1?f.push(c):f.splice(C,1),e(Ge,f)}function u(c){e("save",c),e("update:activeRow",null)}const l=i.computed(()=>n.shortcut?n.config.filter(c=>c.name?!!n.array.find(f=>![null,""].includes(ke(c,f))):!0):n.config);return(c,d)=>(i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("table",Zt,[i.createVNode(Wt,{config:l.value},null,8,["config"]),i.createElementVNode("tbody",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.array,(f,C)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:C},[i.createVNode(Xt,{config:l.value,values:f,selected:c.selectedRows.includes(f),onSelect:k=>s(f,k),class:i.normalizeClass(c.classCallback?c.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),o.value&&c.activeRow===f?(i.openBlock(),i.createBlock(We,{key:0,component:o.value,"row-length":c.config.length,values:f,onClose:d[0]||(d[0]=k=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):i.createCommentVNode("",!0)],64))),128)),c.activeRow===i.unref(w).LIST_ACTIVE_NEW?(i.openBlock(),i.createBlock(We,{key:0,component:o.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"])):i.createCommentVNode("",!0)])])]))}}),tn=i.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:"widget-spinner",style:i.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}});const me=M(tn,[["__scopeId","data-v-0ef9ae88"]]),nn={class:"widget-button"},rn=i.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("button",nn,[e.wait?(i.openBlock(),i.createBlock(me,{key:0,class:"widget-button-spinner"})):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const on=M(rn,[["__scopeId","data-v-450dc564"]]),sn={class:"widget-multi-button-wrap position_relative cursor_pointer"},an={class:"widget-multi-button-body grid"},cn=["onClick"],ln={class:"widget-multi-button-side-wrap"},un=i.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(t){const e=t;i.useCssVars(u=>({"7025434e":r.value}));const n=i.reactive({active:!1,wait:!1}),r=i.computed(()=>e.array.length+(e.label?1:0));function o(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)=>(i.openBlock(),i.createElementBlock("div",sn,[i.createElementVNode("div",{class:i.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[i.createElementVNode("div",an,[u.label?(i.openBlock(),i.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:l[0]||(l[0]=c=>s())},i.toDisplayString(u.label),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.array,(c,d)=>(i.openBlock(),i.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:d,onClick:f=>{o(c.callback),s(!1)}},i.toDisplayString(c.label),9,cn))),128))]),i.createElementVNode("div",ln,[i.createElementVNode("div",{class:i.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:l[1]||(l[1]=c=>s())},[n.wait?(i.openBlock(),i.createBlock(i.unref(me),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(i.openBlock(),i.createBlock(i.unref(te),{key:1,class:"widget-multi-button-side-icon"},{default:i.withCtx(()=>[i.createTextVNode("angle-small-down")]),_:1})):i.createCommentVNode("",!0)],2)])],2)]))}});const dn=M(un,[["__scopeId","data-v-a8d711d1"]]),fn={class:"widget-loader flex flex-align_center gap_10 padding_15"},pn={class:"text_md"},hn=i.defineComponent({__name:"widget-loader",props:{label:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",fn,[i.createVNode(me,{color:"var(--primary)",class:"padding_10"}),i.createElementVNode("span",pn,i.toDisplayString(e.label),1)]))}}),gn=["alt","src"],mn=i.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(t){const e=t,n=i.ref();return i.onMounted(()=>{n.value&&(n.value.src=e.src),n.value.onerror=function(){e.default&&(n.value.src=e.default)}}),(r,o)=>(i.openBlock(),i.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:n,src:r.src||r.$props.default},null,8,gn))}}),yn={props:{config:Array,values:Object,selected:Boolean},setup:st};const En=M(yn,[["__scopeId","data-v-344a8cc1"]]),vn=t=>(i.pushScopeId("data-v-bf495d6a"),t=t(),i.popScopeId(),t),wn={class:"widget-list-head-cell"},Cn=vn(()=>i.createElementVNode("div",{class:"head-cell-resize"},null,-1)),_n=i.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,o)=>(i.openBlock(),i.createElementBlock("th",null,[i.createElementVNode("div",wn,[i.createElementVNode("div",{class:"head-cell-content flex_grow",style:i.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(i.openBlock(),i.createBlock(i.unref(P.FormField),{key:0,type:"single-checkbox",onClick:o[0]||(o[0]=i.withModifiers(s=>e("select"),["stop","prevent"]))})):(i.openBlock(),i.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:o[1]||(o[1]=s=>e("order"))},i.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(i.openBlock(),i.createBlock(i.unref(te),{key:0,class:i.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:i.withCtx(()=>[i.createTextVNode("core-arrow-up")]),_:1},8,["class"])):i.createCommentVNode("",!0),Cn])]))}});const Tn=M(_n,[["__scopeId","data-v-bf495d6a"]]),Sn=i.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const n=t,r=i.ref(),o=i.ref();i.onMounted(()=>{function c(E,v){let m=-1;do m++,v-=E[m];while(v>0&&m<E.length);return m}function d(E,v){let m=0;for(;v>0&&v>E[m]&&m<E.length;)v-=E[m],m++;return console.log(v,m),m>0?m:0}function f(E){try{o.value.style.insetInlineStart=E+"px"}catch(v){console.log(v)}}function C(E){try{o.value.style.width=E+"px",o.value.style.minWidth=E+"px",o.value.style.maxWidth=E+"px"}catch(v){console.log(v)}}function k(E){return E===null?!1:E.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(v){var Pe;function m(I){return I.screenX+p-T}const N=r.value,a=[...N.children].filter(I=>I.localName==="th"),p=((Pe=N.offsetParent)==null?void 0:Pe.scrollLeft)||0,h=a.map(I=>I.clientWidth),_=k(v.target),T=N.getBoundingClientRect().left,G=m(v),A=c(h,G),V=h.slice(0,A).reduce((I,D)=>I+D,0),K=G-V,Ee=N.offsetWidth,H=a[A].clientWidth;if(n.config[A].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",v.screenX),console.log("Widths",h),console.log("max width",Ee),console.log("Start Position",G),console.log("Position From",A),console.log("Start Position",A),console.log("Global offset (Отступ самой таблицы от края экрана)",T),console.log("Del",K),console.groupEnd(),o.value.innerText=a[A].textContent||"",o.value.style.display="grid",o.value.style.width=H+"px",o.value.style.cursor="grabbing",f(V),C(H),document.addEventListener("pointermove",$e,{passive:!0}),document.addEventListener("pointerup",Le);function Le(I){if(console.group("END"),document.removeEventListener("pointermove",$e),document.removeEventListener("pointerup",Le),_&&(n.config[A].width=o.value.style.width,n.config[A].minWidth=o.value.style.width,n.config[A].maxWidth=o.value.style.width,s(n.config)),!_){const D=I.screenX+p-T;console.log("ENP Position",D);const oe=d(h,D);if(console.log(A,"->",oe),oe!==A){const X=n.config[A],ve=n.config;ve.splice(A,1),ve.splice(oe,0,X),s(ve)}else{const X=n.config[A].name;u(X)}}o.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function $e(I){if(_){const X=m(I)-G+H;C(X);return}let D=I.screenX+p-T-K;D<0&&(D=0),D+H>Ee&&(D=Ee-H),f(D)}})});function s(c){e("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(n.order.length===0||n.order[0]!==c)return void l([c]);const d=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([c,d==="asc"?"desc":"asc"])}function l(c){e("update:order",c)}return(c,d)=>(i.openBlock(),i.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.config,(f,C)=>(i.openBlock(),i.createBlock(Tn,i.mergeProps({key:f},f,{onOrder:k=>u(f.name),onSelect:d[0]||(d[0]=k=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),i.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:o},"test",512)],512))}});const An=M(Sn,[["__scopeId","data-v-ccffc6bd"]]),bn={class:"widget-list"},kn={class:"widget-list-body position_relative"},Nn=50,In=i.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,c=!0){if(n.selectedRows)if(!c)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 o(){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 c=l.target;c.scrollTop+c.clientHeight+Nn>c.scrollHeight&&e("scrollEnd")}return(l,c)=>(i.openBlock(),i.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[i.createElementVNode("table",bn,[i.createElementVNode("thead",null,[i.createVNode(An,{onSelect:c[0]||(c[0]=d=>o()),"onUpdate:order":c[1]||(c[1]=d=>e("update:order",d)),"onUpdate:config":c[2]||(c[2]=d=>e("update:config",d)),config:l.config,order:l.order},null,8,["config","order"])]),i.createElementVNode("tbody",kn,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.array,(d,f)=>{var C;return i.openBlock(),i.createBlock(En,{key:f,class:"widget-list-row",values:d,config:l.config,selected:(C=l.selectedRows)==null?void 0:C.includes(d),onSelect:k=>r(d,k)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),x={};function On(t){for(let e in t)x[e]=t[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function Rn(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=i.reactive({wait:!1,call:e});return n}function fe(t){return typeof t=="string"?_e(t):Ln(t)?_e(t.message,t.children):_e(w.DEFAULT_ERROR_MESSAGE)}function Ln(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"message"))}function _e(t,e=[]){return{message:t,children:e}}function $(t="error"){return function(e){const{message:n,children:r}=fe(e);ne.add(t,n,{children:r})}}function pe(t,e={}){return S().emit("entity:read",{...e,entity:t})}function Oe(t,e){return S().emit("entity:update",{...e,entity:t})}function $n(t){return t.reduce((e,n)=>(n.name&&(typeof n.name=="string"?e.push(n.name):e.push(...n.name)),e),[])}function at(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 Pn(t,e){const n=new Map;return t.forEach(r=>{var s;const o=e(r);n.has(o)||n.set(o,[]),(s=n.get(o))==null||s.push(r)}),n}function Dn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function xn(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return w.DEFAULT_ERROR_MESSAGE}})}function L(t,e={}){return R.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=R.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw new Error(w.DEFAULT_ERROR_MESSAGE)}).then(n=>xn(n).then(r=>{if(!n.ok)throw r;return r}))}function Bn(t,e=1e3){let n=0;return(...r)=>{clearTimeout(n),n=setTimeout(()=>t(...r),e)}}function Fn(t,e){let n=!1;return(...r)=>{if(!n)return n=!0,setTimeout(()=>n=!1,e),t(...r)}}const Mn=Te(Ne("pretty-value-field-by-entity"));function Vn(t,e,n){try{const r=he.get(t);if(!r)throw new Error("For entity metadata is not loaded");const o=r.fieldsByName[e];if(!o)throw new Error(`For entity ${t} can't found fieldMetadata for field ${e}`);return o.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(r){return Mn('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,t,e,n),n}}const Un=1,jn=5e3,U=Te(Ne("use-socket"));function S(){return Wn}function qn(t){return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Blob]"}const Wn=function(){let t=1,e,n;const r=new Set;let o=0;const s=new Set;function u(){if(e)o&&(clearTimeout(o),o=0);else return;o=setTimeout(()=>{e.close()},jn*2);const a=new Uint8Array(1);a[0]=Un,e.send(a)}setInterval(()=>{Array.from(r).forEach(a=>{N(a)&&(U("Handler for event %s requestId %d was expired",a.event,a.requestId),a.requestId?c({requestId:a.requestId,event:"request-error",data:{message:q.RequestTookToLong().message}}):r.delete(a))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&d()},w.DELAY_SOCKET_RECONNECT);function l(){return{safeQueue:s,requestId:t,handlers:r,socketInstance:e}}function c(a){const p=[...r.values()];U("Handlers array length is %d. Response event: %s. Request id: %d",r.size,a.event,a.requestId),p.forEach(h=>{const _=a.requestId;(h.requestId&&h.requestId===_||!h.requestId&&h.event===a.event)&&(U("Find appropriated handler: %d, event: %s",t,h.event),h.callback(a.data,a),h.once&&(r.delete(h),U("Handler was removed by *once* params was passed. %o",h)))})}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(a){U("Connection to server was stopped: %d %s",a.code,a.reason),Array.from(r).forEach(p=>{p.guaranteedAnswer&&p.serializeString&&s.add(p.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(a=>{f(a),s.delete(a)})},e.onerror=function(a){console.warn(a)},e.onmessage=a=>{var p;try{if(qn(a.data)){u();return}const h=JSON.parse(a.data);if(!ct(h)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(h);return}(p=h==null?void 0:h.data)!=null&&p.refresh&&location.reload(),c(h)}catch(h){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(h)}}}function f(a){e.send(a)}function C(a,p){m({event:a,callback:p})}function k(a,p){m({event:a,callback:p,once:!0})}function E(){return e&&(e==null?void 0:e.readyState)===1}function v(a,p,h){const _=++t,T=JSON.stringify({requestId:_,event:a,data:p,contextId:R.contextId,url:window.location.href});return E()?f(T):(s.add(T),U("Socket is not connected. Message was send to save-queue")),new Promise((G,A)=>{m({event:a,requestId:_,once:!0,guaranteedAnswer:!0,serializeString:T,callback:(V,K)=>{if(U("Promise was resolve with next data:",V),Gn(K))return void A(V);h&&h(V,K),G(V)},timeToLive:w.TIME_TO_LIVE_SOCKET_REQUEST})})}function m(a){const p={timeToLive:0,...a,created:new Date().getTime()};r.add(p)}function N(a){return a.timeToLive===0||typeof a.timeToLive!="number"?!1:new Date().getTime()-a.created>a.timeToLive}return{get socket(){return e},on:C,once:k,emit:v,initialization(a){n=a},getDevInfo:l}}(),Gn=t=>!!ct(t)&&t.event==="request-error",ct=t=>typeof t=="object"&&t!==null&&"event"in t&&typeof t.event=="string"&&"requestId"in t&&typeof t.requestId=="number"&&"data"in t;function zn(t,e){return S().emit("list-setting:read",{entity:t,mark:e})}function Jn(t,e){return S().emit("metadata-field:treat",{entity:t,fieldName:e})}function lt(t,e){return S().emit("entity:create",{...e,entity:t})}function ut(t,e){return S().emit("entity:delete",{...e,entity:t})}function Yn(t,e){return S().emit("usage-context:read",{...e,entity:t})}function dt(t={}){return S().emit("tool:read",t)}function Kn(t,e={},n={}){const r=i.inject(w.PROVIDE_NAME_ACTIONS,null),o=typeof t=="string"?t:e,s=typeof e=="string"?n:e;return i.computed(()=>{var c;const l=((typeof t=="string"?(c=r==null?void 0:r.actions)==null?void 0:c.value:i.unref(t))||[]).find(d=>d.name===o);return l?{...l,...s}:null})}function Hn(t){return S().emit("history:read",t)}function Xn(t,e){return S().emit("entity:count",{...e,entity:t})}function Qn(){const t=i.ref(null);function e(n){t.value=n}return{activeRow:t,activateRow:e}}function Zn(t,e,n={}){const r=i.reactive([]);let o=0;const s=i.ref(!1);function u(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function l(){if(s.value)return Promise.reject("The process has already started.");const a=m();return s.value=!0,typeof a.limit!="number"&&(a.limit=100),a.offset=o,(n.request||pe)(t,a).then(h=>(o+=h.length,h)).finally(()=>{s.value=!1})}function c(a,p){var _;return typeof a.Version=="number"?a.Version:(_=r.find(T=>T.Id===p))==null?void 0:_.Version}function d(a,p){const h=r.findIndex(_=>_.Id===a);if(h===-1)throw new Error(`Can't found item with Id ${a}`);r.splice(h,1,p)}function f(a){const p=r.findIndex(h=>h.Id===a);if(p===-1)throw new Error(`Can't found item with Id ${a}`);r.splice(p,1)}async function C(a,p){try{const h=m(),_=c(p,a);delete p.Version,await Oe(t,{id:a,values:p,version:_,masterEntities:u()});const T=await pe(t,{fields:h.fields||"",id:a});d(a,T)}catch(h){$()(h)}}async function k(a,p={}){try{const h=m(),_=c(p,a);delete p.Version,await ut(t,{id:a,version:_,masterEntities:u()}),f(a)}catch(h){$()(h)}}async function E(a){try{await lt(t,{values:a,masterEntities:u()}),await N()}catch(p){$()(p)}}async function v(){try{const a=await l();r.push(...a)}catch(a){$()(a)}}function m(){return typeof e=="function"?e():e}async function N(){try{o=0;const a=await l();r.splice(0,r.length,...a)}catch(a){$()(a)}}return{array:r,updateById:C,next:v,reload:N,wait:s,create:E,deleteById:k}}function er(){function t(){return{organizations:R.organizations,currentContextId:R.contextId,person:R.person,context:R.context,contextType:R.contextType,userId:R.userId}}const e=i.reactive(t());return R.onupdateContext(()=>{Object.assign(e,t())}),e}function tr(t,e,n){return S().emit("communication:create",{entityName:t,entityCatalogId:e,targetCode:n})}function nr(t,e,n){return S().emit("communication:read",{entityName:t,entityCatalogId:e,targetCode:n})}function rr(t,e){return S().emit("communication-message:create",{communicationId:t,text:e})}function or(t){return S().emit("communication-message:read",{communicationId:t})}function ir(t){const e=P.Form.getParentForm(),n=i.reactive([]);return e&&e.subscribe(t),t.read=()=>or(t.id).then(r=>(n.splice(0,n.length,...r),r)),{array:n}}function sr(t,e){t.read=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw q.EntityWithoutName(t);return pe(t.name,r)}).then(Re).then(o=>(o.hasOwnProperty("Version")&&(t.version=o.Version),t.setValues(o),o)).catch($())},t.save=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw q.EntityWithoutName(t);return Oe(t.name,{id:r.id,values:t.changes,version:t.version})}).then(o=>{t.version=o.version}).catch(o=>{throw $()(o),o})};function n(){return typeof e=="function"?e():e}}function ar(t){if(!t)return i.inject(w.PROVIDE_NAME_METADATA);he.initEntity(t);const e=i.computed(()=>he.state[t]);return i.provide(w.PROVIDE_NAME_METADATA,e),e}function cr(t,e={}){if(!t)return i.inject(w.PROVIDE_NAME_USAGE_CONTEXT);const n=i.ref(null);return i.provide(w.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await Yn(t,lr(e||{}))}}}function lr(t){return typeof t=="function"?t():t}function ur(t){if(!t)return i.inject(w.PROVIDE_NAME_ACTIONS);const e=i.reactive([]),n=i.computed(()=>e.map(s=>dr(t,s))),r={actions:n,update:o};i.provide(w.PROVIDE_NAME_ACTIONS,r),t.router=ze.useRouter(),t.handleConfirmation||(t.handleConfirmation=pr),t.handleAffectedEntity||(t.handleAffectedEntity=gr),t.handleCloseForm||(t.handleCloseForm=mr),t.handleValidationResult||(t.handleValidationResult=hr);function o(s={}){return e.splice(0,e.length),dt(s).then(u=>e.splice(0,0,...u)).catch($("error"))}return{actions:n,update:o}}function dr(t,e){return{...e,label:e.title,callback(){const n=typeof t.values=="function"?t.values(e,t):t.values,r=()=>L(e.url,{method:"POST",body:JSON.stringify({keys:n,contextId:R.contextId}),headers:{"Content-Type":"application/json"}}).then(async o=>{var s,u;if(!yr(o))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(t.handlers))for await(const l of t.handlers)await l(e,o,t);if(!o.success)throw t.handleValidationResult&&o.validationEffect&&((u=(s=o.validationEffect)==null?void 0:s.results)!=null&&u.length)&&t.handleValidationResult(e,o.validationEffect,t),new Error(o.message);return o.message&&ne.add("info",o.message),Array.isArray(o.affectedEntities)&&t.handleAffectedEntity&&o.affectedEntities.forEach(l=>{var c;return(c=t.handleAffectedEntity)==null?void 0:c.call(t,e,l,t)}),e.closeHostForm&&t.handleCloseForm&&t.handleCloseForm(e,t),o}).catch($("error"));return e.requireSave&&t.form&&t.form.changed?t.form.save().then(r):!e.confirmation||!t.handleConfirmation?r():t.handleConfirmation(e,r)}}}function fr(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 pr(t,e){const n=fr(t.confirmation);if(!de.getComponentFromStore(w.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await de.promptModal(w.MODAL_CONFIRM,{message:n}))return e()}function hr(t,e){const n=w.MODAL_VALIDATION_EFFECT;if(!de.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{de.pushModal(n,e)})}function gr(t,e,n){var u;const{router:r,form:o}=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}});o&&e.name===o.name&&e.updated&&s===o.id&&o.read()}function mr(t,e){const{router:n}=e;n&&t.closeHostForm&&n.back()}function yr(t){return!!(t&&typeof t=="object"&&"affectedEntities"in t&&"success"in t)}function Er(t){function e(n){n.key==="Enter"&&t()}i.onMounted(()=>{document.addEventListener("keypress",e)}),i.onUnmounted(()=>{document.removeEventListener("keypress",e)})}function vr(t){const e=i.reactive([]),n=l=>{const c=i.unref(t);if(l===void 0){e.length===0?c.forEach(o):c.forEach(s);return}r(l)?s(l):o(l)},r=l=>e.includes(l),o=l=>{r(l)||e.push(l)},s=l=>{const c=e.findIndex(d=>d===l);c!==-1&&e.splice(c,1)},u=i.computed(()=>{const l=i.unref(t);return e.length===l.length&&l.length!==0});return[e,n,u,o,s]}function wr(t){const e=i.ref(""),n=i.computed(()=>{const r=e.value.toLowerCase();return i.unref(t).filter(o=>e.value.length?Object.values(o).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:n}}const ne=new class{constructor(){this.store=i.reactive([])}add(e,n,r={}){const o=Cr(r),s=new _r(e,n,o.timeout,o.children,o.click);return this.store.push(s),o.timeout&&setTimeout(this.remove.bind(this,s.id),o.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 Cr(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 ft=class pt{constructor(e,n,r,o,s){this.type=e,this.message=n,this.timeout=r,this.children=o,this.click=s,this.id=pt.cardId++}};ft.cardId=1;let _r=ft;class Tr extends F{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return rr(this.id,e)}static checkAndGenerate(e,n,r){return nr(e,n,r).then(o=>o.length===0?tr(e,n,r):o[0])}}function Sr(){return S().emit("client:read",{})}var ht=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Ar=(t,e,n)=>(ht(t,e,"read from private field"),n?n.call(t):e.get(t)),br=(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)},kr=(t,e,n,r)=>(ht(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),ue;const ye=class z extends F{constructor(){super(...arguments),this.type="front",this.organizations=[],br(this,ue,!1)}set language(e){localStorage.setItem(w.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(w.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){kr(this,ue,e),this.emit(z.EVENT_READY_UPDATE,e)}get ready(){return Ar(this,ue)}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(w.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){$()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(w.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 Sr()}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}}};ue=new WeakMap;ye.DEFAULT_LANGUAGE="en";ye.EVENT_CONTEXT_UPDATE="event:context-update";ye.EVENT_READY_UPDATE="event:ready-update";let Nr=ye;function Ir(t){return S().emit("metadata:read",{entity:t})}const he=function(){const e=i.reactive({}),n=new Map;function r(l){return e[l]}async function o(l){if(n.has(l)&&await n.get(l),e[l])return;const c=await s(l);u(l,c)}function s(l){const c=Ir(l).finally(()=>{n.delete(l)});return n.set(l,c),c}function u(l,c){e[l]=c}return{state:e,initEntity:o,get:r}}();class B{static login(e){return L(x.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:x.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 B.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return B.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return B.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return B.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,n){return L(`${x.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(e){return B.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return B.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return B.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,n){return L(`${x.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(B.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 L(`${x.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,o){return L(`${x.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:o})})}static confirmEmailByAccessRecovery(e,n,r,o){return L(`${x.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:o})})}static finishAccessRecovery(e,n,r){return L(`${x.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 Or{static readHistoryById(e,n){return L(`/close-api/audits/history/${e}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Rr{static readLicences(e){const n=`/close-api/proxy/Dashboard/Licenses?organizationId=${e.toString()}`;return L(n).then(r=>{const o={};return r.byOrganization.licenses.forEach(s=>{const u=s.licenseTypeCode;o[u]||(o[u]={licenseTypeCode:u}),o[u][s.statisticName]=s.value}),Object.values(o)})}}function Lr(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function b(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];if(Array.isArray(r)){const o=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${n} in (${o})`),e}if(Lr(r)){let o=function(s){var u;return((u=s.match(/([^Z]*)/))==null?void 0:u[0])+"0000Z"};return r.start&&e.push(`@${n} ge ${o(r.start)}`),r.end&&e.push(`@${n} le ${o(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(b.is(n,r)),e)},[]).join(" and ")}function re(t){return typeof t=="string"?`'${t}'`:`${t}`}b.includes=function(e,n){return`@${e} Contains ${re(n)}`};b.beginWith=function(e,n){return`@${e} BeginWith ${re(n)}`};b.notEq=function(e,n){return`@${e} nq ${re(n)}`};b.eq=function(e,n){return Array.isArray(n)?b.in(e,n):`@${e} eq ${re(n)}`};b.in=function(e,n){const r=n.map(re).join(", ");return`@${e} in (${r})`};b.notIn=function(e,n){return!Array.isArray(n)||n.length===0?"":b.and(...n.map(r=>b.notEq(e,r)))};b.and=function(...e){return e.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(b.wrap).join(" and ")};b.wrap=function(e){return`(${e})`};b.is=function(e,n){return`@${e} is ${n}`};b.or=function(...e){return e.join(" or ")};function Re(t){return Object.keys(t).reduce((e,n)=>{let r=t[n];const o=n.charAt(0).toUpperCase()+n.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Re(r)),e[o]=r,e},{})}const R=new Nr,$r={staticLink:Pt},Pr={utils:At};exports.Communication=Tr;exports.CoreError=q;exports.Filter=b;exports.Manager=R;exports.MetadataStore=he;exports.NotificationSystem=ne;exports.WidgetButton=on;exports.WidgetIcon=te;exports.WidgetImage=mn;exports.WidgetList=In;exports.WidgetLoader=hn;exports.WidgetMultiButton=dn;exports.WidgetSpinner=me;exports.WidgetTable=en;exports.asyncProcess=Rn;exports.authService=B;exports.billingService=J;exports.catchUniversal=$;exports.clientService=He;exports.communicationService=Ot;exports.config=On;exports.configuration=x;exports.constants=w;exports.dashboardService=Rr;exports.dataService=ee;exports.debounce=Bn;exports.default=Pr;exports.documentsService=Dt;exports.fileService=Rt;exports.getCellName=rt;exports.getCellValue=ke;exports.getNamesFromListConfig=$n;exports.getUnitValue=it;exports.groupArrayByField=Pn;exports.historyService=Or;exports.injectAction=Kn;exports.internationalizationService=bt;exports.invitationService=Lt;exports.openService=$t;exports.parseError=fe;exports.prettyDate=Ie;exports.prettyDateWithTime=ot;exports.prettyMoney=at;exports.prettyValueFieldByEntity=Vn;exports.processWizardService=le;exports.request=L;exports.ruleValidationService=be;exports.t=Y;exports.throttle=Fn;exports.universalEntityCount=Xn;exports.universalEntityCreate=lt;exports.universalEntityDelete=ut;exports.universalEntityRead=pe;exports.universalEntityUpdate=Oe;exports.universalHistoryRead=Hn;exports.universalListSettingRead=zn;exports.universalMetadataFieldTreat=Jn;exports.universalToolRead=dt;exports.useActions=ur;exports.useCommunication=ir;exports.useEnter=Er;exports.useFormEntity=sr;exports.useListActiveRow=Qn;exports.useListEntity=Zn;exports.useListSearch=wr;exports.useListSelect=vr;exports.useManagerState=er;exports.useMetadata=ar;exports.useSocket=S;exports.useUsageContext=cr;exports.useWizard=Mt;exports.utils=$r;exports.uuidv4=Dn;exports.valuesToUpperCase=Re;
10
+ */const De=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},xe=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)},Fe=function(){this.events={}};class F{constructor(){this.events={}}on(e,n){return De.call(this,e,n)}emit(e,n){return xe.call(this,e,n)}off(e,n){return Be.call(this,e,n)}cleanEvents(){Fe.call(this)}static on(e,n){return De.call(F,e,n)}static emit(e,n){return xe.call(F,e,n)}static off(e,n){return Be.call(F,e,n)}static cleanEvents(){Fe.call(F)}}F.events={};var Ze=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},ie=(t,e,n)=>(Ze(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)},Ce=(t,e,n,r)=>(Ze(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Q,se,ae;const W=class O extends F{constructor(){super(...arguments),we(this,Q,void 0),we(this,se,"front"),this.organizations=[],we(this,ae,!1)}set language(e){localStorage.setItem(O.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(O.LOCALSTORAGE_LANGUAGE_KEY)||O.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(O.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){Ce(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){Ce(this,se,e)}get type(){return ie(this,se)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Ce(this,ae,e),this.emit(O.EVENT_READY_UPDATE,e)}get ready(){return ie(this,ae)}onReady(e){return this.on(O.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(O.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(O.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(O.CURRENT_CONTEXT_KEY,String(e)),this.emit(O.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(O.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(n)&&this.validateContextId(Number(n))?this.setCurrentContext(n):this.setCurrentContext(Number(e.id))}catch{yt.add("error",q.ApiNotAvailable().message)}}loadCustomerData(){return He.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;se=new WeakMap;ae=new WeakMap;W.DEFAULT_LANGUAGE="en";W.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage";W.EVENT_CONTEXT_UPDATE="event:context-update";W.EVENT_READY_UPDATE="event:ready-update";W.EVENT_DATA_UPDATE="event:data-update";W.CURRENT_CONTEXT_KEY="CurrentContext";let vt=W;const Me=new vt;function wt(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return mt}})}function g(t,e={}){return Me.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=Me.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw q.ApiNotAvailable()}).then(n=>wt(n).then(r=>{if(!n.ok)throw r;return r}))}class ge{constructor(){}static parseNamesFromListConfig(e){let n=ge.parseFieldsToGraphQL(e.reduce((o,s)=>(s.name&&o.push(s.name),o),[]));function r(o){let s="";for(let u in o)typeof o[u]=="boolean"?s+=` ${u} `:s+=` ${u} { ${r(o[u])} }`;return s}return r(n)}static parseSortFromListConfig(e){let n={};for(let r in e)n[r]=e[r]?"ASC":"DESC";return n}static parseFieldsToGraphQL(e){function n(r,o){if(o.includes(".")){const s=o.indexOf("."),u=o.substring(s+1),l=o.substring(0,s);l in r||(r[l]={}),n(r[l],u)}else r[o]=!0;return r}return e.reduce(n,{})}}class Ct{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")}}const _t=new Ct;function et(t){return t&&t[0].toLowerCase()+t.slice(1)}function Ae(t){return Object.keys(t).reduce((e,n)=>{let r=t[n];const o=n.charAt(0).toUpperCase()+n.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Ae(r)),e[o]=r,e},{})}function Tt(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(".")}const St={Request:g,clickOutside:Je,getPropFromObject:Se,runPromiseQueue:Ye,GraphQL:ge,firstChapterToLowerCase:et,valuesToUpperCase:Ae,prettyMoney:Tt},At=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:ge,Journal:_t,Request:g,clickOutside:Je,default:St,firstChapterToLowerCase:et,getPropFromObject:Se,runPromiseQueue:Ye,valuesToUpperCase:Ae},Symbol.toStringTag,{value:"Module"}));class bt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return g(`/open-api/internationalization/language/${e}`)}}let j={};function Y(t,...e){if(typeof t!="string")return console.trace(`Label is not provided for translation: ${t}`),"undefined";let n=P.utils.getPropFromObject((this==null?void 0:this.vocabulary)||j,t);if(typeof n=="string")return Ve(n,e);const r=P.utils.getPropFromObject(j==null?void 0:j.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}Y.setGlobalVocabulary=function(t){j=t};Y.getScope=function(t){const e=typeof t=="string"?t:"root";return typeof t!="string"&&console.warn(`SCOPE ${t} for translate is not string.`),Y.bind({vocabulary:P.utils.getPropFromObject(j,e.toLowerCase())})};Y.setVocabulary=function(t){return typeof t=="string"&&(t=P.utils.getPropFromObject(j,t)),Y.bind({vocabulary:t})};function kt(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&typeof t[1]=="number"}const Nt="masterId",It="masterEntity";function Ue(t,e){if(!Array.isArray(e))return;if(kt(e))return n(e);e.forEach(n);function n(r){t.append(It,r[0]),t.append(Nt,r[1].toString())}}class ee{static async anonymousGetList(e){return await g(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const n=(o,s)=>r.append(o,s),r=new URLSearchParams;if(e.fields){const o=e.fields;typeof o=="string"?n("fields",o):Array.isArray(o)?n("fields",o.join(" ")):typeof o=="object"&&n("fields",Object.keys(o).join(" "))}if(e.order){let o=e.order;const u=(Array.isArray(o)?[o]:Object.entries(o)).map(([l,c="desc"])=>`@${l} ${c}`).join(",");n("order",u)}return e.limit&&n("limit",e.limit.toString()),e.offset&&n("offset",e.offset.toString()),e.filter&&n("filter",e.filter.toString()),e.useUsageContext&&r.append("useUsageContext",e.useUsageContext.toString()),r}static async getList(e,n){const r=ee.getSearchParamsForEntityListRead(n||{});return await g(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,n){const r=ee.getSearchParamsForEntityListRead(n||{});return g(`/close-api/data/entities/${e}/count?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,n,r){const o=new URLSearchParams;return Ue(o,r==null?void 0:r.masterEntities),g(`/close-api/data/${e}?${o.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:n})})}static update(e,n,r,o={}){return g(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static readById(e,n,r={}){const o=new URLSearchParams;if(r.fields){let s=r.fields;typeof s=="string"&&(s=[s]),o.append("fields",s.join(" "))}return g(`/close-api/data/entities/${e}/id/${n}?${o.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,n,r,o){const s=new URLSearchParams;return Ue(s,o==null?void 0:o.masterEntities),g(`/close-api/data/entities/${e}/id/${n}?${s.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r,version:o==null?void 0:o.version})})}static removeById(e,n,r){const o=typeof n=="number"?{Id:n}:n;return ee.removeByKeys(e,o,r)}static removeByKeys(e,n,r){return g(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:n,version:r})})}}const tt=class Z{static async create(e){return g(Z.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const n=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return g(Z.url+"?"+n.toString(),{method:"get"})}static async readMessages(e){return g(`${Z.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return g(`${Z.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};tt.url="/close-api/communications";let Ot=tt;function je(t){return{...t,createdEntities:t.createdEntites}}const nt=class ce{static async getStartConfig(e,n){return g([ce.url,e,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,n){return g([ce.url,e,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(je)}static async runStep(e,n,r,o,s){return g([ce.url,e,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:o,values:s})}).then(je)}};nt.url="/close-api/views/process-wizard";let le=nt;class Rt{static async upload(e,n){const r=new FormData;r.append("file",e);const o=`/close-api/files?entityName=${n}`;return await fetch(o,{method:"POST",body:r}).then(s=>s.json()).then(s=>(s.filename=e.name,s))}}class Lt{static invite(e,n,r){return g("/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 g("/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 g("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!1})})}}class be{static get url(){return"/close-api/rules-validation/"}static validate(e,n){return g(be.url+e,{method:"POST",body:JSON.stringify(n)})}}class $t{static getConfiguration(){return g("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}function Pt(t,e="images"){return`/static-folder/${e}/${t}`}class Dt{static getRequiredDocuments(e,n,r){const o=new URLSearchParams({entity:e,primaryKey:n,statusCode:r});return fetch(`/close-api/views/required-documents?${o.toString()}`).then(s=>s.json())}}class J{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${J.url()}/calculator/${e}`)}static calculate(e,n){return g(`/${J.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]):q.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 g(`/${J.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:n})})}static applyOnlinePayment(e){return g(`/${J.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}function xt(t){return t.statusName==="Completed"}function Bt(t){return t.statusName==="FinalStepWithConfirmation"}function Ft(t){return t.statusName==="ValidationError"}function Mt(t,e,n){let r=null;const o=i.reactive({wait:null});let s=[],u=null;const l=i.ref(null);function c(){l.value=s.find(a=>a.name===u)||null}function d(){var a;return u?((a=s.find(p=>p.name===u))==null?void 0:a.fields)||[]:[]}function f(a){if(c(),Ft(a))return void n.onValidation(a.validationResults);if((a.statusName==="FinalStep"||a.statusName==="NextStep")&&(!d().length||Vt(d(),n.presets)))return N(n.presets||{});xt(a)&&n.onCompleted(a),Bt(a)&&n.onConfirmation(a)}async function C(){try{await k(),await m()}catch(a){const{message:p}=fe(a);ne.add("error",p)}}function k(){return o.wait="Loading process information.",le.getStartConfig(e,t).then(a=>{s=a.steps.map(p=>({label:p.title,name:p.stepName,number:p.number,fields:p.frontendEntity.objectTypes.reduce((h,_)=>(_.properties.forEach(T=>{h.push({name:T.name,label:T.title,type:T.refEntityName||T.dataType})}),h),[])}))}).then(a=>(o.wait=!1,a))}function E(a){return u=a.nextStepName,r=a.token,a}function v(a){const p=fe(a);ne.add("error",p.message)}function m(){return o.wait="Starting process",le.startProcess(e,t).then(E).then(f).catch(v).finally(()=>{o.wait=null})}function N(a={}){return!r||!u?Promise.reject("Not step or token."):(o.wait="Waiting for result...",le.runStep(e,t,u,r,a).then(E).then(f).catch(v).finally(()=>{o.wait=!1}))}return{initialize:C,state:o,currentStepConfig:i.readonly(l),next:N}}function Vt(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(!P.utils.getPropFromObject(e,r.name))return!1}return!0}const Ut={class:"widget-table__head"},jt={class:"widget-table__head-label margin_0 text_overflow"},qt=i.defineComponent({__name:"widget-table-head",props:{config:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("tr",Ut,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.config,(r,o)=>(i.openBlock(),i.createElementBlock("th",{class:"widget-table__head-cell",key:o},[i.createElementVNode("p",jt,i.toDisplayString(r.label),1)]))),128))]))}});const M=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},Wt=M(qt,[["__scopeId","data-v-25198f4a"]]);function rt(t){return typeof t.name=="string"?t.name:Array.isArray(t.name)?t.name[0]:null}function Gt(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 zt(t,e){return Gt(t).forEach(r=>{t.replace(new RegExp("\\$\\{"+r+"}","g"),P.utils.getPropFromObject(e,r))}),t}function ke(t,e){if(typeof t.value=="string")return zt(t.value,e);const n=rt(t);let r=n?P.utils.getPropFromObject(e,n):null;return r===void 0&&(r=null),t.value?t.value(r,e):t.value===null?null:r}const w={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 Ne(t){return[w.CORE_DEBUG_LABEL,t].join(":")}function ot(t){return Ie(t,"YYYY/MM/DD HH:mm:ss")}function Ie(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return gt.format(n,e)}catch(n){return console.log(n),"Invalid date"}}const Jt={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()=>i.h("i",{class:`icon icon-${n}`})}},te=M(Jt,[["__scopeId","data-v-e287c8d9"]]);function it(t){return e=>typeof e=="string"||typeof e=="number"?`${e} ${t}`:""}const Yt=Te(Ne("setup-list-row"));function Kt(t,e){const n=t.config.map(r=>Ht(r,t,e));return i.h("tr",{class:"widget-table__row widget-table-row"},n)}function Ht(t,e,n){const r=e.values;let o=ke(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 c=[],d=[];if(t.unitValue&&(o=it(t.unitValue)(o)),t.hide&&t.hide(r))return[i.h("td")];if(t.type)switch(l(`widget-table-cell_${t.type}`),t.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=Ie(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=ot(typeof o=="string"?o:null);break}case"money":{o=at(o);break}case"multi-select":{d.push(i.h(P.FormField,{type:"single-checkbox",modelValue:e.selected})),u(qe.bind(null,n,!0));break}case"select":{d.push(i.h(P.FormField,{type:"single-radio",modelValue:e.selected})),u(qe.bind(null,n,!1));break}}if(t.onClick&&u(t.onClick),t.link)try{const f=t.link(r);if(f){const C=i.h(ze.RouterLink,{to:f});d.push(C),l("widget-table-cell_link")}}catch(f){Yt("Can't add router link",f)}if(t.href&&(d.push(i.h("a",{href:t.href(r),target:"_blank"})),l("widget-table-cell_link")),typeof o=="boolean"&&(o=o?"✓":"—"),(typeof o=="string"||typeof o=="number")&&d.push(i.h("p",{class:"widget-list-cell-text"},o)),t.icon&&(typeof t.icon=="string"&&d.push(i.h(te,{name:t.icon})),typeof t.icon=="function")){const f=t.icon(r);f!==null&&d.push(i.h(te,{name:f}))}return t.class&&(typeof t.class=="function"?l(t.class(r)):l(t.class)),c.push(i.h("td",s,d)),c}function qe(t,e){t.emit("select",e)}function st(t,e){return()=>{try{return Kt(t,e)}catch(n){return console.warn(n),null}}}const Xt={props:{values:Object,config:Object,selected:Boolean},setup:st},Qt=["colspan"],We=i.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(t,{emit:e}){const n=i.ref();return i.onMounted(()=>{setTimeout(()=>{n.value&&n.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,o)=>(i.openBlock(),i.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:n},[i.createElementVNode("td",{colspan:r.rowLength},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(r.component),i.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:o[0]||(o[0]=s=>e("close")),onSave:o[1]||(o[1]=s=>e("save",s))}),null,16,["values","new"]))],8,Qt)],512))}}),Zt={class:"widget-table"},Ge="update:selectedRows",en=i.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=i.useSlots(),o=i.computed(()=>{var c;return(c=r==null?void 0:r.default)==null?void 0:c.call(r)[0]});function s(c,d=!0){if(!n.selectedRows)return;if(!d)return e(Ge,n.selectedRows.includes(c)?[]:[c]);const f=[...n.selectedRows],C=f.indexOf(c);return C===-1?f.push(c):f.splice(C,1),e(Ge,f)}function u(c){e("save",c),e("update:activeRow",null)}const l=i.computed(()=>n.shortcut?n.config.filter(c=>c.name?!!n.array.find(f=>![null,""].includes(ke(c,f))):!0):n.config);return(c,d)=>(i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("table",Zt,[i.createVNode(Wt,{config:l.value},null,8,["config"]),i.createElementVNode("tbody",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.array,(f,C)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:C},[i.createVNode(Xt,{config:l.value,values:f,selected:c.selectedRows.includes(f),onSelect:k=>s(f,k),class:i.normalizeClass(c.classCallback?c.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),o.value&&c.activeRow===f?(i.openBlock(),i.createBlock(We,{key:0,component:o.value,"row-length":c.config.length,values:f,onClose:d[0]||(d[0]=k=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):i.createCommentVNode("",!0)],64))),128)),c.activeRow===i.unref(w).LIST_ACTIVE_NEW?(i.openBlock(),i.createBlock(We,{key:0,component:o.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"])):i.createCommentVNode("",!0)])])]))}}),tn=i.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:"widget-spinner",style:i.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}});const me=M(tn,[["__scopeId","data-v-0ef9ae88"]]),nn={class:"widget-button"},rn=i.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("button",nn,[e.wait?(i.openBlock(),i.createBlock(me,{key:0,class:"widget-button-spinner"})):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const on=M(rn,[["__scopeId","data-v-450dc564"]]),sn={class:"widget-multi-button-wrap position_relative cursor_pointer"},an={class:"widget-multi-button-body grid"},cn=["onClick"],ln={class:"widget-multi-button-side-wrap"},un=i.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(t){const e=t;i.useCssVars(u=>({"7025434e":r.value}));const n=i.reactive({active:!1,wait:!1}),r=i.computed(()=>e.array.length+(e.label?1:0));function o(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)=>(i.openBlock(),i.createElementBlock("div",sn,[i.createElementVNode("div",{class:i.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[i.createElementVNode("div",an,[u.label?(i.openBlock(),i.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:l[0]||(l[0]=c=>s())},i.toDisplayString(u.label),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.array,(c,d)=>(i.openBlock(),i.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:d,onClick:f=>{o(c.callback),s(!1)}},i.toDisplayString(c.label),9,cn))),128))]),i.createElementVNode("div",ln,[i.createElementVNode("div",{class:i.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:l[1]||(l[1]=c=>s())},[n.wait?(i.openBlock(),i.createBlock(i.unref(me),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(i.openBlock(),i.createBlock(i.unref(te),{key:1,class:"widget-multi-button-side-icon"},{default:i.withCtx(()=>[i.createTextVNode("angle-small-down")]),_:1})):i.createCommentVNode("",!0)],2)])],2)]))}});const dn=M(un,[["__scopeId","data-v-a8d711d1"]]),fn={class:"widget-loader flex flex-align_center gap_10 padding_15"},pn={class:"text_md"},hn=i.defineComponent({__name:"widget-loader",props:{label:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",fn,[i.createVNode(me,{color:"var(--primary)",class:"padding_10"}),i.createElementVNode("span",pn,i.toDisplayString(e.label),1)]))}}),gn=["alt","src"],mn=i.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(t){const e=t,n=i.ref();return i.onMounted(()=>{n.value&&(n.value.src=e.src),n.value.onerror=function(){e.default&&(n.value.src=e.default)}}),(r,o)=>(i.openBlock(),i.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:n,src:r.src||r.$props.default},null,8,gn))}}),yn={props:{config:Array,values:Object,selected:Boolean},setup:st};const En=M(yn,[["__scopeId","data-v-344a8cc1"]]),vn=t=>(i.pushScopeId("data-v-bf495d6a"),t=t(),i.popScopeId(),t),wn={class:"widget-list-head-cell"},Cn=vn(()=>i.createElementVNode("div",{class:"head-cell-resize"},null,-1)),_n=i.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,o)=>(i.openBlock(),i.createElementBlock("th",null,[i.createElementVNode("div",wn,[i.createElementVNode("div",{class:"head-cell-content flex_grow",style:i.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(i.openBlock(),i.createBlock(i.unref(P.FormField),{key:0,type:"single-checkbox",onClick:o[0]||(o[0]=i.withModifiers(s=>e("select"),["stop","prevent"]))})):(i.openBlock(),i.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:o[1]||(o[1]=s=>e("order"))},i.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(i.openBlock(),i.createBlock(i.unref(te),{key:0,class:i.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:i.withCtx(()=>[i.createTextVNode("core-arrow-up")]),_:1},8,["class"])):i.createCommentVNode("",!0),Cn])]))}});const Tn=M(_n,[["__scopeId","data-v-bf495d6a"]]),Sn=i.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const n=t,r=i.ref(),o=i.ref();i.onMounted(()=>{function c(E,v){let m=-1;do m++,v-=E[m];while(v>0&&m<E.length);return m}function d(E,v){let m=0;for(;v>0&&v>E[m]&&m<E.length;)v-=E[m],m++;return console.log(v,m),m>0?m:0}function f(E){try{o.value.style.insetInlineStart=E+"px"}catch(v){console.log(v)}}function C(E){try{o.value.style.width=E+"px",o.value.style.minWidth=E+"px",o.value.style.maxWidth=E+"px"}catch(v){console.log(v)}}function k(E){return E===null?!1:E.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(v){var Pe;function m(I){return I.screenX+p-T}const N=r.value,a=[...N.children].filter(I=>I.localName==="th"),p=((Pe=N.offsetParent)==null?void 0:Pe.scrollLeft)||0,h=a.map(I=>I.clientWidth),_=k(v.target),T=N.getBoundingClientRect().left,G=m(v),A=c(h,G),V=h.slice(0,A).reduce((I,D)=>I+D,0),K=G-V,Ee=N.offsetWidth,H=a[A].clientWidth;if(n.config[A].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",v.screenX),console.log("Widths",h),console.log("max width",Ee),console.log("Start Position",G),console.log("Position From",A),console.log("Start Position",A),console.log("Global offset (Отступ самой таблицы от края экрана)",T),console.log("Del",K),console.groupEnd(),o.value.innerText=a[A].textContent||"",o.value.style.display="grid",o.value.style.width=H+"px",o.value.style.cursor="grabbing",f(V),C(H),document.addEventListener("pointermove",$e,{passive:!0}),document.addEventListener("pointerup",Le);function Le(I){if(console.group("END"),document.removeEventListener("pointermove",$e),document.removeEventListener("pointerup",Le),_&&(n.config[A].width=o.value.style.width,n.config[A].minWidth=o.value.style.width,n.config[A].maxWidth=o.value.style.width,s(n.config)),!_){const D=I.screenX+p-T;console.log("ENP Position",D);const oe=d(h,D);if(console.log(A,"->",oe),oe!==A){const X=n.config[A],ve=n.config;ve.splice(A,1),ve.splice(oe,0,X),s(ve)}else{const X=n.config[A].name;u(X)}}o.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function $e(I){if(_){const X=m(I)-G+H;C(X);return}let D=I.screenX+p-T-K;D<0&&(D=0),D+H>Ee&&(D=Ee-H),f(D)}})});function s(c){e("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(n.order.length===0||n.order[0]!==c)return void l([c]);const d=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([c,d==="asc"?"desc":"asc"])}function l(c){e("update:order",c)}return(c,d)=>(i.openBlock(),i.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.config,(f,C)=>(i.openBlock(),i.createBlock(Tn,i.mergeProps({key:f},f,{onOrder:k=>u(f.name),onSelect:d[0]||(d[0]=k=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),i.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:o},"test",512)],512))}});const An=M(Sn,[["__scopeId","data-v-ccffc6bd"]]),bn={class:"widget-list"},kn={class:"widget-list-body position_relative"},Nn=50,In=i.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,c=!0){if(n.selectedRows)if(!c)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 o(){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 c=l.target;c.scrollTop+c.clientHeight+Nn>c.scrollHeight&&e("scrollEnd")}return(l,c)=>(i.openBlock(),i.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[i.createElementVNode("table",bn,[i.createElementVNode("thead",null,[i.createVNode(An,{onSelect:c[0]||(c[0]=d=>o()),"onUpdate:order":c[1]||(c[1]=d=>e("update:order",d)),"onUpdate:config":c[2]||(c[2]=d=>e("update:config",d)),config:l.config,order:l.order},null,8,["config","order"])]),i.createElementVNode("tbody",kn,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.array,(d,f)=>{var C;return i.openBlock(),i.createBlock(En,{key:f,class:"widget-list-row",values:d,config:l.config,selected:(C=l.selectedRows)==null?void 0:C.includes(d),onSelect:k=>r(d,k)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),x={};function On(t){for(let e in t)x[e]=t[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function Rn(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=i.reactive({wait:!1,call:e});return n}function fe(t){return typeof t=="string"?_e(t):Ln(t)?_e(t.message,t.children):_e(w.DEFAULT_ERROR_MESSAGE)}function Ln(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"message"))}function _e(t,e=[]){return{message:t,children:e}}function $(t="error"){return function(e){const{message:n,children:r}=fe(e);ne.add(t,n,{children:r})}}function pe(t,e={}){return S().emit("entity:read",{...e,entity:t})}function Oe(t,e){return S().emit("entity:update",{...e,entity:t})}function $n(t){return t.reduce((e,n)=>(n.name&&(typeof n.name=="string"?e.push(n.name):e.push(...n.name)),e),[])}function at(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 Pn(t,e){const n=new Map;return t.forEach(r=>{var s;const o=e(r);n.has(o)||n.set(o,[]),(s=n.get(o))==null||s.push(r)}),n}function Dn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function xn(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return w.DEFAULT_ERROR_MESSAGE}})}function L(t,e={}){return R.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=R.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw new Error(w.DEFAULT_ERROR_MESSAGE)}).then(n=>xn(n).then(r=>{if(!n.ok)throw r;return r}))}function Bn(t,e=1e3){let n=0;return(...r)=>{clearTimeout(n),n=setTimeout(()=>t(...r),e)}}function Fn(t,e){let n=!1;return(...r)=>{if(!n)return n=!0,setTimeout(()=>n=!1,e),t(...r)}}const Mn=Te(Ne("pretty-value-field-by-entity"));function Vn(t,e,n){try{const r=he.get(t);if(!r)throw new Error("For entity metadata is not loaded");const o=r.fieldsByName[e];if(!o)throw new Error(`For entity ${t} can't found fieldMetadata for field ${e}`);return o.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(r){return Mn('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,t,e,n),n}}const Un=1,jn=5e3,U=Te(Ne("use-socket"));function S(){return Wn}function qn(t){return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Blob]"}const Wn=function(){let t=1,e,n;const r=new Set;let o=0;const s=new Set;function u(){if(e)o&&(clearTimeout(o),o=0);else return;o=setTimeout(()=>{e.close()},jn*2);const a=new Uint8Array(1);a[0]=Un,e.send(a)}setInterval(()=>{Array.from(r).forEach(a=>{N(a)&&(U("Handler for event %s requestId %d was expired",a.event,a.requestId),a.requestId?c({requestId:a.requestId,event:"request-error",data:{message:q.RequestTookToLong().message}}):r.delete(a))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&d()},w.DELAY_SOCKET_RECONNECT);function l(){return{safeQueue:s,requestId:t,handlers:r,socketInstance:e}}function c(a){const p=[...r.values()];U("Handlers array length is %d. Response event: %s. Request id: %d",r.size,a.event,a.requestId),p.forEach(h=>{const _=a.requestId;(h.requestId&&h.requestId===_||!h.requestId&&h.event===a.event)&&(U("Find appropriated handler: %d, event: %s",t,h.event),h.callback(a.data,a),h.once&&(r.delete(h),U("Handler was removed by *once* params was passed. %o",h)))})}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(a){U("Connection to server was stopped: %d %s",a.code,a.reason),Array.from(r).forEach(p=>{p.guaranteedAnswer&&p.serializeString&&s.add(p.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(a=>{f(a),s.delete(a)})},e.onerror=function(a){console.warn(a)},e.onmessage=a=>{var p;try{if(qn(a.data)){u();return}const h=JSON.parse(a.data);if(!ct(h)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(h);return}(p=h==null?void 0:h.data)!=null&&p.refresh&&location.reload(),c(h)}catch(h){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(h)}}}function f(a){e.send(a)}function C(a,p){m({event:a,callback:p})}function k(a,p){m({event:a,callback:p,once:!0})}function E(){return e&&(e==null?void 0:e.readyState)===1}function v(a,p,h){const _=++t,T=JSON.stringify({requestId:_,event:a,data:p,contextId:R.contextId,url:window.location.href});return E()?f(T):(s.add(T),U("Socket is not connected. Message was send to save-queue")),new Promise((G,A)=>{m({event:a,requestId:_,once:!0,guaranteedAnswer:!0,serializeString:T,callback:(V,K)=>{if(U("Promise was resolve with next data:",V),Gn(K))return void A(V);h&&h(V,K),G(V)},timeToLive:w.TIME_TO_LIVE_SOCKET_REQUEST})})}function m(a){const p={timeToLive:0,...a,created:new Date().getTime()};r.add(p)}function N(a){return a.timeToLive===0||typeof a.timeToLive!="number"?!1:new Date().getTime()-a.created>a.timeToLive}return{get socket(){return e},on:C,once:k,emit:v,initialization(a){n=a},getDevInfo:l}}(),Gn=t=>!!ct(t)&&t.event==="request-error",ct=t=>typeof t=="object"&&t!==null&&"event"in t&&typeof t.event=="string"&&"requestId"in t&&typeof t.requestId=="number"&&"data"in t;function zn(t,e){return S().emit("list-setting:read",{entity:t,mark:e})}function Jn(t,e){return S().emit("metadata-field:treat",{entity:t,fieldName:e})}function lt(t,e){return S().emit("entity:create",{...e,entity:t})}function ut(t,e){return S().emit("entity:delete",{...e,entity:t})}function Yn(t,e){return S().emit("usage-context:read",{...e,entity:t})}function dt(t={}){return S().emit("tool:read",t)}function Kn(t,e={},n={}){const r=i.inject(w.PROVIDE_NAME_ACTIONS,null),o=typeof t=="string"?t:e,s=typeof e=="string"?n:e;return i.computed(()=>{var c;const l=((typeof t=="string"?(c=r==null?void 0:r.actions)==null?void 0:c.value:i.unref(t))||[]).find(d=>d.name===o);return l?{...l,...s}:null})}function Hn(t){return S().emit("history:read",t)}function Xn(t,e){return S().emit("entity:count",{...e,entity:t})}function Qn(){const t=i.ref(null);function e(n){t.value=n}return{activeRow:t,activateRow:e}}function Zn(t,e,n={}){const r=i.reactive([]);let o=0;const s=i.ref(!1);function u(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function l(){if(s.value)return Promise.reject("The process has already started.");const a=m();return s.value=!0,typeof a.limit!="number"&&(a.limit=100),a.offset=o,(n.request||pe)(t,a).then(h=>(o+=h.length,h)).finally(()=>{s.value=!1})}function c(a,p){var _;return typeof a.Version=="number"?a.Version:(_=r.find(T=>T.Id===p))==null?void 0:_.Version}function d(a,p){const h=r.findIndex(_=>_.Id===a);if(h===-1)throw new Error(`Can't found item with Id ${a}`);r.splice(h,1,p)}function f(a){const p=r.findIndex(h=>h.Id===a);if(p===-1)throw new Error(`Can't found item with Id ${a}`);r.splice(p,1)}async function C(a,p){try{const h=m(),_=c(p,a);delete p.Version,await Oe(t,{id:a,values:p,version:_,masterEntities:u()});const T=await pe(t,{fields:h.fields||"",id:a});d(a,T)}catch(h){$()(h)}}async function k(a,p={}){try{const h=m(),_=c(p,a);delete p.Version,await ut(t,{id:a,version:_,masterEntities:u()}),f(a)}catch(h){$()(h)}}async function E(a){try{await lt(t,{values:a,masterEntities:u()}),await N()}catch(p){$()(p)}}async function v(){try{const a=await l();r.push(...a)}catch(a){$()(a)}}function m(){return typeof e=="function"?e():e}async function N(){try{o=0;const a=await l();r.splice(0,r.length,...a)}catch(a){$()(a)}}return{array:r,updateById:C,next:v,reload:N,wait:s,create:E,deleteById:k}}function er(){function t(){return{organizations:R.organizations,currentContextId:R.contextId,person:R.person,context:R.context,contextType:R.contextType,userId:R.userId}}const e=i.reactive(t());return R.onupdateContext(()=>{Object.assign(e,t())}),e}function tr(t,e,n){return S().emit("communication:create",{entityName:t,entityCatalogId:e,targetCode:n})}function nr(t,e,n){return S().emit("communication:read",{entityName:t,entityCatalogId:e,targetCode:n})}function rr(t,e){return S().emit("communication-message:create",{communicationId:t,text:e})}function or(t){return S().emit("communication-message:read",{communicationId:t})}function ir(t){const e=P.Form.getParentForm(),n=i.reactive([]);return e&&e.subscribe(t),t.read=()=>or(t.id).then(r=>(n.splice(0,n.length,...r),r)),{array:n}}function sr(t,e){t.read=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw q.EntityWithoutName(t);return pe(t.name,r)}).then(Re).then(o=>(o.hasOwnProperty("Version")&&(t.version=o.Version),t.setValues(o),o)).catch($())},t.save=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw q.EntityWithoutName(t);return Oe(t.name,{id:r.id,values:t.changes,version:t.version})}).then(o=>{t.version=o.version}).catch(o=>{throw $()(o),o})};function n(){return typeof e=="function"?e():e}}function ar(t){if(!t)return i.inject(w.PROVIDE_NAME_METADATA);he.initEntity(t);const e=i.computed(()=>he.state[t]);return i.provide(w.PROVIDE_NAME_METADATA,e),e}function cr(t,e={}){if(!t)return i.inject(w.PROVIDE_NAME_USAGE_CONTEXT);const n=i.ref(null);return i.provide(w.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await Yn(t,lr(e||{}))}}}function lr(t){return typeof t=="function"?t():t}function ur(t){if(!t)return i.inject(w.PROVIDE_NAME_ACTIONS);const e=i.reactive([]),n=i.computed(()=>e.map(s=>dr(t,s))),r={actions:n,update:o};i.provide(w.PROVIDE_NAME_ACTIONS,r),t.router=ze.useRouter(),t.handleConfirmation||(t.handleConfirmation=pr),t.handleAffectedEntity||(t.handleAffectedEntity=gr),t.handleCloseForm||(t.handleCloseForm=mr),t.handleValidationResult||(t.handleValidationResult=hr);function o(s={}){return e.splice(0,e.length),dt(s).then(u=>e.splice(0,0,...u)).catch($("error"))}return{actions:n,update:o}}function dr(t,e){return{...e,label:e.title,callback(){const n=typeof t.values=="function"?t.values(e,t):t.values,r=()=>L(e.url,{method:"POST",body:JSON.stringify({keys:n,contextId:R.contextId}),headers:{"Content-Type":"application/json"}}).then(async o=>{var s,u;if(!yr(o))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(t.handlers))for await(const l of t.handlers)await l(e,o,t);if(!o.success)throw t.handleValidationResult&&o.validationEffect&&((u=(s=o.validationEffect)==null?void 0:s.results)!=null&&u.length)&&t.handleValidationResult(e,o.validationEffect,t),new Error(o.message);return o.message&&ne.add("info",o.message),Array.isArray(o.affectedEntities)&&t.handleAffectedEntity&&o.affectedEntities.forEach(l=>{var c;return(c=t.handleAffectedEntity)==null?void 0:c.call(t,e,l,t)}),e.closeHostForm&&t.handleCloseForm&&t.handleCloseForm(e,t),o}).catch($("error"));return e.requireSave&&t.form&&t.form.changed?t.form.save().then(r):!e.confirmation||!t.handleConfirmation?r():t.handleConfirmation(e,r)}}}function fr(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 pr(t,e){const n=fr(t.confirmation);if(!de.getComponentFromStore(w.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await de.promptModal(w.MODAL_CONFIRM,{message:n}))return e()}function hr(t,e){const n=w.MODAL_VALIDATION_EFFECT;if(!de.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{de.pushModal(n,e)})}function gr(t,e,n){var u;const{router:r,form:o}=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}});o&&e.name===o.name&&e.updated&&s===o.id&&o.read()}function mr(t,e){const{router:n}=e;n&&t.closeHostForm&&n.back()}function yr(t){return!!(t&&typeof t=="object"&&"affectedEntities"in t&&"success"in t)}function Er(t){function e(n){n.key==="Enter"&&t()}i.onMounted(()=>{document.addEventListener("keypress",e)}),i.onUnmounted(()=>{document.removeEventListener("keypress",e)})}function vr(t){const e=i.reactive([]),n=l=>{const c=i.unref(t);if(l===void 0){e.length===0?c.forEach(o):c.forEach(s);return}r(l)?s(l):o(l)},r=l=>e.includes(l),o=l=>{r(l)||e.push(l)},s=l=>{const c=e.findIndex(d=>d===l);c!==-1&&e.splice(c,1)},u=i.computed(()=>{const l=i.unref(t);return e.length===l.length&&l.length!==0});return[e,n,u,o,s]}function wr(t){const e=i.ref(""),n=i.computed(()=>{const r=e.value.toLowerCase();return i.unref(t).filter(o=>e.value.length?Object.values(o).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:n}}const ne=new class{constructor(){this.store=i.reactive([])}add(e,n,r={}){const o=Cr(r),s=new _r(e,n,o.timeout,o.children,o.click);return this.store.push(s),o.timeout&&setTimeout(this.remove.bind(this,s.id),o.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 Cr(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 ft=class pt{constructor(e,n,r,o,s){this.type=e,this.message=n,this.timeout=r,this.children=o,this.click=s,this.id=pt.cardId++}};ft.cardId=1;let _r=ft;class Tr extends F{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return rr(this.id,e)}static checkAndGenerate(e,n,r){return nr(e,n,r).then(o=>o.length===0?tr(e,n,r):o[0])}}function Sr(){return S().emit("client:read",{})}var ht=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Ar=(t,e,n)=>(ht(t,e,"read from private field"),n?n.call(t):e.get(t)),br=(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)},kr=(t,e,n,r)=>(ht(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),ue;const ye=class z extends F{constructor(){super(...arguments),this.type="front",this.organizations=[],br(this,ue,!1)}set language(e){localStorage.setItem(w.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(w.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){kr(this,ue,e),this.emit(z.EVENT_READY_UPDATE,e)}get ready(){return Ar(this,ue)}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(w.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){$()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(w.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 Sr()}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}}};ue=new WeakMap;ye.DEFAULT_LANGUAGE="en";ye.EVENT_CONTEXT_UPDATE="event:context-update";ye.EVENT_READY_UPDATE="event:ready-update";let Nr=ye;function Ir(t){return S().emit("metadata:read",{entity:t})}const he=function(){const e=i.reactive({}),n=new Map;function r(l){return e[l]}async function o(l){if(n.has(l)&&await n.get(l),e[l])return;const c=await s(l);u(l,c)}function s(l){const c=Ir(l).finally(()=>{n.delete(l)});return n.set(l,c),c}function u(l,c){e[l]=c}return{state:e,initEntity:o,get:r}}();class B{static login(e){return L(x.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:x.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 B.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return B.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return B.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return B.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,n){return L(`${x.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(e){return B.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return B.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return B.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,n){return L(`${x.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(B.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 L(`${x.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,o){return L(`${x.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:o})})}static confirmEmailByAccessRecovery(e,n,r,o){return L(`${x.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:e,Token:n,Prefix:r,Code:o})})}static finishAccessRecovery(e,n,r){return L(`${x.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 Or{static readHistoryById(e,n){return L(`/close-api/audits/history/${e}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Rr{static readLicences(e){const n=`/close-api/proxy/Dashboard/Licenses?organizationId=${e.toString()}`;return L(n).then(r=>{const o={};return r.byOrganization.licenses.forEach(s=>{const u=s.licenseTypeCode;o[u]||(o[u]={licenseTypeCode:u}),o[u][s.statisticName]=s.value}),Object.values(o)})}}function Lr(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function b(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];if(Array.isArray(r)){const o=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${n} in (${o})`),e}if(Lr(r)){let o=function(s){var u;return((u=s.match(/([^Z]*)/))==null?void 0:u[0])+"0000Z"};return r.start&&e.push(`@${n} ge ${o(r.start)}`),r.end&&e.push(`@${n} le ${o(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(b.is(n,r)),e)},[]).join(" and ")}function re(t){return typeof t=="string"?`'${t}'`:`${t}`}b.includes=function(e,n){return`@${e} Contains ${re(n)}`};b.beginWith=function(e,n){return`@${e} BeginWith ${re(n)}`};b.notEq=function(e,n){return`@${e} nq ${re(n)}`};b.eq=function(e,n){return Array.isArray(n)?b.in(e,n):`@${e} eq ${re(n)}`};b.in=function(e,n){const r=n.map(re).join(", ");return`@${e} in (${r})`};b.notIn=function(e,n){return!Array.isArray(n)||n.length===0?"":b.and(...n.map(r=>b.notEq(e,r)))};b.and=function(...e){return e.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(b.wrap).join(" and ")};b.wrap=function(e){return`(${e})`};b.is=function(e,n){return`@${e} is ${n}`};b.or=function(...e){return e.join(" or ")};function Re(t){return Object.keys(t).reduce((e,n)=>{let r=t[n];const o=n.charAt(0).toUpperCase()+n.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Re(r)),e[o]=r,e},{})}const R=new Nr,$r={staticLink:Pt},Pr={utils:At};exports.Communication=Tr;exports.CoreError=q;exports.Filter=b;exports.Manager=R;exports.MetadataStore=he;exports.NotificationSystem=ne;exports.WidgetButton=on;exports.WidgetIcon=te;exports.WidgetImage=mn;exports.WidgetList=In;exports.WidgetLoader=hn;exports.WidgetMultiButton=dn;exports.WidgetSpinner=me;exports.WidgetTable=en;exports.asyncProcess=Rn;exports.authService=B;exports.billingService=J;exports.catchUniversal=$;exports.clientService=He;exports.communicationService=Ot;exports.config=On;exports.configuration=x;exports.constants=w;exports.dashboardService=Rr;exports.dataService=ee;exports.debounce=Bn;exports.default=Pr;exports.documentsService=Dt;exports.fileService=Rt;exports.getCellName=rt;exports.getCellValue=ke;exports.getNamesFromListConfig=$n;exports.getUnitValue=it;exports.groupArrayByField=Pn;exports.historyService=Or;exports.injectAction=Kn;exports.internationalizationService=bt;exports.invitationService=Lt;exports.openService=$t;exports.parseError=fe;exports.prettyDate=Ie;exports.prettyDateWithTime=ot;exports.prettyMoney=at;exports.prettyValueFieldByEntity=Vn;exports.processWizardService=le;exports.request=L;exports.ruleValidationService=be;exports.t=Y;exports.throttle=Fn;exports.universalEntityCount=Xn;exports.universalEntityCreate=lt;exports.universalEntityDelete=ut;exports.universalEntityRead=pe;exports.universalEntityUpdate=Oe;exports.universalHistoryRead=Hn;exports.universalListSettingRead=zn;exports.universalMetadataFieldTreat=Jn;exports.universalToolRead=dt;exports.useActions=ur;exports.useCommunication=ir;exports.useEnter=Er;exports.useFormEntity=sr;exports.useListActiveRow=Qn;exports.useListEntity=Zn;exports.useListSearch=wr;exports.useListSelect=vr;exports.useManagerState=er;exports.useMetadata=ar;exports.useSocket=S;exports.useUsageContext=cr;exports.useWizard=Mt;exports.utils=$r;exports.uuidv4=Dn;exports.valuesToUpperCase=Re;
11
11
  //# sourceMappingURL=eservices-core.cjs.js.map
@@ -6,7 +6,7 @@ import Ve from "debug";
6
6
  import jt from "date-and-time";
7
7
  import { getComponentFromStore as ut, promptModal as qt, pushModal as Wt } from "jenesius-vue-modal";
8
8
  /*!
9
- * eservices-core v1.3.104
9
+ * eservices-core v1.3.105
10
10
  * (c) 2024 ESERVICES
11
11
  */
12
12
  function je(t, e) {
@@ -1033,13 +1033,15 @@ function gn(t) {
1033
1033
  }
1034
1034
  function yn(t, e) {
1035
1035
  return gn(t).forEach((r) => {
1036
- t.replace(new RegExp("${" + r + "}", "g"), X.getPropFromObject(e, r));
1036
+ t.replace(new RegExp("\\$\\{" + r + "}", "g"), X.getPropFromObject(e, r));
1037
1037
  }), t;
1038
1038
  }
1039
1039
  function vt(t, e) {
1040
+ if (typeof t.value == "string")
1041
+ return yn(t.value, e);
1040
1042
  const n = hn(t);
1041
1043
  let r = n ? X.getPropFromObject(e, n) : null;
1042
- return r === void 0 && (r = null), typeof t.value == "string" ? yn(t.value, e) : t.value ? t.value(r, e) : t.value === null ? null : r;
1044
+ return r === void 0 && (r = null), t.value ? t.value(r, e) : t.value === null ? null : r;
1043
1045
  }
1044
1046
  const _ = {
1045
1047
  LIST_ACTIVE_NEW: "list-active-new",
@@ -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(d,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("jenesius-vue-form"),require("vue-router"),require("debug"),require("date-and-time"),require("jenesius-vue-modal")):typeof define=="function"&&define.amd?define(["exports","vue","jenesius-vue-form","vue-router","debug","date-and-time","jenesius-vue-modal"],o):(d=typeof globalThis<"u"?globalThis:d||self,o(d["eservices-core"]={},d.Vue,d.JenesiusVueForm,d.VueRouter,d.Debug,d.DateAndTime,d.JenesiusVueModal))})(this,function(d,o,$,$e,we,mt,oe){"use strict";/*!
3
- * eservices-core v1.3.104
3
+ * eservices-core v1.3.105
4
4
  * (c) 2024 ESERVICES
5
5
  */const Pr="";function Ce(t,e){if(typeof t!="object"||t===null)return;if(e in t)return t[e];let n=e.indexOf(".");if(n>-1){const r=e.substring(0,n);return r in t?Ce(t[r],e.substr(n+1)):void 0}return t[e]}function Pe(t,e){if(!t)return console.warn("Element is not provided.");function n(i,s){return i==s.target||i.contains(s.target)}const r=i=>{n(t,i)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function De(t){return t.reduce((e,n)=>e.then(r=>n==null?void 0:n(r)),Promise.resolve())}const Be=class E extends Error{constructor(e,n=null){super(),this.message=e,this.details=n,this.id=E.ID++}static ParentFormNotFound(){return new E("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new E("Composite object name is undefined",e)}static EntityWithoutName(e){return new E("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new E(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new E("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new E("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new E(`${e} (id) is not a number`)}static UndefinedErrorId(e,n){return E.ApiNotAvailable()}static ApiError(e){return new E("Request error",e)}static ApiNotAvailable(){return new E(`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?E.ApiNotAvailable():new E(e||"Authorization Error",n)}static ApiResponseParseFailed(){return E.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new E("Object doesn't have id",e)}static ObjectWithIdNotFound(e,n){return new E(`Can't find object with id: ${e}`,n)}static ObjectWithoutConnectToPresentArray(e,n){return new E("Object is not found.",{object:e,array:n})}static EntityWithoutId(e){return new E("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,n){return new E(`Can't find the element with tableIndex ${e}`,n)}static UndefinedError(e,n=[]){return new E(e,n)}static TableArrayAlreadyIncludeProvidedIndexValue(e,n,r){return new E(`Array already includes the element with value ${e}`,{array:n,table:r})}static MetadataEntityIsNotAvailable(e){return new E(`Metadata for the ${e} is not currently available.`)}static RequestTookToLong(){return new E("The request took too long to complete. Try again later.")}};Be.ID=0;let q=Be;const yt="Please try again later or submit a feedback if problem doesn't go.";class Me{static getClientData(){return m("/close-api/client-content")}static getNavigation(){return m("/close-api/client/navigation")}}const Et=new class{constructor(){this.store=o.reactive([])}add(e,n,{children:r,timeout:i=10,click:s=()=>{}}={}){const u=new wt(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.")}},Fe=class ht{constructor(e,n,r,i,s){this.type=e,this.msg=n,this.timeout=r,this.children=i,this.click=s,this.id=ht.cardId++}};Fe.cardId=1;let wt=Fe;/*!
7
7
  * jenesius-event-emitter v1.0.2
8
8
  * (c) 2022 Jenesius
9
9
  * @license MIT
10
- */const Ue=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},Ve=function(t,e){t in this.events&&this.events[t].forEach(n=>n(e))},qe=function(t,e){const n=this.events[t];if(!n)return;const r=n.indexOf(e);r!==-1&&n.splice(r,1)},je=function(){this.events={}};class U{constructor(){this.events={}}on(e,n){return Ue.call(this,e,n)}emit(e,n){return Ve.call(this,e,n)}off(e,n){return qe.call(this,e,n)}cleanEvents(){je.call(this)}static on(e,n){return Ue.call(U,e,n)}static emit(e,n){return Ve.call(U,e,n)}static off(e,n){return qe.call(U,e,n)}static cleanEvents(){je.call(U)}}U.events={};var We=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},se=(t,e,n)=>(We(t,e,"read from private field"),n?n.call(t):e.get(t)),_e=(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)=>(We(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),H,ae,ce;const j=class L extends U{constructor(){super(...arguments),_e(this,H,void 0),_e(this,ae,"front"),this.organizations=[],_e(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){Te(this,H,e)}get router(){if(!se(this,H))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return se(this,H)}set type(e){Te(this,ae,e)}get type(){return se(this,ae)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Te(this,ce,e),this.emit(L.EVENT_READY_UPDATE,e)}get ready(){return se(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{Et.add("error",q.ApiNotAvailable().message)}}loadCustomerData(){return Me.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))}};H=new WeakMap,ae=new WeakMap,ce=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 Ct=j;const Ge=new Ct;function _t(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return yt}})}function m(t,e={}){return Ge.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=Ge.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw q.ApiNotAvailable()}).then(n=>_t(n).then(r=>{if(!n.ok)throw r;return r}))}class le{constructor(){}static parseNamesFromListConfig(e){let n=le.parseFieldsToGraphQL(e.reduce((i,s)=>(s.name&&i.push(s.name),i),[]));function r(i){let s="";for(let u in i)typeof i[u]=="boolean"?s+=` ${u} `:s+=` ${u} { ${r(i[u])} }`;return s}return r(n)}static parseSortFromListConfig(e){let n={};for(let r in e)n[r]=e[r]?"ASC":"DESC";return n}static parseFieldsToGraphQL(e){function n(r,i){if(i.includes(".")){const s=i.indexOf("."),u=i.substring(s+1),l=i.substring(0,s);l in r||(r[l]={}),n(r[l],u)}else r[i]=!0;return r}return e.reduce(n,{})}}class Tt{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")}}const St=new Tt;function xe(t){return t&&t[0].toLowerCase()+t.slice(1)}function Se(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=Se(r)),e[i]=r,e},{})}function At(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(".")}const bt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:le,Journal:St,Request:m,clickOutside:Pe,default:{Request:m,clickOutside:Pe,getPropFromObject:Ce,runPromiseQueue:De,GraphQL:le,firstChapterToLowerCase:xe,valuesToUpperCase:Se,prettyMoney:At},firstChapterToLowerCase:xe,getPropFromObject:Ce,runPromiseQueue:De,valuesToUpperCase:Se},Symbol.toStringTag,{value:"Module"}));class kt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return m(`/open-api/internationalization/language/${e}`)}}let W={};function z(t,...e){if(typeof t!="string")return console.trace(`Label is not provided for translation: ${t}`),"undefined";let n=$.utils.getPropFromObject((this==null?void 0:this.vocabulary)||W,t);if(typeof n=="string")return ze(n,e);const r=$.utils.getPropFromObject(W==null?void 0:W.root,t);return typeof r=="string"?ze(r,e):(typeof n===void 0&&console.warn(`Translation for label "${t}" is not founded.`),t)}function ze(t,e){return e.forEach((n,r)=>{t=t.replaceAll(new RegExp(`\\{${r}}`,"g"),n)}),t}z.setGlobalVocabulary=function(t){W=t},z.getScope=function(t){const e=typeof t=="string"?t:"root";return typeof t!="string"&&console.warn(`SCOPE ${t} for translate is not string.`),z.bind({vocabulary:$.utils.getPropFromObject(W,e.toLowerCase())})},z.setVocabulary=function(t){return typeof t=="string"&&(t=$.utils.getPropFromObject(W,t)),z.bind({vocabulary:t})};function Nt(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&typeof t[1]=="number"}const It="masterId",Ot="masterEntity";function Je(t,e){if(!Array.isArray(e))return;if(Nt(e))return n(e);e.forEach(n);function n(r){t.append(Ot,r[0]),t.append(It,r[1].toString())}}class X{static async anonymousGetList(e){return await m(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const n=(i,s)=>r.append(i,s),r=new URLSearchParams;if(e.fields){const i=e.fields;typeof i=="string"?n("fields",i):Array.isArray(i)?n("fields",i.join(" ")):typeof i=="object"&&n("fields",Object.keys(i).join(" "))}if(e.order){let i=e.order;const u=(Array.isArray(i)?[i]:Object.entries(i)).map(([l,c="desc"])=>`@${l} ${c}`).join(",");n("order",u)}return e.limit&&n("limit",e.limit.toString()),e.offset&&n("offset",e.offset.toString()),e.filter&&n("filter",e.filter.toString()),e.useUsageContext&&r.append("useUsageContext",e.useUsageContext.toString()),r}static async getList(e,n){const r=X.getSearchParamsForEntityListRead(n||{});return await m(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,n){const r=X.getSearchParamsForEntityListRead(n||{});return m(`/close-api/data/entities/${e}/count?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,n,r){const i=new URLSearchParams;return Je(i,r==null?void 0:r.masterEntities),m(`/close-api/data/${e}?${i.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:n})})}static update(e,n,r,i={}){return m(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static readById(e,n,r={}){const i=new URLSearchParams;if(r.fields){let s=r.fields;typeof s=="string"&&(s=[s]),i.append("fields",s.join(" "))}return m(`/close-api/data/entities/${e}/id/${n}?${i.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,n,r,i){const s=new URLSearchParams;return Je(s,i==null?void 0:i.masterEntities),m(`/close-api/data/entities/${e}/id/${n}?${s.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r,version:i==null?void 0:i.version})})}static removeById(e,n,r){const i=typeof n=="number"?{Id:n}:n;return X.removeByKeys(e,i,r)}static removeByKeys(e,n,r){return m(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:n,version:r})})}}const Ye=class ie{static async create(e){return m(ie.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const n=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return m(ie.url+"?"+n.toString(),{method:"get"})}static async readMessages(e){return m(`${ie.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return m(`${ie.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};Ye.url="/close-api/communications";let vt=Ye;function Ke(t){return{...t,createdEntities:t.createdEntites}}const He=class Ee{static async getStartConfig(e,n){return m([Ee.url,e,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,n){return m([Ee.url,e,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(Ke)}static async runStep(e,n,r,i,s){return m([Ee.url,e,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(Ke)}};He.url="/close-api/views/process-wizard";let de=He;class Rt{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 Lt{static invite(e,n,r){return m("/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 m("/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 m("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!1})})}}class Ae{static get url(){return"/close-api/rules-validation/"}static validate(e,n){return m(Ae.url+e,{method:"POST",body:JSON.stringify(n)})}}class $t{static getConfiguration(){return m("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}function Pt(t,e="images"){return`/static-folder/${e}/${t}`}class Dt{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 J{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${J.url()}/calculator/${e}`)}static calculate(e,n){return m(`/${J.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]):q.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 m(`/${J.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:n})})}static applyOnlinePayment(e){return m(`/${J.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}function Bt(t){return t.statusName==="Completed"}function Mt(t){return t.statusName==="FinalStepWithConfirmation"}function Ft(t){return t.statusName==="ValidationError"}function Ut(t,e,n){let r=null;const i=o.reactive({wait:null});let s=[],u=null;const l=o.ref(null);function c(){l.value=s.find(a=>a.name===u)||null}function f(){var a;return u?((a=s.find(h=>h.name===u))==null?void 0:a.fields)||[]:[]}function p(a){if(c(),Ft(a))return void n.onValidation(a.validationResults);if((a.statusName==="FinalStep"||a.statusName==="NextStep")&&(!f().length||Vt(f(),n.presets)))return v(n.presets||{});Bt(a)&&n.onCompleted(a),Mt(a)&&n.onConfirmation(a)}async function T(){try{await I(),await y()}catch(a){const{message:h}=fe(a);Z.add("error",h)}}function I(){return i.wait="Loading process information.",de.getStartConfig(e,t).then(a=>{s=a.steps.map(h=>({label:h.title,name:h.stepName,number:h.number,fields:h.frontendEntity.objectTypes.reduce((g,S)=>(S.properties.forEach(b=>{g.push({name:b.name,label:b.title,type:b.refEntityName||b.dataType})}),g),[])}))}).then(a=>(i.wait=!1,a))}function w(a){return u=a.nextStepName,r=a.token,a}function _(a){const h=fe(a);Z.add("error",h.message)}function y(){return i.wait="Starting process",de.startProcess(e,t).then(w).then(p).catch(_).finally(()=>{i.wait=null})}function v(a={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Waiting for result...",de.runStep(e,t,u,r,a).then(w).then(p).catch(_).finally(()=>{i.wait=!1}))}return{initialize:T,state:i,currentStepConfig:o.readonly(l),next:v}}function Vt(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(!$.utils.getPropFromObject(e,r.name))return!1}return!0}const qt={class:"widget-table__head"},jt={class:"widget-table__head-label margin_0 text_overflow"},Wt=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("tr",qt,[(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",jt,o.toDisplayString(r.label),1)]))),128))]))}}),Br="",V=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},Gt=V(Wt,[["__scopeId","data-v-25198f4a"]]);function Xe(t){return typeof t.name=="string"?t.name:Array.isArray(t.name)?t.name[0]:null}function xt(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 zt(t,e){return xt(t).forEach(r=>{t.replace(new RegExp("${"+r+"}","g"),$.utils.getPropFromObject(e,r))}),t}function be(t,e){const n=Xe(t);let r=n?$.utils.getPropFromObject(e,n):null;return r===void 0&&(r=null),typeof t.value=="string"?zt(t.value,e):t.value?t.value(r,e):t.value===null?null:r}const C={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 ke(t){return[C.CORE_DEBUG_LABEL,t].join(":")}function Qe(t){return Ne(t,"YYYY/MM/DD HH:mm:ss")}function Ne(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return mt.format(n,e)}catch(n){return console.log(n),"Invalid date"}}const Mr="",Q=V({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 Ze(t){return e=>typeof e=="string"||typeof e=="number"?`${e} ${t}`:""}const Jt=we(ke("setup-list-row"));function Yt(t,e){const n=t.config.map(r=>Kt(r,t,e));return o.h("tr",{class:"widget-table__row widget-table-row"},n)}function Kt(t,e,n){const r=e.values;let i=be(t,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(p){s.onClick.push(()=>p(r))}function l(p){Array.isArray(p)?s.class.push(...p):s.class.push(p)}const c=[],f=[];if(t.unitValue&&(i=Ze(t.unitValue)(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=Ne(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Qe(typeof i=="string"?i:null);break}case"money":{i=it(i);break}case"multi-select":{f.push(o.h($.FormField,{type:"single-checkbox",modelValue:e.selected})),u(et.bind(null,n,!0));break}case"select":{f.push(o.h($.FormField,{type:"single-radio",modelValue:e.selected})),u(et.bind(null,n,!1));break}}if(t.onClick&&u(t.onClick),t.link)try{const p=t.link(r);if(p){const T=o.h($e.RouterLink,{to:p});f.push(T),l("widget-table-cell_link")}}catch(p){Jt("Can't add router link",p)}if(t.href&&(f.push(o.h("a",{href:t.href(r),target:"_blank"})),l("widget-table-cell_link")),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(Q,{name:t.icon})),typeof t.icon=="function")){const p=t.icon(r);p!==null&&f.push(o.h(Q,{name:p}))}return t.class&&(typeof t.class=="function"?l(t.class(r)):l(t.class)),c.push(o.h("td",s,f)),c}function et(t,e){t.emit("select",e)}function tt(t,e){return()=>{try{return Yt(t,e)}catch(n){return console.warn(n),null}}}const Ht={props:{values:Object,config:Object,selected:Boolean},setup:tt},Xt=["colspan"],nt=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,Xt)],512))}}),Qt={class:"widget-table"},rt="update:selectedRows",Zt=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 c;return(c=r==null?void 0:r.default)==null?void 0:c.call(r)[0]});function s(c,f=!0){if(!n.selectedRows)return;if(!f)return e(rt,n.selectedRows.includes(c)?[]:[c]);const p=[...n.selectedRows],T=p.indexOf(c);return T===-1?p.push(c):p.splice(T,1),e(rt,p)}function u(c){e("save",c),e("update:activeRow",null)}const l=o.computed(()=>n.shortcut?n.config.filter(c=>c.name?!!n.array.find(p=>![null,""].includes(be(c,p))):!0):n.config);return(c,f)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",Qt,[o.createVNode(Gt,{config:l.value},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.array,(p,T)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:T},[o.createVNode(Ht,{config:l.value,values:p,selected:c.selectedRows.includes(p),onSelect:I=>s(p,I),class:o.normalizeClass(c.classCallback?c.classCallback(p):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&c.activeRow===p?(o.openBlock(),o.createBlock(nt,{key:0,component:i.value,"row-length":c.config.length,values:p,onClose:f[0]||(f[0]=I=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),c.activeRow===o.unref(C).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(nt,{key:0,component:i.value,"row-length":l.value.length,onClose:f[1]||(f[1]=p=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),en=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))}}),Ur="",ue=V(en,[["__scopeId","data-v-0ef9ae88"]]),tn={class:"widget-button"},nn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("button",tn,[e.wait?(o.openBlock(),o.createBlock(ue,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),Vr="",rn=V(nn,[["__scopeId","data-v-450dc564"]]),on={class:"widget-multi-button-wrap position_relative cursor_pointer"},sn={class:"widget-multi-button-body grid"},an=["onClick"],cn={class:"widget-multi-button-side-wrap"},ln=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",on,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[o.createElementVNode("div",sn,[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]=c=>s())},o.toDisplayString(u.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(c,f)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:f,onClick:p=>{i(c.callback),s(!1)}},o.toDisplayString(c.label),9,an))),128))]),o.createElementVNode("div",cn,[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]=c=>s())},[n.wait?(o.openBlock(),o.createBlock(o.unref(ue),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(o.openBlock(),o.createBlock(o.unref(Q),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}}),qr="",dn=V(ln,[["__scopeId","data-v-a8d711d1"]]),un={class:"widget-loader flex flex-align_center gap_10 padding_15"},fn={class:"text_md"},pn=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",un,[o.createVNode(ue,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",fn,o.toDisplayString(e.label),1)]))}}),hn=["alt","src"],gn=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,hn))}}),mn={props:{config:Array,values:Object,selected:Boolean},setup:tt},jr="",yn=V(mn,[["__scopeId","data-v-344a8cc1"]]),En=t=>(o.pushScopeId("data-v-bf495d6a"),t=t(),o.popScopeId(),t),wn={class:"widget-list-head-cell"},Cn=En(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),_n=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",wn,[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($.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(Q),{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),Cn])]))}}),Wr="",Tn=V(_n,[["__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 c(w,_){let y=-1;do y++,_-=w[y];while(_>0&&y<w.length);return y}function f(w,_){let y=0;for(;_>0&&_>w[y]&&y<w.length;)_-=w[y],y++;return console.log(_,y),y>0?y:0}function p(w){try{i.value.style.insetInlineStart=w+"px"}catch(_){console.log(_)}}function T(w){try{i.value.style.width=w+"px",i.value.style.minWidth=w+"px",i.value.style.maxWidth=w+"px"}catch(_){console.log(_)}}function I(w){return w===null?!1:w.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(_){var pt;function y(R){return R.screenX+h-b}const v=r.value,a=[...v.children].filter(R=>R.localName==="th"),h=((pt=v.offsetParent)==null?void 0:pt.scrollLeft)||0,g=a.map(R=>R.clientWidth),S=I(_.target),b=v.getBoundingClientRect().left,Y=y(_),N=c(g,Y),x=g.slice(0,N).reduce((R,F)=>R+F,0),te=Y-x,Re=v.offsetWidth,ne=a[N].clientWidth;if(n.config[N].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",_.screenX),console.log("Widths",g),console.log("max width",Re),console.log("Start Position",Y),console.log("Position From",N),console.log("Start Position",N),console.log("Global offset (Отступ самой таблицы от края экрана)",b),console.log("Del",te),console.groupEnd(),i.value.innerText=a[N].textContent||"",i.value.style.display="grid",i.value.style.width=ne+"px",i.value.style.cursor="grabbing",p(x),T(ne),document.addEventListener("pointermove",ft,{passive:!0}),document.addEventListener("pointerup",ut);function ut(R){if(console.group("END"),document.removeEventListener("pointermove",ft),document.removeEventListener("pointerup",ut),S&&(n.config[N].width=i.value.style.width,n.config[N].minWidth=i.value.style.width,n.config[N].maxWidth=i.value.style.width,s(n.config)),!S){const F=R.screenX+h-b;console.log("ENP Position",F);const ye=f(g,F);if(console.log(N,"->",ye),ye!==N){const re=n.config[N],Le=n.config;Le.splice(N,1),Le.splice(ye,0,re),s(Le)}else{const re=n.config[N].name;u(re)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function ft(R){if(S){const re=y(R)-Y+ne;T(re);return}let F=R.screenX+h-b-te;F<0&&(F=0),F+ne>Re&&(F=Re-ne),p(F)}})});function s(c){e("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(n.order.length===0||n.order[0]!==c)return void l([c]);const f=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([c,f==="asc"?"desc":"asc"])}function l(c){e("update:order",c)}return(c,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(c.config,(p,T)=>(o.openBlock(),o.createBlock(Tn,o.mergeProps({key:p},p,{onOrder:I=>u(p.name),onSelect:f[0]||(f[0]=I=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),Gr="",An=V(Sn,[["__scopeId","data-v-ccffc6bd"]]),bn={class:"widget-list"},kn={class:"widget-list-body position_relative"},Nn=50,In=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,c=!0){if(n.selectedRows)if(!c)s(n.selectedRows.includes(l)?[]:[l]);else{const f=[...n.selectedRows],p=f.indexOf(l);p===-1?f.push(l):f==null||f.splice(p,1),s(f)}}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 c=l.target;c.scrollTop+c.clientHeight+Nn>c.scrollHeight&&e("scrollEnd")}return(l,c)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[o.createElementVNode("table",bn,[o.createElementVNode("thead",null,[o.createVNode(An,{onSelect:c[0]||(c[0]=f=>i()),"onUpdate:order":c[1]||(c[1]=f=>e("update:order",f)),"onUpdate:config":c[2]||(c[2]=f=>e("update:config",f)),config:l.config,order:l.order},null,8,["config","order"])]),o.createElementVNode("tbody",kn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.array,(f,p)=>{var T;return o.openBlock(),o.createBlock(yn,{key:p,class:"widget-list-row",values:f,config:l.config,selected:(T=l.selectedRows)==null?void 0:T.includes(f),onSelect:I=>r(f,I)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),B={};function On(t){for(let e in t)B[e]=t[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function vn(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 fe(t){return typeof t=="string"?Ie(t):Rn(t)?Ie(t.message,t.children):Ie(C.DEFAULT_ERROR_MESSAGE)}function Rn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"message"))}function Ie(t,e=[]){return{message:t,children:e}}function P(t="error"){return function(e){const{message:n,children:r}=fe(e);Z.add(t,n,{children:r})}}function pe(t,e={}){return A().emit("entity:read",{...e,entity:t})}function Oe(t,e){return A().emit("entity:update",{...e,entity:t})}function Ln(t){return t.reduce((e,n)=>(n.name&&(typeof n.name=="string"?e.push(n.name):e.push(...n.name)),e),[])}function it(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 $n(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 Pn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function Dn(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return C.DEFAULT_ERROR_MESSAGE}})}function D(t,e={}){return O.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=O.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw new Error(C.DEFAULT_ERROR_MESSAGE)}).then(n=>Dn(n).then(r=>{if(!n.ok)throw r;return r}))}function Bn(t,e=1e3){let n=0;return(...r)=>{clearTimeout(n),n=setTimeout(()=>t(...r),e)}}function Mn(t,e){let n=!1;return(...r)=>{if(!n)return n=!0,setTimeout(()=>n=!1,e),t(...r)}}const Fn=we(ke("pretty-value-field-by-entity"));function Un(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 Fn('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,t,e,n),n}}const Vn=1,qn=5e3,G=we(ke("use-socket"));function A(){return Wn}function jn(t){return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Blob]"}const Wn=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()},qn*2);const a=new Uint8Array(1);a[0]=Vn,e.send(a)}setInterval(()=>{Array.from(r).forEach(a=>{v(a)&&(G("Handler for event %s requestId %d was expired",a.event,a.requestId),a.requestId?c({requestId:a.requestId,event:"request-error",data:{message:q.RequestTookToLong().message}}):r.delete(a))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&f()},C.DELAY_SOCKET_RECONNECT);function l(){return{safeQueue:s,requestId:t,handlers:r,socketInstance:e}}function c(a){const h=[...r.values()];G("Handlers array length is %d. Response event: %s. Request id: %d",r.size,a.event,a.requestId),h.forEach(g=>{const S=a.requestId;(g.requestId&&g.requestId===S||!g.requestId&&g.event===a.event)&&(G("Find appropriated handler: %d, event: %s",t,g.event),g.callback(a.data,a),g.once&&(r.delete(g),G("Handler was removed by *once* params was passed. %o",g)))})}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(a){G("Connection to server was stopped: %d %s",a.code,a.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(a=>{p(a),s.delete(a)})},e.onerror=function(a){console.warn(a)},e.onmessage=a=>{var h;try{if(jn(a.data)){u();return}const g=JSON.parse(a.data);if(!ot(g)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(g);return}(h=g==null?void 0:g.data)!=null&&h.refresh&&location.reload(),c(g)}catch(g){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(g)}}}function p(a){e.send(a)}function T(a,h){y({event:a,callback:h})}function I(a,h){y({event:a,callback:h,once:!0})}function w(){return e&&(e==null?void 0:e.readyState)===1}function _(a,h,g){const S=++t,b=JSON.stringify({requestId:S,event:a,data:h,contextId:O.contextId,url:window.location.href});return w()?p(b):(s.add(b),G("Socket is not connected. Message was send to save-queue")),new Promise((Y,N)=>{y({event:a,requestId:S,once:!0,guaranteedAnswer:!0,serializeString:b,callback:(x,te)=>{if(G("Promise was resolve with next data:",x),Gn(te))return void N(x);g&&g(x,te),Y(x)},timeToLive:C.TIME_TO_LIVE_SOCKET_REQUEST})})}function y(a){const h={timeToLive:0,...a,created:new Date().getTime()};r.add(h)}function v(a){return a.timeToLive===0||typeof a.timeToLive!="number"?!1:new Date().getTime()-a.created>a.timeToLive}return{get socket(){return e},on:T,once:I,emit:_,initialization(a){n=a},getDevInfo:l}}(),Gn=t=>!!ot(t)&&t.event==="request-error",ot=t=>typeof t=="object"&&t!==null&&"event"in t&&typeof t.event=="string"&&"requestId"in t&&typeof t.requestId=="number"&&"data"in t;function xn(t,e){return A().emit("list-setting:read",{entity:t,mark:e})}function zn(t,e){return A().emit("metadata-field:treat",{entity:t,fieldName:e})}function st(t,e){return A().emit("entity:create",{...e,entity:t})}function at(t,e){return A().emit("entity:delete",{...e,entity:t})}function Jn(t,e){return A().emit("usage-context:read",{...e,entity:t})}function ct(t={}){return A().emit("tool:read",t)}function Yn(t,e={},n={}){const r=o.inject(C.PROVIDE_NAME_ACTIONS,null),i=typeof t=="string"?t:e,s=typeof e=="string"?n:e;return o.computed(()=>{var c;const l=((typeof t=="string"?(c=r==null?void 0:r.actions)==null?void 0:c.value:o.unref(t))||[]).find(f=>f.name===i);return l?{...l,...s}:null})}function Kn(t){return A().emit("history:read",t)}function Hn(t,e){return A().emit("entity:count",{...e,entity:t})}function Xn(){const t=o.ref(null);function e(n){t.value=n}return{activeRow:t,activateRow:e}}function Qn(t,e,n={}){const r=o.reactive([]);let i=0;const s=o.ref(!1);function u(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function l(){if(s.value)return Promise.reject("The process has already started.");const a=y();return s.value=!0,typeof a.limit!="number"&&(a.limit=100),a.offset=i,(n.request||pe)(t,a).then(g=>(i+=g.length,g)).finally(()=>{s.value=!1})}function c(a,h){var S;return typeof a.Version=="number"?a.Version:(S=r.find(b=>b.Id===h))==null?void 0:S.Version}function f(a,h){const g=r.findIndex(S=>S.Id===a);if(g===-1)throw new Error(`Can't found item with Id ${a}`);r.splice(g,1,h)}function p(a){const h=r.findIndex(g=>g.Id===a);if(h===-1)throw new Error(`Can't found item with Id ${a}`);r.splice(h,1)}async function T(a,h){try{const g=y(),S=c(h,a);delete h.Version,await Oe(t,{id:a,values:h,version:S,masterEntities:u()});const b=await pe(t,{fields:g.fields||"",id:a});f(a,b)}catch(g){P()(g)}}async function I(a,h={}){try{const g=y(),S=c(h,a);delete h.Version,await at(t,{id:a,version:S,masterEntities:u()}),p(a)}catch(g){P()(g)}}async function w(a){try{await st(t,{values:a,masterEntities:u()}),await v()}catch(h){P()(h)}}async function _(){try{const a=await l();r.push(...a)}catch(a){P()(a)}}function y(){return typeof e=="function"?e():e}async function v(){try{i=0;const a=await l();r.splice(0,r.length,...a)}catch(a){P()(a)}}return{array:r,updateById:T,next:_,reload:v,wait:s,create:w,deleteById:I}}function Zn(){function t(){return{organizations:O.organizations,currentContextId:O.contextId,person:O.person,context:O.context,contextType:O.contextType,userId:O.userId}}const e=o.reactive(t());return O.onupdateContext(()=>{Object.assign(e,t())}),e}function er(t,e,n){return A().emit("communication:create",{entityName:t,entityCatalogId:e,targetCode:n})}function tr(t,e,n){return A().emit("communication:read",{entityName:t,entityCatalogId:e,targetCode:n})}function nr(t,e){return A().emit("communication-message:create",{communicationId:t,text:e})}function rr(t){return A().emit("communication-message:read",{communicationId:t})}function ir(t){const e=$.Form.getParentForm(),n=o.reactive([]);return e&&e.subscribe(t),t.read=()=>rr(t.id).then(r=>(n.splice(0,n.length,...r),r)),{array:n}}function or(t,e){t.read=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw q.EntityWithoutName(t);return pe(t.name,r)}).then(ve).then(i=>(i.hasOwnProperty("Version")&&(t.version=i.Version),t.setValues(i),i)).catch(P())},t.save=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw q.EntityWithoutName(t);return Oe(t.name,{id:r.id,values:t.changes,version:t.version})}).then(i=>{t.version=i.version}).catch(i=>{throw P()(i),i})};function n(){return typeof e=="function"?e():e}}function sr(t){if(!t)return o.inject(C.PROVIDE_NAME_METADATA);me.initEntity(t);const e=o.computed(()=>me.state[t]);return o.provide(C.PROVIDE_NAME_METADATA,e),e}function ar(t,e={}){if(!t)return o.inject(C.PROVIDE_NAME_USAGE_CONTEXT);const n=o.ref(null);return o.provide(C.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await Jn(t,cr(e||{}))}}}function cr(t){return typeof t=="function"?t():t}function lr(t){if(!t)return o.inject(C.PROVIDE_NAME_ACTIONS);const e=o.reactive([]),n=o.computed(()=>e.map(s=>dr(t,s))),r={actions:n,update:i};o.provide(C.PROVIDE_NAME_ACTIONS,r),t.router=$e.useRouter(),t.handleConfirmation||(t.handleConfirmation=fr),t.handleAffectedEntity||(t.handleAffectedEntity=hr),t.handleCloseForm||(t.handleCloseForm=gr),t.handleValidationResult||(t.handleValidationResult=pr);function i(s={}){return e.splice(0,e.length),ct(s).then(u=>e.splice(0,0,...u)).catch(P("error"))}return{actions:n,update:i}}function dr(t,e){return{...e,label:e.title,callback(){const n=typeof t.values=="function"?t.values(e,t):t.values,r=()=>D(e.url,{method:"POST",body:JSON.stringify({keys:n,contextId:O.contextId}),headers:{"Content-Type":"application/json"}}).then(async i=>{var s,u;if(!mr(i))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(t.handlers))for await(const l of t.handlers)await l(e,i,t);if(!i.success)throw t.handleValidationResult&&i.validationEffect&&((u=(s=i.validationEffect)==null?void 0:s.results)!=null&&u.length)&&t.handleValidationResult(e,i.validationEffect,t),new Error(i.message);return i.message&&Z.add("info",i.message),Array.isArray(i.affectedEntities)&&t.handleAffectedEntity&&i.affectedEntities.forEach(l=>{var c;return(c=t.handleAffectedEntity)==null?void 0:c.call(t,e,l,t)}),e.closeHostForm&&t.handleCloseForm&&t.handleCloseForm(e,t),i}).catch(P("error"));return e.requireSave&&t.form&&t.form.changed?t.form.save().then(r):!e.confirmation||!t.handleConfirmation?r():t.handleConfirmation(e,r)}}}function ur(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 fr(t,e){const n=ur(t.confirmation);if(!oe.getComponentFromStore(C.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await oe.promptModal(C.MODAL_CONFIRM,{message:n}))return e()}function pr(t,e){const n=C.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 hr(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 gr(t,e){const{router:n}=e;n&&t.closeHostForm&&n.back()}function mr(t){return!!(t&&typeof t=="object"&&"affectedEntities"in t&&"success"in t)}function yr(t){function e(n){n.key==="Enter"&&t()}o.onMounted(()=>{document.addEventListener("keypress",e)}),o.onUnmounted(()=>{document.removeEventListener("keypress",e)})}function Er(t){const e=o.reactive([]),n=l=>{const c=o.unref(t);if(l===void 0){e.length===0?c.forEach(i):c.forEach(s);return}r(l)?s(l):i(l)},r=l=>e.includes(l),i=l=>{r(l)||e.push(l)},s=l=>{const c=e.findIndex(f=>f===l);c!==-1&&e.splice(c,1)},u=o.computed(()=>{const l=o.unref(t);return e.length===l.length&&l.length!==0});return[e,n,u,i,s]}function wr(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 Z=new class{constructor(){this.store=o.reactive([])}add(e,n,r={}){const i=Cr(r),s=new _r(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 Cr(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 lt=class gt{constructor(e,n,r,i,s){this.type=e,this.message=n,this.timeout=r,this.children=i,this.click=s,this.id=gt.cardId++}};lt.cardId=1;let _r=lt;class Tr extends U{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return nr(this.id,e)}static checkAndGenerate(e,n,r){return tr(e,n,r).then(i=>i.length===0?er(e,n,r):i[0])}}function Sr(){return A().emit("client:read",{})}var dt=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Ar=(t,e,n)=>(dt(t,e,"read from private field"),n?n.call(t):e.get(t)),br=(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)},kr=(t,e,n,r)=>(dt(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),he;const ge=class K extends U{constructor(){super(...arguments),this.type="front",this.organizations=[],br(this,he,!1)}set language(e){localStorage.setItem(C.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(C.LOCALSTORAGE_LANGUAGE_KEY)||K.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){kr(this,he,e),this.emit(K.EVENT_READY_UPDATE,e)}get ready(){return Ar(this,he)}onReady(e){return this.on(K.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(K.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(C.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(K.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){P()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(C.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 Sr()}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}}};he=new WeakMap,ge.DEFAULT_LANGUAGE="en",ge.EVENT_CONTEXT_UPDATE="event:context-update",ge.EVENT_READY_UPDATE="event:ready-update";let Nr=ge;function Ir(t){return A().emit("metadata:read",{entity:t})}const me=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 c=await s(l);u(l,c)}function s(l){const c=Ir(l).finally(()=>{n.delete(l)});return n.set(l,c),c}function u(l,c){e[l]=c}return{state:e,initEntity:i,get:r}}();class M{static login(e){return D(B.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:B.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 M.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return M.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return M.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return M.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,n){return D(`${B.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(e){return M.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return M.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return M.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,n){return D(`${B.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(M.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 D(`${B.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 D(`${B.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 D(`${B.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 D(`${B.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 Or{static readHistoryById(e,n){return D(`/close-api/audits/history/${e}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class vr{static readLicences(e){const n=`/close-api/proxy/Dashboard/Licenses?organizationId=${e.toString()}`;return D(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)})}}function Rr(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(Rr(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 ee(t){return typeof t=="string"?`'${t}'`:`${t}`}k.includes=function(e,n){return`@${e} Contains ${ee(n)}`},k.beginWith=function(e,n){return`@${e} BeginWith ${ee(n)}`},k.notEq=function(e,n){return`@${e} nq ${ee(n)}`},k.eq=function(e,n){return Array.isArray(n)?k.in(e,n):`@${e} eq ${ee(n)}`},k.in=function(e,n){const r=n.map(ee).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 ve(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=ve(r)),e[i]=r,e},{})}const O=new Nr,Lr={staticLink:Pt},$r={utils:bt};d.Communication=Tr,d.CoreError=q,d.Filter=k,d.Manager=O,d.MetadataStore=me,d.NotificationSystem=Z,d.WidgetButton=rn,d.WidgetIcon=Q,d.WidgetImage=gn,d.WidgetList=In,d.WidgetLoader=pn,d.WidgetMultiButton=dn,d.WidgetSpinner=ue,d.WidgetTable=Zt,d.asyncProcess=vn,d.authService=M,d.billingService=J,d.catchUniversal=P,d.clientService=Me,d.communicationService=vt,d.config=On,d.configuration=B,d.constants=C,d.dashboardService=vr,d.dataService=X,d.debounce=Bn,d.default=$r,d.documentsService=Dt,d.fileService=Rt,d.getCellName=Xe,d.getCellValue=be,d.getNamesFromListConfig=Ln,d.getUnitValue=Ze,d.groupArrayByField=$n,d.historyService=Or,d.injectAction=Yn,d.internationalizationService=kt,d.invitationService=Lt,d.openService=$t,d.parseError=fe,d.prettyDate=Ne,d.prettyDateWithTime=Qe,d.prettyMoney=it,d.prettyValueFieldByEntity=Un,d.processWizardService=de,d.request=D,d.ruleValidationService=Ae,d.t=z,d.throttle=Mn,d.universalEntityCount=Hn,d.universalEntityCreate=st,d.universalEntityDelete=at,d.universalEntityRead=pe,d.universalEntityUpdate=Oe,d.universalHistoryRead=Kn,d.universalListSettingRead=xn,d.universalMetadataFieldTreat=zn,d.universalToolRead=ct,d.useActions=lr,d.useCommunication=ir,d.useEnter=yr,d.useFormEntity=or,d.useListActiveRow=Xn,d.useListEntity=Qn,d.useListSearch=wr,d.useListSelect=Er,d.useManagerState=Zn,d.useMetadata=sr,d.useSocket=A,d.useUsageContext=ar,d.useWizard=Ut,d.utils=Lr,d.uuidv4=Pn,d.valuesToUpperCase=ve,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
10
+ */const Ue=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},Ve=function(t,e){t in this.events&&this.events[t].forEach(n=>n(e))},qe=function(t,e){const n=this.events[t];if(!n)return;const r=n.indexOf(e);r!==-1&&n.splice(r,1)},je=function(){this.events={}};class U{constructor(){this.events={}}on(e,n){return Ue.call(this,e,n)}emit(e,n){return Ve.call(this,e,n)}off(e,n){return qe.call(this,e,n)}cleanEvents(){je.call(this)}static on(e,n){return Ue.call(U,e,n)}static emit(e,n){return Ve.call(U,e,n)}static off(e,n){return qe.call(U,e,n)}static cleanEvents(){je.call(U)}}U.events={};var We=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},se=(t,e,n)=>(We(t,e,"read from private field"),n?n.call(t):e.get(t)),_e=(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)=>(We(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),H,ae,ce;const j=class L extends U{constructor(){super(...arguments),_e(this,H,void 0),_e(this,ae,"front"),this.organizations=[],_e(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){Te(this,H,e)}get router(){if(!se(this,H))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return se(this,H)}set type(e){Te(this,ae,e)}get type(){return se(this,ae)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Te(this,ce,e),this.emit(L.EVENT_READY_UPDATE,e)}get ready(){return se(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{Et.add("error",q.ApiNotAvailable().message)}}loadCustomerData(){return Me.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))}};H=new WeakMap,ae=new WeakMap,ce=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 Ct=j;const Ge=new Ct;function _t(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return yt}})}function m(t,e={}){return Ge.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=Ge.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw q.ApiNotAvailable()}).then(n=>_t(n).then(r=>{if(!n.ok)throw r;return r}))}class le{constructor(){}static parseNamesFromListConfig(e){let n=le.parseFieldsToGraphQL(e.reduce((i,s)=>(s.name&&i.push(s.name),i),[]));function r(i){let s="";for(let u in i)typeof i[u]=="boolean"?s+=` ${u} `:s+=` ${u} { ${r(i[u])} }`;return s}return r(n)}static parseSortFromListConfig(e){let n={};for(let r in e)n[r]=e[r]?"ASC":"DESC";return n}static parseFieldsToGraphQL(e){function n(r,i){if(i.includes(".")){const s=i.indexOf("."),u=i.substring(s+1),l=i.substring(0,s);l in r||(r[l]={}),n(r[l],u)}else r[i]=!0;return r}return e.reduce(n,{})}}class Tt{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")}}const St=new Tt;function xe(t){return t&&t[0].toLowerCase()+t.slice(1)}function Se(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=Se(r)),e[i]=r,e},{})}function At(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(".")}const bt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:le,Journal:St,Request:m,clickOutside:Pe,default:{Request:m,clickOutside:Pe,getPropFromObject:Ce,runPromiseQueue:De,GraphQL:le,firstChapterToLowerCase:xe,valuesToUpperCase:Se,prettyMoney:At},firstChapterToLowerCase:xe,getPropFromObject:Ce,runPromiseQueue:De,valuesToUpperCase:Se},Symbol.toStringTag,{value:"Module"}));class kt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return m(`/open-api/internationalization/language/${e}`)}}let W={};function z(t,...e){if(typeof t!="string")return console.trace(`Label is not provided for translation: ${t}`),"undefined";let n=$.utils.getPropFromObject((this==null?void 0:this.vocabulary)||W,t);if(typeof n=="string")return ze(n,e);const r=$.utils.getPropFromObject(W==null?void 0:W.root,t);return typeof r=="string"?ze(r,e):(typeof n===void 0&&console.warn(`Translation for label "${t}" is not founded.`),t)}function ze(t,e){return e.forEach((n,r)=>{t=t.replaceAll(new RegExp(`\\{${r}}`,"g"),n)}),t}z.setGlobalVocabulary=function(t){W=t},z.getScope=function(t){const e=typeof t=="string"?t:"root";return typeof t!="string"&&console.warn(`SCOPE ${t} for translate is not string.`),z.bind({vocabulary:$.utils.getPropFromObject(W,e.toLowerCase())})},z.setVocabulary=function(t){return typeof t=="string"&&(t=$.utils.getPropFromObject(W,t)),z.bind({vocabulary:t})};function Nt(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&typeof t[1]=="number"}const It="masterId",Ot="masterEntity";function Je(t,e){if(!Array.isArray(e))return;if(Nt(e))return n(e);e.forEach(n);function n(r){t.append(Ot,r[0]),t.append(It,r[1].toString())}}class X{static async anonymousGetList(e){return await m(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const n=(i,s)=>r.append(i,s),r=new URLSearchParams;if(e.fields){const i=e.fields;typeof i=="string"?n("fields",i):Array.isArray(i)?n("fields",i.join(" ")):typeof i=="object"&&n("fields",Object.keys(i).join(" "))}if(e.order){let i=e.order;const u=(Array.isArray(i)?[i]:Object.entries(i)).map(([l,c="desc"])=>`@${l} ${c}`).join(",");n("order",u)}return e.limit&&n("limit",e.limit.toString()),e.offset&&n("offset",e.offset.toString()),e.filter&&n("filter",e.filter.toString()),e.useUsageContext&&r.append("useUsageContext",e.useUsageContext.toString()),r}static async getList(e,n){const r=X.getSearchParamsForEntityListRead(n||{});return await m(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,n){const r=X.getSearchParamsForEntityListRead(n||{});return m(`/close-api/data/entities/${e}/count?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,n,r){const i=new URLSearchParams;return Je(i,r==null?void 0:r.masterEntities),m(`/close-api/data/${e}?${i.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:n})})}static update(e,n,r,i={}){return m(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static readById(e,n,r={}){const i=new URLSearchParams;if(r.fields){let s=r.fields;typeof s=="string"&&(s=[s]),i.append("fields",s.join(" "))}return m(`/close-api/data/entities/${e}/id/${n}?${i.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,n,r,i){const s=new URLSearchParams;return Je(s,i==null?void 0:i.masterEntities),m(`/close-api/data/entities/${e}/id/${n}?${s.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r,version:i==null?void 0:i.version})})}static removeById(e,n,r){const i=typeof n=="number"?{Id:n}:n;return X.removeByKeys(e,i,r)}static removeByKeys(e,n,r){return m(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:n,version:r})})}}const Ye=class ie{static async create(e){return m(ie.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const n=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return m(ie.url+"?"+n.toString(),{method:"get"})}static async readMessages(e){return m(`${ie.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return m(`${ie.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};Ye.url="/close-api/communications";let vt=Ye;function Ke(t){return{...t,createdEntities:t.createdEntites}}const He=class Ee{static async getStartConfig(e,n){return m([Ee.url,e,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,n){return m([Ee.url,e,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(Ke)}static async runStep(e,n,r,i,s){return m([Ee.url,e,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(Ke)}};He.url="/close-api/views/process-wizard";let de=He;class Rt{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 Lt{static invite(e,n,r){return m("/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 m("/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 m("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:n,mark:!1})})}}class Ae{static get url(){return"/close-api/rules-validation/"}static validate(e,n){return m(Ae.url+e,{method:"POST",body:JSON.stringify(n)})}}class $t{static getConfiguration(){return m("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}function Pt(t,e="images"){return`/static-folder/${e}/${t}`}class Dt{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 J{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${J.url()}/calculator/${e}`)}static calculate(e,n){return m(`/${J.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]):q.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 m(`/${J.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:n})})}static applyOnlinePayment(e){return m(`/${J.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}function Bt(t){return t.statusName==="Completed"}function Mt(t){return t.statusName==="FinalStepWithConfirmation"}function Ft(t){return t.statusName==="ValidationError"}function Ut(t,e,n){let r=null;const i=o.reactive({wait:null});let s=[],u=null;const l=o.ref(null);function c(){l.value=s.find(a=>a.name===u)||null}function f(){var a;return u?((a=s.find(h=>h.name===u))==null?void 0:a.fields)||[]:[]}function p(a){if(c(),Ft(a))return void n.onValidation(a.validationResults);if((a.statusName==="FinalStep"||a.statusName==="NextStep")&&(!f().length||Vt(f(),n.presets)))return v(n.presets||{});Bt(a)&&n.onCompleted(a),Mt(a)&&n.onConfirmation(a)}async function T(){try{await I(),await y()}catch(a){const{message:h}=fe(a);Z.add("error",h)}}function I(){return i.wait="Loading process information.",de.getStartConfig(e,t).then(a=>{s=a.steps.map(h=>({label:h.title,name:h.stepName,number:h.number,fields:h.frontendEntity.objectTypes.reduce((g,S)=>(S.properties.forEach(b=>{g.push({name:b.name,label:b.title,type:b.refEntityName||b.dataType})}),g),[])}))}).then(a=>(i.wait=!1,a))}function w(a){return u=a.nextStepName,r=a.token,a}function _(a){const h=fe(a);Z.add("error",h.message)}function y(){return i.wait="Starting process",de.startProcess(e,t).then(w).then(p).catch(_).finally(()=>{i.wait=null})}function v(a={}){return!r||!u?Promise.reject("Not step or token."):(i.wait="Waiting for result...",de.runStep(e,t,u,r,a).then(w).then(p).catch(_).finally(()=>{i.wait=!1}))}return{initialize:T,state:i,currentStepConfig:o.readonly(l),next:v}}function Vt(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(!$.utils.getPropFromObject(e,r.name))return!1}return!0}const qt={class:"widget-table__head"},jt={class:"widget-table__head-label margin_0 text_overflow"},Wt=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("tr",qt,[(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",jt,o.toDisplayString(r.label),1)]))),128))]))}}),Br="",V=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},Gt=V(Wt,[["__scopeId","data-v-25198f4a"]]);function Xe(t){return typeof t.name=="string"?t.name:Array.isArray(t.name)?t.name[0]:null}function xt(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 zt(t,e){return xt(t).forEach(r=>{t.replace(new RegExp("\\$\\{"+r+"}","g"),$.utils.getPropFromObject(e,r))}),t}function be(t,e){if(typeof t.value=="string")return zt(t.value,e);const n=Xe(t);let r=n?$.utils.getPropFromObject(e,n):null;return r===void 0&&(r=null),t.value?t.value(r,e):t.value===null?null:r}const C={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 ke(t){return[C.CORE_DEBUG_LABEL,t].join(":")}function Qe(t){return Ne(t,"YYYY/MM/DD HH:mm:ss")}function Ne(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return mt.format(n,e)}catch(n){return console.log(n),"Invalid date"}}const Mr="",Q=V({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 Ze(t){return e=>typeof e=="string"||typeof e=="number"?`${e} ${t}`:""}const Jt=we(ke("setup-list-row"));function Yt(t,e){const n=t.config.map(r=>Kt(r,t,e));return o.h("tr",{class:"widget-table__row widget-table-row"},n)}function Kt(t,e,n){const r=e.values;let i=be(t,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(p){s.onClick.push(()=>p(r))}function l(p){Array.isArray(p)?s.class.push(...p):s.class.push(p)}const c=[],f=[];if(t.unitValue&&(i=Ze(t.unitValue)(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=Ne(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Qe(typeof i=="string"?i:null);break}case"money":{i=it(i);break}case"multi-select":{f.push(o.h($.FormField,{type:"single-checkbox",modelValue:e.selected})),u(et.bind(null,n,!0));break}case"select":{f.push(o.h($.FormField,{type:"single-radio",modelValue:e.selected})),u(et.bind(null,n,!1));break}}if(t.onClick&&u(t.onClick),t.link)try{const p=t.link(r);if(p){const T=o.h($e.RouterLink,{to:p});f.push(T),l("widget-table-cell_link")}}catch(p){Jt("Can't add router link",p)}if(t.href&&(f.push(o.h("a",{href:t.href(r),target:"_blank"})),l("widget-table-cell_link")),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(Q,{name:t.icon})),typeof t.icon=="function")){const p=t.icon(r);p!==null&&f.push(o.h(Q,{name:p}))}return t.class&&(typeof t.class=="function"?l(t.class(r)):l(t.class)),c.push(o.h("td",s,f)),c}function et(t,e){t.emit("select",e)}function tt(t,e){return()=>{try{return Yt(t,e)}catch(n){return console.warn(n),null}}}const Ht={props:{values:Object,config:Object,selected:Boolean},setup:tt},Xt=["colspan"],nt=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,Xt)],512))}}),Qt={class:"widget-table"},rt="update:selectedRows",Zt=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 c;return(c=r==null?void 0:r.default)==null?void 0:c.call(r)[0]});function s(c,f=!0){if(!n.selectedRows)return;if(!f)return e(rt,n.selectedRows.includes(c)?[]:[c]);const p=[...n.selectedRows],T=p.indexOf(c);return T===-1?p.push(c):p.splice(T,1),e(rt,p)}function u(c){e("save",c),e("update:activeRow",null)}const l=o.computed(()=>n.shortcut?n.config.filter(c=>c.name?!!n.array.find(p=>![null,""].includes(be(c,p))):!0):n.config);return(c,f)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",Qt,[o.createVNode(Gt,{config:l.value},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.array,(p,T)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:T},[o.createVNode(Ht,{config:l.value,values:p,selected:c.selectedRows.includes(p),onSelect:I=>s(p,I),class:o.normalizeClass(c.classCallback?c.classCallback(p):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&c.activeRow===p?(o.openBlock(),o.createBlock(nt,{key:0,component:i.value,"row-length":c.config.length,values:p,onClose:f[0]||(f[0]=I=>e("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),c.activeRow===o.unref(C).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(nt,{key:0,component:i.value,"row-length":l.value.length,onClose:f[1]||(f[1]=p=>e("update:activeRow",null)),onSave:u,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),en=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))}}),Ur="",ue=V(en,[["__scopeId","data-v-0ef9ae88"]]),tn={class:"widget-button"},nn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("button",tn,[e.wait?(o.openBlock(),o.createBlock(ue,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}}),Vr="",rn=V(nn,[["__scopeId","data-v-450dc564"]]),on={class:"widget-multi-button-wrap position_relative cursor_pointer"},sn={class:"widget-multi-button-body grid"},an=["onClick"],cn={class:"widget-multi-button-side-wrap"},ln=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",on,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[o.createElementVNode("div",sn,[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]=c=>s())},o.toDisplayString(u.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.array,(c,f)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:f,onClick:p=>{i(c.callback),s(!1)}},o.toDisplayString(c.label),9,an))),128))]),o.createElementVNode("div",cn,[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]=c=>s())},[n.wait?(o.openBlock(),o.createBlock(o.unref(ue),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(o.openBlock(),o.createBlock(o.unref(Q),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}}),qr="",dn=V(ln,[["__scopeId","data-v-a8d711d1"]]),un={class:"widget-loader flex flex-align_center gap_10 padding_15"},fn={class:"text_md"},pn=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",un,[o.createVNode(ue,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",fn,o.toDisplayString(e.label),1)]))}}),hn=["alt","src"],gn=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,hn))}}),mn={props:{config:Array,values:Object,selected:Boolean},setup:tt},jr="",yn=V(mn,[["__scopeId","data-v-344a8cc1"]]),En=t=>(o.pushScopeId("data-v-bf495d6a"),t=t(),o.popScopeId(),t),wn={class:"widget-list-head-cell"},Cn=En(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),_n=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",wn,[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($.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(Q),{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),Cn])]))}}),Wr="",Tn=V(_n,[["__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 c(w,_){let y=-1;do y++,_-=w[y];while(_>0&&y<w.length);return y}function f(w,_){let y=0;for(;_>0&&_>w[y]&&y<w.length;)_-=w[y],y++;return console.log(_,y),y>0?y:0}function p(w){try{i.value.style.insetInlineStart=w+"px"}catch(_){console.log(_)}}function T(w){try{i.value.style.width=w+"px",i.value.style.minWidth=w+"px",i.value.style.maxWidth=w+"px"}catch(_){console.log(_)}}function I(w){return w===null?!1:w.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(_){var pt;function y(R){return R.screenX+h-b}const v=r.value,a=[...v.children].filter(R=>R.localName==="th"),h=((pt=v.offsetParent)==null?void 0:pt.scrollLeft)||0,g=a.map(R=>R.clientWidth),S=I(_.target),b=v.getBoundingClientRect().left,Y=y(_),N=c(g,Y),x=g.slice(0,N).reduce((R,F)=>R+F,0),te=Y-x,Re=v.offsetWidth,ne=a[N].clientWidth;if(n.config[N].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",_.screenX),console.log("Widths",g),console.log("max width",Re),console.log("Start Position",Y),console.log("Position From",N),console.log("Start Position",N),console.log("Global offset (Отступ самой таблицы от края экрана)",b),console.log("Del",te),console.groupEnd(),i.value.innerText=a[N].textContent||"",i.value.style.display="grid",i.value.style.width=ne+"px",i.value.style.cursor="grabbing",p(x),T(ne),document.addEventListener("pointermove",ft,{passive:!0}),document.addEventListener("pointerup",ut);function ut(R){if(console.group("END"),document.removeEventListener("pointermove",ft),document.removeEventListener("pointerup",ut),S&&(n.config[N].width=i.value.style.width,n.config[N].minWidth=i.value.style.width,n.config[N].maxWidth=i.value.style.width,s(n.config)),!S){const F=R.screenX+h-b;console.log("ENP Position",F);const ye=f(g,F);if(console.log(N,"->",ye),ye!==N){const re=n.config[N],Le=n.config;Le.splice(N,1),Le.splice(ye,0,re),s(Le)}else{const re=n.config[N].name;u(re)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function ft(R){if(S){const re=y(R)-Y+ne;T(re);return}let F=R.screenX+h-b-te;F<0&&(F=0),F+ne>Re&&(F=Re-ne),p(F)}})});function s(c){e("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(n.order.length===0||n.order[0]!==c)return void l([c]);const f=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([c,f==="asc"?"desc":"asc"])}function l(c){e("update:order",c)}return(c,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(c.config,(p,T)=>(o.openBlock(),o.createBlock(Tn,o.mergeProps({key:p},p,{onOrder:I=>u(p.name),onSelect:f[0]||(f[0]=I=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}}),Gr="",An=V(Sn,[["__scopeId","data-v-ccffc6bd"]]),bn={class:"widget-list"},kn={class:"widget-list-body position_relative"},Nn=50,In=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,c=!0){if(n.selectedRows)if(!c)s(n.selectedRows.includes(l)?[]:[l]);else{const f=[...n.selectedRows],p=f.indexOf(l);p===-1?f.push(l):f==null||f.splice(p,1),s(f)}}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 c=l.target;c.scrollTop+c.clientHeight+Nn>c.scrollHeight&&e("scrollEnd")}return(l,c)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[o.createElementVNode("table",bn,[o.createElementVNode("thead",null,[o.createVNode(An,{onSelect:c[0]||(c[0]=f=>i()),"onUpdate:order":c[1]||(c[1]=f=>e("update:order",f)),"onUpdate:config":c[2]||(c[2]=f=>e("update:config",f)),config:l.config,order:l.order},null,8,["config","order"])]),o.createElementVNode("tbody",kn,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.array,(f,p)=>{var T;return o.openBlock(),o.createBlock(yn,{key:p,class:"widget-list-row",values:f,config:l.config,selected:(T=l.selectedRows)==null?void 0:T.includes(f),onSelect:I=>r(f,I)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),B={};function On(t){for(let e in t)B[e]=t[e];console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white")}function vn(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 fe(t){return typeof t=="string"?Ie(t):Rn(t)?Ie(t.message,t.children):Ie(C.DEFAULT_ERROR_MESSAGE)}function Rn(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"message"))}function Ie(t,e=[]){return{message:t,children:e}}function P(t="error"){return function(e){const{message:n,children:r}=fe(e);Z.add(t,n,{children:r})}}function pe(t,e={}){return A().emit("entity:read",{...e,entity:t})}function Oe(t,e){return A().emit("entity:update",{...e,entity:t})}function Ln(t){return t.reduce((e,n)=>(n.name&&(typeof n.name=="string"?e.push(n.name):e.push(...n.name)),e),[])}function it(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 $n(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 Pn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function Dn(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return C.DEFAULT_ERROR_MESSAGE}})}function D(t,e={}){return O.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=O.contextId),e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw new Error(C.DEFAULT_ERROR_MESSAGE)}).then(n=>Dn(n).then(r=>{if(!n.ok)throw r;return r}))}function Bn(t,e=1e3){let n=0;return(...r)=>{clearTimeout(n),n=setTimeout(()=>t(...r),e)}}function Mn(t,e){let n=!1;return(...r)=>{if(!n)return n=!0,setTimeout(()=>n=!1,e),t(...r)}}const Fn=we(ke("pretty-value-field-by-entity"));function Un(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 Fn('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,t,e,n),n}}const Vn=1,qn=5e3,G=we(ke("use-socket"));function A(){return Wn}function jn(t){return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Blob]"}const Wn=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()},qn*2);const a=new Uint8Array(1);a[0]=Vn,e.send(a)}setInterval(()=>{Array.from(r).forEach(a=>{v(a)&&(G("Handler for event %s requestId %d was expired",a.event,a.requestId),a.requestId?c({requestId:a.requestId,event:"request-error",data:{message:q.RequestTookToLong().message}}):r.delete(a))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&f()},C.DELAY_SOCKET_RECONNECT);function l(){return{safeQueue:s,requestId:t,handlers:r,socketInstance:e}}function c(a){const h=[...r.values()];G("Handlers array length is %d. Response event: %s. Request id: %d",r.size,a.event,a.requestId),h.forEach(g=>{const S=a.requestId;(g.requestId&&g.requestId===S||!g.requestId&&g.event===a.event)&&(G("Find appropriated handler: %d, event: %s",t,g.event),g.callback(a.data,a),g.once&&(r.delete(g),G("Handler was removed by *once* params was passed. %o",g)))})}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(a){G("Connection to server was stopped: %d %s",a.code,a.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(a=>{p(a),s.delete(a)})},e.onerror=function(a){console.warn(a)},e.onmessage=a=>{var h;try{if(jn(a.data)){u();return}const g=JSON.parse(a.data);if(!ot(g)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(g);return}(h=g==null?void 0:g.data)!=null&&h.refresh&&location.reload(),c(g)}catch(g){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(g)}}}function p(a){e.send(a)}function T(a,h){y({event:a,callback:h})}function I(a,h){y({event:a,callback:h,once:!0})}function w(){return e&&(e==null?void 0:e.readyState)===1}function _(a,h,g){const S=++t,b=JSON.stringify({requestId:S,event:a,data:h,contextId:O.contextId,url:window.location.href});return w()?p(b):(s.add(b),G("Socket is not connected. Message was send to save-queue")),new Promise((Y,N)=>{y({event:a,requestId:S,once:!0,guaranteedAnswer:!0,serializeString:b,callback:(x,te)=>{if(G("Promise was resolve with next data:",x),Gn(te))return void N(x);g&&g(x,te),Y(x)},timeToLive:C.TIME_TO_LIVE_SOCKET_REQUEST})})}function y(a){const h={timeToLive:0,...a,created:new Date().getTime()};r.add(h)}function v(a){return a.timeToLive===0||typeof a.timeToLive!="number"?!1:new Date().getTime()-a.created>a.timeToLive}return{get socket(){return e},on:T,once:I,emit:_,initialization(a){n=a},getDevInfo:l}}(),Gn=t=>!!ot(t)&&t.event==="request-error",ot=t=>typeof t=="object"&&t!==null&&"event"in t&&typeof t.event=="string"&&"requestId"in t&&typeof t.requestId=="number"&&"data"in t;function xn(t,e){return A().emit("list-setting:read",{entity:t,mark:e})}function zn(t,e){return A().emit("metadata-field:treat",{entity:t,fieldName:e})}function st(t,e){return A().emit("entity:create",{...e,entity:t})}function at(t,e){return A().emit("entity:delete",{...e,entity:t})}function Jn(t,e){return A().emit("usage-context:read",{...e,entity:t})}function ct(t={}){return A().emit("tool:read",t)}function Yn(t,e={},n={}){const r=o.inject(C.PROVIDE_NAME_ACTIONS,null),i=typeof t=="string"?t:e,s=typeof e=="string"?n:e;return o.computed(()=>{var c;const l=((typeof t=="string"?(c=r==null?void 0:r.actions)==null?void 0:c.value:o.unref(t))||[]).find(f=>f.name===i);return l?{...l,...s}:null})}function Kn(t){return A().emit("history:read",t)}function Hn(t,e){return A().emit("entity:count",{...e,entity:t})}function Xn(){const t=o.ref(null);function e(n){t.value=n}return{activeRow:t,activateRow:e}}function Qn(t,e,n={}){const r=o.reactive([]);let i=0;const s=o.ref(!1);function u(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function l(){if(s.value)return Promise.reject("The process has already started.");const a=y();return s.value=!0,typeof a.limit!="number"&&(a.limit=100),a.offset=i,(n.request||pe)(t,a).then(g=>(i+=g.length,g)).finally(()=>{s.value=!1})}function c(a,h){var S;return typeof a.Version=="number"?a.Version:(S=r.find(b=>b.Id===h))==null?void 0:S.Version}function f(a,h){const g=r.findIndex(S=>S.Id===a);if(g===-1)throw new Error(`Can't found item with Id ${a}`);r.splice(g,1,h)}function p(a){const h=r.findIndex(g=>g.Id===a);if(h===-1)throw new Error(`Can't found item with Id ${a}`);r.splice(h,1)}async function T(a,h){try{const g=y(),S=c(h,a);delete h.Version,await Oe(t,{id:a,values:h,version:S,masterEntities:u()});const b=await pe(t,{fields:g.fields||"",id:a});f(a,b)}catch(g){P()(g)}}async function I(a,h={}){try{const g=y(),S=c(h,a);delete h.Version,await at(t,{id:a,version:S,masterEntities:u()}),p(a)}catch(g){P()(g)}}async function w(a){try{await st(t,{values:a,masterEntities:u()}),await v()}catch(h){P()(h)}}async function _(){try{const a=await l();r.push(...a)}catch(a){P()(a)}}function y(){return typeof e=="function"?e():e}async function v(){try{i=0;const a=await l();r.splice(0,r.length,...a)}catch(a){P()(a)}}return{array:r,updateById:T,next:_,reload:v,wait:s,create:w,deleteById:I}}function Zn(){function t(){return{organizations:O.organizations,currentContextId:O.contextId,person:O.person,context:O.context,contextType:O.contextType,userId:O.userId}}const e=o.reactive(t());return O.onupdateContext(()=>{Object.assign(e,t())}),e}function er(t,e,n){return A().emit("communication:create",{entityName:t,entityCatalogId:e,targetCode:n})}function tr(t,e,n){return A().emit("communication:read",{entityName:t,entityCatalogId:e,targetCode:n})}function nr(t,e){return A().emit("communication-message:create",{communicationId:t,text:e})}function rr(t){return A().emit("communication-message:read",{communicationId:t})}function ir(t){const e=$.Form.getParentForm(),n=o.reactive([]);return e&&e.subscribe(t),t.read=()=>rr(t.id).then(r=>(n.splice(0,n.length,...r),r)),{array:n}}function or(t,e){t.read=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw q.EntityWithoutName(t);return pe(t.name,r)}).then(ve).then(i=>(i.hasOwnProperty("Version")&&(t.version=i.Version),t.setValues(i),i)).catch(P())},t.save=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw q.EntityWithoutName(t);return Oe(t.name,{id:r.id,values:t.changes,version:t.version})}).then(i=>{t.version=i.version}).catch(i=>{throw P()(i),i})};function n(){return typeof e=="function"?e():e}}function sr(t){if(!t)return o.inject(C.PROVIDE_NAME_METADATA);me.initEntity(t);const e=o.computed(()=>me.state[t]);return o.provide(C.PROVIDE_NAME_METADATA,e),e}function ar(t,e={}){if(!t)return o.inject(C.PROVIDE_NAME_USAGE_CONTEXT);const n=o.ref(null);return o.provide(C.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await Jn(t,cr(e||{}))}}}function cr(t){return typeof t=="function"?t():t}function lr(t){if(!t)return o.inject(C.PROVIDE_NAME_ACTIONS);const e=o.reactive([]),n=o.computed(()=>e.map(s=>dr(t,s))),r={actions:n,update:i};o.provide(C.PROVIDE_NAME_ACTIONS,r),t.router=$e.useRouter(),t.handleConfirmation||(t.handleConfirmation=fr),t.handleAffectedEntity||(t.handleAffectedEntity=hr),t.handleCloseForm||(t.handleCloseForm=gr),t.handleValidationResult||(t.handleValidationResult=pr);function i(s={}){return e.splice(0,e.length),ct(s).then(u=>e.splice(0,0,...u)).catch(P("error"))}return{actions:n,update:i}}function dr(t,e){return{...e,label:e.title,callback(){const n=typeof t.values=="function"?t.values(e,t):t.values,r=()=>D(e.url,{method:"POST",body:JSON.stringify({keys:n,contextId:O.contextId}),headers:{"Content-Type":"application/json"}}).then(async i=>{var s,u;if(!mr(i))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(t.handlers))for await(const l of t.handlers)await l(e,i,t);if(!i.success)throw t.handleValidationResult&&i.validationEffect&&((u=(s=i.validationEffect)==null?void 0:s.results)!=null&&u.length)&&t.handleValidationResult(e,i.validationEffect,t),new Error(i.message);return i.message&&Z.add("info",i.message),Array.isArray(i.affectedEntities)&&t.handleAffectedEntity&&i.affectedEntities.forEach(l=>{var c;return(c=t.handleAffectedEntity)==null?void 0:c.call(t,e,l,t)}),e.closeHostForm&&t.handleCloseForm&&t.handleCloseForm(e,t),i}).catch(P("error"));return e.requireSave&&t.form&&t.form.changed?t.form.save().then(r):!e.confirmation||!t.handleConfirmation?r():t.handleConfirmation(e,r)}}}function ur(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 fr(t,e){const n=ur(t.confirmation);if(!oe.getComponentFromStore(C.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await oe.promptModal(C.MODAL_CONFIRM,{message:n}))return e()}function pr(t,e){const n=C.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 hr(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 gr(t,e){const{router:n}=e;n&&t.closeHostForm&&n.back()}function mr(t){return!!(t&&typeof t=="object"&&"affectedEntities"in t&&"success"in t)}function yr(t){function e(n){n.key==="Enter"&&t()}o.onMounted(()=>{document.addEventListener("keypress",e)}),o.onUnmounted(()=>{document.removeEventListener("keypress",e)})}function Er(t){const e=o.reactive([]),n=l=>{const c=o.unref(t);if(l===void 0){e.length===0?c.forEach(i):c.forEach(s);return}r(l)?s(l):i(l)},r=l=>e.includes(l),i=l=>{r(l)||e.push(l)},s=l=>{const c=e.findIndex(f=>f===l);c!==-1&&e.splice(c,1)},u=o.computed(()=>{const l=o.unref(t);return e.length===l.length&&l.length!==0});return[e,n,u,i,s]}function wr(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 Z=new class{constructor(){this.store=o.reactive([])}add(e,n,r={}){const i=Cr(r),s=new _r(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 Cr(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 lt=class gt{constructor(e,n,r,i,s){this.type=e,this.message=n,this.timeout=r,this.children=i,this.click=s,this.id=gt.cardId++}};lt.cardId=1;let _r=lt;class Tr extends U{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return nr(this.id,e)}static checkAndGenerate(e,n,r){return tr(e,n,r).then(i=>i.length===0?er(e,n,r):i[0])}}function Sr(){return A().emit("client:read",{})}var dt=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Ar=(t,e,n)=>(dt(t,e,"read from private field"),n?n.call(t):e.get(t)),br=(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)},kr=(t,e,n,r)=>(dt(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),he;const ge=class K extends U{constructor(){super(...arguments),this.type="front",this.organizations=[],br(this,he,!1)}set language(e){localStorage.setItem(C.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(C.LOCALSTORAGE_LANGUAGE_KEY)||K.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){kr(this,he,e),this.emit(K.EVENT_READY_UPDATE,e)}get ready(){return Ar(this,he)}onReady(e){return this.on(K.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(K.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(C.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(K.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){P()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(C.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 Sr()}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}}};he=new WeakMap,ge.DEFAULT_LANGUAGE="en",ge.EVENT_CONTEXT_UPDATE="event:context-update",ge.EVENT_READY_UPDATE="event:ready-update";let Nr=ge;function Ir(t){return A().emit("metadata:read",{entity:t})}const me=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 c=await s(l);u(l,c)}function s(l){const c=Ir(l).finally(()=>{n.delete(l)});return n.set(l,c),c}function u(l,c){e[l]=c}return{state:e,initEntity:i,get:r}}();class M{static login(e){return D(B.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:B.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 M.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return M.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return M.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return M.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,n){return D(`${B.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(e){return M.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return M.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return M.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,n){return D(`${B.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(M.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 D(`${B.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 D(`${B.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 D(`${B.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 D(`${B.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 Or{static readHistoryById(e,n){return D(`/close-api/audits/history/${e}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class vr{static readLicences(e){const n=`/close-api/proxy/Dashboard/Licenses?organizationId=${e.toString()}`;return D(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)})}}function Rr(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(Rr(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 ee(t){return typeof t=="string"?`'${t}'`:`${t}`}k.includes=function(e,n){return`@${e} Contains ${ee(n)}`},k.beginWith=function(e,n){return`@${e} BeginWith ${ee(n)}`},k.notEq=function(e,n){return`@${e} nq ${ee(n)}`},k.eq=function(e,n){return Array.isArray(n)?k.in(e,n):`@${e} eq ${ee(n)}`},k.in=function(e,n){const r=n.map(ee).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 ve(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=ve(r)),e[i]=r,e},{})}const O=new Nr,Lr={staticLink:Pt},$r={utils:bt};d.Communication=Tr,d.CoreError=q,d.Filter=k,d.Manager=O,d.MetadataStore=me,d.NotificationSystem=Z,d.WidgetButton=rn,d.WidgetIcon=Q,d.WidgetImage=gn,d.WidgetList=In,d.WidgetLoader=pn,d.WidgetMultiButton=dn,d.WidgetSpinner=ue,d.WidgetTable=Zt,d.asyncProcess=vn,d.authService=M,d.billingService=J,d.catchUniversal=P,d.clientService=Me,d.communicationService=vt,d.config=On,d.configuration=B,d.constants=C,d.dashboardService=vr,d.dataService=X,d.debounce=Bn,d.default=$r,d.documentsService=Dt,d.fileService=Rt,d.getCellName=Xe,d.getCellValue=be,d.getNamesFromListConfig=Ln,d.getUnitValue=Ze,d.groupArrayByField=$n,d.historyService=Or,d.injectAction=Yn,d.internationalizationService=kt,d.invitationService=Lt,d.openService=$t,d.parseError=fe,d.prettyDate=Ne,d.prettyDateWithTime=Qe,d.prettyMoney=it,d.prettyValueFieldByEntity=Un,d.processWizardService=de,d.request=D,d.ruleValidationService=Ae,d.t=z,d.throttle=Mn,d.universalEntityCount=Hn,d.universalEntityCreate=st,d.universalEntityDelete=at,d.universalEntityRead=pe,d.universalEntityUpdate=Oe,d.universalHistoryRead=Kn,d.universalListSettingRead=xn,d.universalMetadataFieldTreat=zn,d.universalToolRead=ct,d.useActions=lr,d.useCommunication=ir,d.useEnter=yr,d.useFormEntity=or,d.useListActiveRow=Xn,d.useListEntity=Qn,d.useListSearch=wr,d.useListSelect=Er,d.useManagerState=Zn,d.useMetadata=sr,d.useSocket=A,d.useUsageContext=ar,d.useWizard=Ut,d.utils=Lr,d.uuidv4=Pn,d.valuesToUpperCase=ve,Object.defineProperties(d,{__esModule:{value:!0},[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.104",
3
+ "version": "1.3.105",
4
4
  "description": "Core library",
5
5
  "author": "",
6
6
  "scripts": {