eservices-core 1.3.140 → 1.3.142

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.
@@ -34,7 +34,7 @@ export interface IServerParams {
34
34
  /**
35
35
  * @description Конфигурация для подключения к RabbitMQ.
36
36
  */
37
- amqp: IAMQPOptions;
37
+ amqp?: IAMQPOptions;
38
38
  /**
39
39
  * @description Путь до файла с локальной
40
40
  */
@@ -1,11 +1,12 @@
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.140
3
+ * eservices-core v1.3.142
4
4
  * (c) 2024 ESERVICES
5
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),B=require("jenesius-vue-form"),Le=require("vue-router"),Xe=require("date-and-time"),ge=require("debug"),ae=require("jenesius-vue-modal");const Pe=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
- 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.")}};Pe.ID=0;let J=Pe;const Ze="Please try again later or submit a feedback if problem doesn't go.";function Qe(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return Ze}})}function M(t,e={}){return e.redirect="manual",fetch(t,e).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw J.ApiNotAvailable()}).then(n=>Qe(n).then(r=>{if(!n.ok)throw r;return r}))}class et{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,n,r)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[n]=r,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}new et;function be(t){return{...t,createdEntities:t.createdEntites}}const $e=class oe{static async getStartConfig(e,n){return M([oe.url,e,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,n){return M([oe.url,e,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(be)}static async runStep(e,n,r,i,a){return M([oe.url,e,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:a})}).then(be)}};$e.url="/close-api/views/process-wizard";let ie=$e;class tt{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 nt{static getRequiredDocuments(e,n,r){const i=new URLSearchParams({entity:e,primaryKey:n,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(a=>a.json())}}class H{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${H.url()}/calculator/${e}`)}static calculate(e,n){return M(`/${H.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]):J.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(`/${H.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:n})})}static applyOnlinePayment(e){return M(`/${H.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}function rt(t){return t.statusName==="Completed"}function ot(t){return t.statusName==="FinalStepWithConfirmation"}function it(t){return t.statusName==="ValidationError"}function st(t,e,n){let r=null;const i=o.reactive({wait:null});let a=[],d=null;const l=o.ref(null);function s(){l.value=a.find(c=>c.name===d)||null}function u(){var c;return d?((c=a.find(h=>h.name===d))==null?void 0:c.fields)||[]:[]}function f(c){if(s(),it(c))return void n.onValidation(c.validationResults);if((c.statusName==="FinalStep"||c.statusName==="NextStep")&&(!u().length||at(u(),n.presets)))return P(n.presets||{});rt(c)&&n.onCompleted(c),ot(c)&&n.onConfirmation(c)}async function b(){try{await R(),await v()}catch(c){const{message:h}=ce(c);Q.add("error",h)}}function R(){return i.wait="Loading process information.",ie.getStartConfig(e,t).then(c=>{a=c.steps.map(h=>({label:h.title,name:h.stepName,number:h.number,fields:h.frontendEntity.objectTypes.reduce((g,N)=>(N.properties.forEach(S=>{g.push({name:S.name,label:S.title,type:S.refEntityName||S.dataType})}),g),[])}))}).then(c=>(i.wait=!1,c))}function E(c){return["FinalStepWithConfirmation","NextStep","Completed","FinalStep"].includes(c.statusName)&&(r=c.token,d=c.nextStepName),c}function w(c){const h=ce(c);Q.add("error",h.message)}function v(){return i.wait="Starting process",ie.startProcess(e,t).then(E).then(f).catch(w).finally(()=>{i.wait=null})}function P(c={}){return!r||!d?Promise.reject("Not step or token."):(i.wait="Waiting for result...",ie.runStep(e,t,d,r,c).then(E).then(f).catch(w).finally(()=>{i.wait=!1}))}return{initialize:b,state:i,currentStepConfig:o.readonly(l),next:P}}function at(t,e){for(let n=0;n<t.length;n++){const r=t[n];if(!B.utils.getPropFromObject(e,r.name))return!1}return!0}const ct={class:"widget-table__head"},lt={class:"widget-table__head-label margin_0 text_overflow"},ut=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("tr",ct,[(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",lt,o.toDisplayString(r.label),1)]))),128))]))}});const U=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},dt=U(ut,[["__scopeId","data-v-25198f4a"]]);function Fe(t){return typeof t.name=="string"?t.name:Array.isArray(t.name)?t.name[0]:null}function ft(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 pt(t,e){return ft(t).forEach(r=>{t=t.replace(new RegExp("\\$\\{"+r+"}","g"),B.utils.getPropFromObject(e,r))}),t}function he(t){return e=>typeof e=="string"||typeof e=="number"?`${e} ${t}`:""}function me(t,e){const n=Fe(t);if(typeof t.value=="string")return pt(t.value,e);let r=n?B.utils.getPropFromObject(e,n):null;if(r===void 0&&(r=null),typeof t.value=="function")return t.value(r,e);if(t.value===null)return null;if(t.unitValue&&(r=he(t.unitValue)(r)),t.unit&&(r=he(t.unit)(r)),t.type)switch(t.type){case"number":{typeof r=="number"&&(r=new Intl.NumberFormat().format(r));break}case"date":{r=Ee(typeof r=="string"?r:null);break}case"dateTime":case"dateWithTime":{r=De(typeof r=="string"?r:null);break}case"money":{r=xe(r);break}}return t.formatter&&(r=Y(t.formatter).exec(r,e)),typeof r=="boolean"&&(r=r?"✓":"—"),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 ye(t){return[C.CORE_DEBUG_LABEL,t].join(":")}const ht={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}`})}},Z=U(ht,[["__scopeId","data-v-e287c8d9"]]),gt=ge(ye("setup-list-row"));function mt(t,e){const n=t.config.map(r=>yt(r,t,e));return o.h("tr",{class:"widget-table__row widget-table-row"},n)}function yt(t,e,n){const r=e.values;let i=me(t,r);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function d(f){a.onClick.push(()=>f(r))}function l(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const s=[],u=[];if(t.hide&&t.hide(r))return[o.h("td")];if(t.type)switch(l(`widget-table-cell_${t.type}`),t.type){case"multi-select":{u.push(o.h(B.FormField,{type:"single-checkbox",modelValue:e.selected})),d(ke.bind(null,n,!0));break}case"select":{u.push(o.h(B.FormField,{type:"single-radio",modelValue:e.selected})),d(ke.bind(null,n,!1));break}}if(t.onClick&&d(t.onClick),t.link)try{const f=t.link(r);if(f){const b=o.h(Le.RouterLink,{to:f});u.push(b),l("widget-table-cell_link")}}catch(f){gt("Can't add router link",f)}if(t.href&&(u.push(o.h("a",{href:t.href(r),target:"_blank"})),l("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&u.push(o.h("p",{class:"widget-list-cell-text"},i)),t.icon&&(typeof t.icon=="string"&&u.push(o.h(Z,{name:t.icon})),typeof t.icon=="function")){const f=t.icon(r);f!==null&&u.push(o.h(Z,{name:f}))}return t.class&&(typeof t.class=="function"?l(t.class(r)):l(t.class)),s.push(o.h("td",a,u)),s}function ke(t,e){t.emit("select",e)}function Be(t,e){return()=>{try{return mt(t,e)}catch(n){return console.warn(n),null}}}const Et={props:{values:Object,config:Object,selected:Boolean},setup:Be},vt=["colspan"],Te=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(t,{emit:e}){const n=o.ref();return o.onMounted(()=>{setTimeout(()=>{n.value&&n.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:n},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=a=>e("close")),onSave:i[1]||(i[1]=a=>e("save",a))}),null,16,["values","new"]))],8,vt)],512))}}),wt={class:"widget-table"},Se="update:selectedRows",_t=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1}},emits:["update:activeRow","save"],setup(t,{emit:e}){const n=t,r=o.useSlots(),i=o.computed(()=>{var s;return(s=r==null?void 0:r.default)==null?void 0:s.call(r)[0]});function a(s,u=!0){if(!n.selectedRows)return;if(!u)return e(Se,n.selectedRows.includes(s)?[]:[s]);const f=[...n.selectedRows],b=f.indexOf(s);return b===-1?f.push(s):f.splice(b,1),e(Se,f)}function d(s){e("save",s),e("update:activeRow",null)}const l=o.computed(()=>n.shortcut?n.config.filter(s=>s.name?!!n.array.find(f=>![null,""].includes(me(s,f))):!0):n.config);return(s,u)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",wt,[o.createVNode(dt,{config:l.value},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.array,(f,b)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:b},[o.createVNode(Et,{config:l.value,values:f,selected:s.selectedRows.includes(f),onSelect:R=>a(f,R),class:o.normalizeClass(s.classCallback?s.classCallback(f):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&s.activeRow===f?(o.openBlock(),o.createBlock(Te,{key:0,component:i.value,"row-length":s.config.length,values:f,onClose:u[0]||(u[0]=R=>e("update:activeRow",null)),onSave:d,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),s.activeRow===o.unref(C).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(Te,{key:0,component:i.value,"row-length":l.value.length,onClose:u[1]||(u[1]=f=>e("update:activeRow",null)),onSave:d,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),Ct=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}});const de=U(Ct,[["__scopeId","data-v-0ef9ae88"]]),bt={class:"widget-button"},kt=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("button",bt,[e.wait?(o.openBlock(),o.createBlock(de,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const Tt=U(kt,[["__scopeId","data-v-450dc564"]]),St={class:"widget-multi-button-wrap position_relative cursor_pointer"},At={class:"widget-multi-button-body grid"},Rt=["onClick"],Nt={class:"widget-multi-button-side-wrap"},Ot=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(t){const e=t;o.useCssVars(d=>({"7025434e":r.value}));const n=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(d){if(!(typeof d!="function"||n.wait))return n.wait=!0,Promise.resolve().then(d).finally(()=>{n.wait=!1})}function a(d=!n.active){n.active=d}return(d,l)=>(o.openBlock(),o.createElementBlock("div",St,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[o.createElementVNode("div",At,[d.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]=s=>a())},o.toDisplayString(d.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.array,(s,u)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:u,onClick:f=>{i(s.callback),a(!1)}},o.toDisplayString(s.label),9,Rt))),128))]),o.createElementVNode("div",Nt,[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]=s=>a())},[n.wait?(o.openBlock(),o.createBlock(o.unref(de),{key:0,class:"widget-multi-button-side-spinner"})):d.array.length>1?(o.openBlock(),o.createBlock(o.unref(Z),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}});const It=U(Ot,[["__scopeId","data-v-a8d711d1"]]),Lt={class:"widget-loader flex flex-align_center gap_10 padding_15"},Pt={class:"text_md"},$t=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",Lt,[o.createVNode(de,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",Pt,o.toDisplayString(e.label),1)]))}}),Ft=["alt","src"],Bt=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,Ft))}}),Dt={props:{config:Array,values:Object,selected:Boolean},setup:Be};const xt=U(Dt,[["__scopeId","data-v-344a8cc1"]]),Vt=t=>(o.pushScopeId("data-v-bf495d6a"),t=t(),o.popScopeId(),t),Mt={class:"widget-list-head-cell"},jt=Vt(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Wt=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",Mt,[o.createElementVNode("div",{class:"head-cell-content flex_grow",style:o.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(o.openBlock(),o.createBlock(o.unref(B.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(a=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=a=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(Z),{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),jt])]))}});const Ut=U(Wt,[["__scopeId","data-v-bf495d6a"]]),qt=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(t,{emit:e}){const n=t,r=o.ref(),i=o.ref();o.onMounted(()=>{function s(E,w){let v=-1;do v++,w-=E[v];while(w>0&&v<E.length);return v}function u(E,w){let v=0;for(;w>0&&w>E[v]&&v<E.length;)w-=E[v],v++;return console.log(w,v),v>0?v:0}function f(E){try{i.value.style.insetInlineStart=E+"px"}catch(w){console.log(w)}}function b(E){try{i.value.style.width=E+"px",i.value.style.minWidth=E+"px",i.value.style.maxWidth=E+"px"}catch(w){console.log(w)}}function R(E){return E===null?!1:E.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(w){var Ce;function v(L){return L.screenX+h-S}const P=r.value,c=[...P.children].filter(L=>L.localName==="th"),h=((Ce=P.offsetParent)==null?void 0:Ce.scrollLeft)||0,g=c.map(L=>L.clientWidth),N=R(w.target),S=P.getBoundingClientRect().left,j=v(w),p=s(g,j),m=g.slice(0,p).reduce((L,D)=>L+D,0),_=j-m,T=P.offsetWidth,O=c[p].clientWidth;if(n.config[p].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",w.screenX),console.log("Widths",g),console.log("max width",T),console.log("Start Position",j),console.log("Position From",p),console.log("Start Position",p),console.log("Global offset (Отступ самой таблицы от края экрана)",S),console.log("Del",_),console.groupEnd(),i.value.innerText=c[p].textContent||"",i.value.style.display="grid",i.value.style.width=O+"px",i.value.style.cursor="grabbing",f(m),b(O),document.addEventListener("pointermove",_e,{passive:!0}),document.addEventListener("pointerup",te);function te(L){if(console.group("END"),document.removeEventListener("pointermove",_e),document.removeEventListener("pointerup",te),N&&(n.config[p].width=i.value.style.width,n.config[p].minWidth=i.value.style.width,n.config[p].maxWidth=i.value.style.width,a(n.config)),!N){const D=L.screenX+h-S;console.log("ENP Position",D);const ne=u(g,D);if(console.log(p,"->",ne),ne!==p){const X=n.config[p],pe=n.config;pe.splice(p,1),pe.splice(ne,0,X),a(pe)}else{const X=n.config[p].name;d(X)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function _e(L){if(N){const X=v(L)-j+O;b(X);return}let D=L.screenX+h-S-_;D<0&&(D=0),D+O>T&&(D=T-O),f(D)}})});function a(s){e("update:config",s)}function d(s){if(!s)return;if(Array.isArray(s)){if(s.length<1)return;s=s[0]}if(n.order.length===0||n.order[0]!==s)return void l([s]);const u=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([s,u==="asc"?"desc":"asc"])}function l(s){e("update:order",s)}return(s,u)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.config,(f,b)=>(o.openBlock(),o.createBlock(Ut,o.mergeProps({key:f},f,{onOrder:R=>d(f.name),onSelect:u[0]||(u[0]=R=>e("select")),order:s.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}});const zt=U(qt,[["__scopeId","data-v-ccffc6bd"]]),Gt={class:"widget-list"},Ht={class:"widget-list-body position_relative"},Jt=50,Yt=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,s=!0){if(n.selectedRows)if(!s)a(n.selectedRows.includes(l)?[]:[l]);else{const u=[...n.selectedRows],f=u.indexOf(l);f===-1?u.push(l):u==null||u.splice(f,1),a(u)}}function i(){var l;if(((l=n.selectedRows)==null?void 0:l.length)!==n.array.length)return a([...n.array]);a([])}function a(l){e("update:selectedRows",l)}function d(l){if(!l)return;const s=l.target;s.scrollTop+s.clientHeight+Jt>s.scrollHeight&&e("scrollEnd")}return(l,s)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:d},[o.createElementVNode("table",Gt,[o.createElementVNode("thead",null,[o.createVNode(zt,{onSelect:s[0]||(s[0]=u=>i()),"onUpdate:order":s[1]||(s[1]=u=>e("update:order",u)),"onUpdate:config":s[2]||(s[2]=u=>e("update:config",u)),config:l.config,order:l.order},null,8,["config","order"])]),o.createElementVNode("tbody",Ht,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.array,(u,f)=>{var b;return o.openBlock(),o.createBlock(xt,{key:f,class:"widget-list-row",values:u,config:l.config,selected:(b=l.selectedRows)==null?void 0:b.includes(u),onSelect:R=>r(u,R)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),x={};function Kt(t){for(let e in t)x[e]=t[e]}function De(t){return Ee(t,"YYYY/MM/DD HH:mm:ss")}function Ee(t,e="YYYY/MM/DD"){if(!t)return"";try{const n=new Date(t);return Xe.format(n,e)}catch(n){return console.log(n),"Invalid date"}}function Xt(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 ce(t){return typeof t=="string"?re(t):Zt(t)?re(t.message,t.children||t.details||[]):Qt(t)?re(t.title,[t.detail||""]):re(C.DEFAULT_ERROR_MESSAGE)}function Zt(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"message"))}function Qt(t){return!!(typeof t=="object"&&t!==null&&Object.hasOwnProperty.call(t,"title"))}function re(t,e=[]){return{message:t,children:e}}function F(t="error"){return function(e){const{message:n,children:r}=ce(e);Q.add(t,n,{children:r})}}function le(t,e={}){return k().emit("entity:read",{...e,entity:t})}function ve(t,e){return k().emit("entity:update",{...e,entity:t})}function en(t){return t.reduce((e,n)=>(n.name&&(typeof n.name=="string"?e.push(n.name):e.push(...n.name)),e),[])}function xe(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 tn(t,e){const n=new Map;return t.forEach(r=>{var a;const i=e(r);n.has(i)||n.set(i,[]),(a=n.get(i))==null||a.push(r)}),n}function nn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16))}function rn(t){return t.text().then(e=>{try{return JSON.parse(e)}catch{return C.DEFAULT_ERROR_MESSAGE}})}function I(t,e={}){return $.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=$.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=>rn(n).then(r=>{if(!n.ok)throw r;return r}))}function on(t,e=1e3){let n=0;return(...r)=>{clearTimeout(n),n=window.setTimeout(()=>t(...r),e)}}function sn(t,e){let n=!1;return(...r)=>{if(!n)return n=!0,setTimeout(()=>n=!1,e),t(...r)}}const an=ge(ye("pretty-value-field-by-entity"));function cn(t,e,n){try{const r=ue.get(t);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${t} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(r){return an('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',r,t,e,n),n}}const ln=1,un=5e3,dn="static-folder",Ve="request-error",fn="Distinguisher",q=ge(ye("use-socket"));function k(){return hn}function pn(t){return typeof t=="object"&&Object.prototype.toString.call(t)==="[object Blob]"}const hn=function(){let t=1,e,n;const r=new Set;let i=0;const a=new Set;function d(){if(e)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{e.close()},un*2);const c=new Uint8Array(1);c[0]=ln,e.send(c)}setInterval(()=>{Array.from(r).forEach(c=>{P(c)&&(q("Handler for event %s requestId %d was expired",c.event,c.requestId),c.requestId?s({requestId:c.requestId,event:Ve,data:{message:J.RequestTookToLong().message}}):r.delete(c))})},1e3),setInterval(()=>{(!e||e.readyState===3)&&u()},C.DELAY_SOCKET_RECONNECT);function l(){return{safeQueue:a,requestId:t,handlers:r,socketInstance:e}}function s(c){const h=[...r.values()];q("Handlers array length is %d. Response event: %s. Request id: %d",r.size,c.event,c.requestId),h.forEach(g=>{const N=c.requestId;(g.requestId&&g.requestId===N||!g.requestId&&g.event===c.event)&&(q("Find appropriated handler: %d, event: %s",t,g.event),g.callback(c.data,c),g.once&&(r.delete(g),q("Handler was removed by *once* params was passed. %o",g)))})}function u(){if(typeof n!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${n}`,"color: purple","color: black"),e=new WebSocket(n),e.onclose=function(c){q("Connection to server was stopped: %d %s",c.code,c.reason),Array.from(r).forEach(h=>{h.guaranteedAnswer&&h.serializeString&&a.add(h.serializeString)})},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(c=>{f(c),a.delete(c)})},e.onerror=function(c){console.warn(c)},e.onmessage=c=>{var h;try{if(pn(c.data)){d();return}const g=JSON.parse(c.data);if(!Me(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(),s(g)}catch(g){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(g)}}}function f(c){e.send(c)}function b(c,h){v({event:c,callback:h})}function R(c,h){v({event:c,callback:h,once:!0})}function E(){return e&&(e==null?void 0:e.readyState)===1}function w(c,h,g){const N=++t,S=JSON.stringify({requestId:N,event:c,data:h,contextId:$.contextId,url:window.location.href});return E()?f(S):(a.add(S),q("Socket is not connected. Message was send to save-queue")),new Promise((j,p)=>{v({event:c,requestId:N,once:!0,guaranteedAnswer:!0,serializeString:S,callback:(m,_)=>{if(q("Promise was resolve with next data:",m),gn(_))return void p(m);g&&g(m,_),j(m)},timeToLive:C.TIME_TO_LIVE_SOCKET_REQUEST})})}function v(c){const h={timeToLive:0,...c,created:new Date().getTime()};r.add(h)}function P(c){return c.timeToLive===0||typeof c.timeToLive!="number"?!1:new Date().getTime()-c.created>c.timeToLive}return{get socket(){return e},on:b,once:R,emit:w,initialization(c){n=c},getDevInfo:l}}(),gn=t=>!!Me(t)&&t.event===Ve,Me=t=>typeof t=="object"&&t!==null&&"event"in t&&typeof t.event=="string"&&"requestId"in t&&typeof t.requestId=="number"&&"data"in t;function mn(t,e){return k().emit("list-setting:read",{entity:t,mark:e})}function yn(t,e){return k().emit("metadata-field:treat",{entity:t,fieldName:e})}function je(t,e){return k().emit("entity:create",{...e,entity:t})}function We(t,e){return k().emit("entity:delete",{...e,entity:t})}function En(t,e){return k().emit("usage-context:read",{...e,entity:t})}function Ue(t={}){return k().emit("tool:read",t)}function vn(){return k().emit("metadata-list:read",{})}function wn(t,e={},n={}){const r=o.inject(C.PROVIDE_NAME_ACTIONS,null),i=typeof t=="string"?t:e,a=typeof e=="string"?n:e;return o.computed(()=>{var s;const l=((typeof t=="string"?(s=r==null?void 0:r.actions)==null?void 0:s.value:o.unref(t))||[]).find(u=>u.name===i);return l?{...l,...a}:null})}function _n(t){return k().emit("history:read",t)}function Cn(t,e){return k().emit("entity:count",{...e,entity:t})}function bn(t){return`/${dn}/${t}`}function Y(t){return{exec(e,n){switch(t.name){case"replace-boolean":return Y.replaceBoolean(e,t.values);case"replace-record-operation":return Y.replaceRecordOperation(e)}}}}Y.replaceBoolean=kn;Y.replaceRecordOperation=Tn;function kn(t,e){return typeof t!="boolean"?"":t?e[1]:e[0]}function Tn(t){switch(t){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function Sn(t={}){return k().emit("tool:execute",t)}function qe(t,e){return t.handleConfirmation===void 0&&(t.handleConfirmation=Nn),t.handleAffectedEntity===void 0&&(t.handleAffectedEntity=In),t.handleCloseForm===void 0&&(t.handleCloseForm=Ln),t.handleValidationResult===void 0&&(t.handleValidationResult=On),{...e,label:e.title,callback(){var i;const n=typeof t.values=="function"?t.values(e,t):t.values,r=()=>Sn({name:e.name,values:n,usageContext:e.usageContext}).then(async a=>{var d,l;if(!An(a))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(t.handlers))for await(const s of t.handlers)await s(e,a,t);if(!a.success)throw t.handleValidationResult&&a.validationEffect&&((l=(d=a.validationEffect)==null?void 0:d.results)!=null&&l.length)&&t.handleValidationResult(e,a.validationEffect,t),new Error(a.message);return a.message&&Q.add("info",a.message),Array.isArray(a.affectedEntities)&&t.handleAffectedEntity&&a.affectedEntities.forEach(s=>{var u;return(u=t.handleAffectedEntity)==null?void 0:u.call(t,e,s,t)}),e.closeHostForm&&t.handleCloseForm&&t.handleCloseForm(e,t),a}).catch(F("error"));return(i=t.overrides)!=null&&i[e.name]?t.overrides[e.name](e,t):e.requireSave&&t.form&&t.form.changed?t.form.save().then(r):!e.confirmation||!t.handleConfirmation?r():t.handleConfirmation(e,r)}}}function An(t){return!!(t&&typeof t=="object"&&"affectedEntities"in t&&"success"in t)}function Rn(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 Nn(t,e){const n=Rn(t.confirmation);if(!ae.getComponentFromStore(C.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await ae.promptModal(C.MODAL_CONFIRM,{message:n}))return e()}function On(t,e){const n=C.MODAL_VALIDATION_EFFECT;if(!ae.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{ae.pushModal(n,e)})}function In(t,e,n){var d;const{router:r,form:i}=n,a=(d=e.primaryKey)==null?void 0:d.Id;if(r&&e&&e.name===t.redirectEntity)return r.push({name:e.name,params:{id:a}});i&&e.name===i.name&&e.updated&&a===i.id&&i.read()}function Ln(t,e){const{router:n}=e;n&&t.closeHostForm&&n.back()}let z={};function K(t,...e){if(typeof t!="string")return console.trace(`Label is not provided for translation: ${t}`),"undefined";let n=B.utils.getPropFromObject((this==null?void 0:this.vocabulary)||z,t);if(typeof n=="string")return Ae(n,e);const r=B.utils.getPropFromObject(z==null?void 0:z.root,t);return typeof r=="string"?Ae(r,e):(typeof n===void 0&&console.warn(`Translation for label "${t}" is not founded.`),t)}function Ae(t,e){return e.forEach((n,r)=>{t=t.replaceAll(new RegExp(`\\{${r}}`,"g"),n)}),t}K.setGlobalVocabulary=function(t){z=t};K.getScope=function(t){const e=typeof t=="string"?t:"root";return typeof t!="string"&&console.warn(`SCOPE ${t} for translate is not string.`),K.bind({vocabulary:B.utils.getPropFromObject(z,e.toLowerCase())})};K.setVocabulary=function(t){return typeof t=="string"&&(t=B.utils.getPropFromObject(z,t)),K.bind({vocabulary:t})};function Pn(){const t=o.ref(null);function e(n){t.value=n}return{activeRow:t,activateRow:e}}function $n(t,e){return typeof t!="object"||t===null?!1:Object.values(t).join().toLowerCase().includes(e)}async function ze(t,e){t()&&(await e(),await ze(t,e))}function Fn(t,e,n={}){let r=!1;const i=o.ref(""),a=o.computed(()=>d.filter(p=>u(p,i.value))),d=o.reactive([]);let l=0;const s=o.ref(!1);let u=(n==null?void 0:n.filterSearchFn)||((p,m)=>$n(p,m));function f(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function b(){const p=N();return typeof p.limit!="number"&&(p.limit=100),p.offset=l,(n.request||le)(t,p).then(_=>(l+=_.length,_))}function R(p,m){var T;return typeof p.Version=="number"?p.Version:(T=d.find(O=>O.Id===m))==null?void 0:T.Version}function E(p,m){const _=d.findIndex(T=>T.Id===p);if(_===-1)throw new Error(`Can't found item with Id ${p}`);d.splice(_,1,m)}function w(p){const m=d.findIndex(_=>_.Id===p);if(m===-1)throw new Error(`Can't found item with Id ${p}`);d.splice(m,1)}async function v(p,m){try{const _=N(),T=R(m,p);delete m.Version,await ve(t,{id:p,values:m,version:T,masterEntities:f()});const O=await le(t,{fields:_.fields||"",id:p});E(p,O)}catch(_){F()(_)}}async function P(p,m={}){try{const _=N(),T=R(m,p);delete m.Version,await We(t,{id:p,version:T,masterEntities:f()}),w(p)}catch(_){F()(_)}}async function c(p){try{await je(t,{values:p,masterEntities:f()}),await S()}catch(m){F()(m)}}let h;async function g(){s.value=!0;try{h!=null&&h.signal&&!h.signal.aborted&&h.abort();let p=h=new AbortController,m=0;const T=N().limit||0;if(i.value&&!T){console.warn("Using textSearch assumes the use of limit.");return}await ze(()=>(T>0?m<T:!0)&&!r&&!p.signal.aborted,async()=>{const O=await b();p.signal.aborted||(d.push(...O),m+=O.filter(te=>u(te,i.value)).length,(O.length<T||T===0)&&(r=!0))})}catch(p){F()(p)}s.value=!1}function N(){return typeof e=="function"?e():e}async function S(){try{l=0,r=!1,d.splice(0,d.length),await g()}catch(p){F()(p)}}function j(){if(h)return h.abort();s.value=!1}return{array:d,updateById:v,next:g,reload:S,wait:s,create:c,deleteById:P,textSearch:i,filteredArray:a,abort:j}}function Bn(){function t(){return{organizations:$.organizations,currentContextId:$.contextId,person:$.person,context:$.context,contextType:$.contextType,userId:$.userId}}const e=o.reactive(t());return $.onupdateContext(()=>{Object.assign(e,t())}),e}function Dn(t,e,n){return k().emit("communication:create",{entityName:t,entityCatalogId:e,targetCode:n})}function xn(t,e,n){return k().emit("communication:read",{entityName:t,entityCatalogId:e,targetCode:n})}function Vn(t,e){return k().emit("communication-message:create",{communicationId:t,text:e})}function Mn(t){return k().emit("communication-message:read",{communicationId:t})}function jn(t){const e=B.Form.getParentForm(),n=o.reactive([]);return e&&e.subscribe(t),t.read=()=>Mn(t.id).then(r=>(n.splice(0,n.length,...r),r)),{array:n}}function Wn(t,e){t.read=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw J.EntityWithoutName(t);return le(t.name,r)}).then(we).then(i=>(i.hasOwnProperty("Version")&&(t.version=i.Version),t.setValues(i),i)).catch(F())},t.save=()=>{const r=n();return Promise.resolve().then(()=>{if(!t.name)throw J.EntityWithoutName(t);return ve(t.name,{id:r.id,values:t.changes,version:t.version})}).then(i=>{t.version=i.version}).catch(i=>{throw F()(i),i})};function n(){return typeof e=="function"?e():e}}function Un(t){if(!t)return o.inject(C.PROVIDE_NAME_METADATA);ue.initEntity(t);const e=o.computed(()=>ue.state[t]);return o.provide(C.PROVIDE_NAME_METADATA,e),e}function qn(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 En(t,zn(e||{}))}}}function zn(t){return typeof t=="function"?t():t}function Gn(t){if(!t)return o.inject(C.PROVIDE_NAME_ACTIONS);const e=o.reactive([]),n=o.computed(()=>e.map(a=>qe(t,a))),r={actions:n,update:i};o.provide(C.PROVIDE_NAME_ACTIONS,r),t.router=Le.useRouter();function i(a={}){return e.splice(0,e.length),Ue(a).then(d=>e.splice(0,0,...d)).catch(F("error"))}return{actions:n,update:i}}function Hn(t){function e(n){n.key==="Enter"&&t()}o.onMounted(()=>{document.addEventListener("keypress",e)}),o.onUnmounted(()=>{document.removeEventListener("keypress",e)})}function Jn(t,e={}){const n=o.reactive([]),r=s=>{const u=o.unref(t);if(s===void 0){n.length===0?u.forEach(a):u.forEach(d);return}i(s)?d(s):a(s)},i=s=>n.includes(s),a=s=>{e.handleSelect&&!e.handleSelect(s)||i(s)||n.push(s)},d=s=>{const u=n.findIndex(f=>f===s);u!==-1&&n.splice(u,1)},l=o.computed(()=>{const s=o.unref(t);return n.length===s.length&&s.length!==0});return[n,r,l,a,d]}function Yn(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 Q=new class{constructor(){this.store=o.reactive([])}add(e,n,r={}){const i=Kn(r),a=new Xn(e,n,i.timeout,i.children,i.click);return this.store.push(a),i.timeout&&setTimeout(this.remove.bind(this,a.id),i.timeout*1e3),a}remove(e){const n=this.store.findIndex(r=>r.id===e);if(n===-1)return!1;this.store.splice(n,1)}};function Kn(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 Ge=class He{constructor(e,n,r,i,a){this.type=e,this.message=n,this.timeout=r,this.children=i,this.click=a,this.id=He.cardId++}};Ge.cardId=1;let Xn=Ge;/*!
5
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),B=require("jenesius-vue-form"),Qe=require("vue-router"),Ot=require("date-and-time"),Ie=require("debug"),me=require("jenesius-vue-modal");const Ze=class C extends Error{constructor(t,n=null){super(),this.message=t,this.details=n,this.id=C.ID++}static ParentFormNotFound(){return new C("Can't found parent form.")}static UndefinedNameOfCompositeFormController(t){return new C("Composite object name is undefined",t)}static EntityWithoutName(t){return new C("'Entity doesn't have a name",t)}static NotResolvedNameEventEmitter(t){return new C(`'${t}' is not a valid Event emitter name`)}static FormIsNotValidated(t){return new C("Form is not validated",t)}static ListWorkerIsRunningOrEnd(t){return new C("List data request is running or already done",t)}static ObjectIdNotNumber(t){return new C(`${t} (id) is not a number`)}static UndefinedErrorId(t,n){return C.ApiNotAvailable()}static ApiError(t){return new C("Request error",t)}static ApiNotAvailable(){return new C(`Sorry, we experience difficulties here.
6
+ Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(t,n){return!t&&!n?C.ApiNotAvailable():new C(t||"Authorization Error",n)}static ApiResponseParseFailed(){return C.ApiNotAvailable()}static MissingIdInValuesEntity(t){return new C("Object doesn't have id",t)}static ObjectWithIdNotFound(t,n){return new C(`Can't find object with id: ${t}`,n)}static ObjectWithoutConnectToPresentArray(t,n){return new C("Object is not found.",{object:t,array:n})}static EntityWithoutId(t){return new C("Entity doesn't have id.",t)}static NotFoundedTableIndex(t,n){return new C(`Can't find the element with tableIndex ${t}`,n)}static UndefinedError(t,n=[]){return new C(t,n)}static TableArrayAlreadyIncludeProvidedIndexValue(t,n,r){return new C(`Array already includes the element with value ${t}`,{array:n,table:r})}static MetadataEntityIsNotAvailable(t){return new C(`Metadata for the ${t} is not currently available.`)}static RequestTookToLong(){return new C("The request took too long to complete. Try again later.")}};Ze.ID=0;let Q=Ze;const Nt="Please try again later or submit a feedback if problem doesn't go.";function Lt(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return Nt}})}function U(e,t={}){return t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw Q.ApiNotAvailable()}).then(n=>Lt(n).then(r=>{if(!n.ok)throw r;return r}))}class xt{constructor(){this.public=!1,this.errors=new Proxy([],{set:(t,n,r)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),t[n]=r,!0)}),window._journal=this}get error(){return{add:(...t)=>{this.errors.push(t)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}new xt;function Ve(e){return{...e,createdEntities:e.createdEntites}}const et=class de{static async getStartConfig(t,n){return U([de.url,t,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(t,n){return U([de.url,t,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(Ve)}static async runStep(t,n,r,o,s){return U([de.url,t,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:o,values:s})}).then(Ve)}};et.url="/close-api/views/process-wizard";let pe=et;class Pt{static invite(t,n,r){return U("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:t,personKey:n,relatedRoleCode:r})})}static accept(t,n){return U("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:t,version:n,mark:!0})})}static decline(t,n){return U("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:t,version:n,mark:!1})})}}class $t{static getRequiredDocuments(t,n,r){const o=new URLSearchParams({entity:t,primaryKey:n,statusCode:r});return fetch(`/close-api/views/required-documents?${o.toString()}`).then(s=>s.json())}}class K{static url(){return"close-api/billing"}static getBillingMetadata(t){return fetch(`/${K.url()}/calculator/${t}`)}static calculate(t,n){return U(`/${K.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:t,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(t){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:t.name,label:t.title,required:t.required,type:n(t)}}static createOnlinePayment(t,n){return U(`/${K.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:t,returnURL:n})})}static applyOnlinePayment(t){return U(`/${K.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:t})})}}function Ft(e){return e.statusName==="Completed"}function Dt(e){return e.statusName==="FinalStepWithConfirmation"}function Bt(e){return e.statusName==="ValidationError"}function Vt(e,t,n){let r=null;const o=i.reactive({wait:null});let s=[],u=null;const l=i.ref(null);function a(){l.value=s.find(c=>c.name===u)||null}function f(){var c;return u?((c=s.find(m=>m.name===u))==null?void 0:c.fields)||[]:[]}function d(c){if(a(),Bt(c))return void n.onValidation(c.validationResults);if((c.statusName==="FinalStep"||c.statusName==="NextStep")&&(!f().length||Mt(f(),n.presets)))return T(n.presets||{});Ft(c)&&n.onCompleted(c),Dt(c)&&n.onConfirmation(c)}async function g(){try{await E(),await _()}catch(c){const{message:m}=ye(c);ie.add("error",m)}}function E(){return o.wait="Loading process information.",pe.getStartConfig(t,e).then(c=>{s=c.steps.map(m=>({label:m.title,name:m.stepName,number:m.number,fields:m.frontendEntity.objectTypes.reduce((v,I)=>(I.properties.forEach(R=>{v.push({name:R.name,label:R.title,type:R.refEntityName||R.dataType})}),v),[])}))}).then(c=>(o.wait=!1,c))}function h(c){return["FinalStepWithConfirmation","NextStep","Completed","FinalStep"].includes(c.statusName)&&(r=c.token,u=c.nextStepName),c}function y(c){const m=ye(c);ie.add("error",m.message)}function _(){return o.wait="Starting process",pe.startProcess(t,e).then(h).then(d).catch(y).finally(()=>{o.wait=null})}function T(c={}){return!r||!u?Promise.reject("Not step or token."):(o.wait="Waiting for result...",pe.runStep(t,e,u,r,c).then(h).then(d).catch(y).finally(()=>{o.wait=!1}))}return{initialize:g,state:o,currentStepConfig:i.readonly(l),next:T}}function Mt(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(!B.utils.getPropFromObject(t,r.name))return!1}return!0}const Wt={class:"widget-table__head"},jt={class:"widget-table__head-label margin_0 text_overflow"},Ut=i.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("tr",Wt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.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 G=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},qt=G(Ut,[["__scopeId","data-v-25198f4a"]]);function tt(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}function zt(e){const t=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let r;for(;(r=t.exec(e))!==null;)n.push(r[1]);return n}function Gt(e,t){return zt(e).forEach(r=>{e=e.replace(new RegExp("\\$\\{"+r+"}","g"),B.utils.getPropFromObject(t,r))}),e}function Ae(e){return t=>typeof t=="string"||typeof t=="number"?`${t} ${e}`:""}function Re(e,t){const n=tt(e);if(typeof e.value=="string")return Gt(e.value,t);let r=n?B.utils.getPropFromObject(t,n):null;if(r===void 0&&(r=null),typeof e.value=="function")return e.value(r,t);if(e.value===null)return null;if(e.unitValue&&(r=Ae(e.unitValue)(r)),e.unit&&(r=Ae(e.unit)(r)),e.type)switch(e.type){case"number":{typeof r=="number"&&(r=new Intl.NumberFormat().format(r));break}case"date":{r=Le(typeof r=="string"?r:null);break}case"dateTime":case"dateWithTime":{r=nt(typeof r=="string"?r:null);break}case"money":{r=rt(r);break}}return e.formatter&&(r=Z(e.formatter).exec(r,t)),typeof r=="boolean"&&(r=r?"✓":"—"),r}const S={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 Oe(e){return[S.CORE_DEBUG_LABEL,e].join(":")}const Ht={props:{name:String},setup(e,t){let n="unknown";try{n=t.slots.default()[0].children}catch{n=e.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}`})}},re=G(Ht,[["__scopeId","data-v-e287c8d9"]]),Xt=Ie(Oe("setup-list-row"));function Jt(e,t){const n=e.config.map(r=>Yt(r,e,t));return i.h("tr",{class:"widget-table__row widget-table-row"},n)}function Yt(e,t,n){const r=t.values;let o=Re(e,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function u(d){s.onClick.push(()=>d(r))}function l(d){Array.isArray(d)?s.class.push(...d):s.class.push(d)}const a=[],f=[];if(e.hide&&e.hide(r))return[i.h("td")];if(e.type)switch(l(`widget-table-cell_${e.type}`),e.type){case"multi-select":{f.push(i.h(B.FormField,{type:"single-checkbox",modelValue:t.selected})),u(Me.bind(null,n,!0));break}case"select":{f.push(i.h(B.FormField,{type:"single-radio",modelValue:t.selected})),u(Me.bind(null,n,!1));break}}if(e.onClick&&u(e.onClick),e.link)try{const d=e.link(r);if(d){const g=i.h(Qe.RouterLink,{to:d});f.push(g),l("widget-table-cell_link")}}catch(d){Xt("Can't add router link",d)}if(e.href&&(f.push(i.h("a",{href:e.href(r),target:"_blank"})),l("widget-table-cell_link")),(typeof o=="string"||typeof o=="number")&&f.push(i.h("p",{class:"widget-list-cell-text"},o)),e.icon&&(typeof e.icon=="string"&&f.push(i.h(re,{name:e.icon})),typeof e.icon=="function")){const d=e.icon(r);d!==null&&f.push(i.h(re,{name:d}))}return e.class&&(typeof e.class=="function"?l(e.class(r)):l(e.class)),a.push(i.h("td",s,f)),a}function Me(e,t){e.emit("select",t)}function Ne(e,t){return()=>{try{return Jt(e,t)}catch(n){return console.warn(n),null}}}const Kt={props:{values:Object,config:Object,selected:Boolean},setup:Ne},Qt=["colspan"],We=i.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(e,{emit:t}){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=>t("close")),onSave:o[1]||(o[1]=s=>t("save",s))}),null,16,["values","new"]))],8,Qt)],512))}}),Zt={class:"widget-table"},je="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(e,{emit:t}){const n=e,r=i.useSlots(),o=i.computed(()=>{var a;return(a=r==null?void 0:r.default)==null?void 0:a.call(r)[0]});function s(a,f=!0){if(!n.selectedRows)return;if(!f)return t(je,n.selectedRows.includes(a)?[]:[a]);const d=[...n.selectedRows],g=d.indexOf(a);return g===-1?d.push(a):d.splice(g,1),t(je,d)}function u(a){t("save",a),t("update:activeRow",null)}const l=i.computed(()=>n.shortcut?n.config.filter(a=>a.name?!!n.array.find(d=>![null,""].includes(Re(a,d))):!0):n.config);return(a,f)=>(i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("table",Zt,[i.createElementVNode("thead",null,[i.createVNode(qt,{config:l.value},null,8,["config"])]),i.createElementVNode("tbody",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.array,(d,g)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:g},[i.createVNode(Kt,{config:l.value,values:d,selected:a.selectedRows.includes(d),onSelect:E=>s(d,E),class:i.normalizeClass(a.classCallback?a.classCallback(d):"")},null,8,["config","values","selected","onSelect","class"]),o.value&&a.activeRow===d?(i.openBlock(),i.createBlock(We,{key:0,component:o.value,"row-length":a.config.length,values:d,onClose:f[0]||(f[0]=E=>t("update:activeRow",null)),onSave:u,"is-new":!1},null,8,["component","row-length","values"])):i.createCommentVNode("",!0)],64))),128)),a.activeRow===i.unref(S).LIST_ACTIVE_NEW?(i.openBlock(),i.createBlock(We,{key:0,component:o.value,"row-length":l.value.length,onClose:f[1]||(f[1]=d=>t("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(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",{class:"widget-spinner",style:i.normalizeStyle({"border-left":`1.1em solid ${t.color}`})},null,4))}});const be=G(tn,[["__scopeId","data-v-0ef9ae88"]]),nn={class:"widget-button"},rn=i.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("button",nn,[t.wait?(i.openBlock(),i.createBlock(be,{key:0,class:"widget-button-spinner"})):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"default",{},void 0,!0)]))}});const on=G(rn,[["__scopeId","data-v-450dc564"]]),an={class:"widget-multi-button-wrap position_relative cursor_pointer"},sn={class:"widget-multi-button-body grid"},ln=["onClick"],cn={class:"widget-multi-button-side-wrap"},un=i.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(e){const t=e;i.useCssVars(u=>({"7025434e":r.value}));const n=i.reactive({active:!1,wait:!1}),r=i.computed(()=>t.array.length+(t.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",an,[i.createElementVNode("div",{class:i.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[i.createElementVNode("div",sn,[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]=a=>s())},i.toDisplayString(u.label),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.array,(a,f)=>(i.openBlock(),i.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:f,onClick:d=>{o(a.callback),s(!1)}},i.toDisplayString(a.label),9,ln))),128))]),i.createElementVNode("div",cn,[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]=a=>s())},[n.wait?(i.openBlock(),i.createBlock(i.unref(be),{key:0,class:"widget-multi-button-side-spinner"})):u.array.length>1?(i.openBlock(),i.createBlock(i.unref(re),{key:1,class:"widget-multi-button-side-icon"},{default:i.withCtx(()=>[i.createTextVNode("angle-small-down")]),_:1})):i.createCommentVNode("",!0)],2)])],2)]))}});const fn=G(un,[["__scopeId","data-v-a8d711d1"]]),dn={class:"widget-loader flex flex-align_center gap_10 padding_15"},pn={class:"text_md"},gn=i.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",dn,[i.createVNode(be,{color:"var(--primary)",class:"padding_10"}),i.createElementVNode("span",pn,i.toDisplayString(t.label),1)]))}}),hn=["alt","src"],mn=i.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(e){const t=e,n=i.ref();return i.onMounted(()=>{n.value&&(n.value.src=t.src),n.value.onerror=function(){t.default&&(n.value.src=t.default)}}),(r,o)=>(i.openBlock(),i.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:n,src:r.src||r.$props.default},null,8,hn))}}),yn={props:{config:Array,values:Object,selected:Boolean},setup:Ne};const vn=G(yn,[["__scopeId","data-v-344a8cc1"]]),wn=e=>(i.pushScopeId("data-v-bf495d6a"),e=e(),i.popScopeId(),e),En={class:"widget-list-head-cell"},bn=wn(()=>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(e,{emit:t}){const n=e;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",En,[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(B.FormField),{key:0,type:"single-checkbox",onClick:o[0]||(o[0]=i.withModifiers(s=>t("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=>t("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(re),{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),bn])]))}});const Tn=G(_n,[["__scopeId","data-v-bf495d6a"]]),Cn=i.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(e,{emit:t}){const n=e,r=i.ref(),o=i.ref();i.onMounted(()=>{function a(h,y){let _=-1;do _++,y-=h[_];while(y>0&&_<h.length);return _}function f(h,y){let _=0;for(;y>0&&y>h[_]&&_<h.length;)y-=h[_],_++;return console.log(y,_),_>0?_:0}function d(h){try{o.value.style.insetInlineStart=h+"px"}catch(y){console.log(y)}}function g(h){try{o.value.style.width=h+"px",o.value.style.minWidth=h+"px",o.value.style.maxWidth=h+"px"}catch(y){console.log(y)}}function E(h){return h===null?!1:h.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(y){var Be;function _(P){return P.screenX+m-R}const T=r.value,c=[...T.children].filter(P=>P.localName==="th"),m=((Be=T.offsetParent)==null?void 0:Be.scrollLeft)||0,v=c.map(P=>P.clientWidth),I=E(y.target),R=T.getBoundingClientRect().left,V=_(y),p=a(v,V),w=v.slice(0,p).reduce((P,M)=>P+M,0),b=V-w,k=T.offsetWidth,O=c[p].clientWidth;if(n.config[p].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",y.screenX),console.log("Widths",v),console.log("max width",k),console.log("Start Position",V),console.log("Position From",p),console.log("Start Position",p),console.log("Global offset (Отступ самой таблицы от края экрана)",R),console.log("Del",b),console.groupEnd(),o.value.innerText=c[p].textContent||"",o.value.style.display="grid",o.value.style.width=O+"px",o.value.style.cursor="grabbing",d(w),g(O),document.addEventListener("pointermove",De,{passive:!0}),document.addEventListener("pointerup",ae);function ae(P){if(console.group("END"),document.removeEventListener("pointermove",De),document.removeEventListener("pointerup",ae),I&&(n.config[p].width=o.value.style.width,n.config[p].minWidth=o.value.style.width,n.config[p].maxWidth=o.value.style.width,s(n.config)),!I){const M=P.screenX+m-R;console.log("ENP Position",M);const se=f(v,M);if(console.log(p,"->",se),se!==p){const te=n.config[p],Ce=n.config;Ce.splice(p,1),Ce.splice(se,0,te),s(Ce)}else{const te=n.config[p].name;u(te)}}o.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function De(P){if(I){const te=_(P)-V+O;g(te);return}let M=P.screenX+m-R-b;M<0&&(M=0),M+O>k&&(M=k-O),d(M)}})});function s(a){t("update:config",a)}function u(a){if(!a)return;if(Array.isArray(a)){if(a.length<1)return;a=a[0]}if(n.order.length===0||n.order[0]!==a)return void l([a]);const f=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([a,f==="asc"?"desc":"asc"])}function l(a){t("update:order",a)}return(a,f)=>(i.openBlock(),i.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.config,(d,g)=>(i.openBlock(),i.createBlock(Tn,i.mergeProps({key:d},d,{onOrder:E=>u(d.name),onSelect:f[0]||(f[0]=E=>t("select")),order:a.order}),null,16,["onOrder","order"]))),128)),i.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:o},"test",512)],512))}});const An=G(Cn,[["__scopeId","data-v-ccffc6bd"]]),kn={class:"widget-list"},Sn={class:"widget-list-body position_relative"},In=50,Rn=i.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(e,{emit:t}){const n=e;function r(l,a=!0){if(n.selectedRows)if(!a)s(n.selectedRows.includes(l)?[]:[l]);else{const f=[...n.selectedRows],d=f.indexOf(l);d===-1?f.push(l):f==null||f.splice(d,1),s(f)}}function o(){var l;if(((l=n.selectedRows)==null?void 0:l.length)!==n.array.length)return s([...n.array]);s([])}function s(l){t("update:selectedRows",l)}function u(l){if(!l)return;const a=l.target;a.scrollTop+a.clientHeight+In>a.scrollHeight&&t("scrollEnd")}return(l,a)=>(i.openBlock(),i.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[i.createElementVNode("table",kn,[i.createElementVNode("thead",null,[i.createVNode(An,{onSelect:a[0]||(a[0]=f=>o()),"onUpdate:order":a[1]||(a[1]=f=>t("update:order",f)),"onUpdate:config":a[2]||(a[2]=f=>t("update:config",f)),config:l.config,order:l.order},null,8,["config","order"])]),i.createElementVNode("tbody",Sn,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.array,(f,d)=>{var g;return i.openBlock(),i.createBlock(vn,{key:d,class:"widget-list-row",values:f,config:l.config,selected:(g=l.selectedRows)==null?void 0:g.includes(f),onSelect:E=>r(f,E)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}}),W={};function On(e){for(let t in e)W[t]=e[t]}function nt(e){return Le(e,"YYYY/MM/DD HH:mm:ss")}function Le(e,t="YYYY/MM/DD"){if(!e)return"";try{const n=new Date(e);return Ot.format(n,t)}catch(n){return console.log(n),"Invalid date"}}function Nn(e){function t(...r){return n.wait?Promise.reject("The process has already started."):(n.wait=!0,Promise.resolve().then(()=>e(...r)).finally(()=>{n.wait=!1}))}const n=i.reactive({wait:!1,call:t});return n}function ye(e){return typeof e=="string"?le(e):Ln(e)?le(e.message,e.children||e.details||[]):xn(e)?le(e.title,[e.detail||""]):le(S.DEFAULT_ERROR_MESSAGE)}function Ln(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function xn(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function le(e,t=[]){return{message:e,children:t}}function D(e="error"){return function(t){const{message:n,children:r}=ye(t);ie.add(e,n,{children:r})}}function ve(e,t={}){return N().emit("entity:read",{...t,entity:e})}function xe(e,t){return N().emit("entity:update",{...t,entity:e})}function Pn(e){return e.reduce((t,n)=>(n.name&&(typeof n.name=="string"?t.push(n.name):t.push(...n.name)),t),[])}function rt(e,t=2){if(!(typeof e=="string"||typeof e=="number"))return"";let r=String(e).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(t,"0"),r[1].length>t&&(r[1]=r[1].substring(0,t)),r.join(".")}function $n(e,t){const n=new Map;return e.forEach(r=>{var s;const o=t(r);n.has(o)||n.set(o,[]),(s=n.get(o))==null||s.push(r)}),n}function Fn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function Dn(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return S.DEFAULT_ERROR_MESSAGE}})}function x(e,t={}){return F.isFront&&(t.headers||(t.headers={}),t.headers["Context-Id"]=F.contextId),t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.reload():n).catch(()=>{throw new Error(S.DEFAULT_ERROR_MESSAGE)}).then(n=>Dn(n).then(r=>{if(!n.ok)throw r;return r}))}function Bn(e,t=1e3){let n=0;return(...r)=>{clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}function Vn(e,t){let n=!1;return(...r)=>{if(!n)return n=!0,setTimeout(()=>n=!1,t),e(...r)}}const Mn=Ie(Oe("pretty-value-field-by-entity"));function Wn(e,t,n){try{const r=Ee.get(e);if(!r)throw new Error("For entity metadata is not loaded");const o=r.fieldsByName[t];if(!o)throw new Error(`For entity ${e} can't found fieldMetadata for field ${t}`);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,e,t,n),n}}const jn=1,Un=5e3,qn="static-folder",it="request-error",zn="Distinguisher",H=Ie(Oe("use-socket"));function N(){return Hn}function Gn(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const Hn=function(){let e=1,t,n;const r=new Set;let o=0;const s=new Set;function u(){if(t)o&&(clearTimeout(o),o=0);else return;o=setTimeout(()=>{t.close()},Un*2);const c=new Uint8Array(1);c[0]=jn,t.send(c)}setInterval(()=>{Array.from(r).forEach(c=>{T(c)&&(H("Handler for event %s requestId %d was expired",c.event,c.requestId),c.requestId?a({requestId:c.requestId,event:it,data:{message:Q.RequestTookToLong().message}}):r.delete(c))})},1e3),setInterval(()=>{(!t||t.readyState===3)&&f()},S.DELAY_SOCKET_RECONNECT);function l(){return{safeQueue:s,requestId:e,handlers:r,socketInstance:t}}function a(c){const m=[...r.values()];H("Handlers array length is %d. Response event: %s. Request id: %d",r.size,c.event,c.requestId),m.forEach(v=>{const I=c.requestId;(v.requestId&&v.requestId===I||!v.requestId&&v.event===c.event)&&(H("Find appropriated handler: %d, event: %s",e,v.event),v.callback(c.data,c),v.once&&(r.delete(v),H("Handler was removed by *once* params was passed. %o",v)))})}function f(){if(typeof n!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${n}`,"color: purple","color: black"),t=new WebSocket(n),t.onclose=function(c){H("Connection to server was stopped: %d %s",c.code,c.reason),Array.from(r).forEach(m=>{m.guaranteedAnswer&&m.serializeString&&s.add(m.serializeString)})},t.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...s.values()].forEach(c=>{d(c),s.delete(c)})},t.onerror=function(c){console.warn(c)},t.onmessage=c=>{var m;try{if(Gn(c.data)){u();return}const v=JSON.parse(c.data);if(!ot(v)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(v);return}(m=v==null?void 0:v.data)!=null&&m.refresh&&location.reload(),a(v)}catch(v){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(v)}}}function d(c){t.send(c)}function g(c,m){_({event:c,callback:m})}function E(c,m){_({event:c,callback:m,once:!0})}function h(){return t&&(t==null?void 0:t.readyState)===1}function y(c,m,v){const I=++e,R=JSON.stringify({requestId:I,event:c,data:m,contextId:F.contextId,url:window.location.href});return h()?d(R):(s.add(R),H("Socket is not connected. Message was send to save-queue")),new Promise((V,p)=>{_({event:c,requestId:I,once:!0,guaranteedAnswer:!0,serializeString:R,callback:(w,b)=>{if(H("Promise was resolve with next data:",w),Xn(b))return void p(w);v&&v(w,b),V(w)},timeToLive:S.TIME_TO_LIVE_SOCKET_REQUEST})})}function _(c){const m={timeToLive:0,...c,created:new Date().getTime()};r.add(m)}function T(c){return c.timeToLive===0||typeof c.timeToLive!="number"?!1:new Date().getTime()-c.created>c.timeToLive}return{get socket(){return t},on:g,once:E,emit:y,initialization(c){n=c},getDevInfo:l}}(),Xn=e=>!!ot(e)&&e.event===it,ot=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function Jn(e,t){return N().emit("list-setting:read",{entity:e,mark:t})}function Yn(e,t){return N().emit("metadata-field:treat",{entity:e,fieldName:t})}function at(e,t){return N().emit("entity:create",{...t,entity:e})}function st(e,t){return N().emit("entity:delete",{...t,entity:e})}function Kn(e,t){return N().emit("usage-context:read",{...t,entity:e})}function lt(e={}){return N().emit("tool:read",e)}function Qn(){return N().emit("metadata-list:read",{})}function Zn(e,t={},n={}){const r=i.inject(S.PROVIDE_NAME_ACTIONS,null),o=typeof e=="string"?e:t,s=typeof t=="string"?n:t;return i.computed(()=>{var a;const l=((typeof e=="string"?(a=r==null?void 0:r.actions)==null?void 0:a.value:i.unref(e))||[]).find(f=>f.name===o);return l?{...l,...s}:null})}function er(e){return N().emit("history:read",e)}function tr(e,t){return N().emit("entity:count",{...t,entity:e})}function nr(e){return`/${qn}/${e}`}function Z(e){return{exec(t,n){switch(e.name){case"replace-boolean":return Z.replaceBoolean(t,e.values);case"replace-record-operation":return Z.replaceRecordOperation(t)}}}}Z.replaceBoolean=rr;Z.replaceRecordOperation=ir;function rr(e,t){return typeof e!="boolean"?"":e?t[1]:t[0]}function ir(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function or(e={}){return N().emit("tool:execute",e)}function ct(e,t){return e.handleConfirmation===void 0&&(e.handleConfirmation=lr),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=ur),e.handleCloseForm===void 0&&(e.handleCloseForm=fr),e.handleValidationResult===void 0&&(e.handleValidationResult=cr),{...t,label:t.title,callback(){var o;const n=typeof e.values=="function"?e.values(t,e):e.values,r=()=>or({name:t.name,values:n,usageContext:t.usageContext}).then(async s=>{var u,l;if(!ar(s))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(e.handlers))for await(const a of e.handlers)await a(t,s,e);if(!s.success)throw e.handleValidationResult&&s.validationEffect&&((l=(u=s.validationEffect)==null?void 0:u.results)!=null&&l.length)&&e.handleValidationResult(t,s.validationEffect,e),new Error(s.message);return s.message&&ie.add("info",s.message),Array.isArray(s.affectedEntities)&&e.handleAffectedEntity&&s.affectedEntities.forEach(a=>{var f;return(f=e.handleAffectedEntity)==null?void 0:f.call(e,t,a,e)}),t.closeHostForm&&e.handleCloseForm&&e.handleCloseForm(t,e),s}).catch(D("error"));return(o=e.overrides)!=null&&o[t.name]?e.overrides[t.name](t,e):t.requireSave&&e.form&&e.form.changed?e.form.save().then(r):!t.confirmation||!e.handleConfirmation?r():e.handleConfirmation(t,r)}}}function ar(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function sr(e){const t="Are you sure?";return e===!0||typeof e=="string"&&e.toLowerCase()==="true"||e==="1"?t:typeof e=="string"?e:t}async function lr(e,t){const n=sr(e.confirmation);if(!me.getComponentFromStore(S.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await me.promptModal(S.MODAL_CONFIRM,{message:n}))return t()}function cr(e,t){const n=S.MODAL_VALIDATION_EFFECT;if(!me.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{me.pushModal(n,t)})}function ur(e,t,n){var u;const{router:r,form:o}=n,s=(u=t.primaryKey)==null?void 0:u.Id;if(r&&t&&t.name===e.redirectEntity)return r.push({name:t.name,params:{id:s}});o&&t.name===o.name&&t.updated&&s===o.id&&o.read()}function fr(e,t){const{router:n}=t;n&&e.closeHostForm&&n.back()}let X={};function ee(e,...t){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let n=B.utils.getPropFromObject((this==null?void 0:this.vocabulary)||X,e);if(typeof n=="string")return Ue(n,t);const r=B.utils.getPropFromObject(X==null?void 0:X.root,e);return typeof r=="string"?Ue(r,t):(typeof n===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function Ue(e,t){return t.forEach((n,r)=>{e=e.replaceAll(new RegExp(`\\{${r}}`,"g"),n)}),e}ee.setGlobalVocabulary=function(e){X=e};ee.getScope=function(e){const t=typeof e=="string"?e:"root";return typeof e!="string"&&console.warn(`SCOPE ${e} for translate is not string.`),ee.bind({vocabulary:B.utils.getPropFromObject(X,t.toLowerCase())})};ee.setVocabulary=function(e){return typeof e=="string"&&(e=B.utils.getPropFromObject(X,e)),ee.bind({vocabulary:e})};function dr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ke={exports:{}},A={},Se={exports:{}},J={};function ut(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function pr(e,t,n){}function gr(e,t,n){}var hr=/javascript\s*\:/img;function mr(e,t){return hr.test(t)?"":t}J.whiteList=ut();J.getDefaultWhiteList=ut;J.onAttr=pr;J.onIgnoreAttr=gr;J.safeAttrValue=mr;var yr={indexOf:function(e,t){var n,r;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var r,o;if(Array.prototype.forEach)return e.forEach(t,n);for(r=0,o=e.length;r<o;r++)t.call(n,e[r],r,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},ne=yr;function vr(e,t){e=ne.trimRight(e),e[e.length-1]!==";"&&(e+=";");var n=e.length,r=!1,o=0,s=0,u="";function l(){if(!r){var d=ne.trim(e.slice(o,s)),g=d.indexOf(":");if(g!==-1){var E=ne.trim(d.slice(0,g)),h=ne.trim(d.slice(g+1));if(E){var y=t(o,u.length,E,h,d);y&&(u+=y+"; ")}}}o=s+1}for(;s<n;s++){var a=e[s];if(a==="/"&&e[s+1]==="*"){var f=e.indexOf("*/",s+2);if(f===-1)break;s=f+1,o=s+1,r=!1}else a==="("?r=!0:a===")"?r=!1:a===";"?r||l():a===`
7
+ `&&l()}return ne.trim(u)}var wr=vr,ce=J,Er=wr;function qe(e){return e==null}function br(e){var t={};for(var n in e)t[n]=e[n];return t}function ft(e){e=br(e||{}),e.whiteList=e.whiteList||ce.whiteList,e.onAttr=e.onAttr||ce.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||ce.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||ce.safeAttrValue,this.options=e}ft.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,r=n.whiteList,o=n.onAttr,s=n.onIgnoreAttr,u=n.safeAttrValue,l=Er(e,function(a,f,d,g,E){var h=r[d],y=!1;if(h===!0?y=h:typeof h=="function"?y=h(g):h instanceof RegExp&&(y=h.test(g)),y!==!0&&(y=!1),g=u(d,g),!!g){var _={position:f,sourcePosition:a,source:E,isWhite:y};if(y){var T=o(d,g,_);return qe(T)?d+":"+g:T}else{var T=s(d,g,_);if(!qe(T))return T}}});return l};var _r=ft;(function(e,t){var n=J,r=_r;function o(u,l){var a=new r(l);return a.process(u)}t=e.exports=o,t.FilterCSS=r;for(var s in n)t[s]=n[s];typeof window<"u"&&(window.filterCSS=e.exports)})(Se,Se.exports);var Pe=Se.exports,$e={indexOf:function(e,t){var n,r;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var r,o;if(Array.prototype.forEach)return e.forEach(t,n);for(r=0,o=e.length;r<o;r++)t.call(n,e[r],r,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/,n=t.exec(e);return n?n.index:-1}},Tr=Pe.FilterCSS,Cr=Pe.getDefaultWhiteList,we=$e;function dt(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var pt=new Tr;function Ar(e,t,n){}function kr(e,t,n){}function Sr(e,t,n){}function Ir(e,t,n){}function gt(e){return e.replace(Or,"&lt;").replace(Nr,"&gt;")}function Rr(e,t,n,r){if(n=Et(n),t==="href"||t==="src"){if(n=we.trim(n),n==="#")return"#";if(!(n.substr(0,7)==="http://"||n.substr(0,8)==="https://"||n.substr(0,7)==="mailto:"||n.substr(0,4)==="tel:"||n.substr(0,11)==="data:image/"||n.substr(0,6)==="ftp://"||n.substr(0,2)==="./"||n.substr(0,3)==="../"||n[0]==="#"||n[0]==="/"))return""}else if(t==="background"){if(ue.lastIndex=0,ue.test(n))return""}else if(t==="style"){if(ze.lastIndex=0,ze.test(n)||(Ge.lastIndex=0,Ge.test(n)&&(ue.lastIndex=0,ue.test(n))))return"";r!==!1&&(r=r||pt,n=r.process(n))}return n=bt(n),n}var Or=/</g,Nr=/>/g,Lr=/"/g,xr=/&quot;/g,Pr=/&#([a-zA-Z0-9]*);?/gim,$r=/&colon;?/gim,Fr=/&newline;?/gim,ue=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,ze=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,Ge=/u\s*r\s*l\s*\(.*/gi;function ht(e){return e.replace(Lr,"&quot;")}function mt(e){return e.replace(xr,'"')}function yt(e){return e.replace(Pr,function(n,r){return r[0]==="x"||r[0]==="X"?String.fromCharCode(parseInt(r.substr(1),16)):String.fromCharCode(parseInt(r,10))})}function vt(e){return e.replace($r,":").replace(Fr," ")}function wt(e){for(var t="",n=0,r=e.length;n<r;n++)t+=e.charCodeAt(n)<32?" ":e.charAt(n);return we.trim(t)}function Et(e){return e=mt(e),e=yt(e),e=vt(e),e=wt(e),e}function bt(e){return e=ht(e),e=gt(e),e}function Dr(){return""}function Br(e,t){typeof t!="function"&&(t=function(){});var n=!Array.isArray(e);function r(u){return n?!0:we.indexOf(e,u)!==-1}var o=[],s=!1;return{onIgnoreTag:function(u,l,a){if(r(u))if(a.isClosing){var f="[/removed]",d=a.position+f.length;return o.push([s!==!1?s:a.position,d]),s=!1,f}else return s||(s=a.position),"[removed]";else return t(u,l,a)},remove:function(u){var l="",a=0;return we.forEach(o,function(f){l+=u.slice(a,f[0]),a=f[1]}),l+=u.slice(a),l}}}function Vr(e){for(var t="",n=0;n<e.length;){var r=e.indexOf("<!--",n);if(r===-1){t+=e.slice(n);break}t+=e.slice(n,r);var o=e.indexOf("-->",r);if(o===-1)break;n=o+3}return t}function Mr(e){var t=e.split("");return t=t.filter(function(n){var r=n.charCodeAt(0);return r===127?!1:r<=31?r===10||r===13:!0}),t.join("")}A.whiteList=dt();A.getDefaultWhiteList=dt;A.onTag=Ar;A.onIgnoreTag=kr;A.onTagAttr=Sr;A.onIgnoreTagAttr=Ir;A.safeAttrValue=Rr;A.escapeHtml=gt;A.escapeQuote=ht;A.unescapeQuote=mt;A.escapeHtmlEntities=yt;A.escapeDangerHtml5Entities=vt;A.clearNonPrintableCharacter=wt;A.friendlyAttrValue=Et;A.escapeAttrValue=bt;A.onIgnoreTagStripAll=Dr;A.StripTagBody=Br;A.stripCommentTag=Vr;A.stripBlankChar=Mr;A.attributeWrapSign='"';A.cssFilter=pt;A.getDefaultCSSWhiteList=Cr;var _e={},q=$e;function Wr(e){var t=q.spaceIndex(e),n;return t===-1?n=e.slice(1,-1):n=e.slice(1,t+1),n=q.trim(n).toLowerCase(),n.slice(0,1)==="/"&&(n=n.slice(1)),n.slice(-1)==="/"&&(n=n.slice(0,-1)),n}function jr(e){return e.slice(0,2)==="</"}function Ur(e,t,n){var r="",o=0,s=!1,u=!1,l=0,a=e.length,f="",d="";e:for(l=0;l<a;l++){var g=e.charAt(l);if(s===!1){if(g==="<"){s=l;continue}}else if(u===!1){if(g==="<"){r+=n(e.slice(o,l)),s=l,o=l;continue}if(g===">"||l===a-1){r+=n(e.slice(o,s)),d=e.slice(s,l+1),f=Wr(d),r+=t(s,r.length,f,d,jr(d)),o=l+1,s=!1;continue}if(g==='"'||g==="'")for(var E=1,h=e.charAt(l-E);h.trim()===""||h==="=";){if(h==="="){u=g;continue e}h=e.charAt(l-++E)}}else if(g===u){u=!1;continue}}return o<a&&(r+=n(e.substr(o))),r}var qr=/[^a-zA-Z0-9\\_:.-]/gim;function zr(e,t){var n=0,r=0,o=[],s=!1,u=e.length;function l(E,h){if(E=q.trim(E),E=E.replace(qr,"").toLowerCase(),!(E.length<1)){var y=t(E,h||"");y&&o.push(y)}}for(var a=0;a<u;a++){var f=e.charAt(a),d,g;if(s===!1&&f==="="){s=e.slice(n,a),n=a+1,r=e.charAt(n)==='"'||e.charAt(n)==="'"?n:Hr(e,a+1);continue}if(s!==!1&&a===r){if(g=e.indexOf(f,a+1),g===-1)break;d=q.trim(e.slice(r+1,g)),l(s,d),s=!1,a=g,n=a+1;continue}if(/\s|\n|\t/.test(f))if(e=e.replace(/\s|\n|\t/g," "),s===!1)if(g=Gr(e,a),g===-1){d=q.trim(e.slice(n,a)),l(d),s=!1,n=a+1;continue}else{a=g-1;continue}else if(g=Xr(e,a-1),g===-1){d=q.trim(e.slice(n,a)),d=He(d),l(s,d),s=!1,n=a+1;continue}else continue}return n<e.length&&(s===!1?l(e.slice(n)):l(s,He(q.trim(e.slice(n))))),q.trim(o.join(" "))}function Gr(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Hr(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="'"||n==='"'?t:-1}}function Xr(e,t){for(;t>0;t--){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Jr(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function He(e){return Jr(e)?e.substr(1,e.length-2):e}_e.parseTag=Ur;_e.parseAttr=zr;var Yr=Pe.FilterCSS,$=A,_t=_e,Kr=_t.parseTag,Qr=_t.parseAttr,ge=$e;function fe(e){return e==null}function Zr(e){var t=ge.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=ge.trim(e.slice(t+1,-1));var n=e[e.length-1]==="/";return n&&(e=ge.trim(e.slice(0,-1))),{html:e,closing:n}}function ei(e){var t={};for(var n in e)t[n]=e[n];return t}function ti(e){var t={};for(var n in e)Array.isArray(e[n])?t[n.toLowerCase()]=e[n].map(function(r){return r.toLowerCase()}):t[n.toLowerCase()]=e[n];return t}function Tt(e){e=ei(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=$.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=ti(e.whiteList||e.allowList):e.whiteList=$.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":$.attributeWrapSign,e.onTag=e.onTag||$.onTag,e.onTagAttr=e.onTagAttr||$.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||$.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||$.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||$.safeAttrValue,e.escapeHtml=e.escapeHtml||$.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Yr(e.css))}Tt.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,r=n.whiteList,o=n.onTag,s=n.onIgnoreTag,u=n.onTagAttr,l=n.onIgnoreTagAttr,a=n.safeAttrValue,f=n.escapeHtml,d=t.attributeWrapSign,g=t.cssFilter;n.stripBlankChar&&(e=$.stripBlankChar(e)),n.allowCommentTag||(e=$.stripCommentTag(e));var E=!1;n.stripIgnoreTagBody&&(E=$.StripTagBody(n.stripIgnoreTagBody,s),s=E.onIgnoreTag);var h=Kr(e,function(y,_,T,c,m){var v={sourcePosition:y,position:_,isClosing:m,isWhite:Object.prototype.hasOwnProperty.call(r,T)},I=o(T,c,v);if(!fe(I))return I;if(v.isWhite){if(v.isClosing)return"</"+T+">";var R=Zr(c),V=r[T],p=Qr(R.html,function(w,b){var k=ge.indexOf(V,w)!==-1,O=u(T,w,b,k);return fe(O)?k?(b=a(T,w,b,g),b?w+"="+d+b+d:w):(O=l(T,w,b,k),fe(O)?void 0:O):O});return c="<"+T,p&&(c+=" "+p),R.closing&&(c+=" /"),c+=">",c}else return I=s(T,c,v),fe(I)?f(c):I},f);return E&&(h=E.remove(h)),h};var ni=Tt;(function(e,t){var n=A,r=_e,o=ni;function s(l,a){var f=new o(a);return f.process(l)}t=e.exports=s,t.filterXSS=s,t.FilterXSS=o,function(){for(var l in n)t[l]=n[l];for(var a in r)t[a]=r[a]}(),typeof window<"u"&&(window.filterXSS=e.exports);function u(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}u()&&(self.filterXSS=e.exports)})(ke,ke.exports);var ri=ke.exports;const ii=dr(ri);function oi(e){return e=e.replace(/\*\*([^*]+)\*\*/g,"<b>$1</b>"),e=e.replace(/\[icon:([^\]]+)]/g,"<widget-icon>$1</widget-icon>"),e=e.replace(/\[(.*)]\((.*)\)/g,'<router-link to = "$2">$1</router-link>'),ii(e)}function ai(){const e=i.ref(null);function t(n){e.value=n}return{activeRow:e,activateRow:t}}function si(e,t){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(t)}async function Ct(e,t){e()&&(await t(),await Ct(e,t))}function li(e,t,n={}){let r=!1;const o=i.ref(""),s=i.computed(()=>u.filter(p=>f(p,o.value))),u=i.reactive([]);let l=0;const a=i.ref(!1);let f=(n==null?void 0:n.filterSearchFn)||((p,w)=>si(p,w));function d(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function g(){const p=I();return typeof p.limit!="number"&&(p.limit=100),p.offset=l,(n.request||ve)(e,p).then(b=>(l+=b.length,b))}function E(p,w){var k;return typeof p.Version=="number"?p.Version:(k=u.find(O=>O.Id===w))==null?void 0:k.Version}function h(p,w){const b=u.findIndex(k=>k.Id===p);if(b===-1)throw new Error(`Can't found item with Id ${p}`);u.splice(b,1,w)}function y(p){const w=u.findIndex(b=>b.Id===p);if(w===-1)throw new Error(`Can't found item with Id ${p}`);u.splice(w,1)}async function _(p,w){try{const b=I(),k=E(w,p);delete w.Version,await xe(e,{id:p,values:w,version:k,masterEntities:d()});const O=await ve(e,{fields:b.fields||"",id:p});h(p,O)}catch(b){D()(b)}}async function T(p,w={}){try{const b=I(),k=E(w,p);delete w.Version,await st(e,{id:p,version:k,masterEntities:d()}),y(p)}catch(b){D()(b)}}async function c(p){try{await at(e,{values:p,masterEntities:d()}),await R()}catch(w){D()(w)}}let m;async function v(){a.value=!0;try{m!=null&&m.signal&&!m.signal.aborted&&m.abort();let p=m=new AbortController,w=0;const k=I().limit||0;if(o.value&&!k){console.warn("Using textSearch assumes the use of limit.");return}await Ct(()=>(k>0?w<k:!0)&&!r&&!p.signal.aborted,async()=>{const O=await g();p.signal.aborted||(u.push(...O),w+=O.filter(ae=>f(ae,o.value)).length,(O.length<k||k===0)&&(r=!0))})}catch(p){D()(p)}a.value=!1}function I(){return typeof t=="function"?t():t}async function R(){try{l=0,r=!1,u.splice(0,u.length),await v()}catch(p){D()(p)}}function V(){if(m)return m.abort();a.value=!1}return{array:u,updateById:_,next:v,reload:R,wait:a,create:c,deleteById:T,textSearch:o,filteredArray:s,abort:V}}function ci(){function e(){return{organizations:F.organizations,currentContextId:F.contextId,person:F.person,context:F.context,contextType:F.contextType,userId:F.userId}}const t=i.reactive(e());return F.onupdateContext(()=>{Object.assign(t,e())}),t}function ui(e,t,n){return N().emit("communication:create",{entityName:e,entityCatalogId:t,targetCode:n})}function fi(e,t,n){return N().emit("communication:read",{entityName:e,entityCatalogId:t,targetCode:n})}function di(e,t){return N().emit("communication-message:create",{communicationId:e,text:t})}function pi(e){return N().emit("communication-message:read",{communicationId:e})}function gi(e){const t=B.Form.getParentForm(),n=i.reactive([]);return t&&t.subscribe(e),e.read=()=>pi(e.id).then(r=>(n.splice(0,n.length,...r),r)),{array:n}}function hi(e,t){e.read=()=>{const r=n();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return ve(e.name,r)}).then(Fe).then(o=>(o.hasOwnProperty("Version")&&(e.version=o.Version),e.setValues(o),o)).catch(D())},e.save=()=>{const r=n();return Promise.resolve().then(()=>{if(!e.name)throw Q.EntityWithoutName(e);return xe(e.name,{id:r.id,values:e.changes,version:e.version})}).then(o=>{e.version=o.version}).catch(o=>{throw D()(o),o})};function n(){return typeof t=="function"?t():t}}function mi(e){if(!e)return i.inject(S.PROVIDE_NAME_METADATA);Ee.initEntity(e);const t=i.computed(()=>Ee.state[e]);return i.provide(S.PROVIDE_NAME_METADATA,t),t}function yi(e,t={}){if(!e)return i.inject(S.PROVIDE_NAME_USAGE_CONTEXT);const n=i.ref(null);return i.provide(S.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await Kn(e,vi(t||{}))}}}function vi(e){return typeof e=="function"?e():e}function wi(e){if(!e)return i.inject(S.PROVIDE_NAME_ACTIONS);const t=i.reactive([]),n=i.computed(()=>t.map(s=>ct(e,s))),r={actions:n,update:o};i.provide(S.PROVIDE_NAME_ACTIONS,r),e.router=Qe.useRouter();function o(s={}){return t.splice(0,t.length),lt(s).then(u=>t.splice(0,0,...u)).catch(D("error"))}return{actions:n,update:o}}function Ei(e){function t(n){n.key==="Enter"&&e()}i.onMounted(()=>{document.addEventListener("keypress",t)}),i.onUnmounted(()=>{document.removeEventListener("keypress",t)})}function bi(e,t={}){const n=i.reactive([]),r=a=>{const f=i.unref(e);if(a===void 0){n.length===0?f.forEach(s):f.forEach(u);return}o(a)?u(a):s(a)},o=a=>n.includes(a),s=a=>{t.handleSelect&&!t.handleSelect(a)||o(a)||n.push(a)},u=a=>{const f=n.findIndex(d=>d===a);f!==-1&&n.splice(f,1)},l=i.computed(()=>{const a=i.unref(e);return n.length===a.length&&a.length!==0});return[n,r,l,s,u]}function _i(e){const t=i.ref(""),n=i.computed(()=>{const r=t.value.toLowerCase();return i.unref(e).filter(o=>t.value.length?Object.values(o).join().toLowerCase().includes(r):!0)});return{search:t,searchArray:n}}const ie=new class{constructor(){this.store=i.reactive([])}add(t,n,r={}){const o=Ti(r),s=new Ci(t,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(t){const n=this.store.findIndex(r=>r.id===t);if(n===-1)return!1;this.store.splice(n,1)}};function Ti(e){function t(r){return!!r&&typeof r=="object"}const n={timeout:10,click:()=>null,children:[]};return t(e)?{timeout:e.timeout||n.timeout,click:e.click||n.click,children:e.children||n.children}:n}const At=class kt{constructor(t,n,r,o,s){this.type=t,this.message=n,this.timeout=r,this.children=o,this.click=s,this.id=kt.cardId++}};At.cardId=1;let Ci=At;/*!
7
8
  * jenesius-event-emitter v1.0.2
8
9
  * (c) 2022 Jenesius
9
10
  * @license MIT
10
- */const Re=function(t,e){return t in this.events||(this.events[t]=[]),this.events[t].push(e),this.off.bind(this,t,e)},Ne=function(t,e){t in this.events&&this.events[t].forEach(n=>n(e))},Oe=function(t,e){const n=this.events[t];if(!n)return;const r=n.indexOf(e);r!==-1&&n.splice(r,1)},Ie=function(){this.events={}};class W{constructor(){this.events={}}on(e,n){return Re.call(this,e,n)}emit(e,n){return Ne.call(this,e,n)}off(e,n){return Oe.call(this,e,n)}cleanEvents(){Ie.call(this)}static on(e,n){return Re.call(W,e,n)}static emit(e,n){return Ne.call(W,e,n)}static off(e,n){return Oe.call(W,e,n)}static cleanEvents(){Ie.call(W)}}W.events={};class Zn extends W{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return Vn(this.id,e)}static checkAndGenerate(e,n,r){return xn(e,n,r).then(i=>i.length===0?Dn(e,n,r):i[0])}}function Qn(){return k().emit("client:read",{})}var Je=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},er=(t,e,n)=>(Je(t,e,"read from private field"),n?n.call(t):e.get(t)),tr=(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)},nr=(t,e,n,r)=>(Je(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),se;const fe=class G extends W{constructor(){super(...arguments),this.type="front",this.organizations=[],tr(this,se,!1)}set language(e){localStorage.setItem(C.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(C.LOCALSTORAGE_LANGUAGE_KEY)||G.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){nr(this,se,e),this.emit(G.EVENT_READY_UPDATE,e)}get ready(){return er(this,se)}onReady(e){return this.on(G.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(G.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(G.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){F()(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 Qn()}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}}};se=new WeakMap;fe.DEFAULT_LANGUAGE="en";fe.EVENT_CONTEXT_UPDATE="event:context-update";fe.EVENT_READY_UPDATE="event:ready-update";let rr=fe;function or(t){return k().emit("metadata:read",{entity:t})}const ue=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 s=await a(l);d(l,s)}function a(l){const s=or(l).finally(()=>{n.delete(l)});return n.set(l,s),s}function d(l,s){e[l]=s}return{state:e,initEntity:i,get:r}}();class V{static login(e){return I(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 V.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return V.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return V.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return V.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,n){return I(`${x.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(e){return V.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return V.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return V.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,n){return I(`${x.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(V.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 I(`${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,i){return I(`${x.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 I(`${x.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 I(`${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 ir{static readHistoryById(e,n){return I(`/close-api/audits/history/${e}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class sr{static getConfiguration(){return I("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(e){return await I(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class ar{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return I(`/open-api/internationalization/language/${e}`)}}class cr{static async upload(e,n){const r=new FormData;return r.append("file",e),I(`/close-api/files?entityName=${n}`,{method:"POST",body:r}).then(i=>(i.filename=e.name,i))}}var Ye=(t=>(t.Add="A",t.Delete="D",t.Modify="M",t.None="N",t))(Ye||{}),Ke=(t=>(t.Approved="A",t.AwaitingFeedback="AF",t.AssignedForExam="AFE",t.Cancelled="C",t.Closed="CLS",t.Completed="CT",t.Draft="D",t.NotSatisfied="NSF",t.OnClarification="OC",t.Processing="P",t.Rejected="R",t.ReadyForExam="RFE",t.Submitted="S",t.SecurityCheck="SCK",t.Satisfied="SF",t.Withdrawn="W",t))(Ke||{});function lr(t){return typeof t!="object"||t===null?!1:!!(t.hasOwnProperty("start")||t.hasOwnProperty("end"))}function A(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];if(Array.isArray(r)){const i=r.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return r.length&&e.push(`@${n} in (${i})`),e}if(lr(r)){let i=function(a){var d;return((d=a.match(/([^Z]*)/))==null?void 0:d[0])+"0000Z"};return r.start&&e.push(`@${n} ge ${i(r.start)}`),r.end&&e.push(`@${n} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${n} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${n} eq '${r}'`),e):(r===null&&e.push(A.is(n,r)),e)},[]).join(" and ")}function ee(t){return typeof t=="string"?`'${t}'`:`${t}`}A.includes=function(e,n){return`@${e} Contains ${ee(n)}`};A.beginWith=function(e,n){return`@${e} BeginWith ${ee(n)}`};A.notEq=function(e,n){return`@${e} nq ${ee(n)}`};A.eq=function(e,n){return Array.isArray(n)?A.in(e,n):`@${e} eq ${ee(n)}`};A.in=function(e,n){const r=n.map(ee).join(", ");return`@${e} in (${r})`};A.notIn=function(e,n){return!Array.isArray(n)||n.length===0?"":A.and(...n.map(r=>A.notEq(e,r)))};A.and=function(...e){return e.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(A.wrap).join(" and ")};A.wrap=function(e){return`(${e})`};A.is=function(e,n){return`@${e} is ${n}`};A.or=function(...e){return e.join(" or ")};function we(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=we(r)),e[i]=r,e},{})}const $=new rr;exports.ApplicationStatus=Ke;exports.Communication=Zn;exports.CoreError=J;exports.Filter=A;exports.Manager=$;exports.MetadataStore=ue;exports.NotificationSystem=Q;exports.OBJECT_TYPE_NAME_FIELD=fn;exports.RecordOperation=Ye;exports.WidgetButton=Tt;exports.WidgetIcon=Z;exports.WidgetImage=Bt;exports.WidgetList=Yt;exports.WidgetLoader=$t;exports.WidgetMultiButton=It;exports.WidgetSpinner=de;exports.WidgetTable=_t;exports.asyncProcess=Xt;exports.authService=V;exports.billingService=H;exports.catchUniversal=F;exports.config=Kt;exports.configuration=x;exports.constants=C;exports.debounce=on;exports.documentsService=nt;exports.fileService=cr;exports.formatter=Y;exports.getCellName=Fe;exports.getCellValue=me;exports.getNamesFromListConfig=en;exports.getUnitValue=he;exports.groupArrayByField=tn;exports.historyService=ir;exports.injectAction=wn;exports.internationalizationService=ar;exports.invitationService=tt;exports.openService=sr;exports.parseError=ce;exports.prettyDate=Ee;exports.prettyDateWithTime=De;exports.prettyMoney=xe;exports.prettyValueFieldByEntity=cn;exports.processWizardService=ie;exports.request=I;exports.staticLink=bn;exports.t=K;exports.throttle=sn;exports.universalEntityCount=Cn;exports.universalEntityCreate=je;exports.universalEntityDelete=We;exports.universalEntityRead=le;exports.universalEntityUpdate=ve;exports.universalHistoryRead=_n;exports.universalListSettingRead=mn;exports.universalMetadataFieldTreat=yn;exports.universalMetadataListRead=vn;exports.universalToolRead=Ue;exports.useActions=Gn;exports.useCommunication=jn;exports.useEnter=Hn;exports.useFormEntity=Wn;exports.useListActiveRow=Pn;exports.useListEntity=Fn;exports.useListSearch=Yn;exports.useListSelect=Jn;exports.useManagerState=Bn;exports.useMetadata=Un;exports.useSocket=k;exports.useUsageContext=qn;exports.useWizard=st;exports.uuidv4=nn;exports.valuesToUpperCase=we;exports.wrapToolResponse=qe;
11
+ */const Xe=function(e,t){return e in this.events||(this.events[e]=[]),this.events[e].push(t),this.off.bind(this,e,t)},Je=function(e,t){e in this.events&&this.events[e].forEach(n=>n(t))},Ye=function(e,t){const n=this.events[e];if(!n)return;const r=n.indexOf(t);r!==-1&&n.splice(r,1)},Ke=function(){this.events={}};class z{constructor(){this.events={}}on(t,n){return Xe.call(this,t,n)}emit(t,n){return Je.call(this,t,n)}off(t,n){return Ye.call(this,t,n)}cleanEvents(){Ke.call(this)}static on(t,n){return Xe.call(z,t,n)}static emit(t,n){return Je.call(z,t,n)}static off(t,n){return Ye.call(z,t,n)}static cleanEvents(){Ke.call(z)}}z.events={};class Ai extends z{constructor(t){super(),this.name="Communication",this.read=()=>{},this.id=t}sendMessage(t){return di(this.id,t)}static checkAndGenerate(t,n,r){return fi(t,n,r).then(o=>o.length===0?ui(t,n,r):o[0])}}function ki(){return N().emit("client:read",{})}var St=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Si=(e,t,n)=>(St(e,t,"read from private field"),n?n.call(e):t.get(e)),Ii=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ri=(e,t,n,r)=>(St(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),he;const Te=class Y extends z{constructor(){super(...arguments),this.type="front",this.organizations=[],Ii(this,he,!1)}set language(t){localStorage.setItem(S.LOCALSTORAGE_LANGUAGE_KEY,t)}get language(){return localStorage.getItem(S.LOCALSTORAGE_LANGUAGE_KEY)||Y.DEFAULT_LANGUAGE}get contextType(){var t;if(this.contextId)return((t=this.person)==null?void 0:t.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(t){Ri(this,he,t),this.emit(Y.EVENT_READY_UPDATE,t)}get ready(){return Si(this,he)}onReady(t){return this.on(Y.EVENT_READY_UPDATE,t)}onupdateContext(t){return this.on(Y.EVENT_CONTEXT_UPDATE,t)}setCurrentContext(t){if(this.contextId===t)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(t),localStorage.setItem(S.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(t)),this.emit(Y.EVENT_CONTEXT_UPDATE,t),console.log(`Current context id %c${t}`,"color: purple")}get context(){var t;return this.contextId?this.contextId===((t=this.person)==null?void 0:t.id)?this.person:this.organizations.find(n=>n.id===this.contextId)||null:null}async init(){try{const t=await this.loadCustomerData();this.person=t,this.organizations=t.organizations,this.userId=t.userId,this.restoreCurrentContext(),this.ready=!0}catch(t){D()(t)}}restoreCurrentContext(){const t=Number.parseInt(localStorage.getItem(S.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(t)&&this.validateContextId(Number(t)))this.setCurrentContext(t);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return ki()}validateContextId(t){var n;try{return((n=this.person)==null?void 0:n.id)==t?!0:!!this.organizations.find(r=>r.id===t)}catch{return!1}}};he=new WeakMap;Te.DEFAULT_LANGUAGE="en";Te.EVENT_CONTEXT_UPDATE="event:context-update";Te.EVENT_READY_UPDATE="event:ready-update";let Oi=Te;function Ni(e){return N().emit("metadata:read",{entity:e})}const Ee=function(){const t=i.reactive({}),n=new Map;function r(l){return t[l]}async function o(l){if(n.has(l)&&await n.get(l),t[l])return;const a=await s(l);u(l,a)}function s(l){const a=Ni(l).finally(()=>{n.delete(l)});return n.set(l,a),a}function u(l,a){t[l]=a}return{state:t,initEntity:o,get:r}}();class j{static login(t){return x(W.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...t,AppName:W.applicationName})})}static parseProcessAnswer(t){if(t.statusCode>4)throw new Error(t.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return t}static startRegistrationProcess(t){return j.requestStepRegistrationProcess("StartRegistration",t)}static confirmPhoneRegistrationProcess(t){return j.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",t)}static confirmEmailRegistrationProcess(t){return j.requestStepRegistrationProcess("ConfirmEmailByRegistration",t)}static finishEmailRegistrationProcess(t){return j.requestStepRegistrationProcess("FinishRegistration",t)}static requestStepRegistrationProcess(t,n){return x(`${W.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(t){return j.requestStepLoginProcess("StartLogin",t)}static loginWithPassword(t){return j.requestStepLoginProcess("LoginWithPassword",t)}static loginWithOtpCode(t){return j.requestStepLoginProcess("LoginWithOtpCode",t)}static requestStepLoginProcess(t,n){return x(`${W.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(j.parseLoginProcessAnswer)}static parseLoginProcessAnswer(t){if(t.statusCode>3)throw Error(t.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return t}static startPasswordReset(t,n){return x(`${W.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:n,AppName:t})})}static confirmPhoneNumberByAccessRecovery(t,n,r,o){return x(`${W.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:r,Code:o})})}static confirmEmailByAccessRecovery(t,n,r,o){return x(`${W.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:r,Code:o})})}static finishAccessRecovery(t,n,r){return x(`${W.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Password:r,ConfirmedPassword:r})})}}class Li{static readHistoryById(t,n){return x(`/close-api/audits/history/${t}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class xi{static getConfiguration(){return x("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(t){return await x(`/open-api/data/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Pi{static getDictionary(t){if(!t)throw new Error(`Can't get dictionary for ${t}.`);return x(`/open-api/internationalization/language/${t}`)}}class $i{static async upload(t,n){const r=new FormData;return r.append("file",t),x(`/close-api/files?entityName=${n}`,{method:"POST",body:r}).then(o=>(o.filename=t.name,o))}}var It=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(It||{}),Rt=(e=>(e.Approved="A",e.AwaitingFeedback="AF",e.AssignedForExam="AFE",e.Cancelled="C",e.Closed="CLS",e.Completed="CT",e.Draft="D",e.NotSatisfied="NSF",e.OnClarification="OC",e.Processing="P",e.Rejected="R",e.ReadyForExam="RFE",e.Submitted="S",e.SecurityCheck="SCK",e.Satisfied="SF",e.Withdrawn="W",e))(Rt||{});function Fi(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function L(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];if(Array.isArray(r)){const o=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&t.push(`@${n} in (${o})`),t}if(Fi(r)){let o=function(s){var u;return((u=s.match(/([^Z]*)/))==null?void 0:u[0])+"0000Z"};return r.start&&t.push(`@${n} ge ${o(r.start)}`),r.end&&t.push(`@${n} le ${o(r.end)}`),t}return typeof r=="number"?(t.push(`@${n} eq ${r}`),t):typeof r=="string"?(r.length!==0&&t.push(`@${n} eq '${r}'`),t):(r===null&&t.push(L.is(n,r)),t)},[]).join(" and ")}function oe(e){return typeof e=="string"?`'${e}'`:`${e}`}L.includes=function(t,n){return`@${t} Contains ${oe(n)}`};L.beginWith=function(t,n){return`@${t} BeginWith ${oe(n)}`};L.notEq=function(t,n){return`@${t} nq ${oe(n)}`};L.eq=function(t,n){return Array.isArray(n)?L.in(t,n):`@${t} eq ${oe(n)}`};L.in=function(t,n){const r=n.map(oe).join(", ");return`@${t} in (${r})`};L.notIn=function(t,n){return!Array.isArray(n)||n.length===0?"":L.and(...n.map(r=>L.notEq(t,r)))};L.and=function(...t){return t.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(L.wrap).join(" and ")};L.wrap=function(t){return`(${t})`};L.is=function(t,n){return`@${t} is ${n}`};L.or=function(...t){return t.join(" or ")};function Fe(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];const o=n.charAt(0).toUpperCase()+n.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Fe(r)),t[o]=r,t},{})}const F=new Oi;exports.ApplicationStatus=Rt;exports.Communication=Ai;exports.CoreError=Q;exports.Filter=L;exports.Manager=F;exports.MetadataStore=Ee;exports.NotificationSystem=ie;exports.OBJECT_TYPE_NAME_FIELD=zn;exports.RecordOperation=It;exports.WidgetButton=on;exports.WidgetIcon=re;exports.WidgetImage=mn;exports.WidgetList=Rn;exports.WidgetLoader=gn;exports.WidgetMultiButton=fn;exports.WidgetSpinner=be;exports.WidgetTable=en;exports.asyncProcess=Nn;exports.authService=j;exports.billingService=K;exports.catchUniversal=D;exports.config=On;exports.configuration=W;exports.constants=S;exports.debounce=Bn;exports.documentsService=$t;exports.fileService=$i;exports.formatter=Z;exports.getCellName=tt;exports.getCellValue=Re;exports.getNamesFromListConfig=Pn;exports.getUnitValue=Ae;exports.groupArrayByField=$n;exports.historyService=Li;exports.injectAction=Zn;exports.internationalizationService=Pi;exports.invitationService=Pt;exports.openService=xi;exports.parseError=ye;exports.parseTextByMarkdown=oi;exports.prettyDate=Le;exports.prettyDateWithTime=nt;exports.prettyMoney=rt;exports.prettyValueFieldByEntity=Wn;exports.processWizardService=pe;exports.request=x;exports.setupListRow=Ne;exports.staticLink=nr;exports.t=ee;exports.throttle=Vn;exports.universalEntityCount=tr;exports.universalEntityCreate=at;exports.universalEntityDelete=st;exports.universalEntityRead=ve;exports.universalEntityUpdate=xe;exports.universalHistoryRead=er;exports.universalListSettingRead=Jn;exports.universalMetadataFieldTreat=Yn;exports.universalMetadataListRead=Qn;exports.universalToolRead=lt;exports.useActions=wi;exports.useCommunication=gi;exports.useEnter=Ei;exports.useFormEntity=hi;exports.useListActiveRow=ai;exports.useListEntity=li;exports.useListSearch=_i;exports.useListSelect=bi;exports.useManagerState=ci;exports.useMetadata=mi;exports.useSocket=N;exports.useUsageContext=yi;exports.useWizard=Vt;exports.uuidv4=Fn;exports.valuesToUpperCase=Fe;exports.wrapToolResponse=ct;
11
12
  //# sourceMappingURL=eservices-core.cjs.js.map