codesaaz-core 0.0.84 → 0.0.85
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.
- package/dist/codesaaz.es.js +540 -535
- package/dist/codesaaz.umd.js +8 -8
- package/dist/index.css +1 -1
- package/package.json +1 -1
package/dist/codesaaz.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(we,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("vue-router"),require("primevue")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","primevue"],o):(we=typeof globalThis<"u"?globalThis:we||self,o(we.Codesaaz={},we.Vue,we.VueRouter,we.PrimeVue))})(this,function(we,o,mt,Sr){"use strict";var Cr=document.createElement("style");Cr.textContent=`.text-color-hint[data-v-
|
|
1
|
+
(function(we,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("vue-router"),require("primevue")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","primevue"],o):(we=typeof globalThis<"u"?globalThis:we||self,o(we.Codesaaz={},we.Vue,we.VueRouter,we.PrimeVue))})(this,function(we,o,mt,Sr){"use strict";var Cr=document.createElement("style");Cr.textContent=`.text-color-hint[data-v-d62083ae]{color:var( --text-color)}.p-message-wrapper{padding:.5rem}.showHideColor,.sorting-filter-section[data-v-a358808d]:hover,.linked-entity-section[data-v-412eec44]:hover{color:var(--primary-color)}.border-bottom-section[data-v-412eec44]{border-bottom:1px solid var(--surface-border)}.section-heading[data-v-12a444f4]:hover{color:var(--primary-color)}.custom-sidebar[data-v-12a444f4]{padding-left:8%;padding-top:14px;padding-bottom:14px;border-bottom-left-radius:5px;border-bottom-right-radius:5px;background:var(--surface-card);border-top:1px solid var(--surface-border);bottom:0;left:0;position:fixed;right:0;z-index:1111;transition-property:none;transition-duration:.3s;transform:translateY(0)}.custom-sidebar-content[data-v-12a444f4]{display:flex;align-items:center!important;justify-content:space-between;display:inline-flex;word-break:break-word;overflow:visible;flex-grow:1;width:100%}.custom-sidebar-button[data-v-12a444f4]{display:flex;flex-wrap:nowrap;flex-shrink:1}.custom-sidebar-text[data-v-12a444f4]{flex-shrink:100000;width:100%;overflow-x:auto;overflow-y:hidden;display:flex;flex-direction:column;white-space:normal;padding-left:10px}.column-item[data-v-12a444f4]{width:calc(33.33% - 10px);margin-bottom:20px}.tile-grid[data-v-bce4d0f0]{display:grid;grid-template-columns:repeat(3,1fr);gap:15px}.tile[data-v-f59ea2d9]:hover{background:var(--surface-hover)}.border-none[data-v-61921abb]{border:none!important}.tile-grid[data-v-01e06cbc]{display:grid;grid-template-columns:repeat(3,1fr);gap:15px}.record-list[data-v-01e06cbc]{color:var(--primary-color)}.record-head[data-v-01e06cbc]{color:var(--p-red-400)}.tile[data-v-31c3fe68]:hover{background:var(--surface-hover)}.error-message[data-v-31c3fe68]{background-color:#ffe4e4;border:1px solid red;padding:10px;margin-bottom:10px;text-align:center;border-radius:5px}.flex[data-v-c78e676f]{display:flex}.flex-col[data-v-c78e676f]{flex-direction:column}.flex-grow[data-v-c78e676f]{flex-grow:1}.gap-4[data-v-c78e676f]{gap:1rem}.gap-2[data-v-c78e676f]{gap:.5rem}.p-6[data-v-c78e676f]{padding:1.5rem}.bg-white[data-v-c78e676f]{background-color:#fff}.shadow-md[data-v-c78e676f]{box-shadow:0 4px 6px #0000001a}.rounded-lg[data-v-c78e676f]{border-radius:.5rem}.border[data-v-c78e676f]{border-width:1px}.border-gray-300[data-v-c78e676f]{border-color:#d1d5db}.font-bold[data-v-c78e676f]{font-weight:700}.text-gray-700[data-v-c78e676f]{color:#4a5568}.text-gray-600[data-v-c78e676f]{color:#718096}.tile[data-v-037944bc]:hover{background:var(--surface-hover)}.error-message[data-v-037944bc]{background-color:#ffe4e4;border:1px solid red;padding:10px;margin-bottom:10px;text-align:center;border-radius:5px}.flex[data-v-309b76fb]{display:flex}.flex-col[data-v-309b76fb]{flex-direction:column}.flex-grow[data-v-309b76fb]{flex-grow:1}.gap-4[data-v-309b76fb]{gap:1rem}.gap-2[data-v-309b76fb]{gap:.5rem}.p-6[data-v-309b76fb]{padding:1.5rem}.bg-white[data-v-309b76fb]{background-color:#fff}.shadow-md[data-v-309b76fb]{box-shadow:0 4px 6px #0000001a}.rounded-lg[data-v-309b76fb]{border-radius:.5rem}.border[data-v-309b76fb]{border-width:1px}.border-gray-300[data-v-309b76fb]{border-color:#d1d5db}.font-bold[data-v-309b76fb]{font-weight:700}.text-gray-700[data-v-309b76fb]{color:#4a5568}.text-gray-600[data-v-309b76fb]{color:#718096}@media (min-width: 400px) and (max-width: 520px){.responsive-box[data-v-309b76fb]{width:75%}}.tile[data-v-6a1d2c67]:hover{background:var(--surface-hover)}.error-message[data-v-6a1d2c67]{background-color:#ffe4e4;border:1px solid red;padding:10px;margin-bottom:10px;text-align:center;border-radius:5px}.no-scrollbar[data-v-6a1d2c67]::-webkit-scrollbar{display:none}.no-scrollbar[data-v-6a1d2c67]{-ms-overflow-style:none;scrollbar-width:none}
|
|
2
2
|
/*$vite$:1*/`,document.head.appendChild(Cr);/*!
|
|
3
3
|
* pinia v2.3.1
|
|
4
4
|
* (c) 2025 Eduardo San Martin Morote
|
|
@@ -8,25 +8,25 @@
|
|
|
8
8
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[Xr]=this[Xr]={accessors:{}}).accessors,a=this.prototype;function i(l){const s=cn(l);r[s]||(hc(a,l),r[s]=!0)}return R.isArray(t)?t.forEach(i):i(t),this}}_e.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),R.reduceDescriptors(_e.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),R.freezeMethods(_e);function _o(e,t){const n=this||sn,r=t||n,a=_e.from(r.headers);let i=r.data;return R.forEach(e,function(s){i=s.call(n,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function Jr(e){return!!(e&&e.__CANCEL__)}function Yt(e,t,n){ne.call(this,e??"canceled",ne.ERR_CANCELED,t,n),this.name="CanceledError"}R.inherits(Yt,ne,{__CANCEL__:!0});function Qr(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ne("Request failed with status code "+n.status,[ne.ERR_BAD_REQUEST,ne.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function bc(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function yc(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,i=0,l;return t=t!==void 0?t:1e3,function(d){const c=Date.now(),u=r[i];l||(l=c),n[a]=d,r[a]=c;let f=i,m=0;for(;f!==a;)m+=n[f++],f=f%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),c-l<t)return;const p=u&&c-u;return p?Math.round(m*1e3/p):void 0}}function kc(e,t){let n=0,r=1e3/t,a,i;const l=(c,u=Date.now())=>{n=u,a=null,i&&(clearTimeout(i),i=null),e.apply(null,c)};return[(...c)=>{const u=Date.now(),f=u-n;f>=r?l(c,u):(a=c,i||(i=setTimeout(()=>{i=null,l(a)},r-f)))},()=>a&&l(a)]}const Wn=(e,t,n=3)=>{let r=0;const a=yc(50,250);return kc(i=>{const l=i.loaded,s=i.lengthComputable?i.total:void 0,d=l-r,c=a(d),u=l<=s;r=l;const f={loaded:l,total:s,progress:s?l/s:void 0,bytes:d,rate:c||void 0,estimated:c&&s&&u?(s-l)/c:void 0,event:i,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(f)},n)},Zr=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ea=e=>(...t)=>R.asap(()=>e(...t)),wc=Pe.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Pe.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Pe.origin),Pe.navigator&&/(msie|trident)/i.test(Pe.navigator.userAgent)):()=>!0,vc=Pe.hasStandardBrowserEnv?{write(e,t,n,r,a,i){const l=[e+"="+encodeURIComponent(t)];R.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),R.isString(r)&&l.push("path="+r),R.isString(a)&&l.push("domain="+a),i===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function xc(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Sc(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ta(e,t){return e&&!xc(t)?Sc(e,t):t}const na=e=>e instanceof _e?{...e}:e;function Pt(e,t){t=t||{};const n={};function r(c,u,f,m){return R.isPlainObject(c)&&R.isPlainObject(u)?R.merge.call({caseless:m},c,u):R.isPlainObject(u)?R.merge({},u):R.isArray(u)?u.slice():u}function a(c,u,f,m){if(R.isUndefined(u)){if(!R.isUndefined(c))return r(void 0,c,f,m)}else return r(c,u,f,m)}function i(c,u){if(!R.isUndefined(u))return r(void 0,u)}function l(c,u){if(R.isUndefined(u)){if(!R.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function s(c,u,f){if(f in t)return r(c,u);if(f in e)return r(void 0,c)}const d={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:s,headers:(c,u,f)=>a(na(c),na(u),f,!0)};return R.forEach(Object.keys(Object.assign({},e,t)),function(u){const f=d[u]||a,m=f(e[u],t[u],u);R.isUndefined(m)&&f!==s||(n[u]=m)}),n}const oa=e=>{const t=Pt({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:i,headers:l,auth:s}=t;t.headers=l=_e.from(l),t.url=qr(ta(t.baseURL,t.url),e.params,e.paramsSerializer),s&&l.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let d;if(R.isFormData(n)){if(Pe.hasStandardBrowserEnv||Pe.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if((d=l.getContentType())!==!1){const[c,...u]=d?d.split(";").map(f=>f.trim()).filter(Boolean):[];l.setContentType([c||"multipart/form-data",...u].join("; "))}}if(Pe.hasStandardBrowserEnv&&(r&&R.isFunction(r)&&(r=r(t)),r||r!==!1&&wc(t.url))){const c=a&&i&&vc.read(i);c&&l.set(a,c)}return t},Cc=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const a=oa(e);let i=a.data;const l=_e.from(a.headers).normalize();let{responseType:s,onUploadProgress:d,onDownloadProgress:c}=a,u,f,m,p,g;function h(){p&&p(),g&&g(),a.cancelToken&&a.cancelToken.unsubscribe(u),a.signal&&a.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(a.method.toUpperCase(),a.url,!0),b.timeout=a.timeout;function y(){if(!b)return;const x=_e.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),N={data:!s||s==="text"||s==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:x,config:e,request:b};Qr(function(C){n(C),h()},function(C){r(C),h()},N),b=null}"onloadend"in b?b.onloadend=y:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(y)},b.onabort=function(){b&&(r(new ne("Request aborted",ne.ECONNABORTED,e,b)),b=null)},b.onerror=function(){r(new ne("Network Error",ne.ERR_NETWORK,e,b)),b=null},b.ontimeout=function(){let E=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const N=a.transitional||Gr;a.timeoutErrorMessage&&(E=a.timeoutErrorMessage),r(new ne(E,N.clarifyTimeoutError?ne.ETIMEDOUT:ne.ECONNABORTED,e,b)),b=null},i===void 0&&l.setContentType(null),"setRequestHeader"in b&&R.forEach(l.toJSON(),function(E,N){b.setRequestHeader(N,E)}),R.isUndefined(a.withCredentials)||(b.withCredentials=!!a.withCredentials),s&&s!=="json"&&(b.responseType=a.responseType),c&&([m,g]=Wn(c,!0),b.addEventListener("progress",m)),d&&b.upload&&([f,p]=Wn(d),b.upload.addEventListener("progress",f),b.upload.addEventListener("loadend",p)),(a.cancelToken||a.signal)&&(u=x=>{b&&(r(!x||x.type?new Yt(null,e,b):x),b.abort(),b=null)},a.cancelToken&&a.cancelToken.subscribe(u),a.signal&&(a.signal.aborted?u():a.signal.addEventListener("abort",u)));const v=bc(a.url);if(v&&Pe.protocols.indexOf(v)===-1){r(new ne("Unsupported protocol "+v+":",ne.ERR_BAD_REQUEST,e));return}b.send(i||null)})},Ec=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const i=function(c){if(!a){a=!0,s();const u=c instanceof Error?c:this.reason;r.abort(u instanceof ne?u:new Yt(u instanceof Error?u.message:u))}};let l=t&&setTimeout(()=>{l=null,i(new ne(`timeout ${t} of ms exceeded`,ne.ETIMEDOUT))},t);const s=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:d}=r;return d.unsubscribe=()=>R.asap(s),d}},Bc=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,a;for(;r<n;)a=r+t,yield e.slice(r,a),r=a},$c=async function*(e,t){for await(const n of Nc(e))yield*Bc(n,t)},Nc=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},ra=(e,t,n,r)=>{const a=$c(e,t);let i=0,l,s=d=>{l||(l=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:c,value:u}=await a.next();if(c){s(),d.close();return}let f=u.byteLength;if(n){let m=i+=f;n(m)}d.enqueue(new Uint8Array(u))}catch(c){throw s(c),c}},cancel(d){return s(d),a.return()}},{highWaterMark:2})},qn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",aa=qn&&typeof ReadableStream=="function",Oc=qn&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),ia=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Tc=aa&&ia(()=>{let e=!1;const t=new Request(Pe.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),la=64*1024,Ao=aa&&ia(()=>R.isReadableStream(new Response("").body)),Kn={stream:Ao&&(e=>e.body)};qn&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Kn[t]&&(Kn[t]=R.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ne(`Response type '${t}' is not supported`,ne.ERR_NOT_SUPPORT,r)})})})(new Response);const Vc=async e=>{if(e==null)return 0;if(R.isBlob(e))return e.size;if(R.isSpecCompliantForm(e))return(await new Request(Pe.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(R.isArrayBufferView(e)||R.isArrayBuffer(e))return e.byteLength;if(R.isURLSearchParams(e)&&(e=e+""),R.isString(e))return(await Oc(e)).byteLength},Ic=async(e,t)=>{const n=R.toFiniteNumber(e.getContentLength());return n??Vc(t)},Lo={http:Zs,xhr:Cc,fetch:qn&&(async e=>{let{url:t,method:n,data:r,signal:a,cancelToken:i,timeout:l,onDownloadProgress:s,onUploadProgress:d,responseType:c,headers:u,withCredentials:f="same-origin",fetchOptions:m}=oa(e);c=c?(c+"").toLowerCase():"text";let p=Ec([a,i&&i.toAbortSignal()],l),g;const h=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let b;try{if(d&&Tc&&n!=="get"&&n!=="head"&&(b=await Ic(u,r))!==0){let N=new Request(t,{method:"POST",body:r,duplex:"half"}),$;if(R.isFormData(r)&&($=N.headers.get("content-type"))&&u.setContentType($),N.body){const[C,k]=Zr(b,Wn(ea(d)));r=ra(N.body,la,C,k)}}R.isString(f)||(f=f?"include":"omit");const y="credentials"in Request.prototype;g=new Request(t,{...m,signal:p,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:y?f:void 0});let v=await fetch(g);const x=Ao&&(c==="stream"||c==="response");if(Ao&&(s||x&&h)){const N={};["status","statusText","headers"].forEach(w=>{N[w]=v[w]});const $=R.toFiniteNumber(v.headers.get("content-length")),[C,k]=s&&Zr($,Wn(ea(s),!0))||[];v=new Response(ra(v.body,la,C,()=>{k&&k(),h&&h()}),N)}c=c||"text";let E=await Kn[R.findKey(Kn,c)||"text"](v,e);return!x&&h&&h(),await new Promise((N,$)=>{Qr(N,$,{data:E,headers:_e.from(v.headers),status:v.status,statusText:v.statusText,config:e,request:g})})}catch(y){throw h&&h(),y&&y.name==="TypeError"&&/fetch/i.test(y.message)?Object.assign(new ne("Network Error",ne.ERR_NETWORK,e,g),{cause:y.cause||y}):ne.from(y,y&&y.code,e,g)}})};R.forEach(Lo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const sa=e=>`- ${e}`,Fc=e=>R.isFunction(e)||e===null||e===!1,ca={getAdapter:e=>{e=R.isArray(e)?e:[e];const{length:t}=e;let n,r;const a={};for(let i=0;i<t;i++){n=e[i];let l;if(r=n,!Fc(n)&&(r=Lo[(l=String(n)).toLowerCase()],r===void 0))throw new ne(`Unknown adapter '${l}'`);if(r)break;a[l||"#"+i]=r}if(!r){const i=Object.entries(a).map(([s,d])=>`adapter ${s} `+(d===!1?"is not supported by the environment":"is not available in the build"));let l=t?i.length>1?`since :
|
|
9
9
|
`+i.map(sa).join(`
|
|
10
10
|
`):" "+sa(i[0]):"as no adapter specified";throw new ne("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r},adapters:Lo};function zo(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Yt(null,e)}function da(e){return zo(e),e.headers=_e.from(e.headers),e.data=_o.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),ca.getAdapter(e.adapter||sn.adapter)(e).then(function(r){return zo(e),r.data=_o.call(e,e.transformResponse,r),r.headers=_e.from(r.headers),r},function(r){return Jr(r)||(zo(e),r&&r.response&&(r.response.data=_o.call(e,e.transformResponse,r.response),r.response.headers=_e.from(r.response.headers))),Promise.reject(r)})}const ua="1.7.9",Gn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Gn[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const fa={};Gn.transitional=function(t,n,r){function a(i,l){return"[Axios v"+ua+"] Transitional option '"+i+"'"+l+(r?". "+r:"")}return(i,l,s)=>{if(t===!1)throw new ne(a(l," has been removed"+(n?" in "+n:"")),ne.ERR_DEPRECATED);return n&&!fa[l]&&(fa[l]=!0,console.warn(a(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,l,s):!0}},Gn.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Pc(e,t,n){if(typeof e!="object")throw new ne("options must be an object",ne.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const i=r[a],l=t[i];if(l){const s=e[i],d=s===void 0||l(s,i,e);if(d!==!0)throw new ne("option "+i+" must be "+d,ne.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ne("Unknown option "+i,ne.ERR_BAD_OPTION)}}const Yn={assertOptions:Pc,validators:Gn},it=Yn.validators;class Rt{constructor(t){this.defaults=t,this.interceptors={request:new Kr,response:new Kr}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
11
|
-
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Pt(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:i}=n;r!==void 0&&Yn.assertOptions(r,{silentJSONParsing:it.transitional(it.boolean),forcedJSONParsing:it.transitional(it.boolean),clarifyTimeoutError:it.transitional(it.boolean)},!1),a!=null&&(R.isFunction(a)?n.paramsSerializer={serialize:a}:Yn.assertOptions(a,{encode:it.function,serialize:it.function},!0)),Yn.assertOptions(n,{baseUrl:it.spelling("baseURL"),withXsrfToken:it.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=i&&R.merge(i.common,i[n.method]);i&&R.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),n.headers=_e.concat(l,i);const s=[];let d=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(d=d&&h.synchronous,s.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let u,f=0,m;if(!d){const g=[da.bind(this),void 0];for(g.unshift.apply(g,s),g.push.apply(g,c),m=g.length,u=Promise.resolve(n);f<m;)u=u.then(g[f++],g[f++]);return u}m=s.length;let p=n;for(f=0;f<m;){const g=s[f++],h=s[f++];try{p=g(p)}catch(b){h.call(this,b);break}}try{u=da.call(this,p)}catch(g){return Promise.reject(g)}for(f=0,m=c.length;f<m;)u=u.then(c[f++],c[f++]);return u}getUri(t){t=Pt(this.defaults,t);const n=ta(t.baseURL,t.url);return qr(n,t.params,t.paramsSerializer)}}R.forEach(["delete","get","head","options"],function(t){Rt.prototype[t]=function(n,r){return this.request(Pt(r||{},{method:t,url:n,data:(r||{}).data}))}}),R.forEach(["post","put","patch"],function(t){function n(r){return function(i,l,s){return this.request(Pt(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:l}))}}Rt.prototype[t]=n(),Rt.prototype[t+"Form"]=n(!0)});class Mo{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(a=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](a);r._listeners=null}),this.promise.then=a=>{let i;const l=new Promise(s=>{r.subscribe(s),i=s}).then(a);return l.cancel=function(){r.unsubscribe(i)},l},t(function(i,l,s){r.reason||(r.reason=new Yt(i,l,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Mo(function(a){t=a}),cancel:t}}}function Rc(e){return function(n){return e.apply(null,n)}}function Dc(e){return R.isObject(e)&&e.isAxiosError===!0}const jo={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(jo).forEach(([e,t])=>{jo[t]=e});function ma(e){const t=new Rt(e),n=Tr(Rt.prototype.request,t);return R.extend(n,Rt.prototype,t,{allOwnKeys:!0}),R.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return ma(Pt(e,a))},n}const $e=ma(sn);$e.Axios=Rt,$e.CanceledError=Yt,$e.CancelToken=Mo,$e.isCancel=Jr,$e.VERSION=ua,$e.toFormData=Un,$e.AxiosError=ne,$e.Cancel=$e.CanceledError,$e.all=function(t){return Promise.all(t)},$e.spread=Rc,$e.isAxiosError=Dc,$e.mergeConfig=Pt,$e.AxiosHeaders=_e,$e.formToJSON=e=>Yr(R.isHTMLForm(e)?new FormData(e):e),$e.getAdapter=ca.getAdapter,$e.HttpStatusCode=jo,$e.default=$e;const _c=No("loading",{state:()=>({loading:!1}),actions:{setLoading(e){this.loading=e}}});function Ac(){const e=_c();return{onResponse(t){return e.setLoading(!1),["post","put","delete"].includes(t.config.method)&&console.log("🌐 Operation completed successfully"),t},onError(t){var r,a,i,l,s;e.setLoading(!1);const n=((a=(r=t.response)==null?void 0:r.data)==null?void 0:a.message)||t.message||"Unexpected error occurred";return console.error("🌐 API Error",{url:(i=t.config)==null?void 0:i.url,method:(l=t.config)==null?void 0:l.method,status:(s=t.response)==null?void 0:s.status,message:n}),Promise.reject(t)}}}function pa(e={}){return{"Content-Type":"application/json",...e}}function pt(){Oe();const e=Ac(),t=$e.create({headers:pa()});t.interceptors.response.use(d=>e.onResponse(d),d=>(e.onError(d),Promise.reject(d)));const n=()=>"",r=(d={})=>pa(d),a=(d={})=>({...d,requestSource:"web"}),i=d=>{const{data:c}=d;return c!=null&&c.response,c},l=d=>{if(d.response){const{status:c,data:u}=d.response;return{success:!1,status:c,message:(u==null?void 0:u.message)||"Something went wrong",data:u||null}}return Promise.reject(d)},s=async({url:d,method:c="get",payload:u=null,headers:f={}})=>{const m=d.startsWith("http")?d:n()+d,p=r(f),g=u?a(u):null;try{const h={url:m,method:c,headers:p,data:g},b=await t.request(h);return i(b)}catch(h){return l(h)}};return{get:(d,c={})=>s({url:d,method:"get",headers:c}),post:(d,c,u={})=>s({url:d,method:"post",payload:c,headers:u}),put:(d,c,u={})=>s({url:d,method:"put",payload:c,headers:u}),del:(d,c={},u={})=>s({url:d,method:"delete",payload:c,headers:u})}}function We(){const e=Oe(),{get:t,post:n,put:r,del:a}=pt(),i=()=>e.getAppId();return{getEntityRecords:async h=>{const b=i();return await t(`/api/app/v1/${b}/entity/${h}/record`)},searchEntityRecords:async(h,b)=>{const y=i();return await n(`/api/app/v1/${y}/entity/${h}/record/search`,b)},getRelatedEntityRecord:async(h,b)=>{const y=i();return await t(`/api/app/v1/${y}/entity/${h}/link/record/${b}?fetchRelatedEntities=true`)},saveRelatedEntityRecord:async(h,b,y)=>{const v=i();return await n(`/api/app/v1/${v}/entity/${h}/link/record/${b}`,y)},getRecord:async(h,b)=>{const y=i();return await t(`/api/app/v1/${y}/entity/${h}/record/${b}?fetchRelatedEntities=false`)},addRecord:async(h,b)=>{const y=i();return await n(`/api/app/v1/${y}/entity/${h}/record`,b)},updateRecord:async(h,b,y)=>{const v=i();return await r(`/api/app/v1/${v}/entity/${h}/record/${b}`,y)},deleteRecord:async(h,b)=>{const y=i();return await a(`/api/app/v1/${y}/entity/${h}/record/${b}`)},createSampleRecords:async(h,b)=>{const y=i();return await t(`/api/app/v1/${y}/entity/${h}/record/mock?recordCount=${b}`)}}}function Lc(e=""){const t=new We,n={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"};let r=o.ref({}),a=o.ref([]),i=o.ref([]),l=o.ref([]);const s=o.ref(""),d=o.ref(1),c=o.ref(25),u=o.ref(0),f=o.ref(0),m=o.ref(0),p=o.ref(!1),g=o.ref([]),h=o.ref(""),b=o.ref({}),y=async(I,D=!0)=>{p.value=!0;try{const P=await t.getEntityRecords(I);P&&P.response&&(r.value=P.response,a.value=P.response.result,l.value=E(P.response.entity.entityDefinition.columns),i.value=x(P.response.entity.entityDefinition.columns),f.value=P.response.totalRecords,B())}catch(P){console.error("Error fetching entity:",P.errorMessage)}finally{p.value=!1}},v=async(I=!0)=>{p.value=!0;try{const D={sortBy:[s.value],sortDirection:d.value===1?"ASC":"DESC",pageSize:c.value,currentPage:u.value,columnList:null,filter:g.value,fullTextSearch:h.value};Object.keys(D.filter).length===0&&(D.filter=[]);const P=await t.searchEntityRecords(e,D);P&&P.response&&(p.value=!1,r.value=P.response,a.value=P.response.result,f.value=P.response.totalRecords,m.value=u.value*c.value)}catch(D){console.error("Error fetching entity:",D.errorMessage)}finally{p.value=!1}},x=I=>I.filter(D=>D.fieldType!=="ENTITY").map(D=>({field:D.name,name:D.displayName?D.displayName:D.name,filterable:D.filterable,datatype:D.type,sortable:!0,displayFormatKey:D.displayFormatKey,displayFormat:D.displayFormat})),E=I=>I.filter(D=>!(D.fieldType&&D.fieldType==="ENTITY")),N=I=>{s.value=I.sortField,d.value=I.sortOrder,m.value=0,v()},$=I=>{c.value=I.rows,u.value=I.page,m.value=I.first,v()},C=()=>{v()},k=()=>{v()},w=I=>{if(I)switch(I.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},S=I=>{const D=i.value.find(P=>P.field===I);return D?D.datatype:null},B=()=>{for(let I=0;I<l.value.length;I++){const D=l.value[I];if(D.primaryKey&&D.primaryKey==!0){b.value=D,s.value=D.name;break}}};return{items:a,headers:i,first:m,totalRecords:f,pageSize:c,loading:p,sortBy:s,sortDirection:d,operatorMap:n,filterToSend:g,fullTextSearch:h,listingResponse:r,primarayKeyColumn:b,onFullTextSearch:k,getDatatypeByField:S,getColumnDatatype:w,onSort:N,onPage:$,onFilter:C,fetchEntityFilterData:v,fetchEntityByName:y}}const Ie=(e,t)=>{const n=e.__vccOpts||e;for(const[r,a]of t)n[r]=a;return n},zc={key:0,class:"field flex flex-col mb-3"},Mc=["for"],jc={key:0},Uc={key:0,class:"font-bold"},Hc={key:1,class:"font-bold text-color-hint"},Wc={key:1,class:"flex items-center mb-3"},qc={class:"ml-2"},Kc={key:0},Xn=Ie({__name:"EntityForm",props:o.mergeModels({column:Object,errors:Array},{modelValue:{},modelModifiers:{}}),emits:o.mergeModels(["input"],["update:modelValue"]),setup(e,{emit:t}){const n=o.useModel(e,"modelValue"),r=t,a=i=>{r("input",i.name)};if(e.column&&!e.column.fieldType&&!e.column.inputComponent){let i="";switch(e.column.type.toLowerCase()){case"text":i="INPUT_TEXT";break;case"int":i="INPUT_NUMBER";break;case"float":i="INPUT_FLOAT";break;case"boolean":i="INPUT_BOOLEAN";break;case"uuid":i="INPUT_UUID";break;case"date":i="INPUT_DATE";break;default:i="INPUT_STRING"}e.column.inputComponent=i}return(i,l)=>{var f,m,p,g,h;const s=o.resolveComponent("DatePicker"),d=o.resolveComponent("InputNumber"),c=o.resolveComponent("InputText"),u=o.resolveComponent("Checkbox");return o.openBlock(),o.createElementBlock(o.Fragment,null,[!e.column.fieldType&&e.column.inputComponent.toLowerCase()!="input_boolean"?(o.openBlock(),o.createElementBlock("div",zc,[o.createElementVNode("label",{class:"mb-1",for:e.column.name},[o.createTextVNode(o.toDisplayString(e.column.displayName||e.column.name)+" ",1),e.column.required?(o.openBlock(),o.createElementBlock("span",jc,"*")):o.createCommentVNode("",!0)],8,Mc),e.column.inputComponent.toLowerCase()=="input_date"?(o.openBlock(),o.createBlock(s,{key:0,modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=b=>n.value=b),id:e.column.name,name:e.column.name,onDateSelect:l[1]||(l[1]=b=>a(e.column)),invalid:((f=e.errors)==null?void 0:f.length)>0},null,8,["modelValue","id","name","invalid"])):e.column.inputComponent.toLowerCase()=="input_number"?(o.openBlock(),o.createBlock(d,{key:1,modelValue:n.value,"onUpdate:modelValue":l[2]||(l[2]=b=>n.value=b),id:e.column.name,name:e.column.name,allowEmpty:!0,format:!1,onInput:l[3]||(l[3]=b=>a(e.column)),invalid:((m=e.errors)==null?void 0:m.length)>0},null,8,["modelValue","id","name","invalid"])):e.column.type.toLowerCase()=="input_float"?(o.openBlock(),o.createBlock(d,{key:2,type:"decimal",minFractionDigits:1,id:e.column.name,allowEmpty:!0,format:!1,name:e.column.name,onInput:l[4]||(l[4]=b=>a(e.column)),invalid:((p=e.errors)==null?void 0:p.length)>0},null,8,["id","name","invalid"])):(o.openBlock(),o.createBlock(c,{key:3,modelValue:n.value,"onUpdate:modelValue":l[5]||(l[5]=b=>n.value=b),id:e.column.name,name:e.column.name,onInput:l[6]||(l[6]=b=>a(e.column)),invalid:((g=e.errors)==null?void 0:g.length)>0},null,8,["modelValue","id","name","invalid"])),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.errors,(b,y)=>(o.openBlock(),o.createElementBlock("div",{key:y,class:"text-red-500 mt-1 ml-2"},[b.includes("hint:")?(o.openBlock(),o.createElementBlock("small",Hc,o.toDisplayString(b.split(":")[1]),1)):(o.openBlock(),o.createElementBlock("small",Uc,o.toDisplayString(b),1))]))),128))])):o.createCommentVNode("",!0),!e.column.fieldType&&e.column.inputComponent.toLowerCase()=="input_boolean"?(o.openBlock(),o.createElementBlock("div",Wc,[o.createVNode(u,{modelValue:n.value,"onUpdate:modelValue":l[7]||(l[7]=b=>n.value=b),invalid:((h=e.errors)==null?void 0:h.length)>0,onInput:l[8]||(l[8]=b=>a(e.column.name)),binary:""},null,8,["modelValue","invalid"]),o.createElementVNode("label",qc,[o.createTextVNode(o.toDisplayString(e.column.displayName||e.column.name)+" ",1),e.column.required?(o.openBlock(),o.createElementBlock("span",Kc,"*")):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-ef200394"]]);/**
|
|
11
|
+
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Pt(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:i}=n;r!==void 0&&Yn.assertOptions(r,{silentJSONParsing:it.transitional(it.boolean),forcedJSONParsing:it.transitional(it.boolean),clarifyTimeoutError:it.transitional(it.boolean)},!1),a!=null&&(R.isFunction(a)?n.paramsSerializer={serialize:a}:Yn.assertOptions(a,{encode:it.function,serialize:it.function},!0)),Yn.assertOptions(n,{baseUrl:it.spelling("baseURL"),withXsrfToken:it.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=i&&R.merge(i.common,i[n.method]);i&&R.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),n.headers=_e.concat(l,i);const s=[];let d=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(d=d&&h.synchronous,s.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let u,f=0,m;if(!d){const g=[da.bind(this),void 0];for(g.unshift.apply(g,s),g.push.apply(g,c),m=g.length,u=Promise.resolve(n);f<m;)u=u.then(g[f++],g[f++]);return u}m=s.length;let p=n;for(f=0;f<m;){const g=s[f++],h=s[f++];try{p=g(p)}catch(b){h.call(this,b);break}}try{u=da.call(this,p)}catch(g){return Promise.reject(g)}for(f=0,m=c.length;f<m;)u=u.then(c[f++],c[f++]);return u}getUri(t){t=Pt(this.defaults,t);const n=ta(t.baseURL,t.url);return qr(n,t.params,t.paramsSerializer)}}R.forEach(["delete","get","head","options"],function(t){Rt.prototype[t]=function(n,r){return this.request(Pt(r||{},{method:t,url:n,data:(r||{}).data}))}}),R.forEach(["post","put","patch"],function(t){function n(r){return function(i,l,s){return this.request(Pt(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:l}))}}Rt.prototype[t]=n(),Rt.prototype[t+"Form"]=n(!0)});class Mo{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(a=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](a);r._listeners=null}),this.promise.then=a=>{let i;const l=new Promise(s=>{r.subscribe(s),i=s}).then(a);return l.cancel=function(){r.unsubscribe(i)},l},t(function(i,l,s){r.reason||(r.reason=new Yt(i,l,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Mo(function(a){t=a}),cancel:t}}}function Rc(e){return function(n){return e.apply(null,n)}}function Dc(e){return R.isObject(e)&&e.isAxiosError===!0}const jo={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(jo).forEach(([e,t])=>{jo[t]=e});function ma(e){const t=new Rt(e),n=Tr(Rt.prototype.request,t);return R.extend(n,Rt.prototype,t,{allOwnKeys:!0}),R.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return ma(Pt(e,a))},n}const $e=ma(sn);$e.Axios=Rt,$e.CanceledError=Yt,$e.CancelToken=Mo,$e.isCancel=Jr,$e.VERSION=ua,$e.toFormData=Un,$e.AxiosError=ne,$e.Cancel=$e.CanceledError,$e.all=function(t){return Promise.all(t)},$e.spread=Rc,$e.isAxiosError=Dc,$e.mergeConfig=Pt,$e.AxiosHeaders=_e,$e.formToJSON=e=>Yr(R.isHTMLForm(e)?new FormData(e):e),$e.getAdapter=ca.getAdapter,$e.HttpStatusCode=jo,$e.default=$e;const _c=No("loading",{state:()=>({loading:!1}),actions:{setLoading(e){this.loading=e}}});function Ac(){const e=_c();return{onResponse(t){return e.setLoading(!1),["post","put","delete"].includes(t.config.method)&&console.log("🌐 Operation completed successfully"),t},onError(t){var r,a,i,l,s;e.setLoading(!1);const n=((a=(r=t.response)==null?void 0:r.data)==null?void 0:a.message)||t.message||"Unexpected error occurred";return console.error("🌐 API Error",{url:(i=t.config)==null?void 0:i.url,method:(l=t.config)==null?void 0:l.method,status:(s=t.response)==null?void 0:s.status,message:n}),Promise.reject(t)}}}function pa(e={}){return{"Content-Type":"application/json",...e}}function pt(){Oe();const e=Ac(),t=$e.create({headers:pa()});t.interceptors.response.use(d=>e.onResponse(d),d=>(e.onError(d),Promise.reject(d)));const n=()=>"",r=(d={})=>pa(d),a=(d={})=>({...d,requestSource:"web"}),i=d=>{const{data:c}=d;return c!=null&&c.response,c},l=d=>{if(d.response){const{status:c,data:u}=d.response;return{success:!1,status:c,message:(u==null?void 0:u.message)||"Something went wrong",data:u||null}}return Promise.reject(d)},s=async({url:d,method:c="get",payload:u=null,headers:f={}})=>{const m=d.startsWith("http")?d:n()+d,p=r(f),g=u?a(u):null;try{const h={url:m,method:c,headers:p,data:g},b=await t.request(h);return i(b)}catch(h){return l(h)}};return{get:(d,c={})=>s({url:d,method:"get",headers:c}),post:(d,c,u={})=>s({url:d,method:"post",payload:c,headers:u}),put:(d,c,u={})=>s({url:d,method:"put",payload:c,headers:u}),del:(d,c={},u={})=>s({url:d,method:"delete",payload:c,headers:u})}}function We(){const e=Oe(),{get:t,post:n,put:r,del:a}=pt(),i=()=>e.getAppId();return{getEntityRecords:async h=>{const b=i();return await t(`/api/app/v1/${b}/entity/${h}/record`)},searchEntityRecords:async(h,b)=>{const y=i();return await n(`/api/app/v1/${y}/entity/${h}/record/search`,b)},getRelatedEntityRecord:async(h,b)=>{const y=i();return await t(`/api/app/v1/${y}/entity/${h}/link/record/${b}?fetchRelatedEntities=true`)},saveRelatedEntityRecord:async(h,b,y)=>{const v=i();return await n(`/api/app/v1/${v}/entity/${h}/link/record/${b}`,y)},getRecord:async(h,b)=>{const y=i();return await t(`/api/app/v1/${y}/entity/${h}/record/${b}?fetchRelatedEntities=false`)},addRecord:async(h,b)=>{const y=i();return await n(`/api/app/v1/${y}/entity/${h}/record`,b)},updateRecord:async(h,b,y)=>{const v=i();return await r(`/api/app/v1/${v}/entity/${h}/record/${b}`,y)},deleteRecord:async(h,b)=>{const y=i();return await a(`/api/app/v1/${y}/entity/${h}/record/${b}`)},createSampleRecords:async(h,b)=>{const y=i();return await t(`/api/app/v1/${y}/entity/${h}/record/mock?recordCount=${b}`)}}}function Lc(e=""){const t=new We,n={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"};let r=o.ref({}),a=o.ref([]),i=o.ref([]),l=o.ref([]);const s=o.ref(""),d=o.ref(1),c=o.ref(25),u=o.ref(0),f=o.ref(0),m=o.ref(0),p=o.ref(!1),g=o.ref([]),h=o.ref(""),b=o.ref({}),y=async(I,D=!0)=>{p.value=!0;try{const P=await t.getEntityRecords(I);P&&P.response&&(r.value=P.response,a.value=P.response.result,l.value=E(P.response.entity.entityDefinition.columns),i.value=x(P.response.entity.entityDefinition.columns),f.value=P.response.totalRecords,B())}catch(P){console.error("Error fetching entity:",P.errorMessage)}finally{p.value=!1}},v=async(I=!0)=>{p.value=!0;try{const D={sortBy:[s.value],sortDirection:d.value===1?"ASC":"DESC",pageSize:c.value,currentPage:u.value,columnList:null,filter:g.value,fullTextSearch:h.value};Object.keys(D.filter).length===0&&(D.filter=[]);const P=await t.searchEntityRecords(e,D);P&&P.response&&(p.value=!1,r.value=P.response,a.value=P.response.result,f.value=P.response.totalRecords,m.value=u.value*c.value)}catch(D){console.error("Error fetching entity:",D.errorMessage)}finally{p.value=!1}},x=I=>I.filter(D=>D.fieldType!=="ENTITY").map(D=>({field:D.name,name:D.displayName?D.displayName:D.name,filterable:D.filterable,datatype:D.type,sortable:!0,displayFormatKey:D.displayFormatKey,displayFormat:D.displayFormat})),E=I=>I.filter(D=>!(D.fieldType&&D.fieldType==="ENTITY")),N=I=>{s.value=I.sortField,d.value=I.sortOrder,m.value=0,v()},$=I=>{c.value=I.rows,u.value=I.page,m.value=I.first,v()},C=()=>{v()},k=()=>{v()},w=I=>{if(I)switch(I.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},S=I=>{const D=i.value.find(P=>P.field===I);return D?D.datatype:null},B=()=>{for(let I=0;I<l.value.length;I++){const D=l.value[I];if(D.primaryKey&&D.primaryKey==!0){b.value=D,s.value=D.name;break}}};return{items:a,headers:i,first:m,totalRecords:f,pageSize:c,loading:p,sortBy:s,sortDirection:d,operatorMap:n,filterToSend:g,fullTextSearch:h,listingResponse:r,primarayKeyColumn:b,onFullTextSearch:k,getDatatypeByField:S,getColumnDatatype:w,onSort:N,onPage:$,onFilter:C,fetchEntityFilterData:v,fetchEntityByName:y}}const Ie=(e,t)=>{const n=e.__vccOpts||e;for(const[r,a]of t)n[r]=a;return n},zc={key:0,class:"field flex flex-col mb-3"},Mc=["for"],jc={key:0},Uc={key:0,class:"font-bold"},Hc={key:1,class:"font-bold text-color-hint"},Wc={key:1,class:"flex items-center mb-3"},qc={class:"ml-2"},Kc={key:0},Xn=Ie({__name:"EntityForm",props:o.mergeModels({column:Object,errors:Array},{modelValue:{},modelModifiers:{}}),emits:o.mergeModels(["input"],["update:modelValue"]),setup(e,{emit:t}){const n=o.useModel(e,"modelValue"),r=t,a=i=>{r("input",i.name)};if(e.column&&!e.column.fieldType&&!e.column.inputComponent){let i="";switch(e.column.type.toLowerCase()){case"text":i="INPUT_TEXT";break;case"int":i="INPUT_NUMBER";break;case"float":i="INPUT_FLOAT";break;case"boolean":i="INPUT_BOOLEAN";break;case"uuid":i="INPUT_UUID";break;case"date":i="INPUT_CALENDAR";break;default:i="INPUT_STRING"}e.column.inputComponent=i}return(i,l)=>{var f,m,p,g,h;const s=o.resolveComponent("DatePicker"),d=o.resolveComponent("InputNumber"),c=o.resolveComponent("InputText"),u=o.resolveComponent("Checkbox");return o.openBlock(),o.createElementBlock(o.Fragment,null,[!e.column.fieldType&&e.column.inputComponent.toLowerCase()!="input_boolean"?(o.openBlock(),o.createElementBlock("div",zc,[o.createElementVNode("label",{class:"mb-1",for:e.column.name},[o.createTextVNode(o.toDisplayString(e.column.displayName||e.column.name)+" ",1),e.column.required?(o.openBlock(),o.createElementBlock("span",jc,"*")):o.createCommentVNode("",!0)],8,Mc),e.column.inputComponent.toLowerCase()=="input_calendar"?(o.openBlock(),o.createBlock(s,{key:0,modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=b=>n.value=b),id:e.column.name,name:e.column.name,onDateSelect:l[1]||(l[1]=b=>a(e.column)),invalid:((f=e.errors)==null?void 0:f.length)>0},null,8,["modelValue","id","name","invalid"])):e.column.inputComponent.toLowerCase()=="input_number"?(o.openBlock(),o.createBlock(d,{key:1,modelValue:n.value,"onUpdate:modelValue":l[2]||(l[2]=b=>n.value=b),id:e.column.name,name:e.column.name,allowEmpty:!0,format:!1,onInput:l[3]||(l[3]=b=>a(e.column)),invalid:((m=e.errors)==null?void 0:m.length)>0},null,8,["modelValue","id","name","invalid"])):e.column.type.toLowerCase()=="input_float"?(o.openBlock(),o.createBlock(d,{key:2,type:"decimal",minFractionDigits:1,id:e.column.name,allowEmpty:!0,format:!1,name:e.column.name,onInput:l[4]||(l[4]=b=>a(e.column)),invalid:((p=e.errors)==null?void 0:p.length)>0},null,8,["id","name","invalid"])):(o.openBlock(),o.createBlock(c,{key:3,modelValue:n.value,"onUpdate:modelValue":l[5]||(l[5]=b=>n.value=b),id:e.column.name,name:e.column.name,onInput:l[6]||(l[6]=b=>a(e.column)),invalid:((g=e.errors)==null?void 0:g.length)>0},null,8,["modelValue","id","name","invalid"])),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.errors,(b,y)=>(o.openBlock(),o.createElementBlock("div",{key:y,class:"text-red-500 mt-1 ml-2"},[b.includes("hint:")?(o.openBlock(),o.createElementBlock("small",Hc,o.toDisplayString(b.split(":")[1]),1)):(o.openBlock(),o.createElementBlock("small",Uc,o.toDisplayString(b),1))]))),128))])):o.createCommentVNode("",!0),!e.column.fieldType&&e.column.inputComponent.toLowerCase()=="input_boolean"?(o.openBlock(),o.createElementBlock("div",Wc,[o.createVNode(u,{modelValue:n.value,"onUpdate:modelValue":l[7]||(l[7]=b=>n.value=b),invalid:((h=e.errors)==null?void 0:h.length)>0,onInput:l[8]||(l[8]=b=>a(e.column.name)),binary:""},null,8,["modelValue","invalid"]),o.createElementVNode("label",qc,[o.createTextVNode(o.toDisplayString(e.column.displayName||e.column.name)+" ",1),e.column.required?(o.openBlock(),o.createElementBlock("span",Kc,"*")):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-d62083ae"]]);/**
|
|
12
12
|
* vee-validate v4.15.0
|
|
13
13
|
* (c) 2024 Abdelrahman Awad
|
|
14
14
|
* @license MIT
|
|
15
|
-
*/function et(e){return typeof e=="function"}function ga(e){return e==null}const Xt=e=>e!==null&&!!e&&typeof e=="object"&&!Array.isArray(e);function Uo(e){return Number(e)>=0}function Gc(e){return typeof e=="object"&&e!==null}function Yc(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}function ha(e){if(!Gc(e)||Yc(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function dn(e,t){return Object.keys(t).forEach(n=>{if(ha(t[n])&&ha(e[n])){e[n]||(e[n]={}),dn(e[n],t[n]);return}e[n]=t[n]}),e}function Jn(e){const t=e.split(".");if(!t.length)return"";let n=String(t[0]);for(let r=1;r<t.length;r++){if(Uo(t[r])){n+=`[${t[r]}]`;continue}n+=`.${t[r]}`}return n}const Xc={};function Jc(e){return Xc[e]}function ba(e,t,n){typeof n.value=="object"&&(n.value=ke(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function ke(e){if(typeof e!="object")return e;var t=0,n,r,a,i=Object.prototype.toString.call(e);if(i==="[object Object]"?a=Object.create(e.__proto__||null):i==="[object Array]"?a=Array(e.length):i==="[object Set]"?(a=new Set,e.forEach(function(l){a.add(ke(l))})):i==="[object Map]"?(a=new Map,e.forEach(function(l,s){a.set(ke(s),ke(l))})):i==="[object Date]"?a=new Date(+e):i==="[object RegExp]"?a=new RegExp(e.source,e.flags):i==="[object DataView]"?a=new e.constructor(ke(e.buffer)):i==="[object ArrayBuffer]"?a=e.slice(0):i.slice(-6)==="Array]"&&(a=new e.constructor(e)),a){for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)ba(a,r[t],Object.getOwnPropertyDescriptor(e,r[t]));for(t=0,r=Object.getOwnPropertyNames(e);t<r.length;t++)Object.hasOwnProperty.call(a,n=r[t])&&a[n]===e[n]||ba(a,n,Object.getOwnPropertyDescriptor(e,n))}return a||e}const Qc=Symbol("vee-validate-form"),Zc=Symbol("vee-validate-form-context"),ed=typeof window<"u";function td(e){return et(e)&&!!e.__locatorRef}function Ct(e){return!!e&&et(e.parse)&&e.__type==="VVTypedSchema"}function ya(e){return!!e&&et(e.validate)}function nd(e){return e==="checkbox"||e==="radio"}function od(e){return Xt(e)||Array.isArray(e)}function rd(e){return Array.isArray(e)?e.length===0:Xt(e)&&Object.keys(e).length===0}function Qn(e){return/^\[.+\]$/i.test(e)}function ad(e){return ka(e)&&e.multiple}function ka(e){return e.tagName==="SELECT"}function id(e){return wa(e)&&e.target&&"submit"in e.target}function wa(e){return e?!!(typeof Event<"u"&&et(Event)&&e instanceof Event||e&&e.srcElement):!1}function un(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,a;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!un(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;for(r of e.entries())if(!un(r[1],t.get(r[0])))return!1;return!0}if(xa(e)&&xa(t))return!(e.size!==t.size||e.name!==t.name||e.lastModified!==t.lastModified||e.type!==t.type);if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(a=Object.keys(e),n=a.length-va(e,a),n!==Object.keys(t).length-va(t,Object.keys(t)))return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){var i=a[r];if(!un(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function va(e,t){let n=0;for(let a=t.length;a--!==0;){var r=t[a];e[r]===void 0&&n++}return n}function xa(e){return ed?e instanceof File:!1}function Ho(e){return Qn(e)?e.replace(/\[|\]/gi,""):e}function gt(e,t,n){return e?Qn(t)?e[Ho(t)]:(t||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((a,i)=>od(a)&&i in a?a[i]:n,e):n}function ht(e,t,n){if(Qn(t)){e[Ho(t)]=n;return}const r=t.split(/\.|\[(\d+)\]/).filter(Boolean);let a=e;for(let i=0;i<r.length;i++){if(i===r.length-1){a[r[i]]=n;return}(!(r[i]in a)||ga(a[r[i]]))&&(a[r[i]]=Uo(r[i+1])?[]:{}),a=a[r[i]]}}function Wo(e,t){if(Array.isArray(e)&&Uo(t)){e.splice(Number(t),1);return}Xt(e)&&delete e[t]}function Sa(e,t){if(Qn(t)){delete e[Ho(t)];return}const n=t.split(/\.|\[(\d+)\]/).filter(Boolean);let r=e;for(let i=0;i<n.length;i++){if(i===n.length-1){Wo(r,n[i]);break}if(!(n[i]in r)||ga(r[n[i]]))break;r=r[n[i]]}const a=n.map((i,l)=>gt(e,n.slice(0,l).join(".")));for(let i=a.length-1;i>=0;i--)if(rd(a[i])){if(i===0){Wo(e,n[0]);continue}Wo(a[i-1],n[i-1])}}function qe(e){return Object.keys(e)}function Ca(e,t=0){let n=null,r=[];return function(...a){return n&&clearTimeout(n),n=setTimeout(()=>{const i=e(...a);r.forEach(l=>l(i)),r=[]},t),new Promise(i=>r.push(i))}}function ld(e,t){let n;return async function(...a){const i=e(...a);n=i;const l=await i;return i!==n?l:(n=void 0,t(l,a))}}function Ea(e){return Array.isArray(e)?e:e?[e]:[]}function Zn(e,t){const n={};for(const r in e)t.includes(r)||(n[r]=e[r]);return n}function sd(e){let t=null,n=[];return function(...r){const a=o.nextTick(()=>{if(t!==a)return;const i=e(...r);n.forEach(l=>l(i)),n=[],t=null});return t=a,new Promise(i=>n.push(i))}}function qo(e){if(Ba(e))return e._value}function Ba(e){return"_value"in e}function cd(e){return e.type==="number"||e.type==="range"?Number.isNaN(e.valueAsNumber)?e.value:e.valueAsNumber:e.value}function $a(e){if(!wa(e))return e;const t=e.target;if(nd(t.type)&&Ba(t))return qo(t);if(t.type==="file"&&t.files){const n=Array.from(t.files);return t.multiple?n:n[0]}if(ad(t))return Array.from(t.options).filter(n=>n.selected&&!n.disabled).map(qo);if(ka(t)){const n=Array.from(t.options).find(r=>r.selected);return n?qo(n):t.value}return cd(t)}function dd(e){const t={};return Object.defineProperty(t,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),e?Xt(e)&&e._$$isNormalized?e:Xt(e)?Object.keys(e).reduce((n,r)=>{const a=ud(e[r]);return e[r]!==!1&&(n[r]=Na(a)),n},t):typeof e!="string"?t:e.split("|").reduce((n,r)=>{const a=fd(r);return a.name&&(n[a.name]=Na(a.params)),n},t):t}function ud(e){return e===!0?[]:Array.isArray(e)||Xt(e)?e:[e]}function Na(e){const t=n=>typeof n=="string"&&n[0]==="@"?md(n.slice(1)):n;return Array.isArray(e)?e.map(t):e instanceof RegExp?[e]:Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{})}const fd=e=>{let t=[];const n=e.split(":")[0];return e.includes(":")&&(t=e.split(":").slice(1).join(":").split(",")),{name:n,params:t}};function md(e){const t=n=>{var r;return(r=gt(n,e))!==null&&r!==void 0?r:n[e]};return t.__locatorRef=e,t}let pd=Object.assign({},{generateMessage:({field:e})=>`${e} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const fn=()=>pd;async function gd(e,t,n={}){const r=n==null?void 0:n.bails,a={name:(n==null?void 0:n.name)||"{field}",rules:t,label:n==null?void 0:n.label,bails:r??!0,formData:(n==null?void 0:n.values)||{}},i=await hd(a,e);return Object.assign(Object.assign({},i),{valid:!i.errors.length})}async function hd(e,t){const n=e.rules;if(Ct(n)||ya(n))return yd(t,Object.assign(Object.assign({},e),{rules:n}));if(et(n)||Array.isArray(n)){const s={field:e.label||e.name,name:e.name,label:e.label,form:e.formData,value:t},d=Array.isArray(n)?n:[n],c=d.length,u=[];for(let f=0;f<c;f++){const m=d[f],p=await m(t,s);if(!(typeof p!="string"&&!Array.isArray(p)&&p)){if(Array.isArray(p))u.push(...p);else{const h=typeof p=="string"?p:Ta(s);u.push(h)}if(e.bails)return{errors:u}}}return{errors:u}}const r=Object.assign(Object.assign({},e),{rules:dd(n)}),a=[],i=Object.keys(r.rules),l=i.length;for(let s=0;s<l;s++){const d=i[s],c=await kd(r,t,{name:d,params:r.rules[d]});if(c.error&&(a.push(c.error),e.bails))return{errors:a}}return{errors:a}}function bd(e){return!!e&&e.name==="ValidationError"}function Oa(e){return{__type:"VVTypedSchema",async parse(n,r){var a;try{return{output:await e.validate(n,{abortEarly:!1,context:(r==null?void 0:r.formData)||{}}),errors:[]}}catch(i){if(!bd(i))throw i;if(!(!((a=i.inner)===null||a===void 0)&&a.length)&&i.errors.length)return{errors:[{path:i.path,errors:i.errors}]};const l=i.inner.reduce((s,d)=>{const c=d.path||"";return s[c]||(s[c]={errors:[],path:c}),s[c].errors.push(...d.errors),s},{});return{errors:Object.values(l)}}}}}async function yd(e,t){const r=await(Ct(t.rules)?t.rules:Oa(t.rules)).parse(e,{formData:t.formData}),a=[];for(const i of r.errors)i.errors.length&&a.push(...i.errors);return{value:r.value,errors:a}}async function kd(e,t,n){const r=Jc(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const a=wd(n.params,e.formData),i={field:e.label||e.name,name:e.name,label:e.label,value:t,form:e.formData,rule:Object.assign(Object.assign({},n),{params:a})},l=await r(t,a,i);return typeof l=="string"?{error:l}:{error:l?void 0:Ta(i)}}function Ta(e){const t=fn().generateMessage;return t?t(e):"Field is invalid"}function wd(e,t){const n=r=>td(r)?r(t):r;return Array.isArray(e)?e.map(n):Object.keys(e).reduce((r,a)=>(r[a]=n(e[a]),r),{})}async function vd(e,t){const r=await(Ct(e)?e:Oa(e)).parse(ke(t),{formData:ke(t)}),a={},i={};for(const l of r.errors){const s=l.errors,d=(l.path||"").replace(/\["(\d+)"\]/g,(c,u)=>`[${u}]`);a[d]={valid:!s.length,errors:s},s.length&&(i[d]=s[0])}return{valid:!r.errors.length,results:a,errors:i,values:r.value,source:"schema"}}async function xd(e,t,n){const a=qe(e).map(async c=>{var u,f,m;const p=(u=n==null?void 0:n.names)===null||u===void 0?void 0:u[c],g=await gd(gt(t,c),e[c],{name:(p==null?void 0:p.name)||c,label:p==null?void 0:p.label,values:t,bails:(m=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[c])!==null&&m!==void 0?m:!0});return Object.assign(Object.assign({},g),{path:c})});let i=!0;const l=await Promise.all(a),s={},d={};for(const c of l)s[c.path]={valid:c.valid,errors:c.errors},c.valid||(i=!1,d[c.path]=c.errors[0]);return{valid:i,results:s,errors:d,source:"schema"}}let Sd=0;const eo=["bails","fieldsCount","id","multiple","type","validate"];function Va(e){const t={},n=Object.assign({},o.toValue(t)),r=o.unref(void 0);return r&&Ct(r)&&et(r.cast)?ke(r.cast(n)||{}):ke(n)}function Ia(e){var t;const n=Sd++,r="Form";let a=0;const i=o.ref(!1),l=o.ref(!1),s=o.ref(0),d=[],c=o.reactive(Va()),u=o.ref([]),f=o.ref({}),m=o.ref({}),p=sd(()=>{m.value=u.value.reduce((O,T)=>(O[Jn(o.toValue(T.path))]=T,O),{})});function g(O,T){const L=q(O);if(!L){typeof O=="string"&&(f.value[Jn(O)]=Ea(T));return}if(typeof O=="string"){const W=Jn(O);f.value[W]&&delete f.value[W]}L.errors=Ea(T),L.valid=!L.errors.length}function h(O){qe(O).forEach(T=>{g(T,O[T])})}const b=o.computed(()=>{const O=u.value.reduce((T,L)=>(L.errors.length&&(T[o.toValue(L.path)]=L.errors),T),{});return Object.assign(Object.assign({},f.value),O)}),y=o.computed(()=>qe(b.value).reduce((O,T)=>{const L=b.value[T];return L!=null&&L.length&&(O[T]=L[0]),O},{})),v=o.computed(()=>u.value.reduce((O,T)=>(O[o.toValue(T.path)]={name:o.toValue(T.path)||"",label:T.label||""},O),{})),x=o.computed(()=>u.value.reduce((O,T)=>{var L;return O[o.toValue(T.path)]=(L=T.bails)!==null&&L!==void 0?L:!0,O},{})),E=Object.assign({},{}),N=(t=void 0)!==null&&t!==void 0?t:!1,{initialValues:$,originalInitialValues:C,setInitialValues:k}=Ed(u,c),w=Cd(u,c,C,y),S=o.computed(()=>u.value.reduce((O,T)=>{const L=gt(c,o.toValue(T.path));return ht(O,o.toValue(T.path),L),O},{})),B=void 0;function I(O,T){var L,W;const ee=o.computed(()=>gt($.value,o.toValue(O))),oe=m.value[o.toValue(O)],X=(T==null?void 0:T.type)==="checkbox"||(T==null?void 0:T.type)==="radio";if(oe&&X){oe.multiple=!0;const Se=a++;return Array.isArray(oe.id)?oe.id.push(Se):oe.id=[oe.id,Se],oe.fieldsCount++,oe.__flags.pendingUnmount[Se]=!1,oe}const A=o.computed(()=>gt(c,o.toValue(O))),U=o.toValue(O),G=V.findIndex(Se=>Se===U);G!==-1&&V.splice(G,1);const K=o.computed(()=>{var Se,Fe,Dn,_n;const An=o.toValue(B);if(Ct(An))return(Fe=(Se=An.describe)===null||Se===void 0?void 0:Se.call(An,o.toValue(O)).required)!==null&&Fe!==void 0?Fe:!1;const xr=o.toValue(T==null?void 0:T.schema);return Ct(xr)&&(_n=(Dn=xr.describe)===null||Dn===void 0?void 0:Dn.call(xr).required)!==null&&_n!==void 0?_n:!1}),te=a++,ye=o.reactive({id:te,path:O,touched:!1,pending:!1,valid:!0,validated:!!(!((L=E[U])===null||L===void 0)&&L.length),required:K,initialValue:ee,errors:o.shallowRef([]),bails:(W=T==null?void 0:T.bails)!==null&&W!==void 0?W:!1,label:T==null?void 0:T.label,type:(T==null?void 0:T.type)||"default",value:A,multiple:!1,__flags:{pendingUnmount:{[te]:!1},pendingReset:!1},fieldsCount:1,validate:T==null?void 0:T.validate,dirty:o.computed(()=>!un(o.unref(A),o.unref(ee)))});return u.value.push(ye),m.value[U]=ye,p(),y.value[U]&&!E[U]&&o.nextTick(()=>{Me(U,{mode:"silent"})}),o.isRef(O)&&o.watch(O,Se=>{p();const Fe=ke(A.value);m.value[Se]=ye,o.nextTick(()=>{ht(c,Se,Fe)})}),ye}const D=Ca(Qe,5),P=Ca(Qe,5),M=ld(async O=>await(O==="silent"?D():P()),(O,[T])=>{const L=qe(ce.errorBag.value),ee=[...new Set([...qe(O.results),...u.value.map(oe=>oe.path),...L])].sort().reduce((oe,X)=>{var A;const U=X,G=q(U)||F(U),K=((A=O.results[U])===null||A===void 0?void 0:A.errors)||[],te=o.toValue(G==null?void 0:G.path)||U,ye=Bd({errors:K,valid:!K.length},oe.results[te]);return oe.results[te]=ye,ye.valid||(oe.errors[te]=ye.errors[0]),G&&f.value[te]&&delete f.value[te],G?(G.valid=ye.valid,T==="silent"||T==="validated-only"&&!G.validated||g(G,ye.errors),oe):(g(te,K),oe)},{valid:O.valid,results:{},errors:{},source:O.source});return O.values&&(ee.values=O.values,ee.source=O.source),qe(ee.results).forEach(oe=>{var X;const A=q(oe);A&&T!=="silent"&&(T==="validated-only"&&!A.validated||g(A,(X=ee.results[oe])===null||X===void 0?void 0:X.errors))}),ee});function j(O){u.value.forEach(O)}function q(O){const T=typeof O=="string"?Jn(O):O;return typeof T=="string"?m.value[T]:T}function F(O){return u.value.filter(L=>O.startsWith(o.toValue(L.path))).reduce((L,W)=>L?W.path.length>L.path.length?W:L:W,void 0)}let V=[],_;function J(O){return V.push(O),_||(_=o.nextTick(()=>{[...V].sort().reverse().forEach(L=>{Sa(c,L)}),V=[],_=null})),_}function re(O){return function(L,W){return function(oe){return oe instanceof Event&&(oe.preventDefault(),oe.stopPropagation()),j(X=>X.touched=!0),i.value=!0,s.value++,Ee().then(X=>{const A=ke(c);if(X.valid&&typeof L=="function"){const U=ke(S.value);let G=O?U:A;return X.values&&(G=X.source==="schema"?X.values:Object.assign({},G,X.values)),L(G,{evt:oe,controlledValues:U,setErrors:h,setFieldError:g,setTouched:ge,setFieldTouched:Je,setValues:Re,setFieldValue:xe,resetForm:he,resetField:me})}!X.valid&&typeof W=="function"&&W({values:A,evt:oe,errors:X.errors,results:X.results})}).then(X=>(i.value=!1,X),X=>{throw i.value=!1,X})}}}const Y=re(!1);Y.withControlled=re(!0);function Q(O,T){const L=u.value.findIndex(ee=>ee.path===O&&(Array.isArray(ee.id)?ee.id.includes(T):ee.id===T)),W=u.value[L];if(!(L===-1||!W)){if(o.nextTick(()=>{Me(O,{mode:"silent",warn:!1})}),W.multiple&&W.fieldsCount&&W.fieldsCount--,Array.isArray(W.id)){const ee=W.id.indexOf(T);ee>=0&&W.id.splice(ee,1),delete W.__flags.pendingUnmount[T]}(!W.multiple||W.fieldsCount<=0)&&(u.value.splice(L,1),ft(O),p(),delete m.value[O])}}function le(O){qe(m.value).forEach(T=>{T.startsWith(O)&&delete m.value[T]}),u.value=u.value.filter(T=>!T.path.startsWith(O)),o.nextTick(()=>{p()})}const ce={name:r,formId:n,values:c,controlledValues:S,errorBag:b,errors:y,schema:B,submitCount:s,meta:w,isSubmitting:i,isValidating:l,fieldArrays:d,keepValuesOnUnmount:N,validateSchema:o.unref(B)?M:void 0,validate:Ee,setFieldError:g,validateField:Me,setFieldValue:xe,setValues:Re,setErrors:h,setFieldTouched:Je,setTouched:ge,resetForm:he,resetField:me,handleSubmit:Y,useFieldModel:qt,defineInputBinds:Z,defineComponentBinds:at,defineField:It,stageInitialValue:Ve,unsetInitialValue:ft,setFieldInitialValue:je,createPathState:I,getPathState:q,unsetPathValue:J,removePathState:Q,initialValues:$,getAllPathStates:()=>u.value,destroyPath:le,isFieldTouched:H,isFieldDirty:z,isFieldValid:fe};function xe(O,T,L=!0){const W=ke(T),ee=typeof O=="string"?O:O.path;q(ee)||I(ee),ht(c,ee,W),L&&Me(ee)}function He(O,T=!0){qe(c).forEach(L=>{delete c[L]}),qe(O).forEach(L=>{xe(L,O[L],!1)}),T&&Ee()}function Re(O,T=!0){dn(c,O),d.forEach(L=>L&&L.reset()),T&&Ee()}function rt(O,T){const L=q(o.toValue(O))||I(O);return o.computed({get(){return L.value},set(W){var ee;const oe=o.toValue(O);xe(oe,W,(ee=o.toValue(T))!==null&&ee!==void 0?ee:!1)}})}function Je(O,T){const L=q(O);L&&(L.touched=T)}function H(O){const T=q(O);return T?T.touched:u.value.filter(L=>L.path.startsWith(O)).some(L=>L.touched)}function z(O){const T=q(O);return T?T.dirty:u.value.filter(L=>L.path.startsWith(O)).some(L=>L.dirty)}function fe(O){const T=q(O);return T?T.valid:u.value.filter(L=>L.path.startsWith(O)).every(L=>L.valid)}function ge(O){if(typeof O=="boolean"){j(T=>{T.touched=O});return}qe(O).forEach(T=>{Je(T,!!O[T])})}function me(O,T){var L;const W=T&&"value"in T?T.value:gt($.value,O),ee=q(O);ee&&(ee.__flags.pendingReset=!0),je(O,ke(W),!0),xe(O,W,!1),Je(O,(L=T==null?void 0:T.touched)!==null&&L!==void 0?L:!1),g(O,(T==null?void 0:T.errors)||[]),o.nextTick(()=>{ee&&(ee.__flags.pendingReset=!1)})}function he(O,T){let L=ke(O!=null&&O.values?O.values:C.value);L=T!=null&&T.force?L:dn(C.value,L),L=Ct(B)&&et(B.cast)?B.cast(L):L,k(L,{force:T==null?void 0:T.force}),j(W=>{var ee;W.__flags.pendingReset=!0,W.validated=!1,W.touched=((ee=O==null?void 0:O.touched)===null||ee===void 0?void 0:ee[o.toValue(W.path)])||!1,xe(o.toValue(W.path),gt(L,o.toValue(W.path)),!1),g(o.toValue(W.path),void 0)}),T!=null&&T.force?He(L,!1):Re(L,!1),h((O==null?void 0:O.errors)||{}),s.value=(O==null?void 0:O.submitCount)||0,o.nextTick(()=>{Ee({mode:"silent"}),j(W=>{W.__flags.pendingReset=!1})})}async function Ee(O){const T=(O==null?void 0:O.mode)||"force";if(T==="force"&&j(X=>X.validated=!0),ce.validateSchema)return ce.validateSchema(T);l.value=!0;const L=await Promise.all(u.value.map(X=>X.validate?X.validate(O).then(A=>({key:o.toValue(X.path),valid:A.valid,errors:A.errors,value:A.value})):Promise.resolve({key:o.toValue(X.path),valid:!0,errors:[],value:void 0})));l.value=!1;const W={},ee={},oe={};for(const X of L)W[X.key]={valid:X.valid,errors:X.errors},X.value&&ht(oe,X.key,X.value),X.errors.length&&(ee[X.key]=X.errors[0]);return{valid:L.every(X=>X.valid),results:W,errors:ee,values:oe,source:"fields"}}async function Me(O,T){var L;const W=q(O);return W&&(T==null?void 0:T.mode)!=="silent"&&(W.validated=!0),W!=null&&W.validate?W.validate(T):(!W&&(L=T==null?void 0:T.warn),Promise.resolve({errors:[],valid:!0}))}function ft(O){Sa($.value,O)}function Ve(O,T,L=!1){je(O,T),ht(c,O,T),L&&ht(C.value,O,ke(T))}function je(O,T,L=!1){ht($.value,O,ke(T)),L&&ht(C.value,O,ke(T))}async function Qe(){const O=o.unref(B);if(!O)return{valid:!0,results:{},errors:{},source:"none"};l.value=!0;const T=ya(O)||Ct(O)?await vd(O,c):await xd(O,c,{names:v.value,bailsMap:x.value});return l.value=!1,T}const Vt=Y((O,{evt:T})=>{id(T)&&T.target.submit()});o.onMounted(()=>{ce.validateSchema&&ce.validateSchema("silent")}),o.isRef(B)&&o.watch(B,()=>{var O;(O=ce.validateSchema)===null||O===void 0||O.call(ce,"validated-only")}),o.provide(Qc,ce);function It(O,T){const L=et(T)||T==null?void 0:T.label,W=q(o.toValue(O))||I(O,{label:L}),ee=()=>et(T)?T(Zn(W,eo)):T||{};function oe(){var K;W.touched=!0,((K=ee().validateOnBlur)!==null&&K!==void 0?K:fn().validateOnBlur)&&Me(o.toValue(W.path))}function X(){var K;((K=ee().validateOnInput)!==null&&K!==void 0?K:fn().validateOnInput)&&o.nextTick(()=>{Me(o.toValue(W.path))})}function A(){var K;((K=ee().validateOnChange)!==null&&K!==void 0?K:fn().validateOnChange)&&o.nextTick(()=>{Me(o.toValue(W.path))})}const U=o.computed(()=>{const K={onChange:A,onInput:X,onBlur:oe};return et(T)?Object.assign(Object.assign({},K),T(Zn(W,eo)).props||{}):T!=null&&T.props?Object.assign(Object.assign({},K),T.props(Zn(W,eo))):K});return[rt(O,()=>{var K,te,ye;return(ye=(K=ee().validateOnModelUpdate)!==null&&K!==void 0?K:(te=fn())===null||te===void 0?void 0:te.validateOnModelUpdate)!==null&&ye!==void 0?ye:!0}),U]}function qt(O){return Array.isArray(O)?O.map(T=>rt(T,!0)):rt(O)}function Z(O,T){const[L,W]=It(O,T);function ee(){W.value.onBlur()}function oe(A){const U=$a(A);xe(o.toValue(O),U,!1),W.value.onInput()}function X(A){const U=$a(A);xe(o.toValue(O),U,!1),W.value.onChange()}return o.computed(()=>Object.assign(Object.assign({},W.value),{onBlur:ee,onInput:oe,onChange:X,value:L.value}))}function at(O,T){const[L,W]=It(O,T),ee=q(o.toValue(O));function oe(X){L.value=X}return o.computed(()=>{const X=et(T)?T(Zn(ee,eo)):T||{};return Object.assign({[X.model||"modelValue"]:L.value,[`onUpdate:${X.model||"modelValue"}`]:oe},W.value)})}const Be=Object.assign(Object.assign({},ce),{values:o.readonly(c),handleReset:()=>he(),submitForm:Vt});return o.provide(Zc,Be),Be}function Cd(e,t,n,r){const a={touched:"some",pending:"some",valid:"every"},i=o.computed(()=>!un(t,o.unref(n)));function l(){const d=e.value;return qe(a).reduce((c,u)=>{const f=a[u];return c[u]=d[f](m=>m[u]),c},{})}const s=o.reactive(l());return o.watchEffect(()=>{const d=l();s.touched=d.touched,s.valid=d.valid,s.pending=d.pending}),o.computed(()=>Object.assign(Object.assign({initialValues:o.unref(n)},s),{valid:s.valid&&!qe(r.value).length,dirty:i.value}))}function Ed(e,t,n){const r=Va(),a=o.ref(r),i=o.ref(ke(r));function l(s,d){d!=null&&d.force?(a.value=ke(s),i.value=ke(s)):(a.value=dn(ke(a.value)||{},ke(s)),i.value=dn(ke(i.value)||{},ke(s))),d!=null&&d.updateFields&&e.value.forEach(c=>{if(c.touched)return;const f=gt(a.value,o.toValue(c.path));ht(t,o.toValue(c.path),ke(f))})}return{initialValues:a,originalInitialValues:i,setInitialValues:l}}function Bd(e,t){return t?{valid:e.valid&&t.valid,errors:[...e.errors,...t.errors]}:e}function Fa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ko,Pa;function $d(){if(Pa)return Ko;Pa=1;function e(y){this._maxSize=y,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(y){return this._values[y]},e.prototype.set=function(y,v){return this._size>=this._maxSize&&this.clear(),y in this._values||this._size++,this._values[y]=v};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,r=/^\d/,a=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,i=/^\s*(['"]?)(.*?)(\1)\s*$/,l=512,s=new e(l),d=new e(l),c=new e(l);Ko={Cache:e,split:f,normalizePath:u,setter:function(y){var v=u(y);return d.get(y)||d.set(y,function(E,N){for(var $=0,C=v.length,k=E;$<C-1;){var w=v[$];if(w==="__proto__"||w==="constructor"||w==="prototype")return E;k=k[v[$++]]}k[v[$]]=N})},getter:function(y,v){var x=u(y);return c.get(y)||c.set(y,function(N){for(var $=0,C=x.length;$<C;)if(N!=null||!v)N=N[x[$++]];else return;return N})},join:function(y){return y.reduce(function(v,x){return v+(p(x)||n.test(x)?"["+x+"]":(v?".":"")+x)},"")},forEach:function(y,v,x){m(Array.isArray(y)?y:f(y),v,x)}};function u(y){return s.get(y)||s.set(y,f(y).map(function(v){return v.replace(i,"$2")}))}function f(y){return y.match(t)||[""]}function m(y,v,x){var E=y.length,N,$,C,k;for($=0;$<E;$++)N=y[$],N&&(b(N)&&(N='"'+N+'"'),k=p(N),C=!k&&/^\d+$/.test(N),v.call(x,N,k,C,$,y))}function p(y){return typeof y=="string"&&y&&["'",'"'].indexOf(y.charAt(0))!==-1}function g(y){return y.match(r)&&!y.match(n)}function h(y){return a.test(y)}function b(y){return!p(y)&&(g(y)||h(y))}return Ko}var Dt=$d(),Go,Ra;function Nd(){if(Ra)return Go;Ra=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=u=>u.match(e)||[],n=u=>u[0].toUpperCase()+u.slice(1),r=(u,f)=>t(u).join(f).toLowerCase(),a=u=>t(u).reduce((f,m)=>`${f}${f?m[0].toUpperCase()+m.slice(1).toLowerCase():m.toLowerCase()}`,"");return Go={words:t,upperFirst:n,camelCase:a,pascalCase:u=>n(a(u)),snakeCase:u=>r(u,"_"),kebabCase:u=>r(u,"-"),sentenceCase:u=>n(r(u," ")),titleCase:u=>t(u).map(n).join(" ")},Go}var Yo=Nd(),to={exports:{}},Da;function Od(){if(Da)return to.exports;Da=1,to.exports=function(a){return e(t(a),a)},to.exports.array=e;function e(a,i){var l=a.length,s=new Array(l),d={},c=l,u=n(i),f=r(a);for(i.forEach(function(p){if(!f.has(p[0])||!f.has(p[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});c--;)d[c]||m(a[c],c,new Set);return s;function m(p,g,h){if(h.has(p)){var b;try{b=", node was:"+JSON.stringify(p)}catch{b=""}throw new Error("Cyclic dependency"+b)}if(!f.has(p))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(p));if(!d[g]){d[g]=!0;var y=u.get(p)||new Set;if(y=Array.from(y),g=y.length){h.add(p);do{var v=y[--g];m(v,f.get(v),h)}while(g);h.delete(p)}s[--l]=p}}}function t(a){for(var i=new Set,l=0,s=a.length;l<s;l++){var d=a[l];i.add(d[0]),i.add(d[1])}return Array.from(i)}function n(a){for(var i=new Map,l=0,s=a.length;l<s;l++){var d=a[l];i.has(d[0])||i.set(d[0],new Set),i.has(d[1])||i.set(d[1],new Set),i.get(d[0]).add(d[1])}return i}function r(a){for(var i=new Map,l=0,s=a.length;l<s;l++)i.set(a[l],l);return i}return to.exports}var Td=Od();const Vd=Fa(Td),Id=Object.prototype.toString,Fd=Error.prototype.toString,Pd=RegExp.prototype.toString,Rd=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Dd=/^Symbol\((.*)\)(.*)$/;function _d(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function _a(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return _d(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return Rd.call(e).replace(Dd,"Symbol($1)");const r=Id.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+Fd.call(e)+"]":r==="RegExp"?Pd.call(e):null}function Et(e,t){let n=_a(e,t);return n!==null?n:JSON.stringify(e,function(r,a){let i=_a(this[r],t);return i!==null?i:a},2)}function Aa(e){return e==null?[]:[].concat(e)}let La,za,Ma,Ad=/\$\{\s*(\w+)\s*\}/g;La=Symbol.toStringTag;class ja{constructor(t,n,r,a){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[La]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=a,this.errors=[],this.inner=[],Aa(t).forEach(i=>{if(Ae.isError(i)){this.errors.push(...i.errors);const l=i.inner.length?i.inner:[i];this.inner.push(...l)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}za=Symbol.hasInstance,Ma=Symbol.toStringTag;class Ae extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(Ad,(a,i)=>Et(n[i])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,a,i){const l=new ja(t,n,r,a);if(i)return l;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Ma]="Error",this.name=l.name,this.message=l.message,this.type=l.type,this.value=l.value,this.path=l.path,this.errors=l.errors,this.inner=l.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Ae)}static[za](t){return ja[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let lt={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const a=r!=null&&r!==n?` (cast from the value \`${Et(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${Et(n,!0)}\``+a:`${e} must match the configured type. The validated value was: \`${Et(n,!0)}\``+a}},Le={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Ld={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Xo={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},zd={isValue:"${path} field must be ${value}"},no={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"};Object.assign(Object.create(null),{mixed:lt,string:Le,number:Ld,date:Xo,object:no,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:zd,tuple:{notType:e=>{const{path:t,value:n,spec:r}=e,a=r.types.length;if(Array.isArray(n)){if(n.length<a)return`${t} tuple value has too few items, expected a length of ${a} but got ${n.length} for value: \`${Et(n,!0)}\``;if(n.length>a)return`${t} tuple value has too many items, expected a length of ${a} but got ${n.length} for value: \`${Et(n,!0)}\``}return Ae.formatError(lt.notType,e)}}});const Jo=e=>e&&e.__isYupSchema__;class oo{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:a,otherwise:i}=n,l=typeof r=="function"?r:(...s)=>s.every(d=>d===r);return new oo(t,(s,d)=>{var c;let u=l(...s)?a:i;return(c=u==null?void 0:u(d))!=null?c:d})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(i=>i.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),a=this.fn(r,t,n);if(a===void 0||a===t)return t;if(!Jo(a))throw new TypeError("conditions must return a schema object");return a.resolve(n)}}const ro={context:"$",value:"."};class _t{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===ro.context,this.isValue=this.key[0]===ro.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?ro.context:this.isValue?ro.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Dt.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let a=this.isContext?r:this.isValue?t:n;return this.getter&&(a=this.getter(a||{})),this.map&&(a=this.map(a)),a}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}_t.prototype.__isYupRef=!0;const At=e=>e==null;function Jt(e){function t({value:n,path:r="",options:a,originalValue:i,schema:l},s,d){const{name:c,test:u,params:f,message:m,skipAbsent:p}=e;let{parent:g,context:h,abortEarly:b=l.spec.abortEarly,disableStackTrace:y=l.spec.disableStackTrace}=a;function v(B){return _t.isRef(B)?B.getValue(n,g,h):B}function x(B={}){const I=Object.assign({value:n,originalValue:i,label:l.spec.label,path:B.path||r,spec:l.spec,disableStackTrace:B.disableStackTrace||y},f,B.params);for(const P of Object.keys(I))I[P]=v(I[P]);const D=new Ae(Ae.formatError(B.message||m,I),n,I.path,B.type||c,I.disableStackTrace);return D.params=I,D}const E=b?s:d;let N={path:r,parent:g,type:c,from:a.from,createError:x,resolve:v,options:a,originalValue:i,schema:l};const $=B=>{Ae.isError(B)?E(B):B?d(null):E(x())},C=B=>{Ae.isError(B)?E(B):s(B)};if(p&&At(n))return $(!0);let w;try{var S;if(w=u.call(N,n,N),typeof((S=w)==null?void 0:S.then)=="function"){if(a.sync)throw new Error(`Validation test of type: "${N.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(w).then($,C)}}catch(B){C(B);return}$(w)}return t.OPTIONS=e,t}function Md(e,t,n,r=n){let a,i,l;return t?(Dt.forEach(t,(s,d,c)=>{let u=d?s.slice(1,s.length-1):s;e=e.resolve({context:r,parent:a,value:n});let f=e.type==="tuple",m=c?parseInt(u,10):0;if(e.innerType||f){if(f&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${l}" must contain an index to the tuple element, e.g. "${l}[0]"`);if(n&&m>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);a=n,n=n&&n[m],e=f?e.spec.types[m]:e.innerType}if(!c){if(!e.fields||!e.fields[u])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${l} which is a type: "${e.type}")`);a=n,n=n&&n[u],e=e.fields[u]}i=u,l=d?"["+s+"]":"."+s}),{schema:e,parent:a,parentPath:i}):{parent:a,parentPath:t,schema:e}}class ao extends Set{describe(){const t=[];for(const n of this.values())t.push(_t.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new ao(this.values())}merge(t,n){const r=this.clone();return t.forEach(a=>r.add(a)),n.forEach(a=>r.delete(a)),r}}function Qt(e,t=new Map){if(Jo(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Qt(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,a]of e.entries())n.set(r,Qt(a,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Qt(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,a]of Object.entries(e))n[r]=Qt(a,t)}else throw Error(`Unable to clone ${e}`);return n}class st{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new ao,this._blacklist=new ao,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(lt.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Qt(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const a=Object.assign({},n.spec,r.spec);return r.spec=a,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(i=>{t.tests.forEach(l=>{i.test(l.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((a,i)=>i.resolve(a,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,a,i;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(a=t.recursive)!=null?a:this.spec.recursive,disableStackTrace:(i=t.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),a=n.assert==="ignore-optionality",i=r._cast(t,n);if(n.assert!==!1&&!r.isType(i)){if(a&&At(i))return i;let l=Et(t),s=Et(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
15
|
+
*/function et(e){return typeof e=="function"}function ga(e){return e==null}const Xt=e=>e!==null&&!!e&&typeof e=="object"&&!Array.isArray(e);function Uo(e){return Number(e)>=0}function Gc(e){return typeof e=="object"&&e!==null}function Yc(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}function ha(e){if(!Gc(e)||Yc(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function dn(e,t){return Object.keys(t).forEach(n=>{if(ha(t[n])&&ha(e[n])){e[n]||(e[n]={}),dn(e[n],t[n]);return}e[n]=t[n]}),e}function Jn(e){const t=e.split(".");if(!t.length)return"";let n=String(t[0]);for(let r=1;r<t.length;r++){if(Uo(t[r])){n+=`[${t[r]}]`;continue}n+=`.${t[r]}`}return n}const Xc={};function Jc(e){return Xc[e]}function ba(e,t,n){typeof n.value=="object"&&(n.value=ke(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function ke(e){if(typeof e!="object")return e;var t=0,n,r,a,i=Object.prototype.toString.call(e);if(i==="[object Object]"?a=Object.create(e.__proto__||null):i==="[object Array]"?a=Array(e.length):i==="[object Set]"?(a=new Set,e.forEach(function(l){a.add(ke(l))})):i==="[object Map]"?(a=new Map,e.forEach(function(l,s){a.set(ke(s),ke(l))})):i==="[object Date]"?a=new Date(+e):i==="[object RegExp]"?a=new RegExp(e.source,e.flags):i==="[object DataView]"?a=new e.constructor(ke(e.buffer)):i==="[object ArrayBuffer]"?a=e.slice(0):i.slice(-6)==="Array]"&&(a=new e.constructor(e)),a){for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)ba(a,r[t],Object.getOwnPropertyDescriptor(e,r[t]));for(t=0,r=Object.getOwnPropertyNames(e);t<r.length;t++)Object.hasOwnProperty.call(a,n=r[t])&&a[n]===e[n]||ba(a,n,Object.getOwnPropertyDescriptor(e,n))}return a||e}const Qc=Symbol("vee-validate-form"),Zc=Symbol("vee-validate-form-context"),ed=typeof window<"u";function td(e){return et(e)&&!!e.__locatorRef}function Ct(e){return!!e&&et(e.parse)&&e.__type==="VVTypedSchema"}function ya(e){return!!e&&et(e.validate)}function nd(e){return e==="checkbox"||e==="radio"}function od(e){return Xt(e)||Array.isArray(e)}function rd(e){return Array.isArray(e)?e.length===0:Xt(e)&&Object.keys(e).length===0}function Qn(e){return/^\[.+\]$/i.test(e)}function ad(e){return ka(e)&&e.multiple}function ka(e){return e.tagName==="SELECT"}function id(e){return wa(e)&&e.target&&"submit"in e.target}function wa(e){return e?!!(typeof Event<"u"&&et(Event)&&e instanceof Event||e&&e.srcElement):!1}function un(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,a;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!un(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;for(r of e.entries())if(!un(r[1],t.get(r[0])))return!1;return!0}if(xa(e)&&xa(t))return!(e.size!==t.size||e.name!==t.name||e.lastModified!==t.lastModified||e.type!==t.type);if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(a=Object.keys(e),n=a.length-va(e,a),n!==Object.keys(t).length-va(t,Object.keys(t)))return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){var i=a[r];if(!un(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function va(e,t){let n=0;for(let a=t.length;a--!==0;){var r=t[a];e[r]===void 0&&n++}return n}function xa(e){return ed?e instanceof File:!1}function Ho(e){return Qn(e)?e.replace(/\[|\]/gi,""):e}function gt(e,t,n){return e?Qn(t)?e[Ho(t)]:(t||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((a,i)=>od(a)&&i in a?a[i]:n,e):n}function ht(e,t,n){if(Qn(t)){e[Ho(t)]=n;return}const r=t.split(/\.|\[(\d+)\]/).filter(Boolean);let a=e;for(let i=0;i<r.length;i++){if(i===r.length-1){a[r[i]]=n;return}(!(r[i]in a)||ga(a[r[i]]))&&(a[r[i]]=Uo(r[i+1])?[]:{}),a=a[r[i]]}}function Wo(e,t){if(Array.isArray(e)&&Uo(t)){e.splice(Number(t),1);return}Xt(e)&&delete e[t]}function Sa(e,t){if(Qn(t)){delete e[Ho(t)];return}const n=t.split(/\.|\[(\d+)\]/).filter(Boolean);let r=e;for(let i=0;i<n.length;i++){if(i===n.length-1){Wo(r,n[i]);break}if(!(n[i]in r)||ga(r[n[i]]))break;r=r[n[i]]}const a=n.map((i,l)=>gt(e,n.slice(0,l).join(".")));for(let i=a.length-1;i>=0;i--)if(rd(a[i])){if(i===0){Wo(e,n[0]);continue}Wo(a[i-1],n[i-1])}}function qe(e){return Object.keys(e)}function Ca(e,t=0){let n=null,r=[];return function(...a){return n&&clearTimeout(n),n=setTimeout(()=>{const i=e(...a);r.forEach(l=>l(i)),r=[]},t),new Promise(i=>r.push(i))}}function ld(e,t){let n;return async function(...a){const i=e(...a);n=i;const l=await i;return i!==n?l:(n=void 0,t(l,a))}}function Ea(e){return Array.isArray(e)?e:e?[e]:[]}function Zn(e,t){const n={};for(const r in e)t.includes(r)||(n[r]=e[r]);return n}function sd(e){let t=null,n=[];return function(...r){const a=o.nextTick(()=>{if(t!==a)return;const i=e(...r);n.forEach(l=>l(i)),n=[],t=null});return t=a,new Promise(i=>n.push(i))}}function qo(e){if(Ba(e))return e._value}function Ba(e){return"_value"in e}function cd(e){return e.type==="number"||e.type==="range"?Number.isNaN(e.valueAsNumber)?e.value:e.valueAsNumber:e.value}function $a(e){if(!wa(e))return e;const t=e.target;if(nd(t.type)&&Ba(t))return qo(t);if(t.type==="file"&&t.files){const n=Array.from(t.files);return t.multiple?n:n[0]}if(ad(t))return Array.from(t.options).filter(n=>n.selected&&!n.disabled).map(qo);if(ka(t)){const n=Array.from(t.options).find(r=>r.selected);return n?qo(n):t.value}return cd(t)}function dd(e){const t={};return Object.defineProperty(t,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),e?Xt(e)&&e._$$isNormalized?e:Xt(e)?Object.keys(e).reduce((n,r)=>{const a=ud(e[r]);return e[r]!==!1&&(n[r]=Na(a)),n},t):typeof e!="string"?t:e.split("|").reduce((n,r)=>{const a=fd(r);return a.name&&(n[a.name]=Na(a.params)),n},t):t}function ud(e){return e===!0?[]:Array.isArray(e)||Xt(e)?e:[e]}function Na(e){const t=n=>typeof n=="string"&&n[0]==="@"?md(n.slice(1)):n;return Array.isArray(e)?e.map(t):e instanceof RegExp?[e]:Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{})}const fd=e=>{let t=[];const n=e.split(":")[0];return e.includes(":")&&(t=e.split(":").slice(1).join(":").split(",")),{name:n,params:t}};function md(e){const t=n=>{var r;return(r=gt(n,e))!==null&&r!==void 0?r:n[e]};return t.__locatorRef=e,t}let pd=Object.assign({},{generateMessage:({field:e})=>`${e} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const fn=()=>pd;async function gd(e,t,n={}){const r=n==null?void 0:n.bails,a={name:(n==null?void 0:n.name)||"{field}",rules:t,label:n==null?void 0:n.label,bails:r??!0,formData:(n==null?void 0:n.values)||{}},i=await hd(a,e);return Object.assign(Object.assign({},i),{valid:!i.errors.length})}async function hd(e,t){const n=e.rules;if(Ct(n)||ya(n))return yd(t,Object.assign(Object.assign({},e),{rules:n}));if(et(n)||Array.isArray(n)){const s={field:e.label||e.name,name:e.name,label:e.label,form:e.formData,value:t},d=Array.isArray(n)?n:[n],c=d.length,u=[];for(let f=0;f<c;f++){const m=d[f],p=await m(t,s);if(!(typeof p!="string"&&!Array.isArray(p)&&p)){if(Array.isArray(p))u.push(...p);else{const h=typeof p=="string"?p:Ta(s);u.push(h)}if(e.bails)return{errors:u}}}return{errors:u}}const r=Object.assign(Object.assign({},e),{rules:dd(n)}),a=[],i=Object.keys(r.rules),l=i.length;for(let s=0;s<l;s++){const d=i[s],c=await kd(r,t,{name:d,params:r.rules[d]});if(c.error&&(a.push(c.error),e.bails))return{errors:a}}return{errors:a}}function bd(e){return!!e&&e.name==="ValidationError"}function Oa(e){return{__type:"VVTypedSchema",async parse(n,r){var a;try{return{output:await e.validate(n,{abortEarly:!1,context:(r==null?void 0:r.formData)||{}}),errors:[]}}catch(i){if(!bd(i))throw i;if(!(!((a=i.inner)===null||a===void 0)&&a.length)&&i.errors.length)return{errors:[{path:i.path,errors:i.errors}]};const l=i.inner.reduce((s,d)=>{const c=d.path||"";return s[c]||(s[c]={errors:[],path:c}),s[c].errors.push(...d.errors),s},{});return{errors:Object.values(l)}}}}}async function yd(e,t){const r=await(Ct(t.rules)?t.rules:Oa(t.rules)).parse(e,{formData:t.formData}),a=[];for(const i of r.errors)i.errors.length&&a.push(...i.errors);return{value:r.value,errors:a}}async function kd(e,t,n){const r=Jc(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const a=wd(n.params,e.formData),i={field:e.label||e.name,name:e.name,label:e.label,value:t,form:e.formData,rule:Object.assign(Object.assign({},n),{params:a})},l=await r(t,a,i);return typeof l=="string"?{error:l}:{error:l?void 0:Ta(i)}}function Ta(e){const t=fn().generateMessage;return t?t(e):"Field is invalid"}function wd(e,t){const n=r=>td(r)?r(t):r;return Array.isArray(e)?e.map(n):Object.keys(e).reduce((r,a)=>(r[a]=n(e[a]),r),{})}async function vd(e,t){const r=await(Ct(e)?e:Oa(e)).parse(ke(t),{formData:ke(t)}),a={},i={};for(const l of r.errors){const s=l.errors,d=(l.path||"").replace(/\["(\d+)"\]/g,(c,u)=>`[${u}]`);a[d]={valid:!s.length,errors:s},s.length&&(i[d]=s[0])}return{valid:!r.errors.length,results:a,errors:i,values:r.value,source:"schema"}}async function xd(e,t,n){const a=qe(e).map(async c=>{var u,f,m;const p=(u=n==null?void 0:n.names)===null||u===void 0?void 0:u[c],g=await gd(gt(t,c),e[c],{name:(p==null?void 0:p.name)||c,label:p==null?void 0:p.label,values:t,bails:(m=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[c])!==null&&m!==void 0?m:!0});return Object.assign(Object.assign({},g),{path:c})});let i=!0;const l=await Promise.all(a),s={},d={};for(const c of l)s[c.path]={valid:c.valid,errors:c.errors},c.valid||(i=!1,d[c.path]=c.errors[0]);return{valid:i,results:s,errors:d,source:"schema"}}let Sd=0;const eo=["bails","fieldsCount","id","multiple","type","validate"];function Va(e){const t={},n=Object.assign({},o.toValue(t)),r=o.unref(void 0);return r&&Ct(r)&&et(r.cast)?ke(r.cast(n)||{}):ke(n)}function Ia(e){var t;const n=Sd++,r="Form";let a=0;const i=o.ref(!1),l=o.ref(!1),s=o.ref(0),d=[],c=o.reactive(Va()),u=o.ref([]),f=o.ref({}),m=o.ref({}),p=sd(()=>{m.value=u.value.reduce((T,V)=>(T[Jn(o.toValue(V.path))]=V,T),{})});function g(T,V){const L=q(T);if(!L){typeof T=="string"&&(f.value[Jn(T)]=Ea(V));return}if(typeof T=="string"){const W=Jn(T);f.value[W]&&delete f.value[W]}L.errors=Ea(V),L.valid=!L.errors.length}function h(T){qe(T).forEach(V=>{g(V,T[V])})}const b=o.computed(()=>{const T=u.value.reduce((V,L)=>(L.errors.length&&(V[o.toValue(L.path)]=L.errors),V),{});return Object.assign(Object.assign({},f.value),T)}),y=o.computed(()=>qe(b.value).reduce((T,V)=>{const L=b.value[V];return L!=null&&L.length&&(T[V]=L[0]),T},{})),v=o.computed(()=>u.value.reduce((T,V)=>(T[o.toValue(V.path)]={name:o.toValue(V.path)||"",label:V.label||""},T),{})),x=o.computed(()=>u.value.reduce((T,V)=>{var L;return T[o.toValue(V.path)]=(L=V.bails)!==null&&L!==void 0?L:!0,T},{})),E=Object.assign({},{}),N=(t=void 0)!==null&&t!==void 0?t:!1,{initialValues:$,originalInitialValues:C,setInitialValues:k}=Ed(u,c),w=Cd(u,c,C,y),S=o.computed(()=>u.value.reduce((T,V)=>{const L=gt(c,o.toValue(V.path));return ht(T,o.toValue(V.path),L),T},{})),B=void 0;function I(T,V){var L,W;const ee=o.computed(()=>gt($.value,o.toValue(T))),oe=m.value[o.toValue(T)],X=(V==null?void 0:V.type)==="checkbox"||(V==null?void 0:V.type)==="radio";if(oe&&X){oe.multiple=!0;const Se=a++;return Array.isArray(oe.id)?oe.id.push(Se):oe.id=[oe.id,Se],oe.fieldsCount++,oe.__flags.pendingUnmount[Se]=!1,oe}const A=o.computed(()=>gt(c,o.toValue(T))),U=o.toValue(T),G=O.findIndex(Se=>Se===U);G!==-1&&O.splice(G,1);const K=o.computed(()=>{var Se,Fe,Dn,_n;const An=o.toValue(B);if(Ct(An))return(Fe=(Se=An.describe)===null||Se===void 0?void 0:Se.call(An,o.toValue(T)).required)!==null&&Fe!==void 0?Fe:!1;const xr=o.toValue(V==null?void 0:V.schema);return Ct(xr)&&(_n=(Dn=xr.describe)===null||Dn===void 0?void 0:Dn.call(xr).required)!==null&&_n!==void 0?_n:!1}),te=a++,ye=o.reactive({id:te,path:T,touched:!1,pending:!1,valid:!0,validated:!!(!((L=E[U])===null||L===void 0)&&L.length),required:K,initialValue:ee,errors:o.shallowRef([]),bails:(W=V==null?void 0:V.bails)!==null&&W!==void 0?W:!1,label:V==null?void 0:V.label,type:(V==null?void 0:V.type)||"default",value:A,multiple:!1,__flags:{pendingUnmount:{[te]:!1},pendingReset:!1},fieldsCount:1,validate:V==null?void 0:V.validate,dirty:o.computed(()=>!un(o.unref(A),o.unref(ee)))});return u.value.push(ye),m.value[U]=ye,p(),y.value[U]&&!E[U]&&o.nextTick(()=>{Me(U,{mode:"silent"})}),o.isRef(T)&&o.watch(T,Se=>{p();const Fe=ke(A.value);m.value[Se]=ye,o.nextTick(()=>{ht(c,Se,Fe)})}),ye}const D=Ca(Qe,5),P=Ca(Qe,5),M=ld(async T=>await(T==="silent"?D():P()),(T,[V])=>{const L=qe(ce.errorBag.value),ee=[...new Set([...qe(T.results),...u.value.map(oe=>oe.path),...L])].sort().reduce((oe,X)=>{var A;const U=X,G=q(U)||F(U),K=((A=T.results[U])===null||A===void 0?void 0:A.errors)||[],te=o.toValue(G==null?void 0:G.path)||U,ye=Bd({errors:K,valid:!K.length},oe.results[te]);return oe.results[te]=ye,ye.valid||(oe.errors[te]=ye.errors[0]),G&&f.value[te]&&delete f.value[te],G?(G.valid=ye.valid,V==="silent"||V==="validated-only"&&!G.validated||g(G,ye.errors),oe):(g(te,K),oe)},{valid:T.valid,results:{},errors:{},source:T.source});return T.values&&(ee.values=T.values,ee.source=T.source),qe(ee.results).forEach(oe=>{var X;const A=q(oe);A&&V!=="silent"&&(V==="validated-only"&&!A.validated||g(A,(X=ee.results[oe])===null||X===void 0?void 0:X.errors))}),ee});function j(T){u.value.forEach(T)}function q(T){const V=typeof T=="string"?Jn(T):T;return typeof V=="string"?m.value[V]:V}function F(T){return u.value.filter(L=>T.startsWith(o.toValue(L.path))).reduce((L,W)=>L?W.path.length>L.path.length?W:L:W,void 0)}let O=[],_;function J(T){return O.push(T),_||(_=o.nextTick(()=>{[...O].sort().reverse().forEach(L=>{Sa(c,L)}),O=[],_=null})),_}function re(T){return function(L,W){return function(oe){return oe instanceof Event&&(oe.preventDefault(),oe.stopPropagation()),j(X=>X.touched=!0),i.value=!0,s.value++,Ee().then(X=>{const A=ke(c);if(X.valid&&typeof L=="function"){const U=ke(S.value);let G=T?U:A;return X.values&&(G=X.source==="schema"?X.values:Object.assign({},G,X.values)),L(G,{evt:oe,controlledValues:U,setErrors:h,setFieldError:g,setTouched:ge,setFieldTouched:Je,setValues:Re,setFieldValue:xe,resetForm:he,resetField:me})}!X.valid&&typeof W=="function"&&W({values:A,evt:oe,errors:X.errors,results:X.results})}).then(X=>(i.value=!1,X),X=>{throw i.value=!1,X})}}}const Y=re(!1);Y.withControlled=re(!0);function Q(T,V){const L=u.value.findIndex(ee=>ee.path===T&&(Array.isArray(ee.id)?ee.id.includes(V):ee.id===V)),W=u.value[L];if(!(L===-1||!W)){if(o.nextTick(()=>{Me(T,{mode:"silent",warn:!1})}),W.multiple&&W.fieldsCount&&W.fieldsCount--,Array.isArray(W.id)){const ee=W.id.indexOf(V);ee>=0&&W.id.splice(ee,1),delete W.__flags.pendingUnmount[V]}(!W.multiple||W.fieldsCount<=0)&&(u.value.splice(L,1),ft(T),p(),delete m.value[T])}}function le(T){qe(m.value).forEach(V=>{V.startsWith(T)&&delete m.value[V]}),u.value=u.value.filter(V=>!V.path.startsWith(T)),o.nextTick(()=>{p()})}const ce={name:r,formId:n,values:c,controlledValues:S,errorBag:b,errors:y,schema:B,submitCount:s,meta:w,isSubmitting:i,isValidating:l,fieldArrays:d,keepValuesOnUnmount:N,validateSchema:o.unref(B)?M:void 0,validate:Ee,setFieldError:g,validateField:Me,setFieldValue:xe,setValues:Re,setErrors:h,setFieldTouched:Je,setTouched:ge,resetForm:he,resetField:me,handleSubmit:Y,useFieldModel:qt,defineInputBinds:Z,defineComponentBinds:at,defineField:It,stageInitialValue:Ve,unsetInitialValue:ft,setFieldInitialValue:je,createPathState:I,getPathState:q,unsetPathValue:J,removePathState:Q,initialValues:$,getAllPathStates:()=>u.value,destroyPath:le,isFieldTouched:H,isFieldDirty:z,isFieldValid:fe};function xe(T,V,L=!0){const W=ke(V),ee=typeof T=="string"?T:T.path;q(ee)||I(ee),ht(c,ee,W),L&&Me(ee)}function He(T,V=!0){qe(c).forEach(L=>{delete c[L]}),qe(T).forEach(L=>{xe(L,T[L],!1)}),V&&Ee()}function Re(T,V=!0){dn(c,T),d.forEach(L=>L&&L.reset()),V&&Ee()}function rt(T,V){const L=q(o.toValue(T))||I(T);return o.computed({get(){return L.value},set(W){var ee;const oe=o.toValue(T);xe(oe,W,(ee=o.toValue(V))!==null&&ee!==void 0?ee:!1)}})}function Je(T,V){const L=q(T);L&&(L.touched=V)}function H(T){const V=q(T);return V?V.touched:u.value.filter(L=>L.path.startsWith(T)).some(L=>L.touched)}function z(T){const V=q(T);return V?V.dirty:u.value.filter(L=>L.path.startsWith(T)).some(L=>L.dirty)}function fe(T){const V=q(T);return V?V.valid:u.value.filter(L=>L.path.startsWith(T)).every(L=>L.valid)}function ge(T){if(typeof T=="boolean"){j(V=>{V.touched=T});return}qe(T).forEach(V=>{Je(V,!!T[V])})}function me(T,V){var L;const W=V&&"value"in V?V.value:gt($.value,T),ee=q(T);ee&&(ee.__flags.pendingReset=!0),je(T,ke(W),!0),xe(T,W,!1),Je(T,(L=V==null?void 0:V.touched)!==null&&L!==void 0?L:!1),g(T,(V==null?void 0:V.errors)||[]),o.nextTick(()=>{ee&&(ee.__flags.pendingReset=!1)})}function he(T,V){let L=ke(T!=null&&T.values?T.values:C.value);L=V!=null&&V.force?L:dn(C.value,L),L=Ct(B)&&et(B.cast)?B.cast(L):L,k(L,{force:V==null?void 0:V.force}),j(W=>{var ee;W.__flags.pendingReset=!0,W.validated=!1,W.touched=((ee=T==null?void 0:T.touched)===null||ee===void 0?void 0:ee[o.toValue(W.path)])||!1,xe(o.toValue(W.path),gt(L,o.toValue(W.path)),!1),g(o.toValue(W.path),void 0)}),V!=null&&V.force?He(L,!1):Re(L,!1),h((T==null?void 0:T.errors)||{}),s.value=(T==null?void 0:T.submitCount)||0,o.nextTick(()=>{Ee({mode:"silent"}),j(W=>{W.__flags.pendingReset=!1})})}async function Ee(T){const V=(T==null?void 0:T.mode)||"force";if(V==="force"&&j(X=>X.validated=!0),ce.validateSchema)return ce.validateSchema(V);l.value=!0;const L=await Promise.all(u.value.map(X=>X.validate?X.validate(T).then(A=>({key:o.toValue(X.path),valid:A.valid,errors:A.errors,value:A.value})):Promise.resolve({key:o.toValue(X.path),valid:!0,errors:[],value:void 0})));l.value=!1;const W={},ee={},oe={};for(const X of L)W[X.key]={valid:X.valid,errors:X.errors},X.value&&ht(oe,X.key,X.value),X.errors.length&&(ee[X.key]=X.errors[0]);return{valid:L.every(X=>X.valid),results:W,errors:ee,values:oe,source:"fields"}}async function Me(T,V){var L;const W=q(T);return W&&(V==null?void 0:V.mode)!=="silent"&&(W.validated=!0),W!=null&&W.validate?W.validate(V):(!W&&(L=V==null?void 0:V.warn),Promise.resolve({errors:[],valid:!0}))}function ft(T){Sa($.value,T)}function Ve(T,V,L=!1){je(T,V),ht(c,T,V),L&&ht(C.value,T,ke(V))}function je(T,V,L=!1){ht($.value,T,ke(V)),L&&ht(C.value,T,ke(V))}async function Qe(){const T=o.unref(B);if(!T)return{valid:!0,results:{},errors:{},source:"none"};l.value=!0;const V=ya(T)||Ct(T)?await vd(T,c):await xd(T,c,{names:v.value,bailsMap:x.value});return l.value=!1,V}const Vt=Y((T,{evt:V})=>{id(V)&&V.target.submit()});o.onMounted(()=>{ce.validateSchema&&ce.validateSchema("silent")}),o.isRef(B)&&o.watch(B,()=>{var T;(T=ce.validateSchema)===null||T===void 0||T.call(ce,"validated-only")}),o.provide(Qc,ce);function It(T,V){const L=et(V)||V==null?void 0:V.label,W=q(o.toValue(T))||I(T,{label:L}),ee=()=>et(V)?V(Zn(W,eo)):V||{};function oe(){var K;W.touched=!0,((K=ee().validateOnBlur)!==null&&K!==void 0?K:fn().validateOnBlur)&&Me(o.toValue(W.path))}function X(){var K;((K=ee().validateOnInput)!==null&&K!==void 0?K:fn().validateOnInput)&&o.nextTick(()=>{Me(o.toValue(W.path))})}function A(){var K;((K=ee().validateOnChange)!==null&&K!==void 0?K:fn().validateOnChange)&&o.nextTick(()=>{Me(o.toValue(W.path))})}const U=o.computed(()=>{const K={onChange:A,onInput:X,onBlur:oe};return et(V)?Object.assign(Object.assign({},K),V(Zn(W,eo)).props||{}):V!=null&&V.props?Object.assign(Object.assign({},K),V.props(Zn(W,eo))):K});return[rt(T,()=>{var K,te,ye;return(ye=(K=ee().validateOnModelUpdate)!==null&&K!==void 0?K:(te=fn())===null||te===void 0?void 0:te.validateOnModelUpdate)!==null&&ye!==void 0?ye:!0}),U]}function qt(T){return Array.isArray(T)?T.map(V=>rt(V,!0)):rt(T)}function Z(T,V){const[L,W]=It(T,V);function ee(){W.value.onBlur()}function oe(A){const U=$a(A);xe(o.toValue(T),U,!1),W.value.onInput()}function X(A){const U=$a(A);xe(o.toValue(T),U,!1),W.value.onChange()}return o.computed(()=>Object.assign(Object.assign({},W.value),{onBlur:ee,onInput:oe,onChange:X,value:L.value}))}function at(T,V){const[L,W]=It(T,V),ee=q(o.toValue(T));function oe(X){L.value=X}return o.computed(()=>{const X=et(V)?V(Zn(ee,eo)):V||{};return Object.assign({[X.model||"modelValue"]:L.value,[`onUpdate:${X.model||"modelValue"}`]:oe},W.value)})}const Be=Object.assign(Object.assign({},ce),{values:o.readonly(c),handleReset:()=>he(),submitForm:Vt});return o.provide(Zc,Be),Be}function Cd(e,t,n,r){const a={touched:"some",pending:"some",valid:"every"},i=o.computed(()=>!un(t,o.unref(n)));function l(){const d=e.value;return qe(a).reduce((c,u)=>{const f=a[u];return c[u]=d[f](m=>m[u]),c},{})}const s=o.reactive(l());return o.watchEffect(()=>{const d=l();s.touched=d.touched,s.valid=d.valid,s.pending=d.pending}),o.computed(()=>Object.assign(Object.assign({initialValues:o.unref(n)},s),{valid:s.valid&&!qe(r.value).length,dirty:i.value}))}function Ed(e,t,n){const r=Va(),a=o.ref(r),i=o.ref(ke(r));function l(s,d){d!=null&&d.force?(a.value=ke(s),i.value=ke(s)):(a.value=dn(ke(a.value)||{},ke(s)),i.value=dn(ke(i.value)||{},ke(s))),d!=null&&d.updateFields&&e.value.forEach(c=>{if(c.touched)return;const f=gt(a.value,o.toValue(c.path));ht(t,o.toValue(c.path),ke(f))})}return{initialValues:a,originalInitialValues:i,setInitialValues:l}}function Bd(e,t){return t?{valid:e.valid&&t.valid,errors:[...e.errors,...t.errors]}:e}function Fa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ko,Pa;function $d(){if(Pa)return Ko;Pa=1;function e(y){this._maxSize=y,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(y){return this._values[y]},e.prototype.set=function(y,v){return this._size>=this._maxSize&&this.clear(),y in this._values||this._size++,this._values[y]=v};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,r=/^\d/,a=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,i=/^\s*(['"]?)(.*?)(\1)\s*$/,l=512,s=new e(l),d=new e(l),c=new e(l);Ko={Cache:e,split:f,normalizePath:u,setter:function(y){var v=u(y);return d.get(y)||d.set(y,function(E,N){for(var $=0,C=v.length,k=E;$<C-1;){var w=v[$];if(w==="__proto__"||w==="constructor"||w==="prototype")return E;k=k[v[$++]]}k[v[$]]=N})},getter:function(y,v){var x=u(y);return c.get(y)||c.set(y,function(N){for(var $=0,C=x.length;$<C;)if(N!=null||!v)N=N[x[$++]];else return;return N})},join:function(y){return y.reduce(function(v,x){return v+(p(x)||n.test(x)?"["+x+"]":(v?".":"")+x)},"")},forEach:function(y,v,x){m(Array.isArray(y)?y:f(y),v,x)}};function u(y){return s.get(y)||s.set(y,f(y).map(function(v){return v.replace(i,"$2")}))}function f(y){return y.match(t)||[""]}function m(y,v,x){var E=y.length,N,$,C,k;for($=0;$<E;$++)N=y[$],N&&(b(N)&&(N='"'+N+'"'),k=p(N),C=!k&&/^\d+$/.test(N),v.call(x,N,k,C,$,y))}function p(y){return typeof y=="string"&&y&&["'",'"'].indexOf(y.charAt(0))!==-1}function g(y){return y.match(r)&&!y.match(n)}function h(y){return a.test(y)}function b(y){return!p(y)&&(g(y)||h(y))}return Ko}var Dt=$d(),Go,Ra;function Nd(){if(Ra)return Go;Ra=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=u=>u.match(e)||[],n=u=>u[0].toUpperCase()+u.slice(1),r=(u,f)=>t(u).join(f).toLowerCase(),a=u=>t(u).reduce((f,m)=>`${f}${f?m[0].toUpperCase()+m.slice(1).toLowerCase():m.toLowerCase()}`,"");return Go={words:t,upperFirst:n,camelCase:a,pascalCase:u=>n(a(u)),snakeCase:u=>r(u,"_"),kebabCase:u=>r(u,"-"),sentenceCase:u=>n(r(u," ")),titleCase:u=>t(u).map(n).join(" ")},Go}var Yo=Nd(),to={exports:{}},Da;function Od(){if(Da)return to.exports;Da=1,to.exports=function(a){return e(t(a),a)},to.exports.array=e;function e(a,i){var l=a.length,s=new Array(l),d={},c=l,u=n(i),f=r(a);for(i.forEach(function(p){if(!f.has(p[0])||!f.has(p[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});c--;)d[c]||m(a[c],c,new Set);return s;function m(p,g,h){if(h.has(p)){var b;try{b=", node was:"+JSON.stringify(p)}catch{b=""}throw new Error("Cyclic dependency"+b)}if(!f.has(p))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(p));if(!d[g]){d[g]=!0;var y=u.get(p)||new Set;if(y=Array.from(y),g=y.length){h.add(p);do{var v=y[--g];m(v,f.get(v),h)}while(g);h.delete(p)}s[--l]=p}}}function t(a){for(var i=new Set,l=0,s=a.length;l<s;l++){var d=a[l];i.add(d[0]),i.add(d[1])}return Array.from(i)}function n(a){for(var i=new Map,l=0,s=a.length;l<s;l++){var d=a[l];i.has(d[0])||i.set(d[0],new Set),i.has(d[1])||i.set(d[1],new Set),i.get(d[0]).add(d[1])}return i}function r(a){for(var i=new Map,l=0,s=a.length;l<s;l++)i.set(a[l],l);return i}return to.exports}var Td=Od();const Vd=Fa(Td),Id=Object.prototype.toString,Fd=Error.prototype.toString,Pd=RegExp.prototype.toString,Rd=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Dd=/^Symbol\((.*)\)(.*)$/;function _d(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function _a(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return _d(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return Rd.call(e).replace(Dd,"Symbol($1)");const r=Id.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+Fd.call(e)+"]":r==="RegExp"?Pd.call(e):null}function Et(e,t){let n=_a(e,t);return n!==null?n:JSON.stringify(e,function(r,a){let i=_a(this[r],t);return i!==null?i:a},2)}function Aa(e){return e==null?[]:[].concat(e)}let La,za,Ma,Ad=/\$\{\s*(\w+)\s*\}/g;La=Symbol.toStringTag;class ja{constructor(t,n,r,a){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[La]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=a,this.errors=[],this.inner=[],Aa(t).forEach(i=>{if(Ae.isError(i)){this.errors.push(...i.errors);const l=i.inner.length?i.inner:[i];this.inner.push(...l)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}za=Symbol.hasInstance,Ma=Symbol.toStringTag;class Ae extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(Ad,(a,i)=>Et(n[i])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,a,i){const l=new ja(t,n,r,a);if(i)return l;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[Ma]="Error",this.name=l.name,this.message=l.message,this.type=l.type,this.value=l.value,this.path=l.path,this.errors=l.errors,this.inner=l.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Ae)}static[za](t){return ja[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let lt={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const a=r!=null&&r!==n?` (cast from the value \`${Et(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${Et(n,!0)}\``+a:`${e} must match the configured type. The validated value was: \`${Et(n,!0)}\``+a}},Le={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Ld={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Xo={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},zd={isValue:"${path} field must be ${value}"},no={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"};Object.assign(Object.create(null),{mixed:lt,string:Le,number:Ld,date:Xo,object:no,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:zd,tuple:{notType:e=>{const{path:t,value:n,spec:r}=e,a=r.types.length;if(Array.isArray(n)){if(n.length<a)return`${t} tuple value has too few items, expected a length of ${a} but got ${n.length} for value: \`${Et(n,!0)}\``;if(n.length>a)return`${t} tuple value has too many items, expected a length of ${a} but got ${n.length} for value: \`${Et(n,!0)}\``}return Ae.formatError(lt.notType,e)}}});const Jo=e=>e&&e.__isYupSchema__;class oo{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:a,otherwise:i}=n,l=typeof r=="function"?r:(...s)=>s.every(d=>d===r);return new oo(t,(s,d)=>{var c;let u=l(...s)?a:i;return(c=u==null?void 0:u(d))!=null?c:d})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(i=>i.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),a=this.fn(r,t,n);if(a===void 0||a===t)return t;if(!Jo(a))throw new TypeError("conditions must return a schema object");return a.resolve(n)}}const ro={context:"$",value:"."};class _t{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===ro.context,this.isValue=this.key[0]===ro.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?ro.context:this.isValue?ro.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Dt.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let a=this.isContext?r:this.isValue?t:n;return this.getter&&(a=this.getter(a||{})),this.map&&(a=this.map(a)),a}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}_t.prototype.__isYupRef=!0;const At=e=>e==null;function Jt(e){function t({value:n,path:r="",options:a,originalValue:i,schema:l},s,d){const{name:c,test:u,params:f,message:m,skipAbsent:p}=e;let{parent:g,context:h,abortEarly:b=l.spec.abortEarly,disableStackTrace:y=l.spec.disableStackTrace}=a;function v(B){return _t.isRef(B)?B.getValue(n,g,h):B}function x(B={}){const I=Object.assign({value:n,originalValue:i,label:l.spec.label,path:B.path||r,spec:l.spec,disableStackTrace:B.disableStackTrace||y},f,B.params);for(const P of Object.keys(I))I[P]=v(I[P]);const D=new Ae(Ae.formatError(B.message||m,I),n,I.path,B.type||c,I.disableStackTrace);return D.params=I,D}const E=b?s:d;let N={path:r,parent:g,type:c,from:a.from,createError:x,resolve:v,options:a,originalValue:i,schema:l};const $=B=>{Ae.isError(B)?E(B):B?d(null):E(x())},C=B=>{Ae.isError(B)?E(B):s(B)};if(p&&At(n))return $(!0);let w;try{var S;if(w=u.call(N,n,N),typeof((S=w)==null?void 0:S.then)=="function"){if(a.sync)throw new Error(`Validation test of type: "${N.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(w).then($,C)}}catch(B){C(B);return}$(w)}return t.OPTIONS=e,t}function Md(e,t,n,r=n){let a,i,l;return t?(Dt.forEach(t,(s,d,c)=>{let u=d?s.slice(1,s.length-1):s;e=e.resolve({context:r,parent:a,value:n});let f=e.type==="tuple",m=c?parseInt(u,10):0;if(e.innerType||f){if(f&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${l}" must contain an index to the tuple element, e.g. "${l}[0]"`);if(n&&m>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);a=n,n=n&&n[m],e=f?e.spec.types[m]:e.innerType}if(!c){if(!e.fields||!e.fields[u])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${l} which is a type: "${e.type}")`);a=n,n=n&&n[u],e=e.fields[u]}i=u,l=d?"["+s+"]":"."+s}),{schema:e,parent:a,parentPath:i}):{parent:a,parentPath:t,schema:e}}class ao extends Set{describe(){const t=[];for(const n of this.values())t.push(_t.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new ao(this.values())}merge(t,n){const r=this.clone();return t.forEach(a=>r.add(a)),n.forEach(a=>r.delete(a)),r}}function Qt(e,t=new Map){if(Jo(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Qt(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,a]of e.entries())n.set(r,Qt(a,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Qt(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,a]of Object.entries(e))n[r]=Qt(a,t)}else throw Error(`Unable to clone ${e}`);return n}class st{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new ao,this._blacklist=new ao,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(lt.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Qt(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const a=Object.assign({},n.spec,r.spec);return r.spec=a,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(i=>{t.tests.forEach(l=>{i.test(l.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((a,i)=>i.resolve(a,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,a,i;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(a=t.recursive)!=null?a:this.spec.recursive,disableStackTrace:(i=t.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),a=n.assert==="ignore-optionality",i=r._cast(t,n);if(n.assert!==!1&&!r.isType(i)){if(a&&At(i))return i;let l=Et(t),s=Et(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
16
16
|
|
|
17
17
|
attempted value: ${l}
|
|
18
|
-
`+(s!==l?`result of cast: ${s}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((a,i)=>i.call(this,a,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,a){let{path:i,originalValue:l=t,strict:s=this.spec.strict}=n,d=t;s||(d=this._cast(d,Object.assign({assert:!1},n)));let c=[];for(let u of Object.values(this.internalTests))u&&c.push(u);this.runTests({path:i,value:d,originalValue:l,options:n,tests:c},r,u=>{if(u.length)return a(u,d);this.runTests({path:i,value:d,originalValue:l,options:n,tests:this.tests},r,a)})}runTests(t,n,r){let a=!1,{tests:i,value:l,originalValue:s,path:d,options:c}=t,u=h=>{a||(a=!0,n(h,l))},f=h=>{a||(a=!0,r(h,l))},m=i.length,p=[];if(!m)return f([]);let g={value:l,originalValue:s,path:d,options:c,schema:this};for(let h=0;h<i.length;h++){const b=i[h];b(g,u,function(v){v&&(Array.isArray(v)?p.push(...v):p.push(v)),--m<=0&&f(p)})}}asNestedTest({key:t,index:n,parent:r,parentPath:a,originalParent:i,options:l}){const s=t??n;if(s==null)throw TypeError("Must include `key` or `index` for nested validations");const d=typeof s=="number";let c=r[s];const u=Object.assign({},l,{strict:!0,parent:r,value:c,originalValue:i[s],key:void 0,[d?"index":"key"]:s,path:d||s.includes(".")?`${a||""}[${d?s:`"${s}"`}]`:(a?`${a}.`:"")+t});return(f,m,p)=>this.resolve(u)._validate(c,u,m,p)}validate(t,n){var r;let a=this.resolve(Object.assign({},n,{value:t})),i=(r=n==null?void 0:n.disableStackTrace)!=null?r:a.spec.disableStackTrace;return new Promise((l,s)=>a._validate(t,n,(d,c)=>{Ae.isError(d)&&(d.value=c),s(d)},(d,c)=>{d.length?s(new Ae(d,c,void 0,void 0,i)):l(c)}))}validateSync(t,n){var r;let a=this.resolve(Object.assign({},n,{value:t})),i,l=(r=n==null?void 0:n.disableStackTrace)!=null?r:a.spec.disableStackTrace;return a._validate(t,Object.assign({},n,{sync:!0}),(s,d)=>{throw Ae.isError(s)&&(s.value=d),s},(s,d)=>{if(s.length)throw new Ae(s,t,void 0,void 0,l);i=d}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Ae.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Ae.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Qt(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=Jt({message:n,name:"nullable",test(a){return a===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=Jt({message:n,name:"optionality",test(a){return a===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=lt.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=lt.notNull){return this.nullability(!1,t)}required(t=lt.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=lt.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),a=Jt(n),i=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(l=>!(l.OPTIONS.name===n.name&&(i||l.OPTIONS.test===a.OPTIONS.test))),r.tests.push(a),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),a=Aa(t).map(i=>new _t(i));return a.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new oo(a,n):oo.fromOptions(a,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=Jt({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=lt.oneOf){let r=this.clone();return t.forEach(a=>{r._whitelist.add(a),r._blacklist.delete(a)}),r.internalTests.whiteList=Jt({message:n,name:"oneOf",skipAbsent:!0,test(a){let i=this.schema._whitelist,l=i.resolveAll(this.resolve);return l.includes(a)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:l}})}}),r}notOneOf(t,n=lt.notOneOf){let r=this.clone();return t.forEach(a=>{r._blacklist.add(a),r._whitelist.delete(a)}),r.internalTests.blacklist=Jt({message:n,name:"notOneOf",test(a){let i=this.schema._blacklist,l=i.resolveAll(this.resolve);return l.includes(a)?this.createError({params:{values:Array.from(i).join(", "),resolved:l}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:a,optional:i,nullable:l}=n.spec;return{meta:a,label:r,optional:i,nullable:l,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(d=>({name:d.OPTIONS.name,params:d.OPTIONS.params})).filter((d,c,u)=>u.findIndex(f=>f.name===d.name)===c)}}}st.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])st.prototype[`${e}At`]=function(t,n,r={}){const{parent:a,parentPath:i,schema:l}=Md(this,t,n,r.context);return l[e](a&&a[i],Object.assign({},r,{parent:a,path:t}))};for(const e of["equals","is"])st.prototype[e]=st.prototype.oneOf;for(const e of["not","nope"])st.prototype[e]=st.prototype.notOneOf;const jd=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Ud(e){const t=Qo(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function Qo(e){var t,n;const r=jd.exec(e);return r?{year:bt(r[1]),month:bt(r[2],1)-1,day:bt(r[3],1),hour:bt(r[4]),minute:bt(r[5]),second:bt(r[6]),millisecond:r[7]?bt(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:bt(r[10]),minuteOffset:bt(r[11])}:null}function bt(e,t=0){return Number(e)||t}let Hd=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Wd=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,qd=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Kd="^\\d{4}-\\d{2}-\\d{2}",Gd="\\d{2}:\\d{2}:\\d{2}",Yd="(([+-]\\d{2}(:?\\d{2})?)|Z)",Xd=new RegExp(`${Kd}T${Gd}(\\.\\d+)?${Yd}$`),Jd=e=>At(e)||e===e.trim(),Qd={}.toString();function Zo(){return new Ua}class Ua extends st{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const a=t!=null&&t.toString?t.toString():t;return a===Qd?t:a})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||lt.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=Le.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=Le.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=Le.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,a,i;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:a,name:i}=n:a=n),this.test({name:i||"matches",message:a||Le.matches,params:{regex:t},skipAbsent:!0,test:l=>l===""&&r||l.search(t)!==-1})}email(t=Le.email){return this.matches(Hd,{name:"email",message:t,excludeEmptyString:!0})}url(t=Le.url){return this.matches(Wd,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Le.uuid){return this.matches(qd,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,a;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:a=void 0}=t:n=t),this.matches(Xd,{name:"datetime",message:n||Le.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||Le.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:i=>{if(!i||r)return!0;const l=Qo(i);return l?!!l.z:!1}}).test({name:"datetime_precision",message:n||Le.datetime_precision,params:{precision:a},skipAbsent:!0,test:i=>{if(!i||a==null)return!0;const l=Qo(i);return l?l.precision===a:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Le.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:Jd})}lowercase(t=Le.lowercase){return this.transform(n=>At(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>At(n)||n===n.toLowerCase()})}uppercase(t=Le.uppercase){return this.transform(n=>At(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>At(n)||n===n.toUpperCase()})}}Zo.prototype=Ua.prototype;let Zd=new Date(""),eu=e=>Object.prototype.toString.call(e)==="[object Date]";class io extends st{constructor(){super({type:"date",check(t){return eu(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=Ud(t),isNaN(t)?io.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(_t.isRef(t))r=t;else{let a=this.cast(t);if(!this._typeCheck(a))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=a}return r}min(t,n=Xo.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a>=this.resolve(r)}})}max(t,n=Xo.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a<=this.resolve(r)}})}}io.INVALID_DATE=Zd,io.prototype;function tu(e,t=[]){let n=[],r=new Set,a=new Set(t.map(([l,s])=>`${l}-${s}`));function i(l,s){let d=Dt.split(l)[0];r.add(d),a.has(`${s}-${d}`)||n.push([s,d])}for(const l of Object.keys(e)){let s=e[l];r.add(l),_t.isRef(s)&&s.isSibling?i(s.path,l):Jo(s)&&"deps"in s&&s.deps.forEach(d=>i(d,l))}return Vd.array(Array.from(r),n).reverse()}function Ha(e,t){let n=1/0;return e.some((r,a)=>{var i;if((i=t.path)!=null&&i.includes(r))return n=a,!0}),n}function Wa(e){return(t,n)=>Ha(e,t)-Ha(e,n)}const nu=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function lo(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=lo(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=lo(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(lo)}):"optional"in e?e.optional():e}const ou=(e,t)=>{const n=[...Dt.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),a=Dt.getter(Dt.join(n),!0)(e);return!!(a&&r in a)};let qa=e=>Object.prototype.toString.call(e)==="[object Object]";function Ka(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const ru=Wa([]);function er(e){return new Ga(e)}class Ga extends st{constructor(t){super({type:"object",check(n){return qa(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=ru,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let a=super._cast(t,n);if(a===void 0)return this.getDefault(n);if(!this._typeCheck(a))return a;let i=this.fields,l=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(a).filter(f=>!this._nodes.includes(f))),d={},c=Object.assign({},n,{parent:d,__validating:n.__validating||!1}),u=!1;for(const f of s){let m=i[f],p=f in a;if(m){let g,h=a[f];c.path=(n.path?`${n.path}.`:"")+f,m=m.resolve({value:h,context:n.context,parent:d});let b=m instanceof st?m.spec:void 0,y=b==null?void 0:b.strict;if(b!=null&&b.strip){u=u||f in a;continue}g=!n.__validating||!y?m.cast(a[f],c):a[f],g!==void 0&&(d[f]=g)}else p&&!l&&(d[f]=a[f]);(p!==f in d||d[f]!==a[f])&&(u=!0)}return u?d:a}_validate(t,n={},r,a){let{from:i=[],originalValue:l=t,recursive:s=this.spec.recursive}=n;n.from=[{schema:this,value:l},...i],n.__validating=!0,n.originalValue=l,super._validate(t,n,r,(d,c)=>{if(!s||!qa(c)){a(d,c);return}l=l||c;let u=[];for(let f of this._nodes){let m=this.fields[f];!m||_t.isRef(m)||u.push(m.asNestedTest({options:n,key:f,parent:c,parentPath:n.path,originalParent:l}))}this.runTests({tests:u,value:c,originalValue:l,options:n},r,f=>{a(f.sort(this._sortErrors).concat(d),c)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[a,i]of Object.entries(this.fields)){const l=r[a];r[a]=l===void 0?i:l}return n.withMutation(a=>a.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var a;const i=this.fields[r];let l=t;(a=l)!=null&&a.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[r]})),n[r]=i&&"getDefault"in i?i.getDefault(l):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=tu(t,n),r._sortErrors=Wa(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let a=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),a=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),a)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return lo(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,a])=>t.includes(r)&&t.includes(a)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let a=Dt.getter(t,!0);return this.transform(i=>{if(!i)return i;let l=i;return ou(i,t)&&(l=Object.assign({},i),r||delete l[t],l[n]=a(i)),l})}json(){return this.transform(nu)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||no.exact,test(n){if(n==null)return!0;const r=Ka(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=no.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(a){if(a==null)return!0;const i=Ka(this.schema,a);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=no.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const a of Object.keys(n))r[t(a)]=n[a];return r})}camelCase(){return this.transformKeys(Yo.camelCase)}snakeCase(){return this.transformKeys(Yo.snakeCase)}constantCase(){return this.transformKeys(t=>Yo.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[i,l]of Object.entries(n.fields)){var a;let s=t;(a=s)!=null&&a.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[i]})),r.fields[i]=l.describe(s)}return r}}er.prototype=Ga.prototype;function tr(e,t,n){const r=new We;let a=o.ref({});const i=o.ref({}),l=o.ref({});let s=o.ref([]);const d=o.ref(null),c=o.ref([]);let u=o.ref([]),f=o.ref(!1);const m=o.ref({});let{handleSubmit:p,errors:g,setErrors:h}=Ia();const b=async()=>{var F;try{const V=await r.getEntityRecords(e);V&&V.response&&(a.value=V.response,s.value=(F=V.response.entity.entityDefinition)==null?void 0:F.columns,q(),C(),B())}catch(V){toast.add({severity:"error",summary:"Error",detail:V.errorMessage,life:3e3})}finally{}},y=async()=>{var F;try{const V=await r.getRecord(e,t);V&&V.response&&(a.value=V.response,s.value=(F=V.response.entity.entityDefinition)==null?void 0:F.columns,q(),i.value=JSON.parse(JSON.stringify(V.response.result[0])),B())}catch(V){console.error("Error fetching entity:",V.errorMessage)}finally{}},v=async()=>{var F,V;try{const _=await r.getRelatedEntityRecord(e,t);_&&_.response&&(a.value=_.response,s.value=(V=(F=_.response.entity)==null?void 0:F.entityDefinition)==null?void 0:V.columns,q(),i.value=JSON.parse(JSON.stringify(_.response.result[0])),i.value.entityName&&delete i.value.entityName,i.value.linkedEntities&&delete i.value.linkedEntities,u.value=_.response.result[0].linkedEntities,l.value=JSON.parse(JSON.stringify(i.value)),B())}catch(_){console.error("Error fetching entity:",_.errorMessage)}finally{}},x=async F=>{try{let V=await r.addRecord(e,F);V&&V.response&&n("onSaveDialog",{entityName:e,recordId:t})}catch(V){V.validationErrors&&(c.value=JSON.parse(JSON.stringify(V.validationErrors))),console.error("Error fetching entity:",V.errorMessage)}finally{}},E=async(F,V)=>{try{let _=await r.addRecord(e,V);if(_&&_.response){let J=await r.saveRelatedEntityRecord(e,_.response.recordId,F.linkedEntities);J&&J.response&&n("onSaveDialog",{entityName:e,recordId:t})}}catch(_){_.validationErrors&&(c.value=JSON.parse(JSON.stringify(_.validationErrors))),console.error("Error fetching entity:",_.errorMessage)}finally{}},N=async F=>{try{const V=await r.updateRecord(e,t,F);V&&V.response&&(f.value=!1,l.value=JSON.parse(JSON.stringify(i.value)),n("onSaveDialog",{entityName:e,recordId:t}))}catch(V){V.validationErrors&&(c.value=JSON.parse(JSON.stringify(V.errvalidationErrorsors))),console.error("Error fetching entity:",V.errorMessage)}finally{}},$=async(F,V,_)=>{try{let J=await r.saveRelatedEntityRecord(F,V,_);J&&J.response&&n("onSaveDialog",{entityName:e,enityRecordId:V})}catch(J){J.validationErrors&&(c.value=JSON.parse(JSON.stringify(J.validationErrors))),console.error("Error fetching entity:",J.errorMessage)}finally{}},C=()=>{for(let F=0;F<s.value.length;F++){let V=s.value[F];V.autoGenerated||(i.value[V.name]="")}},k=F=>{let V="";for(let _=0;_<s.value.length;_++){let J=s.value[_];if(F==J.name){V=J.type;break}}return V},w=()=>{const F=s.value.filter(_=>_.autoGenerated).map(_=>_.name);return Object.entries(i.value).filter(([_])=>!F.includes(_)).map(([_,J])=>({recordColumnName:_,recordColumnValue:J,columnType:k(_)}))},S=async(F={})=>{try{await d.value.validate(i.value,{abortEarly:!1}),h({})}catch(_){const J=_.inner.reduce((ae,Y)=>(ae[Y.path]||(ae[Y.path]={messages:[]}),ae[Y.path].messages.push(...Y.errors),ae),{}),re=Object.entries(J).reduce((ae,[Y,Q])=>(ae[Y]={messages:Q.messages},ae),{});h(re);return}const V={dataDefinitions:w()};t?await N(V):F.relationType=="MANY_TO_ONE"?await E(F,V):await x(V)},B=()=>{d.value=er().shape(s.value.reduce((F,V)=>(V.autoGenerated||(F[V.name]=Zo().nullable(!1).test({name:"custom-validation",test:function(_){const J=[];let re="";if(V.required&&(!_||_.trim()===""))if(V.validations){re=I(V.validations,"VALIDATE_REQUIRED"),J.push(re);let ae=P(V.validations,"VALIDATE_REQUIRED");ae&&(ae="hint:"+ae,J.push(ae))}else re=V.displayName+" is required.",J.push(re);else{if(V.maxLength&&_.length>V.maxLength)if(V.validations){re=I(V.validations,"VALIDATE_MAXLENGTH"),J.push(re);let ae=P(V.validations,"VALIDATE_MAXLENGTH");ae&&(ae="hint:"+ae,J.push(ae))}else re=V.displayName+" cannot exceed from "+V.maxLength+" characters",J.push(re);if(V.regxId&&!new RegExp(D(V.validations,"VALIDATE_REGX")).test(_))if(V.validations){re=I(V.validations,"VALIDATE_REGX"),J.push(re);let ae=P(V.validations,"VALIDATE_REGX");ae&&(ae="hint:"+ae,J.push(ae))}else re=V.displayName+" invalid format.",J.push(re)}return J.length>0?this.createError({message:J}):!0}})),F),{}))},I=(F,V)=>{for(let _=0;_<F.length;_++)if(V==F[_].type)return F[_].message},D=(F,V)=>{for(let _=0;_<F.length;_++)if(V==F[_].type)return F[_].regx},P=(F,V)=>{for(let _=0;_<F.length;_++)if(V==F[_].type)return F[_].hint},M=F=>{h({...g.value,[F]:null}),f.value=!0},j=()=>{f.value=!1;for(let F in i.value)i.value.hasOwnProperty(F)&&h({...g.value,[F]:null});i.value=JSON.parse(JSON.stringify(l.value))},q=()=>{for(let F=0;F<s.value.length;F++){const V=s.value[F];if(V.primaryKey&&V.primaryKey==!0){m.value=V;break}}};return{formData:i,columns:s,errors:g,backendErrors:c,isDataChange:f,linkedEntities:u,primarayKeyColumn:m,clearErrors:M,saveRecord:S,fetchAllRecords:b,fetchRecord:y,getRelatedEntityRecordById:v,cancleRecord:j,saveRelatedEntityRecord:$}}const au={key:0,class:"surface-card"},iu={class:"info"},lu={key:0,class:"list-none p-0"},Ya={__name:"EntityFormErrors",props:{errors:Array},setup(e){let t=o.ref(!0);const n=()=>{t.value=!t.value};return(r,a)=>{var l;const i=o.resolveComponent("Message");return((l=e.errors)==null?void 0:l.length)>0?(o.openBlock(),o.createElementBlock("div",au,[a[1]||(a[1]=o.createElementVNode("h4",{class:"flex-1 font-bold text-red-500"},"Errors",-1)),o.createElementVNode("div",iu,[o.createElementVNode("span",{onClick:a[0]||(a[0]=s=>n()),class:"cursor-pointer underline showHideColor"},o.toDisplayString(o.unref(t)?"Hide":"Show"),1)]),o.unref(t)?(o.openBlock(),o.createElementBlock("ul",lu,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.errors,(s,d)=>(o.openBlock(),o.createElementBlock("li",{key:d,class:"mb-2"},[o.createVNode(i,{style:{"word-break":"break-all"},closable:!1,severity:"error"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.message),1)]),_:2},1024)]))),128))])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)}}},su={class:"field flex flex-col mb-3"},cu=["for"],du={key:0,class:"flex items-center"},uu={key:1},fu={class:"flex items-center"},Xa={__name:"RelatedEntitySelection",props:{modelValue:{required:!0},entityName:{type:String,required:!0},columnName:{type:String,required:!0},relatedEntityColumn:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){mt.useRoute();const{getEntityRecords:n,searchEntityRecords:r,saveRelatedEntityRecord:a,getRecord:i,addRecord:l,updateRecord:s,deleteRecord:d}=We(),c=e,u=o.ref({});let f=o.ref("");const m=t;o.onMounted(()=>{p()});const p=async()=>{try{const b=await n(c.entityName);b&&b.response&&(u.value=b.response,h())}catch{}finally{}},g=()=>{m("update:modelValue",f.value[c.relatedEntityColumn])},h=()=>{for(let b=0;b<u.value.result.length;b++){const y=u.value.result[b];if(y[c.relatedEntityColumn]==c.modelValue){f.value=y;break}}};return(b,y)=>{const v=o.resolveComponent("Select");return o.openBlock(),o.createElementBlock("div",su,[o.createElementVNode("label",{for:e.columnName},o.toDisplayString(e.columnName),9,cu),o.createVNode(v,{modelValue:o.unref(f),"onUpdate:modelValue":[y[0]||(y[0]=x=>o.isRef(f)?f.value=x:f=x),g],"item-value":e.relatedEntityColumn,options:u.value.result,filter:"",optionLabel:e.relatedEntityColumn,placeholder:"Select "+e.relatedEntityColumn,class:"w-full"},{value:o.withCtx(x=>[x.value?(o.openBlock(),o.createElementBlock("div",du,[o.createElementVNode("div",null,o.toDisplayString(x.value[e.relatedEntityColumn]),1)])):(o.openBlock(),o.createElementBlock("span",uu,o.toDisplayString(x.placeholder),1))]),option:o.withCtx(x=>[o.createElementVNode("div",fu,[o.createElementVNode("div",null,o.toDisplayString(x.option[e.relatedEntityColumn]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"])])}}},mu={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},pu={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},gu={__name:"EntityDialog",props:o.mergeModels({entityName:{type:String,required:!0},recordId:{type:[String,Number],default:null}},{showForm:{},showFormModifiers:{}}),emits:o.mergeModels(["onSaveDialog"],["update:showForm"]),setup(e,{emit:t}){const n=o.useModel(e,"showForm"),r=t,{formData:a,columns:i,errors:l,backendErrors:s,clearErrors:d,saveRecord:c,fetchAllRecords:u,fetchRecord:f}=tr(e.entityName,e.recordId,r);return o.onMounted(()=>{e.recordId?f():u()}),(m,p)=>{const g=o.resolveComponent("Button"),h=o.resolveComponent("Dialog");return n.value?(o.openBlock(),o.createBlock(h,{key:0,showFooter:!1,visible:n.value,"onUpdate:visible":p[2]||(p[2]=b=>n.value=b),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},modal:!0,class:"p-fluid"},{header:o.withCtx(()=>[e.recordId?(o.openBlock(),o.createElementBlock("span",mu,"Edit "+o.toDisplayString(e.entityName)+" record details",1)):o.createCommentVNode("",!0),e.recordId?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",pu,"Add "+o.toDisplayString(e.entityName)+" record details",1))]),footer:o.withCtx(()=>[o.createVNode(g,{type:"button",icon:"",label:"Cancel",severity:"secondary",onClick:p[0]||(p[0]=b=>n.value=!1)}),o.createVNode(g,{type:"button",icon:"",label:"Save",severity:"success",onClick:p[1]||(p[1]=b=>o.unref(c)())})]),default:o.withCtx(()=>{var b;return[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(i),(y,v)=>{var x;return o.openBlock(),o.createElementBlock("div",{key:v},[!y.autoGenerated&&!y.foreignKey?(o.openBlock(),o.createBlock(Xn,{key:0,modelValue:o.unref(a)[y.name],"onUpdate:modelValue":E=>o.unref(a)[y.name]=E,column:y,errors:(x=o.unref(l)[y.name])==null?void 0:x.messages,onInput:o.unref(d)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"])):o.createCommentVNode("",!0),!y.autoGenerated&&y.foreignKey?(o.openBlock(),o.createBlock(Xa,{key:1,modelValue:o.unref(a)[y.name],"onUpdate:modelValue":E=>o.unref(a)[y.name]=E,entityName:y.foreignKey.referencedEntityName,columnName:y.name,relatedEntityColumn:y.foreignKey.referencedColumnName},null,8,["modelValue","onUpdate:modelValue","entityName","columnName","relatedEntityColumn"])):o.createCommentVNode("",!0)])}),128)),((b=o.unref(s))==null?void 0:b.length)>0?(o.openBlock(),o.createBlock(Ya,{key:0,errors:o.unref(s)},null,8,["errors"])):o.createCommentVNode("",!0)]}),_:1},8,["visible"])):o.createCommentVNode("",!0)}}},hu={__name:"DeleteConfirmationDialog",props:o.mergeModels({entityName:{type:String,required:!0},recordId:{type:[String,Number],default:null}},{showDeleteDialog:{},showDeleteDialogModifiers:{}}),emits:o.mergeModels(["onDeleteItem"],["update:showDeleteDialog"]),setup(e,{emit:t}){const n=new We,r=o.useModel(e,"showDeleteDialog"),a=t,i=async()=>{try{const l=await n.deleteRecord(e.entityName,e.recordId);l&&l.response&&a("onDeleteItem")}catch(l){console.error("Error deleting record:",l.errorMessage)}finally{}};return(l,s)=>{const d=o.resolveComponent("Button"),c=o.resolveComponent("Dialog");return o.openBlock(),o.createBlock(c,{visible:r.value,"onUpdate:visible":s[1]||(s[1]=u=>r.value=u),style:{width:"450px"},header:"Confirm",modal:!0},{footer:o.withCtx(()=>[o.createVNode(d,{label:"No",icon:"pi pi-times",text:"",onClick:s[0]||(s[0]=u=>r.value=!1)}),o.createVNode(d,{label:"Yes",icon:"pi pi-check",text:"",onClick:i})]),default:o.withCtx(()=>[s[2]||(s[2]=o.createElementVNode("div",{class:"flex items-center justify-center"},[o.createElementVNode("i",{class:"pi pi-exclamation-triangle mr-3",style:{"font-size":"2rem"}}),o.createElementVNode("span",null,"Are you sure you want to delete the selected item?")],-1))]),_:1},8,["visible"])}}};var bu=Object.defineProperty,Ja=Object.getOwnPropertySymbols,yu=Object.prototype.hasOwnProperty,ku=Object.prototype.propertyIsEnumerable,Qa=(e,t,n)=>t in e?bu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wu=(e,t)=>{for(var n in t||(t={}))yu.call(t,n)&&Qa(e,n,t[n]);if(Ja)for(var n of Ja(t))ku.call(t,n)&&Qa(e,n,t[n]);return e};function Lt(e){return e==null||e===""||Array.isArray(e)&&e.length===0||!(e instanceof Date)&&typeof e=="object"&&Object.keys(e).length===0}function nr(e,t,n=new WeakSet){if(e===t)return!0;if(!e||!t||typeof e!="object"||typeof t!="object"||n.has(e)||n.has(t))return!1;n.add(e).add(t);let r=Array.isArray(e),a=Array.isArray(t),i,l,s;if(r&&a){if(l=e.length,l!=t.length)return!1;for(i=l;i--!==0;)if(!nr(e[i],t[i],n))return!1;return!0}if(r!=a)return!1;let d=e instanceof Date,c=t instanceof Date;if(d!=c)return!1;if(d&&c)return e.getTime()==t.getTime();let u=e instanceof RegExp,f=t instanceof RegExp;if(u!=f)return!1;if(u&&f)return e.toString()==t.toString();let m=Object.keys(e);if(l=m.length,l!==Object.keys(t).length)return!1;for(i=l;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,m[i]))return!1;for(i=l;i--!==0;)if(s=m[i],!nr(e[s],t[s],n))return!1;return!0}function vu(e,t){return nr(e,t)}function so(e){return!!(e&&e.constructor&&e.call&&e.apply)}function de(e){return!Lt(e)}function yt(e,t){if(!e||!t)return null;try{const n=e[t];if(de(n))return n}catch{}if(Object.keys(e).length){if(so(t))return t(e);if(t.indexOf(".")===-1)return e[t];{let n=t.split("."),r=e;for(let a=0,i=n.length;a<i;++a){if(r==null)return null;r=r[n[a]]}return r}}return null}function Za(e,t,n){return n?yt(e,n)===yt(t,n):vu(e,t)}function ei(e,t){let n=-1;if(de(e))try{n=e.findLastIndex(t)}catch{n=e.lastIndexOf([...e].reverse().find(t))}return n}function ct(e,t=!0){return e instanceof Object&&e.constructor===Object&&(t||Object.keys(e).length!==0)}function Ke(e,...t){return so(e)?e(...t):e}function ze(e,t=!0){return typeof e=="string"&&(t||e!=="")}function tt(e){return ze(e)?e.replace(/(-|_)/g,"").toLowerCase():e}function or(e,t="",n={}){const r=tt(t).split("."),a=r.shift();return a?ct(e)?or(Ke(e[Object.keys(e).find(i=>tt(i)===a)||""],n),r.join("."),n):void 0:Ke(e,n)}function co(e,t=!0){return Array.isArray(e)&&(t||e.length!==0)}function xu(e){return de(e)&&!isNaN(e)}function Su(e=""){return de(e)&&e.length===1&&!!e.match(/\S| /)}function kt(e,t){if(t){const n=t.test(e);return t.lastIndex=0,n}return!1}function ti(...e){const t=(n={},r={})=>{const a=wu({},n);return Object.keys(r).forEach(i=>{ct(r[i])&&i in n&&ct(n[i])?a[i]=t(n[i],r[i]):a[i]=r[i]}),a};return e.reduce((n,r,a)=>a===0?r:t(n,r),{})}function mn(e){return e&&e.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":")}function Ge(e){if(e&&/[\xC0-\xFF\u0100-\u017E]/.test(e)){const n={A:/[\xC0-\xC5\u0100\u0102\u0104]/g,AE:/[\xC6]/g,C:/[\xC7\u0106\u0108\u010A\u010C]/g,D:/[\xD0\u010E\u0110]/g,E:/[\xC8-\xCB\u0112\u0114\u0116\u0118\u011A]/g,G:/[\u011C\u011E\u0120\u0122]/g,H:/[\u0124\u0126]/g,I:/[\xCC-\xCF\u0128\u012A\u012C\u012E\u0130]/g,IJ:/[\u0132]/g,J:/[\u0134]/g,K:/[\u0136]/g,L:/[\u0139\u013B\u013D\u013F\u0141]/g,N:/[\xD1\u0143\u0145\u0147\u014A]/g,O:/[\xD2-\xD6\xD8\u014C\u014E\u0150]/g,OE:/[\u0152]/g,R:/[\u0154\u0156\u0158]/g,S:/[\u015A\u015C\u015E\u0160]/g,T:/[\u0162\u0164\u0166]/g,U:/[\xD9-\xDC\u0168\u016A\u016C\u016E\u0170\u0172]/g,W:/[\u0174]/g,Y:/[\xDD\u0176\u0178]/g,Z:/[\u0179\u017B\u017D]/g,a:/[\xE0-\xE5\u0101\u0103\u0105]/g,ae:/[\xE6]/g,c:/[\xE7\u0107\u0109\u010B\u010D]/g,d:/[\u010F\u0111]/g,e:/[\xE8-\xEB\u0113\u0115\u0117\u0119\u011B]/g,g:/[\u011D\u011F\u0121\u0123]/g,i:/[\xEC-\xEF\u0129\u012B\u012D\u012F\u0131]/g,ij:/[\u0133]/g,j:/[\u0135]/g,k:/[\u0137,\u0138]/g,l:/[\u013A\u013C\u013E\u0140\u0142]/g,n:/[\xF1\u0144\u0146\u0148\u014B]/g,p:/[\xFE]/g,o:/[\xF2-\xF6\xF8\u014D\u014F\u0151]/g,oe:/[\u0153]/g,r:/[\u0155\u0157\u0159]/g,s:/[\u015B\u015D\u015F\u0161]/g,t:/[\u0163\u0165\u0167]/g,u:/[\xF9-\xFC\u0169\u016B\u016D\u016F\u0171\u0173]/g,w:/[\u0175]/g,y:/[\xFD\xFF\u0177]/g,z:/[\u017A\u017C\u017E]/g};for(let r in n)e=e.replace(n[r],r)}return e}function Cu(e){return ze(e,!1)?e[0].toUpperCase()+e.slice(1):e}function ni(e){return ze(e)?e.replace(/(_)/g,"-").replace(/[A-Z]/g,(t,n)=>n===0?t:"-"+t.toLowerCase()).toLowerCase():e}function oi(e){return ze(e)?e.replace(/[A-Z]/g,(t,n)=>n===0?t:"."+t.toLowerCase()).toLowerCase():e}var Zt={STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter"},Eu={AND:"and",OR:"or"};function ri(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Bu(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
19
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return l=c.done,c},e:function(c){s=!0,i=c},f:function(){try{l||n.return==null||n.return()}finally{if(s)throw i}}}}function Bu(e,t){if(e){if(typeof e=="string")return ai(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ai(e,t):void 0}}function ai(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var $u={filter:function(t,n,r,a,i){var l=[];if(!t)return l;var s=ri(t),d;try{for(s.s();!(d=s.n()).done;){var c=d.value;if(typeof c=="string"){if(this.filters[a](c,r,i)){l.push(c);continue}}else{var u=ri(n),f;try{for(u.s();!(f=u.n()).done;){var m=f.value,p=yt(c,m);if(this.filters[a](p,r,i)){l.push(c);break}}}catch(g){u.e(g)}finally{u.f()}}}}catch(g){s.e(g)}finally{s.f()}return l},filters:{startsWith:function(t,n,r){if(n==null||n==="")return!0;if(t==null)return!1;var a=Ge(n.toString()).toLocaleLowerCase(r),i=Ge(t.toString()).toLocaleLowerCase(r);return i.slice(0,a.length)===a},contains:function(t,n,r){if(n==null||n==="")return!0;if(t==null)return!1;var a=Ge(n.toString()).toLocaleLowerCase(r),i=Ge(t.toString()).toLocaleLowerCase(r);return i.indexOf(a)!==-1},notContains:function(t,n,r){if(n==null||n==="")return!0;if(t==null)return!1;var a=Ge(n.toString()).toLocaleLowerCase(r),i=Ge(t.toString()).toLocaleLowerCase(r);return i.indexOf(a)===-1},endsWith:function(t,n,r){if(n==null||n==="")return!0;if(t==null)return!1;var a=Ge(n.toString()).toLocaleLowerCase(r),i=Ge(t.toString()).toLocaleLowerCase(r);return i.indexOf(a,i.length-a.length)!==-1},equals:function(t,n,r){return n==null||n===""?!0:t==null?!1:t.getTime&&n.getTime?t.getTime()===n.getTime():Ge(t.toString()).toLocaleLowerCase(r)==Ge(n.toString()).toLocaleLowerCase(r)},notEquals:function(t,n,r){return n==null||n===""?!1:t==null?!0:t.getTime&&n.getTime?t.getTime()!==n.getTime():Ge(t.toString()).toLocaleLowerCase(r)!=Ge(n.toString()).toLocaleLowerCase(r)},in:function(t,n){if(n==null||n.length===0)return!0;for(var r=0;r<n.length;r++)if(Za(t,n[r]))return!0;return!1},between:function(t,n){return n==null||n[0]==null||n[1]==null?!0:t==null?!1:t.getTime?n[0].getTime()<=t.getTime()&&t.getTime()<=n[1].getTime():n[0]<=t&&t<=n[1]},lt:function(t,n){return n==null?!0:t==null?!1:t.getTime&&n.getTime?t.getTime()<n.getTime():t<n},lte:function(t,n){return n==null?!0:t==null?!1:t.getTime&&n.getTime?t.getTime()<=n.getTime():t<=n},gt:function(t,n){return n==null?!0:t==null?!1:t.getTime&&n.getTime?t.getTime()>n.getTime():t>n},gte:function(t,n){return n==null?!0:t==null?!1:t.getTime&&n.getTime?t.getTime()>=n.getTime():t>=n},dateIs:function(t,n){return n==null?!0:t==null?!1:t.toDateString()===n.toDateString()},dateIsNot:function(t,n){return n==null?!0:t==null?!1:t.toDateString()!==n.toDateString()},dateBefore:function(t,n){return n==null?!0:t==null?!1:t.getTime()<n.getTime()},dateAfter:function(t,n){return n==null?!0:t==null?!1:t.getTime()>n.getTime()}},register:function(t,n){this.filters[t]=n}};const Nu={key:0},Ou={key:1},rr={__name:"RecordColumnRenderer",props:{column:Object,value:null},setup(e){const t=o.ref(null),n=Object.assign({});async function r(){await o.nextTick();const a=n[`/src/directives/${e.column.displayFormatKey}.js`];a&&t.value&&a().then(i=>{i.default.beforeMount(t.value,{value:e.value,arg:e.column.displayFormat})})}return o.onMounted(()=>{r()}),o.onUpdated(()=>{r()}),(a,i)=>e.column.displayFormatKey?(o.openBlock(),o.createElementBlock("span",Nu,[o.createElementVNode("span",{ref_key:"el",ref:t},o.toDisplayString(e.value),513)])):(o.openBlock(),o.createElementBlock("span",Ou,o.toDisplayString(e.value),1))}},Tu={class:"my-2"},Vu={class:"flex flex-col md:flex-row md:justify-between md:items-center"},Iu={class:"flex flex-row gap-2"},ar={__name:"Grid",props:{entityName:String,showAddButton:Boolean,showClearFilters:Boolean,columnsToShow:Array,editable:Boolean,deleteable:Boolean,showPagination:Boolean},setup(e){const t=Oe(),n=e;console.log("columnsToShow",n.columnsToShow);const r=mt.useRoute(),a=o.ref(n.entityName||r.params.entityName),i=o.ref({}),l=o.ref(""),s=o.ref(!1),d=o.ref(!1),{items:c,headers:u,first:f,totalRecords:m,pageSize:p,loading:g,sortBy:h,sortDirection:b,operatorMap:y,filterToSend:v,primarayKeyColumn:x,fullTextSearch:E,listingResponse:N,onFullTextSearch:$,getDatatypeByField:C,getColumnDatatype:k,onSort:w,onPage:S,onFilter:B,fetchEntityFilterData:I,fetchEntityByName:D}=Lc(a.value),P=o.ref();let M=o.ref(!1);const j=Y=>{i.value=Y.reduce((Q,le)=>{if(!le.filterable)return Q;let ce=Zt.CONTAINS;switch(le.datatype.toLowerCase()){case"string":case"uuid":ce=Zt.STARTS_WITH;break;case"date":ce=Zt.DATE_IS;break;case"numeric":case"int":case"integer":ce=Zt.EQUALS;break;case"bool":case"boolean":ce=Zt.EQUALS;break}return le.datatype=="bool"||le.datatype=="boolean"?Q[le.field]={value:null,matchMode:Zt.EQUALS}:Q[le.field]={operator:Eu.AND,constraints:[{value:null,matchMode:ce}]},Q},{})},q=()=>{j(u.value),v.value=ae(i.value),B()},F=Y=>{v.value=ae(i.value),B()},V=Y=>{Y?l.value=Y[x.value.name]:l.value="",s.value=!s.value},_=()=>{s.value=!1,I(!1)},J=Y=>{l.value=Y[x.value.name],d.value=!0},re=()=>{d.value=!1,I(!1)},ae=Y=>Object.keys(Y).map(Q=>{const le=Y[Q];return le.constraints?le.constraints.filter(ce=>ce.value!==null&&ce.value!=="").map(ce=>({columnName:Q,operator:y[ce.matchMode]??ce.matchMode,value:ce.value,columnType:C(Q)})):le.value!==null&&le.value!==""?{columnName:Q,operator:y[le.matchMode]??le.matchMode,value:le.value,columnType:C(Q)}:[]}).flat();return o.watch(()=>t.globalConfigs.appId,async Y=>{Y&&D(a.value)},{immediate:!0}),o.watch(()=>u.value,Y=>{!M.value&&Y&&Y.length&&(j(Y),M.value=!0)},{immediate:!0}),(Y,Q)=>{const le=o.resolveComponent("Button"),ce=o.resolveComponent("Toolbar"),xe=o.resolveComponent("ProgressSpinner"),He=o.resolveComponent("InputIcon"),Re=o.resolveComponent("IconField"),rt=o.resolveComponent("DatePicker"),Je=o.resolveComponent("InputNumber"),H=o.resolveComponent("Checkbox"),z=o.resolveComponent("Column"),fe=o.resolveComponent("DataTable");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",o.normalizeProps(o.guardReactiveProps(Y.$attrs)),[o.renderSlot(Y.$slots,"header"),e.showClearFilters||e.showAddButton?(o.openBlock(),o.createBlock(ce,{key:0,class:"mb-4 mt-4"},o.createSlots({_:2},[e.showClearFilters?{name:"start",fn:o.withCtx(()=>[o.createElementVNode("div",Tu,[o.createVNode(le,{type:"button",icon:"pi pi-filter-slash",label:"Clear",severity:"warning",onClick:Q[0]||(Q[0]=ge=>q())})])]),key:"0"}:void 0,e.showAddButton?{name:"end",fn:o.withCtx(()=>[o.createVNode(le,{label:"Add",icon:"pi pi-plus",class:"mr-2",severity:"success",onClick:Q[1]||(Q[1]=ge=>V())})]),key:"1"}:void 0]),1024)):o.createCommentVNode("",!0),o.createVNode(fe,{lazy:"",value:o.unref(c),loading:o.unref(g),ref_key:"dt",ref:P,stripedRows:!0,showGridlines:"",rowHover:!0,paginator:e.showPagination,rows:o.unref(p),rowsPerPageOptions:[10,25,50,100],totalRecords:o.unref(m),first:o.unref(f),sortField:o.unref(h),sortOrder:o.unref(b),filters:i.value,"onUpdate:filters":Q[5]||(Q[5]=ge=>i.value=ge),filterDisplay:"menu",scrollable:"",scrollHeight:"400px",onSort:o.unref(w),onPage:o.unref(S),onFilter:Q[6]||(Q[6]=ge=>F()),size:"large",paginatorTemplate:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} items"},{empty:o.withCtx(()=>Q[9]||(Q[9]=[o.createTextVNode(" No data found. ")])),loading:o.withCtx(()=>[o.createVNode(xe)]),header:o.withCtx(()=>[o.createElementVNode("div",Vu,[o.createVNode(Re,{iconPosition:"left",class:"block mt-2 md:mt-0"},{default:o.withCtx(()=>[o.createVNode(He,{class:"pi pi-search",onClick:Q[2]||(Q[2]=ge=>o.unref($)())}),o.createVNode(o.unref(Sr.InputText),{class:"w-full sm:w-auto",onKeyup:Q[3]||(Q[3]=o.withKeys(ge=>o.unref($)(),["enter"])),modelValue:o.unref(E),"onUpdate:modelValue":Q[4]||(Q[4]=ge=>o.isRef(E)?E.value=ge:null),placeholder:"Search..."},null,8,["modelValue"])]),_:1})])]),default:o.withCtx(()=>{var ge;return[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(u).filter(me=>!n.columnsToShow||n.columnsToShow.length===0||n.columnsToShow.includes(me.field)),me=>(o.openBlock(),o.createBlock(z,{key:me.field,dataType:o.unref(k)(me.datatype),field:me.field,header:me.name,sortable:me.sortable,showAddButton:!1,showFilterOperator:!1,style:{"text-wrap":"nowrap"}},o.createSlots({body:o.withCtx(({data:he})=>[o.createVNode(rr,{column:me,value:he[me.field]},null,8,["column","value"])]),_:2},[me.datatype.toLowerCase()==="date"&&me.filterable?{name:"filter",fn:o.withCtx(({filterModel:he})=>[o.createVNode(rt,{modelValue:he.value,"onUpdate:modelValue":Ee=>he.value=Ee,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])]),key:"0"}:me.datatype.toLowerCase()==="int"&&me.filterable?{name:"filter",fn:o.withCtx(({filterModel:he})=>[o.createVNode(Je,{modelValue:he.value,"onUpdate:modelValue":Ee=>he.value=Ee,placeholder:"Search..."},null,8,["modelValue","onUpdate:modelValue"])]),key:"1"}:me.datatype.toLowerCase()==="boolean"&&me.filterable?{name:"filter",fn:o.withCtx(({filterModel:he})=>[o.createVNode(H,{modelValue:he.value,"onUpdate:modelValue":Ee=>he.value=Ee,indeterminate:he.value===null,binary:""},null,8,["modelValue","onUpdate:modelValue","indeterminate"])]),key:"2"}:me.filterable?{name:"filter",fn:o.withCtx(({filterModel:he})=>[o.createVNode(o.unref(Sr.InputText),{style:{width:"150px"},type:"text",modelValue:he.value,"onUpdate:modelValue":Ee=>he.value=Ee,class:"p-column-filter",placeholder:"Search..."},null,8,["modelValue","onUpdate:modelValue"])]),key:"3"}:void 0]),1032,["dataType","field","header","sortable"]))),128)),((ge=o.unref(c))==null?void 0:ge.length)>0&&(e.editable||e.deleteable)?(o.openBlock(),o.createBlock(z,{key:0,header:"Actions"},{body:o.withCtx(({data:me})=>[o.createElementVNode("div",Iu,[e.editable?(o.openBlock(),o.createBlock(le,{key:0,onClick:he=>V(me),icon:"pi pi-pencil",severity:"success",size:"",rounded:"","aria-label":"Edit"},null,8,["onClick"])):o.createCommentVNode("",!0),e.deleteable?(o.openBlock(),o.createBlock(le,{key:1,onClick:he=>J(me),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"},null,8,["onClick"])):o.createCommentVNode("",!0)])]),_:1})):o.createCommentVNode("",!0)]}),_:1},8,["value","loading","paginator","rows","totalRecords","first","sortField","sortOrder","filters","onSort","onPage"]),o.renderSlot(Y.$slots,"footer")],16),s.value?(o.openBlock(),o.createBlock(gu,{key:0,showForm:s.value,"onUpdate:showForm":Q[7]||(Q[7]=ge=>s.value=ge),entityName:o.unref(N).entityName,recordId:l.value,onOnSaveDialog:_},null,8,["showForm","entityName","recordId"])):o.createCommentVNode("",!0),d.value?(o.openBlock(),o.createBlock(hu,{key:1,showDeleteDialog:d.value,"onUpdate:showDeleteDialog":Q[8]||(Q[8]=ge=>d.value=ge),entityName:o.unref(N).entityName,recordId:l.value,onOnDeleteItem:re},null,8,["showDeleteDialog","entityName","recordId"])):o.createCommentVNode("",!0)],64)}}},Fu={class:"flex flex-col p-3"},Pu={class:"flex justify-center flex-row mb-2 cursor-pointer"},Ru={style:{"word-break":"break-all"}},Du={__name:"LinkEntityContent",props:{linkEntityListItem:{type:Object,required:!0}},setup(e){mt.useRoute();const t=Oe(),n=o.ref("");t.getAppId()!=null&&t.getAppId()!=""&&(n.value=t.getAppId());const r=o.ref(),a=o.ref(!1),i=o.ref(!1),l=o.ref({}),s=o.ref([{label:"Remove association",icon:"",command:f=>{d()}}]),d=()=>{console.log(l.value),console.log("Function is calling")},c=(f,m)=>{l.value=m,r.value.show(f),i.value=!0},u=()=>{l.value={},i.value=!1};return(f,m)=>{const p=o.resolveComponent("Button"),g=o.resolveComponent("ContextMenu"),h=o.resolveComponent("router-link");return o.openBlock(),o.createElementBlock("div",{onMouseenter:m[4]||(m[4]=o.withModifiers(b=>a.value=!0,["prevent"])),onMouseleave:m[5]||(m[5]=o.withModifiers(b=>a.value=!1,["prevent"])),class:"flex relative m-3",style:{border:"1px solid var(--surface-border)","border-radius":"5px"}},[o.withDirectives(o.createVNode(p,{onClick:m[0]||(m[0]=b=>c(b,e.linkEntityListItem)),class:"!absolute right-0",size:"small",style:{width:"55px",height:"25px","border-radius":"5px","font-size":"12px"}},{default:o.withCtx(()=>m[6]||(m[6]=[o.createTextVNode(" More")])),_:1},512),[[o.vShow,a.value||i.value]]),o.createVNode(g,{ref_key:"menu",ref:r,model:s.value,onMouseenter:m[1]||(m[1]=o.withModifiers(b=>a.value=!0,["prevent"])),onMouseleave:m[2]||(m[2]=o.withModifiers(b=>a.value=!1,["prevent"])),onHide:m[3]||(m[3]=b=>u())},null,8,["model"]),o.createElementVNode("div",Fu,[o.createElementVNode("div",Pu,[o.createElementVNode("div",Ru,o.toDisplayString(e.linkEntityListItem.entityName),1),o.createVNode(h,{to:{name:"entity360view",params:{entityName:e.linkEntityListItem.entityName,id:e.linkEntityListItem.id,appId:n.value}},target:"_blank"},{default:o.withCtx(()=>m[7]||(m[7]=[o.createElementVNode("div",{class:"pi pi-external-link ml-3"},null,-1)])),_:1},8,["to"])]),o.createElementVNode("div",null,"Id: "+o.toDisplayString(e.linkEntityListItem.id),1)])],32)}}},_u={class:"flex flex-col mt-3"},Au={class:"flex flex-row items-center"},Lu={class:"flex items-center justify-center mt-5"},zu={key:0,class:"pi pi-caret-right"},Mu={key:1,class:"pi pi-caret-down"},ju={key:0},Uu={class:"flex flex-col mt-5"},Hu={class:"col-12"},Wu={class:"flex flex-col mt-5"},qu={class:"col-12 font-bold"},Ku={key:0},Gu={class:"flex flex-col mt-5"},Yu={class:"col-12"},Xu={class:"flex flex-col mt-5"},Ju={class:"col-12"},Qu={class:"flex flex-col mt-5"},Zu={class:"col-12"},ef={class:"flex flex-row justify-between items-center mt-5"},tf={key:1,class:"mt-2"},nf={class:"flex flex-row justify-between items-center"},of={key:1,class:"text-red-500"},rf={class:"flex flex-col mt-5"},af={class:"flex flex-row justify-between items-center mt-2"},lf={class:"flex flex-row items-center mt-5 mb-5"},sf={class:"font-bold"},cf={class:"font-bold ml-2 flex-1"},df={class:"flex flex-row justify-center items-center mb-2"},uf={class:"ml-2 flex-1"},ff={key:0,class:"pi pi-exclamation-circle"},mf={class:"flex flex-col justify-center"},pf={class:"flex flex-row justify-between items-center"},gf={class:"justify-start"},hf={class:"justify-start"},bf=Ie({__name:"EntityLookup",props:o.mergeModels({linkedEntity:{type:Object,required:!0},entity360Name:{type:String,required:!0},entity360Id:{required:!0},saveExistingRelatedEntityRecord:{type:Function,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){mt.useRoute();const t=e,n=o.useModel(e,"modelValue"),r=new We,a=o.ref({}),i=o.ref([]),l=o.ref({}),s=o.ref([]),d=o.ref([]),c=o.ref({}),u=o.ref("id"),f=o.ref(1),m=o.ref([]),p=o.ref(25),g=o.ref(0),h=o.ref(0),b=o.ref(0);let y=o.ref([]);const v=o.ref(!1),x={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"},E={gt:"is greater than",dateAfter:"is after",equals:"is equals",dateIs:"is equals",notEquals:"is not equals",dateIsNot:"is not equals",lt:"is less than",dateBefore:"is before",lte:"is less than or equal to",gte:"is greater than or equal to",between:"between",contains:"contains",startsWith:"starts with",notContains:"not contains",endsWith:"ends with"};o.onMounted(()=>{$()});const N=H=>t.linkedEntity.list.some(z=>z[c.value.name]===H),$=async()=>{try{const H={sortBy:[u.value],sortDirection:f.value===1?"ASC":"DESC",pageSize:p.value,currentPage:g.value,columnList:null,filter:y.value,fullTextSearch:""},z=await r.searchEntityRecords(t.linkedEntity.entityName,H);z&&z.response&&(a.value=z.response,s.value=z.response.entity.entityDefinition.columns,d.value=xe(z.response.entity.entityDefinition.columns),h.value=z.response.totalRecords,await C(),await k(),w())}catch{}finally{}},C=async()=>{for(let H=0;H<s.value.length;H++){const z=s.value[H];!z.autoGeneerated&&z.foreignKey&&z.foreignKey.referencedEntityName.toLowerCase()==t.entity360Name.toLowerCase()&&(l.value=z)}},k=async()=>{for(let H=0;H<s.value.length;H++){const z=s.value[H];if(z.primaryKey&&z.primaryKey==!0){c.value=z;break}}},w=()=>{for(let H=0;H<t.linkedEntity.list.length;H++){const z=t.linkedEntity.list[H];z.is_deleted==!1&&z[l.value.name]==t.entity360Id&&i.value.push(z[c.value.name])}},S=()=>{let H=JSON.parse(JSON.stringify(i.value));H=H.filter(fe=>!N(fe));let z={linkEntityName:a.value.entityName,linkRecordIdList:[]};for(let fe=0;fe<H.length;fe++){const ge=H[fe];z.linkRecordIdList.push(ge)}t.saveExistingRelatedEntityRecord(z)},B=()=>{v.value=!v.value},I=[{label:"Starts with",value:"startsWith"},{label:"Contains",value:"contains"},{label:"Not contains",value:"notContains"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],D=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Less than",value:"lt"},{label:"Less than or equal to",value:"lte"},{label:"Greater than",value:"gt"},{label:"Greater than or equal to",value:"gte"}],P=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],M=[{label:"Date is",value:"dateIs"},{label:"Date is not",value:"dateIsNot"},{label:"Date is before",value:"dateBefore"},{label:"Date is after",value:"dateAfter"}],j=[{label:"ASC",value:1},{label:"DESC",value:-1}];let q=[];const F=o.computed(()=>d.value.filter(H=>H.sortable)),V=o.computed(()=>d.value.filter(H=>H.filterable)),_=H=>d.value.filter(z=>{var fe;return z.filterable?((fe=m.value[H])==null?void 0:fe.columnName)===z.name?!0:!m.value.some((ge,me)=>me!==H&&ge.columnName===z.name):!1}).map(z=>({label:z.name,value:z.field})),J=H=>{let z="";switch(Re(H.columnName).toLowerCase()){case"string":case"uuid":z="startsWith";break;case"date":z="dateIs";break;case"numeric":case"int":case"integer":z="equals";break;case"bool":case"boolean":z="equals";break}H.operator=z,H.value=""},re=H=>{const z=Re(H.columnName);switch(z&&z.toLowerCase()){case"integer":case"int":case"numeric":q=D;break;case"date":q=M;break;case"bool":case"boolean":q=P;break;default:q=I}return q},ae=H=>{if(H&&H.columnName){const z=Re(H.columnName);return rt(z)}else return""},Y=()=>{for(let H=0;H<m.value.length;H++){const z=m.value[H];z.editing=!1}m.value.push({columnName:"",value:"",operator:"",editing:!0})},Q=H=>{m.value.splice(H,1)},le=H=>{H.editing=!H.editing},ce=()=>{let H=JSON.parse(JSON.stringify(m.value));y.value=[];for(let z=0;z<H.length;z++){const fe=H[z];delete fe.editing,fe.columnName&&fe.operator&&fe.value&&(fe.columnType=Re(fe.columnName),fe.operator=x[fe.operator],y.value.push(fe))}$()},xe=H=>H.map(z=>({field:z.name,name:z.displayName?z.displayName:z.name,filterable:z.filterable,datatype:z.type,sortable:!0,displayFormatKey:z.displayFormatKey,displayFormat:z.displayFormat})),He=()=>{$()},Re=H=>{const z=d.value.find(fe=>fe.field===H);return z?z.datatype:null},rt=H=>{switch(H.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},Je=H=>{p.value=H.rows,g.value=H.page,b.value=H.first,$()};return(H,z)=>{var It,qt;const fe=o.resolveComponent("InputIcon"),ge=o.resolveComponent("InputText"),me=o.resolveComponent("IconField"),he=o.resolveComponent("Select"),Ee=o.resolveComponent("Divider"),Me=o.resolveComponent("InputNumber"),ft=o.resolveComponent("DatePicker"),Ve=o.resolveComponent("Button"),je=o.resolveComponent("Checkbox"),Qe=o.resolveComponent("Paginator"),Vt=o.resolveDirective("tooltip");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",_u,[o.createElementVNode("div",Au,[o.createVNode(me,{class:"block mt-2 md:mt-0 w-full"},{default:o.withCtx(()=>[o.createVNode(fe,{onClick:z[0]||(z[0]=()=>{}),class:"pi pi-search"}),o.createVNode(ge,{class:"w-full",onKeyup:z[1]||(z[1]=o.withKeys(()=>{},["enter"])),placeholder:`Search ${a.value.entityName}`},null,8,["placeholder"])]),_:1})]),o.createElementVNode("div",Lu,[o.createElementVNode("div",{class:"flex items-center cursor-pointer sorting-filter-section flex-1 line-height-4",onClick:z[2]||(z[2]=Z=>B())},[v.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",zu)),v.value?(o.openBlock(),o.createElementBlock("div",Mu)):o.createCommentVNode("",!0),z[9]||(z[9]=o.createElementVNode("div",{class:"ml-3 font-bold"}," Sorting & Filters ",-1))])]),v.value?(o.openBlock(),o.createElementBlock("div",ju,[o.createElementVNode("div",Uu,[z[10]||(z[10]=o.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),o.createElementVNode("div",Hu,[o.createVNode(he,{modelValue:u.value,"onUpdate:modelValue":z[3]||(z[3]=Z=>u.value=Z),options:F.value,optionLabel:"name",optionValue:"field",highlightOnSelect:!1,class:"w-full",onChange:z[4]||(z[4]=Z=>He(H.event))},null,8,["modelValue","options"])])]),o.createElementVNode("div",Wu,[z[11]||(z[11]=o.createElementVNode("div",{class:"col-12 font-bold"},[o.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),o.createElementVNode("div",qu,[o.createVNode(he,{modelValue:f.value,"onUpdate:modelValue":z[5]||(z[5]=Z=>f.value=Z),options:j,optionLabel:"label",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:z[6]||(z[6]=Z=>He(H.event))},null,8,["modelValue"])])]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(m.value,(Z,at)=>(o.openBlock(),o.createElementBlock("div",{key:at},[Z.editing?(o.openBlock(),o.createElementBlock("div",Ku,[o.createVNode(Ee,{class:"mt-5"}),o.createElementVNode("div",Gu,[z[12]||(z[12]=o.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),o.createElementVNode("div",Yu,[o.createVNode(he,{modelValue:Z.columnName,"onUpdate:modelValue":Be=>Z.columnName=Be,options:_(at),optionLabel:"label",placeholder:"Select column",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:Be=>J(Z)},null,8,["modelValue","onUpdate:modelValue","options","onChange"])])]),o.createElementVNode("div",Xu,[z[13]||(z[13]=o.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),o.createElementVNode("div",Ju,[o.createVNode(he,{modelValue:Z.operator,"onUpdate:modelValue":Be=>Z.operator=Be,options:re(Z),optionLabel:"label",placeholder:"Select operator",optionValue:"value",highlightOnSelect:!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","options"])])]),o.createElementVNode("div",Qu,[z[14]||(z[14]=o.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),o.createElementVNode("div",Zu,[ae(Z)=="numeric"?(o.openBlock(),o.createBlock(Me,{key:0,format:!1,class:"w-full",modelValue:Z.value,"onUpdate:modelValue":Be=>Z.value=Be,placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"])):ae(Z)=="date"?(o.openBlock(),o.createBlock(ft,{key:1,class:"w-full",modelValue:Z.value,"onUpdate:modelValue":Be=>Z.value=Be,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])):(o.openBlock(),o.createBlock(ge,{key:2,modelValue:Z.value,"onUpdate:modelValue":Be=>Z.value=Be,class:"w-full",placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"]))])]),o.createElementVNode("div",ef,[o.createVNode(Ve,{style:{width:"100px"},label:"Hide",icon:"",severity:"warning",onClick:Be=>le(Z)},null,8,["onClick"]),o.createVNode(Ve,{style:{width:"100px"},label:"Delete",icon:"",severity:"danger",onClick:Be=>Q(at)},null,8,["onClick"])])])):o.createCommentVNode("",!0),Z.editing?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",tf,[o.createVNode(Ee),o.createElementVNode("div",nf,[o.createElementVNode("span",null,[Z.columnName||Z.operator||Z.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",{class:o.normalizeClass({"text-red-500":!Z.columnName})},o.toDisplayString(Z.columnName?" "+Z.columnName:" column"),3),o.createElementVNode("span",{class:o.normalizeClass({"text-red-500":!E[Z.operator]})},o.toDisplayString(Z.operator?" "+E[Z.operator]:" operator"),3),o.createElementVNode("span",{class:o.normalizeClass({"text-red-500":!Z.value})},o.toDisplayString(Z.value?" "+Z.value:" value"),3)],64)):(o.openBlock(),o.createElementBlock("span",of,"Filter is empty"))]),o.createVNode(Ve,{style:{width:"100px"},label:"Edit",icon:"",severity:"info",onClick:Be=>le(Z)},null,8,["onClick"])])]))]))),128)),o.createElementVNode("div",rf,[o.createVNode(Ee),o.createElementVNode("div",af,[o.createVNode(Ve,{style:{width:"100px"},label:"Add",disabled:V.value.length===m.value.length,icon:"",severity:"success",onClick:Y},null,8,["disabled"]),o.createVNode(Ve,{style:{width:"100px"},label:"Apply",severity:"info",onClick:ce})])])])):o.createCommentVNode("",!0),o.createElementVNode("div",lf,[o.createElementVNode("div",sf,o.toDisplayString((It=a.value)==null?void 0:It.totalRecords),1),o.createElementVNode("div",cf,o.toDisplayString((qt=a.value)==null?void 0:qt.entityName),1)]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value.result,(Z,at)=>(o.openBlock(),o.createElementBlock("div",{key:at},[o.createElementVNode("div",df,[o.createVNode(je,{disabled:N(Z[c.value.name]),modelValue:i.value,"onUpdate:modelValue":z[7]||(z[7]=Be=>i.value=Be),value:Z[c.value.name]},null,8,["disabled","modelValue","value"]),o.createElementVNode("div",uf,[o.createTextVNode(o.toDisplayString(e.linkedEntity.entityName)+" ",1),o.createElementVNode("span",null,o.toDisplayString(Z[c.value.name]),1)]),N(Z[c.value.name])?o.withDirectives((o.openBlock(),o.createElementBlock("div",ff,null,512)),[[Vt,"This record is already associated.",void 0,{left:!0}]]):o.createCommentVNode("",!0)])]))),128)),o.createVNode(Qe,{rows:p.value,totalRecords:h.value,rowsPerPageOptions:[10,25,50,100],onPage:Je,template:"FirstPageLink PageLinks LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:""},null,8,["rows","totalRecords"])]),o.createElementVNode("div",mf,[o.createVNode(Ee,{class:"mt-5"}),o.createElementVNode("div",pf,[o.createElementVNode("div",gf,[o.createVNode(Ve,{label:"Cancel",icon:"",severity:"secondary",onClick:z[8]||(z[8]=Z=>n.value=!1)})]),o.createElementVNode("div",hf,[o.createVNode(Ve,{label:"Save",severity:"success",onClick:S})])])])],64)}}},[["__scopeId","data-v-a358808d"]]),yf={class:"field flex flex-col"},kf={key:0,class:"flex items-center"},wf={key:1},vf={class:"flex items-center"},xf={class:"flex flex-col justify-center"},Sf={class:"flex flex-row justify-between items-center"},Cf={class:"justify-start"},Ef={class:"justify-start"},Bf={__name:"EntityLookupObject",props:o.mergeModels({linkedEntity:{type:Object,required:!0},entity360Name:{type:String,required:!0},entity360Id:{type:[String,Number]},saveExistingEntityObject:{type:Function}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){mt.useRoute();const{getEntityRecords:t,searchEntityRecords:n,saveRelatedEntityRecord:r,getRecord:a,addRecord:i,updateRecord:l,deleteRecord:s}=We(),d=e,c=o.useModel(e,"modelValue");new EntityRecordService;const u=o.ref({}),f=o.ref({});let m=o.ref("");const p=o.ref({}),g=o.ref({});o.onMounted(async()=>{console.log("linkedEntity"),console.log(d.linkedEntity),console.log("entity360Name"),console.log(d.entity360Name),console.log("entity360Id"),console.log(d.entity360Id),await b(),await h()});const h=async()=>{try{const N=await t(d.linkedEntity.entityName);N&&N.response&&(u.value=N.response,await y(N.response.entity.entityDefinition.columns),await x(),console.log(u.value))}catch{}finally{}},b=async()=>{try{const N=await a(d.entity360Name,d.entity360Id);N&&N.response&&(f.value=N.response,await v(N.response.entity.entityDefinition.columns),console.log(f.value))}catch{}finally{}},y=async N=>{for(let $=0;$<N.length;$++){const C=N[$];if(C.primaryKey&&C.primaryKey==!0){p.value=C;break}}},v=async N=>{for(let $=0;$<N.length;$++){const C=N[$];if(!C.autoGeneerated&&C.foreignKey&&C.foreignKey.referencedEntityName.toLowerCase()==d.linkedEntity.entityName.toLowerCase()){g.value=C;break}}},x=async()=>{for(let N=0;N<u.value.result.length;N++){const $=u.value.result[N];if($[p.value.name]==f.value.result[0][g.value.name]){m.value=$;break}}},E=()=>{const N={linkedEntityRecordId:m.value[p.value.name],linkedEntityName:d.linkedEntity.entityName,relationType:"ManyToOne"};d.saveExistingEntityObject(N)};return(N,$)=>{const C=o.resolveComponent("Select"),k=o.resolveComponent("Divider"),w=o.resolveComponent("Button");return o.openBlock(),o.createElementBlock("div",yf,[o.createVNode(C,{modelValue:o.unref(m),"onUpdate:modelValue":$[0]||($[0]=S=>o.isRef(m)?m.value=S:m=S),"item-value":p.value.name,options:u.value.result,filter:"",optionLabel:p.value.name,placeholder:"Select "+p.value.name,class:"w-full"},{value:o.withCtx(S=>[S.value?(o.openBlock(),o.createElementBlock("div",kf,[o.createElementVNode("div",null,o.toDisplayString(S.value[p.value.name]),1)])):(o.openBlock(),o.createElementBlock("span",wf,o.toDisplayString(S.placeholder),1))]),option:o.withCtx(S=>[o.createElementVNode("div",vf,[o.createElementVNode("div",null,o.toDisplayString(S.option[p.value.name]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"]),o.createElementVNode("div",xf,[o.createVNode(k),o.createElementVNode("div",Sf,[o.createElementVNode("div",Cf,[o.createVNode(w,{label:"Cancel",icon:"",severity:"secondary",onClick:$[1]||($[1]=S=>c.value=!1)})]),o.createElementVNode("div",Ef,[o.createVNode(w,{label:"Save",severity:"success",onClick:E})])])])])}}},$f={style:{"font-weight":"700","font-size":"1.25rem"}},Nf={class:"flex flex-col"},Of={class:"flex flex-row justify-between items-center"},Tf={class:"justify-start"},Vf={class:"justify-start"},If="",Ff={__name:"CreateRelatedentity",props:o.mergeModels({entity360Id:{required:!0},entity360Name:{type:String,required:!0},linkedEntity:{type:Object,required:!0}},{showCreateRelatedEntityForm:{},showCreateRelatedEntityFormModifiers:{}}),emits:o.mergeModels(["onSaveDialog"],["update:showCreateRelatedEntityForm"]),setup(e,{emit:t}){const n=o.useModel(e,"showCreateRelatedEntityForm");mt.useRoute();const r=e,a=r.linkedEntity.entityName,i=t,l=o.ref("Add existing");o.onMounted(()=>{p()});const{formData:s,columns:d,errors:c,backendErrors:u,clearErrors:f,saveRecord:m,fetchAllRecords:p,saveRelatedEntityRecord:g}=tr(a,If,i),h=()=>{for(let x=0;x<d.value.length;x++){const E=d.value[x];!E.autoGenerated&&E.foreignKey&&(s.value[E.name]=r.entity360Id)}const v={relationType:r.linkedEntity.relationType,linkedEntities:{entityLinkage:[{linkEntityName:r.entity360Name,linkRecordIdList:[r.entity360Id]}]}};m(v)},b=v=>{var x;if(((x=v==null?void 0:v.linkRecordIdList)==null?void 0:x.length)>0){const E={entityLinkage:[{linkEntityName:v.linkEntityName,linkRecordIdList:v.linkRecordIdList}]};g(r.entity360Name,r.entity360Id,E)}},y=v=>{const x={entityLinkage:[{linkEntityName:r.entity360Name,linkRecordIdList:[r.entity360Id]}]};g(v.linkedEntityName,v.linkedEntityRecordId,x)};return(v,x)=>{const E=o.resolveComponent("Tab"),N=o.resolveComponent("TabList"),$=o.resolveComponent("Divider"),C=o.resolveComponent("Button"),k=o.resolveComponent("TabPanel"),w=o.resolveComponent("TabPanels"),S=o.resolveComponent("Tabs"),B=o.resolveComponent("Drawer");return o.openBlock(),o.createBlock(B,{visible:n.value,"onUpdate:visible":x[3]||(x[3]=I=>n.value=I),blockScroll:!0,position:"right",class:"p-fluid layout-profile-sidebar",style:{width:"40%"},pt:{closeButton:"ml-auto"}},{header:o.withCtx(()=>[o.createElementVNode("span",$f,o.toDisplayString(l.value)+" "+o.toDisplayString(e.linkedEntity.entityName),1)]),default:o.withCtx(()=>[o.createVNode(S,{value:"1"},{default:o.withCtx(()=>[o.createVNode(N,null,{default:o.withCtx(()=>[o.createVNode(E,{value:"0"},{default:o.withCtx(()=>x[4]||(x[4]=[o.createTextVNode("Create new")])),_:1}),o.createVNode(E,{value:"1"},{default:o.withCtx(()=>x[5]||(x[5]=[o.createTextVNode("Add existing")])),_:1})]),_:1}),o.createVNode(w,null,{default:o.withCtx(()=>[o.createVNode(k,{value:"0"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(d),(I,D)=>{var P;return o.openBlock(),o.createElementBlock("div",{key:D,class:"mt-3"},[!I.autoGenerated&&!I.foreignKey?(o.openBlock(),o.createBlock(Xn,{key:0,modelValue:o.unref(s)[I.name],"onUpdate:modelValue":M=>o.unref(s)[I.name]=M,column:I,errors:(P=o.unref(c)[I.name])==null?void 0:P.messages,onInput:o.unref(f)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"])):o.createCommentVNode("",!0)])}),128)),o.createElementVNode("div",Nf,[o.createVNode($),o.createElementVNode("div",Of,[o.createElementVNode("div",Tf,[o.createVNode(C,{label:"Cancel",icon:"",severity:"secondary",onClick:x[0]||(x[0]=I=>n.value=!1)})]),o.createElementVNode("div",Vf,[o.createVNode(C,{label:"Save",severity:"success",onClick:h})])])])]),_:1}),o.createVNode(k,{value:"1"},{default:o.withCtx(()=>[e.linkedEntity.relationType=="ONE_TO_MANY"?(o.openBlock(),o.createBlock(bf,{key:0,modelValue:n.value,"onUpdate:modelValue":x[1]||(x[1]=I=>n.value=I),linkedEntity:e.linkedEntity,entity360Name:e.entity360Name,entity360Id:e.entity360Id,saveExistingRelatedEntityRecord:b},null,8,["modelValue","linkedEntity","entity360Name","entity360Id"])):o.createCommentVNode("",!0),e.linkedEntity.relationType=="MANY_TO_ONE"?(o.openBlock(),o.createBlock(Bf,{key:1,modelValue:n.value,"onUpdate:modelValue":x[2]||(x[2]=I=>n.value=I),linkedEntity:e.linkedEntity,entity360Name:e.entity360Name,entity360Id:e.entity360Id,saveExistingEntityObject:y},null,8,["modelValue","linkedEntity","entity360Name","entity360Id"])):o.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1})]),_:1},8,["visible"])}}},Pf={class:"flex flex-col border-bottom-section pb-3 pt-3"},Rf={class:"flex items-center pl-3 pr-3 justify-between"},Df={key:0,class:"pi pi-caret-right"},_f={key:1,class:"pi pi-caret-down"},Af={class:"ml-3 font-bold"},Lf={class:"ml-1"},zf={class:"text-right"},Mf={key:0},jf=Ie({__name:"LinkEntitySection",props:{entity360Id:{required:!0},entity360Name:{type:String,required:!0},linkedEntity:{type:Object,required:!0},entity360Name:{type:[String,Number]},onSaveRelatedEnttity:{type:Function}},setup(e){mt.useRoute();const t=e,n=o.ref(!1),r=o.ref(!1),a=()=>{n.value=!n.value},i=()=>{r.value=!r.value},l=()=>{r.value=!1,t.onSaveRelatedEnttity()},s=o.computed(()=>t.linkedEntity.list.filter(d=>!d.is_deleted).length);return(d,c)=>{const u=o.resolveComponent("Button");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",Pf,[o.createElementVNode("div",Rf,[o.createElementVNode("div",{class:"flex cursor-pointer items-center linked-entity-section grow line-height-4",onClick:c[0]||(c[0]=f=>a())},[n.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Df)),n.value?(o.openBlock(),o.createElementBlock("div",_f)):o.createCommentVNode("",!0),o.createElementVNode("div",Af,o.toDisplayString(e.linkedEntity.entityName),1),o.createElementVNode("div",Lf," ("+o.toDisplayString(s.value)+") ",1)]),o.createElementVNode("div",zf,[o.createVNode(u,{label:"Add",icon:"pi pi-plus",size:"small",onClick:c[1]||(c[1]=f=>i())})])]),n.value?(o.openBlock(),o.createElementBlock("div",Mf,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.linkedEntity.list,(f,m)=>(o.openBlock(),o.createElementBlock("div",{class:"flex flex-col",key:m},[f.is_deleted?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(Du,{key:0,linkEntityListItem:f},null,8,["linkEntityListItem"]))]))),128))])):o.createCommentVNode("",!0)]),r.value?(o.openBlock(),o.createBlock(Ff,{key:0,showCreateRelatedEntityForm:r.value,"onUpdate:showCreateRelatedEntityForm":c[2]||(c[2]=f=>r.value=f),linkedEntity:e.linkedEntity,entity360Name:e.entity360Name,entity360Id:e.entity360Id,onOnSaveDialog:l},null,8,["showCreateRelatedEntityForm","linkedEntity","entity360Name","entity360Id"])):o.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-412eec44"]]),Uf={key:0},Hf={class:"flex"},Wf={class:"p-3 mt-3 flex-col items-center"},qf={key:0,class:"pi pi-caret-right"},Kf={key:1,class:"pi pi-caret-down"},Gf={class:"font-bold ml-2"},Yf={key:0,class:"flex flex-col mt-4"},Xf={class:"flex flex-col mt-2"},Jf={class:"flex flex-row flex-wrap justify-between pl-5"},Qf={class:"flex flex-col"},Zf={class:"font-bold"},em={class:"mt-2"},tm={key:0,class:"flex flex-col",style:{position:"relative","max-width":"400px","background-color":"var(--surface-card)"}},nm={key:2,style:{width:"350px"},class:"flex flex-col justify-center"},om={key:0,class:"custom-sidebar"},rm={class:"custom-sidebar-content"},am={class:"custom-sidebar-button"},im={class:"custom-sidebar-text"},ii=Ie({__name:"Entity360",props:{entityName:{type:String},recordId:{type:String},variable:{type:String,default:"item"},linkedEntity:Array},emits:["onSaveDialog"],setup(e,{expose:t,emit:n}){var B,I;const r=Oe(),a=mt.useRoute(),i=e,l=o.ref(!0),s=o.ref(!1),d=o.ref([]);let c=(B=a==null?void 0:a.params)==null?void 0:B.entityName,u=(I=a==null?void 0:a.params)==null?void 0:I.id;i.entityName&&(c=i.entityName),i.recordId&&(u=i.recordId);const f=n,{formData:m,columns:p,errors:g,backendErrors:h,isDataChange:b,linkedEntities:y,primarayColumn:v,clearErrors:x,saveRecord:E,getRelatedEntityRecordById:N,cancleRecord:$}=tr(c,u,f);o.watch(()=>r.globalConfigs.appId,async D=>{D&&N()},{immediate:!0});const C=()=>{l.value=!l.value},k=()=>{s.value=!s.value},w=()=>{N()},S=D=>{if(!d.value||d.value.length===0)return[];const P=d.value.find(M=>M.entityName===D);return P&&P.list?P.list:(console.log("No related entity found"),[])};return t({getRelatedEntity:S}),o.watch(()=>y.value,D=>{Array.isArray(D)&&D.length>0&&D[0]&&(d.value=D)},{immediate:!0,deep:!0}),(D,P)=>{var ae;const M=o.resolveComponent("SplitterPanel"),j=o.resolveComponent("Tab"),q=o.resolveComponent("TabList"),F=o.resolveComponent("TabPanel"),V=o.resolveComponent("TabPanels"),_=o.resolveComponent("Tabs"),J=o.resolveComponent("Splitter"),re=o.resolveComponent("Button");return D.$slots["list-item-display-360"]?(o.openBlock(),o.createElementBlock("div",Uf,[o.renderSlot(D.$slots,"header",{},void 0,!0),o.createElementVNode("div",null,[o.renderSlot(D.$slots,"list-item-display-360",o.normalizeProps({[e.variable||""]:{formData:o.unref(m),columns:o.unref(p),linkedEntities:o.unref(y),errors:o.unref(g),recordId:o.unref(u),entityName:o.unref(c),getRelatedEntity:S}}),void 0,!0)]),o.renderSlot(D.$slots,"footer",{},void 0,!0)])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",Hf,[o.createVNode(J,{class:"flex-1",layout:"horizontal",gutterSize:8,size:100},{default:o.withCtx(()=>[o.createVNode(M,{size:20,minSize:10,maxSize:20},{default:o.withCtx(()=>[o.createElementVNode("div",Wf,[o.createElementVNode("div",{onClick:P[0]||(P[0]=Y=>C()),class:"section-heading cursor-pointer"},[l.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("i",qf)),l.value?(o.openBlock(),o.createElementBlock("i",Kf)):o.createCommentVNode("",!0),o.createElementVNode("span",Gf," About this "+o.toDisplayString(o.unref(c)),1)]),l.value?(o.openBlock(),o.createElementBlock("div",Yf,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(p),(Y,Q)=>{var le;return o.openBlock(),o.createElementBlock("div",{key:Q},[Y.autoGenerated?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(Xn,{key:0,modelValue:o.unref(m)[Y.name],"onUpdate:modelValue":ce=>o.unref(m)[Y.name]=ce,column:Y,errors:(le=o.unref(g)[Y.name])==null?void 0:le.messages,onInput:o.unref(x)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"]))])}),128))])):o.createCommentVNode("",!0)])]),_:1}),o.createVNode(M,{size:55,minSize:35,style:{height:"100%"}},{default:o.withCtx(()=>[o.createVNode(_,{value:"0"},{default:o.withCtx(()=>[o.createVNode(q,null,{default:o.withCtx(()=>[o.createVNode(j,{value:"0"},{default:o.withCtx(()=>P[3]||(P[3]=[o.createTextVNode("Overview")])),_:1}),o.createVNode(j,{value:"1"},{default:o.withCtx(()=>P[4]||(P[4]=[o.createTextVNode("Activity")])),_:1})]),_:1}),o.createVNode(V,null,{default:o.withCtx(()=>[o.createVNode(F,{value:"0"},{default:o.withCtx(()=>[o.createElementVNode("div",Xf,[P[5]||(P[5]=o.createElementVNode("h3",{class:"mt-2 text-xl font-semibold"},"Data highlights",-1)),o.createElementVNode("div",Jf,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(p).filter(Y=>Y.autoGenerated),(Y,Q)=>(o.openBlock(),o.createElementBlock("div",{key:Q,class:"column-item"},[o.createElementVNode("div",Qf,[o.createElementVNode("div",Zf,o.toDisplayString(Y.name),1),o.createElementVNode("div",em,[o.createVNode(rr,{column:Y,value:o.unref(m)[Y.name]},null,8,["column","value"])])])]))),128))])])]),_:1}),o.createVNode(F,{value:"1"})]),_:1})]),_:1})]),_:1})]),_:1}),((ae=o.unref(y))==null?void 0:ae.length)>0?(o.openBlock(),o.createElementBlock("div",tm,[s.value?(o.openBlock(),o.createBlock(re,{key:0,icon:"pi pi-caret-right",rounded:"",onClick:k,"aria-label":"Filter",style:{height:"2rem",width:"2rem",left:"-20px"}})):o.createCommentVNode("",!0),s.value?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(re,{key:1,icon:"pi pi-caret-left",rounded:"",onClick:k,"aria-label":"Filter",style:{height:"2rem",width:"2rem",left:"-20px"}})),s.value?(o.openBlock(),o.createElementBlock("div",nm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(y),(Y,Q)=>(o.openBlock(),o.createElementBlock("div",{key:Q},[o.createVNode(jf,{entity360Name:o.unref(c),entity360Id:o.unref(u),linkedEntity:Y,onSaveRelatedEnttity:w},null,8,["entity360Name","entity360Id","linkedEntity"])]))),128))])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)]),o.unref(b)?(o.openBlock(),o.createElementBlock("div",om,[o.createElementVNode("div",rm,[o.createElementVNode("div",am,[o.createVNode(re,{severity:"primary",onClick:P[1]||(P[1]=Y=>o.unref(E)())},{default:o.withCtx(()=>P[6]||(P[6]=[o.createTextVNode("Save")])),_:1}),o.createVNode(re,{style:{"margin-left":"10px"},severity:"secondary",onClick:P[2]||(P[2]=Y=>o.unref($)())},{default:o.withCtx(()=>P[7]||(P[7]=[o.createTextVNode("Cancel")])),_:1})]),o.createElementVNode("div",im," You've changed property in the "+o.toDisplayString(o.unref(c))+". ",1)])])):o.createCommentVNode("",!0)],64))}}},[["__scopeId","data-v-12a444f4"]]),lm=o.ref("id"),sm=o.ref(1),cm=o.ref(25),dm=o.ref(0),li=o.ref([]);o.ref("");function uo(){const e=new We;let{errors:t,setErrors:n}=Ia(),r=o.reactive({data:null});const a=k=>{r.data=k},i=async k=>{try{const w=await e.getEntityRecords(k);if(w&&w.response)return w}catch(w){return console.error("Error fetching entity:",w.errorMessage),w}finally{}},l=async(k,w)=>{try{let S=await e.addRecord(k.entityName,w);if(S)return S}catch(S){return S}finally{}},s=async(k,w,S)=>{try{const B=await e.updateRecord(k.entityName,w,S);if(B&&B.response)return B}catch(B){return B}finally{}},d=async(k,w)=>{try{w.filter==null&&(w.filter={}),Object.keys(w.filter).length===0&&(w.filter=[]);const S=await e.searchEntityRecords(k.entityName,w);if(S)return S.response.sortBy=w.sortBy,S.response.filters=w.filter,S.response.sortDirection=w.sortDirection,S.response.fullTextSearch=w.fullTextSearch,S}catch(S){return S}finally{}},c=async(k,w)=>{try{const S=await e.deleteRecord(k.entityName,w);if(S)return S}catch(S){console.error("Error on deleting record:",S.errorMessage)}finally{}},u=k=>k.result,f=k=>{var w,S;return m((S=(w=k==null?void 0:k.entity)==null?void 0:w.entityDefinition)==null?void 0:S.columns)},m=k=>k.filter(w=>!(w.fieldType&&w.fieldType==="ENTITY")),p=k=>{const w=k.entity.entityDefinition.columns;let S={};for(let B=0;B<w.length;B++){const I=w[B];if(I.primaryKey&&I.primaryKey==!0){S=I;break}}return S},g=k=>{const w=k.entity.entityDefinition.columns;let S={};for(let B=0;B<w.length;B++){let I=w[B];I.autoGenerated||(S[I.name]="")}return S},h=(k,w)=>{let S="";const B=k.entity.entityDefinition.columns;for(let I=0;I<B.length;I++){let D=B[I];if(w==D.name){S=D.type;break}}return S},b=(k,w)=>{const B=k.entity.entityDefinition.columns.filter(D=>D.autoGenerated).map(D=>D.name);return Object.entries(w).filter(([D])=>!B.includes(D)).map(([D,P])=>({recordColumnName:D,recordColumnValue:P,columnType:h(r.data,D)}))},y=()=>{const k=r.data.entity.entityDefinition.columns;return er().shape(k.reduce((S,B)=>(B.autoGenerated||(S[B.name]=Zo().nullable(!1).test({name:"custom-validation",test:function(I){const D=[];let P="";if(B.required&&(!I||I.trim()===""))if(B.validations){P=v(B.validations,"VALIDATE_REQUIRED"),D.push(P);let M=E(B.validations,"VALIDATE_REQUIRED");M&&(M="hint:"+M,D.push(M))}else P=B.displayName+" is required.",D.push(P);else{if(B.maxLength&&I.length>B.maxLength)if(B.validations){P=v(B.validations,"VALIDATE_MAXLENGTH"),D.push(P);let M=E(B.validations,"VALIDATE_MAXLENGTH");M&&(M="hint:"+M,D.push(M))}else P=B.displayName+" cannot exceed from "+B.maxLength+" characters",D.push(P);if(B.regxId&&!new RegExp(x(B.validations,"VALIDATE_REGX")).test(I))if(B.validations){P=v(B.validations,"VALIDATE_REGX"),D.push(P);let M=E(B.validations,"VALIDATE_REGX");M&&(M="hint:"+M,D.push(M))}else P=B.displayName+" invalid format.",D.push(P)}return D.length>0?this.createError({message:D}):!0}})),S),{}))},v=(k,w)=>{for(let S=0;S<k.length;S++)if(w==k[S].type)return k[S].message},x=(k,w)=>{for(let S=0;S<k.length;S++)if(w==k[S].type)return k[S].regx},E=(k,w)=>{for(let S=0;S<k.length;S++)if(w==k[S].type)return k[S].hint};return{state:r,setEntity:a,getEntity:i,addRecord:l,updateRecord:s,searchRecord:d,entityRecordDelete:c,getEntityItems:u,getEntityColumns:f,getPrimaryKeyColumn:p,getFormData:g,createDataToSave:b,createValidationSchema:y,clearErrors:k=>(n({...t.value,[k]:null}),t.value),validateData:async(k,w)=>{try{return await k.validate(w,{abortEarly:!1}),n({}),{validate:!0}}catch(S){const B=S.inner.reduce((P,M)=>(P[M.path]||(P[M.path]={messages:[]}),P[M.path].messages.push(...M.errors),P),{}),I=Object.entries(B).reduce((P,[M,j])=>(P[M]={messages:j.messages},P),{});return n(I),{validate:!1,errors:t.value}}},applyPreset:async(k,w)=>{console.log("Applying preset:",k),li.value=[];const S={sortBy:[lm.value],sortDirection:sm.value===1?"ASC":"DESC",pageSize:cm.value,currentPage:dm.value,columnList:null,filter:li.value,fullTextSearch:"",presetName:k},B=await e.searchEntityRecords(w,S);if(B.success)return B.response}}}const fo={__name:"ConfirmDeleteDialog",props:{showDeleteDialog:{},showDeleteDialogModifiers:{}},emits:o.mergeModels(["onDeleteItem"],["update:showDeleteDialog"]),setup(e,{emit:t}){const n=o.useModel(e,"showDeleteDialog"),r=t,a=i=>{r("onDeleteItem",{remove:i})};return(i,l)=>{const s=o.resolveComponent("Button"),d=o.resolveComponent("Dialog");return o.openBlock(),o.createBlock(d,{visible:n.value,"onUpdate:visible":l[2]||(l[2]=c=>n.value=c),style:{width:"450px"},header:"Confirm",modal:!0},{footer:o.withCtx(()=>[o.createVNode(s,{label:"No",icon:"pi pi-times",text:"",onClick:l[0]||(l[0]=c=>a(!1))}),o.createVNode(s,{label:"Yes",icon:"pi pi-check",text:"",onClick:l[1]||(l[1]=c=>a(!0))})]),default:o.withCtx(()=>[l[3]||(l[3]=o.createElementVNode("div",{class:"flex items-center justify-center"},[o.createElementVNode("i",{class:"pi pi-exclamation-triangle mr-3",style:{"font-size":"2rem"}}),o.createElementVNode("span",null,"Are you sure you want to delete the selected item?")],-1))]),_:1},8,["visible"])}}},um={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},fm={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},pn={__name:"EntityFormDialog",props:o.mergeModels({item:Object},{showEntityForm:{},showEntityFormModifiers:{}}),emits:["update:showEntityForm"],setup(e){const t=o.useModel(e,"showEntityForm"),n=o.inject("entityObject"),r=e;let a=o.ref([]),i=o.ref({}),l=o.ref([]),s=o.ref(null),d=o.ref({});o.onMounted(()=>{a.value=n.getEntityColumns(n.state.data),r.item?i.value=JSON.parse(JSON.stringify(r.item)):i.value=n.getFormData(n.state.data),s.value=n.createValidationSchema()});const c=async()=>{const p=await n.validateData(s.value,i.value);if(!p.validate){d.value=p.errors;return}const g=n.getPrimaryKeyColumn(n.state.data),h=r.item[g.name],b={dataDefinitions:n.createDataToSave(n.state.data,i.value)},y=await n.updateRecord(n.state.data,h,b);if(y&&y.success){t.value=!1;const v={sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch},x=await n.searchRecord(n.state.data,v);if(x!=null&&x.response){let E=x==null?void 0:x.response;n.setEntity(E)}}else y.validationErrors&&(l.value=JSON.parse(JSON.stringify(y.errvalidationErrorsors)))},u=async()=>{const p=await n.validateData(s.value,i.value);if(!p.validate){d.value=p.errors;return}const g={dataDefinitions:n.createDataToSave(n.state.data,i.value)},h=await n.addRecord(n.state.data,g);h&&h.success?(t.value=!1,n.state.data=await n.getEntity(n.state.data.entityName)):h.validationErrors&&(l.value=JSON.parse(JSON.stringify(h.errvalidationErrorsors)))},f=async()=>{r.item?c():u()},m=p=>{d.value=n.clearErrors(p)};return(p,g)=>{const h=o.resolveComponent("Button"),b=o.resolveComponent("Dialog");return t.value?(o.openBlock(),o.createBlock(b,{key:0,showFooter:!1,visible:t.value,"onUpdate:visible":g[2]||(g[2]=y=>t.value=y),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},modal:!0,class:"p-fluid"},{header:o.withCtx(()=>[e.item?(o.openBlock(),o.createElementBlock("span",um,"Edit "+o.toDisplayString(o.unref(n).state.data.entityName)+" record details",1)):o.createCommentVNode("",!0),e.item?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",fm,"Add "+o.toDisplayString(o.unref(n).state.data.entityName)+" record details",1))]),footer:o.withCtx(()=>[o.createVNode(h,{type:"button",icon:"",label:"Cancel",severity:"secondary",onClick:g[0]||(g[0]=y=>t.value=!1)}),o.createVNode(h,{type:"button",icon:"",label:"Save",severity:"success",onClick:g[1]||(g[1]=y=>f())})]),default:o.withCtx(()=>{var y;return[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(a),(v,x)=>{var E;return o.openBlock(),o.createElementBlock("div",{key:x},[!v.autoGenerated&&!v.foreignKey?(o.openBlock(),o.createBlock(Xn,{key:0,modelValue:o.unref(i)[v.name],"onUpdate:modelValue":N=>o.unref(i)[v.name]=N,column:v,errors:(E=o.unref(d)[v.name])==null?void 0:E.messages,onInput:m},null,8,["modelValue","onUpdate:modelValue","column","errors"])):o.createCommentVNode("",!0),!v.autoGenerated&&v.foreignKey?(o.openBlock(),o.createBlock(Xa,{key:1,modelValue:o.unref(i)[v.name],"onUpdate:modelValue":N=>o.unref(i)[v.name]=N,entityName:v.foreignKey.referencedEntityName,columnName:v.name,relatedEntityColumn:v.foreignKey.referencedColumnName},null,8,["modelValue","onUpdate:modelValue","entityName","columnName","relatedEntityColumn"])):o.createCommentVNode("",!0)])}),128)),((y=o.unref(l))==null?void 0:y.length)>0?(o.openBlock(),o.createBlock(Ya,{key:0,errors:o.unref(l)},null,8,["errors"])):o.createCommentVNode("",!0)]}),_:1},8,["visible"])):o.createCommentVNode("",!0)}}},mm={class:"flex justify-between items-start"},pm={class:"flex-grow-1"},gm={class:"tile-grid"},hm={class:"font-bold text-lg text-700"},bm={class:"flex flex-col gap-2"},ym=Ie({__name:"EntityListSingleRecord",props:{item:Object},setup(e){const t=e,n=o.inject("entityObject"),r=o.ref([]),a=o.ref(!1),i=o.ref(!1);o.onMounted(()=>{r.value=n.getEntityColumns(n.state.data)});const l=()=>{a.value=!0},s=()=>{i.value=!0},d=u=>{u.remove==!0?c():a.value=!1},c=async()=>{const u=n.getPrimaryKeyColumn(n.state.data),f=t.item[u.name],m=await n.entityRecordDelete(n.state.data,f);if(m!=null&&m.success){a.value=!1;const p={sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch},g=await n.searchRecord(n.state.data,p);if(g!=null&&g.response){let h=g==null?void 0:g.response;n.setEntity(h)}console.log(m)}};return(u,f)=>{const m=o.resolveComponent("Button");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",mm,[o.createElementVNode("div",pm,[o.createElementVNode("div",gm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(p,g)=>(o.openBlock(),o.createElementBlock("div",{key:g},[o.createElementVNode("span",hm,o.toDisplayString(p.name)+" : ",1),o.createVNode(rr,{column:p,value:e.item[p.name]},null,8,["column","value"])]))),128))])]),o.createElementVNode("div",bm,[o.createVNode(m,{onClick:f[0]||(f[0]=p=>s()),icon:"pi pi-pencil",severity:"success",size:"",rounded:"","aria-label":"Edit"}),o.createVNode(m,{onClick:f[1]||(f[1]=p=>l()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})])]),i.value?(o.openBlock(),o.createBlock(pn,{key:0,showEntityForm:i.value,"onUpdate:showEntityForm":f[2]||(f[2]=p=>i.value=p),item:e.item},null,8,["showEntityForm","item"])):o.createCommentVNode("",!0),a.value?(o.openBlock(),o.createBlock(fo,{key:1,showDeleteDialog:a.value,"onUpdate:showDeleteDialog":f[3]||(f[3]=p=>a.value=p),onOnDeleteItem:d},null,8,["showDeleteDialog"])):o.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-bce4d0f0"]]),km=Ie({__name:"EntityListRecordParent",props:{listItemDisplay:String},setup(e){const t=o.inject("entityObject"),n=o.ref([]);return o.watch(()=>t.state.data,r=>{r&&(n.value=r.result,console.log("Entity state updated in child:",t))},{immediate:!0}),(r,a)=>(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.value,(i,l)=>(o.openBlock(),o.createElementBlock("div",{key:l,class:"card rounded-md p-5 my-2 shadow-lg relative tile"},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listItemDisplay!=null&&e.listItemDisplay!=""?e.listItemDisplay:ym),o.mergeProps({ref_for:!0},{item:i}),null,16))]))),128))}},[["__scopeId","data-v-f59ea2d9"]]),wm={};function vm(e,t){return null}const xm=Ie(wm,[["render",vm]]),Sm={class:"my-2"},Cm={class:"m-0"},Em={__name:"EntityListHeaderSlot",setup(e){const t=o.inject("entityObject");let n=o.ref("");return o.watch(()=>t.state.data,r=>{r&&(n.value=r.entityName)},{immediate:!0}),(r,a)=>{const i=o.resolveComponent("Toolbar");return o.openBlock(),o.createBlock(i,{class:"p-2 my-2"},{start:o.withCtx(()=>[o.createElementVNode("div",Sm,[o.createElementVNode("h2",Cm,"EntityName: "+o.toDisplayString(o.unref(n)),1)])]),end:o.withCtx(()=>a[0]||(a[0]=[])),_:1})}}},Bm={class:"flex flex-col mb-5"},$m={class:"col-12"},Nm={class:"flex flex-col mb-5"},Om={class:"col-12"},Tm={key:0},Vm={class:"flex flex-col mb-5"},Im={class:"col-12"},Fm={class:"flex flex-col mb-5"},Pm={class:"col-12"},Rm={class:"flex flex-col mb-5"},Dm={class:"col-12"},_m={class:"flex flex-row justify-between items-center"},Am={key:1},Lm={class:"flex flex-row justify-between items-center"},zm={key:1,class:"text-red-500"},Mm={class:"flex flex-col"},jm={class:"flex flex-row justify-between items-center"},Um={__name:"FilterSortSidebar",props:o.mergeModels({headers:Array,operatorMap:Object,sortCallback:Function,filterCallback:Function,getColumnDatatype:Function,getDatatypeByField:Function,preFiltered:String},{sortBy:{},sortByModifiers:{},sortDirection:{},sortDirectionModifiers:{},showFilter:{},showFilterModifiers:{},filters:{},filtersModifiers:{}}),emits:["update:sortBy","update:sortDirection","update:showFilter","update:filters"],setup(e){const t=o.useModel(e,"sortBy"),n=o.useModel(e,"sortDirection"),r=o.useModel(e,"showFilter"),a=o.useModel(e,"filters"),i={GREATER_THAN:"is greater than",dateAfter:"is after",EQUAL:"is equals",dateIs:"is equals",NOT_EQUAL:"is not equals",dateIsNot:"is not equals",LESS_THAN:"is less than",dateBefore:"is before",LESS_THAN_EQUAL:"is less than or equal to",GREATER_THAN_EQUAL:"is greater than or equal to",between:"between",CONTAINS:"contains",STARTS_WITH:"starts with",NOT_CONTAINS:"not contains",ENDS_WITH:"ends with"},l=[{label:"Starts with",value:"STARTS_WITH"},{label:"Contains",value:"CONTAINS"},{label:"Not contains",value:"NOT_CONTAINS"},{label:"Ends with",value:"ENDS_WITH"},{label:"Equals",value:"EQUAL"},{label:"Not equals",value:"NOT_EQUAL"}],s=[{label:"Equals",value:"EQUAL"},{label:"Not equals",value:"NOT_EQUAL"},{label:"Less than",value:"LESS_THAN"},{label:"Less than or equal to",value:"LESS_THAN_EQUAL"},{label:"Greater than",value:"GREATER_THAN"},{label:"Greater than or equal to",value:"GREATER_THAN_EQUAL"}],d=[{label:"Equals",value:"EQUAL"},{label:"Not equals",value:"NOT_EQUAL"}],c=[{label:"Date is",value:"dateIs"},{label:"Date is not",value:"dateIsNot"},{label:"Date is before",value:"dateBefore"},{label:"Date is after",value:"dateAfter"}],u=[{label:"ASC",value:1},{label:"DESC",value:-1}];let f=[];const m=o.computed(()=>{var w;const C=e.preFiltered?((w=e.preFiltered.match(/\b\w+(?==)/g))==null?void 0:w.map(S=>S.trim().toLowerCase()))||[]:[];return e.headers.filter(S=>S.sortable&&!C.includes(S.field.toLowerCase()))}),p=o.computed(()=>e.headers.filter(C=>C.filterable)),g=C=>e.headers.filter(k=>{var S,B;return k.filterable?((S=a.value[C])==null?void 0:S.columnName)===k.name?!0:(e.preFiltered?((B=e.preFiltered.match(/\b\w+(?==)/g))==null?void 0:B.map(I=>I.trim().toLowerCase()))||[]:[]).includes(k.field.toLowerCase())?!1:!a.value.some((I,D)=>D!==C&&I.columnName===k.name):!1}).map(k=>({label:k.name,value:k.field})),h=C=>{let k="";switch(e.getDatatypeByField(C.columnName).toLowerCase()){case"string":case"uuid":k="startsWith";break;case"date":k="dateIs";break;case"numeric":case"int":case"integer":k="equals";break;case"bool":case"boolean":k="equals";break}C.operator=k,C.value=""},b=C=>{const k=e.getDatatypeByField(C.columnName);switch(k&&k.toLowerCase()){case"integer":case"int":case"numeric":f=s;break;case"date":f=c;break;case"bool":case"boolean":f=d;break;default:f=l}return f},y=C=>{if(C&&C.columnName){const k=e.getDatatypeByField(C.columnName);return e.getColumnDatatype(k)}else return""},v=()=>{for(let C=0;C<a.value.length;C++){const k=a.value[C];k.editing=!1}a.value.push({columnName:"",value:"",operator:"",editing:!0})},x=C=>{a.value.splice(C,1)},E=C=>{C.editing=!C.editing},N=()=>{let C=[],k=JSON.parse(JSON.stringify(a.value));for(let w=0;w<k.length;w++){const S=k[w];delete S.editing,S.columnName&&S.operator&&S.value&&(S.columnType=e.getDatatypeByField(S.columnName),S.operator=e.operatorMap[S.operator],C.push(S))}e.filterCallback(C)},$=()=>{e.sortCallback()};return(C,k)=>{const w=o.resolveComponent("Select"),S=o.resolveComponent("Divider"),B=o.resolveComponent("InputNumber"),I=o.resolveComponent("DatePicker"),D=o.resolveComponent("InputText"),P=o.resolveComponent("Button"),M=o.resolveComponent("Drawer");return o.openBlock(),o.createBlock(M,{visible:r.value,"onUpdate:visible":k[4]||(k[4]=j=>r.value=j),header:"Sorting and Filter",blockScroll:!0,position:"right",class:"layout-profile-sidebar !w-full md:!w-80 lg:!w-[30rem]",pt:{closeButton:"ml-auto"}},{default:o.withCtx(()=>[o.createElementVNode("div",Bm,[k[5]||(k[5]=o.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),o.createElementVNode("div",$m,[o.createVNode(w,{modelValue:t.value,"onUpdate:modelValue":k[0]||(k[0]=j=>t.value=j),options:m.value,optionLabel:"name",optionValue:"field",highlightOnSelect:!1,class:"w-full",onChange:k[1]||(k[1]=j=>$(C.event))},null,8,["modelValue","options"])])]),o.createElementVNode("div",Nm,[k[6]||(k[6]=o.createElementVNode("div",{class:"col-12 font-bold"},[o.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),o.createElementVNode("div",Om,[o.createVNode(w,{modelValue:n.value,"onUpdate:modelValue":k[2]||(k[2]=j=>n.value=j),options:u,optionLabel:"label",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:k[3]||(k[3]=j=>$(C.event))},null,8,["modelValue"])])]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(j,q)=>(o.openBlock(),o.createElementBlock("div",{key:q},[j.editing?(o.openBlock(),o.createElementBlock("div",Tm,[o.createVNode(S),o.createElementVNode("div",Vm,[k[7]||(k[7]=o.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),o.createElementVNode("div",Im,[o.createVNode(w,{modelValue:j.columnName,"onUpdate:modelValue":F=>j.columnName=F,options:g(q),optionLabel:"label",placeholder:"Select column",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:F=>h(j)},null,8,["modelValue","onUpdate:modelValue","options","onChange"])])]),o.createElementVNode("div",Fm,[k[8]||(k[8]=o.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),o.createElementVNode("div",Pm,[o.createVNode(w,{modelValue:j.operator,"onUpdate:modelValue":F=>j.operator=F,options:b(j),optionLabel:"label",placeholder:"Select operator",optionValue:"value",highlightOnSelect:!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","options"])])]),o.createElementVNode("div",Rm,[k[9]||(k[9]=o.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),o.createElementVNode("div",Dm,[y(j)=="numeric"?(o.openBlock(),o.createBlock(B,{key:0,format:!1,class:"w-full",modelValue:j.value,"onUpdate:modelValue":F=>j.value=F,placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"])):y(j)=="date"?(o.openBlock(),o.createBlock(I,{key:1,class:"w-full",modelValue:j.value,"onUpdate:modelValue":F=>j.value=F,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])):(o.openBlock(),o.createBlock(D,{key:2,modelValue:j.value,"onUpdate:modelValue":F=>j.value=F,class:"w-full",placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"]))])]),o.createElementVNode("div",_m,[o.createVNode(P,{label:"Hide",icon:"",severity:"warn",onClick:F=>E(j)},null,8,["onClick"]),o.createVNode(P,{label:"Delete",icon:"",severity:"danger",onClick:F=>x(q)},null,8,["onClick"])])])):o.createCommentVNode("",!0),j.editing?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Am,[o.createVNode(S),o.createElementVNode("div",Lm,[o.createElementVNode("span",null,[j.columnName||j.operator||j.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",{class:o.normalizeClass({"text-red-500":!j.columnName})},o.toDisplayString(j.columnName?" "+j.columnName:" column"),3),o.createElementVNode("span",{class:o.normalizeClass({"text-red-500":!i[j.operator]})},o.toDisplayString(j.operator?" "+i[j.operator]:" operator"),3),o.createElementVNode("span",{class:o.normalizeClass({"text-red-500":!j.value})},o.toDisplayString(j.value?" "+j.value:" value"),3)],64)):(o.openBlock(),o.createElementBlock("span",zm,"Filter is empty"))]),o.createVNode(P,{label:"Edit",icon:"",severity:"info",onClick:F=>E(j)},null,8,["onClick"])])]))]))),128)),o.createElementVNode("div",Mm,[o.createVNode(S),o.createElementVNode("div",jm,[o.createVNode(P,{label:"Add",disabled:p.value.length===a.value.length,icon:"",severity:"success",onClick:v},null,8,["disabled"]),o.createVNode(P,{label:"Apply",severity:"info",onClick:N})])])]),_:1},8,["visible"])}}},Hm={class:"my-1"},Ye=Ie({__name:"EntityListFilters",props:{externalFilterPayload:Object,preFiltered:{type:String,default:""}},setup(e){const t=o.inject("entityObject"),n=o.ref(!1),r=o.ref([]),a=o.ref([]),i=o.ref(""),l=o.ref(1),s=o.ref(""),d=o.ref([]),c=o.ref([]),u=o.ref(!1),f=e,m=o.inject("getVariable"),p={GREATER_THAN:"GREATER_THAN",dateAfter:"GREATER_THAN",EQUAL:"EQUAL",dateIs:"EQUAL",NOT_EQUAL:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",LESS_THAN:"LESS_THAN",dateBefore:"LESS_THAN",LESS_THAN_EQUAL:"LESS_THAN_EQUAL",GREATER_THAN_EQUAL:"GREATER_THAN_EQUAL",between:"BETWEEN",CONTAINS:"CONTAINS",STARTS_WITH:"STARTS_WITH",NOT_CONTAINS:"NOT_CONTAINS",ENDS_WITH:"ENDS_WITH"},g=()=>{var w;const k=f.externalFilterPayload;i.value=((w=k.sortBy)==null?void 0:w[0])||"",l.value=k.sortDirection==="DESC"?-1:1,s.value=k.fullTextSearch||"",r.value=k.filter||[],a.value=k.filter||[],y()};o.watch(()=>t.state.data,k=>{if(k&&!u.value){if(d.value=t.getEntityColumns(k),c.value=N(d.value),!i.value){const w=t.getPrimaryKeyColumn(k);i.value=(w==null?void 0:w.name)||""}f.externalFilterPayload&&g(),u.value=!0}},{immediate:!0});const h=()=>{n.value=!n.value},b=k=>{a.value=k,y()},y=async()=>{const k=t.state.data,w={sortBy:[i.value],sortDirection:l.value===1?"ASC":"DESC",pageSize:(k==null?void 0:k.pageSize)||25,currentPage:(k==null?void 0:k.currentPage)||0,columnList:null,filter:a.value,fullTextSearch:s.value},S=await t.searchRecord(k,w);S!=null&&S.success&&t.setEntity(S.response)},v=()=>{y()},x=()=>{var w;r.value=[],a.value=[];const k=((w=f.preFiltered)==null?void 0:w.split("&&").map(S=>{const[B,I]=S.split("=").map(P=>P.trim()),D=m==null?void 0:m(I);return{columnName:B,value:D,operator:"EQUAL",columnType:typeof D=="string"?"STRING":"INT"}}))||[];a.value=k,y()},E=()=>{y()},N=k=>k.map(w=>({field:w.name,name:w.displayName||w.name,filterable:w.filterable,datatype:w.type,sortable:w.indexColumn,displayFormatKey:w.displayFormatKey,displayFormat:w.displayFormat})),$=k=>{switch(k.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},C=k=>{const w=d.value.find(S=>S.name===k);return w?w.type:null};return(k,w)=>{const S=o.resolveComponent("Button"),B=o.resolveComponent("InputIcon"),I=o.resolveComponent("InputText"),D=o.resolveComponent("IconField"),P=o.resolveComponent("Toolbar");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(P,{class:"p-2 my-2 border-none"},{start:o.withCtx(()=>[o.createElementVNode("div",Hm,[o.createVNode(S,{type:"button",size:"medium",icon:"pi pi-filter",severity:"info",onClick:w[0]||(w[0]=M=>h())})]),o.createVNode(S,{class:"ml-3",size:"medium",type:"button",icon:"pi pi-filter-slash",severity:"warn",onClick:w[1]||(w[1]=M=>x())})]),end:o.withCtx(()=>[o.createVNode(D,{iconPosition:"right",class:"block mt-2 md:mt-0"},{default:o.withCtx(()=>[o.createVNode(B,{onClick:w[2]||(w[2]=M=>E()),class:"pi pi-search"}),o.createVNode(I,{class:"w-full sm:w-auto",onKeyup:w[3]||(w[3]=o.withKeys(M=>E(),["enter"])),modelValue:s.value,"onUpdate:modelValue":w[4]||(w[4]=M=>s.value=M),placeholder:"Search..."},null,8,["modelValue"])]),_:1})]),_:1}),o.createVNode(Um,{sortBy:i.value,"onUpdate:sortBy":w[5]||(w[5]=M=>i.value=M),sortDirection:l.value,"onUpdate:sortDirection":w[6]||(w[6]=M=>l.value=M),showFilter:n.value,"onUpdate:showFilter":w[7]||(w[7]=M=>n.value=M),filters:r.value,"onUpdate:filters":w[8]||(w[8]=M=>r.value=M),headers:c.value,operatorMap:p,sortCallback:v,filterCallback:b,getColumnDatatype:$,getDatatypeByField:C,preFiltered:f.preFiltered},null,8,["sortBy","sortDirection","showFilter","filters","headers","preFiltered"])],64)}}},[["__scopeId","data-v-61921abb"]]),dt={__name:"EntityListPagination",setup(e){const t=o.ref(25),n=o.ref(0),r=o.ref(0),a=o.ref(0);let i=o.inject("entityObject");const l=async s=>{t.value=s.rows,n.value=s.page,a.value=s.first;const d={sortBy:i.state.data.sortBy,sortDirection:i.state.data.sortDirection,columnList:null,filter:i.state.data.filters,fullTextSearch:i.state.data.fullTextSearch,pageSize:t.value,currentPage:n.value},c=await i.searchRecord(i.state.data,d);if(c!=null&&c.success){let u=c==null?void 0:c.response;i.setEntity(u),r.value=c.response.totalRecords,a.value=n.value*t.value}};return o.watch(()=>{var s,d;return(d=(s=i==null?void 0:i.state)==null?void 0:s.data)==null?void 0:d.totalRecords},s=>{r&&(r.value=s)},{immediate:!0}),(s,d)=>{const c=o.resolveComponent("Paginator");return o.openBlock(),o.createBlock(c,{class:"my-4",rows:t.value,totalRecords:r.value,rowsPerPageOptions:[10,25,50,100],onPage:l,template:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} items"},null,8,["rows","totalRecords"])}}},Wm={class:"flex flex-row justify-end p-2 my-1"},Xe={__name:"EntityListAddButton",setup(e){const t=o.ref(!1),n=()=>{t.value=!0};return(r,a)=>{const i=o.resolveComponent("Button");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",Wm,[o.createVNode(i,{size:"medium",icon:"pi pi-plus",onClick:a[0]||(a[0]=l=>n())})]),t.value?(o.openBlock(),o.createBlock(pn,{key:0,showEntityForm:t.value,"onUpdate:showEntityForm":a[1]||(a[1]=l=>t.value=l)},null,8,["showEntityForm"])):o.createCommentVNode("",!0)],64)}}},si={__name:"EntityList",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,listFilerSlot:Boolean,className:{type:String,default:"default-class"}},setup(e,{expose:t}){const n=uo(),r=Oe();o.provide("entityObject",n);const a=e;return t({props:a,reload:()=>{console.log("reload data")}}),o.watch(()=>r.globalConfigs.appId,async l=>{if(l){const s=await n.getEntity(a.entityName);s.success?n.setEntity(s.response):n.setEntity({result:[]})}},{immediate:!0}),(l,s)=>{var d,c,u;return l.$slots["list-item-display"]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[e.showAddButton?(o.openBlock(),o.createBlock(Xe,{key:0})):o.createCommentVNode("",!0),e.listFilerSlot?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFilter||Ye),{key:1})):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(((u=(c=(d=o.unref(n))==null?void 0:d.state)==null?void 0:c.data)==null?void 0:u.result)||[],f=>o.renderSlot(l.$slots,"list-item-display",{item:f})),256))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listHeader||Em))),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFilter||Ye))),e.showAddButton?(o.openBlock(),o.createBlock(Xe,{key:0})):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listDisplay||km),o.normalizeProps(o.guardReactiveProps({listItemDisplay:e.listItemDisplay})),null,16)),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listPagination||dt))),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFooter||xm)))],64))}}};function ci(){Oe();const{get:e,post:t,put:n,del:r}=pt();return{getActiveUser:async()=>await e("/users/me"),getAppSecurity:async b=>await e(`/api/app/v1/${b}/security`),enableAppSecurity:async(b,y)=>await t(`/api/app/v1/${b}/security/enable`,y),getAppSecurityRules:async b=>await e(`/api/app/v1/${b}/security/rules`),saveAppSecurityRule:async(b,y)=>await t(`/api/app/v1/${b}/security/rules`,y),getAppSecurityRoles:async b=>await e(`/api/app/v1/${b}/security/roles`),saveAppSecurityRoles:async(b,y)=>await t(`/api/app/v1/${b}/security/roles`,y),getAppSecurityPermissions:async b=>await e(`/api/app/v1/${b}/security/permission`),saveAppSecurityPermission:async(b,y)=>await t(`/api/app/v1/${b}/security/permission`,y),deleteAppSecurityPermission:async(b,y)=>await r(`/api/app/v1/${b}/security/permission/${y}`),deleteAppSecurityRole:async(b,y)=>await r(`/api/app/v1/${b}/security/roles/${y}`),deleteAppSecurityAccessRule:async(b,y)=>await r(`/api/app/v1/${b}/security/rules/${y}`)}}const Bt=o.ref({role:[],permissions:[]}),ir=o.ref(!1);let di=!1;function zt(){const e=async()=>{if(ir.value)return console.log("User is ROOT_USER, skipping fetch."),!0;if(di||Bt.value.role[0]&&Bt.value.permissions[0])return console.log("User details already available, skipping fetch."),!0;console.log("Fetching User Details...");const{getActiveUser:a}=ci(),i=await a();return console.log("Fetched Response:",i),i&&Array.isArray(i.authorities)&&i.authorities.includes("ROOT_USER")?(ir.value=!0,!0):(Bt.value={role:["Admin"],permissions:["user","Admin","Entity"]},di=!0,console.log("User Details Set:",Bt.value),!0)};return{userDetails:Bt,fetchUserDetails:e,getRole:()=>Bt.value.role,getPermissions:()=>Bt.value.permissions,hasMatchingRoleAndPermissions:async(a=[],i=[])=>{const l=Array.isArray(a)?a:a.split(",").map(m=>m.trim()),s=Array.isArray(i)?i:i.split(",").map(m=>m.trim());if(await e(),ir.value)return!0;const{role:d,permissions:c}=Bt.value,u=l.length===0||l.some(m=>d.includes(m)),f=s.length===0||s.some(m=>c.includes(m));return u&&!f?!1:u&&f}}}const qm={class:"flex items-center justify-between bg-white p-2 rounded border-b"},Km=["href"],Gm={class:"text-sm text-gray-500 block"},Ym={key:1},Xm={class:"flex items-center gap-2"},Jm=Ie({__name:"EntityListingSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listClass:String,listItemClass:String,listFooter:String,listFilter:String,listPagination:String,displayField:String,baseUrl:String,hrefKey:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean,linkedEntity:Array,externalFilterPayload:Object,roles:{type:[Array,String],default:()=>[]},permissions:{type:[Array,String],default:()=>[]},showPresets:{type:Boolean,default:!1},decoration:{type:String,default:"default"},numberVisible:{type:Number,default:3},variable:{type:String,default:"item"},scrollHeight:{type:String,default:""},showToolBar:{type:String,default:""},justifyContent:{type:String,default:""},preFiltered:{type:String,default:""},gap:{type:Number}},setup(e){const t=e,n=o.inject("entityObject"),r=o.ref([]),a=o.ref(null),i=o.ref(null),l=o.ref(!1),s=o.ref(!1),d=o.ref(null);o.onMounted(()=>{var p,g;t.linkedEntity&&t.linkedEntity.length>0?r.value=Object.keys(t.linkedEntity[0]).map(h=>({name:h})):r.value=n==null?void 0:n.getEntityColumns(n.state.data),d.value=((p=r==null?void 0:r.value)==null?void 0:p.find(h=>h.name==="created_date"))||null,d.value&&(d.value=t==null?void 0:t.item[d.value.name]),a.value=((g=r==null?void 0:r.value)==null?void 0:g.find(h=>h.name===t.displayField))||null,a.value&&(i.value=t==null?void 0:t.item[a.value.name])});const c=()=>{l.value=!0},u=()=>{s.value=!0},f=async p=>{p.remove?m():l.value=!1},m=async()=>{const p=n.getPrimaryKeyColumn(n.state.data),g=t.item[p.name],h=await n.entityRecordDelete(n.state.data,g);if(h!=null&&h.success){l.value=!1;const b=await n.searchRecord(n.state.data,{sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch});b!=null&&b.response&&n.setEntity(b.response)}};return(p,g)=>{const h=o.resolveComponent("Button");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("ul",{class:o.normalizeClass([t.className,"space-y-2"])},[o.createElementVNode("li",qm,[o.createElementVNode("div",null,[a.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("a",{href:`${e.baseUrl}/${e.item[e.hrefKey]}`,target:"_blank",class:"hover:underline font-medium"},o.toDisplayString(i.value),9,Km),o.createElementVNode("span",Gm,o.toDisplayString(d.value),1)],64)):(o.openBlock(),o.createElementBlock("span",Ym,"No matching field found for '"+o.toDisplayString(i.value)+"'.",1))]),o.createElementVNode("div",Xm,[e.editable?(o.openBlock(),o.createBlock(h,{key:0,onClick:g[0]||(g[0]=b=>u()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):o.createCommentVNode("",!0),e.deletable?(o.openBlock(),o.createBlock(h,{key:1,onClick:g[1]||(g[1]=b=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):o.createCommentVNode("",!0)])])],2),s.value?(o.openBlock(),o.createBlock(pn,{key:0,showEntityForm:s.value,"onUpdate:showEntityForm":g[2]||(g[2]=b=>s.value=b),item:e.item},null,8,["showEntityForm","item"])):o.createCommentVNode("",!0),l.value?(o.openBlock(),o.createBlock(fo,{key:1,showDeleteDialog:l.value,"onUpdate:showDeleteDialog":g[3]||(g[3]=b=>l.value=b),onOnDeleteItem:f},null,8,["showDeleteDialog"])):o.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-01e06cbc"]]);/**
|
|
18
|
+
`+(s!==l?`result of cast: ${s}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((a,i)=>i.call(this,a,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,a){let{path:i,originalValue:l=t,strict:s=this.spec.strict}=n,d=t;s||(d=this._cast(d,Object.assign({assert:!1},n)));let c=[];for(let u of Object.values(this.internalTests))u&&c.push(u);this.runTests({path:i,value:d,originalValue:l,options:n,tests:c},r,u=>{if(u.length)return a(u,d);this.runTests({path:i,value:d,originalValue:l,options:n,tests:this.tests},r,a)})}runTests(t,n,r){let a=!1,{tests:i,value:l,originalValue:s,path:d,options:c}=t,u=h=>{a||(a=!0,n(h,l))},f=h=>{a||(a=!0,r(h,l))},m=i.length,p=[];if(!m)return f([]);let g={value:l,originalValue:s,path:d,options:c,schema:this};for(let h=0;h<i.length;h++){const b=i[h];b(g,u,function(v){v&&(Array.isArray(v)?p.push(...v):p.push(v)),--m<=0&&f(p)})}}asNestedTest({key:t,index:n,parent:r,parentPath:a,originalParent:i,options:l}){const s=t??n;if(s==null)throw TypeError("Must include `key` or `index` for nested validations");const d=typeof s=="number";let c=r[s];const u=Object.assign({},l,{strict:!0,parent:r,value:c,originalValue:i[s],key:void 0,[d?"index":"key"]:s,path:d||s.includes(".")?`${a||""}[${d?s:`"${s}"`}]`:(a?`${a}.`:"")+t});return(f,m,p)=>this.resolve(u)._validate(c,u,m,p)}validate(t,n){var r;let a=this.resolve(Object.assign({},n,{value:t})),i=(r=n==null?void 0:n.disableStackTrace)!=null?r:a.spec.disableStackTrace;return new Promise((l,s)=>a._validate(t,n,(d,c)=>{Ae.isError(d)&&(d.value=c),s(d)},(d,c)=>{d.length?s(new Ae(d,c,void 0,void 0,i)):l(c)}))}validateSync(t,n){var r;let a=this.resolve(Object.assign({},n,{value:t})),i,l=(r=n==null?void 0:n.disableStackTrace)!=null?r:a.spec.disableStackTrace;return a._validate(t,Object.assign({},n,{sync:!0}),(s,d)=>{throw Ae.isError(s)&&(s.value=d),s},(s,d)=>{if(s.length)throw new Ae(s,t,void 0,void 0,l);i=d}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Ae.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Ae.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Qt(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=Jt({message:n,name:"nullable",test(a){return a===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=Jt({message:n,name:"optionality",test(a){return a===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=lt.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=lt.notNull){return this.nullability(!1,t)}required(t=lt.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=lt.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),a=Jt(n),i=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(l=>!(l.OPTIONS.name===n.name&&(i||l.OPTIONS.test===a.OPTIONS.test))),r.tests.push(a),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),a=Aa(t).map(i=>new _t(i));return a.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new oo(a,n):oo.fromOptions(a,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=Jt({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=lt.oneOf){let r=this.clone();return t.forEach(a=>{r._whitelist.add(a),r._blacklist.delete(a)}),r.internalTests.whiteList=Jt({message:n,name:"oneOf",skipAbsent:!0,test(a){let i=this.schema._whitelist,l=i.resolveAll(this.resolve);return l.includes(a)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:l}})}}),r}notOneOf(t,n=lt.notOneOf){let r=this.clone();return t.forEach(a=>{r._blacklist.add(a),r._whitelist.delete(a)}),r.internalTests.blacklist=Jt({message:n,name:"notOneOf",test(a){let i=this.schema._blacklist,l=i.resolveAll(this.resolve);return l.includes(a)?this.createError({params:{values:Array.from(i).join(", "),resolved:l}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:a,optional:i,nullable:l}=n.spec;return{meta:a,label:r,optional:i,nullable:l,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(d=>({name:d.OPTIONS.name,params:d.OPTIONS.params})).filter((d,c,u)=>u.findIndex(f=>f.name===d.name)===c)}}}st.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])st.prototype[`${e}At`]=function(t,n,r={}){const{parent:a,parentPath:i,schema:l}=Md(this,t,n,r.context);return l[e](a&&a[i],Object.assign({},r,{parent:a,path:t}))};for(const e of["equals","is"])st.prototype[e]=st.prototype.oneOf;for(const e of["not","nope"])st.prototype[e]=st.prototype.notOneOf;const jd=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Ud(e){const t=Qo(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function Qo(e){var t,n;const r=jd.exec(e);return r?{year:bt(r[1]),month:bt(r[2],1)-1,day:bt(r[3],1),hour:bt(r[4]),minute:bt(r[5]),second:bt(r[6]),millisecond:r[7]?bt(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:bt(r[10]),minuteOffset:bt(r[11])}:null}function bt(e,t=0){return Number(e)||t}let Hd=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Wd=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,qd=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Kd="^\\d{4}-\\d{2}-\\d{2}",Gd="\\d{2}:\\d{2}:\\d{2}",Yd="(([+-]\\d{2}(:?\\d{2})?)|Z)",Xd=new RegExp(`${Kd}T${Gd}(\\.\\d+)?${Yd}$`),Jd=e=>At(e)||e===e.trim(),Qd={}.toString();function Zo(){return new Ua}class Ua extends st{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const a=t!=null&&t.toString?t.toString():t;return a===Qd?t:a})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||lt.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=Le.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=Le.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=Le.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,a,i;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:a,name:i}=n:a=n),this.test({name:i||"matches",message:a||Le.matches,params:{regex:t},skipAbsent:!0,test:l=>l===""&&r||l.search(t)!==-1})}email(t=Le.email){return this.matches(Hd,{name:"email",message:t,excludeEmptyString:!0})}url(t=Le.url){return this.matches(Wd,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Le.uuid){return this.matches(qd,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,a;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:a=void 0}=t:n=t),this.matches(Xd,{name:"datetime",message:n||Le.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||Le.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:i=>{if(!i||r)return!0;const l=Qo(i);return l?!!l.z:!1}}).test({name:"datetime_precision",message:n||Le.datetime_precision,params:{precision:a},skipAbsent:!0,test:i=>{if(!i||a==null)return!0;const l=Qo(i);return l?l.precision===a:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Le.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:Jd})}lowercase(t=Le.lowercase){return this.transform(n=>At(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>At(n)||n===n.toLowerCase()})}uppercase(t=Le.uppercase){return this.transform(n=>At(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>At(n)||n===n.toUpperCase()})}}Zo.prototype=Ua.prototype;let Zd=new Date(""),eu=e=>Object.prototype.toString.call(e)==="[object Date]";class io extends st{constructor(){super({type:"date",check(t){return eu(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=Ud(t),isNaN(t)?io.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(_t.isRef(t))r=t;else{let a=this.cast(t);if(!this._typeCheck(a))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=a}return r}min(t,n=Xo.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a>=this.resolve(r)}})}max(t,n=Xo.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a<=this.resolve(r)}})}}io.INVALID_DATE=Zd,io.prototype;function tu(e,t=[]){let n=[],r=new Set,a=new Set(t.map(([l,s])=>`${l}-${s}`));function i(l,s){let d=Dt.split(l)[0];r.add(d),a.has(`${s}-${d}`)||n.push([s,d])}for(const l of Object.keys(e)){let s=e[l];r.add(l),_t.isRef(s)&&s.isSibling?i(s.path,l):Jo(s)&&"deps"in s&&s.deps.forEach(d=>i(d,l))}return Vd.array(Array.from(r),n).reverse()}function Ha(e,t){let n=1/0;return e.some((r,a)=>{var i;if((i=t.path)!=null&&i.includes(r))return n=a,!0}),n}function Wa(e){return(t,n)=>Ha(e,t)-Ha(e,n)}const nu=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function lo(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=lo(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=lo(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(lo)}):"optional"in e?e.optional():e}const ou=(e,t)=>{const n=[...Dt.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),a=Dt.getter(Dt.join(n),!0)(e);return!!(a&&r in a)};let qa=e=>Object.prototype.toString.call(e)==="[object Object]";function Ka(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const ru=Wa([]);function er(e){return new Ga(e)}class Ga extends st{constructor(t){super({type:"object",check(n){return qa(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=ru,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let a=super._cast(t,n);if(a===void 0)return this.getDefault(n);if(!this._typeCheck(a))return a;let i=this.fields,l=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(a).filter(f=>!this._nodes.includes(f))),d={},c=Object.assign({},n,{parent:d,__validating:n.__validating||!1}),u=!1;for(const f of s){let m=i[f],p=f in a;if(m){let g,h=a[f];c.path=(n.path?`${n.path}.`:"")+f,m=m.resolve({value:h,context:n.context,parent:d});let b=m instanceof st?m.spec:void 0,y=b==null?void 0:b.strict;if(b!=null&&b.strip){u=u||f in a;continue}g=!n.__validating||!y?m.cast(a[f],c):a[f],g!==void 0&&(d[f]=g)}else p&&!l&&(d[f]=a[f]);(p!==f in d||d[f]!==a[f])&&(u=!0)}return u?d:a}_validate(t,n={},r,a){let{from:i=[],originalValue:l=t,recursive:s=this.spec.recursive}=n;n.from=[{schema:this,value:l},...i],n.__validating=!0,n.originalValue=l,super._validate(t,n,r,(d,c)=>{if(!s||!qa(c)){a(d,c);return}l=l||c;let u=[];for(let f of this._nodes){let m=this.fields[f];!m||_t.isRef(m)||u.push(m.asNestedTest({options:n,key:f,parent:c,parentPath:n.path,originalParent:l}))}this.runTests({tests:u,value:c,originalValue:l,options:n},r,f=>{a(f.sort(this._sortErrors).concat(d),c)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[a,i]of Object.entries(this.fields)){const l=r[a];r[a]=l===void 0?i:l}return n.withMutation(a=>a.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var a;const i=this.fields[r];let l=t;(a=l)!=null&&a.value&&(l=Object.assign({},l,{parent:l.value,value:l.value[r]})),n[r]=i&&"getDefault"in i?i.getDefault(l):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=tu(t,n),r._sortErrors=Wa(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let a=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),a=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),a)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return lo(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,a])=>t.includes(r)&&t.includes(a)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let a=Dt.getter(t,!0);return this.transform(i=>{if(!i)return i;let l=i;return ou(i,t)&&(l=Object.assign({},i),r||delete l[t],l[n]=a(i)),l})}json(){return this.transform(nu)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||no.exact,test(n){if(n==null)return!0;const r=Ka(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=no.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(a){if(a==null)return!0;const i=Ka(this.schema,a);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=no.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const a of Object.keys(n))r[t(a)]=n[a];return r})}camelCase(){return this.transformKeys(Yo.camelCase)}snakeCase(){return this.transformKeys(Yo.snakeCase)}constantCase(){return this.transformKeys(t=>Yo.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[i,l]of Object.entries(n.fields)){var a;let s=t;(a=s)!=null&&a.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[i]})),r.fields[i]=l.describe(s)}return r}}er.prototype=Ga.prototype;function tr(e,t,n){const r=new We;let a=o.ref({});const i=o.ref({}),l=o.ref({});let s=o.ref([]);const d=o.ref(null),c=o.ref([]);let u=o.ref([]),f=o.ref(!1);const m=o.ref({});let{handleSubmit:p,errors:g,setErrors:h}=Ia();const b=async()=>{var F;try{const O=await r.getEntityRecords(e);O&&O.response&&(a.value=O.response,s.value=(F=O.response.entity.entityDefinition)==null?void 0:F.columns,q(),C(),B())}catch(O){toast.add({severity:"error",summary:"Error",detail:O.errorMessage,life:3e3})}finally{}},y=async()=>{var F;try{const O=await r.getRecord(e,t);O&&O.response&&(a.value=O.response,s.value=(F=O.response.entity.entityDefinition)==null?void 0:F.columns,q(),i.value=JSON.parse(JSON.stringify(O.response.result[0])),B())}catch(O){console.error("Error fetching entity:",O.errorMessage)}finally{}},v=async()=>{var F,O;try{const _=await r.getRelatedEntityRecord(e,t);_&&_.response&&(a.value=_.response,s.value=(O=(F=_.response.entity)==null?void 0:F.entityDefinition)==null?void 0:O.columns,q(),i.value=JSON.parse(JSON.stringify(_.response.result[0])),i.value.entityName&&delete i.value.entityName,i.value.linkedEntities&&delete i.value.linkedEntities,u.value=_.response.result[0].linkedEntities,l.value=JSON.parse(JSON.stringify(i.value)),B())}catch(_){console.error("Error fetching entity:",_.errorMessage)}finally{}},x=async F=>{try{let O=await r.addRecord(e,F);O&&O.response&&n("onSaveDialog",{entityName:e,recordId:t})}catch(O){O.validationErrors&&(c.value=JSON.parse(JSON.stringify(O.validationErrors))),console.error("Error fetching entity:",O.errorMessage)}finally{}},E=async(F,O)=>{try{let _=await r.addRecord(e,O);if(_&&_.response){let J=await r.saveRelatedEntityRecord(e,_.response.recordId,F.linkedEntities);J&&J.response&&n("onSaveDialog",{entityName:e,recordId:t})}}catch(_){_.validationErrors&&(c.value=JSON.parse(JSON.stringify(_.validationErrors))),console.error("Error fetching entity:",_.errorMessage)}finally{}},N=async F=>{try{const O=await r.updateRecord(e,t,F);O&&O.response&&(f.value=!1,l.value=JSON.parse(JSON.stringify(i.value)),n("onSaveDialog",{entityName:e,recordId:t}))}catch(O){O.validationErrors&&(c.value=JSON.parse(JSON.stringify(O.errvalidationErrorsors))),console.error("Error fetching entity:",O.errorMessage)}finally{}},$=async(F,O,_)=>{try{let J=await r.saveRelatedEntityRecord(F,O,_);J&&J.response&&n("onSaveDialog",{entityName:e,enityRecordId:O})}catch(J){J.validationErrors&&(c.value=JSON.parse(JSON.stringify(J.validationErrors))),console.error("Error fetching entity:",J.errorMessage)}finally{}},C=()=>{for(let F=0;F<s.value.length;F++){let O=s.value[F];!O.autoGenerated&&!O.fieldType&&(i.value[O.name]="")}},k=F=>{let O="";for(let _=0;_<s.value.length;_++){let J=s.value[_];if(F==J.name){O=J.type;break}}return O},w=()=>{const F=s.value.filter(_=>_.autoGenerated||_.fieldType).map(_=>_.name);return Object.entries(i.value).filter(([_])=>!F.includes(_)).map(([_,J])=>({recordColumnName:_,recordColumnValue:J,columnType:k(_)}))},S=async(F={})=>{try{await d.value.validate(i.value,{abortEarly:!1}),h({})}catch(_){const J=_.inner.reduce((ae,Y)=>(ae[Y.path]||(ae[Y.path]={messages:[]}),ae[Y.path].messages.push(...Y.errors),ae),{}),re=Object.entries(J).reduce((ae,[Y,Q])=>(ae[Y]={messages:Q.messages},ae),{});h(re);return}const O={dataDefinitions:w()};t?await N(O):F.relationType=="MANY_TO_ONE"?await E(F,O):await x(O)},B=()=>{d.value=er().shape(s.value.reduce((F,O)=>(O.autoGenerated||O.fieldType||(F[O.name]=Zo().nullable(!1).test({name:"custom-validation",test:function(_){const J=[];let re="";if(O.required&&(!_||_.trim()===""))if(O.validations){re=I(O.validations,"VALIDATE_REQUIRED"),J.push(re);let ae=P(O.validations,"VALIDATE_REQUIRED");ae&&(ae="hint:"+ae,J.push(ae))}else re=O.displayName+" is required.",J.push(re);else{if(O.maxLength&&_.length>O.maxLength)if(O.validations){re=I(O.validations,"VALIDATE_MAXLENGTH"),J.push(re);let ae=P(O.validations,"VALIDATE_MAXLENGTH");ae&&(ae="hint:"+ae,J.push(ae))}else re=O.displayName+" cannot exceed from "+O.maxLength+" characters",J.push(re);if(O.regxId&&!new RegExp(D(O.validations,"VALIDATE_REGX")).test(_))if(O.validations){re=I(O.validations,"VALIDATE_REGX"),J.push(re);let ae=P(O.validations,"VALIDATE_REGX");ae&&(ae="hint:"+ae,J.push(ae))}else re=O.displayName+" invalid format.",J.push(re)}return J.length>0?this.createError({message:J}):!0}})),F),{}))},I=(F,O)=>{for(let _=0;_<F.length;_++)if(O==F[_].type)return F[_].message},D=(F,O)=>{for(let _=0;_<F.length;_++)if(O==F[_].type)return F[_].regx},P=(F,O)=>{for(let _=0;_<F.length;_++)if(O==F[_].type)return F[_].hint},M=F=>{h({...g.value,[F]:null}),f.value=!0},j=()=>{f.value=!1;for(let F in i.value)i.value.hasOwnProperty(F)&&h({...g.value,[F]:null});i.value=JSON.parse(JSON.stringify(l.value))},q=()=>{for(let F=0;F<s.value.length;F++){const O=s.value[F];if(O.primaryKey&&O.primaryKey==!0){m.value=O;break}}};return{formData:i,columns:s,errors:g,backendErrors:c,isDataChange:f,linkedEntities:u,primarayKeyColumn:m,clearErrors:M,saveRecord:S,fetchAllRecords:b,fetchRecord:y,getRelatedEntityRecordById:v,cancleRecord:j,saveRelatedEntityRecord:$}}const au={key:0,class:"surface-card"},iu={class:"info"},lu={key:0,class:"list-none p-0"},Ya={__name:"EntityFormErrors",props:{errors:Array},setup(e){let t=o.ref(!0);const n=()=>{t.value=!t.value};return(r,a)=>{var l;const i=o.resolveComponent("Message");return((l=e.errors)==null?void 0:l.length)>0?(o.openBlock(),o.createElementBlock("div",au,[a[1]||(a[1]=o.createElementVNode("h4",{class:"flex-1 font-bold text-red-500"},"Errors",-1)),o.createElementVNode("div",iu,[o.createElementVNode("span",{onClick:a[0]||(a[0]=s=>n()),class:"cursor-pointer underline showHideColor"},o.toDisplayString(o.unref(t)?"Hide":"Show"),1)]),o.unref(t)?(o.openBlock(),o.createElementBlock("ul",lu,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.errors,(s,d)=>(o.openBlock(),o.createElementBlock("li",{key:d,class:"mb-2"},[o.createVNode(i,{style:{"word-break":"break-all"},closable:!1,severity:"error"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.message),1)]),_:2},1024)]))),128))])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)}}},su={class:"field flex flex-col mb-3"},cu=["for"],du={key:0,class:"flex items-center"},uu={key:1},fu={class:"flex items-center"},Xa={__name:"RelatedEntitySelection",props:{modelValue:{required:!0},entityName:{type:String,required:!0},columnName:{type:String,required:!0},displayName:{type:String},relatedEntityColumn:{type:String,required:!0}},emits:["update:modelValue"],setup(e,{emit:t}){mt.useRoute();const{getEntityRecords:n,searchEntityRecords:r,saveRelatedEntityRecord:a,getRecord:i,addRecord:l,updateRecord:s,deleteRecord:d}=We(),c=e,u=o.ref({});let f=o.ref("");const m=t;o.onMounted(()=>{p()});const p=async()=>{try{const b=await n(c.entityName);b&&b.response&&(u.value=b.response,h())}catch{}finally{}},g=()=>{m("update:modelValue",f.value[c.relatedEntityColumn])},h=()=>{for(let b=0;b<u.value.result.length;b++){const y=u.value.result[b];if(y[c.relatedEntityColumn]==c.modelValue){f.value=y;break}}};return(b,y)=>{const v=o.resolveComponent("Select");return o.openBlock(),o.createElementBlock("div",su,[o.createElementVNode("label",{for:e.columnName},o.toDisplayString(e.displayName||e.columnName),9,cu),o.createVNode(v,{modelValue:o.unref(f),"onUpdate:modelValue":[y[0]||(y[0]=x=>o.isRef(f)?f.value=x:f=x),g],"item-value":e.relatedEntityColumn,options:u.value.result,filter:"",optionLabel:e.relatedEntityColumn,placeholder:"Select "+e.relatedEntityColumn,class:"w-full"},{value:o.withCtx(x=>[x.value?(o.openBlock(),o.createElementBlock("div",du,[o.createElementVNode("div",null,o.toDisplayString(x.value[e.relatedEntityColumn]),1)])):(o.openBlock(),o.createElementBlock("span",uu,o.toDisplayString(x.placeholder),1))]),option:o.withCtx(x=>[o.createElementVNode("div",fu,[o.createElementVNode("div",null,o.toDisplayString(x.option[e.relatedEntityColumn]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"])])}}},mu={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},pu={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},gu={__name:"EntityDialog",props:o.mergeModels({entityName:{type:String,required:!0},recordId:{type:[String,Number],default:null}},{showForm:{},showFormModifiers:{}}),emits:o.mergeModels(["onSaveDialog"],["update:showForm"]),setup(e,{emit:t}){const n=o.useModel(e,"showForm"),r=t,{formData:a,columns:i,errors:l,backendErrors:s,clearErrors:d,saveRecord:c,fetchAllRecords:u,fetchRecord:f}=tr(e.entityName,e.recordId,r);return o.onMounted(()=>{e.recordId?f():u()}),(m,p)=>{const g=o.resolveComponent("Button"),h=o.resolveComponent("Dialog");return n.value?(o.openBlock(),o.createBlock(h,{key:0,showFooter:!1,visible:n.value,"onUpdate:visible":p[2]||(p[2]=b=>n.value=b),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},modal:!0,class:"p-fluid"},{header:o.withCtx(()=>[e.recordId?(o.openBlock(),o.createElementBlock("span",mu,"Edit "+o.toDisplayString(e.entityName)+" record details",1)):o.createCommentVNode("",!0),e.recordId?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",pu,"Add "+o.toDisplayString(e.entityName)+" record details",1))]),footer:o.withCtx(()=>[o.createVNode(g,{type:"button",icon:"",label:"Cancel",severity:"secondary",onClick:p[0]||(p[0]=b=>n.value=!1)}),o.createVNode(g,{type:"button",icon:"",label:"Save",severity:"success",onClick:p[1]||(p[1]=b=>o.unref(c)())})]),default:o.withCtx(()=>{var b;return[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(i),(y,v)=>{var x;return o.openBlock(),o.createElementBlock("div",{key:v},[!y.autoGenerated&&!y.foreignKey?(o.openBlock(),o.createBlock(Xn,{key:0,modelValue:o.unref(a)[y.name],"onUpdate:modelValue":E=>o.unref(a)[y.name]=E,column:y,errors:(x=o.unref(l)[y.name])==null?void 0:x.messages,onInput:o.unref(d)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"])):o.createCommentVNode("",!0),!y.autoGenerated&&y.foreignKey?(o.openBlock(),o.createBlock(Xa,{key:1,modelValue:o.unref(a)[y.name],"onUpdate:modelValue":E=>o.unref(a)[y.name]=E,entityName:y.foreignKey.referencedEntityName,columnName:y.name,relatedEntityColumn:y.foreignKey.referencedColumnName},null,8,["modelValue","onUpdate:modelValue","entityName","columnName","relatedEntityColumn"])):o.createCommentVNode("",!0)])}),128)),((b=o.unref(s))==null?void 0:b.length)>0?(o.openBlock(),o.createBlock(Ya,{key:0,errors:o.unref(s)},null,8,["errors"])):o.createCommentVNode("",!0)]}),_:1},8,["visible"])):o.createCommentVNode("",!0)}}},hu={__name:"DeleteConfirmationDialog",props:o.mergeModels({entityName:{type:String,required:!0},recordId:{type:[String,Number],default:null}},{showDeleteDialog:{},showDeleteDialogModifiers:{}}),emits:o.mergeModels(["onDeleteItem"],["update:showDeleteDialog"]),setup(e,{emit:t}){const n=new We,r=o.useModel(e,"showDeleteDialog"),a=t,i=async()=>{try{const l=await n.deleteRecord(e.entityName,e.recordId);l&&l.response&&a("onDeleteItem")}catch(l){console.error("Error deleting record:",l.errorMessage)}finally{}};return(l,s)=>{const d=o.resolveComponent("Button"),c=o.resolveComponent("Dialog");return o.openBlock(),o.createBlock(c,{visible:r.value,"onUpdate:visible":s[1]||(s[1]=u=>r.value=u),style:{width:"450px"},header:"Confirm",modal:!0},{footer:o.withCtx(()=>[o.createVNode(d,{label:"No",icon:"pi pi-times",text:"",onClick:s[0]||(s[0]=u=>r.value=!1)}),o.createVNode(d,{label:"Yes",icon:"pi pi-check",text:"",onClick:i})]),default:o.withCtx(()=>[s[2]||(s[2]=o.createElementVNode("div",{class:"flex items-center justify-center"},[o.createElementVNode("i",{class:"pi pi-exclamation-triangle mr-3",style:{"font-size":"2rem"}}),o.createElementVNode("span",null,"Are you sure you want to delete the selected item?")],-1))]),_:1},8,["visible"])}}};var bu=Object.defineProperty,Ja=Object.getOwnPropertySymbols,yu=Object.prototype.hasOwnProperty,ku=Object.prototype.propertyIsEnumerable,Qa=(e,t,n)=>t in e?bu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wu=(e,t)=>{for(var n in t||(t={}))yu.call(t,n)&&Qa(e,n,t[n]);if(Ja)for(var n of Ja(t))ku.call(t,n)&&Qa(e,n,t[n]);return e};function Lt(e){return e==null||e===""||Array.isArray(e)&&e.length===0||!(e instanceof Date)&&typeof e=="object"&&Object.keys(e).length===0}function nr(e,t,n=new WeakSet){if(e===t)return!0;if(!e||!t||typeof e!="object"||typeof t!="object"||n.has(e)||n.has(t))return!1;n.add(e).add(t);let r=Array.isArray(e),a=Array.isArray(t),i,l,s;if(r&&a){if(l=e.length,l!=t.length)return!1;for(i=l;i--!==0;)if(!nr(e[i],t[i],n))return!1;return!0}if(r!=a)return!1;let d=e instanceof Date,c=t instanceof Date;if(d!=c)return!1;if(d&&c)return e.getTime()==t.getTime();let u=e instanceof RegExp,f=t instanceof RegExp;if(u!=f)return!1;if(u&&f)return e.toString()==t.toString();let m=Object.keys(e);if(l=m.length,l!==Object.keys(t).length)return!1;for(i=l;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,m[i]))return!1;for(i=l;i--!==0;)if(s=m[i],!nr(e[s],t[s],n))return!1;return!0}function vu(e,t){return nr(e,t)}function so(e){return!!(e&&e.constructor&&e.call&&e.apply)}function de(e){return!Lt(e)}function yt(e,t){if(!e||!t)return null;try{const n=e[t];if(de(n))return n}catch{}if(Object.keys(e).length){if(so(t))return t(e);if(t.indexOf(".")===-1)return e[t];{let n=t.split("."),r=e;for(let a=0,i=n.length;a<i;++a){if(r==null)return null;r=r[n[a]]}return r}}return null}function Za(e,t,n){return n?yt(e,n)===yt(t,n):vu(e,t)}function ei(e,t){let n=-1;if(de(e))try{n=e.findLastIndex(t)}catch{n=e.lastIndexOf([...e].reverse().find(t))}return n}function ct(e,t=!0){return e instanceof Object&&e.constructor===Object&&(t||Object.keys(e).length!==0)}function Ke(e,...t){return so(e)?e(...t):e}function ze(e,t=!0){return typeof e=="string"&&(t||e!=="")}function tt(e){return ze(e)?e.replace(/(-|_)/g,"").toLowerCase():e}function or(e,t="",n={}){const r=tt(t).split("."),a=r.shift();return a?ct(e)?or(Ke(e[Object.keys(e).find(i=>tt(i)===a)||""],n),r.join("."),n):void 0:Ke(e,n)}function co(e,t=!0){return Array.isArray(e)&&(t||e.length!==0)}function xu(e){return de(e)&&!isNaN(e)}function Su(e=""){return de(e)&&e.length===1&&!!e.match(/\S| /)}function kt(e,t){if(t){const n=t.test(e);return t.lastIndex=0,n}return!1}function ti(...e){const t=(n={},r={})=>{const a=wu({},n);return Object.keys(r).forEach(i=>{ct(r[i])&&i in n&&ct(n[i])?a[i]=t(n[i],r[i]):a[i]=r[i]}),a};return e.reduce((n,r,a)=>a===0?r:t(n,r),{})}function mn(e){return e&&e.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,"").replace(/ {2,}/g," ").replace(/ ([{:}]) /g,"$1").replace(/([;,]) /g,"$1").replace(/ !/g,"!").replace(/: /g,":")}function Ge(e){if(e&&/[\xC0-\xFF\u0100-\u017E]/.test(e)){const n={A:/[\xC0-\xC5\u0100\u0102\u0104]/g,AE:/[\xC6]/g,C:/[\xC7\u0106\u0108\u010A\u010C]/g,D:/[\xD0\u010E\u0110]/g,E:/[\xC8-\xCB\u0112\u0114\u0116\u0118\u011A]/g,G:/[\u011C\u011E\u0120\u0122]/g,H:/[\u0124\u0126]/g,I:/[\xCC-\xCF\u0128\u012A\u012C\u012E\u0130]/g,IJ:/[\u0132]/g,J:/[\u0134]/g,K:/[\u0136]/g,L:/[\u0139\u013B\u013D\u013F\u0141]/g,N:/[\xD1\u0143\u0145\u0147\u014A]/g,O:/[\xD2-\xD6\xD8\u014C\u014E\u0150]/g,OE:/[\u0152]/g,R:/[\u0154\u0156\u0158]/g,S:/[\u015A\u015C\u015E\u0160]/g,T:/[\u0162\u0164\u0166]/g,U:/[\xD9-\xDC\u0168\u016A\u016C\u016E\u0170\u0172]/g,W:/[\u0174]/g,Y:/[\xDD\u0176\u0178]/g,Z:/[\u0179\u017B\u017D]/g,a:/[\xE0-\xE5\u0101\u0103\u0105]/g,ae:/[\xE6]/g,c:/[\xE7\u0107\u0109\u010B\u010D]/g,d:/[\u010F\u0111]/g,e:/[\xE8-\xEB\u0113\u0115\u0117\u0119\u011B]/g,g:/[\u011D\u011F\u0121\u0123]/g,i:/[\xEC-\xEF\u0129\u012B\u012D\u012F\u0131]/g,ij:/[\u0133]/g,j:/[\u0135]/g,k:/[\u0137,\u0138]/g,l:/[\u013A\u013C\u013E\u0140\u0142]/g,n:/[\xF1\u0144\u0146\u0148\u014B]/g,p:/[\xFE]/g,o:/[\xF2-\xF6\xF8\u014D\u014F\u0151]/g,oe:/[\u0153]/g,r:/[\u0155\u0157\u0159]/g,s:/[\u015B\u015D\u015F\u0161]/g,t:/[\u0163\u0165\u0167]/g,u:/[\xF9-\xFC\u0169\u016B\u016D\u016F\u0171\u0173]/g,w:/[\u0175]/g,y:/[\xFD\xFF\u0177]/g,z:/[\u017A\u017C\u017E]/g};for(let r in n)e=e.replace(n[r],r)}return e}function Cu(e){return ze(e,!1)?e[0].toUpperCase()+e.slice(1):e}function ni(e){return ze(e)?e.replace(/(_)/g,"-").replace(/[A-Z]/g,(t,n)=>n===0?t:"-"+t.toLowerCase()).toLowerCase():e}function oi(e){return ze(e)?e.replace(/[A-Z]/g,(t,n)=>n===0?t:"."+t.toLowerCase()).toLowerCase():e}var Zt={STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter"},Eu={AND:"and",OR:"or"};function ri(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Bu(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
19
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return l=c.done,c},e:function(c){s=!0,i=c},f:function(){try{l||n.return==null||n.return()}finally{if(s)throw i}}}}function Bu(e,t){if(e){if(typeof e=="string")return ai(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ai(e,t):void 0}}function ai(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var $u={filter:function(t,n,r,a,i){var l=[];if(!t)return l;var s=ri(t),d;try{for(s.s();!(d=s.n()).done;){var c=d.value;if(typeof c=="string"){if(this.filters[a](c,r,i)){l.push(c);continue}}else{var u=ri(n),f;try{for(u.s();!(f=u.n()).done;){var m=f.value,p=yt(c,m);if(this.filters[a](p,r,i)){l.push(c);break}}}catch(g){u.e(g)}finally{u.f()}}}}catch(g){s.e(g)}finally{s.f()}return l},filters:{startsWith:function(t,n,r){if(n==null||n==="")return!0;if(t==null)return!1;var a=Ge(n.toString()).toLocaleLowerCase(r),i=Ge(t.toString()).toLocaleLowerCase(r);return i.slice(0,a.length)===a},contains:function(t,n,r){if(n==null||n==="")return!0;if(t==null)return!1;var a=Ge(n.toString()).toLocaleLowerCase(r),i=Ge(t.toString()).toLocaleLowerCase(r);return i.indexOf(a)!==-1},notContains:function(t,n,r){if(n==null||n==="")return!0;if(t==null)return!1;var a=Ge(n.toString()).toLocaleLowerCase(r),i=Ge(t.toString()).toLocaleLowerCase(r);return i.indexOf(a)===-1},endsWith:function(t,n,r){if(n==null||n==="")return!0;if(t==null)return!1;var a=Ge(n.toString()).toLocaleLowerCase(r),i=Ge(t.toString()).toLocaleLowerCase(r);return i.indexOf(a,i.length-a.length)!==-1},equals:function(t,n,r){return n==null||n===""?!0:t==null?!1:t.getTime&&n.getTime?t.getTime()===n.getTime():Ge(t.toString()).toLocaleLowerCase(r)==Ge(n.toString()).toLocaleLowerCase(r)},notEquals:function(t,n,r){return n==null||n===""?!1:t==null?!0:t.getTime&&n.getTime?t.getTime()!==n.getTime():Ge(t.toString()).toLocaleLowerCase(r)!=Ge(n.toString()).toLocaleLowerCase(r)},in:function(t,n){if(n==null||n.length===0)return!0;for(var r=0;r<n.length;r++)if(Za(t,n[r]))return!0;return!1},between:function(t,n){return n==null||n[0]==null||n[1]==null?!0:t==null?!1:t.getTime?n[0].getTime()<=t.getTime()&&t.getTime()<=n[1].getTime():n[0]<=t&&t<=n[1]},lt:function(t,n){return n==null?!0:t==null?!1:t.getTime&&n.getTime?t.getTime()<n.getTime():t<n},lte:function(t,n){return n==null?!0:t==null?!1:t.getTime&&n.getTime?t.getTime()<=n.getTime():t<=n},gt:function(t,n){return n==null?!0:t==null?!1:t.getTime&&n.getTime?t.getTime()>n.getTime():t>n},gte:function(t,n){return n==null?!0:t==null?!1:t.getTime&&n.getTime?t.getTime()>=n.getTime():t>=n},dateIs:function(t,n){return n==null?!0:t==null?!1:t.toDateString()===n.toDateString()},dateIsNot:function(t,n){return n==null?!0:t==null?!1:t.toDateString()!==n.toDateString()},dateBefore:function(t,n){return n==null?!0:t==null?!1:t.getTime()<n.getTime()},dateAfter:function(t,n){return n==null?!0:t==null?!1:t.getTime()>n.getTime()}},register:function(t,n){this.filters[t]=n}};const Nu={key:0},Ou={key:1},rr={__name:"RecordColumnRenderer",props:{column:Object,value:null},setup(e){const t=o.ref(null),n=Object.assign({});async function r(){await o.nextTick();const a=n[`/src/directives/${e.column.displayFormatKey}.js`];a&&t.value&&a().then(i=>{i.default.beforeMount(t.value,{value:e.value,arg:e.column.displayFormat})})}return o.onMounted(()=>{r()}),o.onUpdated(()=>{r()}),(a,i)=>e.column.displayFormatKey?(o.openBlock(),o.createElementBlock("span",Nu,[o.createElementVNode("span",{ref_key:"el",ref:t},o.toDisplayString(e.value),513)])):(o.openBlock(),o.createElementBlock("span",Ou,o.toDisplayString(e.value),1))}},Tu={class:"my-2"},Vu={class:"flex flex-col md:flex-row md:justify-between md:items-center"},Iu={class:"flex flex-row gap-2"},ar={__name:"Grid",props:{entityName:String,showAddButton:Boolean,showClearFilters:Boolean,columnsToShow:Array,editable:Boolean,deleteable:Boolean,showPagination:Boolean},setup(e){const t=Oe(),n=e;console.log("columnsToShow",n.columnsToShow);const r=mt.useRoute(),a=o.ref(n.entityName||r.params.entityName),i=o.ref({}),l=o.ref(""),s=o.ref(!1),d=o.ref(!1),{items:c,headers:u,first:f,totalRecords:m,pageSize:p,loading:g,sortBy:h,sortDirection:b,operatorMap:y,filterToSend:v,primarayKeyColumn:x,fullTextSearch:E,listingResponse:N,onFullTextSearch:$,getDatatypeByField:C,getColumnDatatype:k,onSort:w,onPage:S,onFilter:B,fetchEntityFilterData:I,fetchEntityByName:D}=Lc(a.value),P=o.ref();let M=o.ref(!1);const j=Y=>{i.value=Y.reduce((Q,le)=>{if(!le.filterable)return Q;let ce=Zt.CONTAINS;switch(le.datatype.toLowerCase()){case"string":case"uuid":ce=Zt.STARTS_WITH;break;case"date":ce=Zt.DATE_IS;break;case"numeric":case"int":case"integer":ce=Zt.EQUALS;break;case"bool":case"boolean":ce=Zt.EQUALS;break}return le.datatype=="bool"||le.datatype=="boolean"?Q[le.field]={value:null,matchMode:Zt.EQUALS}:Q[le.field]={operator:Eu.AND,constraints:[{value:null,matchMode:ce}]},Q},{})},q=()=>{j(u.value),v.value=ae(i.value),B()},F=Y=>{v.value=ae(i.value),B()},O=Y=>{Y?l.value=Y[x.value.name]:l.value="",s.value=!s.value},_=()=>{s.value=!1,I(!1)},J=Y=>{l.value=Y[x.value.name],d.value=!0},re=()=>{d.value=!1,I(!1)},ae=Y=>Object.keys(Y).map(Q=>{const le=Y[Q];return le.constraints?le.constraints.filter(ce=>ce.value!==null&&ce.value!=="").map(ce=>({columnName:Q,operator:y[ce.matchMode]??ce.matchMode,value:ce.value,columnType:C(Q)})):le.value!==null&&le.value!==""?{columnName:Q,operator:y[le.matchMode]??le.matchMode,value:le.value,columnType:C(Q)}:[]}).flat();return o.watch(()=>t.globalConfigs.appId,async Y=>{Y&&D(a.value)},{immediate:!0}),o.watch(()=>u.value,Y=>{!M.value&&Y&&Y.length&&(j(Y),M.value=!0)},{immediate:!0}),(Y,Q)=>{const le=o.resolveComponent("Button"),ce=o.resolveComponent("Toolbar"),xe=o.resolveComponent("ProgressSpinner"),He=o.resolveComponent("InputIcon"),Re=o.resolveComponent("IconField"),rt=o.resolveComponent("DatePicker"),Je=o.resolveComponent("InputNumber"),H=o.resolveComponent("Checkbox"),z=o.resolveComponent("Column"),fe=o.resolveComponent("DataTable");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",o.normalizeProps(o.guardReactiveProps(Y.$attrs)),[o.renderSlot(Y.$slots,"header"),e.showClearFilters||e.showAddButton?(o.openBlock(),o.createBlock(ce,{key:0,class:"mb-4 mt-4"},o.createSlots({_:2},[e.showClearFilters?{name:"start",fn:o.withCtx(()=>[o.createElementVNode("div",Tu,[o.createVNode(le,{type:"button",icon:"pi pi-filter-slash",label:"Clear",severity:"warning",onClick:Q[0]||(Q[0]=ge=>q())})])]),key:"0"}:void 0,e.showAddButton?{name:"end",fn:o.withCtx(()=>[o.createVNode(le,{label:"Add",icon:"pi pi-plus",class:"mr-2",severity:"success",onClick:Q[1]||(Q[1]=ge=>O())})]),key:"1"}:void 0]),1024)):o.createCommentVNode("",!0),o.createVNode(fe,{lazy:"",value:o.unref(c),loading:o.unref(g),ref_key:"dt",ref:P,stripedRows:!0,showGridlines:"",rowHover:!0,paginator:e.showPagination,rows:o.unref(p),rowsPerPageOptions:[10,25,50,100],totalRecords:o.unref(m),first:o.unref(f),sortField:o.unref(h),sortOrder:o.unref(b),filters:i.value,"onUpdate:filters":Q[5]||(Q[5]=ge=>i.value=ge),filterDisplay:"menu",scrollable:"",scrollHeight:"400px",onSort:o.unref(w),onPage:o.unref(S),onFilter:Q[6]||(Q[6]=ge=>F()),size:"large",paginatorTemplate:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} items"},{empty:o.withCtx(()=>Q[9]||(Q[9]=[o.createTextVNode(" No data found. ")])),loading:o.withCtx(()=>[o.createVNode(xe)]),header:o.withCtx(()=>[o.createElementVNode("div",Vu,[o.createVNode(Re,{iconPosition:"left",class:"block mt-2 md:mt-0"},{default:o.withCtx(()=>[o.createVNode(He,{class:"pi pi-search",onClick:Q[2]||(Q[2]=ge=>o.unref($)())}),o.createVNode(o.unref(Sr.InputText),{class:"w-full sm:w-auto",onKeyup:Q[3]||(Q[3]=o.withKeys(ge=>o.unref($)(),["enter"])),modelValue:o.unref(E),"onUpdate:modelValue":Q[4]||(Q[4]=ge=>o.isRef(E)?E.value=ge:null),placeholder:"Search..."},null,8,["modelValue"])]),_:1})])]),default:o.withCtx(()=>{var ge;return[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(u).filter(me=>!n.columnsToShow||n.columnsToShow.length===0||n.columnsToShow.includes(me.field)),me=>(o.openBlock(),o.createBlock(z,{key:me.field,dataType:o.unref(k)(me.datatype),field:me.field,header:me.name,sortable:me.sortable,showAddButton:!1,showFilterOperator:!1,style:{"text-wrap":"nowrap"}},o.createSlots({body:o.withCtx(({data:he})=>[o.createVNode(rr,{column:me,value:he[me.field]},null,8,["column","value"])]),_:2},[me.datatype.toLowerCase()==="date"&&me.filterable?{name:"filter",fn:o.withCtx(({filterModel:he})=>[o.createVNode(rt,{modelValue:he.value,"onUpdate:modelValue":Ee=>he.value=Ee,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])]),key:"0"}:me.datatype.toLowerCase()==="int"&&me.filterable?{name:"filter",fn:o.withCtx(({filterModel:he})=>[o.createVNode(Je,{modelValue:he.value,"onUpdate:modelValue":Ee=>he.value=Ee,placeholder:"Search..."},null,8,["modelValue","onUpdate:modelValue"])]),key:"1"}:me.datatype.toLowerCase()==="boolean"&&me.filterable?{name:"filter",fn:o.withCtx(({filterModel:he})=>[o.createVNode(H,{modelValue:he.value,"onUpdate:modelValue":Ee=>he.value=Ee,indeterminate:he.value===null,binary:""},null,8,["modelValue","onUpdate:modelValue","indeterminate"])]),key:"2"}:me.filterable?{name:"filter",fn:o.withCtx(({filterModel:he})=>[o.createVNode(o.unref(Sr.InputText),{style:{width:"150px"},type:"text",modelValue:he.value,"onUpdate:modelValue":Ee=>he.value=Ee,class:"p-column-filter",placeholder:"Search..."},null,8,["modelValue","onUpdate:modelValue"])]),key:"3"}:void 0]),1032,["dataType","field","header","sortable"]))),128)),((ge=o.unref(c))==null?void 0:ge.length)>0&&(e.editable||e.deleteable)?(o.openBlock(),o.createBlock(z,{key:0,header:"Actions"},{body:o.withCtx(({data:me})=>[o.createElementVNode("div",Iu,[e.editable?(o.openBlock(),o.createBlock(le,{key:0,onClick:he=>O(me),icon:"pi pi-pencil",severity:"success",size:"",rounded:"","aria-label":"Edit"},null,8,["onClick"])):o.createCommentVNode("",!0),e.deleteable?(o.openBlock(),o.createBlock(le,{key:1,onClick:he=>J(me),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"},null,8,["onClick"])):o.createCommentVNode("",!0)])]),_:1})):o.createCommentVNode("",!0)]}),_:1},8,["value","loading","paginator","rows","totalRecords","first","sortField","sortOrder","filters","onSort","onPage"]),o.renderSlot(Y.$slots,"footer")],16),s.value?(o.openBlock(),o.createBlock(gu,{key:0,showForm:s.value,"onUpdate:showForm":Q[7]||(Q[7]=ge=>s.value=ge),entityName:o.unref(N).entityName,recordId:l.value,onOnSaveDialog:_},null,8,["showForm","entityName","recordId"])):o.createCommentVNode("",!0),d.value?(o.openBlock(),o.createBlock(hu,{key:1,showDeleteDialog:d.value,"onUpdate:showDeleteDialog":Q[8]||(Q[8]=ge=>d.value=ge),entityName:o.unref(N).entityName,recordId:l.value,onOnDeleteItem:re},null,8,["showDeleteDialog","entityName","recordId"])):o.createCommentVNode("",!0)],64)}}},Fu={class:"flex flex-col p-3"},Pu={class:"flex justify-center flex-row mb-2 cursor-pointer"},Ru={style:{"word-break":"break-all"}},Du={__name:"LinkEntityContent",props:{linkEntityListItem:{type:Object,required:!0}},setup(e){mt.useRoute();const t=Oe(),n=o.ref("");t.getAppId()!=null&&t.getAppId()!=""&&(n.value=t.getAppId());const r=o.ref(),a=o.ref(!1),i=o.ref(!1),l=o.ref({}),s=o.ref([{label:"Remove association",icon:"",command:f=>{d()}}]),d=()=>{console.log(l.value),console.log("Function is calling")},c=(f,m)=>{l.value=m,r.value.show(f),i.value=!0},u=()=>{l.value={},i.value=!1};return(f,m)=>{const p=o.resolveComponent("Button"),g=o.resolveComponent("ContextMenu"),h=o.resolveComponent("router-link");return o.openBlock(),o.createElementBlock("div",{onMouseenter:m[4]||(m[4]=o.withModifiers(b=>a.value=!0,["prevent"])),onMouseleave:m[5]||(m[5]=o.withModifiers(b=>a.value=!1,["prevent"])),class:"flex relative m-3",style:{border:"1px solid var(--surface-border)","border-radius":"5px"}},[o.withDirectives(o.createVNode(p,{onClick:m[0]||(m[0]=b=>c(b,e.linkEntityListItem)),class:"!absolute right-0",size:"small",style:{width:"55px",height:"25px","border-radius":"5px","font-size":"12px"}},{default:o.withCtx(()=>m[6]||(m[6]=[o.createTextVNode(" More")])),_:1},512),[[o.vShow,a.value||i.value]]),o.createVNode(g,{ref_key:"menu",ref:r,model:s.value,onMouseenter:m[1]||(m[1]=o.withModifiers(b=>a.value=!0,["prevent"])),onMouseleave:m[2]||(m[2]=o.withModifiers(b=>a.value=!1,["prevent"])),onHide:m[3]||(m[3]=b=>u())},null,8,["model"]),o.createElementVNode("div",Fu,[o.createElementVNode("div",Pu,[o.createElementVNode("div",Ru,o.toDisplayString(e.linkEntityListItem.entityName),1),o.createVNode(h,{to:{name:"entity360view",params:{entityName:e.linkEntityListItem.entityName,id:e.linkEntityListItem.id,appId:n.value}},target:"_blank"},{default:o.withCtx(()=>m[7]||(m[7]=[o.createElementVNode("div",{class:"pi pi-external-link ml-3"},null,-1)])),_:1},8,["to"])]),o.createElementVNode("div",null,"Id: "+o.toDisplayString(e.linkEntityListItem.id),1)])],32)}}},_u={class:"flex flex-col mt-3"},Au={class:"flex flex-row items-center"},Lu={class:"flex items-center justify-center mt-5"},zu={key:0,class:"pi pi-caret-right"},Mu={key:1,class:"pi pi-caret-down"},ju={key:0},Uu={class:"flex flex-col mt-5"},Hu={class:"col-12"},Wu={class:"flex flex-col mt-5"},qu={class:"col-12 font-bold"},Ku={key:0},Gu={class:"flex flex-col mt-5"},Yu={class:"col-12"},Xu={class:"flex flex-col mt-5"},Ju={class:"col-12"},Qu={class:"flex flex-col mt-5"},Zu={class:"col-12"},ef={class:"flex flex-row justify-between items-center mt-5"},tf={key:1,class:"mt-2"},nf={class:"flex flex-row justify-between items-center"},of={key:1,class:"text-red-500"},rf={class:"flex flex-col mt-5"},af={class:"flex flex-row justify-between items-center mt-2"},lf={class:"flex flex-row items-center mt-5 mb-5"},sf={class:"font-bold"},cf={class:"font-bold ml-2 flex-1"},df={class:"flex flex-row justify-center items-center mb-2"},uf={class:"ml-2 flex-1"},ff={key:0,class:"pi pi-exclamation-circle"},mf={class:"flex flex-col justify-center"},pf={class:"flex flex-row justify-between items-center"},gf={class:"justify-start"},hf={class:"justify-start"},bf=Ie({__name:"EntityLookup",props:o.mergeModels({linkedEntity:{type:Object,required:!0},entity360Name:{type:String,required:!0},entity360Id:{required:!0},saveExistingRelatedEntityRecord:{type:Function,required:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){mt.useRoute();const t=e,n=o.useModel(e,"modelValue"),r=new We,a=o.ref({}),i=o.ref([]),l=o.ref({}),s=o.ref([]),d=o.ref([]),c=o.ref({}),u=o.ref("id"),f=o.ref(1),m=o.ref([]),p=o.ref(25),g=o.ref(0),h=o.ref(0),b=o.ref(0);let y=o.ref([]);const v=o.ref(!1),x={gt:"GREATER_THAN",dateAfter:"GREATER_THAN",equals:"EQUAL",dateIs:"EQUAL",notEquals:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",lt:"LESS_THAN",dateBefore:"LESS_THAN",lte:"LESS_THAN_EQUAL",gte:"GREATER_THAN_EQUAL",between:"BETWEEN",contains:"CONTAINS",startsWith:"STARTS_WITH",notContains:"NOT_CONTAINS",endsWith:"ENDS_WITH"},E={gt:"is greater than",dateAfter:"is after",equals:"is equals",dateIs:"is equals",notEquals:"is not equals",dateIsNot:"is not equals",lt:"is less than",dateBefore:"is before",lte:"is less than or equal to",gte:"is greater than or equal to",between:"between",contains:"contains",startsWith:"starts with",notContains:"not contains",endsWith:"ends with"};o.onMounted(()=>{$()});const N=H=>t.linkedEntity.list.some(z=>z[c.value.name]===H),$=async()=>{try{const H={sortBy:[u.value],sortDirection:f.value===1?"ASC":"DESC",pageSize:p.value,currentPage:g.value,columnList:null,filter:y.value,fullTextSearch:""},z=await r.searchEntityRecords(t.linkedEntity.entityName,H);z&&z.response&&(a.value=z.response,s.value=z.response.entity.entityDefinition.columns,d.value=xe(z.response.entity.entityDefinition.columns),h.value=z.response.totalRecords,await C(),await k(),w())}catch{}finally{}},C=async()=>{for(let H=0;H<s.value.length;H++){const z=s.value[H];!z.autoGeneerated&&z.foreignKey&&z.foreignKey.referencedEntityName.toLowerCase()==t.entity360Name.toLowerCase()&&(l.value=z)}},k=async()=>{for(let H=0;H<s.value.length;H++){const z=s.value[H];if(z.primaryKey&&z.primaryKey==!0){c.value=z;break}}},w=()=>{for(let H=0;H<t.linkedEntity.list.length;H++){const z=t.linkedEntity.list[H];z.is_deleted==!1&&z[l.value.name]==t.entity360Id&&i.value.push(z[c.value.name])}},S=()=>{let H=JSON.parse(JSON.stringify(i.value));H=H.filter(fe=>!N(fe));let z={linkEntityName:a.value.entityName,linkRecordIdList:[]};for(let fe=0;fe<H.length;fe++){const ge=H[fe];z.linkRecordIdList.push(ge)}t.saveExistingRelatedEntityRecord(z)},B=()=>{v.value=!v.value},I=[{label:"Starts with",value:"startsWith"},{label:"Contains",value:"contains"},{label:"Not contains",value:"notContains"},{label:"Ends with",value:"endsWith"},{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],D=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"},{label:"Less than",value:"lt"},{label:"Less than or equal to",value:"lte"},{label:"Greater than",value:"gt"},{label:"Greater than or equal to",value:"gte"}],P=[{label:"Equals",value:"equals"},{label:"Not equals",value:"notEquals"}],M=[{label:"Date is",value:"dateIs"},{label:"Date is not",value:"dateIsNot"},{label:"Date is before",value:"dateBefore"},{label:"Date is after",value:"dateAfter"}],j=[{label:"ASC",value:1},{label:"DESC",value:-1}];let q=[];const F=o.computed(()=>d.value.filter(H=>H.sortable)),O=o.computed(()=>d.value.filter(H=>H.filterable)),_=H=>d.value.filter(z=>{var fe;return z.filterable?((fe=m.value[H])==null?void 0:fe.columnName)===z.name?!0:!m.value.some((ge,me)=>me!==H&&ge.columnName===z.name):!1}).map(z=>({label:z.name,value:z.field})),J=H=>{let z="";switch(Re(H.columnName).toLowerCase()){case"string":case"uuid":z="startsWith";break;case"date":z="dateIs";break;case"numeric":case"int":case"integer":z="equals";break;case"bool":case"boolean":z="equals";break}H.operator=z,H.value=""},re=H=>{const z=Re(H.columnName);switch(z&&z.toLowerCase()){case"integer":case"int":case"numeric":q=D;break;case"date":q=M;break;case"bool":case"boolean":q=P;break;default:q=I}return q},ae=H=>{if(H&&H.columnName){const z=Re(H.columnName);return rt(z)}else return""},Y=()=>{for(let H=0;H<m.value.length;H++){const z=m.value[H];z.editing=!1}m.value.push({columnName:"",value:"",operator:"",editing:!0})},Q=H=>{m.value.splice(H,1)},le=H=>{H.editing=!H.editing},ce=()=>{let H=JSON.parse(JSON.stringify(m.value));y.value=[];for(let z=0;z<H.length;z++){const fe=H[z];delete fe.editing,fe.columnName&&fe.operator&&fe.value&&(fe.columnType=Re(fe.columnName),fe.operator=x[fe.operator],y.value.push(fe))}$()},xe=H=>H.map(z=>({field:z.name,name:z.displayName?z.displayName:z.name,filterable:z.filterable,datatype:z.type,sortable:!0,displayFormatKey:z.displayFormatKey,displayFormat:z.displayFormat})),He=()=>{$()},Re=H=>{const z=d.value.find(fe=>fe.field===H);return z?z.datatype:null},rt=H=>{switch(H.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},Je=H=>{p.value=H.rows,g.value=H.page,b.value=H.first,$()};return(H,z)=>{var It,qt;const fe=o.resolveComponent("InputIcon"),ge=o.resolveComponent("InputText"),me=o.resolveComponent("IconField"),he=o.resolveComponent("Select"),Ee=o.resolveComponent("Divider"),Me=o.resolveComponent("InputNumber"),ft=o.resolveComponent("DatePicker"),Ve=o.resolveComponent("Button"),je=o.resolveComponent("Checkbox"),Qe=o.resolveComponent("Paginator"),Vt=o.resolveDirective("tooltip");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",_u,[o.createElementVNode("div",Au,[o.createVNode(me,{class:"block mt-2 md:mt-0 w-full"},{default:o.withCtx(()=>[o.createVNode(fe,{onClick:z[0]||(z[0]=()=>{}),class:"pi pi-search"}),o.createVNode(ge,{class:"w-full",onKeyup:z[1]||(z[1]=o.withKeys(()=>{},["enter"])),placeholder:`Search ${a.value.entityName}`},null,8,["placeholder"])]),_:1})]),o.createElementVNode("div",Lu,[o.createElementVNode("div",{class:"flex items-center cursor-pointer sorting-filter-section flex-1 line-height-4",onClick:z[2]||(z[2]=Z=>B())},[v.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",zu)),v.value?(o.openBlock(),o.createElementBlock("div",Mu)):o.createCommentVNode("",!0),z[9]||(z[9]=o.createElementVNode("div",{class:"ml-3 font-bold"}," Sorting & Filters ",-1))])]),v.value?(o.openBlock(),o.createElementBlock("div",ju,[o.createElementVNode("div",Uu,[z[10]||(z[10]=o.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),o.createElementVNode("div",Hu,[o.createVNode(he,{modelValue:u.value,"onUpdate:modelValue":z[3]||(z[3]=Z=>u.value=Z),options:F.value,optionLabel:"name",optionValue:"field",highlightOnSelect:!1,class:"w-full",onChange:z[4]||(z[4]=Z=>He(H.event))},null,8,["modelValue","options"])])]),o.createElementVNode("div",Wu,[z[11]||(z[11]=o.createElementVNode("div",{class:"col-12 font-bold"},[o.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),o.createElementVNode("div",qu,[o.createVNode(he,{modelValue:f.value,"onUpdate:modelValue":z[5]||(z[5]=Z=>f.value=Z),options:j,optionLabel:"label",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:z[6]||(z[6]=Z=>He(H.event))},null,8,["modelValue"])])]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(m.value,(Z,at)=>(o.openBlock(),o.createElementBlock("div",{key:at},[Z.editing?(o.openBlock(),o.createElementBlock("div",Ku,[o.createVNode(Ee,{class:"mt-5"}),o.createElementVNode("div",Gu,[z[12]||(z[12]=o.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),o.createElementVNode("div",Yu,[o.createVNode(he,{modelValue:Z.columnName,"onUpdate:modelValue":Be=>Z.columnName=Be,options:_(at),optionLabel:"label",placeholder:"Select column",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:Be=>J(Z)},null,8,["modelValue","onUpdate:modelValue","options","onChange"])])]),o.createElementVNode("div",Xu,[z[13]||(z[13]=o.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),o.createElementVNode("div",Ju,[o.createVNode(he,{modelValue:Z.operator,"onUpdate:modelValue":Be=>Z.operator=Be,options:re(Z),optionLabel:"label",placeholder:"Select operator",optionValue:"value",highlightOnSelect:!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","options"])])]),o.createElementVNode("div",Qu,[z[14]||(z[14]=o.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),o.createElementVNode("div",Zu,[ae(Z)=="numeric"?(o.openBlock(),o.createBlock(Me,{key:0,format:!1,class:"w-full",modelValue:Z.value,"onUpdate:modelValue":Be=>Z.value=Be,placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"])):ae(Z)=="date"?(o.openBlock(),o.createBlock(ft,{key:1,class:"w-full",modelValue:Z.value,"onUpdate:modelValue":Be=>Z.value=Be,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])):(o.openBlock(),o.createBlock(ge,{key:2,modelValue:Z.value,"onUpdate:modelValue":Be=>Z.value=Be,class:"w-full",placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"]))])]),o.createElementVNode("div",ef,[o.createVNode(Ve,{style:{width:"100px"},label:"Hide",icon:"",severity:"warning",onClick:Be=>le(Z)},null,8,["onClick"]),o.createVNode(Ve,{style:{width:"100px"},label:"Delete",icon:"",severity:"danger",onClick:Be=>Q(at)},null,8,["onClick"])])])):o.createCommentVNode("",!0),Z.editing?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",tf,[o.createVNode(Ee),o.createElementVNode("div",nf,[o.createElementVNode("span",null,[Z.columnName||Z.operator||Z.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",{class:o.normalizeClass({"text-red-500":!Z.columnName})},o.toDisplayString(Z.columnName?" "+Z.columnName:" column"),3),o.createElementVNode("span",{class:o.normalizeClass({"text-red-500":!E[Z.operator]})},o.toDisplayString(Z.operator?" "+E[Z.operator]:" operator"),3),o.createElementVNode("span",{class:o.normalizeClass({"text-red-500":!Z.value})},o.toDisplayString(Z.value?" "+Z.value:" value"),3)],64)):(o.openBlock(),o.createElementBlock("span",of,"Filter is empty"))]),o.createVNode(Ve,{style:{width:"100px"},label:"Edit",icon:"",severity:"info",onClick:Be=>le(Z)},null,8,["onClick"])])]))]))),128)),o.createElementVNode("div",rf,[o.createVNode(Ee),o.createElementVNode("div",af,[o.createVNode(Ve,{style:{width:"100px"},label:"Add",disabled:O.value.length===m.value.length,icon:"",severity:"success",onClick:Y},null,8,["disabled"]),o.createVNode(Ve,{style:{width:"100px"},label:"Apply",severity:"info",onClick:ce})])])])):o.createCommentVNode("",!0),o.createElementVNode("div",lf,[o.createElementVNode("div",sf,o.toDisplayString((It=a.value)==null?void 0:It.totalRecords),1),o.createElementVNode("div",cf,o.toDisplayString((qt=a.value)==null?void 0:qt.entityName),1)]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value.result,(Z,at)=>(o.openBlock(),o.createElementBlock("div",{key:at},[o.createElementVNode("div",df,[o.createVNode(je,{disabled:N(Z[c.value.name]),modelValue:i.value,"onUpdate:modelValue":z[7]||(z[7]=Be=>i.value=Be),value:Z[c.value.name]},null,8,["disabled","modelValue","value"]),o.createElementVNode("div",uf,[o.createTextVNode(o.toDisplayString(e.linkedEntity.entityName)+" ",1),o.createElementVNode("span",null,o.toDisplayString(Z[c.value.name]),1)]),N(Z[c.value.name])?o.withDirectives((o.openBlock(),o.createElementBlock("div",ff,null,512)),[[Vt,"This record is already associated.",void 0,{left:!0}]]):o.createCommentVNode("",!0)])]))),128)),o.createVNode(Qe,{rows:p.value,totalRecords:h.value,rowsPerPageOptions:[10,25,50,100],onPage:Je,template:"FirstPageLink PageLinks LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:""},null,8,["rows","totalRecords"])]),o.createElementVNode("div",mf,[o.createVNode(Ee,{class:"mt-5"}),o.createElementVNode("div",pf,[o.createElementVNode("div",gf,[o.createVNode(Ve,{label:"Cancel",icon:"",severity:"secondary",onClick:z[8]||(z[8]=Z=>n.value=!1)})]),o.createElementVNode("div",hf,[o.createVNode(Ve,{label:"Save",severity:"success",onClick:S})])])])],64)}}},[["__scopeId","data-v-a358808d"]]),yf={class:"field flex flex-col"},kf={key:0,class:"flex items-center"},wf={key:1},vf={class:"flex items-center"},xf={class:"flex flex-col justify-center"},Sf={class:"flex flex-row justify-between items-center"},Cf={class:"justify-start"},Ef={class:"justify-start"},Bf={__name:"EntityLookupObject",props:o.mergeModels({linkedEntity:{type:Object,required:!0},entity360Name:{type:String,required:!0},entity360Id:{type:[String,Number]},saveExistingEntityObject:{type:Function}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){mt.useRoute();const{getEntityRecords:t,searchEntityRecords:n,saveRelatedEntityRecord:r,getRecord:a,addRecord:i,updateRecord:l,deleteRecord:s}=We(),d=e,c=o.useModel(e,"modelValue");new EntityRecordService;const u=o.ref({}),f=o.ref({});let m=o.ref("");const p=o.ref({}),g=o.ref({});o.onMounted(async()=>{console.log("linkedEntity"),console.log(d.linkedEntity),console.log("entity360Name"),console.log(d.entity360Name),console.log("entity360Id"),console.log(d.entity360Id),await b(),await h()});const h=async()=>{try{const N=await t(d.linkedEntity.entityName);N&&N.response&&(u.value=N.response,await y(N.response.entity.entityDefinition.columns),await x(),console.log(u.value))}catch{}finally{}},b=async()=>{try{const N=await a(d.entity360Name,d.entity360Id);N&&N.response&&(f.value=N.response,await v(N.response.entity.entityDefinition.columns),console.log(f.value))}catch{}finally{}},y=async N=>{for(let $=0;$<N.length;$++){const C=N[$];if(C.primaryKey&&C.primaryKey==!0){p.value=C;break}}},v=async N=>{for(let $=0;$<N.length;$++){const C=N[$];if(!C.autoGeneerated&&C.foreignKey&&C.foreignKey.referencedEntityName.toLowerCase()==d.linkedEntity.entityName.toLowerCase()){g.value=C;break}}},x=async()=>{for(let N=0;N<u.value.result.length;N++){const $=u.value.result[N];if($[p.value.name]==f.value.result[0][g.value.name]){m.value=$;break}}},E=()=>{const N={linkedEntityRecordId:m.value[p.value.name],linkedEntityName:d.linkedEntity.entityName,relationType:"ManyToOne"};d.saveExistingEntityObject(N)};return(N,$)=>{const C=o.resolveComponent("Select"),k=o.resolveComponent("Divider"),w=o.resolveComponent("Button");return o.openBlock(),o.createElementBlock("div",yf,[o.createVNode(C,{modelValue:o.unref(m),"onUpdate:modelValue":$[0]||($[0]=S=>o.isRef(m)?m.value=S:m=S),"item-value":p.value.name,options:u.value.result,filter:"",optionLabel:p.value.name,placeholder:"Select "+p.value.name,class:"w-full"},{value:o.withCtx(S=>[S.value?(o.openBlock(),o.createElementBlock("div",kf,[o.createElementVNode("div",null,o.toDisplayString(S.value[p.value.name]),1)])):(o.openBlock(),o.createElementBlock("span",wf,o.toDisplayString(S.placeholder),1))]),option:o.withCtx(S=>[o.createElementVNode("div",vf,[o.createElementVNode("div",null,o.toDisplayString(S.option[p.value.name]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"]),o.createElementVNode("div",xf,[o.createVNode(k),o.createElementVNode("div",Sf,[o.createElementVNode("div",Cf,[o.createVNode(w,{label:"Cancel",icon:"",severity:"secondary",onClick:$[1]||($[1]=S=>c.value=!1)})]),o.createElementVNode("div",Ef,[o.createVNode(w,{label:"Save",severity:"success",onClick:E})])])])])}}},$f={style:{"font-weight":"700","font-size":"1.25rem"}},Nf={class:"flex flex-col"},Of={class:"flex flex-row justify-between items-center"},Tf={class:"justify-start"},Vf={class:"justify-start"},If="",Ff={__name:"CreateRelatedentity",props:o.mergeModels({entity360Id:{required:!0},entity360Name:{type:String,required:!0},linkedEntity:{type:Object,required:!0}},{showCreateRelatedEntityForm:{},showCreateRelatedEntityFormModifiers:{}}),emits:o.mergeModels(["onSaveDialog"],["update:showCreateRelatedEntityForm"]),setup(e,{emit:t}){const n=o.useModel(e,"showCreateRelatedEntityForm");mt.useRoute();const r=e,a=r.linkedEntity.entityName,i=t,l=o.ref("Add existing");o.onMounted(()=>{p()});const{formData:s,columns:d,errors:c,backendErrors:u,clearErrors:f,saveRecord:m,fetchAllRecords:p,saveRelatedEntityRecord:g}=tr(a,If,i),h=()=>{for(let x=0;x<d.value.length;x++){const E=d.value[x];!E.autoGenerated&&E.foreignKey&&(s.value[E.name]=r.entity360Id)}const v={relationType:r.linkedEntity.relationType,linkedEntities:{entityLinkage:[{linkEntityName:r.entity360Name,linkRecordIdList:[r.entity360Id]}]}};m(v)},b=v=>{var x;if(((x=v==null?void 0:v.linkRecordIdList)==null?void 0:x.length)>0){const E={entityLinkage:[{linkEntityName:v.linkEntityName,linkRecordIdList:v.linkRecordIdList}]};g(r.entity360Name,r.entity360Id,E)}},y=v=>{const x={entityLinkage:[{linkEntityName:r.entity360Name,linkRecordIdList:[r.entity360Id]}]};g(v.linkedEntityName,v.linkedEntityRecordId,x)};return(v,x)=>{const E=o.resolveComponent("Tab"),N=o.resolveComponent("TabList"),$=o.resolveComponent("Divider"),C=o.resolveComponent("Button"),k=o.resolveComponent("TabPanel"),w=o.resolveComponent("TabPanels"),S=o.resolveComponent("Tabs"),B=o.resolveComponent("Drawer");return o.openBlock(),o.createBlock(B,{visible:n.value,"onUpdate:visible":x[3]||(x[3]=I=>n.value=I),blockScroll:!0,position:"right",class:"p-fluid layout-profile-sidebar",style:{width:"40%"},pt:{closeButton:"ml-auto"}},{header:o.withCtx(()=>[o.createElementVNode("span",$f,o.toDisplayString(l.value)+" "+o.toDisplayString(e.linkedEntity.entityName),1)]),default:o.withCtx(()=>[o.createVNode(S,{value:"1"},{default:o.withCtx(()=>[o.createVNode(N,null,{default:o.withCtx(()=>[o.createVNode(E,{value:"0"},{default:o.withCtx(()=>x[4]||(x[4]=[o.createTextVNode("Create new")])),_:1}),o.createVNode(E,{value:"1"},{default:o.withCtx(()=>x[5]||(x[5]=[o.createTextVNode("Add existing")])),_:1})]),_:1}),o.createVNode(w,null,{default:o.withCtx(()=>[o.createVNode(k,{value:"0"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(d),(I,D)=>{var P;return o.openBlock(),o.createElementBlock("div",{key:D,class:"mt-3"},[!I.autoGenerated&&!I.foreignKey?(o.openBlock(),o.createBlock(Xn,{key:0,modelValue:o.unref(s)[I.name],"onUpdate:modelValue":M=>o.unref(s)[I.name]=M,column:I,errors:(P=o.unref(c)[I.name])==null?void 0:P.messages,onInput:o.unref(f)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"])):o.createCommentVNode("",!0)])}),128)),o.createElementVNode("div",Nf,[o.createVNode($),o.createElementVNode("div",Of,[o.createElementVNode("div",Tf,[o.createVNode(C,{label:"Cancel",icon:"",severity:"secondary",onClick:x[0]||(x[0]=I=>n.value=!1)})]),o.createElementVNode("div",Vf,[o.createVNode(C,{label:"Save",severity:"success",onClick:h})])])])]),_:1}),o.createVNode(k,{value:"1"},{default:o.withCtx(()=>[e.linkedEntity.relationType=="ONE_TO_MANY"?(o.openBlock(),o.createBlock(bf,{key:0,modelValue:n.value,"onUpdate:modelValue":x[1]||(x[1]=I=>n.value=I),linkedEntity:e.linkedEntity,entity360Name:e.entity360Name,entity360Id:e.entity360Id,saveExistingRelatedEntityRecord:b},null,8,["modelValue","linkedEntity","entity360Name","entity360Id"])):o.createCommentVNode("",!0),e.linkedEntity.relationType=="MANY_TO_ONE"?(o.openBlock(),o.createBlock(Bf,{key:1,modelValue:n.value,"onUpdate:modelValue":x[2]||(x[2]=I=>n.value=I),linkedEntity:e.linkedEntity,entity360Name:e.entity360Name,entity360Id:e.entity360Id,saveExistingEntityObject:y},null,8,["modelValue","linkedEntity","entity360Name","entity360Id"])):o.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1})]),_:1},8,["visible"])}}},Pf={class:"flex flex-col border-bottom-section pb-3 pt-3"},Rf={class:"flex items-center pl-3 pr-3 justify-between"},Df={key:0,class:"pi pi-caret-right"},_f={key:1,class:"pi pi-caret-down"},Af={class:"ml-3 font-bold"},Lf={class:"ml-1"},zf={class:"text-right"},Mf={key:0},jf=Ie({__name:"LinkEntitySection",props:{entity360Id:{required:!0},entity360Name:{type:String,required:!0},linkedEntity:{type:Object,required:!0},entity360Name:{type:[String,Number]},onSaveRelatedEnttity:{type:Function}},setup(e){mt.useRoute();const t=e,n=o.ref(!1),r=o.ref(!1),a=()=>{n.value=!n.value},i=()=>{r.value=!r.value},l=()=>{r.value=!1,t.onSaveRelatedEnttity()},s=o.computed(()=>t.linkedEntity.list.filter(d=>!d.is_deleted).length);return(d,c)=>{const u=o.resolveComponent("Button");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",Pf,[o.createElementVNode("div",Rf,[o.createElementVNode("div",{class:"flex cursor-pointer items-center linked-entity-section grow line-height-4",onClick:c[0]||(c[0]=f=>a())},[n.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Df)),n.value?(o.openBlock(),o.createElementBlock("div",_f)):o.createCommentVNode("",!0),o.createElementVNode("div",Af,o.toDisplayString(e.linkedEntity.entityName),1),o.createElementVNode("div",Lf," ("+o.toDisplayString(s.value)+") ",1)]),o.createElementVNode("div",zf,[o.createVNode(u,{label:"Add",icon:"pi pi-plus",size:"small",onClick:c[1]||(c[1]=f=>i())})])]),n.value?(o.openBlock(),o.createElementBlock("div",Mf,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.linkedEntity.list,(f,m)=>(o.openBlock(),o.createElementBlock("div",{class:"flex flex-col",key:m},[f.is_deleted?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(Du,{key:0,linkEntityListItem:f},null,8,["linkEntityListItem"]))]))),128))])):o.createCommentVNode("",!0)]),r.value?(o.openBlock(),o.createBlock(Ff,{key:0,showCreateRelatedEntityForm:r.value,"onUpdate:showCreateRelatedEntityForm":c[2]||(c[2]=f=>r.value=f),linkedEntity:e.linkedEntity,entity360Name:e.entity360Name,entity360Id:e.entity360Id,onOnSaveDialog:l},null,8,["showCreateRelatedEntityForm","linkedEntity","entity360Name","entity360Id"])):o.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-412eec44"]]),Uf={key:0},Hf={class:"flex"},Wf={class:"p-3 mt-3 flex-col items-center"},qf={key:0,class:"pi pi-caret-right"},Kf={key:1,class:"pi pi-caret-down"},Gf={class:"font-bold ml-2"},Yf={key:0,class:"flex flex-col mt-4"},Xf={class:"flex flex-col mt-2"},Jf={class:"flex flex-row flex-wrap justify-between pl-5"},Qf={class:"flex flex-col"},Zf={class:"font-bold"},em={class:"mt-2"},tm={key:0,class:"flex flex-col",style:{position:"relative","max-width":"400px","background-color":"var(--surface-card)"}},nm={key:2,style:{width:"350px"},class:"flex flex-col justify-center"},om={key:0,class:"custom-sidebar"},rm={class:"custom-sidebar-content"},am={class:"custom-sidebar-button"},im={class:"custom-sidebar-text"},ii=Ie({__name:"Entity360",props:{entityName:{type:String},recordId:{type:String},variable:{type:String,default:"item"},linkedEntity:Array},emits:["onSaveDialog"],setup(e,{expose:t,emit:n}){var B,I;const r=Oe(),a=mt.useRoute(),i=e,l=o.ref(!0),s=o.ref(!1),d=o.ref([]);let c=(B=a==null?void 0:a.params)==null?void 0:B.entityName,u=(I=a==null?void 0:a.params)==null?void 0:I.id;i.entityName&&(c=i.entityName),i.recordId&&(u=i.recordId);const f=n,{formData:m,columns:p,errors:g,backendErrors:h,isDataChange:b,linkedEntities:y,primarayColumn:v,clearErrors:x,saveRecord:E,getRelatedEntityRecordById:N,cancleRecord:$}=tr(c,u,f);o.watch(()=>r.globalConfigs.appId,async D=>{D&&N()},{immediate:!0});const C=()=>{l.value=!l.value},k=()=>{s.value=!s.value},w=()=>{N()},S=D=>{if(!d.value||d.value.length===0)return[];const P=d.value.find(M=>M.entityName===D);return P&&P.list?P.list:(console.log("No related entity found"),[])};return t({getRelatedEntity:S}),o.watch(()=>y.value,D=>{Array.isArray(D)&&D.length>0&&D[0]&&(d.value=D)},{immediate:!0,deep:!0}),(D,P)=>{var ae;const M=o.resolveComponent("SplitterPanel"),j=o.resolveComponent("Tab"),q=o.resolveComponent("TabList"),F=o.resolveComponent("TabPanel"),O=o.resolveComponent("TabPanels"),_=o.resolveComponent("Tabs"),J=o.resolveComponent("Splitter"),re=o.resolveComponent("Button");return D.$slots["list-item-display-360"]?(o.openBlock(),o.createElementBlock("div",Uf,[o.renderSlot(D.$slots,"header",{},void 0,!0),o.createElementVNode("div",null,[o.renderSlot(D.$slots,"list-item-display-360",o.normalizeProps({[e.variable||""]:{formData:o.unref(m),columns:o.unref(p),linkedEntities:o.unref(y),errors:o.unref(g),recordId:o.unref(u),entityName:o.unref(c),getRelatedEntity:S}}),void 0,!0)]),o.renderSlot(D.$slots,"footer",{},void 0,!0)])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",Hf,[o.createVNode(J,{class:"flex-1",layout:"horizontal",gutterSize:8,size:100},{default:o.withCtx(()=>[o.createVNode(M,{size:20,minSize:10,maxSize:20},{default:o.withCtx(()=>[o.createElementVNode("div",Wf,[o.createElementVNode("div",{onClick:P[0]||(P[0]=Y=>C()),class:"section-heading cursor-pointer"},[l.value?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("i",qf)),l.value?(o.openBlock(),o.createElementBlock("i",Kf)):o.createCommentVNode("",!0),o.createElementVNode("span",Gf," About this "+o.toDisplayString(o.unref(c)),1)]),l.value?(o.openBlock(),o.createElementBlock("div",Yf,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(p),(Y,Q)=>{var le;return o.openBlock(),o.createElementBlock("div",{key:Q},[Y.autoGenerated?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(Xn,{key:0,modelValue:o.unref(m)[Y.name],"onUpdate:modelValue":ce=>o.unref(m)[Y.name]=ce,column:Y,errors:(le=o.unref(g)[Y.name])==null?void 0:le.messages,onInput:o.unref(x)},null,8,["modelValue","onUpdate:modelValue","column","errors","onInput"]))])}),128))])):o.createCommentVNode("",!0)])]),_:1}),o.createVNode(M,{size:55,minSize:35,style:{height:"100%"}},{default:o.withCtx(()=>[o.createVNode(_,{value:"0"},{default:o.withCtx(()=>[o.createVNode(q,null,{default:o.withCtx(()=>[o.createVNode(j,{value:"0"},{default:o.withCtx(()=>P[3]||(P[3]=[o.createTextVNode("Overview")])),_:1}),o.createVNode(j,{value:"1"},{default:o.withCtx(()=>P[4]||(P[4]=[o.createTextVNode("Activity")])),_:1})]),_:1}),o.createVNode(O,null,{default:o.withCtx(()=>[o.createVNode(F,{value:"0"},{default:o.withCtx(()=>[o.createElementVNode("div",Xf,[P[5]||(P[5]=o.createElementVNode("h3",{class:"mt-2 text-xl font-semibold"},"Data highlights",-1)),o.createElementVNode("div",Jf,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(p).filter(Y=>Y.autoGenerated),(Y,Q)=>(o.openBlock(),o.createElementBlock("div",{key:Q,class:"column-item"},[o.createElementVNode("div",Qf,[o.createElementVNode("div",Zf,o.toDisplayString(Y.name),1),o.createElementVNode("div",em,[o.createVNode(rr,{column:Y,value:o.unref(m)[Y.name]},null,8,["column","value"])])])]))),128))])])]),_:1}),o.createVNode(F,{value:"1"})]),_:1})]),_:1})]),_:1})]),_:1}),((ae=o.unref(y))==null?void 0:ae.length)>0?(o.openBlock(),o.createElementBlock("div",tm,[s.value?(o.openBlock(),o.createBlock(re,{key:0,icon:"pi pi-caret-right",rounded:"",onClick:k,"aria-label":"Filter",style:{height:"2rem",width:"2rem",left:"-20px"}})):o.createCommentVNode("",!0),s.value?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(re,{key:1,icon:"pi pi-caret-left",rounded:"",onClick:k,"aria-label":"Filter",style:{height:"2rem",width:"2rem",left:"-20px"}})),s.value?(o.openBlock(),o.createElementBlock("div",nm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(y),(Y,Q)=>(o.openBlock(),o.createElementBlock("div",{key:Q},[o.createVNode(jf,{entity360Name:o.unref(c),entity360Id:o.unref(u),linkedEntity:Y,onSaveRelatedEnttity:w},null,8,["entity360Name","entity360Id","linkedEntity"])]))),128))])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)]),o.unref(b)?(o.openBlock(),o.createElementBlock("div",om,[o.createElementVNode("div",rm,[o.createElementVNode("div",am,[o.createVNode(re,{severity:"primary",onClick:P[1]||(P[1]=Y=>o.unref(E)())},{default:o.withCtx(()=>P[6]||(P[6]=[o.createTextVNode("Save")])),_:1}),o.createVNode(re,{style:{"margin-left":"10px"},severity:"secondary",onClick:P[2]||(P[2]=Y=>o.unref($)())},{default:o.withCtx(()=>P[7]||(P[7]=[o.createTextVNode("Cancel")])),_:1})]),o.createElementVNode("div",im," You've changed property in the "+o.toDisplayString(o.unref(c))+". ",1)])])):o.createCommentVNode("",!0)],64))}}},[["__scopeId","data-v-12a444f4"]]),lm=o.ref("id"),sm=o.ref(1),cm=o.ref(25),dm=o.ref(0),li=o.ref([]);o.ref("");function uo(){const e=new We;let{errors:t,setErrors:n}=Ia(),r=o.reactive({data:null});const a=k=>{r.data=k},i=async k=>{try{const w=await e.getEntityRecords(k);if(w&&w.response)return w}catch(w){return console.error("Error fetching entity:",w.errorMessage),w}finally{}},l=async(k,w)=>{try{let S=await e.addRecord(k.entityName,w);if(S)return S}catch(S){return S}finally{}},s=async(k,w,S)=>{try{const B=await e.updateRecord(k.entityName,w,S);if(B&&B.response)return B}catch(B){return B}finally{}},d=async(k,w)=>{try{w.filter==null&&(w.filter={}),Object.keys(w.filter).length===0&&(w.filter=[]);const S=await e.searchEntityRecords(k.entityName,w);if(S)return S.response.sortBy=w.sortBy,S.response.filters=w.filter,S.response.sortDirection=w.sortDirection,S.response.fullTextSearch=w.fullTextSearch,S}catch(S){return S}finally{}},c=async(k,w)=>{try{const S=await e.deleteRecord(k.entityName,w);if(S)return S}catch(S){console.error("Error on deleting record:",S.errorMessage)}finally{}},u=k=>k.result,f=k=>{var w,S;return m((S=(w=k==null?void 0:k.entity)==null?void 0:w.entityDefinition)==null?void 0:S.columns)},m=k=>k.filter(w=>!(w.fieldType&&w.fieldType==="ENTITY")),p=k=>{const w=k.entity.entityDefinition.columns;let S={};for(let B=0;B<w.length;B++){const I=w[B];if(I.primaryKey&&I.primaryKey==!0){S=I;break}}return S},g=k=>{const w=k.entity.entityDefinition.columns;let S={};for(let B=0;B<w.length;B++){let I=w[B];I.autoGenerated||(S[I.name]="")}return S},h=(k,w)=>{let S="";const B=k.entity.entityDefinition.columns;for(let I=0;I<B.length;I++){let D=B[I];if(w==D.name){S=D.type;break}}return S},b=(k,w)=>{const B=k.entity.entityDefinition.columns.filter(D=>D.autoGenerated).map(D=>D.name);return Object.entries(w).filter(([D])=>!B.includes(D)).map(([D,P])=>({recordColumnName:D,recordColumnValue:P,columnType:h(r.data,D)}))},y=()=>{const k=r.data.entity.entityDefinition.columns;return er().shape(k.reduce((S,B)=>(B.autoGenerated||(S[B.name]=Zo().nullable(!1).test({name:"custom-validation",test:function(I){const D=[];let P="";if(B.required&&(!I||I.trim()===""))if(B.validations){P=v(B.validations,"VALIDATE_REQUIRED"),D.push(P);let M=E(B.validations,"VALIDATE_REQUIRED");M&&(M="hint:"+M,D.push(M))}else P=B.displayName+" is required.",D.push(P);else{if(B.maxLength&&I.length>B.maxLength)if(B.validations){P=v(B.validations,"VALIDATE_MAXLENGTH"),D.push(P);let M=E(B.validations,"VALIDATE_MAXLENGTH");M&&(M="hint:"+M,D.push(M))}else P=B.displayName+" cannot exceed from "+B.maxLength+" characters",D.push(P);if(B.regxId&&!new RegExp(x(B.validations,"VALIDATE_REGX")).test(I))if(B.validations){P=v(B.validations,"VALIDATE_REGX"),D.push(P);let M=E(B.validations,"VALIDATE_REGX");M&&(M="hint:"+M,D.push(M))}else P=B.displayName+" invalid format.",D.push(P)}return D.length>0?this.createError({message:D}):!0}})),S),{}))},v=(k,w)=>{for(let S=0;S<k.length;S++)if(w==k[S].type)return k[S].message},x=(k,w)=>{for(let S=0;S<k.length;S++)if(w==k[S].type)return k[S].regx},E=(k,w)=>{for(let S=0;S<k.length;S++)if(w==k[S].type)return k[S].hint};return{state:r,setEntity:a,getEntity:i,addRecord:l,updateRecord:s,searchRecord:d,entityRecordDelete:c,getEntityItems:u,getEntityColumns:f,getPrimaryKeyColumn:p,getFormData:g,createDataToSave:b,createValidationSchema:y,clearErrors:k=>(n({...t.value,[k]:null}),t.value),validateData:async(k,w)=>{try{return await k.validate(w,{abortEarly:!1}),n({}),{validate:!0}}catch(S){const B=S.inner.reduce((P,M)=>(P[M.path]||(P[M.path]={messages:[]}),P[M.path].messages.push(...M.errors),P),{}),I=Object.entries(B).reduce((P,[M,j])=>(P[M]={messages:j.messages},P),{});return n(I),{validate:!1,errors:t.value}}},applyPreset:async(k,w)=>{console.log("Applying preset:",k),li.value=[];const S={sortBy:[lm.value],sortDirection:sm.value===1?"ASC":"DESC",pageSize:cm.value,currentPage:dm.value,columnList:null,filter:li.value,fullTextSearch:"",presetName:k},B=await e.searchEntityRecords(w,S);if(B.success)return B.response}}}const fo={__name:"ConfirmDeleteDialog",props:{showDeleteDialog:{},showDeleteDialogModifiers:{}},emits:o.mergeModels(["onDeleteItem"],["update:showDeleteDialog"]),setup(e,{emit:t}){const n=o.useModel(e,"showDeleteDialog"),r=t,a=i=>{r("onDeleteItem",{remove:i})};return(i,l)=>{const s=o.resolveComponent("Button"),d=o.resolveComponent("Dialog");return o.openBlock(),o.createBlock(d,{visible:n.value,"onUpdate:visible":l[2]||(l[2]=c=>n.value=c),style:{width:"450px"},header:"Confirm",modal:!0},{footer:o.withCtx(()=>[o.createVNode(s,{label:"No",icon:"pi pi-times",text:"",onClick:l[0]||(l[0]=c=>a(!1))}),o.createVNode(s,{label:"Yes",icon:"pi pi-check",text:"",onClick:l[1]||(l[1]=c=>a(!0))})]),default:o.withCtx(()=>[l[3]||(l[3]=o.createElementVNode("div",{class:"flex items-center justify-center"},[o.createElementVNode("i",{class:"pi pi-exclamation-triangle mr-3",style:{"font-size":"2rem"}}),o.createElementVNode("span",null,"Are you sure you want to delete the selected item?")],-1))]),_:1},8,["visible"])}}},um={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},fm={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},pn={__name:"EntityFormDialog",props:o.mergeModels({item:Object},{showEntityForm:{},showEntityFormModifiers:{}}),emits:["update:showEntityForm"],setup(e){const t=o.useModel(e,"showEntityForm"),n=o.inject("entityObject"),r=e;let a=o.ref([]),i=o.ref({}),l=o.ref([]),s=o.ref(null),d=o.ref({});o.onMounted(()=>{a.value=n.getEntityColumns(n.state.data),r.item?i.value=JSON.parse(JSON.stringify(r.item)):i.value=n.getFormData(n.state.data),s.value=n.createValidationSchema()});const c=async()=>{const p=await n.validateData(s.value,i.value);if(!p.validate){d.value=p.errors;return}const g=n.getPrimaryKeyColumn(n.state.data),h=r.item[g.name],b={dataDefinitions:n.createDataToSave(n.state.data,i.value)},y=await n.updateRecord(n.state.data,h,b);if(y&&y.success){t.value=!1;const v={sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch},x=await n.searchRecord(n.state.data,v);if(x!=null&&x.response){let E=x==null?void 0:x.response;n.setEntity(E)}}else y.validationErrors&&(l.value=JSON.parse(JSON.stringify(y.errvalidationErrorsors)))},u=async()=>{const p=await n.validateData(s.value,i.value);if(!p.validate){d.value=p.errors;return}const g={dataDefinitions:n.createDataToSave(n.state.data,i.value)},h=await n.addRecord(n.state.data,g);h&&h.success?(t.value=!1,n.state.data=await n.getEntity(n.state.data.entityName)):h.validationErrors&&(l.value=JSON.parse(JSON.stringify(h.errvalidationErrorsors)))},f=async()=>{r.item?c():u()},m=p=>{d.value=n.clearErrors(p)};return(p,g)=>{const h=o.resolveComponent("Button"),b=o.resolveComponent("Dialog");return t.value?(o.openBlock(),o.createBlock(b,{key:0,showFooter:!1,visible:t.value,"onUpdate:visible":g[2]||(g[2]=y=>t.value=y),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},modal:!0,class:"p-fluid"},{header:o.withCtx(()=>[e.item?(o.openBlock(),o.createElementBlock("span",um,"Edit "+o.toDisplayString(o.unref(n).state.data.entityName)+" record details",1)):o.createCommentVNode("",!0),e.item?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",fm,"Add "+o.toDisplayString(o.unref(n).state.data.entityName)+" record details",1))]),footer:o.withCtx(()=>[o.createVNode(h,{type:"button",icon:"",label:"Cancel",severity:"secondary",onClick:g[0]||(g[0]=y=>t.value=!1)}),o.createVNode(h,{type:"button",icon:"",label:"Save",severity:"success",onClick:g[1]||(g[1]=y=>f())})]),default:o.withCtx(()=>{var y;return[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(a),(v,x)=>{var E;return o.openBlock(),o.createElementBlock("div",{key:x},[!v.autoGenerated&&!v.foreignKey?(o.openBlock(),o.createBlock(Xn,{key:0,modelValue:o.unref(i)[v.name],"onUpdate:modelValue":N=>o.unref(i)[v.name]=N,column:v,errors:(E=o.unref(d)[v.name])==null?void 0:E.messages,onInput:m},null,8,["modelValue","onUpdate:modelValue","column","errors"])):o.createCommentVNode("",!0),!v.autoGenerated&&v.foreignKey?(o.openBlock(),o.createBlock(Xa,{key:1,modelValue:o.unref(i)[v.name],"onUpdate:modelValue":N=>o.unref(i)[v.name]=N,entityName:v.foreignKey.referencedEntityName,columnName:v.name,displayName:v.displayName,relatedEntityColumn:v.foreignKey.referencedColumnName},null,8,["modelValue","onUpdate:modelValue","entityName","columnName","displayName","relatedEntityColumn"])):o.createCommentVNode("",!0)])}),128)),((y=o.unref(l))==null?void 0:y.length)>0?(o.openBlock(),o.createBlock(Ya,{key:0,errors:o.unref(l)},null,8,["errors"])):o.createCommentVNode("",!0)]}),_:1},8,["visible"])):o.createCommentVNode("",!0)}}},mm={class:"flex justify-between items-start"},pm={class:"flex-grow-1"},gm={class:"tile-grid"},hm={class:"font-bold text-lg text-700"},bm={class:"flex flex-col gap-2"},ym=Ie({__name:"EntityListSingleRecord",props:{item:Object},setup(e){const t=e,n=o.inject("entityObject"),r=o.ref([]),a=o.ref(!1),i=o.ref(!1);o.onMounted(()=>{r.value=n.getEntityColumns(n.state.data)});const l=()=>{a.value=!0},s=()=>{i.value=!0},d=u=>{u.remove==!0?c():a.value=!1},c=async()=>{const u=n.getPrimaryKeyColumn(n.state.data),f=t.item[u.name],m=await n.entityRecordDelete(n.state.data,f);if(m!=null&&m.success){a.value=!1;const p={sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch},g=await n.searchRecord(n.state.data,p);if(g!=null&&g.response){let h=g==null?void 0:g.response;n.setEntity(h)}console.log(m)}};return(u,f)=>{const m=o.resolveComponent("Button");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",mm,[o.createElementVNode("div",pm,[o.createElementVNode("div",gm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(p,g)=>(o.openBlock(),o.createElementBlock("div",{key:g},[o.createElementVNode("span",hm,o.toDisplayString(p.name)+" : ",1),o.createVNode(rr,{column:p,value:e.item[p.name]},null,8,["column","value"])]))),128))])]),o.createElementVNode("div",bm,[o.createVNode(m,{onClick:f[0]||(f[0]=p=>s()),icon:"pi pi-pencil",severity:"success",size:"",rounded:"","aria-label":"Edit"}),o.createVNode(m,{onClick:f[1]||(f[1]=p=>l()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})])]),i.value?(o.openBlock(),o.createBlock(pn,{key:0,showEntityForm:i.value,"onUpdate:showEntityForm":f[2]||(f[2]=p=>i.value=p),item:e.item},null,8,["showEntityForm","item"])):o.createCommentVNode("",!0),a.value?(o.openBlock(),o.createBlock(fo,{key:1,showDeleteDialog:a.value,"onUpdate:showDeleteDialog":f[3]||(f[3]=p=>a.value=p),onOnDeleteItem:d},null,8,["showDeleteDialog"])):o.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-bce4d0f0"]]),km=Ie({__name:"EntityListRecordParent",props:{listItemDisplay:String},setup(e){const t=o.inject("entityObject"),n=o.ref([]);return o.watch(()=>t.state.data,r=>{r&&(n.value=r.result,console.log("Entity state updated in child:",t))},{immediate:!0}),(r,a)=>(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.value,(i,l)=>(o.openBlock(),o.createElementBlock("div",{key:l,class:"card rounded-md p-5 my-2 shadow-lg relative tile"},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listItemDisplay!=null&&e.listItemDisplay!=""?e.listItemDisplay:ym),o.mergeProps({ref_for:!0},{item:i}),null,16))]))),128))}},[["__scopeId","data-v-f59ea2d9"]]),wm={};function vm(e,t){return null}const xm=Ie(wm,[["render",vm]]),Sm={class:"my-2"},Cm={class:"m-0"},Em={__name:"EntityListHeaderSlot",setup(e){const t=o.inject("entityObject");let n=o.ref("");return o.watch(()=>t.state.data,r=>{r&&(n.value=r.entityName)},{immediate:!0}),(r,a)=>{const i=o.resolveComponent("Toolbar");return o.openBlock(),o.createBlock(i,{class:"p-2 my-2"},{start:o.withCtx(()=>[o.createElementVNode("div",Sm,[o.createElementVNode("h2",Cm,"EntityName: "+o.toDisplayString(o.unref(n)),1)])]),end:o.withCtx(()=>a[0]||(a[0]=[])),_:1})}}},Bm={class:"flex flex-col mb-5"},$m={class:"col-12"},Nm={class:"flex flex-col mb-5"},Om={class:"col-12"},Tm={key:0},Vm={class:"flex flex-col mb-5"},Im={class:"col-12"},Fm={class:"flex flex-col mb-5"},Pm={class:"col-12"},Rm={class:"flex flex-col mb-5"},Dm={class:"col-12"},_m={class:"flex flex-row justify-between items-center"},Am={key:1},Lm={class:"flex flex-row justify-between items-center"},zm={key:1,class:"text-red-500"},Mm={class:"flex flex-col"},jm={class:"flex flex-row justify-between items-center"},Um={__name:"FilterSortSidebar",props:o.mergeModels({headers:Array,operatorMap:Object,sortCallback:Function,filterCallback:Function,getColumnDatatype:Function,getDatatypeByField:Function,preFiltered:String},{sortBy:{},sortByModifiers:{},sortDirection:{},sortDirectionModifiers:{},showFilter:{},showFilterModifiers:{},filters:{},filtersModifiers:{}}),emits:["update:sortBy","update:sortDirection","update:showFilter","update:filters"],setup(e){const t=o.useModel(e,"sortBy"),n=o.useModel(e,"sortDirection"),r=o.useModel(e,"showFilter"),a=o.useModel(e,"filters"),i={GREATER_THAN:"is greater than",dateAfter:"is after",EQUAL:"is equals",dateIs:"is equals",NOT_EQUAL:"is not equals",dateIsNot:"is not equals",LESS_THAN:"is less than",dateBefore:"is before",LESS_THAN_EQUAL:"is less than or equal to",GREATER_THAN_EQUAL:"is greater than or equal to",between:"between",CONTAINS:"contains",STARTS_WITH:"starts with",NOT_CONTAINS:"not contains",ENDS_WITH:"ends with"},l=[{label:"Starts with",value:"STARTS_WITH"},{label:"Contains",value:"CONTAINS"},{label:"Not contains",value:"NOT_CONTAINS"},{label:"Ends with",value:"ENDS_WITH"},{label:"Equals",value:"EQUAL"},{label:"Not equals",value:"NOT_EQUAL"}],s=[{label:"Equals",value:"EQUAL"},{label:"Not equals",value:"NOT_EQUAL"},{label:"Less than",value:"LESS_THAN"},{label:"Less than or equal to",value:"LESS_THAN_EQUAL"},{label:"Greater than",value:"GREATER_THAN"},{label:"Greater than or equal to",value:"GREATER_THAN_EQUAL"}],d=[{label:"Equals",value:"EQUAL"},{label:"Not equals",value:"NOT_EQUAL"}],c=[{label:"Date is",value:"dateIs"},{label:"Date is not",value:"dateIsNot"},{label:"Date is before",value:"dateBefore"},{label:"Date is after",value:"dateAfter"}],u=[{label:"ASC",value:1},{label:"DESC",value:-1}];let f=[];const m=o.computed(()=>{var w;const C=e.preFiltered?((w=e.preFiltered.match(/\b\w+(?==)/g))==null?void 0:w.map(S=>S.trim().toLowerCase()))||[]:[];return e.headers.filter(S=>S.sortable&&!C.includes(S.field.toLowerCase()))}),p=o.computed(()=>e.headers.filter(C=>C.filterable)),g=C=>e.headers.filter(k=>{var S,B;return k.filterable?((S=a.value[C])==null?void 0:S.columnName)===k.name?!0:(e.preFiltered?((B=e.preFiltered.match(/\b\w+(?==)/g))==null?void 0:B.map(I=>I.trim().toLowerCase()))||[]:[]).includes(k.field.toLowerCase())?!1:!a.value.some((I,D)=>D!==C&&I.columnName===k.name):!1}).map(k=>({label:k.name,value:k.field})),h=C=>{let k="";switch(e.getDatatypeByField(C.columnName).toLowerCase()){case"string":case"uuid":k="startsWith";break;case"date":k="dateIs";break;case"numeric":case"int":case"integer":k="equals";break;case"bool":case"boolean":k="equals";break}C.operator=k,C.value=""},b=C=>{const k=e.getDatatypeByField(C.columnName);switch(k&&k.toLowerCase()){case"integer":case"int":case"numeric":f=s;break;case"date":f=c;break;case"bool":case"boolean":f=d;break;default:f=l}return f},y=C=>{if(C&&C.columnName){const k=e.getDatatypeByField(C.columnName);return e.getColumnDatatype(k)}else return""},v=()=>{for(let C=0;C<a.value.length;C++){const k=a.value[C];k.editing=!1}a.value.push({columnName:"",value:"",operator:"",editing:!0})},x=C=>{a.value.splice(C,1)},E=C=>{C.editing=!C.editing},N=()=>{let C=[],k=JSON.parse(JSON.stringify(a.value));for(let w=0;w<k.length;w++){const S=k[w];delete S.editing,S.columnName&&S.operator&&S.value&&(S.columnType=e.getDatatypeByField(S.columnName),S.operator=e.operatorMap[S.operator],C.push(S))}e.filterCallback(C)},$=()=>{e.sortCallback()};return(C,k)=>{const w=o.resolveComponent("Select"),S=o.resolveComponent("Divider"),B=o.resolveComponent("InputNumber"),I=o.resolveComponent("DatePicker"),D=o.resolveComponent("InputText"),P=o.resolveComponent("Button"),M=o.resolveComponent("Drawer");return o.openBlock(),o.createBlock(M,{visible:r.value,"onUpdate:visible":k[4]||(k[4]=j=>r.value=j),header:"Sorting and Filter",blockScroll:!0,position:"right",class:"layout-profile-sidebar !w-full md:!w-80 lg:!w-[30rem]",pt:{closeButton:"ml-auto"}},{default:o.withCtx(()=>[o.createElementVNode("div",Bm,[k[5]||(k[5]=o.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),o.createElementVNode("div",$m,[o.createVNode(w,{modelValue:t.value,"onUpdate:modelValue":k[0]||(k[0]=j=>t.value=j),options:m.value,optionLabel:"name",optionValue:"field",highlightOnSelect:!1,class:"w-full",onChange:k[1]||(k[1]=j=>$(C.event))},null,8,["modelValue","options"])])]),o.createElementVNode("div",Nm,[k[6]||(k[6]=o.createElementVNode("div",{class:"col-12 font-bold"},[o.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),o.createElementVNode("div",Om,[o.createVNode(w,{modelValue:n.value,"onUpdate:modelValue":k[2]||(k[2]=j=>n.value=j),options:u,optionLabel:"label",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:k[3]||(k[3]=j=>$(C.event))},null,8,["modelValue"])])]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(j,q)=>(o.openBlock(),o.createElementBlock("div",{key:q},[j.editing?(o.openBlock(),o.createElementBlock("div",Tm,[o.createVNode(S),o.createElementVNode("div",Vm,[k[7]||(k[7]=o.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),o.createElementVNode("div",Im,[o.createVNode(w,{modelValue:j.columnName,"onUpdate:modelValue":F=>j.columnName=F,options:g(q),optionLabel:"label",placeholder:"Select column",optionValue:"value",highlightOnSelect:!1,class:"w-full",onChange:F=>h(j)},null,8,["modelValue","onUpdate:modelValue","options","onChange"])])]),o.createElementVNode("div",Fm,[k[8]||(k[8]=o.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),o.createElementVNode("div",Pm,[o.createVNode(w,{modelValue:j.operator,"onUpdate:modelValue":F=>j.operator=F,options:b(j),optionLabel:"label",placeholder:"Select operator",optionValue:"value",highlightOnSelect:!1,class:"w-full"},null,8,["modelValue","onUpdate:modelValue","options"])])]),o.createElementVNode("div",Rm,[k[9]||(k[9]=o.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),o.createElementVNode("div",Dm,[y(j)=="numeric"?(o.openBlock(),o.createBlock(B,{key:0,format:!1,class:"w-full",modelValue:j.value,"onUpdate:modelValue":F=>j.value=F,placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"])):y(j)=="date"?(o.openBlock(),o.createBlock(I,{key:1,class:"w-full",modelValue:j.value,"onUpdate:modelValue":F=>j.value=F,dateFormat:"mm/dd/yy",placeholder:"mm/dd/yyyy"},null,8,["modelValue","onUpdate:modelValue"])):(o.openBlock(),o.createBlock(D,{key:2,modelValue:j.value,"onUpdate:modelValue":F=>j.value=F,class:"w-full",placeholder:"Search value"},null,8,["modelValue","onUpdate:modelValue"]))])]),o.createElementVNode("div",_m,[o.createVNode(P,{label:"Hide",icon:"",severity:"warn",onClick:F=>E(j)},null,8,["onClick"]),o.createVNode(P,{label:"Delete",icon:"",severity:"danger",onClick:F=>x(q)},null,8,["onClick"])])])):o.createCommentVNode("",!0),j.editing?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Am,[o.createVNode(S),o.createElementVNode("div",Lm,[o.createElementVNode("span",null,[j.columnName||j.operator||j.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",{class:o.normalizeClass({"text-red-500":!j.columnName})},o.toDisplayString(j.columnName?" "+j.columnName:" column"),3),o.createElementVNode("span",{class:o.normalizeClass({"text-red-500":!i[j.operator]})},o.toDisplayString(j.operator?" "+i[j.operator]:" operator"),3),o.createElementVNode("span",{class:o.normalizeClass({"text-red-500":!j.value})},o.toDisplayString(j.value?" "+j.value:" value"),3)],64)):(o.openBlock(),o.createElementBlock("span",zm,"Filter is empty"))]),o.createVNode(P,{label:"Edit",icon:"",severity:"info",onClick:F=>E(j)},null,8,["onClick"])])]))]))),128)),o.createElementVNode("div",Mm,[o.createVNode(S),o.createElementVNode("div",jm,[o.createVNode(P,{label:"Add",disabled:p.value.length===a.value.length,icon:"",severity:"success",onClick:v},null,8,["disabled"]),o.createVNode(P,{label:"Apply",severity:"info",onClick:N})])])]),_:1},8,["visible"])}}},Hm={class:"my-1"},Ye=Ie({__name:"EntityListFilters",props:{externalFilterPayload:Object,preFiltered:{type:String,default:""}},setup(e){const t=o.inject("entityObject"),n=o.ref(!1),r=o.ref([]),a=o.ref([]),i=o.ref(""),l=o.ref(1),s=o.ref(""),d=o.ref([]),c=o.ref([]),u=o.ref(!1),f=e,m=o.inject("getVariable"),p={GREATER_THAN:"GREATER_THAN",dateAfter:"GREATER_THAN",EQUAL:"EQUAL",dateIs:"EQUAL",NOT_EQUAL:"NOT_EQUAL",dateIsNot:"NOT_EQUAL",LESS_THAN:"LESS_THAN",dateBefore:"LESS_THAN",LESS_THAN_EQUAL:"LESS_THAN_EQUAL",GREATER_THAN_EQUAL:"GREATER_THAN_EQUAL",between:"BETWEEN",CONTAINS:"CONTAINS",STARTS_WITH:"STARTS_WITH",NOT_CONTAINS:"NOT_CONTAINS",ENDS_WITH:"ENDS_WITH"},g=()=>{var w;const k=f.externalFilterPayload;i.value=((w=k.sortBy)==null?void 0:w[0])||"",l.value=k.sortDirection==="DESC"?-1:1,s.value=k.fullTextSearch||"",r.value=k.filter||[],a.value=k.filter||[],y()};o.watch(()=>t.state.data,k=>{if(k&&!u.value){if(d.value=t.getEntityColumns(k),c.value=N(d.value),!i.value){const w=t.getPrimaryKeyColumn(k);i.value=(w==null?void 0:w.name)||""}f.externalFilterPayload&&g(),u.value=!0}},{immediate:!0});const h=()=>{n.value=!n.value},b=k=>{a.value=k,y()},y=async()=>{const k=t.state.data,w={sortBy:[i.value],sortDirection:l.value===1?"ASC":"DESC",pageSize:(k==null?void 0:k.pageSize)||25,currentPage:(k==null?void 0:k.currentPage)||0,columnList:null,filter:a.value,fullTextSearch:s.value},S=await t.searchRecord(k,w);S!=null&&S.success&&t.setEntity(S.response)},v=()=>{y()},x=()=>{var w;r.value=[],a.value=[];const k=((w=f.preFiltered)==null?void 0:w.split("&&").map(S=>{const[B,I]=S.split("=").map(P=>P.trim()),D=m==null?void 0:m(I);return{columnName:B,value:D,operator:"EQUAL",columnType:typeof D=="string"?"STRING":"INT"}}))||[];a.value=k,y()},E=()=>{y()},N=k=>k.map(w=>({field:w.name,name:w.displayName||w.name,filterable:w.filterable,datatype:w.type,sortable:w.indexColumn,displayFormatKey:w.displayFormatKey,displayFormat:w.displayFormat})),$=k=>{switch(k.toLowerCase()){case"integer":case"int":case"numeric":return"numeric";case"date":return"date";case"bool":case"boolean":return"boolean";default:return"text"}},C=k=>{const w=d.value.find(S=>S.name===k);return w?w.type:null};return(k,w)=>{const S=o.resolveComponent("Button"),B=o.resolveComponent("InputIcon"),I=o.resolveComponent("InputText"),D=o.resolveComponent("IconField"),P=o.resolveComponent("Toolbar");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode(P,{class:"p-2 my-2 border-none"},{start:o.withCtx(()=>[o.createElementVNode("div",Hm,[o.createVNode(S,{type:"button",size:"medium",icon:"pi pi-filter",severity:"info",onClick:w[0]||(w[0]=M=>h())})]),o.createVNode(S,{class:"ml-3",size:"medium",type:"button",icon:"pi pi-filter-slash",severity:"warn",onClick:w[1]||(w[1]=M=>x())})]),end:o.withCtx(()=>[o.createVNode(D,{iconPosition:"right",class:"block mt-2 md:mt-0"},{default:o.withCtx(()=>[o.createVNode(B,{onClick:w[2]||(w[2]=M=>E()),class:"pi pi-search"}),o.createVNode(I,{class:"w-full sm:w-auto",onKeyup:w[3]||(w[3]=o.withKeys(M=>E(),["enter"])),modelValue:s.value,"onUpdate:modelValue":w[4]||(w[4]=M=>s.value=M),placeholder:"Search..."},null,8,["modelValue"])]),_:1})]),_:1}),o.createVNode(Um,{sortBy:i.value,"onUpdate:sortBy":w[5]||(w[5]=M=>i.value=M),sortDirection:l.value,"onUpdate:sortDirection":w[6]||(w[6]=M=>l.value=M),showFilter:n.value,"onUpdate:showFilter":w[7]||(w[7]=M=>n.value=M),filters:r.value,"onUpdate:filters":w[8]||(w[8]=M=>r.value=M),headers:c.value,operatorMap:p,sortCallback:v,filterCallback:b,getColumnDatatype:$,getDatatypeByField:C,preFiltered:f.preFiltered},null,8,["sortBy","sortDirection","showFilter","filters","headers","preFiltered"])],64)}}},[["__scopeId","data-v-61921abb"]]),dt={__name:"EntityListPagination",setup(e){const t=o.ref(25),n=o.ref(0),r=o.ref(0),a=o.ref(0);let i=o.inject("entityObject");const l=async s=>{t.value=s.rows,n.value=s.page,a.value=s.first;const d={sortBy:i.state.data.sortBy,sortDirection:i.state.data.sortDirection,columnList:null,filter:i.state.data.filters,fullTextSearch:i.state.data.fullTextSearch,pageSize:t.value,currentPage:n.value},c=await i.searchRecord(i.state.data,d);if(c!=null&&c.success){let u=c==null?void 0:c.response;i.setEntity(u),r.value=c.response.totalRecords,a.value=n.value*t.value}};return o.watch(()=>{var s,d;return(d=(s=i==null?void 0:i.state)==null?void 0:s.data)==null?void 0:d.totalRecords},s=>{r&&(r.value=s)},{immediate:!0}),(s,d)=>{const c=o.resolveComponent("Paginator");return o.openBlock(),o.createBlock(c,{class:"my-4",rows:t.value,totalRecords:r.value,rowsPerPageOptions:[10,25,50,100],onPage:l,template:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} items"},null,8,["rows","totalRecords"])}}},Wm={class:"flex flex-row justify-end p-2 my-1"},Xe={__name:"EntityListAddButton",setup(e){const t=o.ref(!1),n=()=>{t.value=!0};return(r,a)=>{const i=o.resolveComponent("Button");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",Wm,[o.createVNode(i,{size:"medium",icon:"pi pi-plus",onClick:a[0]||(a[0]=l=>n())})]),t.value?(o.openBlock(),o.createBlock(pn,{key:0,showEntityForm:t.value,"onUpdate:showEntityForm":a[1]||(a[1]=l=>t.value=l)},null,8,["showEntityForm"])):o.createCommentVNode("",!0)],64)}}},si={__name:"EntityList",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,listFilerSlot:Boolean,className:{type:String,default:"default-class"}},setup(e,{expose:t}){const n=uo(),r=Oe();o.provide("entityObject",n);const a=e;return t({props:a,reload:()=>{console.log("reload data")}}),o.watch(()=>r.globalConfigs.appId,async l=>{if(l){const s=await n.getEntity(a.entityName);s.success?n.setEntity(s.response):n.setEntity({result:[]})}},{immediate:!0}),(l,s)=>{var d,c,u;return l.$slots["list-item-display"]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[e.showAddButton?(o.openBlock(),o.createBlock(Xe,{key:0})):o.createCommentVNode("",!0),e.listFilerSlot?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFilter||Ye),{key:1})):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(((u=(c=(d=o.unref(n))==null?void 0:d.state)==null?void 0:c.data)==null?void 0:u.result)||[],f=>o.renderSlot(l.$slots,"list-item-display",{item:f})),256))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listHeader||Em))),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFilter||Ye))),e.showAddButton?(o.openBlock(),o.createBlock(Xe,{key:0})):o.createCommentVNode("",!0),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listDisplay||km),o.normalizeProps(o.guardReactiveProps({listItemDisplay:e.listItemDisplay})),null,16)),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listPagination||dt))),(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFooter||xm)))],64))}}};function ci(){Oe();const{get:e,post:t,put:n,del:r}=pt();return{getActiveUser:async()=>await e("/users/me"),getAppSecurity:async b=>await e(`/api/app/v1/${b}/security`),enableAppSecurity:async(b,y)=>await t(`/api/app/v1/${b}/security/enable`,y),getAppSecurityRules:async b=>await e(`/api/app/v1/${b}/security/rules`),saveAppSecurityRule:async(b,y)=>await t(`/api/app/v1/${b}/security/rules`,y),getAppSecurityRoles:async b=>await e(`/api/app/v1/${b}/security/roles`),saveAppSecurityRoles:async(b,y)=>await t(`/api/app/v1/${b}/security/roles`,y),getAppSecurityPermissions:async b=>await e(`/api/app/v1/${b}/security/permission`),saveAppSecurityPermission:async(b,y)=>await t(`/api/app/v1/${b}/security/permission`,y),deleteAppSecurityPermission:async(b,y)=>await r(`/api/app/v1/${b}/security/permission/${y}`),deleteAppSecurityRole:async(b,y)=>await r(`/api/app/v1/${b}/security/roles/${y}`),deleteAppSecurityAccessRule:async(b,y)=>await r(`/api/app/v1/${b}/security/rules/${y}`)}}const Bt=o.ref({role:[],permissions:[]}),ir=o.ref(!1);let di=!1;function zt(){const e=async()=>{if(ir.value)return console.log("User is ROOT_USER, skipping fetch."),!0;if(di||Bt.value.role[0]&&Bt.value.permissions[0])return console.log("User details already available, skipping fetch."),!0;console.log("Fetching User Details...");const{getActiveUser:a}=ci(),i=await a();return console.log("Fetched Response:",i),i&&Array.isArray(i.authorities)&&i.authorities.includes("ROOT_USER")?(ir.value=!0,!0):(Bt.value={role:["Admin"],permissions:["user","Admin","Entity"]},di=!0,console.log("User Details Set:",Bt.value),!0)};return{userDetails:Bt,fetchUserDetails:e,getRole:()=>Bt.value.role,getPermissions:()=>Bt.value.permissions,hasMatchingRoleAndPermissions:async(a=[],i=[])=>{const l=Array.isArray(a)?a:a.split(",").map(m=>m.trim()),s=Array.isArray(i)?i:i.split(",").map(m=>m.trim());if(await e(),ir.value)return!0;const{role:d,permissions:c}=Bt.value,u=l.length===0||l.some(m=>d.includes(m)),f=s.length===0||s.some(m=>c.includes(m));return u&&!f?!1:u&&f}}}const qm={class:"flex items-center justify-between bg-white p-2 rounded border-b"},Km=["href"],Gm={class:"text-sm text-gray-500 block"},Ym={key:1},Xm={class:"flex items-center gap-2"},Jm=Ie({__name:"EntityListingSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listClass:String,listItemClass:String,listFooter:String,listFilter:String,listPagination:String,displayField:String,baseUrl:String,hrefKey:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean,linkedEntity:Array,externalFilterPayload:Object,roles:{type:[Array,String],default:()=>[]},permissions:{type:[Array,String],default:()=>[]},showPresets:{type:Boolean,default:!1},decoration:{type:String,default:"default"},numberVisible:{type:Number,default:3},variable:{type:String,default:"item"},scrollHeight:{type:String,default:""},showToolBar:{type:String,default:""},justifyContent:{type:String,default:""},preFiltered:{type:String,default:""},gap:{type:Number}},setup(e){const t=e,n=o.inject("entityObject"),r=o.ref([]),a=o.ref(null),i=o.ref(null),l=o.ref(!1),s=o.ref(!1),d=o.ref(null);o.onMounted(()=>{var p,g;t.linkedEntity&&t.linkedEntity.length>0?r.value=Object.keys(t.linkedEntity[0]).map(h=>({name:h})):r.value=n==null?void 0:n.getEntityColumns(n.state.data),d.value=((p=r==null?void 0:r.value)==null?void 0:p.find(h=>h.name==="created_date"))||null,d.value&&(d.value=t==null?void 0:t.item[d.value.name]),a.value=((g=r==null?void 0:r.value)==null?void 0:g.find(h=>h.name===t.displayField))||null,a.value&&(i.value=t==null?void 0:t.item[a.value.name])});const c=()=>{l.value=!0},u=()=>{s.value=!0},f=async p=>{p.remove?m():l.value=!1},m=async()=>{const p=n.getPrimaryKeyColumn(n.state.data),g=t.item[p.name],h=await n.entityRecordDelete(n.state.data,g);if(h!=null&&h.success){l.value=!1;const b=await n.searchRecord(n.state.data,{sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch});b!=null&&b.response&&n.setEntity(b.response)}};return(p,g)=>{const h=o.resolveComponent("Button");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("ul",{class:o.normalizeClass([t.className,"space-y-2"])},[o.createElementVNode("li",qm,[o.createElementVNode("div",null,[a.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("a",{href:`${e.baseUrl}/${e.item[e.hrefKey]}`,target:"_blank",class:"hover:underline font-medium"},o.toDisplayString(i.value),9,Km),o.createElementVNode("span",Gm,o.toDisplayString(d.value),1)],64)):(o.openBlock(),o.createElementBlock("span",Ym,"No matching field found for '"+o.toDisplayString(i.value)+"'.",1))]),o.createElementVNode("div",Xm,[e.editable?(o.openBlock(),o.createBlock(h,{key:0,onClick:g[0]||(g[0]=b=>u()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):o.createCommentVNode("",!0),e.deletable?(o.openBlock(),o.createBlock(h,{key:1,onClick:g[1]||(g[1]=b=>c()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):o.createCommentVNode("",!0)])])],2),s.value?(o.openBlock(),o.createBlock(pn,{key:0,showEntityForm:s.value,"onUpdate:showEntityForm":g[2]||(g[2]=b=>s.value=b),item:e.item},null,8,["showEntityForm","item"])):o.createCommentVNode("",!0),l.value?(o.openBlock(),o.createBlock(fo,{key:1,showDeleteDialog:l.value,"onUpdate:showDeleteDialog":g[3]||(g[3]=b=>l.value=b),onOnDeleteItem:f},null,8,["showDeleteDialog"])):o.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-01e06cbc"]]);/**
|
|
20
20
|
* Vue 3 Carousel 0.13.0
|
|
21
21
|
* (c) 2025
|
|
22
22
|
* @license MIT
|
|
23
|
-
*/const ui=["viewport","carousel"],gn={"bottom-to-top":"btt","left-to-right":"ltr","right-to-left":"rtl","top-to-bottom":"ttb"},fi=["ltr","left-to-right","rtl","right-to-left","ttb","top-to-bottom","btt","bottom-to-top"],Qm={ariaGallery:"Gallery",ariaNavigateToPage:"Navigate to page {slideNumber}",ariaNavigateToSlide:"Navigate to slide {slideNumber}",ariaNextSlide:"Navigate to next slide",ariaPreviousSlide:"Navigate to previous slide",iconArrowDown:"Arrow pointing downwards",iconArrowLeft:"Arrow pointing to the left",iconArrowRight:"Arrow pointing to the right",iconArrowUp:"Arrow pointing upwards",itemXofY:"Item {currentSlide} of {slidesCount}"};Object.values(gn);const mi=["slide","fade"],pi=["center","start","end","center-even","center-odd"],Ne={autoplay:0,breakpointMode:ui[0],breakpoints:void 0,dir:fi[0],enabled:!0,gap:0,height:"auto",i18n:Qm,ignoreAnimations:!1,itemsToScroll:1,itemsToShow:1,modelValue:0,mouseDrag:!0,pauseAutoplayOnHover:!1,preventExcessiveDragging:!1,slideEffect:mi[0],snapAlign:pi[0],touchDrag:!0,transition:300,wrapAround:!1},Mt=Symbol("carousel"),Zm=e=>{const t=o.shallowReactive([]),n=r=>{r!==void 0?t.slice(r).forEach((a,i)=>{var l;(l=a.exposed)===null||l===void 0||l.setIndex(r+i)}):t.forEach((a,i)=>{var l;(l=a.exposed)===null||l===void 0||l.setIndex(i)})};return{cleanup:()=>{t.splice(0,t.length)},getSlides:()=>t,registerSlide:(r,a)=>{if(!r||r.props.isClone)return;const i=a??t.length;t.splice(i,0,r),n(i),e("slide-registered",{slide:r,index:i})},unregisterSlide:r=>{const a=t.indexOf(r);a!==-1&&(e("slide-unregistered",{slide:r,index:a}),t.splice(a,1),n(a))}}};function ep(e){return e.length===0?0:e.reduce((n,r)=>n+r,0)/e.length}function gi({slides:e,position:t,toShow:n}){const r=[],a=t==="before",i=a?-n:0,l=a?0:n;if(e.length<=0)return r;for(let s=i;s<l;s++){const c={index:a?s:s+e.length,isClone:!0,position:t,id:void 0,key:`clone-${t}-${s}`},u=e[(s%e.length+e.length)%e.length].vnode,f=o.cloneVNode(u,c);f.el=null,r.push(f)}return r}const tp='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])';function hi(e){if(!e.el||!(e.el instanceof Element))return;const t=e.el.querySelectorAll(tp);for(const n of t)n instanceof HTMLElement&&!n.hasAttribute("disabled")&&n.getAttribute("aria-hidden")!=="true"&&n.setAttribute("tabindex","-1")}function np(e,t){return Object.keys(e).filter(n=>!t.includes(n)).reduce((n,r)=>(n[r]=e[r],n),{})}function op(e){const{isVertical:t,isReversed:n,dragged:r,effectiveSlideSize:a}=e,i=t?r.y:r.x;if(i===0)return 0;const l=Math.round(i/a);return n?l:-l}function wt({val:e,max:t,min:n}){return t<n?e:Math.min(Math.max(e,isNaN(n)?e:n),isNaN(t)?e:t)}function rp(e){const{transform:t}=window.getComputedStyle(e);return t.split(/[(,)]/).slice(1,-1).map(n=>parseFloat(n))}function ap(e){let t=1,n=1;return e.forEach(r=>{const a=rp(r);a.length===6&&(t/=a[0],n/=a[3])}),{widthMultiplier:t,heightMultiplier:n}}function ip(e,t){switch(e){case"start":return 0;case"center":case"center-odd":return(t-1)/2;case"center-even":return(t-2)/2;case"end":return t-1;default:return 0}}function lp(e,t,n){switch(e){case"start":return 0;case"center":case"center-odd":return(n-t)/2;case"center-even":return n/2-t;case"end":return n-t;default:return 0}}function lr({slideSize:e,viewportSize:t,align:n,itemsToShow:r}){return r!==void 0?ip(n,r):e!==void 0&&t!==void 0?lp(n,e,t):0}function bi(e="",t={}){return Object.entries(t).reduce((n,[r,a])=>n.replace(`{${r}}`,String(a)),e)}function yi({val:e,max:t,min:n=0}){const r=t-n+1;return((e-n)%r+r)%r+n}function sr(e,t=0){let n=!1,r=0,a=null;function i(...l){if(n)return;n=!0;const s=()=>{a=requestAnimationFrame(d=>{d-r>t?(r=d,e(...l),n=!1):s()})};s()}return i.cancel=()=>{a&&(cancelAnimationFrame(a),a=null,n=!1)},i}function mo(e,t="px"){if(!(e==null||e===""))return typeof e=="number"||parseFloat(e).toString()===e?`${e}${t}`:e}const sp=o.defineComponent({name:"CarouselAria",setup(){const e=o.inject(Mt);return e?()=>o.h("div",{class:["carousel__liveregion","carousel__sr-only"],"aria-live":"polite","aria-atomic":"true"},bi(e.config.i18n.itemXofY,{currentSlide:e.currentSlide+1,slidesCount:e.slidesCount})):()=>""}}),cp={autoplay:{default:Ne.autoplay,type:Number},breakpoints:{default:Ne.breakpoints,type:Object},breakpointMode:{default:Ne.breakpointMode,validator(e){return ui.includes(e)}},enabled:{default:Ne.enabled,type:Boolean},gap:{default:Ne.gap,type:Number},height:{default:Ne.height,type:[Number,String]},ignoreAnimations:{default:!1,type:[Array,Boolean,String]},itemsToScroll:{default:Ne.itemsToScroll,type:Number},itemsToShow:{default:Ne.itemsToShow,type:[Number,String]},i18n:{default:Ne.i18n,type:Object},modelValue:{default:void 0,type:Number},mouseDrag:{default:Ne.mouseDrag,type:Boolean},touchDrag:{default:Ne.touchDrag,type:Boolean},pauseAutoplayOnHover:{default:Ne.pauseAutoplayOnHover,type:Boolean},preventExcessiveDragging:{default:!1,type:Boolean,validator(e,t){return e&&t.wrapAround&&console.warn('[vue3-carousel warn]: "preventExcessiveDragging" cannot be used with wrapAround. The setting will be ignored.'),!0}},snapAlign:{default:Ne.snapAlign,validator(e){return pi.includes(e)}},slideEffect:{type:String,default:Ne.slideEffect,validator(e){return mi.includes(e)}},transition:{default:Ne.transition,type:Number},dir:{type:String,default:Ne.dir,validator(e,t){if(!fi.includes(e))return!1;const n=e in gn?gn[e]:e;return["ttb","btt"].includes(n)&&(!t.height||t.height==="auto")&&console.warn(`[vue3-carousel warn]: The dir "${e}" is not supported with height "auto".`),!0}},wrapAround:{default:Ne.wrapAround,type:Boolean}};o.defineComponent({name:"VueCarousel",props:cp,emits:["before-init","drag","init","loop","slide-end","slide-registered","slide-start","slide-unregistered","update:modelValue"],setup(e,{slots:t,emit:n,expose:r}){var a;const i=Zm(n),l=i.getSlides(),s=o.computed(()=>l.length),d=o.ref(null),c=o.ref(null),u=o.ref(0),f=o.computed(()=>Object.assign(Object.assign(Object.assign({},Ne),np(e,["breakpoints","modelValue"])),{i18n:Object.assign(Object.assign({},Ne.i18n),e.i18n)})),m=o.shallowReactive(Object.assign({},f.value)),p=o.ref((a=e.modelValue)!==null&&a!==void 0?a:0),g=o.ref(p.value);o.watch(p,A=>g.value=A);const h=o.ref(0),b=o.computed(()=>Math.ceil((s.value-1)/2)),y=o.computed(()=>s.value-1),v=o.computed(()=>0);let x=null,E=null,N=null;const $=o.computed(()=>u.value+m.gap),C=o.computed(()=>{const A=m.dir||"ltr";return A in gn?gn[A]:A}),k=o.computed(()=>["rtl","btt"].includes(C.value)),w=o.computed(()=>["ttb","btt"].includes(C.value)),S=o.computed(()=>m.itemsToShow==="auto"),B=o.computed(()=>w.value?"height":"width");function I(){var A;if(!Q.value)return;const U=(f.value.breakpointMode==="carousel"?(A=d.value)===null||A===void 0?void 0:A.getBoundingClientRect().width:typeof window<"u"?window.innerWidth:0)||0,G=Object.keys(e.breakpoints||{}).map(te=>Number(te)).sort((te,ye)=>+ye-+te),K={};G.some(te=>U>=te?(Object.assign(K,e.breakpoints[te]),K.i18n&&Object.assign(K.i18n,f.value.i18n,e.breakpoints[te].i18n),!0):!1),Object.assign(m,f.value,K)}const D=sr(()=>{I(),_(),V()}),P=o.shallowReactive(new Set),M=o.ref([]);function j({widthMultiplier:A,heightMultiplier:U}){M.value=l.map(G=>{var K;const te=(K=G.exposed)===null||K===void 0?void 0:K.getBoundingRect();return{width:te.width*A,height:te.height*U}})}const q=o.ref({width:0,height:0});function F({widthMultiplier:A,heightMultiplier:U}){var G;const K=((G=c.value)===null||G===void 0?void 0:G.getBoundingClientRect())||{width:0,height:0};q.value={width:K.width*A,height:K.height*U}}function V(){if(!c.value)return;const A=ap(P);if(F(A),j(A),S.value)u.value=ep(M.value.map(U=>U[B.value]));else{const U=Number(m.itemsToShow),G=(U-1)*m.gap;u.value=(q.value[B.value]-G)/U}}function _(){!m.wrapAround&&s.value>0&&(p.value=wt({val:p.value,max:y.value,min:v.value})),S.value||(m.itemsToShow=wt({val:Number(m.itemsToShow),max:s.value,min:1}))}const J=o.computed(()=>typeof e.ignoreAnimations=="string"?e.ignoreAnimations.split(","):Array.isArray(e.ignoreAnimations)?e.ignoreAnimations:e.ignoreAnimations?!1:[]);o.watchEffect(()=>_()),o.watchEffect(()=>{V()});let re;const ae=A=>{const U=A.target;if(!(!(U!=null&&U.contains(d.value))||Array.isArray(J.value)&&J.value.includes(A.animationName))&&(P.add(U),!re)){const G=()=>{re=requestAnimationFrame(()=>{V(),G()})};G()}},Y=A=>{const U=A.target;U&&P.delete(U),re&&P.size===0&&(cancelAnimationFrame(re),V())},Q=o.ref(!1);typeof document<"u"&&o.watchEffect(()=>{Q.value&&J.value!==!1?(document.addEventListener("animationstart",ae),document.addEventListener("animationend",Y)):(document.removeEventListener("animationstart",ae),document.removeEventListener("animationend",Y))}),o.onMounted(()=>{Q.value=!0,I(),Ee(),d.value&&(N=new ResizeObserver(D),N.observe(d.value)),n("init")}),o.onBeforeUnmount(()=>{Q.value=!1,i.cleanup(),E&&clearTimeout(E),re&&cancelAnimationFrame(re),x&&clearInterval(x),N&&(N.disconnect(),N=null),typeof document<"u"&&fe(),d.value&&(d.value.removeEventListener("transitionend",V),d.value.removeEventListener("animationiteration",V))});let le=!1;const ce={x:0,y:0},xe=o.reactive({x:0,y:0}),He=o.ref(!1),Re=o.ref(!1),rt=()=>{He.value=!0},Je=()=>{He.value=!1},H=sr(A=>{if(!A.ctrlKey)switch(A.key){case"ArrowLeft":case"ArrowUp":w.value===A.key.endsWith("Up")&&(k.value?Qe(!0):Vt(!0));break;case"ArrowRight":case"ArrowDown":w.value===A.key.endsWith("Down")&&(k.value?Vt(!0):Qe(!0));break}},200),z=()=>{document.addEventListener("keydown",H)},fe=()=>{document.removeEventListener("keydown",H)};function ge(A){const U=A.target.tagName;if(["INPUT","TEXTAREA","SELECT"].includes(U)||Ve.value||(le=A.type==="touchstart",!le&&(A.preventDefault(),A.button!==0)))return;ce.x="touches"in A?A.touches[0].clientX:A.clientX,ce.y="touches"in A?A.touches[0].clientY:A.clientY;const G=le?"touchmove":"mousemove",K=le?"touchend":"mouseup";document.addEventListener(G,me,{passive:!1}),document.addEventListener(K,he,{passive:!0})}const me=sr(A=>{Re.value=!0;const U="touches"in A?A.touches[0].clientX:A.clientX,G="touches"in A?A.touches[0].clientY:A.clientY;xe.x=U-ce.x,xe.y=G-ce.y;const K=op({isVertical:w.value,isReversed:k.value,dragged:xe,effectiveSlideSize:$.value});g.value=m.wrapAround?p.value+K:wt({val:p.value+K,max:y.value,min:v.value}),n("drag",{deltaX:xe.x,deltaY:xe.y})});function he(){if(me.cancel(),g.value!==p.value&&!le){const G=K=>{K.preventDefault(),window.removeEventListener("click",G)};window.addEventListener("click",G)}je(g.value),xe.x=0,xe.y=0,Re.value=!1;const A=le?"touchmove":"mousemove",U=le?"touchend":"mouseup";document.removeEventListener(A,me),document.removeEventListener(U,he)}function Ee(){!m.autoplay||m.autoplay<=0||(x=setInterval(()=>{m.pauseAutoplayOnHover&&He.value||Qe()},m.autoplay))}function Me(){x&&(clearInterval(x),x=null)}function ft(){Me(),Ee()}const Ve=o.ref(!1);function je(A,U=!1){if(!U&&Ve.value)return;let G=A,K=A;h.value=p.value,m.wrapAround?K=yi({val:G,max:y.value,min:v.value}):G=wt({val:G,max:y.value,min:v.value}),n("slide-start",{slidingToIndex:A,currentSlideIndex:p.value,prevSlideIndex:h.value,slidesCount:s.value}),Me(),Ve.value=!0,p.value=G,K!==G&&qt.pause(),n("update:modelValue",K),E=setTimeout(()=>{m.wrapAround&&K!==G&&(qt.resume(),p.value=K,n("loop",{currentSlideIndex:p.value,slidingToIndex:A})),n("slide-end",{currentSlideIndex:p.value,prevSlideIndex:h.value,slidesCount:s.value}),Ve.value=!1,ft()},m.transition)}function Qe(A=!1){je(p.value+m.itemsToScroll,A)}function Vt(A=!1){je(p.value-m.itemsToScroll,A)}function It(){I(),_(),V(),ft()}o.watch(()=>[f.value,e.breakpoints],()=>I(),{deep:!0}),o.watch(()=>e.autoplay,()=>ft());const qt=o.watch(()=>e.modelValue,A=>{A!==p.value&&je(Number(A),!0)});n("before-init");const Z=o.computed(()=>{if(!m.wrapAround)return{before:0,after:0};if(S.value)return{before:l.length,after:l.length};const A=Number(m.itemsToShow),U=Math.ceil(A+(m.itemsToScroll-1)),G=U-g.value,K=U-(s.value-(g.value+1));return{before:Math.max(0,G),after:Math.max(0,K)}}),at=o.computed(()=>Z.value.before?S.value?M.value.slice(-1*Z.value.before).reduce((A,U)=>A+U[B.value]+m.gap,0)*-1:Z.value.before*$.value*-1:0),Be=o.computed(()=>{var A;if(S.value){const U=(p.value%l.length+l.length)%l.length;return lr({slideSize:(A=M.value[U])===null||A===void 0?void 0:A[B.value],viewportSize:q.value[B.value],align:m.snapAlign})}return lr({align:m.snapAlign,itemsToShow:+m.itemsToShow})}),O=o.computed(()=>{let A=0;if(S.value){if(p.value<0?A=M.value.slice(p.value).reduce((U,G)=>U+G[B.value]+m.gap,0)*-1:A=M.value.slice(0,p.value).reduce((U,G)=>U+G[B.value]+m.gap,0),A-=Be.value,!m.wrapAround){const U=M.value.reduce((G,K)=>G+K[B.value]+m.gap,0)-q.value[B.value]-m.gap;A=wt({val:A,max:U,min:0})}}else{let U=p.value-Be.value;m.wrapAround||(U=wt({val:U,max:s.value-+m.itemsToShow,min:0})),A=U*$.value}return A*(k.value?1:-1)}),T=o.computed(()=>{var A,U;if(!S.value){const te=p.value-Be.value;return m.wrapAround?{min:Math.floor(te),max:Math.ceil(te+Number(m.itemsToShow)-1)}:{min:Math.floor(wt({val:te,max:s.value-Number(m.itemsToShow),min:0})),max:Math.ceil(wt({val:te+Number(m.itemsToShow)-1,max:s.value-1,min:0}))}}let G=0;{let te=0,ye=0-Z.value.before;const Se=Math.abs(O.value+at.value);for(;te<=Se;){const Fe=(ye%l.length+l.length)%l.length;te+=((A=M.value[Fe])===null||A===void 0?void 0:A[B.value])+m.gap,ye++}G=ye-1}let K=0;{let te=G,ye=0;for(te<0?ye=M.value.slice(0,te).reduce((Se,Fe)=>Se+Fe[B.value]+m.gap,0)-Math.abs(O.value+at.value):ye=M.value.slice(0,te).reduce((Se,Fe)=>Se+Fe[B.value]+m.gap,0)-Math.abs(O.value);ye<q.value[B.value];){const Se=(te%l.length+l.length)%l.length;ye+=((U=M.value[Se])===null||U===void 0?void 0:U[B.value])+m.gap,te++}K=te-1}return{min:Math.floor(G),max:Math.ceil(K)}}),L=o.computed(()=>{if(m.slideEffect==="fade")return;const A=w.value?"Y":"X",U=w.value?xe.y:xe.x;let G=O.value+U;if(!m.wrapAround&&m.preventExcessiveDragging){let K=0;S.value?K=M.value.reduce((Se,Fe)=>Se+Fe[B.value],0):K=(s.value-Number(m.itemsToShow))*$.value;const te=k.value?0:-1*K,ye=k.value?K:0;G=wt({val:G,min:te,max:ye})}return`translate${A}(${G}px)`}),W=o.computed(()=>({"--vc-transition-duration":Ve.value?mo(m.transition,"ms"):void 0,"--vc-slide-gap":mo(m.gap),"--vc-carousel-height":mo(m.height),"--vc-cloned-offset":mo(at.value)})),ee={slideTo:je,next:Qe,prev:Vt},oe=o.reactive({activeSlide:g,config:m,currentSlide:p,isSliding:Ve,isVertical:w,maxSlide:y,minSlide:v,nav:ee,normalizedDir:C,slideRegistry:i,slideSize:u,slides:l,slidesCount:s,viewport:c,visibleRange:T});o.provide(Mt,oe);const X=o.reactive({config:m,currentSlide:p,maxSlide:y,middleSlide:b,minSlide:v,slideSize:u,slidesCount:s});return r({data:X,nav:ee,next:Qe,prev:Vt,restartCarousel:It,slideTo:je,updateBreakpointsConfig:I,updateSlideSize:V,updateSlidesData:_}),()=>{var A;const U=t.default||t.slides,G=(U==null?void 0:U(X))||[],{before:K,after:te}=Z.value,ye=gi({slides:l,position:"before",toShow:K}),Se=gi({slides:l,position:"after",toShow:te}),Fe=[...ye,...G,...Se];if(!m.enabled||!Fe.length)return o.h("section",{ref:d,class:["carousel","is-disabled"]},Fe);const Dn=((A=t.addons)===null||A===void 0?void 0:A.call(t,X))||[],_n=o.h("ol",{class:"carousel__track",style:{transform:L.value},onMousedownCapture:m.mouseDrag?ge:null,onTouchstartPassiveCapture:m.touchDrag?ge:null},Fe),An=o.h("div",{class:"carousel__viewport",ref:c},_n);return o.h("section",{ref:d,class:["carousel",`is-${C.value}`,`is-effect-${m.slideEffect}`,{"is-vertical":w.value,"is-sliding":Ve.value,"is-dragging":Re.value,"is-hover":He.value}],dir:C.value,style:W.value,"aria-label":m.i18n.ariaGallery,tabindex:"0",onFocus:z,onBlur:fe,onMouseenter:rt,onMouseleave:Je},[An,Dn,o.h(sp)])}}});var cr;(function(e){e.arrowDown="arrowDown",e.arrowLeft="arrowLeft",e.arrowRight="arrowRight",e.arrowUp="arrowUp"})(cr||(cr={}));const ki=e=>`icon${e.charAt(0).toUpperCase()+e.slice(1)}`,dp={arrowDown:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z",arrowLeft:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z",arrowRight:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",arrowUp:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"};function up(e){return e in cr}const wi=e=>e&&up(e),vi=o.defineComponent({props:{name:{type:String,required:!0,validator:wi},title:{type:String,default:e=>e.name?Ne.i18n[ki(e.name)]:""}},setup(e){const t=o.inject(Mt,null);return()=>{const n=e.name;if(!n||!wi(n))return;const r=dp[n],a=o.h("path",{d:r}),i=(t==null?void 0:t.config.i18n[ki(n)])||e.title,l=o.h("title",i);return o.h("svg",{class:"carousel__icon",viewBox:"0 0 24 24",role:"img","aria-label":i},[l,a])}}});o.defineComponent({name:"CarouselNavigation",inheritAttrs:!1,setup(e,{slots:t,attrs:n}){const r=o.inject(Mt);if(!r)return()=>"";const{next:a,prev:i}=t,l=()=>({btt:"arrowDown",ltr:"arrowLeft",rtl:"arrowRight",ttb:"arrowUp"})[r.normalizedDir],s=()=>({btt:"arrowUp",ltr:"arrowRight",rtl:"arrowLeft",ttb:"arrowDown"})[r.normalizedDir],d=o.computed(()=>!r.config.wrapAround&&r.currentSlide<=r.minSlide),c=o.computed(()=>!r.config.wrapAround&&r.currentSlide>=r.maxSlide);return()=>{const{i18n:u}=r.config,f=o.h("button",Object.assign(Object.assign({type:"button",disabled:d.value,"aria-label":u.ariaPreviousSlide,title:u.ariaPreviousSlide,onClick:r.nav.prev},n),{class:["carousel__prev",{"carousel__prev--disabled":d.value},n.class]}),(i==null?void 0:i())||o.h(vi,{name:l()})),m=o.h("button",Object.assign(Object.assign({type:"button",disabled:c.value,"aria-label":u.ariaNextSlide,title:u.ariaNextSlide,onClick:r.nav.next},n),{class:["carousel__next",{"carousel__next--disabled":c.value},n.class]}),(a==null?void 0:a())||o.h(vi,{name:s()}));return[f,m]}}}),o.defineComponent({name:"CarouselPagination",props:{disableOnClick:{type:Boolean},paginateByItemsToShow:{type:Boolean}},setup(e){const t=o.inject(Mt);if(!t)return()=>"";const n=o.computed(()=>t.config.itemsToShow),r=o.computed(()=>lr({align:t.config.snapAlign,itemsToShow:n.value})),a=o.computed(()=>e.paginateByItemsToShow&&n.value>1),i=o.computed(()=>Math.ceil((t.activeSlide-r.value)/n.value)),l=o.computed(()=>Math.ceil(t.slidesCount/n.value)),s=d=>yi(a.value?{val:i.value,max:l.value-1,min:0}:{val:t.activeSlide,max:t.maxSlide,min:t.minSlide})===d;return()=>{var d,c;const u=[];for(let f=a.value?0:t.minSlide;f<=(a.value?l.value-1:t.maxSlide);f++){const m=bi(t.config.i18n[a.value?"ariaNavigateToPage":"ariaNavigateToSlide"],{slideNumber:f+1}),p=s(f),g=o.h("button",{type:"button",class:{"carousel__pagination-button":!0,"carousel__pagination-button--active":p},"aria-label":m,"aria-pressed":p,"aria-controls":(c=(d=t.slides[f])===null||d===void 0?void 0:d.exposed)===null||c===void 0?void 0:c.id,title:m,disabled:e.disableOnClick,onClick:()=>t.nav.slideTo(a.value?Math.floor(f*+t.config.itemsToShow+r.value):f)}),h=o.h("li",{class:"carousel__pagination-item",key:f},g);u.push(h)}return o.h("ol",{class:"carousel__pagination"},u)}}}),o.defineComponent({name:"CarouselSlide",props:{id:{type:String,default:e=>e.isClone?void 0:o.useId()},index:{type:Number,default:void 0},isClone:{type:Boolean,default:!1},position:{type:String,default:void 0}},setup(e,{attrs:t,slots:n,expose:r}){const a=o.inject(Mt);if(o.provide(Mt,void 0),!a)return()=>"";const i=o.ref(e.index),l=g=>{i.value=g},s=o.getCurrentInstance(),d=()=>{const g=s.vnode.el;return g?g.getBoundingClientRect():{width:0,height:0}};r({id:e.id,setIndex:l,getBoundingRect:d});const c=o.computed(()=>i.value===a.activeSlide),u=o.computed(()=>i.value===a.activeSlide-1),f=o.computed(()=>i.value===a.activeSlide+1),m=o.computed(()=>i.value>=a.visibleRange.min&&i.value<=a.visibleRange.max),p=o.computed(()=>{if(a.config.itemsToShow==="auto")return;const g=a.config.itemsToShow,h=a.config.gap>0&&g>1?`calc(${100/g}% - ${a.config.gap*(g-1)/g}px)`:`${100/g}%`;return a.isVertical?{height:h}:{width:h}});return a.slideRegistry.registerSlide(s,e.index),o.onUnmounted(()=>{a.slideRegistry.unregisterSlide(s)}),e.isClone&&(o.onMounted(()=>{hi(s.vnode)}),o.onUpdated(()=>{hi(s.vnode)})),()=>{var g,h;return a.config.enabled?o.h("li",{style:[t.style,Object.assign({},p.value)],class:{carousel__slide:!0,"carousel__slide--clone":e.isClone,"carousel__slide--visible":m.value,"carousel__slide--active":c.value,"carousel__slide--prev":u.value,"carousel__slide--next":f.value,"carousel__slide--sliding":a.isSliding},onFocusin:()=>{a.viewport&&(a.viewport.scrollLeft=0),a.nav.slideTo(i.value)},id:e.isClone?void 0:e.id,"aria-hidden":e.isClone||void 0},(h=n.default)===null||h===void 0?void 0:h.call(n,{currentIndex:i.value,isActive:c.value,isClone:e.isClone,isPrev:u.value,isNext:f.value,isSliding:a.isSliding,isVisible:m.value})):(g=n.default)===null||g===void 0?void 0:g.call(n)}}});const fp={class:"flex items-center justify-between rounded-md w-full overflow-hidden"},mp={key:0,class:"flex flex-col w-full bg-white rounded-lg gap-2"},pp={class:"flex items-center justify-center gap-2 flex-wrap"},gp={key:0,class:"flex items-center gap-3 overflow-x-auto mb-3 p-3 scrollbar-none pr-4"},hp=["onClick"],bp={key:1,class:"flex flex-col w-full bg-white rounded-lg gap-2"},yp={class:"flex items-center justify-center gap-2 flex-wrap"},kp={key:0,class:"error-message"},wp={class:"text-red-500 font-bold"},vp={key:0},xp={class:"flex items-center justify-between rounded-md w-full overflow-hidden"},Sp={key:0,class:"flex flex-col w-full bg-white rounded-lg gap-2"},Cp={class:"flex items-center justify-center gap-2 flex-wrap"},Ep={key:0,class:"flex items-center gap-3 overflow-x-auto mb-3 p-3 scrollbar-none pr-4"},Bp=["onClick"],$p={key:1,class:"flex flex-col w-full bg-white rounded-lg gap-2"},Np={class:"flex items-center justify-center gap-2 flex-wrap"},Op={key:1},xi=Ie({__name:"EntityListing",props:{entityName:String,listClass:String,listItemClass:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},displayField:String,baseUrl:String,hrefKey:String,editable:Boolean,deletable:Boolean,linkedEntity:Array,externalFilterPayload:Object,roles:{type:[Array,String],default:()=>[]},permissions:{type:[Array,String],default:()=>[]},decoration:{type:String,default:"default"},numberVisible:{type:Number,default:3},variable:{type:String,default:"item"},showPresets:{type:Boolean,default:!1},scrollHeight:{type:String,default:""},showToolBar:{type:String,default:"top"},gap:{type:Number,default:1},justifyContent:{type:String,default:""},preFiltered:{type:String,default:""}},setup(e,{expose:t,emit:n}){const r=uo(),a=Oe(),i=new We;o.ref(null),o.ref(null);const l=o.ref("id"),s=o.ref(1),d=o.ref(25),c=o.ref(0);o.provide("entityObject",r);const u=n,f=e,m=o.ref([]),p=o.ref([]),g=o.ref(!0),h=o.ref(null),{hasMatchingRoleAndPermissions:b}=zt(),y=o.inject("getVariable");o.onMounted(async()=>{g.value=await b(f.roles,f.permissions),console.log("props entitylist",f.preFiltered),f.preFiltered&&x()}),f.linkedEntity?o.watch(()=>f.linkedEntity,w=>{w&&(m.value=w,u("linkedEntityChanged",w))},{immediate:!0}):o.watch(()=>r.state.data,w=>{w&&(m.value=w.result,u("linkedEntityChanged",w.result))},{immediate:!0});const v=async w=>{var S;try{const B={sortBy:[l.value],sortDirection:s.value===1?"ASC":"DESC",pageSize:d.value,currentPage:c.value,columnList:null,filter:w,fullTextSearch:""},I=await i.searchEntityRecords(f.entityName,B);I&&I.response?(r.state.data=I.response,p.value=((S=r.state.data)==null?void 0:S.presets)||[],console.log("Fetched presets data:",p.value),m.value=I.response.result):console.error("Error fetching entity data:",I)}catch(B){toast.add({severity:"error",summary:"Error",detail:(B==null?void 0:B.errorMessage)||"Failed to fetch data",life:3e3})}},x=async()=>{var S;if(!f.preFiltered){console.log("No pre-filtered data provided");return}const w=((S=f.preFiltered)==null?void 0:S.split("&&").map(B=>{const[I,D]=B.split("=").map(M=>M.trim()),P=(y==null?void 0:y(D))??D;return console.log("Parsed filter:",{field:I,value:P}),{columnName:I,value:P,operator:"EQUAL",columnType:typeof P=="string"?"STRING":"INT"}}))||[];w.length&&f.preFiltered&&v(w)};t({props:f,reload:()=>{console.log("reload data")},filter:w=>{console.log("filter data in unordered",w)},addToCurrentList:w=>{var S,B;(B=(S=r==null?void 0:r.state)==null?void 0:S.data)!=null&&B.result&&r.state.data.result.push(w)},deleteFromCurrentList:w=>{const S=r.state.data.result.indexOf(w);r.state.data.result.splice(S,1)}}),o.watch(()=>a.globalConfigs.appId,async w=>{var S,B;if(w){if(f.linkedEntity&&f.linkedEntity.length>0)r.setEntity(f.linkedEntity);else if(!f.preFiltered){const I=await r.getEntity(f.entityName);p.value=((B=(S=I==null?void 0:I.response)==null?void 0:S.entity)==null?void 0:B.presets)||[],console.log("Fetched presets data:",p.value),r.setEntity(I.success?I.response:{result:[]})}}},{immediate:!0});const k=async w=>{const S=await r.applyPreset(w,f.entityName);r.state.data=S||{}};return(w,S)=>{var B,I,D;return g.value?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0},w.$attrs,{class:"flex flex-col"}),[o.renderSlot(w.$slots,"header",{},void 0,!0),w.$slots["list-item-display"]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("div",fp,[e.showToolBar=="top"&&(e.showFilters||e.showAddButton||e.showPagination)?(o.openBlock(),o.createElementBlock("div",mp,[o.createElementVNode("div",pp,[e.showFilters?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFilter||Ye),{key:0,externalFilterPayload:f.externalFilterPayload,preFiltered:f.preFiltered},null,8,["externalFilterPayload","preFiltered"])):o.createCommentVNode("",!0),e.showAddButton?(o.openBlock(),o.createBlock(Xe,{key:1})):o.createCommentVNode("",!0),e.showPagination?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listPagination||dt),{key:2,class:"ml-auto"})):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)]),e.showPresets?(o.openBlock(),o.createElementBlock("div",gp,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(p.value,P=>(o.openBlock(),o.createElementBlock("button",{key:P,onClick:M=>{h.value=P.name,k(P.name)},class:o.normalizeClass(["bg-blue-100 text-blue-700 px-4 py-2 rounded-full text-sm",["px-4 py-2 rounded-full text-sm",h.value===P.name?"bg-blue-800 text-white":"bg-blue-100 text-blue-700"]])},o.toDisplayString(P.name),11,hp))),128))])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["flex flex-wrap",[f.decoration==="tiles"?"":"flex-col",`gap-${f.gap}`,f.scrollHeight?`overflow-y-auto h-[${f.scrollHeight}]`:"",f.justifyContent?`justify-${f.justifyContent}`:"justify-center"]])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.linkedEntity&&e.linkedEntity.length>0?e.linkedEntity:((D=(I=(B=o.unref(r))==null?void 0:B.state)==null?void 0:I.data)==null?void 0:D.result)||[],P=>o.renderSlot(w.$slots,"list-item-display",o.normalizeProps({item:P,class:e.listItemClass,[e.variable||""]:P}),void 0,!0)),256))],2),e.showToolBar=="bottom"&&(e.showFilters||e.showAddButton||e.showPagination)?(o.openBlock(),o.createElementBlock("div",bp,[o.createElementVNode("div",yp,[e.showFilters?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFilter||Ye),{key:0,externalFilterPayload:f.externalFilterPayload,preFiltered:f.preFiltered},null,8,["externalFilterPayload","preFiltered"])):o.createCommentVNode("",!0),e.showAddButton?(o.openBlock(),o.createBlock(Xe,{key:1})):o.createCommentVNode("",!0),e.showPagination?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listPagination||dt),{key:2,class:"ml-auto"})):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[e.entityName?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",kp,[o.createElementVNode("p",wp,[S[0]||(S[0]=o.createTextVNode(" Error: Missing required props - ")),e.entityName?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",vp,"Entity Name"))])])),o.createElementVNode("div",null,[o.createElementVNode("div",xp,[e.showToolBar=="top"&&(e.showFilters||e.showAddButton||e.showPagination)?(o.openBlock(),o.createElementBlock("div",Sp,[o.createElementVNode("div",Cp,[e.showFilters?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFilter||Ye),{key:0,externalFilterPayload:f.externalFilterPayload,preFiltered:f.preFiltered},null,8,["externalFilterPayload","preFiltered"])):o.createCommentVNode("",!0),e.showAddButton?(o.openBlock(),o.createBlock(Xe,{key:1})):o.createCommentVNode("",!0),e.showPagination?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listPagination||dt),{key:2,class:"ml-auto"})):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)]),e.showPresets?(o.openBlock(),o.createElementBlock("div",Ep,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(p.value,P=>(o.openBlock(),o.createElementBlock("button",{key:P,onClick:M=>{h.value=P.name,k(P.name)},class:o.normalizeClass(["bg-blue-100 text-blue-700 px-4 py-2 rounded-full text-sm",["px-4 py-2 rounded-full text-sm",h.value===P.name?"bg-blue-800 text-white":"bg-blue-100 text-blue-700"]])},o.toDisplayString(P.name),11,Bp))),128))])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(m.value,(P,M)=>(o.openBlock(),o.createElementBlock("div",{key:M},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listItemDisplay!=null&&e.listItemDisplay!=""?e.listItemDisplay:Jm),o.mergeProps({key:P,preFiltered:f.preFiltered,ref_for:!0},{item:P,...f}),null,16,["preFiltered"]))]))),128)),e.showToolBar=="bottom"&&(e.showFilters||e.showAddButton||e.showPagination)?(o.openBlock(),o.createElementBlock("div",$p,[o.createElementVNode("div",Np,[e.showFilters?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFilter||Ye),{key:0,externalFilterPayload:f.externalFilterPayload,preFiltered:f.preFiltered},null,8,["externalFilterPayload","preFiltered"])):o.createCommentVNode("",!0),e.showAddButton?(o.openBlock(),o.createBlock(Xe,{key:1})):o.createCommentVNode("",!0),e.showPagination?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listPagination||dt),{key:2,class:"ml-auto"})):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)]),o.renderSlot(w.$slots,"footer",{},void 0,!0)],64)),o.renderSlot(w.$slots,"footer",{},void 0,!0)],16)):(o.openBlock(),o.createElementBlock("p",Op,"You do not have the required permissions to access this feature."))}}},[["__scopeId","data-v-31c3fe68"]]),Tp={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col"},Vp={class:"flex justify-between items-start gap-4"},Ip={class:"flex-grow"},Fp={class:"flex flex-col gap-2"},Pp={class:"font-bold text-gray-700"},Rp={class:"text-gray-600"},Dp={class:"flex flex-col gap-2"},_p=Ie({__name:"EntityListingTileSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(e){const t=e,n=o.inject("entityObject"),r=o.ref([]),a=o.ref(null),i=o.ref(null),l=o.ref(!1),s=o.ref(!1);o.onMounted(()=>{r.value=n.getEntityColumns(n.state.data),a.value=r.value.find(m=>m.name===t.displayField)||null,a.value&&(i.value=t.item[a.value.name])});const d=()=>{l.value=!0},c=()=>{s.value=!0},u=async m=>{m.remove?f():l.value=!1},f=async()=>{const m=n.getPrimaryKeyColumn(n.state.data),p=t.item[m.name],g=await n.entityRecordDelete(n.state.data,p);if(g!=null&&g.success){l.value=!1;const h=await n.searchRecord(n.state.data,{sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch});h!=null&&h.response&&n.setEntity(h.response)}};return(m,p)=>{const g=o.resolveComponent("Button");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",Tp,[o.createElementVNode("div",Vp,[o.createElementVNode("div",Ip,[o.createElementVNode("div",Fp,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(h,b)=>(o.openBlock(),o.createElementBlock("div",{key:b,class:"flex flex-col"},[o.createElementVNode("span",Pp,o.toDisplayString(h.displayName||h.name)+":",1),o.createElementVNode("span",Rp,o.toDisplayString(e.item[h.name]),1)]))),128))])]),o.createElementVNode("div",Dp,[e.editable?(o.openBlock(),o.createBlock(g,{key:0,onClick:p[0]||(p[0]=h=>c()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):o.createCommentVNode("",!0),e.deletable?(o.openBlock(),o.createBlock(g,{key:1,onClick:p[1]||(p[1]=h=>d()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):o.createCommentVNode("",!0)])])]),s.value?(o.openBlock(),o.createBlock(pn,{key:0,showEntityForm:s.value,"onUpdate:showEntityForm":p[2]||(p[2]=h=>s.value=h),item:e.item},null,8,["showEntityForm","item"])):o.createCommentVNode("",!0),l.value?(o.openBlock(),o.createBlock(fo,{key:1,showDeleteDialog:l.value,"onUpdate:showDeleteDialog":p[3]||(p[3]=h=>l.value=h),onOnDeleteItem:u},null,8,["showDeleteDialog"])):o.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-c78e676f"]]),Ap={class:"flex flex-wrap gap-4 p-2"},Lp={key:0,class:"error-message"},zp={class:"text-red-500 font-bold"},Mp={key:0},jp={key:1},Up={class:"flex flex-wrap gap-4 p-4"},Si=Ie({__name:"EntityListingTile",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean,dynamicPropName:{type:String,default:"item"}},setup(e,{expose:t}){const n=uo(),r=Oe();o.provide("entityObject",n);const a=e,i=o.ref([]);return o.watch(()=>n.state.data,d=>{d&&(i.value=d.result)},{immediate:!0}),t({props:a,reload:()=>{console.log("reload data")},filter:()=>{console.log("filter data in unordered")}}),o.watch(()=>r.globalConfigs.appId,async d=>{if(d){const c=await n.getEntity(a.entityName);n.setEntity(c.success?c.response:{result:[]})}},{immediate:!0}),(d,c)=>{var u,f,m;return o.openBlock(),o.createElementBlock("div",o.normalizeProps(o.guardReactiveProps(d.$attrs)),[d.$slots["list-item-display-tile"]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.renderSlot(d.$slots,"header",{},void 0,!0),e.showAddButton?(o.openBlock(),o.createBlock(Xe,{key:0})):o.createCommentVNode("",!0),e.showFilters?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFilter||Ye),{key:1})):o.createCommentVNode("",!0),o.createElementVNode("div",Ap,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(((m=(f=(u=o.unref(n))==null?void 0:u.state)==null?void 0:f.data)==null?void 0:m.result)||[],(p,g)=>(o.openBlock(),o.createElementBlock("div",{key:g,class:"flex flex-col p-6 border border-gray-300 shadow-md rounded-lg bg-white w-full sm:w-1/2 md:w-1/3 lg:w-1/4 xl:w-1/5 2xl:w-1/8"},[o.renderSlot(d.$slots,"list-item-display-tile",o.normalizeProps({[e.dynamicPropName||""]:p}),void 0,!0)]))),128))]),o.renderSlot(d.$slots,"footer",{},void 0,!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.renderSlot(d.$slots,"header",{},void 0,!0),e.entityName?(o.openBlock(),o.createElementBlock("div",jp,[e.showFilters?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFilter||Ye),{key:0})):o.createCommentVNode("",!0),e.showAddButton?(o.openBlock(),o.createBlock(Xe,{key:1})):o.createCommentVNode("",!0),o.createElementVNode("div",Up,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.value,(p,g)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listItemDisplay!=null&&e.listItemDisplay!=""?e.listItemDisplay:_p),o.mergeProps({key:g,ref_for:!0},{item:p,...a}),null,16))),128))]),e.showPagination?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listPagination||dt),{key:2})):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",Lp,[o.createElementVNode("p",zp,[c[0]||(c[0]=o.createTextVNode(" Error: Missing required props - ")),e.entityName?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",Mp,"Entity Name"))])])),o.renderSlot(d.$slots,"footer",{},void 0,!0)],64))],16)}}},[["__scopeId","data-v-037944bc"]]),Hp={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col responsive-box"},Wp={class:"flex justify-between items-start gap-4"},qp={class:"flex-grow"},Kp={class:"flex flex-col gap-2"},Gp={class:"font-bold text-gray-700"},Yp={class:"text-gray-600"},Xp={class:"flex flex-col gap-2"},Jp=Ie({__name:"EntityListingCarouselSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean,numberVisible:{type:Number,default:3}},setup(e){const t=e,n=o.inject("entityObject"),r=o.ref([]),a=o.ref(null),i=o.ref(null),l=o.ref(!1),s=o.ref(!1);o.onMounted(()=>{r.value=n.getEntityColumns(n.state.data),a.value=r.value.find(m=>m.name===t.displayField)||null,a.value&&(i.value=t.item[a.value.name])});const d=()=>{l.value=!0},c=()=>{s.value=!0},u=async m=>{m.remove?f():l.value=!1},f=async()=>{const m=n.getPrimaryKeyColumn(n.state.data),p=t.item[m.name],g=await n.entityRecordDelete(n.state.data,p);if(g!=null&&g.success){l.value=!1;const h=await n.searchRecord(n.state.data,{sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch});h!=null&&h.response&&n.setEntity(h.response)}};return(m,p)=>{const g=o.resolveComponent("Button");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",Hp,[o.createElementVNode("div",Wp,[o.createElementVNode("div",qp,[o.createElementVNode("div",Kp,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(h,b)=>(o.openBlock(),o.createElementBlock("div",{key:b,class:"flex flex-col"},[o.createElementVNode("span",Gp,o.toDisplayString(h.displayName||h.name)+":",1),o.createElementVNode("span",Yp,o.toDisplayString(e.item[h.name]),1)]))),128))])]),o.createElementVNode("div",Xp,[e.editable?(o.openBlock(),o.createBlock(g,{key:0,onClick:p[0]||(p[0]=h=>c()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):o.createCommentVNode("",!0),e.deletable?(o.openBlock(),o.createBlock(g,{key:1,onClick:p[1]||(p[1]=h=>d()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):o.createCommentVNode("",!0)])])]),s.value?(o.openBlock(),o.createBlock(pn,{key:0,showEntityForm:s.value,"onUpdate:showEntityForm":p[2]||(p[2]=h=>s.value=h),item:e.item},null,8,["showEntityForm","item"])):o.createCommentVNode("",!0),l.value?(o.openBlock(),o.createBlock(fo,{key:1,showDeleteDialog:l.value,"onUpdate:showDeleteDialog":p[3]||(p[3]=h=>l.value=h),onOnDeleteItem:u},null,8,["showDeleteDialog"])):o.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-309b76fb"]]);function Qp(e,t){return e?e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className):!1}function Zp(e,t){if(e&&t){const n=r=>{Qp(e,r)||(e.classList?e.classList.add(r):e.className+=" "+r)};[t].flat().filter(Boolean).forEach(r=>r.split(" ").forEach(n))}}function po(e){for(const t of document==null?void 0:document.styleSheets)try{for(const n of t==null?void 0:t.cssRules)for(const r of n==null?void 0:n.style)if(e.test(r))return{name:r,value:n.style.getPropertyValue(r).trim()}}catch{}return null}function dr(e,t){if(e&&t){const n=r=>{e.classList?e.classList.remove(r):e.className=e.className.replace(new RegExp("(^|\\b)"+r.split(" ").join("|")+"(\\b|$)","gi")," ")};[t].flat().filter(Boolean).forEach(r=>r.split(" ").forEach(n))}}function Ci(e){let t={width:0,height:0};return e&&(e.style.visibility="hidden",e.style.display="block",t.width=e.offsetWidth,t.height=e.offsetHeight,e.style.display="none",e.style.visibility="visible"),t}function Ei(){let e=window,t=document,n=t.documentElement,r=t.getElementsByTagName("body")[0],a=e.innerWidth||n.clientWidth||r.clientWidth,i=e.innerHeight||n.clientHeight||r.clientHeight;return{width:a,height:i}}function eg(){let e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}function tg(){let e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}function ng(e,t,n=!0){var r,a,i,l;if(e){const s=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:Ci(e),d=s.height,c=s.width,u=t.offsetHeight,f=t.offsetWidth,m=t.getBoundingClientRect(),p=tg(),g=eg(),h=Ei();let b,y,v="top";m.top+u+d>h.height?(b=m.top+p-d,v="bottom",b<0&&(b=p)):b=u+m.top+p,m.left+c>h.width?y=Math.max(0,m.left+g+f-c):y=m.left+g,e.style.top=b+"px",e.style.left=y+"px",e.style.transformOrigin=v,n&&(e.style.marginTop=v==="bottom"?`calc(${(a=(r=po(/-anchor-gutter$/))==null?void 0:r.value)!=null?a:"2px"} * -1)`:(l=(i=po(/-anchor-gutter$/))==null?void 0:i.value)!=null?l:"")}}function og(e,t){e&&(typeof t=="string"?e.style.cssText=t:Object.entries(t).forEach(([n,r])=>e.style[n]=r))}function Bi(e,t){return e instanceof HTMLElement?e.offsetWidth:0}function rg(e,t,n=!0){var r,a,i,l;if(e){const s=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:Ci(e),d=t.offsetHeight,c=t.getBoundingClientRect(),u=Ei();let f,m,p="top";c.top+d+s.height>u.height?(f=-1*s.height,p="bottom",c.top+f<0&&(f=-1*c.top)):f=d,s.width>u.width?m=c.left*-1:c.left+s.width>u.width?m=(c.left+s.width-u.width)*-1:m=0,e.style.top=f+"px",e.style.left=m+"px",e.style.transformOrigin=p,n&&(e.style.marginTop=p==="bottom"?`calc(${(a=(r=po(/-anchor-gutter$/))==null?void 0:r.value)!=null?a:"2px"} * -1)`:(l=(i=po(/-anchor-gutter$/))==null?void 0:i.value)!=null?l:"")}}function hn(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e!==null&&e.nodeType===1&&typeof e.nodeName=="string"}function go(e,t={}){if(hn(e)){const n=(r,a)=>{var i,l;const s=(i=e==null?void 0:e.$attrs)!=null&&i[r]?[(l=e==null?void 0:e.$attrs)==null?void 0:l[r]]:[];return[a].flat().reduce((d,c)=>{if(c!=null){const u=typeof c;if(u==="string"||u==="number")d.push(c);else if(u==="object"){const f=Array.isArray(c)?n(r,c):Object.entries(c).map(([m,p])=>r==="style"&&(p||p===0)?`${m.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${p}`:p?m:void 0);d=f.length?d.concat(f.filter(m=>!!m)):d}}return d},s)};Object.entries(t).forEach(([r,a])=>{if(a!=null){const i=r.match(/^on(.+)/);i?e.addEventListener(i[1].toLowerCase(),a):r==="p-bind"||r==="pBind"?go(e,a):(a=r==="class"?[...new Set(n("class",a))].join(" ").trim():r==="style"?n("style",a).join(";").trim():a,(e.$attrs=e.$attrs||{})&&(e.$attrs[r]=a),e.setAttribute(r,a))}})}}function ag(e,t={},...n){{const r=document.createElement(e);return go(r,t),r.append(...n),r}}function ig(e,t){return hn(e)?Array.from(e.querySelectorAll(t)):[]}function ho(e,t){return hn(e)?e.matches(t)?e:e.querySelector(t):null}function $t(e,t){e&&document.activeElement!==e&&e.focus(t)}function lg(e,t){if(hn(e)){const n=e.getAttribute(t);return isNaN(n)?n==="true"||n==="false"?n==="true":n:+n}}function ur(e,t=""){let n=ig(e,`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
23
|
+
*/const ui=["viewport","carousel"],gn={"bottom-to-top":"btt","left-to-right":"ltr","right-to-left":"rtl","top-to-bottom":"ttb"},fi=["ltr","left-to-right","rtl","right-to-left","ttb","top-to-bottom","btt","bottom-to-top"],Qm={ariaGallery:"Gallery",ariaNavigateToPage:"Navigate to page {slideNumber}",ariaNavigateToSlide:"Navigate to slide {slideNumber}",ariaNextSlide:"Navigate to next slide",ariaPreviousSlide:"Navigate to previous slide",iconArrowDown:"Arrow pointing downwards",iconArrowLeft:"Arrow pointing to the left",iconArrowRight:"Arrow pointing to the right",iconArrowUp:"Arrow pointing upwards",itemXofY:"Item {currentSlide} of {slidesCount}"};Object.values(gn);const mi=["slide","fade"],pi=["center","start","end","center-even","center-odd"],Ne={autoplay:0,breakpointMode:ui[0],breakpoints:void 0,dir:fi[0],enabled:!0,gap:0,height:"auto",i18n:Qm,ignoreAnimations:!1,itemsToScroll:1,itemsToShow:1,modelValue:0,mouseDrag:!0,pauseAutoplayOnHover:!1,preventExcessiveDragging:!1,slideEffect:mi[0],snapAlign:pi[0],touchDrag:!0,transition:300,wrapAround:!1},Mt=Symbol("carousel"),Zm=e=>{const t=o.shallowReactive([]),n=r=>{r!==void 0?t.slice(r).forEach((a,i)=>{var l;(l=a.exposed)===null||l===void 0||l.setIndex(r+i)}):t.forEach((a,i)=>{var l;(l=a.exposed)===null||l===void 0||l.setIndex(i)})};return{cleanup:()=>{t.splice(0,t.length)},getSlides:()=>t,registerSlide:(r,a)=>{if(!r||r.props.isClone)return;const i=a??t.length;t.splice(i,0,r),n(i),e("slide-registered",{slide:r,index:i})},unregisterSlide:r=>{const a=t.indexOf(r);a!==-1&&(e("slide-unregistered",{slide:r,index:a}),t.splice(a,1),n(a))}}};function ep(e){return e.length===0?0:e.reduce((n,r)=>n+r,0)/e.length}function gi({slides:e,position:t,toShow:n}){const r=[],a=t==="before",i=a?-n:0,l=a?0:n;if(e.length<=0)return r;for(let s=i;s<l;s++){const c={index:a?s:s+e.length,isClone:!0,position:t,id:void 0,key:`clone-${t}-${s}`},u=e[(s%e.length+e.length)%e.length].vnode,f=o.cloneVNode(u,c);f.el=null,r.push(f)}return r}const tp='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])';function hi(e){if(!e.el||!(e.el instanceof Element))return;const t=e.el.querySelectorAll(tp);for(const n of t)n instanceof HTMLElement&&!n.hasAttribute("disabled")&&n.getAttribute("aria-hidden")!=="true"&&n.setAttribute("tabindex","-1")}function np(e,t){return Object.keys(e).filter(n=>!t.includes(n)).reduce((n,r)=>(n[r]=e[r],n),{})}function op(e){const{isVertical:t,isReversed:n,dragged:r,effectiveSlideSize:a}=e,i=t?r.y:r.x;if(i===0)return 0;const l=Math.round(i/a);return n?l:-l}function wt({val:e,max:t,min:n}){return t<n?e:Math.min(Math.max(e,isNaN(n)?e:n),isNaN(t)?e:t)}function rp(e){const{transform:t}=window.getComputedStyle(e);return t.split(/[(,)]/).slice(1,-1).map(n=>parseFloat(n))}function ap(e){let t=1,n=1;return e.forEach(r=>{const a=rp(r);a.length===6&&(t/=a[0],n/=a[3])}),{widthMultiplier:t,heightMultiplier:n}}function ip(e,t){switch(e){case"start":return 0;case"center":case"center-odd":return(t-1)/2;case"center-even":return(t-2)/2;case"end":return t-1;default:return 0}}function lp(e,t,n){switch(e){case"start":return 0;case"center":case"center-odd":return(n-t)/2;case"center-even":return n/2-t;case"end":return n-t;default:return 0}}function lr({slideSize:e,viewportSize:t,align:n,itemsToShow:r}){return r!==void 0?ip(n,r):e!==void 0&&t!==void 0?lp(n,e,t):0}function bi(e="",t={}){return Object.entries(t).reduce((n,[r,a])=>n.replace(`{${r}}`,String(a)),e)}function yi({val:e,max:t,min:n=0}){const r=t-n+1;return((e-n)%r+r)%r+n}function sr(e,t=0){let n=!1,r=0,a=null;function i(...l){if(n)return;n=!0;const s=()=>{a=requestAnimationFrame(d=>{d-r>t?(r=d,e(...l),n=!1):s()})};s()}return i.cancel=()=>{a&&(cancelAnimationFrame(a),a=null,n=!1)},i}function mo(e,t="px"){if(!(e==null||e===""))return typeof e=="number"||parseFloat(e).toString()===e?`${e}${t}`:e}const sp=o.defineComponent({name:"CarouselAria",setup(){const e=o.inject(Mt);return e?()=>o.h("div",{class:["carousel__liveregion","carousel__sr-only"],"aria-live":"polite","aria-atomic":"true"},bi(e.config.i18n.itemXofY,{currentSlide:e.currentSlide+1,slidesCount:e.slidesCount})):()=>""}}),cp={autoplay:{default:Ne.autoplay,type:Number},breakpoints:{default:Ne.breakpoints,type:Object},breakpointMode:{default:Ne.breakpointMode,validator(e){return ui.includes(e)}},enabled:{default:Ne.enabled,type:Boolean},gap:{default:Ne.gap,type:Number},height:{default:Ne.height,type:[Number,String]},ignoreAnimations:{default:!1,type:[Array,Boolean,String]},itemsToScroll:{default:Ne.itemsToScroll,type:Number},itemsToShow:{default:Ne.itemsToShow,type:[Number,String]},i18n:{default:Ne.i18n,type:Object},modelValue:{default:void 0,type:Number},mouseDrag:{default:Ne.mouseDrag,type:Boolean},touchDrag:{default:Ne.touchDrag,type:Boolean},pauseAutoplayOnHover:{default:Ne.pauseAutoplayOnHover,type:Boolean},preventExcessiveDragging:{default:!1,type:Boolean,validator(e,t){return e&&t.wrapAround&&console.warn('[vue3-carousel warn]: "preventExcessiveDragging" cannot be used with wrapAround. The setting will be ignored.'),!0}},snapAlign:{default:Ne.snapAlign,validator(e){return pi.includes(e)}},slideEffect:{type:String,default:Ne.slideEffect,validator(e){return mi.includes(e)}},transition:{default:Ne.transition,type:Number},dir:{type:String,default:Ne.dir,validator(e,t){if(!fi.includes(e))return!1;const n=e in gn?gn[e]:e;return["ttb","btt"].includes(n)&&(!t.height||t.height==="auto")&&console.warn(`[vue3-carousel warn]: The dir "${e}" is not supported with height "auto".`),!0}},wrapAround:{default:Ne.wrapAround,type:Boolean}};o.defineComponent({name:"VueCarousel",props:cp,emits:["before-init","drag","init","loop","slide-end","slide-registered","slide-start","slide-unregistered","update:modelValue"],setup(e,{slots:t,emit:n,expose:r}){var a;const i=Zm(n),l=i.getSlides(),s=o.computed(()=>l.length),d=o.ref(null),c=o.ref(null),u=o.ref(0),f=o.computed(()=>Object.assign(Object.assign(Object.assign({},Ne),np(e,["breakpoints","modelValue"])),{i18n:Object.assign(Object.assign({},Ne.i18n),e.i18n)})),m=o.shallowReactive(Object.assign({},f.value)),p=o.ref((a=e.modelValue)!==null&&a!==void 0?a:0),g=o.ref(p.value);o.watch(p,A=>g.value=A);const h=o.ref(0),b=o.computed(()=>Math.ceil((s.value-1)/2)),y=o.computed(()=>s.value-1),v=o.computed(()=>0);let x=null,E=null,N=null;const $=o.computed(()=>u.value+m.gap),C=o.computed(()=>{const A=m.dir||"ltr";return A in gn?gn[A]:A}),k=o.computed(()=>["rtl","btt"].includes(C.value)),w=o.computed(()=>["ttb","btt"].includes(C.value)),S=o.computed(()=>m.itemsToShow==="auto"),B=o.computed(()=>w.value?"height":"width");function I(){var A;if(!Q.value)return;const U=(f.value.breakpointMode==="carousel"?(A=d.value)===null||A===void 0?void 0:A.getBoundingClientRect().width:typeof window<"u"?window.innerWidth:0)||0,G=Object.keys(e.breakpoints||{}).map(te=>Number(te)).sort((te,ye)=>+ye-+te),K={};G.some(te=>U>=te?(Object.assign(K,e.breakpoints[te]),K.i18n&&Object.assign(K.i18n,f.value.i18n,e.breakpoints[te].i18n),!0):!1),Object.assign(m,f.value,K)}const D=sr(()=>{I(),_(),O()}),P=o.shallowReactive(new Set),M=o.ref([]);function j({widthMultiplier:A,heightMultiplier:U}){M.value=l.map(G=>{var K;const te=(K=G.exposed)===null||K===void 0?void 0:K.getBoundingRect();return{width:te.width*A,height:te.height*U}})}const q=o.ref({width:0,height:0});function F({widthMultiplier:A,heightMultiplier:U}){var G;const K=((G=c.value)===null||G===void 0?void 0:G.getBoundingClientRect())||{width:0,height:0};q.value={width:K.width*A,height:K.height*U}}function O(){if(!c.value)return;const A=ap(P);if(F(A),j(A),S.value)u.value=ep(M.value.map(U=>U[B.value]));else{const U=Number(m.itemsToShow),G=(U-1)*m.gap;u.value=(q.value[B.value]-G)/U}}function _(){!m.wrapAround&&s.value>0&&(p.value=wt({val:p.value,max:y.value,min:v.value})),S.value||(m.itemsToShow=wt({val:Number(m.itemsToShow),max:s.value,min:1}))}const J=o.computed(()=>typeof e.ignoreAnimations=="string"?e.ignoreAnimations.split(","):Array.isArray(e.ignoreAnimations)?e.ignoreAnimations:e.ignoreAnimations?!1:[]);o.watchEffect(()=>_()),o.watchEffect(()=>{O()});let re;const ae=A=>{const U=A.target;if(!(!(U!=null&&U.contains(d.value))||Array.isArray(J.value)&&J.value.includes(A.animationName))&&(P.add(U),!re)){const G=()=>{re=requestAnimationFrame(()=>{O(),G()})};G()}},Y=A=>{const U=A.target;U&&P.delete(U),re&&P.size===0&&(cancelAnimationFrame(re),O())},Q=o.ref(!1);typeof document<"u"&&o.watchEffect(()=>{Q.value&&J.value!==!1?(document.addEventListener("animationstart",ae),document.addEventListener("animationend",Y)):(document.removeEventListener("animationstart",ae),document.removeEventListener("animationend",Y))}),o.onMounted(()=>{Q.value=!0,I(),Ee(),d.value&&(N=new ResizeObserver(D),N.observe(d.value)),n("init")}),o.onBeforeUnmount(()=>{Q.value=!1,i.cleanup(),E&&clearTimeout(E),re&&cancelAnimationFrame(re),x&&clearInterval(x),N&&(N.disconnect(),N=null),typeof document<"u"&&fe(),d.value&&(d.value.removeEventListener("transitionend",O),d.value.removeEventListener("animationiteration",O))});let le=!1;const ce={x:0,y:0},xe=o.reactive({x:0,y:0}),He=o.ref(!1),Re=o.ref(!1),rt=()=>{He.value=!0},Je=()=>{He.value=!1},H=sr(A=>{if(!A.ctrlKey)switch(A.key){case"ArrowLeft":case"ArrowUp":w.value===A.key.endsWith("Up")&&(k.value?Qe(!0):Vt(!0));break;case"ArrowRight":case"ArrowDown":w.value===A.key.endsWith("Down")&&(k.value?Vt(!0):Qe(!0));break}},200),z=()=>{document.addEventListener("keydown",H)},fe=()=>{document.removeEventListener("keydown",H)};function ge(A){const U=A.target.tagName;if(["INPUT","TEXTAREA","SELECT"].includes(U)||Ve.value||(le=A.type==="touchstart",!le&&(A.preventDefault(),A.button!==0)))return;ce.x="touches"in A?A.touches[0].clientX:A.clientX,ce.y="touches"in A?A.touches[0].clientY:A.clientY;const G=le?"touchmove":"mousemove",K=le?"touchend":"mouseup";document.addEventListener(G,me,{passive:!1}),document.addEventListener(K,he,{passive:!0})}const me=sr(A=>{Re.value=!0;const U="touches"in A?A.touches[0].clientX:A.clientX,G="touches"in A?A.touches[0].clientY:A.clientY;xe.x=U-ce.x,xe.y=G-ce.y;const K=op({isVertical:w.value,isReversed:k.value,dragged:xe,effectiveSlideSize:$.value});g.value=m.wrapAround?p.value+K:wt({val:p.value+K,max:y.value,min:v.value}),n("drag",{deltaX:xe.x,deltaY:xe.y})});function he(){if(me.cancel(),g.value!==p.value&&!le){const G=K=>{K.preventDefault(),window.removeEventListener("click",G)};window.addEventListener("click",G)}je(g.value),xe.x=0,xe.y=0,Re.value=!1;const A=le?"touchmove":"mousemove",U=le?"touchend":"mouseup";document.removeEventListener(A,me),document.removeEventListener(U,he)}function Ee(){!m.autoplay||m.autoplay<=0||(x=setInterval(()=>{m.pauseAutoplayOnHover&&He.value||Qe()},m.autoplay))}function Me(){x&&(clearInterval(x),x=null)}function ft(){Me(),Ee()}const Ve=o.ref(!1);function je(A,U=!1){if(!U&&Ve.value)return;let G=A,K=A;h.value=p.value,m.wrapAround?K=yi({val:G,max:y.value,min:v.value}):G=wt({val:G,max:y.value,min:v.value}),n("slide-start",{slidingToIndex:A,currentSlideIndex:p.value,prevSlideIndex:h.value,slidesCount:s.value}),Me(),Ve.value=!0,p.value=G,K!==G&&qt.pause(),n("update:modelValue",K),E=setTimeout(()=>{m.wrapAround&&K!==G&&(qt.resume(),p.value=K,n("loop",{currentSlideIndex:p.value,slidingToIndex:A})),n("slide-end",{currentSlideIndex:p.value,prevSlideIndex:h.value,slidesCount:s.value}),Ve.value=!1,ft()},m.transition)}function Qe(A=!1){je(p.value+m.itemsToScroll,A)}function Vt(A=!1){je(p.value-m.itemsToScroll,A)}function It(){I(),_(),O(),ft()}o.watch(()=>[f.value,e.breakpoints],()=>I(),{deep:!0}),o.watch(()=>e.autoplay,()=>ft());const qt=o.watch(()=>e.modelValue,A=>{A!==p.value&&je(Number(A),!0)});n("before-init");const Z=o.computed(()=>{if(!m.wrapAround)return{before:0,after:0};if(S.value)return{before:l.length,after:l.length};const A=Number(m.itemsToShow),U=Math.ceil(A+(m.itemsToScroll-1)),G=U-g.value,K=U-(s.value-(g.value+1));return{before:Math.max(0,G),after:Math.max(0,K)}}),at=o.computed(()=>Z.value.before?S.value?M.value.slice(-1*Z.value.before).reduce((A,U)=>A+U[B.value]+m.gap,0)*-1:Z.value.before*$.value*-1:0),Be=o.computed(()=>{var A;if(S.value){const U=(p.value%l.length+l.length)%l.length;return lr({slideSize:(A=M.value[U])===null||A===void 0?void 0:A[B.value],viewportSize:q.value[B.value],align:m.snapAlign})}return lr({align:m.snapAlign,itemsToShow:+m.itemsToShow})}),T=o.computed(()=>{let A=0;if(S.value){if(p.value<0?A=M.value.slice(p.value).reduce((U,G)=>U+G[B.value]+m.gap,0)*-1:A=M.value.slice(0,p.value).reduce((U,G)=>U+G[B.value]+m.gap,0),A-=Be.value,!m.wrapAround){const U=M.value.reduce((G,K)=>G+K[B.value]+m.gap,0)-q.value[B.value]-m.gap;A=wt({val:A,max:U,min:0})}}else{let U=p.value-Be.value;m.wrapAround||(U=wt({val:U,max:s.value-+m.itemsToShow,min:0})),A=U*$.value}return A*(k.value?1:-1)}),V=o.computed(()=>{var A,U;if(!S.value){const te=p.value-Be.value;return m.wrapAround?{min:Math.floor(te),max:Math.ceil(te+Number(m.itemsToShow)-1)}:{min:Math.floor(wt({val:te,max:s.value-Number(m.itemsToShow),min:0})),max:Math.ceil(wt({val:te+Number(m.itemsToShow)-1,max:s.value-1,min:0}))}}let G=0;{let te=0,ye=0-Z.value.before;const Se=Math.abs(T.value+at.value);for(;te<=Se;){const Fe=(ye%l.length+l.length)%l.length;te+=((A=M.value[Fe])===null||A===void 0?void 0:A[B.value])+m.gap,ye++}G=ye-1}let K=0;{let te=G,ye=0;for(te<0?ye=M.value.slice(0,te).reduce((Se,Fe)=>Se+Fe[B.value]+m.gap,0)-Math.abs(T.value+at.value):ye=M.value.slice(0,te).reduce((Se,Fe)=>Se+Fe[B.value]+m.gap,0)-Math.abs(T.value);ye<q.value[B.value];){const Se=(te%l.length+l.length)%l.length;ye+=((U=M.value[Se])===null||U===void 0?void 0:U[B.value])+m.gap,te++}K=te-1}return{min:Math.floor(G),max:Math.ceil(K)}}),L=o.computed(()=>{if(m.slideEffect==="fade")return;const A=w.value?"Y":"X",U=w.value?xe.y:xe.x;let G=T.value+U;if(!m.wrapAround&&m.preventExcessiveDragging){let K=0;S.value?K=M.value.reduce((Se,Fe)=>Se+Fe[B.value],0):K=(s.value-Number(m.itemsToShow))*$.value;const te=k.value?0:-1*K,ye=k.value?K:0;G=wt({val:G,min:te,max:ye})}return`translate${A}(${G}px)`}),W=o.computed(()=>({"--vc-transition-duration":Ve.value?mo(m.transition,"ms"):void 0,"--vc-slide-gap":mo(m.gap),"--vc-carousel-height":mo(m.height),"--vc-cloned-offset":mo(at.value)})),ee={slideTo:je,next:Qe,prev:Vt},oe=o.reactive({activeSlide:g,config:m,currentSlide:p,isSliding:Ve,isVertical:w,maxSlide:y,minSlide:v,nav:ee,normalizedDir:C,slideRegistry:i,slideSize:u,slides:l,slidesCount:s,viewport:c,visibleRange:V});o.provide(Mt,oe);const X=o.reactive({config:m,currentSlide:p,maxSlide:y,middleSlide:b,minSlide:v,slideSize:u,slidesCount:s});return r({data:X,nav:ee,next:Qe,prev:Vt,restartCarousel:It,slideTo:je,updateBreakpointsConfig:I,updateSlideSize:O,updateSlidesData:_}),()=>{var A;const U=t.default||t.slides,G=(U==null?void 0:U(X))||[],{before:K,after:te}=Z.value,ye=gi({slides:l,position:"before",toShow:K}),Se=gi({slides:l,position:"after",toShow:te}),Fe=[...ye,...G,...Se];if(!m.enabled||!Fe.length)return o.h("section",{ref:d,class:["carousel","is-disabled"]},Fe);const Dn=((A=t.addons)===null||A===void 0?void 0:A.call(t,X))||[],_n=o.h("ol",{class:"carousel__track",style:{transform:L.value},onMousedownCapture:m.mouseDrag?ge:null,onTouchstartPassiveCapture:m.touchDrag?ge:null},Fe),An=o.h("div",{class:"carousel__viewport",ref:c},_n);return o.h("section",{ref:d,class:["carousel",`is-${C.value}`,`is-effect-${m.slideEffect}`,{"is-vertical":w.value,"is-sliding":Ve.value,"is-dragging":Re.value,"is-hover":He.value}],dir:C.value,style:W.value,"aria-label":m.i18n.ariaGallery,tabindex:"0",onFocus:z,onBlur:fe,onMouseenter:rt,onMouseleave:Je},[An,Dn,o.h(sp)])}}});var cr;(function(e){e.arrowDown="arrowDown",e.arrowLeft="arrowLeft",e.arrowRight="arrowRight",e.arrowUp="arrowUp"})(cr||(cr={}));const ki=e=>`icon${e.charAt(0).toUpperCase()+e.slice(1)}`,dp={arrowDown:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z",arrowLeft:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z",arrowRight:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",arrowUp:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"};function up(e){return e in cr}const wi=e=>e&&up(e),vi=o.defineComponent({props:{name:{type:String,required:!0,validator:wi},title:{type:String,default:e=>e.name?Ne.i18n[ki(e.name)]:""}},setup(e){const t=o.inject(Mt,null);return()=>{const n=e.name;if(!n||!wi(n))return;const r=dp[n],a=o.h("path",{d:r}),i=(t==null?void 0:t.config.i18n[ki(n)])||e.title,l=o.h("title",i);return o.h("svg",{class:"carousel__icon",viewBox:"0 0 24 24",role:"img","aria-label":i},[l,a])}}});o.defineComponent({name:"CarouselNavigation",inheritAttrs:!1,setup(e,{slots:t,attrs:n}){const r=o.inject(Mt);if(!r)return()=>"";const{next:a,prev:i}=t,l=()=>({btt:"arrowDown",ltr:"arrowLeft",rtl:"arrowRight",ttb:"arrowUp"})[r.normalizedDir],s=()=>({btt:"arrowUp",ltr:"arrowRight",rtl:"arrowLeft",ttb:"arrowDown"})[r.normalizedDir],d=o.computed(()=>!r.config.wrapAround&&r.currentSlide<=r.minSlide),c=o.computed(()=>!r.config.wrapAround&&r.currentSlide>=r.maxSlide);return()=>{const{i18n:u}=r.config,f=o.h("button",Object.assign(Object.assign({type:"button",disabled:d.value,"aria-label":u.ariaPreviousSlide,title:u.ariaPreviousSlide,onClick:r.nav.prev},n),{class:["carousel__prev",{"carousel__prev--disabled":d.value},n.class]}),(i==null?void 0:i())||o.h(vi,{name:l()})),m=o.h("button",Object.assign(Object.assign({type:"button",disabled:c.value,"aria-label":u.ariaNextSlide,title:u.ariaNextSlide,onClick:r.nav.next},n),{class:["carousel__next",{"carousel__next--disabled":c.value},n.class]}),(a==null?void 0:a())||o.h(vi,{name:s()}));return[f,m]}}}),o.defineComponent({name:"CarouselPagination",props:{disableOnClick:{type:Boolean},paginateByItemsToShow:{type:Boolean}},setup(e){const t=o.inject(Mt);if(!t)return()=>"";const n=o.computed(()=>t.config.itemsToShow),r=o.computed(()=>lr({align:t.config.snapAlign,itemsToShow:n.value})),a=o.computed(()=>e.paginateByItemsToShow&&n.value>1),i=o.computed(()=>Math.ceil((t.activeSlide-r.value)/n.value)),l=o.computed(()=>Math.ceil(t.slidesCount/n.value)),s=d=>yi(a.value?{val:i.value,max:l.value-1,min:0}:{val:t.activeSlide,max:t.maxSlide,min:t.minSlide})===d;return()=>{var d,c;const u=[];for(let f=a.value?0:t.minSlide;f<=(a.value?l.value-1:t.maxSlide);f++){const m=bi(t.config.i18n[a.value?"ariaNavigateToPage":"ariaNavigateToSlide"],{slideNumber:f+1}),p=s(f),g=o.h("button",{type:"button",class:{"carousel__pagination-button":!0,"carousel__pagination-button--active":p},"aria-label":m,"aria-pressed":p,"aria-controls":(c=(d=t.slides[f])===null||d===void 0?void 0:d.exposed)===null||c===void 0?void 0:c.id,title:m,disabled:e.disableOnClick,onClick:()=>t.nav.slideTo(a.value?Math.floor(f*+t.config.itemsToShow+r.value):f)}),h=o.h("li",{class:"carousel__pagination-item",key:f},g);u.push(h)}return o.h("ol",{class:"carousel__pagination"},u)}}}),o.defineComponent({name:"CarouselSlide",props:{id:{type:String,default:e=>e.isClone?void 0:o.useId()},index:{type:Number,default:void 0},isClone:{type:Boolean,default:!1},position:{type:String,default:void 0}},setup(e,{attrs:t,slots:n,expose:r}){const a=o.inject(Mt);if(o.provide(Mt,void 0),!a)return()=>"";const i=o.ref(e.index),l=g=>{i.value=g},s=o.getCurrentInstance(),d=()=>{const g=s.vnode.el;return g?g.getBoundingClientRect():{width:0,height:0}};r({id:e.id,setIndex:l,getBoundingRect:d});const c=o.computed(()=>i.value===a.activeSlide),u=o.computed(()=>i.value===a.activeSlide-1),f=o.computed(()=>i.value===a.activeSlide+1),m=o.computed(()=>i.value>=a.visibleRange.min&&i.value<=a.visibleRange.max),p=o.computed(()=>{if(a.config.itemsToShow==="auto")return;const g=a.config.itemsToShow,h=a.config.gap>0&&g>1?`calc(${100/g}% - ${a.config.gap*(g-1)/g}px)`:`${100/g}%`;return a.isVertical?{height:h}:{width:h}});return a.slideRegistry.registerSlide(s,e.index),o.onUnmounted(()=>{a.slideRegistry.unregisterSlide(s)}),e.isClone&&(o.onMounted(()=>{hi(s.vnode)}),o.onUpdated(()=>{hi(s.vnode)})),()=>{var g,h;return a.config.enabled?o.h("li",{style:[t.style,Object.assign({},p.value)],class:{carousel__slide:!0,"carousel__slide--clone":e.isClone,"carousel__slide--visible":m.value,"carousel__slide--active":c.value,"carousel__slide--prev":u.value,"carousel__slide--next":f.value,"carousel__slide--sliding":a.isSliding},onFocusin:()=>{a.viewport&&(a.viewport.scrollLeft=0),a.nav.slideTo(i.value)},id:e.isClone?void 0:e.id,"aria-hidden":e.isClone||void 0},(h=n.default)===null||h===void 0?void 0:h.call(n,{currentIndex:i.value,isActive:c.value,isClone:e.isClone,isPrev:u.value,isNext:f.value,isSliding:a.isSliding,isVisible:m.value})):(g=n.default)===null||g===void 0?void 0:g.call(n)}}});const fp={class:"flex items-center justify-between rounded-md w-full overflow-hidden"},mp={key:0,class:"flex flex-col w-full bg-white rounded-lg gap-2"},pp={class:"flex items-center justify-center gap-2 flex-wrap"},gp={key:0,class:"flex items-center gap-3 overflow-x-auto mb-3 p-3 scrollbar-none pr-4"},hp=["onClick"],bp={key:1,class:"flex flex-col w-full bg-white rounded-lg gap-2"},yp={class:"flex items-center justify-center gap-2 flex-wrap"},kp={key:0,class:"error-message"},wp={class:"text-red-500 font-bold"},vp={key:0},xp={class:"flex items-center justify-between rounded-md w-full overflow-hidden"},Sp={key:0,class:"flex flex-col w-full bg-white rounded-lg gap-2"},Cp={class:"flex items-center justify-center gap-2 flex-wrap"},Ep={key:0,class:"flex items-center gap-3 overflow-x-auto mb-3 p-3 scrollbar-none pr-4"},Bp=["onClick"],$p={key:1,class:"flex flex-col w-full bg-white rounded-lg gap-2"},Np={class:"flex items-center justify-center gap-2 flex-wrap"},Op={key:1},xi=Ie({__name:"EntityListing",props:{entityName:String,listClass:String,listItemClass:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},displayField:String,baseUrl:String,hrefKey:String,editable:Boolean,deletable:Boolean,linkedEntity:Array,externalFilterPayload:Object,roles:{type:[Array,String],default:()=>[]},permissions:{type:[Array,String],default:()=>[]},decoration:{type:String,default:"default"},numberVisible:{type:Number,default:3},variable:{type:String,default:"item"},showPresets:{type:Boolean,default:!1},scrollHeight:{type:String,default:""},showToolBar:{type:String,default:"top"},gap:{type:Number,default:1},justifyContent:{type:String,default:""},preFiltered:{type:String,default:""}},setup(e,{expose:t,emit:n}){const r=uo(),a=Oe(),i=new We;o.ref(null),o.ref(null);const l=o.ref("id"),s=o.ref(1),d=o.ref(25),c=o.ref(0);o.provide("entityObject",r);const u=n,f=e,m=o.ref([]),p=o.ref([]),g=o.ref(!0),h=o.ref(null),{hasMatchingRoleAndPermissions:b}=zt(),y=o.inject("getVariable");o.onMounted(async()=>{g.value=await b(f.roles,f.permissions),console.log("props entitylist",f.preFiltered),f.preFiltered&&x()}),f.linkedEntity?o.watch(()=>f.linkedEntity,w=>{w&&(m.value=w,u("linkedEntityChanged",w))},{immediate:!0}):o.watch(()=>r.state.data,w=>{w&&(m.value=w.result,u("linkedEntityChanged",w.result))},{immediate:!0});const v=async w=>{var S;try{const B={sortBy:[l.value],sortDirection:s.value===1?"ASC":"DESC",pageSize:d.value,currentPage:c.value,columnList:null,filter:w,fullTextSearch:""},I=await i.searchEntityRecords(f.entityName,B);I&&I.response?(r.state.data=I.response,p.value=((S=r.state.data)==null?void 0:S.presets)||[],console.log("Fetched presets data:",p.value),m.value=I.response.result):console.error("Error fetching entity data:",I)}catch(B){toast.add({severity:"error",summary:"Error",detail:(B==null?void 0:B.errorMessage)||"Failed to fetch data",life:3e3})}},x=async()=>{var S;if(!f.preFiltered){console.log("No pre-filtered data provided");return}const w=((S=f.preFiltered)==null?void 0:S.split("&&").map(B=>{const[I,D]=B.split("=").map(M=>M.trim()),P=(y==null?void 0:y(D))??D;return console.log("Parsed filter:",{field:I,value:P}),{columnName:I,value:P,operator:"EQUAL",columnType:typeof P=="string"?"STRING":"INT"}}))||[];w.length&&f.preFiltered&&v(w)};t({props:f,reload:()=>{console.log("reload data")},filter:w=>{console.log("filter data in unordered",w)},addToCurrentList:w=>{var S,B;(B=(S=r==null?void 0:r.state)==null?void 0:S.data)!=null&&B.result&&r.state.data.result.push(w)},deleteFromCurrentList:w=>{const S=r.state.data.result.indexOf(w);r.state.data.result.splice(S,1)}}),o.watch(()=>a.globalConfigs.appId,async w=>{var S,B;if(w){if(f.linkedEntity&&f.linkedEntity.length>0)r.setEntity(f.linkedEntity);else if(!f.preFiltered){const I=await r.getEntity(f.entityName);p.value=((B=(S=I==null?void 0:I.response)==null?void 0:S.entity)==null?void 0:B.presets)||[],console.log("Fetched presets data:",p.value),r.setEntity(I.success?I.response:{result:[]})}}},{immediate:!0});const k=async w=>{const S=await r.applyPreset(w,f.entityName);r.state.data=S||{}};return(w,S)=>{var B,I,D;return g.value?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0},w.$attrs,{class:"flex flex-col"}),[o.renderSlot(w.$slots,"header",{},void 0,!0),w.$slots["list-item-display"]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("div",fp,[e.showToolBar=="top"&&(e.showFilters||e.showAddButton||e.showPagination)?(o.openBlock(),o.createElementBlock("div",mp,[o.createElementVNode("div",pp,[e.showFilters?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFilter||Ye),{key:0,externalFilterPayload:f.externalFilterPayload,preFiltered:f.preFiltered},null,8,["externalFilterPayload","preFiltered"])):o.createCommentVNode("",!0),e.showAddButton?(o.openBlock(),o.createBlock(Xe,{key:1})):o.createCommentVNode("",!0),e.showPagination?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listPagination||dt),{key:2,class:"ml-auto"})):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)]),e.showPresets?(o.openBlock(),o.createElementBlock("div",gp,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(p.value,P=>(o.openBlock(),o.createElementBlock("button",{key:P,onClick:M=>{h.value=P.name,k(P.name)},class:o.normalizeClass(["bg-blue-100 text-blue-700 px-4 py-2 rounded-full text-sm",["px-4 py-2 rounded-full text-sm",h.value===P.name?"bg-blue-800 text-white":"bg-blue-100 text-blue-700"]])},o.toDisplayString(P.name),11,hp))),128))])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["flex flex-wrap",[f.decoration==="tiles"?"":"flex-col",`gap-${f.gap}`,f.scrollHeight?`overflow-y-auto h-[${f.scrollHeight}]`:"",f.justifyContent?`justify-${f.justifyContent}`:"justify-center"]])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.linkedEntity&&e.linkedEntity.length>0?e.linkedEntity:((D=(I=(B=o.unref(r))==null?void 0:B.state)==null?void 0:I.data)==null?void 0:D.result)||[],P=>o.renderSlot(w.$slots,"list-item-display",o.normalizeProps({item:P,class:e.listItemClass,[e.variable||""]:P}),void 0,!0)),256))],2),e.showToolBar=="bottom"&&(e.showFilters||e.showAddButton||e.showPagination)?(o.openBlock(),o.createElementBlock("div",bp,[o.createElementVNode("div",yp,[e.showFilters?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFilter||Ye),{key:0,externalFilterPayload:f.externalFilterPayload,preFiltered:f.preFiltered},null,8,["externalFilterPayload","preFiltered"])):o.createCommentVNode("",!0),e.showAddButton?(o.openBlock(),o.createBlock(Xe,{key:1})):o.createCommentVNode("",!0),e.showPagination?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listPagination||dt),{key:2,class:"ml-auto"})):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[e.entityName?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",kp,[o.createElementVNode("p",wp,[S[0]||(S[0]=o.createTextVNode(" Error: Missing required props - ")),e.entityName?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",vp,"Entity Name"))])])),o.createElementVNode("div",null,[o.createElementVNode("div",xp,[e.showToolBar=="top"&&(e.showFilters||e.showAddButton||e.showPagination)?(o.openBlock(),o.createElementBlock("div",Sp,[o.createElementVNode("div",Cp,[e.showFilters?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFilter||Ye),{key:0,externalFilterPayload:f.externalFilterPayload,preFiltered:f.preFiltered},null,8,["externalFilterPayload","preFiltered"])):o.createCommentVNode("",!0),e.showAddButton?(o.openBlock(),o.createBlock(Xe,{key:1})):o.createCommentVNode("",!0),e.showPagination?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listPagination||dt),{key:2,class:"ml-auto"})):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)]),e.showPresets?(o.openBlock(),o.createElementBlock("div",Ep,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(p.value,P=>(o.openBlock(),o.createElementBlock("button",{key:P,onClick:M=>{h.value=P.name,k(P.name)},class:o.normalizeClass(["bg-blue-100 text-blue-700 px-4 py-2 rounded-full text-sm",["px-4 py-2 rounded-full text-sm",h.value===P.name?"bg-blue-800 text-white":"bg-blue-100 text-blue-700"]])},o.toDisplayString(P.name),11,Bp))),128))])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(m.value,(P,M)=>(o.openBlock(),o.createElementBlock("div",{key:M},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listItemDisplay!=null&&e.listItemDisplay!=""?e.listItemDisplay:Jm),o.mergeProps({key:P,preFiltered:f.preFiltered,ref_for:!0},{item:P,...f}),null,16,["preFiltered"]))]))),128)),e.showToolBar=="bottom"&&(e.showFilters||e.showAddButton||e.showPagination)?(o.openBlock(),o.createElementBlock("div",$p,[o.createElementVNode("div",Np,[e.showFilters?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFilter||Ye),{key:0,externalFilterPayload:f.externalFilterPayload,preFiltered:f.preFiltered},null,8,["externalFilterPayload","preFiltered"])):o.createCommentVNode("",!0),e.showAddButton?(o.openBlock(),o.createBlock(Xe,{key:1})):o.createCommentVNode("",!0),e.showPagination?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listPagination||dt),{key:2,class:"ml-auto"})):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)]),o.renderSlot(w.$slots,"footer",{},void 0,!0)],64)),o.renderSlot(w.$slots,"footer",{},void 0,!0)],16)):(o.openBlock(),o.createElementBlock("p",Op,"You do not have the required permissions to access this feature."))}}},[["__scopeId","data-v-31c3fe68"]]),Tp={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col"},Vp={class:"flex justify-between items-start gap-4"},Ip={class:"flex-grow"},Fp={class:"flex flex-col gap-2"},Pp={class:"font-bold text-gray-700"},Rp={class:"text-gray-600"},Dp={class:"flex flex-col gap-2"},_p=Ie({__name:"EntityListingTileSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean},setup(e){const t=e,n=o.inject("entityObject"),r=o.ref([]),a=o.ref(null),i=o.ref(null),l=o.ref(!1),s=o.ref(!1);o.onMounted(()=>{r.value=n.getEntityColumns(n.state.data),a.value=r.value.find(m=>m.name===t.displayField)||null,a.value&&(i.value=t.item[a.value.name])});const d=()=>{l.value=!0},c=()=>{s.value=!0},u=async m=>{m.remove?f():l.value=!1},f=async()=>{const m=n.getPrimaryKeyColumn(n.state.data),p=t.item[m.name],g=await n.entityRecordDelete(n.state.data,p);if(g!=null&&g.success){l.value=!1;const h=await n.searchRecord(n.state.data,{sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch});h!=null&&h.response&&n.setEntity(h.response)}};return(m,p)=>{const g=o.resolveComponent("Button");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",Tp,[o.createElementVNode("div",Vp,[o.createElementVNode("div",Ip,[o.createElementVNode("div",Fp,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(h,b)=>(o.openBlock(),o.createElementBlock("div",{key:b,class:"flex flex-col"},[o.createElementVNode("span",Pp,o.toDisplayString(h.displayName||h.name)+":",1),o.createElementVNode("span",Rp,o.toDisplayString(e.item[h.name]),1)]))),128))])]),o.createElementVNode("div",Dp,[e.editable?(o.openBlock(),o.createBlock(g,{key:0,onClick:p[0]||(p[0]=h=>c()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):o.createCommentVNode("",!0),e.deletable?(o.openBlock(),o.createBlock(g,{key:1,onClick:p[1]||(p[1]=h=>d()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):o.createCommentVNode("",!0)])])]),s.value?(o.openBlock(),o.createBlock(pn,{key:0,showEntityForm:s.value,"onUpdate:showEntityForm":p[2]||(p[2]=h=>s.value=h),item:e.item},null,8,["showEntityForm","item"])):o.createCommentVNode("",!0),l.value?(o.openBlock(),o.createBlock(fo,{key:1,showDeleteDialog:l.value,"onUpdate:showDeleteDialog":p[3]||(p[3]=h=>l.value=h),onOnDeleteItem:u},null,8,["showDeleteDialog"])):o.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-c78e676f"]]),Ap={class:"flex flex-wrap gap-4 p-2"},Lp={key:0,class:"error-message"},zp={class:"text-red-500 font-bold"},Mp={key:0},jp={key:1},Up={class:"flex flex-wrap gap-4 p-4"},Si=Ie({__name:"EntityListingTile",props:{entityName:String,listDisplay:String,listItemDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,showAddButton:Boolean,showFilters:Boolean,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean,dynamicPropName:{type:String,default:"item"}},setup(e,{expose:t}){const n=uo(),r=Oe();o.provide("entityObject",n);const a=e,i=o.ref([]);return o.watch(()=>n.state.data,d=>{d&&(i.value=d.result)},{immediate:!0}),t({props:a,reload:()=>{console.log("reload data")},filter:()=>{console.log("filter data in unordered")}}),o.watch(()=>r.globalConfigs.appId,async d=>{if(d){const c=await n.getEntity(a.entityName);n.setEntity(c.success?c.response:{result:[]})}},{immediate:!0}),(d,c)=>{var u,f,m;return o.openBlock(),o.createElementBlock("div",o.normalizeProps(o.guardReactiveProps(d.$attrs)),[d.$slots["list-item-display-tile"]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.renderSlot(d.$slots,"header",{},void 0,!0),e.showAddButton?(o.openBlock(),o.createBlock(Xe,{key:0})):o.createCommentVNode("",!0),e.showFilters?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFilter||Ye),{key:1})):o.createCommentVNode("",!0),o.createElementVNode("div",Ap,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(((m=(f=(u=o.unref(n))==null?void 0:u.state)==null?void 0:f.data)==null?void 0:m.result)||[],(p,g)=>(o.openBlock(),o.createElementBlock("div",{key:g,class:"flex flex-col p-6 border border-gray-300 shadow-md rounded-lg bg-white w-full sm:w-1/2 md:w-1/3 lg:w-1/4 xl:w-1/5 2xl:w-1/8"},[o.renderSlot(d.$slots,"list-item-display-tile",o.normalizeProps({[e.dynamicPropName||""]:p}),void 0,!0)]))),128))]),o.renderSlot(d.$slots,"footer",{},void 0,!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.renderSlot(d.$slots,"header",{},void 0,!0),e.entityName?(o.openBlock(),o.createElementBlock("div",jp,[e.showFilters?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listFilter||Ye),{key:0})):o.createCommentVNode("",!0),e.showAddButton?(o.openBlock(),o.createBlock(Xe,{key:1})):o.createCommentVNode("",!0),o.createElementVNode("div",Up,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.value,(p,g)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listItemDisplay!=null&&e.listItemDisplay!=""?e.listItemDisplay:_p),o.mergeProps({key:g,ref_for:!0},{item:p,...a}),null,16))),128))]),e.showPagination?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(e.listPagination||dt),{key:2})):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",Lp,[o.createElementVNode("p",zp,[c[0]||(c[0]=o.createTextVNode(" Error: Missing required props - ")),e.entityName?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("span",Mp,"Entity Name"))])])),o.renderSlot(d.$slots,"footer",{},void 0,!0)],64))],16)}}},[["__scopeId","data-v-037944bc"]]),Hp={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col responsive-box"},Wp={class:"flex justify-between items-start gap-4"},qp={class:"flex-grow"},Kp={class:"flex flex-col gap-2"},Gp={class:"font-bold text-gray-700"},Yp={class:"text-gray-600"},Xp={class:"flex flex-col gap-2"},Jp=Ie({__name:"EntityListingCarouselSingleRecord",props:{item:Object,entityName:String,showAddButton:Boolean,showFilters:Boolean,className:String,listDisplay:String,listHeader:String,listFooter:String,listFilter:String,listPagination:String,listItemDisplay:String,listHeaderSlot:Boolean,showPagination:Boolean,className:{type:String,default:"default-class"},editable:Boolean,deletable:Boolean,numberVisible:{type:Number,default:3}},setup(e){const t=e,n=o.inject("entityObject"),r=o.ref([]),a=o.ref(null),i=o.ref(null),l=o.ref(!1),s=o.ref(!1);o.onMounted(()=>{r.value=n.getEntityColumns(n.state.data),a.value=r.value.find(m=>m.name===t.displayField)||null,a.value&&(i.value=t.item[a.value.name])});const d=()=>{l.value=!0},c=()=>{s.value=!0},u=async m=>{m.remove?f():l.value=!1},f=async()=>{const m=n.getPrimaryKeyColumn(n.state.data),p=t.item[m.name],g=await n.entityRecordDelete(n.state.data,p);if(g!=null&&g.success){l.value=!1;const h=await n.searchRecord(n.state.data,{sortBy:n.state.data.sortBy,sortDirection:n.state.data.sortDirection,pageSize:n.state.data.pageSize,currentPage:n.state.data.currentPage,columnList:null,filter:n.state.data.filters,fullTextSearch:n.state.data.fullTextSearch});h!=null&&h.response&&n.setEntity(h.response)}};return(m,p)=>{const g=o.resolveComponent("Button");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",Hp,[o.createElementVNode("div",Wp,[o.createElementVNode("div",qp,[o.createElementVNode("div",Kp,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.value,(h,b)=>(o.openBlock(),o.createElementBlock("div",{key:b,class:"flex flex-col"},[o.createElementVNode("span",Gp,o.toDisplayString(h.displayName||h.name)+":",1),o.createElementVNode("span",Yp,o.toDisplayString(e.item[h.name]),1)]))),128))])]),o.createElementVNode("div",Xp,[e.editable?(o.openBlock(),o.createBlock(g,{key:0,onClick:p[0]||(p[0]=h=>c()),icon:"pi pi-pencil",severity:"success",rounded:"","aria-label":"Edit"})):o.createCommentVNode("",!0),e.deletable?(o.openBlock(),o.createBlock(g,{key:1,onClick:p[1]||(p[1]=h=>d()),icon:"pi pi-trash",severity:"danger",rounded:"","aria-label":"Delete"})):o.createCommentVNode("",!0)])])]),s.value?(o.openBlock(),o.createBlock(pn,{key:0,showEntityForm:s.value,"onUpdate:showEntityForm":p[2]||(p[2]=h=>s.value=h),item:e.item},null,8,["showEntityForm","item"])):o.createCommentVNode("",!0),l.value?(o.openBlock(),o.createBlock(fo,{key:1,showDeleteDialog:l.value,"onUpdate:showDeleteDialog":p[3]||(p[3]=h=>l.value=h),onOnDeleteItem:u},null,8,["showDeleteDialog"])):o.createCommentVNode("",!0)],64)}}},[["__scopeId","data-v-309b76fb"]]);function Qp(e,t){return e?e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className):!1}function Zp(e,t){if(e&&t){const n=r=>{Qp(e,r)||(e.classList?e.classList.add(r):e.className+=" "+r)};[t].flat().filter(Boolean).forEach(r=>r.split(" ").forEach(n))}}function po(e){for(const t of document==null?void 0:document.styleSheets)try{for(const n of t==null?void 0:t.cssRules)for(const r of n==null?void 0:n.style)if(e.test(r))return{name:r,value:n.style.getPropertyValue(r).trim()}}catch{}return null}function dr(e,t){if(e&&t){const n=r=>{e.classList?e.classList.remove(r):e.className=e.className.replace(new RegExp("(^|\\b)"+r.split(" ").join("|")+"(\\b|$)","gi")," ")};[t].flat().filter(Boolean).forEach(r=>r.split(" ").forEach(n))}}function Ci(e){let t={width:0,height:0};return e&&(e.style.visibility="hidden",e.style.display="block",t.width=e.offsetWidth,t.height=e.offsetHeight,e.style.display="none",e.style.visibility="visible"),t}function Ei(){let e=window,t=document,n=t.documentElement,r=t.getElementsByTagName("body")[0],a=e.innerWidth||n.clientWidth||r.clientWidth,i=e.innerHeight||n.clientHeight||r.clientHeight;return{width:a,height:i}}function eg(){let e=document.documentElement;return(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}function tg(){let e=document.documentElement;return(window.pageYOffset||e.scrollTop)-(e.clientTop||0)}function ng(e,t,n=!0){var r,a,i,l;if(e){const s=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:Ci(e),d=s.height,c=s.width,u=t.offsetHeight,f=t.offsetWidth,m=t.getBoundingClientRect(),p=tg(),g=eg(),h=Ei();let b,y,v="top";m.top+u+d>h.height?(b=m.top+p-d,v="bottom",b<0&&(b=p)):b=u+m.top+p,m.left+c>h.width?y=Math.max(0,m.left+g+f-c):y=m.left+g,e.style.top=b+"px",e.style.left=y+"px",e.style.transformOrigin=v,n&&(e.style.marginTop=v==="bottom"?`calc(${(a=(r=po(/-anchor-gutter$/))==null?void 0:r.value)!=null?a:"2px"} * -1)`:(l=(i=po(/-anchor-gutter$/))==null?void 0:i.value)!=null?l:"")}}function og(e,t){e&&(typeof t=="string"?e.style.cssText=t:Object.entries(t).forEach(([n,r])=>e.style[n]=r))}function Bi(e,t){return e instanceof HTMLElement?e.offsetWidth:0}function rg(e,t,n=!0){var r,a,i,l;if(e){const s=e.offsetParent?{width:e.offsetWidth,height:e.offsetHeight}:Ci(e),d=t.offsetHeight,c=t.getBoundingClientRect(),u=Ei();let f,m,p="top";c.top+d+s.height>u.height?(f=-1*s.height,p="bottom",c.top+f<0&&(f=-1*c.top)):f=d,s.width>u.width?m=c.left*-1:c.left+s.width>u.width?m=(c.left+s.width-u.width)*-1:m=0,e.style.top=f+"px",e.style.left=m+"px",e.style.transformOrigin=p,n&&(e.style.marginTop=p==="bottom"?`calc(${(a=(r=po(/-anchor-gutter$/))==null?void 0:r.value)!=null?a:"2px"} * -1)`:(l=(i=po(/-anchor-gutter$/))==null?void 0:i.value)!=null?l:"")}}function hn(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e!==null&&e.nodeType===1&&typeof e.nodeName=="string"}function go(e,t={}){if(hn(e)){const n=(r,a)=>{var i,l;const s=(i=e==null?void 0:e.$attrs)!=null&&i[r]?[(l=e==null?void 0:e.$attrs)==null?void 0:l[r]]:[];return[a].flat().reduce((d,c)=>{if(c!=null){const u=typeof c;if(u==="string"||u==="number")d.push(c);else if(u==="object"){const f=Array.isArray(c)?n(r,c):Object.entries(c).map(([m,p])=>r==="style"&&(p||p===0)?`${m.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${p}`:p?m:void 0);d=f.length?d.concat(f.filter(m=>!!m)):d}}return d},s)};Object.entries(t).forEach(([r,a])=>{if(a!=null){const i=r.match(/^on(.+)/);i?e.addEventListener(i[1].toLowerCase(),a):r==="p-bind"||r==="pBind"?go(e,a):(a=r==="class"?[...new Set(n("class",a))].join(" ").trim():r==="style"?n("style",a).join(";").trim():a,(e.$attrs=e.$attrs||{})&&(e.$attrs[r]=a),e.setAttribute(r,a))}})}}function ag(e,t={},...n){{const r=document.createElement(e);return go(r,t),r.append(...n),r}}function ig(e,t){return hn(e)?Array.from(e.querySelectorAll(t)):[]}function ho(e,t){return hn(e)?e.matches(t)?e:e.querySelector(t):null}function $t(e,t){e&&document.activeElement!==e&&e.focus(t)}function lg(e,t){if(hn(e)){const n=e.getAttribute(t);return isNaN(n)?n==="true"||n==="false"?n==="true":n:+n}}function ur(e,t=""){let n=ig(e,`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
24
24
|
[href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
25
25
|
input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
26
26
|
select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
27
27
|
textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
28
28
|
[tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t},
|
|
29
|
-
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}`),r=[];for(let a of n)getComputedStyle(a).display!="none"&&getComputedStyle(a).visibility!="hidden"&&r.push(a);return r}function sg(e,t){const n=ur(e,t);return n.length>0?n[0]:null}function jt(e){if(e){let t=e.offsetHeight,n=getComputedStyle(e);return t-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),t}return 0}function $i(e){if(e){let t=e.parentNode;return t&&t instanceof ShadowRoot&&t.host&&(t=t.host),t}return null}function cg(e,t){const n=ur(e,t);return n.length>0?n[n.length-1]:null}function dg(e){if(e){let t=e.getBoundingClientRect();return{top:t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:t.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}return{top:"auto",left:"auto"}}function ug(e,t){return e?e.offsetHeight:0}function Ni(e,t=[]){const n=$i(e);return n===null?t:Ni(n,t.concat([n]))}function fg(e){let t=[];if(e){let n=Ni(e);const r=/(auto|scroll)/,a=i=>{try{let l=window.getComputedStyle(i,null);return r.test(l.getPropertyValue("overflow"))||r.test(l.getPropertyValue("overflowX"))||r.test(l.getPropertyValue("overflowY"))}catch{return!1}};for(let i of n){let l=i.nodeType===1&&i.dataset.scrollselectors;if(l){let s=l.split(",");for(let d of s){let c=ho(i,d);c&&a(c)&&t.push(c)}}i.nodeType!==9&&a(i)&&t.push(i)}}return t}function mg(e){return!!(e!==null&&typeof e<"u"&&e.nodeName&&$i(e))}function Ut(e){if(e){let t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth),t}return 0}function pg(){return/(android)/i.test(navigator.userAgent)}function fr(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function bo(e){return!!(e&&e.offsetParent!=null)}function gg(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function hg(e,t="",n){hn(e)&&n!==null&&n!==void 0&&e.setAttribute(t,n)}function mr(){const e=new Map;return{on(t,n){let r=e.get(t);return r?r.push(n):r=[n],e.set(t,r),this},off(t,n){let r=e.get(t);return r&&r.splice(r.indexOf(n)>>>0,1),this},emit(t,n){let r=e.get(t);r&&r.slice().map(a=>{a(n)})},clear(){e.clear()}}}var bg=Object.defineProperty,yg=Object.defineProperties,kg=Object.getOwnPropertyDescriptors,yo=Object.getOwnPropertySymbols,Oi=Object.prototype.hasOwnProperty,Ti=Object.prototype.propertyIsEnumerable,Vi=(e,t,n)=>t in e?bg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ve=(e,t)=>{for(var n in t||(t={}))Oi.call(t,n)&&Vi(e,n,t[n]);if(yo)for(var n of yo(t))Ti.call(t,n)&&Vi(e,n,t[n]);return e},en=(e,t)=>yg(e,kg(t)),vt=(e,t)=>{var n={};for(var r in e)Oi.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yo)for(var r of yo(e))t.indexOf(r)<0&&Ti.call(e,r)&&(n[r]=e[r]);return n},wg=mr(),xt=wg;function Ii(e,t){co(e)?e.push(...t||[]):ct(e)&&Object.assign(e,t)}function vg(e){return ct(e)&&e.hasOwnProperty("value")&&e.hasOwnProperty("type")?e.value:e}function xg(e){return e.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}function pr(e="",t=""){return xg(`${ze(e,!1)&&ze(t,!1)?`${e}-`:e}${t}`)}function Fi(e="",t=""){return`--${pr(e,t)}`}function Sg(e=""){const t=(e.match(/{/g)||[]).length,n=(e.match(/}/g)||[]).length;return(t+n)%2!==0}function Pi(e,t="",n="",r=[],a){if(ze(e)){const i=/{([^}]*)}/g,l=e.trim();if(Sg(l))return;if(kt(l,i)){const s=l.replaceAll(i,u=>{const m=u.replace(/{|}/g,"").split(".").filter(p=>!r.some(g=>kt(p,g)));return`var(${Fi(n,ni(m.join("-")))}${de(a)?`, ${a}`:""})`}),d=/(\d+\s+[\+\-\*\/]\s+\d+)/g,c=/var\([^)]+\)/g;return kt(s.replace(c,"0"),d)?`calc(${s})`:s}return l}else if(xu(e))return e}function Cg(e,t,n){ze(t,!1)&&e.push(`${t}:${n};`)}function tn(e,t){return e?`${e}{${t}}`:""}var bn=(...e)=>Eg(pe.getTheme(),...e),Eg=(e={},t,n,r)=>{if(t){const{variable:a,options:i}=pe.defaults||{},{prefix:l,transform:s}=(e==null?void 0:e.options)||i||{},c=kt(t,/{([^}]*)}/g)?t:`{${t}}`;return r==="value"||Lt(r)&&s==="strict"?pe.getTokenValue(t):Pi(c,void 0,l,[a.excludedKeyRegex],n)}return""},Ri=(e={})=>{let{preset:t,options:n}=e;return{preset(r){return t=t?ti(t,r):r,this},options(r){return n=n?ve(ve({},n),r):r,this},primaryPalette(r){const{semantic:a}=t||{};return t=en(ve({},t),{semantic:en(ve({},a),{primary:r})}),this},surfacePalette(r){var a,i;const{semantic:l}=t||{},s=r!=null&&r.hasOwnProperty("light")?r==null?void 0:r.light:r,d=r!=null&&r.hasOwnProperty("dark")?r==null?void 0:r.dark:r,c={colorScheme:{light:ve(ve({},(a=l==null?void 0:l.colorScheme)==null?void 0:a.light),!!s&&{surface:s}),dark:ve(ve({},(i=l==null?void 0:l.colorScheme)==null?void 0:i.dark),!!d&&{surface:d})}};return t=en(ve({},t),{semantic:ve(ve({},l),c)}),this},define({useDefaultPreset:r=!1,useDefaultOptions:a=!1}={}){return{preset:r?pe.getPreset():t,options:a?pe.getOptions():n}},update({mergePresets:r=!0,mergeOptions:a=!0}={}){const i={preset:r?ti(pe.getPreset(),t):t,options:a?ve(ve({},pe.getOptions()),n):n};return pe.setTheme(i),i},use(r){const a=this.define(r);return pe.setTheme(a),a}}};function Bg(e,t={}){const n=pe.defaults.variable,{prefix:r=n.prefix,selector:a=n.selector,excludedKeyRegex:i=n.excludedKeyRegex}=t,l=(c,u="")=>Object.entries(c).reduce((f,[m,p])=>{const g=kt(m,i)?pr(u):pr(u,ni(m)),h=vg(p);if(ct(h)){const{variables:b,tokens:y}=l(h,g);Ii(f.tokens,y),Ii(f.variables,b)}else f.tokens.push((r?g.replace(`${r}-`,""):g).replaceAll("-",".")),Cg(f.variables,Fi(g),Pi(h,g,r,[i]));return f},{variables:[],tokens:[]}),{variables:s,tokens:d}=l(e,r);return{value:s,tokens:d,declarations:s.join(""),css:tn(a,s.join(""))}}var nt={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(e){return{type:"class",selector:e,matched:this.pattern.test(e.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(e){return{type:"attr",selector:`:root${e}`,matched:this.pattern.test(e.trim())}}},media:{pattern:/^@media (.*)$/,resolve(e){return{type:"media",selector:`${e}{:root{[CSS]}}`,matched:this.pattern.test(e.trim())}}},system:{pattern:/^system$/,resolve(e){return{type:"system",selector:"@media (prefers-color-scheme: dark){:root{[CSS]}}",matched:this.pattern.test(e.trim())}}},custom:{resolve(e){return{type:"custom",selector:e,matched:!0}}}},resolve(e){const t=Object.keys(this.rules).filter(n=>n!=="custom").map(n=>this.rules[n]);return[e].flat().map(n=>{var r;return(r=t.map(a=>a.resolve(n)).find(a=>a.matched))!=null?r:this.rules.custom.resolve(n)})}},_toVariables(e,t){return Bg(e,{prefix:t==null?void 0:t.prefix})},getCommon({name:e="",theme:t={},params:n,set:r,defaults:a}){var i,l,s,d,c,u,f;const{preset:m,options:p}=t;let g,h,b,y,v,x,E;if(de(m)&&p.transform!=="strict"){const{primitive:N,semantic:$,extend:C}=m,k=$||{},{colorScheme:w}=k,S=vt(k,["colorScheme"]),B=C||{},{colorScheme:I}=B,D=vt(B,["colorScheme"]),P=w||{},{dark:M}=P,j=vt(P,["dark"]),q=I||{},{dark:F}=q,V=vt(q,["dark"]),_=de(N)?this._toVariables({primitive:N},p):{},J=de(S)?this._toVariables({semantic:S},p):{},re=de(j)?this._toVariables({light:j},p):{},ae=de(M)?this._toVariables({dark:M},p):{},Y=de(D)?this._toVariables({semantic:D},p):{},Q=de(V)?this._toVariables({light:V},p):{},le=de(F)?this._toVariables({dark:F},p):{},[ce,xe]=[(i=_.declarations)!=null?i:"",_.tokens],[He,Re]=[(l=J.declarations)!=null?l:"",J.tokens||[]],[rt,Je]=[(s=re.declarations)!=null?s:"",re.tokens||[]],[H,z]=[(d=ae.declarations)!=null?d:"",ae.tokens||[]],[fe,ge]=[(c=Y.declarations)!=null?c:"",Y.tokens||[]],[me,he]=[(u=Q.declarations)!=null?u:"",Q.tokens||[]],[Ee,Me]=[(f=le.declarations)!=null?f:"",le.tokens||[]];g=this.transformCSS(e,ce,"light","variable",p,r,a),h=xe;const ft=this.transformCSS(e,`${He}${rt}`,"light","variable",p,r,a),Ve=this.transformCSS(e,`${H}`,"dark","variable",p,r,a);b=`${ft}${Ve}`,y=[...new Set([...Re,...Je,...z])];const je=this.transformCSS(e,`${fe}${me}color-scheme:light`,"light","variable",p,r,a),Qe=this.transformCSS(e,`${Ee}color-scheme:dark`,"dark","variable",p,r,a);v=`${je}${Qe}`,x=[...new Set([...ge,...he,...Me])],E=Ke(m.css,{dt:bn})}return{primitive:{css:g,tokens:h},semantic:{css:b,tokens:y},global:{css:v,tokens:x},style:E}},getPreset({name:e="",preset:t={},options:n,params:r,set:a,defaults:i,selector:l}){var s,d,c;let u,f,m;if(de(t)&&n.transform!=="strict"){const p=e.replace("-directive",""),g=t,{colorScheme:h,extend:b,css:y}=g,v=vt(g,["colorScheme","extend","css"]),x=b||{},{colorScheme:E}=x,N=vt(x,["colorScheme"]),$=h||{},{dark:C}=$,k=vt($,["dark"]),w=E||{},{dark:S}=w,B=vt(w,["dark"]),I=de(v)?this._toVariables({[p]:ve(ve({},v),N)},n):{},D=de(k)?this._toVariables({[p]:ve(ve({},k),B)},n):{},P=de(C)?this._toVariables({[p]:ve(ve({},C),S)},n):{},[M,j]=[(s=I.declarations)!=null?s:"",I.tokens||[]],[q,F]=[(d=D.declarations)!=null?d:"",D.tokens||[]],[V,_]=[(c=P.declarations)!=null?c:"",P.tokens||[]],J=this.transformCSS(p,`${M}${q}`,"light","variable",n,a,i,l),re=this.transformCSS(p,V,"dark","variable",n,a,i,l);u=`${J}${re}`,f=[...new Set([...j,...F,..._])],m=Ke(y,{dt:bn})}return{css:u,tokens:f,style:m}},getPresetC({name:e="",theme:t={},params:n,set:r,defaults:a}){var i;const{preset:l,options:s}=t,d=(i=l==null?void 0:l.components)==null?void 0:i[e];return this.getPreset({name:e,preset:d,options:s,params:n,set:r,defaults:a})},getPresetD({name:e="",theme:t={},params:n,set:r,defaults:a}){var i;const l=e.replace("-directive",""),{preset:s,options:d}=t,c=(i=s==null?void 0:s.directives)==null?void 0:i[l];return this.getPreset({name:l,preset:c,options:d,params:n,set:r,defaults:a})},applyDarkColorScheme(e){return!(e.darkModeSelector==="none"||e.darkModeSelector===!1)},getColorSchemeOption(e,t){var n;return this.applyDarkColorScheme(e)?this.regex.resolve(e.darkModeSelector===!0?t.options.darkModeSelector:(n=e.darkModeSelector)!=null?n:t.options.darkModeSelector):[]},getLayerOrder(e,t={},n,r){const{cssLayer:a}=t;return a?`@layer ${Ke(a.order||"primeui",n)}`:""},getCommonStyleSheet({name:e="",theme:t={},params:n,props:r={},set:a,defaults:i}){const l=this.getCommon({name:e,theme:t,params:n,set:a,defaults:i}),s=Object.entries(r).reduce((d,[c,u])=>d.push(`${c}="${u}"`)&&d,[]).join(" ");return Object.entries(l||{}).reduce((d,[c,u])=>{if(u!=null&&u.css){const f=mn(u==null?void 0:u.css),m=`${c}-variables`;d.push(`<style type="text/css" data-primevue-style-id="${m}" ${s}>${f}</style>`)}return d},[]).join("")},getStyleSheet({name:e="",theme:t={},params:n,props:r={},set:a,defaults:i}){var l;const s={name:e,theme:t,params:n,set:a,defaults:i},d=(l=e.includes("-directive")?this.getPresetD(s):this.getPresetC(s))==null?void 0:l.css,c=Object.entries(r).reduce((u,[f,m])=>u.push(`${f}="${m}"`)&&u,[]).join(" ");return d?`<style type="text/css" data-primevue-style-id="${e}-variables" ${c}>${mn(d)}</style>`:""},createTokens(e={},t,n="",r="",a={}){return Object.entries(e).forEach(([i,l])=>{const s=kt(i,t.variable.excludedKeyRegex)?n:n?`${n}.${oi(i)}`:oi(i),d=r?`${r}.${i}`:i;ct(l)?this.createTokens(l,t,s,d,a):(a[s]||(a[s]={paths:[],computed(c,u={}){var f,m;return this.paths.length===1?(f=this.paths[0])==null?void 0:f.computed(this.paths[0].scheme,u.binding):c&&c!=="none"?(m=this.paths.find(p=>p.scheme===c))==null?void 0:m.computed(c,u.binding):this.paths.map(p=>p.computed(p.scheme,u[p.scheme]))}}),a[s].paths.push({path:d,value:l,scheme:d.includes("colorScheme.light")?"light":d.includes("colorScheme.dark")?"dark":"none",computed(c,u={}){const f=/{([^}]*)}/g;let m=l;if(u.name=this.path,u.binding||(u.binding={}),kt(l,f)){const g=l.trim().replaceAll(f,y=>{var v;const x=y.replace(/{|}/g,""),E=(v=a[x])==null?void 0:v.computed(c,u);return co(E)&&E.length===2?`light-dark(${E[0].value},${E[1].value})`:E==null?void 0:E.value}),h=/(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g,b=/var\([^)]+\)/g;m=kt(g.replace(b,"0"),h)?`calc(${g})`:g}return Lt(u.binding)&&delete u.binding,{colorScheme:c,path:this.path,paths:u,value:m.includes("undefined")?void 0:m}}}))}),a},getTokenValue(e,t,n){var r;const i=(d=>d.split(".").filter(u=>!kt(u.toLowerCase(),n.variable.excludedKeyRegex)).join("."))(t),l=t.includes("colorScheme.light")?"light":t.includes("colorScheme.dark")?"dark":void 0,s=[(r=e[i])==null?void 0:r.computed(l)].flat().filter(d=>d);return s.length===1?s[0].value:s.reduce((d={},c)=>{const u=c,{colorScheme:f}=u,m=vt(u,["colorScheme"]);return d[f]=m,d},void 0)},getSelectorRule(e,t,n,r){return n==="class"||n==="attr"?tn(de(t)?`${e}${t},${e} ${t}`:e,r):tn(e,de(t)?tn(t,r):r)},transformCSS(e,t,n,r,a={},i,l,s){if(de(t)){const{cssLayer:d}=a;if(r!=="style"){const c=this.getColorSchemeOption(a,l);t=n==="dark"?c.reduce((u,{type:f,selector:m})=>(de(m)&&(u+=m.includes("[CSS]")?m.replace("[CSS]",t):this.getSelectorRule(m,s,f,t)),u),""):tn(s??":root",t)}if(d){const c={name:"primeui",order:"primeui"};ct(d)&&(c.name=Ke(d.name,{name:e,type:r})),de(c.name)&&(t=tn(`@layer ${c.name}`,t),i==null||i.layerNames(c.name))}return t}return""}},pe={defaults:{variable:{prefix:"p",selector:":root",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(e={}){const{theme:t}=e;t&&(this._theme=en(ve({},t),{options:ve(ve({},this.defaults.options),t.options)}),this._tokens=nt.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var e;return((e=this.theme)==null?void 0:e.preset)||{}},get options(){var e;return((e=this.theme)==null?void 0:e.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(e){this.update({theme:e}),xt.emit("theme:change",e)},getPreset(){return this.preset},setPreset(e){this._theme=en(ve({},this.theme),{preset:e}),this._tokens=nt.createTokens(e,this.defaults),this.clearLoadedStyleNames(),xt.emit("preset:change",e),xt.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(e){this._theme=en(ve({},this.theme),{options:e}),this.clearLoadedStyleNames(),xt.emit("options:change",e),xt.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(e){this._layerNames.add(e)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(e){return this._loadedStyleNames.has(e)},setLoadedStyleName(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(e){return nt.getTokenValue(this.tokens,e,this.defaults)},getCommon(e="",t){return nt.getCommon({name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(e="",t){const n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return nt.getPresetC(n)},getDirective(e="",t){const n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return nt.getPresetD(n)},getCustomPreset(e="",t,n,r){const a={name:e,preset:t,options:this.options,selector:n,params:r,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return nt.getPreset(a)},getLayerOrderCSS(e=""){return nt.getLayerOrder(e,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(e="",t,n="style",r){return nt.transformCSS(e,t,r,n,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(e="",t,n={}){return nt.getCommonStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(e,t,n={}){return nt.getStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(e){this._loadingStyles.add(e)},onStyleUpdated(e){this._loadingStyles.add(e)},onStyleLoaded(e,{name:t}){this._loadingStyles.size&&(this._loadingStyles.delete(t),xt.emit(`theme:${t}:load`,e),!this._loadingStyles.size&&xt.emit("theme:load"))}};function $g(e){return Ri().surfacePalette(e).update().preset}var ko={};function gr(e="pui_id_"){return ko.hasOwnProperty(e)||(ko[e]=0),ko[e]++,`${e}${ko[e]}`}var Nt={_loadedStyleNames:new Set,getLoadedStyleNames:function(){return this._loadedStyleNames},isStyleNameLoaded:function(t){return this._loadedStyleNames.has(t)},setLoadedStyleName:function(t){this._loadedStyleNames.add(t)},deleteLoadedStyleName:function(t){this._loadedStyleNames.delete(t)},clearLoadedStyleNames:function(){this._loadedStyleNames.clear()}};function yn(e){"@babel/helpers - typeof";return yn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yn(e)}function Di(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _i(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Di(Object(n),!0).forEach(function(r){Ng(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Di(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ng(e,t,n){return(t=Og(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Og(e){var t=Tg(e,"string");return yn(t)=="symbol"?t:t+""}function Tg(e,t){if(yn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(yn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;o.getCurrentInstance()?o.onMounted(e):t?e():o.nextTick(e)}var Ig=0;function Fg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=o.ref(!1),r=o.ref(e),a=o.ref(null),i=fr()?window.document:void 0,l=t.document,s=l===void 0?i:l,d=t.immediate,c=d===void 0?!0:d,u=t.manual,f=u===void 0?!1:u,m=t.name,p=m===void 0?"style_".concat(++Ig):m,g=t.id,h=g===void 0?void 0:g,b=t.media,y=b===void 0?void 0:b,v=t.nonce,x=v===void 0?void 0:v,E=t.first,N=E===void 0?!1:E,$=t.onMounted,C=$===void 0?void 0:$,k=t.onUpdated,w=k===void 0?void 0:k,S=t.onLoad,B=S===void 0?void 0:S,I=t.props,D=I===void 0?{}:I,P=function(){},M=function(F){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s){var _=_i(_i({},D),V),J=_.name||p,re=_.id||h,ae=_.nonce||x;a.value=s.querySelector('style[data-primevue-style-id="'.concat(J,'"]'))||s.getElementById(re)||s.createElement("style"),a.value.isConnected||(r.value=F||e,go(a.value,{type:"text/css",id:re,media:y,nonce:ae}),N?s.head.prepend(a.value):s.head.appendChild(a.value),hg(a.value,"data-primevue-style-id",J),go(a.value,_),a.value.onload=function(Y){return B==null?void 0:B(Y,{name:J})},C==null||C(J)),!n.value&&(P=o.watch(r,function(Y){a.value.textContent=Y,w==null||w(J)},{immediate:!0}),n.value=!0)}},j=function(){!s||!n.value||(P(),mg(a.value)&&s.head.removeChild(a.value),n.value=!1)};return c&&!f&&Vg(M),{id:h,name:p,el:a,css:r,unload:j,load:M,isLoaded:o.readonly(n)}}function kn(e){"@babel/helpers - typeof";return kn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kn(e)}function Ai(e,t){return _g(e)||Dg(e,t)||Rg(e,t)||Pg()}function Pg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
29
|
+
[contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${t}`),r=[];for(let a of n)getComputedStyle(a).display!="none"&&getComputedStyle(a).visibility!="hidden"&&r.push(a);return r}function sg(e,t){const n=ur(e,t);return n.length>0?n[0]:null}function jt(e){if(e){let t=e.offsetHeight,n=getComputedStyle(e);return t-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),t}return 0}function $i(e){if(e){let t=e.parentNode;return t&&t instanceof ShadowRoot&&t.host&&(t=t.host),t}return null}function cg(e,t){const n=ur(e,t);return n.length>0?n[n.length-1]:null}function dg(e){if(e){let t=e.getBoundingClientRect();return{top:t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:t.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}return{top:"auto",left:"auto"}}function ug(e,t){return e?e.offsetHeight:0}function Ni(e,t=[]){const n=$i(e);return n===null?t:Ni(n,t.concat([n]))}function fg(e){let t=[];if(e){let n=Ni(e);const r=/(auto|scroll)/,a=i=>{try{let l=window.getComputedStyle(i,null);return r.test(l.getPropertyValue("overflow"))||r.test(l.getPropertyValue("overflowX"))||r.test(l.getPropertyValue("overflowY"))}catch{return!1}};for(let i of n){let l=i.nodeType===1&&i.dataset.scrollselectors;if(l){let s=l.split(",");for(let d of s){let c=ho(i,d);c&&a(c)&&t.push(c)}}i.nodeType!==9&&a(i)&&t.push(i)}}return t}function mg(e){return!!(e!==null&&typeof e<"u"&&e.nodeName&&$i(e))}function Ut(e){if(e){let t=e.offsetWidth,n=getComputedStyle(e);return t-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight)+parseFloat(n.borderLeftWidth)+parseFloat(n.borderRightWidth),t}return 0}function pg(){return/(android)/i.test(navigator.userAgent)}function fr(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function bo(e){return!!(e&&e.offsetParent!=null)}function gg(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function hg(e,t="",n){hn(e)&&n!==null&&n!==void 0&&e.setAttribute(t,n)}function mr(){const e=new Map;return{on(t,n){let r=e.get(t);return r?r.push(n):r=[n],e.set(t,r),this},off(t,n){let r=e.get(t);return r&&r.splice(r.indexOf(n)>>>0,1),this},emit(t,n){let r=e.get(t);r&&r.slice().map(a=>{a(n)})},clear(){e.clear()}}}var bg=Object.defineProperty,yg=Object.defineProperties,kg=Object.getOwnPropertyDescriptors,yo=Object.getOwnPropertySymbols,Oi=Object.prototype.hasOwnProperty,Ti=Object.prototype.propertyIsEnumerable,Vi=(e,t,n)=>t in e?bg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ve=(e,t)=>{for(var n in t||(t={}))Oi.call(t,n)&&Vi(e,n,t[n]);if(yo)for(var n of yo(t))Ti.call(t,n)&&Vi(e,n,t[n]);return e},en=(e,t)=>yg(e,kg(t)),vt=(e,t)=>{var n={};for(var r in e)Oi.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yo)for(var r of yo(e))t.indexOf(r)<0&&Ti.call(e,r)&&(n[r]=e[r]);return n},wg=mr(),xt=wg;function Ii(e,t){co(e)?e.push(...t||[]):ct(e)&&Object.assign(e,t)}function vg(e){return ct(e)&&e.hasOwnProperty("value")&&e.hasOwnProperty("type")?e.value:e}function xg(e){return e.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}function pr(e="",t=""){return xg(`${ze(e,!1)&&ze(t,!1)?`${e}-`:e}${t}`)}function Fi(e="",t=""){return`--${pr(e,t)}`}function Sg(e=""){const t=(e.match(/{/g)||[]).length,n=(e.match(/}/g)||[]).length;return(t+n)%2!==0}function Pi(e,t="",n="",r=[],a){if(ze(e)){const i=/{([^}]*)}/g,l=e.trim();if(Sg(l))return;if(kt(l,i)){const s=l.replaceAll(i,u=>{const m=u.replace(/{|}/g,"").split(".").filter(p=>!r.some(g=>kt(p,g)));return`var(${Fi(n,ni(m.join("-")))}${de(a)?`, ${a}`:""})`}),d=/(\d+\s+[\+\-\*\/]\s+\d+)/g,c=/var\([^)]+\)/g;return kt(s.replace(c,"0"),d)?`calc(${s})`:s}return l}else if(xu(e))return e}function Cg(e,t,n){ze(t,!1)&&e.push(`${t}:${n};`)}function tn(e,t){return e?`${e}{${t}}`:""}var bn=(...e)=>Eg(pe.getTheme(),...e),Eg=(e={},t,n,r)=>{if(t){const{variable:a,options:i}=pe.defaults||{},{prefix:l,transform:s}=(e==null?void 0:e.options)||i||{},c=kt(t,/{([^}]*)}/g)?t:`{${t}}`;return r==="value"||Lt(r)&&s==="strict"?pe.getTokenValue(t):Pi(c,void 0,l,[a.excludedKeyRegex],n)}return""},Ri=(e={})=>{let{preset:t,options:n}=e;return{preset(r){return t=t?ti(t,r):r,this},options(r){return n=n?ve(ve({},n),r):r,this},primaryPalette(r){const{semantic:a}=t||{};return t=en(ve({},t),{semantic:en(ve({},a),{primary:r})}),this},surfacePalette(r){var a,i;const{semantic:l}=t||{},s=r!=null&&r.hasOwnProperty("light")?r==null?void 0:r.light:r,d=r!=null&&r.hasOwnProperty("dark")?r==null?void 0:r.dark:r,c={colorScheme:{light:ve(ve({},(a=l==null?void 0:l.colorScheme)==null?void 0:a.light),!!s&&{surface:s}),dark:ve(ve({},(i=l==null?void 0:l.colorScheme)==null?void 0:i.dark),!!d&&{surface:d})}};return t=en(ve({},t),{semantic:ve(ve({},l),c)}),this},define({useDefaultPreset:r=!1,useDefaultOptions:a=!1}={}){return{preset:r?pe.getPreset():t,options:a?pe.getOptions():n}},update({mergePresets:r=!0,mergeOptions:a=!0}={}){const i={preset:r?ti(pe.getPreset(),t):t,options:a?ve(ve({},pe.getOptions()),n):n};return pe.setTheme(i),i},use(r){const a=this.define(r);return pe.setTheme(a),a}}};function Bg(e,t={}){const n=pe.defaults.variable,{prefix:r=n.prefix,selector:a=n.selector,excludedKeyRegex:i=n.excludedKeyRegex}=t,l=(c,u="")=>Object.entries(c).reduce((f,[m,p])=>{const g=kt(m,i)?pr(u):pr(u,ni(m)),h=vg(p);if(ct(h)){const{variables:b,tokens:y}=l(h,g);Ii(f.tokens,y),Ii(f.variables,b)}else f.tokens.push((r?g.replace(`${r}-`,""):g).replaceAll("-",".")),Cg(f.variables,Fi(g),Pi(h,g,r,[i]));return f},{variables:[],tokens:[]}),{variables:s,tokens:d}=l(e,r);return{value:s,tokens:d,declarations:s.join(""),css:tn(a,s.join(""))}}var nt={regex:{rules:{class:{pattern:/^\.([a-zA-Z][\w-]*)$/,resolve(e){return{type:"class",selector:e,matched:this.pattern.test(e.trim())}}},attr:{pattern:/^\[(.*)\]$/,resolve(e){return{type:"attr",selector:`:root${e}`,matched:this.pattern.test(e.trim())}}},media:{pattern:/^@media (.*)$/,resolve(e){return{type:"media",selector:`${e}{:root{[CSS]}}`,matched:this.pattern.test(e.trim())}}},system:{pattern:/^system$/,resolve(e){return{type:"system",selector:"@media (prefers-color-scheme: dark){:root{[CSS]}}",matched:this.pattern.test(e.trim())}}},custom:{resolve(e){return{type:"custom",selector:e,matched:!0}}}},resolve(e){const t=Object.keys(this.rules).filter(n=>n!=="custom").map(n=>this.rules[n]);return[e].flat().map(n=>{var r;return(r=t.map(a=>a.resolve(n)).find(a=>a.matched))!=null?r:this.rules.custom.resolve(n)})}},_toVariables(e,t){return Bg(e,{prefix:t==null?void 0:t.prefix})},getCommon({name:e="",theme:t={},params:n,set:r,defaults:a}){var i,l,s,d,c,u,f;const{preset:m,options:p}=t;let g,h,b,y,v,x,E;if(de(m)&&p.transform!=="strict"){const{primitive:N,semantic:$,extend:C}=m,k=$||{},{colorScheme:w}=k,S=vt(k,["colorScheme"]),B=C||{},{colorScheme:I}=B,D=vt(B,["colorScheme"]),P=w||{},{dark:M}=P,j=vt(P,["dark"]),q=I||{},{dark:F}=q,O=vt(q,["dark"]),_=de(N)?this._toVariables({primitive:N},p):{},J=de(S)?this._toVariables({semantic:S},p):{},re=de(j)?this._toVariables({light:j},p):{},ae=de(M)?this._toVariables({dark:M},p):{},Y=de(D)?this._toVariables({semantic:D},p):{},Q=de(O)?this._toVariables({light:O},p):{},le=de(F)?this._toVariables({dark:F},p):{},[ce,xe]=[(i=_.declarations)!=null?i:"",_.tokens],[He,Re]=[(l=J.declarations)!=null?l:"",J.tokens||[]],[rt,Je]=[(s=re.declarations)!=null?s:"",re.tokens||[]],[H,z]=[(d=ae.declarations)!=null?d:"",ae.tokens||[]],[fe,ge]=[(c=Y.declarations)!=null?c:"",Y.tokens||[]],[me,he]=[(u=Q.declarations)!=null?u:"",Q.tokens||[]],[Ee,Me]=[(f=le.declarations)!=null?f:"",le.tokens||[]];g=this.transformCSS(e,ce,"light","variable",p,r,a),h=xe;const ft=this.transformCSS(e,`${He}${rt}`,"light","variable",p,r,a),Ve=this.transformCSS(e,`${H}`,"dark","variable",p,r,a);b=`${ft}${Ve}`,y=[...new Set([...Re,...Je,...z])];const je=this.transformCSS(e,`${fe}${me}color-scheme:light`,"light","variable",p,r,a),Qe=this.transformCSS(e,`${Ee}color-scheme:dark`,"dark","variable",p,r,a);v=`${je}${Qe}`,x=[...new Set([...ge,...he,...Me])],E=Ke(m.css,{dt:bn})}return{primitive:{css:g,tokens:h},semantic:{css:b,tokens:y},global:{css:v,tokens:x},style:E}},getPreset({name:e="",preset:t={},options:n,params:r,set:a,defaults:i,selector:l}){var s,d,c;let u,f,m;if(de(t)&&n.transform!=="strict"){const p=e.replace("-directive",""),g=t,{colorScheme:h,extend:b,css:y}=g,v=vt(g,["colorScheme","extend","css"]),x=b||{},{colorScheme:E}=x,N=vt(x,["colorScheme"]),$=h||{},{dark:C}=$,k=vt($,["dark"]),w=E||{},{dark:S}=w,B=vt(w,["dark"]),I=de(v)?this._toVariables({[p]:ve(ve({},v),N)},n):{},D=de(k)?this._toVariables({[p]:ve(ve({},k),B)},n):{},P=de(C)?this._toVariables({[p]:ve(ve({},C),S)},n):{},[M,j]=[(s=I.declarations)!=null?s:"",I.tokens||[]],[q,F]=[(d=D.declarations)!=null?d:"",D.tokens||[]],[O,_]=[(c=P.declarations)!=null?c:"",P.tokens||[]],J=this.transformCSS(p,`${M}${q}`,"light","variable",n,a,i,l),re=this.transformCSS(p,O,"dark","variable",n,a,i,l);u=`${J}${re}`,f=[...new Set([...j,...F,..._])],m=Ke(y,{dt:bn})}return{css:u,tokens:f,style:m}},getPresetC({name:e="",theme:t={},params:n,set:r,defaults:a}){var i;const{preset:l,options:s}=t,d=(i=l==null?void 0:l.components)==null?void 0:i[e];return this.getPreset({name:e,preset:d,options:s,params:n,set:r,defaults:a})},getPresetD({name:e="",theme:t={},params:n,set:r,defaults:a}){var i;const l=e.replace("-directive",""),{preset:s,options:d}=t,c=(i=s==null?void 0:s.directives)==null?void 0:i[l];return this.getPreset({name:l,preset:c,options:d,params:n,set:r,defaults:a})},applyDarkColorScheme(e){return!(e.darkModeSelector==="none"||e.darkModeSelector===!1)},getColorSchemeOption(e,t){var n;return this.applyDarkColorScheme(e)?this.regex.resolve(e.darkModeSelector===!0?t.options.darkModeSelector:(n=e.darkModeSelector)!=null?n:t.options.darkModeSelector):[]},getLayerOrder(e,t={},n,r){const{cssLayer:a}=t;return a?`@layer ${Ke(a.order||"primeui",n)}`:""},getCommonStyleSheet({name:e="",theme:t={},params:n,props:r={},set:a,defaults:i}){const l=this.getCommon({name:e,theme:t,params:n,set:a,defaults:i}),s=Object.entries(r).reduce((d,[c,u])=>d.push(`${c}="${u}"`)&&d,[]).join(" ");return Object.entries(l||{}).reduce((d,[c,u])=>{if(u!=null&&u.css){const f=mn(u==null?void 0:u.css),m=`${c}-variables`;d.push(`<style type="text/css" data-primevue-style-id="${m}" ${s}>${f}</style>`)}return d},[]).join("")},getStyleSheet({name:e="",theme:t={},params:n,props:r={},set:a,defaults:i}){var l;const s={name:e,theme:t,params:n,set:a,defaults:i},d=(l=e.includes("-directive")?this.getPresetD(s):this.getPresetC(s))==null?void 0:l.css,c=Object.entries(r).reduce((u,[f,m])=>u.push(`${f}="${m}"`)&&u,[]).join(" ");return d?`<style type="text/css" data-primevue-style-id="${e}-variables" ${c}>${mn(d)}</style>`:""},createTokens(e={},t,n="",r="",a={}){return Object.entries(e).forEach(([i,l])=>{const s=kt(i,t.variable.excludedKeyRegex)?n:n?`${n}.${oi(i)}`:oi(i),d=r?`${r}.${i}`:i;ct(l)?this.createTokens(l,t,s,d,a):(a[s]||(a[s]={paths:[],computed(c,u={}){var f,m;return this.paths.length===1?(f=this.paths[0])==null?void 0:f.computed(this.paths[0].scheme,u.binding):c&&c!=="none"?(m=this.paths.find(p=>p.scheme===c))==null?void 0:m.computed(c,u.binding):this.paths.map(p=>p.computed(p.scheme,u[p.scheme]))}}),a[s].paths.push({path:d,value:l,scheme:d.includes("colorScheme.light")?"light":d.includes("colorScheme.dark")?"dark":"none",computed(c,u={}){const f=/{([^}]*)}/g;let m=l;if(u.name=this.path,u.binding||(u.binding={}),kt(l,f)){const g=l.trim().replaceAll(f,y=>{var v;const x=y.replace(/{|}/g,""),E=(v=a[x])==null?void 0:v.computed(c,u);return co(E)&&E.length===2?`light-dark(${E[0].value},${E[1].value})`:E==null?void 0:E.value}),h=/(\d+\w*\s+[\+\-\*\/]\s+\d+\w*)/g,b=/var\([^)]+\)/g;m=kt(g.replace(b,"0"),h)?`calc(${g})`:g}return Lt(u.binding)&&delete u.binding,{colorScheme:c,path:this.path,paths:u,value:m.includes("undefined")?void 0:m}}}))}),a},getTokenValue(e,t,n){var r;const i=(d=>d.split(".").filter(u=>!kt(u.toLowerCase(),n.variable.excludedKeyRegex)).join("."))(t),l=t.includes("colorScheme.light")?"light":t.includes("colorScheme.dark")?"dark":void 0,s=[(r=e[i])==null?void 0:r.computed(l)].flat().filter(d=>d);return s.length===1?s[0].value:s.reduce((d={},c)=>{const u=c,{colorScheme:f}=u,m=vt(u,["colorScheme"]);return d[f]=m,d},void 0)},getSelectorRule(e,t,n,r){return n==="class"||n==="attr"?tn(de(t)?`${e}${t},${e} ${t}`:e,r):tn(e,de(t)?tn(t,r):r)},transformCSS(e,t,n,r,a={},i,l,s){if(de(t)){const{cssLayer:d}=a;if(r!=="style"){const c=this.getColorSchemeOption(a,l);t=n==="dark"?c.reduce((u,{type:f,selector:m})=>(de(m)&&(u+=m.includes("[CSS]")?m.replace("[CSS]",t):this.getSelectorRule(m,s,f,t)),u),""):tn(s??":root",t)}if(d){const c={name:"primeui",order:"primeui"};ct(d)&&(c.name=Ke(d.name,{name:e,type:r})),de(c.name)&&(t=tn(`@layer ${c.name}`,t),i==null||i.layerNames(c.name))}return t}return""}},pe={defaults:{variable:{prefix:"p",selector:":root",excludedKeyRegex:/^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi},options:{prefix:"p",darkModeSelector:"system",cssLayer:!1}},_theme:void 0,_layerNames:new Set,_loadedStyleNames:new Set,_loadingStyles:new Set,_tokens:{},update(e={}){const{theme:t}=e;t&&(this._theme=en(ve({},t),{options:ve(ve({},this.defaults.options),t.options)}),this._tokens=nt.createTokens(this.preset,this.defaults),this.clearLoadedStyleNames())},get theme(){return this._theme},get preset(){var e;return((e=this.theme)==null?void 0:e.preset)||{}},get options(){var e;return((e=this.theme)==null?void 0:e.options)||{}},get tokens(){return this._tokens},getTheme(){return this.theme},setTheme(e){this.update({theme:e}),xt.emit("theme:change",e)},getPreset(){return this.preset},setPreset(e){this._theme=en(ve({},this.theme),{preset:e}),this._tokens=nt.createTokens(e,this.defaults),this.clearLoadedStyleNames(),xt.emit("preset:change",e),xt.emit("theme:change",this.theme)},getOptions(){return this.options},setOptions(e){this._theme=en(ve({},this.theme),{options:e}),this.clearLoadedStyleNames(),xt.emit("options:change",e),xt.emit("theme:change",this.theme)},getLayerNames(){return[...this._layerNames]},setLayerNames(e){this._layerNames.add(e)},getLoadedStyleNames(){return this._loadedStyleNames},isStyleNameLoaded(e){return this._loadedStyleNames.has(e)},setLoadedStyleName(e){this._loadedStyleNames.add(e)},deleteLoadedStyleName(e){this._loadedStyleNames.delete(e)},clearLoadedStyleNames(){this._loadedStyleNames.clear()},getTokenValue(e){return nt.getTokenValue(this.tokens,e,this.defaults)},getCommon(e="",t){return nt.getCommon({name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getComponent(e="",t){const n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return nt.getPresetC(n)},getDirective(e="",t){const n={name:e,theme:this.theme,params:t,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return nt.getPresetD(n)},getCustomPreset(e="",t,n,r){const a={name:e,preset:t,options:this.options,selector:n,params:r,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}};return nt.getPreset(a)},getLayerOrderCSS(e=""){return nt.getLayerOrder(e,this.options,{names:this.getLayerNames()},this.defaults)},transformCSS(e="",t,n="style",r){return nt.transformCSS(e,t,r,n,this.options,{layerNames:this.setLayerNames.bind(this)},this.defaults)},getCommonStyleSheet(e="",t,n={}){return nt.getCommonStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},getStyleSheet(e,t,n={}){return nt.getStyleSheet({name:e,theme:this.theme,params:t,props:n,defaults:this.defaults,set:{layerNames:this.setLayerNames.bind(this)}})},onStyleMounted(e){this._loadingStyles.add(e)},onStyleUpdated(e){this._loadingStyles.add(e)},onStyleLoaded(e,{name:t}){this._loadingStyles.size&&(this._loadingStyles.delete(t),xt.emit(`theme:${t}:load`,e),!this._loadingStyles.size&&xt.emit("theme:load"))}};function $g(e){return Ri().surfacePalette(e).update().preset}var ko={};function gr(e="pui_id_"){return ko.hasOwnProperty(e)||(ko[e]=0),ko[e]++,`${e}${ko[e]}`}var Nt={_loadedStyleNames:new Set,getLoadedStyleNames:function(){return this._loadedStyleNames},isStyleNameLoaded:function(t){return this._loadedStyleNames.has(t)},setLoadedStyleName:function(t){this._loadedStyleNames.add(t)},deleteLoadedStyleName:function(t){this._loadedStyleNames.delete(t)},clearLoadedStyleNames:function(){this._loadedStyleNames.clear()}};function yn(e){"@babel/helpers - typeof";return yn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yn(e)}function Di(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _i(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Di(Object(n),!0).forEach(function(r){Ng(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Di(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ng(e,t,n){return(t=Og(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Og(e){var t=Tg(e,"string");return yn(t)=="symbol"?t:t+""}function Tg(e,t){if(yn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(yn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;o.getCurrentInstance()?o.onMounted(e):t?e():o.nextTick(e)}var Ig=0;function Fg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=o.ref(!1),r=o.ref(e),a=o.ref(null),i=fr()?window.document:void 0,l=t.document,s=l===void 0?i:l,d=t.immediate,c=d===void 0?!0:d,u=t.manual,f=u===void 0?!1:u,m=t.name,p=m===void 0?"style_".concat(++Ig):m,g=t.id,h=g===void 0?void 0:g,b=t.media,y=b===void 0?void 0:b,v=t.nonce,x=v===void 0?void 0:v,E=t.first,N=E===void 0?!1:E,$=t.onMounted,C=$===void 0?void 0:$,k=t.onUpdated,w=k===void 0?void 0:k,S=t.onLoad,B=S===void 0?void 0:S,I=t.props,D=I===void 0?{}:I,P=function(){},M=function(F){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s){var _=_i(_i({},D),O),J=_.name||p,re=_.id||h,ae=_.nonce||x;a.value=s.querySelector('style[data-primevue-style-id="'.concat(J,'"]'))||s.getElementById(re)||s.createElement("style"),a.value.isConnected||(r.value=F||e,go(a.value,{type:"text/css",id:re,media:y,nonce:ae}),N?s.head.prepend(a.value):s.head.appendChild(a.value),hg(a.value,"data-primevue-style-id",J),go(a.value,_),a.value.onload=function(Y){return B==null?void 0:B(Y,{name:J})},C==null||C(J)),!n.value&&(P=o.watch(r,function(Y){a.value.textContent=Y,w==null||w(J)},{immediate:!0}),n.value=!0)}},j=function(){!s||!n.value||(P(),mg(a.value)&&s.head.removeChild(a.value),n.value=!1)};return c&&!f&&Vg(M),{id:h,name:p,el:a,css:r,unload:j,load:M,isLoaded:o.readonly(n)}}function kn(e){"@babel/helpers - typeof";return kn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kn(e)}function Ai(e,t){return _g(e)||Dg(e,t)||Rg(e,t)||Pg()}function Pg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
30
30
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rg(e,t){if(e){if(typeof e=="string")return Li(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Li(e,t):void 0}}function Li(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Dg(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,l,s=[],d=!0,c=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);d=!0);}catch(u){c=!0,a=u}finally{try{if(!d&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw a}}return s}}function _g(e){if(Array.isArray(e))return e}function zi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function hr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zi(Object(n),!0).forEach(function(r){Ag(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zi(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ag(e,t,n){return(t=Lg(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lg(e){var t=zg(e,"string");return kn(t)=="symbol"?t:t+""}function zg(e,t){if(kn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(kn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mg=function(t){var n=t.dt;return`
|
|
31
31
|
*,
|
|
32
32
|
::before,
|
|
@@ -929,7 +929,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
929
929
|
* author : Adam Draper
|
|
930
930
|
* license : MIT
|
|
931
931
|
* http://adamwdraper.github.com/Numeral-js/
|
|
932
|
-
*/var t0=So.exports,hl;function n0(){return hl||(hl=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(t0,function(){var t,n,r="2.0.6",a={},i={},l={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},s={currentLocale:l.currentLocale,zeroFormat:l.zeroFormat,nullFormat:l.nullFormat,defaultFormat:l.defaultFormat,scalePercentBy100:l.scalePercentBy100};function d(c,u){this._input=c,this._value=u}return t=function(c){var u,f,m,p;if(t.isNumeral(c))u=c.value();else if(c===0||typeof c>"u")u=0;else if(c===null||n.isNaN(c))u=null;else if(typeof c=="string")if(s.zeroFormat&&c===s.zeroFormat)u=0;else if(s.nullFormat&&c===s.nullFormat||!c.replace(/[^0-9]+/g,"").length)u=null;else{for(f in a)if(p=typeof a[f].regexps.unformat=="function"?a[f].regexps.unformat():a[f].regexps.unformat,p&&c.match(p)){m=a[f].unformat;break}m=m||t._.stringToNumber,u=m(c)}else u=Number(c)||null;return new d(c,u)},t.version=r,t.isNumeral=function(c){return c instanceof d},t._=n={numberToFormat:function(c,u,f){var m=i[t.options.currentLocale],p=!1,g=!1,h=0,b="",y=1e12,v=1e9,x=1e6,E=1e3,N="",$=!1,C,k,w,S,B,I,D;if(c=c||0,k=Math.abs(c),t._.includes(u,"(")?(p=!0,u=u.replace(/[\(|\)]/g,"")):(t._.includes(u,"+")||t._.includes(u,"-"))&&(B=t._.includes(u,"+")?u.indexOf("+"):c<0?u.indexOf("-"):-1,u=u.replace(/[\+|\-]/g,"")),t._.includes(u,"a")&&(C=u.match(/a(k|m|b|t)?/),C=C?C[1]:!1,t._.includes(u," a")&&(b=" "),u=u.replace(new RegExp(b+"a[kmbt]?"),""),k>=y&&!C||C==="t"?(b+=m.abbreviations.trillion,c=c/y):k<y&&k>=v&&!C||C==="b"?(b+=m.abbreviations.billion,c=c/v):k<v&&k>=x&&!C||C==="m"?(b+=m.abbreviations.million,c=c/x):(k<x&&k>=E&&!C||C==="k")&&(b+=m.abbreviations.thousand,c=c/E)),t._.includes(u,"[.]")&&(g=!0,u=u.replace("[.]",".")),w=c.toString().split(".")[0],S=u.split(".")[1],I=u.indexOf(","),h=(u.split(".")[0].split(",")[0].match(/0/g)||[]).length,S?(t._.includes(S,"[")?(S=S.replace("]",""),S=S.split("["),N=t._.toFixed(c,S[0].length+S[1].length,f,S[1].length)):N=t._.toFixed(c,S.length,f),w=N.split(".")[0],t._.includes(N,".")?N=m.delimiters.decimal+N.split(".")[1]:N="",g&&Number(N.slice(1))===0&&(N="")):w=t._.toFixed(c,0,f),b&&!C&&Number(w)>=1e3&&b!==m.abbreviations.trillion)switch(w=String(Number(w)/1e3),b){case m.abbreviations.thousand:b=m.abbreviations.million;break;case m.abbreviations.million:b=m.abbreviations.billion;break;case m.abbreviations.billion:b=m.abbreviations.trillion;break}if(t._.includes(w,"-")&&(w=w.slice(1),$=!0),w.length<h)for(var P=h-w.length;P>0;P--)w="0"+w;return I>-1&&(w=w.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m.delimiters.thousands)),u.indexOf(".")===0&&(w=""),D=w+N+(b||""),p?D=(p&&$?"(":"")+D+(p&&$?")":""):B>=0?D=B===0?($?"-":"+")+D:D+($?"-":"+"):$&&(D="-"+D),D},stringToNumber:function(c){var u=i[s.currentLocale],f=c,m={thousand:3,million:6,billion:9,trillion:12},p,g,h;if(s.zeroFormat&&c===s.zeroFormat)g=0;else if(s.nullFormat&&c===s.nullFormat||!c.replace(/[^0-9]+/g,"").length)g=null;else{g=1,u.delimiters.decimal!=="."&&(c=c.replace(/\./g,"").replace(u.delimiters.decimal,"."));for(p in m)if(h=new RegExp("[^a-zA-Z]"+u.abbreviations[p]+"(?:\\)|(\\"+u.currency.symbol+")?(?:\\))?)?$"),f.match(h)){g*=Math.pow(10,m[p]);break}g*=(c.split("-").length+Math.min(c.split("(").length-1,c.split(")").length-1))%2?1:-1,c=c.replace(/[^0-9\.]+/g,""),g*=Number(c)}return g},isNaN:function(c){return typeof c=="number"&&isNaN(c)},includes:function(c,u){return c.indexOf(u)!==-1},insert:function(c,u,f){return c.slice(0,f)+u+c.slice(f)},reduce:function(c,u){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof u!="function")throw new TypeError(u+" is not a function");var f=Object(c),m=f.length>>>0,p=0,g;if(arguments.length===3)g=arguments[2];else{for(;p<m&&!(p in f);)p++;if(p>=m)throw new TypeError("Reduce of empty array with no initial value");g=f[p++]}for(;p<m;p++)p in f&&(g=u(g,f[p],p,f));return g},multiplier:function(c){var u=c.toString().split(".");return u.length<2?1:Math.pow(10,u[1].length)},correctionFactor:function(){var c=Array.prototype.slice.call(arguments);return c.reduce(function(u,f){var m=n.multiplier(f);return u>m?u:m},1)},toFixed:function(c,u,f,m){var p=c.toString().split("."),g=u-(m||0),h,b,y,v;return p.length===2?h=Math.min(Math.max(p[1].length,g),u):h=g,y=Math.pow(10,h),v=(f(c+"e+"+h)/y).toFixed(h),m>u-h&&(b=new RegExp("\\.?0{1,"+(m-(u-h))+"}$"),v=v.replace(b,"")),v}},t.options=s,t.formats=a,t.locales=i,t.locale=function(c){return c&&(s.currentLocale=c.toLowerCase()),s.currentLocale},t.localeData=function(c){if(!c)return i[s.currentLocale];if(c=c.toLowerCase(),!i[c])throw new Error("Unknown locale : "+c);return i[c]},t.reset=function(){for(var c in l)s[c]=l[c]},t.zeroFormat=function(c){s.zeroFormat=typeof c=="string"?c:null},t.nullFormat=function(c){s.nullFormat=typeof c=="string"?c:null},t.defaultFormat=function(c){s.defaultFormat=typeof c=="string"?c:"0.0"},t.register=function(c,u,f){if(u=u.toLowerCase(),this[c+"s"][u])throw new TypeError(u+" "+c+" already registered.");return this[c+"s"][u]=f,f},t.validate=function(c,u){var f,m,p,g,h,b,y,v;if(typeof c!="string"&&(c+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",c)),c=c.trim(),c.match(/^\d+$/))return!0;if(c==="")return!1;try{y=t.localeData(u)}catch{y=t.localeData(t.locale())}return p=y.currency.symbol,h=y.abbreviations,f=y.delimiters.decimal,y.delimiters.thousands==="."?m="\\.":m=y.delimiters.thousands,v=c.match(/^[^\d]+/),v!==null&&(c=c.substr(1),v[0]!==p)||(v=c.match(/[^\d]+$/),v!==null&&(c=c.slice(0,-1),v[0]!==h.thousand&&v[0]!==h.million&&v[0]!==h.billion&&v[0]!==h.trillion))?!1:(b=new RegExp(m+"{2}"),c.match(/[^\d.,]/g)?!1:(g=c.split(f),g.length>2?!1:g.length<2?!!g[0].match(/^\d+.*\d$/)&&!g[0].match(b):g[0].length===1?!!g[0].match(/^\d+$/)&&!g[0].match(b)&&!!g[1].match(/^\d+$/):!!g[0].match(/^\d+.*\d$/)&&!g[0].match(b)&&!!g[1].match(/^\d+$/)))},t.fn=d.prototype={clone:function(){return t(this)},format:function(c,u){var f=this._value,m=c||s.defaultFormat,p,g,h;if(u=u||Math.round,f===0&&s.zeroFormat!==null)g=s.zeroFormat;else if(f===null&&s.nullFormat!==null)g=s.nullFormat;else{for(p in a)if(m.match(a[p].regexps.format)){h=a[p].format;break}h=h||t._.numberToFormat,g=h(f,m,u)}return g},value:function(){return this._value},input:function(){return this._input},set:function(c){return this._value=Number(c),this},add:function(c){var u=n.correctionFactor.call(null,this._value,c);function f(m,p,g,h){return m+Math.round(u*p)}return this._value=n.reduce([this._value,c],f,0)/u,this},subtract:function(c){var u=n.correctionFactor.call(null,this._value,c);function f(m,p,g,h){return m-Math.round(u*p)}return this._value=n.reduce([c],f,Math.round(this._value*u))/u,this},multiply:function(c){function u(f,m,p,g){var h=n.correctionFactor(f,m);return Math.round(f*h)*Math.round(m*h)/Math.round(h*h)}return this._value=n.reduce([this._value,c],u,1),this},divide:function(c){function u(f,m,p,g){var h=n.correctionFactor(f,m);return Math.round(f*h)/Math.round(m*h)}return this._value=n.reduce([this._value,c],u),this},difference:function(c){return Math.abs(t(this._value).subtract(c).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(c){var u=c%10;return~~(c%100/10)===1?"th":u===1?"st":u===2?"nd":u===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(c,u,f){var m=t._.includes(u," BPS")?" ":"",p;return c=c*1e4,u=u.replace(/\s?BPS/,""),p=t._.numberToFormat(c,u,f),t._.includes(p,")")?(p=p.split(""),p.splice(-1,0,m+"BPS"),p=p.join("")):p=p+m+"BPS",p},unformat:function(c){return+(t._.stringToNumber(c)*1e-4).toFixed(15)}})}(),function(){var c={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},u={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},f=c.suffixes.concat(u.suffixes.filter(function(p){return c.suffixes.indexOf(p)<0})),m=f.join("|");m="("+m.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(m)},format:function(p,g,h){var b,y=t._.includes(g,"ib")?u:c,v=t._.includes(g," b")||t._.includes(g," ib")?" ":"",x,E,N;for(g=g.replace(/\s?i?b/,""),x=0;x<=y.suffixes.length;x++)if(E=Math.pow(y.base,x),N=Math.pow(y.base,x+1),p===null||p===0||p>=E&&p<N){v+=y.suffixes[x],E>0&&(p=p/E);break}return b=t._.numberToFormat(p,g,h),b+v},unformat:function(p){var g=t._.stringToNumber(p),h,b;if(g){for(h=c.suffixes.length-1;h>=0;h--){if(t._.includes(p,c.suffixes[h])){b=Math.pow(c.base,h);break}if(t._.includes(p,u.suffixes[h])){b=Math.pow(u.base,h);break}}g*=b||1}return g}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(c,u,f){var m=t.locales[t.options.currentLocale],p={before:u.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:u.match(/([\+|\-|\)|\s|\$]*)$/)[0]},g,h,b;for(u=u.replace(/\s?\$\s?/,""),g=t._.numberToFormat(c,u,f),c>=0?(p.before=p.before.replace(/[\-\(]/,""),p.after=p.after.replace(/[\-\)]/,"")):c<0&&!t._.includes(p.before,"-")&&!t._.includes(p.before,"(")&&(p.before="-"+p.before),b=0;b<p.before.length;b++)switch(h=p.before[b],h){case"$":g=t._.insert(g,m.currency.symbol,b);break;case" ":g=t._.insert(g," ",b+m.currency.symbol.length-1);break}for(b=p.after.length-1;b>=0;b--)switch(h=p.after[b],h){case"$":g=b===p.after.length-1?g+m.currency.symbol:t._.insert(g,m.currency.symbol,-(p.after.length-(1+b)));break;case" ":g=b===p.after.length-1?g+" ":t._.insert(g," ",-(p.after.length-(1+b)+m.currency.symbol.length-1));break}return g}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(c,u,f){var m,p=typeof c=="number"&&!t._.isNaN(c)?c.toExponential():"0e+0",g=p.split("e");return u=u.replace(/e[\+|\-]{1}0/,""),m=t._.numberToFormat(Number(g[0]),u,f),m+"e"+g[1]},unformat:function(c){var u=t._.includes(c,"e+")?c.split("e+"):c.split("e-"),f=Number(u[0]),m=Number(u[1]);m=t._.includes(c,"e-")?m*=-1:m;function p(g,h,b,y){var v=t._.correctionFactor(g,h),x=g*v*(h*v)/(v*v);return x}return t._.reduce([f,Math.pow(10,m)],p,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(c,u,f){var m=t.locales[t.options.currentLocale],p,g=t._.includes(u," o")?" ":"";return u=u.replace(/\s?o/,""),g+=m.ordinal(c),p=t._.numberToFormat(c,u,f),p+g}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(c,u,f){var m=t._.includes(u," %")?" ":"",p;return t.options.scalePercentBy100&&(c=c*100),u=u.replace(/\s?\%/,""),p=t._.numberToFormat(c,u,f),t._.includes(p,")")?(p=p.split(""),p.splice(-1,0,m+"%"),p=p.join("")):p=p+m+"%",p},unformat:function(c){var u=t._.stringToNumber(c);return t.options.scalePercentBy100?u*.01:u}})}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(c,u,f){var m=Math.floor(c/60/60),p=Math.floor((c-m*60*60)/60),g=Math.round(c-m*60*60-p*60);return m+":"+(p<10?"0"+p:p)+":"+(g<10?"0"+g:g)},unformat:function(c){var u=c.split(":"),f=0;return u.length===3?(f=f+Number(u[0])*60*60,f=f+Number(u[1])*60,f=f+Number(u[2])):u.length===2&&(f=f+Number(u[0])*60,f=f+Number(u[1])),Number(f)}})}(),t})}(So)),So.exports}var o0=n0();const bl=Fa(o0),yl={__name:"FieldExpression",props:["value","type","displayFormat"],setup(e){const t=o.computed(()=>n()),n=()=>e.type==="DATE"?r():e.type==="NUMBER"?a():e.value,r=()=>Zb(e.value,e.displayFormat?e.displayFormat:"MM/dd/yyyy"),a=()=>e.displayFormat?e.displayFormat==="currency"?bl(e.value).format("$0,0.00"):bl(e.value).format(e.displayFormat):e.value;return(i,l)=>(o.openBlock(),o.createElementBlock("span",null,o.toDisplayString(t.value),1))}};function kl(){const e=Oe(),{get:t,post:n,put:r,del:a}=pt(),i=()=>e.getAppId();return{getEntities:async()=>{const F=i();return await t(`/api/app/v1/${F}/entity`)},getEntity:async F=>{const V=i();return await t(`/api/app/v1/${V}/entity/${F}`)},saveEntity:async F=>{const V=i();return await n(`/api/app/v1/${V}/entity`,F)},updateEntityGeneralSettings:async(F,V)=>{const _=i();return await r(`/api/app/v1/${_}/entity/${F}/rename`,V)},updateEntityAuditable:async(F,V)=>{const _=i();return await r(`/api/app/v1/${_}/entity/${F}/auditable`,V)},updateEntityRevisionEnabled:async(F,V)=>{const _=i();return await r(`/api/app/v1/${_}/entity/${F}/revision`,V)},updateEntitySoftDelete:async(F,V)=>{const _=i();return await r(`/api/app/v1/${_}/entity/${F}/soft-delete`,V)},updateEntityDeleteProtected:async(F,V)=>{const _=i();return await r(`/api/app/v1/${_}/entity/${F}/delete-protect`,V)},updateEntityColumn:async(F,V)=>{const _=i();return await r(`/api/app/v1/${_}/entity/${F}/column`,V)},saveEntityColumn:async(F,V)=>{const _=i();return await n(`/api/app/v1/${_}/entity/${F}/column`,V)},dropEntityColumn:async(F,V)=>{const _=i();return await a(`/api/app/v1/${_}/entity/${F}/column/${V}`)},saveForeignKey:async(F,V)=>{const _=i();return await r(`/api/app/v1/${_}/entity/foreignKey`,V)},dropForeignKey:async F=>{const V=i();return await a(`/api/app/v1/${V}/entity/foreignKey`,F)},saveUniqueConstraint:async(F,V)=>{const _=i();return await n(`/api/app/v1/${_}/entity/${F}/column/${V}/constraint`)},dropUniqueConstraint:async(F,V)=>{const _=i();return await a(`/api/app/v1/${_}/entity/${F}/column/${V}/constraint`)},saveIndex:async(F,V)=>{const _=i();return await n(`/api/app/v1/${_}/entity/${F}/column-index`,V)},dropIndex:async(F,V)=>{const _=i();return await a(`/api/app/v1/${_}/entity/${F}/column-index`,V)},deleteEntity:async F=>{const V=i();return await a(`/api/app/v1/${V}/entity/${F}`)},getEntityEvents:async F=>{const V=i();return await t(`/api/app/v1/${V}/entity/${F}/event`)},saveEntityEvent:async(F,V)=>{const _=i();return await n(`/api/app/v1/${_}/entity/${F}/event`,V)},deleteEntityEvent:async(F,V)=>{const _=i();return await a(`/api/app/v1/${_}/entity/${F}/event/${V}`)},updateEntityEvent:async(F,V,_)=>{const J=i();return await r(`/api/app/v1/${J}/entity/${F}/event/${V}`,_)},getActionTypes:async()=>{const F=i();return await t(`/api/app/v1/${F}/action-type`)},getActionConfigByType:async F=>{const V=i();return await t(`/api/app/v1/${V}/notification-config/${F}`)},enableCache:async(F,V)=>{const _=i();return await r(`/api/app/v1/${_}/entity/${F}/enableCache`,V)},addOrUpdatePresets:async(F,V)=>{const _=i();return await n(`/api/app/v1/${_}/entity/${F}/preset`,V)},updateEntity:async F=>{const V=i();return await r(`/api/app/v1/${V}/entity`,F)},deletePreset:async(F,V)=>{const _=i();return await a(`/api/app/v1/${_}/entity/${F}/preset/${V}`)}}}const wl=No("entitiesStore",{state:()=>({entities:[],entityService:new kl}),actions:{async fetchEntities(){try{return await this.entityService.getEntities()}catch(e){console.error("Error fetching entities:",e)}finally{}},async getEntities(){if(this.entities.length===0){const e=await this.fetchEntities();return this.setEntities(e.response),this.entities}else return this.entities},setEntities(e){this.entities=e},getEntityByName(e){return this.entities.find(t=>t.name.toLowerCase()===e.toLowerCase())}}}),r0={class:"field flex flex-col w-full"},a0={key:0,class:"flex items-center"},i0={key:1},l0={class:"flex items-center"},s0={__name:"EntitySelection",props:{entityName:String,onEntityChangeCallback:Function},setup(e){const t=Oe(),n=o.ref(""),r=wl(),a=o.ref([]),i=async()=>{a.value=await r.getEntities(),l()},l=()=>{for(let d=0;d<a.value.length;d++){const c=a.value[d];c.name.toLowerCase()==e.entityName.toLowerCase()&&(n.value=c)}},s=()=>{e.onEntityChangeCallback(n.value.name)};return o.watch(()=>t.globalConfigs.appId,async d=>{d&&await i()},{immediate:!0}),(d,c)=>{const u=o.resolveComponent("Select");return o.openBlock(),o.createElementBlock("div",r0,[o.createVNode(u,{modelValue:n.value,"onUpdate:modelValue":[c[0]||(c[0]=f=>n.value=f),s],options:a.value,filter:"",optionLabel:"name",placeholder:"Select entity",class:"w-full"},{value:o.withCtx(f=>[f.value?(o.openBlock(),o.createElementBlock("div",a0,[o.createElementVNode("div",null,o.toDisplayString(f.value.name),1)])):(o.openBlock(),o.createElementBlock("span",i0,o.toDisplayString(f.placeholder),1))]),option:o.withCtx(f=>[o.createElementVNode("div",l0,[o.createElementVNode("div",null,o.toDisplayString(f.option.name),1)])]),_:1},8,["modelValue","options"])])}}},c0={class:"flex flex-col w-full"},d0={class:"w-1/4"},u0={class:"w-full mt-5"},vl={__name:"EntityExplorer",props:{entityName:String},setup(e){const t=e,n=o.ref(t.entityName);o.watch(n,a=>{console.log("Entity changed to:",a)});const r=a=>{n.value=a};return(a,i)=>(o.openBlock(),o.createElementBlock("div",c0,[o.createElementVNode("div",d0,[(o.openBlock(),o.createBlock(s0,{key:n.value,entityName:n.value,onEntityChangeCallback:r},null,8,["entityName"]))]),o.createElementVNode("div",u0,[(o.openBlock(),o.createBlock(ar,{key:n.value,entityName:n.value},null,8,["entityName"]))])]))}};function xl(){const e=Oe(),{get:t,post:n,put:r,del:a}=pt(),i=()=>e.getAppId();return{getAllMenu:async()=>{const m=i();return await t(`/api/app/v1/${m}/menu`)},getMenu:async m=>{const p=i();return await t(`/api/app/v1/${p}/menu/${m}`)},createMenu:async m=>{const p=i();return await n(`/api/app/v1/${p}/menu`,m)},updateMenu:async(m,p)=>{const g=i();return await r(`/api/app/v1/${g}/menu/${m}`,p)},deleteMenu:async m=>{const p=i();return await a(`/api/app/v1/${p}/menu/${m}`)},getMenuByName:async m=>{const p=i();return await t(`/api/app/v1/${p}/menu/name/${m}`)}}}const Sl={__name:"MenuItem",props:{item:Object,parentItems:{type:Array,default:()=>[]},layoutType:String,iconPosition:String,iconSize:String,labelSize:String,openTrigger:String,isChild:{type:Boolean,default:!1},hasSlotParent:{type:Boolean,default:!1},hasSlotChild:{type:Boolean,default:!1},onToggle:Function},setup(e){const t=mt.useRouter(),n=e,r=n.item.children&&n.item.children.length>0,a=()=>{r&&(n.item.isOpen=!0)},i=()=>{r&&(n.item.isOpen=!1)},l=()=>{var s;r?((s=n.parentItems)==null||s.forEach(d=>{d!==n.item&&(d.isOpen=!1)}),n.item.isOpen=!n.item.isOpen):n.item.route&&n.item.url?t.push(n.item.url):!n.item.route&&n.item.url&&(window.location.href=n.item.url)};return(s,d)=>(o.openBlock(),o.createElementBlock("div",{class:"relative",onMouseenter:d[1]||(d[1]=c=>e.openTrigger==="hover"&&o.unref(r)?a():null),onMouseleave:d[2]||(d[2]=c=>e.openTrigger==="hover"&&o.unref(r)?i():null)},[o.createElementVNode("li",{class:o.normalizeClass(e.layoutType==="horizontal"?"inline-block":"block")},[o.createElementVNode("div",{onClick:d[0]||(d[0]=c=>e.openTrigger==="click"?l():null)},[!e.isChild&&e.hasSlotParent?o.renderSlot(s.$slots,"list-item-menu-parent",{key:0,item:e.item}):e.isChild?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["px-2 py-1 whitespace-nowrap",[e.iconPosition==="top"||e.iconPosition==="bottom"?"flex flex-col items-center justify-center gap-1":"flex flex-row items-center gap-1"]])},[e.iconPosition==="top"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("i",{class:o.normalizeClass([e.item.mediumIcon,e.iconSize])},null,2),o.createElementVNode("span",{class:o.normalizeClass(e.labelSize)},o.toDisplayString(e.item.displayLabel),3)],64)):e.iconPosition==="bottom"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("span",{class:o.normalizeClass(e.labelSize)},o.toDisplayString(e.item.displayLabel),3),o.createElementVNode("i",{class:o.normalizeClass([e.item.mediumIcon,e.iconSize])},null,2)],64)):e.iconPosition==="right"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createElementVNode("span",{class:o.normalizeClass(e.labelSize)},o.toDisplayString(e.item.displayLabel),3),o.createElementVNode("i",{class:o.normalizeClass([e.item.mediumIcon,e.iconSize])},null,2)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:3},[o.createElementVNode("i",{class:o.normalizeClass([e.item.mediumIcon,e.iconSize])},null,2),o.createElementVNode("span",{class:o.normalizeClass(e.labelSize)},o.toDisplayString(e.item.displayLabel),3)],64))],2)),e.isChild&&e.hasSlotChild?o.renderSlot(s.$slots,"list-item-menu-child",{key:2,item:e.item}):e.isChild?(o.openBlock(),o.createElementBlock("div",{key:3,class:o.normalizeClass(["whitespace-nowrap",[e.iconPosition==="top"||e.iconPosition==="bottom"?"flex flex-col items-start gap-1":"flex flex-row items-center gap-2"]])},[e.iconPosition==="top"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("i",{class:o.normalizeClass([e.item.mediumIcon,e.iconSize])},null,2),o.createElementVNode("span",{class:o.normalizeClass(e.labelSize)},o.toDisplayString(e.item.displayLabel),3)],64)):e.iconPosition==="bottom"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("span",{class:o.normalizeClass(e.labelSize)},o.toDisplayString(e.item.displayLabel),3),o.createElementVNode("i",{class:o.normalizeClass([e.item.mediumIcon,e.iconSize])},null,2)],64)):e.iconPosition==="right"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createElementVNode("span",{class:o.normalizeClass(e.labelSize)},o.toDisplayString(e.item.displayLabel),3),o.createElementVNode("i",{class:o.normalizeClass([e.item.mediumIcon,e.iconSize])},null,2)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:3},[o.createElementVNode("i",{class:o.normalizeClass([e.item.mediumIcon,e.iconSize])},null,2),o.createElementVNode("span",{class:o.normalizeClass(e.labelSize)},o.toDisplayString(e.item.displayLabel),3)],64))],2)):o.createCommentVNode("",!0)])],2),e.item.isOpen&&e.item.children.length?(o.openBlock(),o.createElementBlock("ul",{key:0,class:o.normalizeClass(["list-none mt-1",e.layoutType==="horizontal"?"absolute left-0 top-full ml-4":"ml-4 pl-2"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.children,c=>(o.openBlock(),o.createBlock(Sl,{key:c.id,item:c,layoutType:e.layoutType,iconPosition:e.iconPosition,iconSize:e.iconSize,labelSize:e.labelSize,openTrigger:e.openTrigger,isChild:!0,hasSlotParent:e.hasSlotParent,hasSlotChild:e.hasSlotChild,onToggle:e.onToggle,parentItems:e.item.children},o.createSlots({_:2},[e.hasSlotParent?{name:"list-item-menu-parent",fn:o.withCtx(u=>[o.renderSlot(s.$slots,"list-item-menu-parent",o.mergeProps({ref_for:!0},u))]),key:"0"}:void 0,e.hasSlotChild?{name:"list-item-menu-child",fn:o.withCtx(u=>[o.renderSlot(s.$slots,"list-item-menu-child",o.mergeProps({ref_for:!0},u))]),key:"1"}:void 0]),1032,["item","layoutType","iconPosition","iconSize","labelSize","openTrigger","hasSlotParent","hasSlotChild","onToggle","parentItems"]))),128))],2)):o.createCommentVNode("",!0)],32))}},Cl={__name:"Menu",props:{menuName:{type:String,required:!0},layoutType:{type:String,default:"vertical"},iconPosition:{type:String,default:"left"},iconSize:{type:String,default:"text-base"},labelSize:{type:String,default:"text-sm"},openTrigger:{type:String,default:"click"}},setup(e){const t=e,n=o.ref([]),r=xl(),a=s=>{s.forEach(d=>{d.isOpen=!1,d.children=d.children||[],d.children.length>0&&a(d.children)})},i=s=>{const d=c=>{c.forEach(u=>{u!==s&&(u.isOpen=!1),u.children&&u.children.length>0&&d(u.children)})};d(n.value),s.isOpen=!s.isOpen},l=async()=>{var c;const s=await r.getMenuByName(t.menuName),d=((c=s==null?void 0:s.response)==null?void 0:c.children)||[];a(d),n.value=d};return o.onMounted(l),(s,d)=>s.$slots["list-wrapper"]?o.renderSlot(s.$slots,"list-wrapper",{key:0,menuItems:n.value}):(o.openBlock(),o.createElementBlock("ul",{key:1,class:o.normalizeClass(["p-0",e.layoutType==="horizontal"?"flex flex-row gap-2":"flex flex-col gap-2"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.value,c=>(o.openBlock(),o.createBlock(Sl,{key:c.id,item:c,parentItems:n.value,layoutType:e.layoutType,iconPosition:e.iconPosition,iconSize:e.iconSize,labelSize:e.labelSize,openTrigger:e.openTrigger,hasSlotParent:s.$slots["list-item-menu-parent"],hasSlotChild:s.$slots["list-item-menu-child"],onToggle:i},o.createSlots({_:2},[s.$slots["list-item-menu-parent"]?{name:"list-item-menu-parent",fn:o.withCtx(u=>[o.renderSlot(s.$slots,"list-item-menu-parent",o.mergeProps({ref_for:!0},u))]),key:"0"}:void 0,s.$slots["list-item-menu-child"]?{name:"list-item-menu-child",fn:o.withCtx(u=>[o.renderSlot(s.$slots,"list-item-menu-child",o.mergeProps({ref_for:!0},u))]),key:"1"}:void 0]),1032,["item","parentItems","layoutType","iconPosition","iconSize","labelSize","openTrigger","hasSlotParent","hasSlotChild"]))),128))],2))}},El={__name:"TextInput",props:{modelValue:{type:String,default:""},invalid:{type:Boolean,default:!1}},emits:["update:modelValue","input"],setup(e,{emit:t}){const n=t;function r(a){n("update:modelValue",a.target.value),n("input",a)}return(a,i)=>{const l=o.resolveComponent("InputText");return o.openBlock(),o.createElementBlock("div",null,[o.createVNode(l,o.mergeProps({class:"w-full",value:e.modelValue,onInput:r},a.$attrs),null,16,["value"])])}}},f0={key:1},Bl={__name:"Button",props:{label:{type:String,default:"Button"},size:{type:String,default:"medium",validator:e=>["small","medium","large"].includes(e)},severity:{type:String,default:"primary",validator:e=>["primary","info","danger","success"].includes(e)},onClick:{type:Function,default:null},roles:{type:[Array,String],default:()=>[]},permissions:{type:[Array,String],default:()=>[]},iconName:{type:String,default:null}},setup(e){const t=e,n=o.ref(!0),{hasMatchingRoleAndPermissions:r}=zt();o.onMounted(async()=>{n.value=await r(t.roles,t.permissions)});function a(i){t.onClick&&t.onClick(i)}return(i,l)=>n.value?(o.openBlock(),o.createBlock(o.unref(ol),{key:0,label:e.label,size:e.size,onClick:a,severity:e.severity,icon:e.iconName},null,8,["label","size","severity","icon"])):(o.openBlock(),o.createElementBlock("p",f0,"You do not have the required permissions to access this feature."))}},m0={name:"StateFullText",props:{value:{type:String,required:!0}},model:{prop:"value",event:"input"}};function p0(e,t,n,r,a,i){return o.openBlock(),o.createElementBlock("span",null,o.toDisplayString(n.value),1)}const $l=Ie(m0,[["render",p0]]),g0=["value"],Nl={__name:"colorpicker",props:{modelValue:{type:String}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function r(a){n("update:modelValue",a.target.value)}return(a,i)=>(o.openBlock(),o.createElementBlock("input",{type:"color",value:e.modelValue,onInput:r,class:"w-14 h-10 border border-gray-300 rounded shadow cursor-pointer"},null,40,g0))}},h0=["min","max","value"],Ol={__name:"RangeInput",props:{modelValue:{type:[Number,String],default:0},min:{type:[Number,String],default:0},max:{type:[Number,String],default:100},type:{type:String,default:"range"}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function r(a){n("update:modelValue",a.target.value)}return(a,i)=>e.type==="range"?(o.openBlock(),o.createElementBlock("input",{key:0,type:"range",min:e.min,max:e.max,value:e.modelValue,onInput:r,class:"w-full accent-blue-500"},null,40,h0)):o.createCommentVNode("",!0)}};function b0(){let e=[];const t=(l,s,d=999)=>{const c=a(l,s,d),u=c.value+(c.key===l?0:d)+1;return e.push({key:l,value:u}),u},n=l=>{e=e.filter(s=>s.value!==l)},r=(l,s)=>a(l).value,a=(l,s,d=0)=>[...e].reverse().find(c=>!0)||{key:l,value:d},i=l=>l&&parseInt(l.style.zIndex,10)||0;return{get:i,set:(l,s,d)=>{s&&(s.style.zIndex=String(t(l,!0,d)))},clear:l=>{l&&(n(i(l)),l.style.zIndex="")},getCurrent:l=>r(l)}}var wr=b0();function Tn(e){"@babel/helpers - typeof";return Tn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tn(e)}function y0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k0(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v0(r.key),r)}}function w0(e,t,n){return k0(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function v0(e){var t=x0(e,"string");return Tn(t)=="symbol"?t:t+""}function x0(e,t){if(Tn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Tn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var S0=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){};y0(this,e),this.element=t,this.listener=n}return w0(e,[{key:"bindScrollListener",value:function(){this.scrollableParents=fg(this.element);for(var n=0;n<this.scrollableParents.length;n++)this.scrollableParents[n].addEventListener("scroll",this.listener)}},{key:"unbindScrollListener",value:function(){if(this.scrollableParents)for(var n=0;n<this.scrollableParents.length;n++)this.scrollableParents[n].removeEventListener("scroll",this.listener)}},{key:"destroy",value:function(){this.unbindScrollListener(),this.element=null,this.listener=null,this.scrollableParents=null}}])}();function Tl(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"pv_id_";return gr(e)}var Vl={name:"BlankIcon",extends:nn};function C0(e,t,n,r,a,i){return o.openBlock(),o.createElementBlock("svg",o.mergeProps({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),t[0]||(t[0]=[o.createElementVNode("rect",{width:"1",height:"1",fill:"currentColor","fill-opacity":"0"},null,-1)]),16)}Vl.render=C0;var Il={name:"CheckIcon",extends:nn};function E0(e,t,n,r,a,i){return o.openBlock(),o.createElementBlock("svg",o.mergeProps({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),t[0]||(t[0]=[o.createElementVNode("path",{d:"M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z",fill:"currentColor"},null,-1)]),16)}Il.render=E0;var Fl={name:"SearchIcon",extends:nn};function B0(e,t,n,r,a,i){return o.openBlock(),o.createElementBlock("svg",o.mergeProps({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),t[0]||(t[0]=[o.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.67602 11.0265C3.6661 11.688 4.83011 12.0411 6.02086 12.0411C6.81149 12.0411 7.59438 11.8854 8.32483 11.5828C8.87005 11.357 9.37808 11.0526 9.83317 10.6803L12.9769 13.8241C13.0323 13.8801 13.0983 13.9245 13.171 13.9548C13.2438 13.985 13.3219 14.0003 13.4007 14C13.4795 14.0003 13.5575 13.985 13.6303 13.9548C13.7031 13.9245 13.7691 13.8801 13.8244 13.8241C13.9367 13.7116 13.9998 13.5592 13.9998 13.4003C13.9998 13.2414 13.9367 13.089 13.8244 12.9765L10.6807 9.8328C11.053 9.37773 11.3573 8.86972 11.5831 8.32452C11.8857 7.59408 12.0414 6.81119 12.0414 6.02056C12.0414 4.8298 11.6883 3.66579 11.0268 2.67572C10.3652 1.68564 9.42494 0.913972 8.32483 0.45829C7.22472 0.00260857 6.01418 -0.116618 4.84631 0.115686C3.67844 0.34799 2.60568 0.921393 1.76369 1.76338C0.921698 2.60537 0.348296 3.67813 0.115991 4.84601C-0.116313 6.01388 0.00291375 7.22441 0.458595 8.32452C0.914277 9.42464 1.68595 10.3649 2.67602 11.0265ZM3.35565 2.0158C4.14456 1.48867 5.07206 1.20731 6.02086 1.20731C7.29317 1.20731 8.51338 1.71274 9.41304 2.6124C10.3127 3.51206 10.8181 4.73226 10.8181 6.00457C10.8181 6.95337 10.5368 7.88088 10.0096 8.66978C9.48251 9.45868 8.73328 10.0736 7.85669 10.4367C6.98011 10.7997 6.01554 10.8947 5.08496 10.7096C4.15439 10.5245 3.2996 10.0676 2.62869 9.39674C1.95778 8.72583 1.50089 7.87104 1.31579 6.94046C1.13068 6.00989 1.22568 5.04532 1.58878 4.16874C1.95187 3.29215 2.56675 2.54292 3.35565 2.0158Z",fill:"currentColor"},null,-1)]),16)}Fl.render=B0;var Pl={name:"TimesIcon",extends:nn};function $0(e,t,n,r,a,i){return o.openBlock(),o.createElementBlock("svg",o.mergeProps({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),t[0]||(t[0]=[o.createElementVNode("path",{d:"M8.01186 7.00933L12.27 2.75116C12.341 2.68501 12.398 2.60524 12.4375 2.51661C12.4769 2.42798 12.4982 2.3323 12.4999 2.23529C12.5016 2.13827 12.4838 2.0419 12.4474 1.95194C12.4111 1.86197 12.357 1.78024 12.2884 1.71163C12.2198 1.64302 12.138 1.58893 12.0481 1.55259C11.9581 1.51625 11.8617 1.4984 11.7647 1.50011C11.6677 1.50182 11.572 1.52306 11.4834 1.56255C11.3948 1.60204 11.315 1.65898 11.2488 1.72997L6.99067 5.98814L2.7325 1.72997C2.59553 1.60234 2.41437 1.53286 2.22718 1.53616C2.03999 1.53946 1.8614 1.61529 1.72901 1.74767C1.59663 1.88006 1.5208 2.05865 1.5175 2.24584C1.5142 2.43303 1.58368 2.61419 1.71131 2.75116L5.96948 7.00933L1.71131 11.2675C1.576 11.403 1.5 11.5866 1.5 11.7781C1.5 11.9696 1.576 12.1532 1.71131 12.2887C1.84679 12.424 2.03043 12.5 2.2219 12.5C2.41338 12.5 2.59702 12.424 2.7325 12.2887L6.99067 8.03052L11.2488 12.2887C11.3843 12.424 11.568 12.5 11.7594 12.5C11.9509 12.5 12.1346 12.424 12.27 12.2887C12.4053 12.1532 12.4813 11.9696 12.4813 11.7781C12.4813 11.5866 12.4053 11.403 12.27 11.2675L8.01186 7.00933Z",fill:"currentColor"},null,-1)]),16)}Pl.render=$0;var N0=function(t){var n=t.dt;return`
|
|
932
|
+
*/var t0=So.exports,hl;function n0(){return hl||(hl=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(t0,function(){var t,n,r="2.0.6",a={},i={},l={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},s={currentLocale:l.currentLocale,zeroFormat:l.zeroFormat,nullFormat:l.nullFormat,defaultFormat:l.defaultFormat,scalePercentBy100:l.scalePercentBy100};function d(c,u){this._input=c,this._value=u}return t=function(c){var u,f,m,p;if(t.isNumeral(c))u=c.value();else if(c===0||typeof c>"u")u=0;else if(c===null||n.isNaN(c))u=null;else if(typeof c=="string")if(s.zeroFormat&&c===s.zeroFormat)u=0;else if(s.nullFormat&&c===s.nullFormat||!c.replace(/[^0-9]+/g,"").length)u=null;else{for(f in a)if(p=typeof a[f].regexps.unformat=="function"?a[f].regexps.unformat():a[f].regexps.unformat,p&&c.match(p)){m=a[f].unformat;break}m=m||t._.stringToNumber,u=m(c)}else u=Number(c)||null;return new d(c,u)},t.version=r,t.isNumeral=function(c){return c instanceof d},t._=n={numberToFormat:function(c,u,f){var m=i[t.options.currentLocale],p=!1,g=!1,h=0,b="",y=1e12,v=1e9,x=1e6,E=1e3,N="",$=!1,C,k,w,S,B,I,D;if(c=c||0,k=Math.abs(c),t._.includes(u,"(")?(p=!0,u=u.replace(/[\(|\)]/g,"")):(t._.includes(u,"+")||t._.includes(u,"-"))&&(B=t._.includes(u,"+")?u.indexOf("+"):c<0?u.indexOf("-"):-1,u=u.replace(/[\+|\-]/g,"")),t._.includes(u,"a")&&(C=u.match(/a(k|m|b|t)?/),C=C?C[1]:!1,t._.includes(u," a")&&(b=" "),u=u.replace(new RegExp(b+"a[kmbt]?"),""),k>=y&&!C||C==="t"?(b+=m.abbreviations.trillion,c=c/y):k<y&&k>=v&&!C||C==="b"?(b+=m.abbreviations.billion,c=c/v):k<v&&k>=x&&!C||C==="m"?(b+=m.abbreviations.million,c=c/x):(k<x&&k>=E&&!C||C==="k")&&(b+=m.abbreviations.thousand,c=c/E)),t._.includes(u,"[.]")&&(g=!0,u=u.replace("[.]",".")),w=c.toString().split(".")[0],S=u.split(".")[1],I=u.indexOf(","),h=(u.split(".")[0].split(",")[0].match(/0/g)||[]).length,S?(t._.includes(S,"[")?(S=S.replace("]",""),S=S.split("["),N=t._.toFixed(c,S[0].length+S[1].length,f,S[1].length)):N=t._.toFixed(c,S.length,f),w=N.split(".")[0],t._.includes(N,".")?N=m.delimiters.decimal+N.split(".")[1]:N="",g&&Number(N.slice(1))===0&&(N="")):w=t._.toFixed(c,0,f),b&&!C&&Number(w)>=1e3&&b!==m.abbreviations.trillion)switch(w=String(Number(w)/1e3),b){case m.abbreviations.thousand:b=m.abbreviations.million;break;case m.abbreviations.million:b=m.abbreviations.billion;break;case m.abbreviations.billion:b=m.abbreviations.trillion;break}if(t._.includes(w,"-")&&(w=w.slice(1),$=!0),w.length<h)for(var P=h-w.length;P>0;P--)w="0"+w;return I>-1&&(w=w.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m.delimiters.thousands)),u.indexOf(".")===0&&(w=""),D=w+N+(b||""),p?D=(p&&$?"(":"")+D+(p&&$?")":""):B>=0?D=B===0?($?"-":"+")+D:D+($?"-":"+"):$&&(D="-"+D),D},stringToNumber:function(c){var u=i[s.currentLocale],f=c,m={thousand:3,million:6,billion:9,trillion:12},p,g,h;if(s.zeroFormat&&c===s.zeroFormat)g=0;else if(s.nullFormat&&c===s.nullFormat||!c.replace(/[^0-9]+/g,"").length)g=null;else{g=1,u.delimiters.decimal!=="."&&(c=c.replace(/\./g,"").replace(u.delimiters.decimal,"."));for(p in m)if(h=new RegExp("[^a-zA-Z]"+u.abbreviations[p]+"(?:\\)|(\\"+u.currency.symbol+")?(?:\\))?)?$"),f.match(h)){g*=Math.pow(10,m[p]);break}g*=(c.split("-").length+Math.min(c.split("(").length-1,c.split(")").length-1))%2?1:-1,c=c.replace(/[^0-9\.]+/g,""),g*=Number(c)}return g},isNaN:function(c){return typeof c=="number"&&isNaN(c)},includes:function(c,u){return c.indexOf(u)!==-1},insert:function(c,u,f){return c.slice(0,f)+u+c.slice(f)},reduce:function(c,u){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof u!="function")throw new TypeError(u+" is not a function");var f=Object(c),m=f.length>>>0,p=0,g;if(arguments.length===3)g=arguments[2];else{for(;p<m&&!(p in f);)p++;if(p>=m)throw new TypeError("Reduce of empty array with no initial value");g=f[p++]}for(;p<m;p++)p in f&&(g=u(g,f[p],p,f));return g},multiplier:function(c){var u=c.toString().split(".");return u.length<2?1:Math.pow(10,u[1].length)},correctionFactor:function(){var c=Array.prototype.slice.call(arguments);return c.reduce(function(u,f){var m=n.multiplier(f);return u>m?u:m},1)},toFixed:function(c,u,f,m){var p=c.toString().split("."),g=u-(m||0),h,b,y,v;return p.length===2?h=Math.min(Math.max(p[1].length,g),u):h=g,y=Math.pow(10,h),v=(f(c+"e+"+h)/y).toFixed(h),m>u-h&&(b=new RegExp("\\.?0{1,"+(m-(u-h))+"}$"),v=v.replace(b,"")),v}},t.options=s,t.formats=a,t.locales=i,t.locale=function(c){return c&&(s.currentLocale=c.toLowerCase()),s.currentLocale},t.localeData=function(c){if(!c)return i[s.currentLocale];if(c=c.toLowerCase(),!i[c])throw new Error("Unknown locale : "+c);return i[c]},t.reset=function(){for(var c in l)s[c]=l[c]},t.zeroFormat=function(c){s.zeroFormat=typeof c=="string"?c:null},t.nullFormat=function(c){s.nullFormat=typeof c=="string"?c:null},t.defaultFormat=function(c){s.defaultFormat=typeof c=="string"?c:"0.0"},t.register=function(c,u,f){if(u=u.toLowerCase(),this[c+"s"][u])throw new TypeError(u+" "+c+" already registered.");return this[c+"s"][u]=f,f},t.validate=function(c,u){var f,m,p,g,h,b,y,v;if(typeof c!="string"&&(c+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",c)),c=c.trim(),c.match(/^\d+$/))return!0;if(c==="")return!1;try{y=t.localeData(u)}catch{y=t.localeData(t.locale())}return p=y.currency.symbol,h=y.abbreviations,f=y.delimiters.decimal,y.delimiters.thousands==="."?m="\\.":m=y.delimiters.thousands,v=c.match(/^[^\d]+/),v!==null&&(c=c.substr(1),v[0]!==p)||(v=c.match(/[^\d]+$/),v!==null&&(c=c.slice(0,-1),v[0]!==h.thousand&&v[0]!==h.million&&v[0]!==h.billion&&v[0]!==h.trillion))?!1:(b=new RegExp(m+"{2}"),c.match(/[^\d.,]/g)?!1:(g=c.split(f),g.length>2?!1:g.length<2?!!g[0].match(/^\d+.*\d$/)&&!g[0].match(b):g[0].length===1?!!g[0].match(/^\d+$/)&&!g[0].match(b)&&!!g[1].match(/^\d+$/):!!g[0].match(/^\d+.*\d$/)&&!g[0].match(b)&&!!g[1].match(/^\d+$/)))},t.fn=d.prototype={clone:function(){return t(this)},format:function(c,u){var f=this._value,m=c||s.defaultFormat,p,g,h;if(u=u||Math.round,f===0&&s.zeroFormat!==null)g=s.zeroFormat;else if(f===null&&s.nullFormat!==null)g=s.nullFormat;else{for(p in a)if(m.match(a[p].regexps.format)){h=a[p].format;break}h=h||t._.numberToFormat,g=h(f,m,u)}return g},value:function(){return this._value},input:function(){return this._input},set:function(c){return this._value=Number(c),this},add:function(c){var u=n.correctionFactor.call(null,this._value,c);function f(m,p,g,h){return m+Math.round(u*p)}return this._value=n.reduce([this._value,c],f,0)/u,this},subtract:function(c){var u=n.correctionFactor.call(null,this._value,c);function f(m,p,g,h){return m-Math.round(u*p)}return this._value=n.reduce([c],f,Math.round(this._value*u))/u,this},multiply:function(c){function u(f,m,p,g){var h=n.correctionFactor(f,m);return Math.round(f*h)*Math.round(m*h)/Math.round(h*h)}return this._value=n.reduce([this._value,c],u,1),this},divide:function(c){function u(f,m,p,g){var h=n.correctionFactor(f,m);return Math.round(f*h)/Math.round(m*h)}return this._value=n.reduce([this._value,c],u),this},difference:function(c){return Math.abs(t(this._value).subtract(c).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(c){var u=c%10;return~~(c%100/10)===1?"th":u===1?"st":u===2?"nd":u===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(c,u,f){var m=t._.includes(u," BPS")?" ":"",p;return c=c*1e4,u=u.replace(/\s?BPS/,""),p=t._.numberToFormat(c,u,f),t._.includes(p,")")?(p=p.split(""),p.splice(-1,0,m+"BPS"),p=p.join("")):p=p+m+"BPS",p},unformat:function(c){return+(t._.stringToNumber(c)*1e-4).toFixed(15)}})}(),function(){var c={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},u={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},f=c.suffixes.concat(u.suffixes.filter(function(p){return c.suffixes.indexOf(p)<0})),m=f.join("|");m="("+m.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(m)},format:function(p,g,h){var b,y=t._.includes(g,"ib")?u:c,v=t._.includes(g," b")||t._.includes(g," ib")?" ":"",x,E,N;for(g=g.replace(/\s?i?b/,""),x=0;x<=y.suffixes.length;x++)if(E=Math.pow(y.base,x),N=Math.pow(y.base,x+1),p===null||p===0||p>=E&&p<N){v+=y.suffixes[x],E>0&&(p=p/E);break}return b=t._.numberToFormat(p,g,h),b+v},unformat:function(p){var g=t._.stringToNumber(p),h,b;if(g){for(h=c.suffixes.length-1;h>=0;h--){if(t._.includes(p,c.suffixes[h])){b=Math.pow(c.base,h);break}if(t._.includes(p,u.suffixes[h])){b=Math.pow(u.base,h);break}}g*=b||1}return g}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(c,u,f){var m=t.locales[t.options.currentLocale],p={before:u.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:u.match(/([\+|\-|\)|\s|\$]*)$/)[0]},g,h,b;for(u=u.replace(/\s?\$\s?/,""),g=t._.numberToFormat(c,u,f),c>=0?(p.before=p.before.replace(/[\-\(]/,""),p.after=p.after.replace(/[\-\)]/,"")):c<0&&!t._.includes(p.before,"-")&&!t._.includes(p.before,"(")&&(p.before="-"+p.before),b=0;b<p.before.length;b++)switch(h=p.before[b],h){case"$":g=t._.insert(g,m.currency.symbol,b);break;case" ":g=t._.insert(g," ",b+m.currency.symbol.length-1);break}for(b=p.after.length-1;b>=0;b--)switch(h=p.after[b],h){case"$":g=b===p.after.length-1?g+m.currency.symbol:t._.insert(g,m.currency.symbol,-(p.after.length-(1+b)));break;case" ":g=b===p.after.length-1?g+" ":t._.insert(g," ",-(p.after.length-(1+b)+m.currency.symbol.length-1));break}return g}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(c,u,f){var m,p=typeof c=="number"&&!t._.isNaN(c)?c.toExponential():"0e+0",g=p.split("e");return u=u.replace(/e[\+|\-]{1}0/,""),m=t._.numberToFormat(Number(g[0]),u,f),m+"e"+g[1]},unformat:function(c){var u=t._.includes(c,"e+")?c.split("e+"):c.split("e-"),f=Number(u[0]),m=Number(u[1]);m=t._.includes(c,"e-")?m*=-1:m;function p(g,h,b,y){var v=t._.correctionFactor(g,h),x=g*v*(h*v)/(v*v);return x}return t._.reduce([f,Math.pow(10,m)],p,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(c,u,f){var m=t.locales[t.options.currentLocale],p,g=t._.includes(u," o")?" ":"";return u=u.replace(/\s?o/,""),g+=m.ordinal(c),p=t._.numberToFormat(c,u,f),p+g}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(c,u,f){var m=t._.includes(u," %")?" ":"",p;return t.options.scalePercentBy100&&(c=c*100),u=u.replace(/\s?\%/,""),p=t._.numberToFormat(c,u,f),t._.includes(p,")")?(p=p.split(""),p.splice(-1,0,m+"%"),p=p.join("")):p=p+m+"%",p},unformat:function(c){var u=t._.stringToNumber(c);return t.options.scalePercentBy100?u*.01:u}})}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(c,u,f){var m=Math.floor(c/60/60),p=Math.floor((c-m*60*60)/60),g=Math.round(c-m*60*60-p*60);return m+":"+(p<10?"0"+p:p)+":"+(g<10?"0"+g:g)},unformat:function(c){var u=c.split(":"),f=0;return u.length===3?(f=f+Number(u[0])*60*60,f=f+Number(u[1])*60,f=f+Number(u[2])):u.length===2&&(f=f+Number(u[0])*60,f=f+Number(u[1])),Number(f)}})}(),t})}(So)),So.exports}var o0=n0();const bl=Fa(o0),yl={__name:"FieldExpression",props:["value","type","displayFormat"],setup(e){const t=o.computed(()=>n()),n=()=>e.type==="DATE"?r():e.type==="NUMBER"?a():e.value,r=()=>Zb(e.value,e.displayFormat?e.displayFormat:"MM/dd/yyyy"),a=()=>e.displayFormat?e.displayFormat==="currency"?bl(e.value).format("$0,0.00"):bl(e.value).format(e.displayFormat):e.value;return(i,l)=>(o.openBlock(),o.createElementBlock("span",null,o.toDisplayString(t.value),1))}};function kl(){const e=Oe(),{get:t,post:n,put:r,del:a}=pt(),i=()=>e.getAppId();return{getEntities:async()=>{const F=i();return await t(`/api/app/v1/${F}/entity`)},getEntity:async F=>{const O=i();return await t(`/api/app/v1/${O}/entity/${F}`)},saveEntity:async F=>{const O=i();return await n(`/api/app/v1/${O}/entity`,F)},updateEntityGeneralSettings:async(F,O)=>{const _=i();return await r(`/api/app/v1/${_}/entity/${F}/rename`,O)},updateEntityAuditable:async(F,O)=>{const _=i();return await r(`/api/app/v1/${_}/entity/${F}/auditable`,O)},updateEntityRevisionEnabled:async(F,O)=>{const _=i();return await r(`/api/app/v1/${_}/entity/${F}/revision`,O)},updateEntitySoftDelete:async(F,O)=>{const _=i();return await r(`/api/app/v1/${_}/entity/${F}/soft-delete`,O)},updateEntityDeleteProtected:async(F,O)=>{const _=i();return await r(`/api/app/v1/${_}/entity/${F}/delete-protect`,O)},updateEntityColumn:async(F,O)=>{const _=i();return await r(`/api/app/v1/${_}/entity/${F}/column`,O)},saveEntityColumn:async(F,O)=>{const _=i();return await n(`/api/app/v1/${_}/entity/${F}/column`,O)},dropEntityColumn:async(F,O)=>{const _=i();return await a(`/api/app/v1/${_}/entity/${F}/column/${O}`)},saveForeignKey:async(F,O)=>{const _=i();return await r(`/api/app/v1/${_}/entity/foreignKey`,O)},dropForeignKey:async F=>{const O=i();return await a(`/api/app/v1/${O}/entity/foreignKey`,F)},saveUniqueConstraint:async(F,O)=>{const _=i();return await n(`/api/app/v1/${_}/entity/${F}/column/${O}/constraint`)},dropUniqueConstraint:async(F,O)=>{const _=i();return await a(`/api/app/v1/${_}/entity/${F}/column/${O}/constraint`)},saveIndex:async(F,O)=>{const _=i();return await n(`/api/app/v1/${_}/entity/${F}/column-index`,O)},dropIndex:async(F,O)=>{const _=i();return await a(`/api/app/v1/${_}/entity/${F}/column-index`,O)},deleteEntity:async F=>{const O=i();return await a(`/api/app/v1/${O}/entity/${F}`)},getEntityEvents:async F=>{const O=i();return await t(`/api/app/v1/${O}/entity/${F}/event`)},saveEntityEvent:async(F,O)=>{const _=i();return await n(`/api/app/v1/${_}/entity/${F}/event`,O)},deleteEntityEvent:async(F,O)=>{const _=i();return await a(`/api/app/v1/${_}/entity/${F}/event/${O}`)},updateEntityEvent:async(F,O,_)=>{const J=i();return await r(`/api/app/v1/${J}/entity/${F}/event/${O}`,_)},getActionTypes:async()=>{const F=i();return await t(`/api/app/v1/${F}/action-type`)},getActionConfigByType:async F=>{const O=i();return await t(`/api/app/v1/${O}/notification-config/${F}`)},enableCache:async(F,O)=>{const _=i();return await r(`/api/app/v1/${_}/entity/${F}/enableCache`,O)},addOrUpdatePresets:async(F,O)=>{const _=i();return await n(`/api/app/v1/${_}/entity/${F}/preset`,O)},updateEntity:async F=>{const O=i();return await r(`/api/app/v1/${O}/entity`,F)},deletePreset:async(F,O)=>{const _=i();return await a(`/api/app/v1/${_}/entity/${F}/preset/${O}`)}}}const wl=No("entitiesStore",{state:()=>({entities:[],entityService:new kl}),actions:{async fetchEntities(){try{return await this.entityService.getEntities()}catch(e){console.error("Error fetching entities:",e)}finally{}},async getEntities(){if(this.entities.length===0){const e=await this.fetchEntities();return this.setEntities(e.response),this.entities}else return this.entities},setEntities(e){this.entities=e},getEntityByName(e){return this.entities.find(t=>t.name.toLowerCase()===e.toLowerCase())}}}),r0={class:"field flex flex-col w-full"},a0={key:0,class:"flex items-center"},i0={key:1},l0={class:"flex items-center"},s0={__name:"EntitySelection",props:{entityName:String,onEntityChangeCallback:Function},setup(e){const t=Oe(),n=o.ref(""),r=wl(),a=o.ref([]),i=async()=>{a.value=await r.getEntities(),l()},l=()=>{for(let d=0;d<a.value.length;d++){const c=a.value[d];c.name.toLowerCase()==e.entityName.toLowerCase()&&(n.value=c)}},s=()=>{e.onEntityChangeCallback(n.value.name)};return o.watch(()=>t.globalConfigs.appId,async d=>{d&&await i()},{immediate:!0}),(d,c)=>{const u=o.resolveComponent("Select");return o.openBlock(),o.createElementBlock("div",r0,[o.createVNode(u,{modelValue:n.value,"onUpdate:modelValue":[c[0]||(c[0]=f=>n.value=f),s],options:a.value,filter:"",optionLabel:"name",placeholder:"Select entity",class:"w-full"},{value:o.withCtx(f=>[f.value?(o.openBlock(),o.createElementBlock("div",a0,[o.createElementVNode("div",null,o.toDisplayString(f.value.name),1)])):(o.openBlock(),o.createElementBlock("span",i0,o.toDisplayString(f.placeholder),1))]),option:o.withCtx(f=>[o.createElementVNode("div",l0,[o.createElementVNode("div",null,o.toDisplayString(f.option.name),1)])]),_:1},8,["modelValue","options"])])}}},c0={class:"flex flex-col w-full"},d0={class:"w-1/4"},u0={class:"w-full mt-5"},vl={__name:"EntityExplorer",props:{entityName:String},setup(e){const t=e,n=o.ref(t.entityName);o.watch(n,a=>{console.log("Entity changed to:",a)});const r=a=>{n.value=a};return(a,i)=>(o.openBlock(),o.createElementBlock("div",c0,[o.createElementVNode("div",d0,[(o.openBlock(),o.createBlock(s0,{key:n.value,entityName:n.value,onEntityChangeCallback:r},null,8,["entityName"]))]),o.createElementVNode("div",u0,[(o.openBlock(),o.createBlock(ar,{key:n.value,entityName:n.value},null,8,["entityName"]))])]))}};function xl(){const e=Oe(),{get:t,post:n,put:r,del:a}=pt(),i=()=>e.getAppId();return{getAllMenu:async()=>{const m=i();return await t(`/api/app/v1/${m}/menu`)},getMenu:async m=>{const p=i();return await t(`/api/app/v1/${p}/menu/${m}`)},createMenu:async m=>{const p=i();return await n(`/api/app/v1/${p}/menu`,m)},updateMenu:async(m,p)=>{const g=i();return await r(`/api/app/v1/${g}/menu/${m}`,p)},deleteMenu:async m=>{const p=i();return await a(`/api/app/v1/${p}/menu/${m}`)},getMenuByName:async m=>{const p=i();return await t(`/api/app/v1/${p}/menu/name/${m}`)}}}const Sl={__name:"MenuItem",props:{item:Object,parentItems:{type:Array,default:()=>[]},layoutType:String,iconPosition:String,iconSize:String,labelSize:String,openTrigger:String,isChild:{type:Boolean,default:!1},hasSlotParent:{type:Boolean,default:!1},hasSlotChild:{type:Boolean,default:!1},onToggle:Function},setup(e){const t=mt.useRouter(),n=e,r=n.item.children&&n.item.children.length>0,a=()=>{r&&(n.item.isOpen=!0)},i=()=>{r&&(n.item.isOpen=!1)},l=()=>{var s;r?((s=n.parentItems)==null||s.forEach(d=>{d!==n.item&&(d.isOpen=!1)}),n.item.isOpen=!n.item.isOpen):n.item.route&&n.item.url?t.push(n.item.url):!n.item.route&&n.item.url&&(window.location.href=n.item.url)};return(s,d)=>(o.openBlock(),o.createElementBlock("div",{class:"relative",onMouseenter:d[1]||(d[1]=c=>e.openTrigger==="hover"&&o.unref(r)?a():null),onMouseleave:d[2]||(d[2]=c=>e.openTrigger==="hover"&&o.unref(r)?i():null)},[o.createElementVNode("li",{class:o.normalizeClass(e.layoutType==="horizontal"?"inline-block":"block")},[o.createElementVNode("div",{onClick:d[0]||(d[0]=c=>e.openTrigger==="click"?l():null)},[!e.isChild&&e.hasSlotParent?o.renderSlot(s.$slots,"list-item-menu-parent",{key:0,item:e.item}):e.isChild?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["px-2 py-1 whitespace-nowrap",[e.iconPosition==="top"||e.iconPosition==="bottom"?"flex flex-col items-center justify-center gap-1":"flex flex-row items-center gap-1"]])},[e.iconPosition==="top"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("i",{class:o.normalizeClass([e.item.mediumIcon,e.iconSize])},null,2),o.createElementVNode("span",{class:o.normalizeClass(e.labelSize)},o.toDisplayString(e.item.displayLabel),3)],64)):e.iconPosition==="bottom"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("span",{class:o.normalizeClass(e.labelSize)},o.toDisplayString(e.item.displayLabel),3),o.createElementVNode("i",{class:o.normalizeClass([e.item.mediumIcon,e.iconSize])},null,2)],64)):e.iconPosition==="right"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createElementVNode("span",{class:o.normalizeClass(e.labelSize)},o.toDisplayString(e.item.displayLabel),3),o.createElementVNode("i",{class:o.normalizeClass([e.item.mediumIcon,e.iconSize])},null,2)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:3},[o.createElementVNode("i",{class:o.normalizeClass([e.item.mediumIcon,e.iconSize])},null,2),o.createElementVNode("span",{class:o.normalizeClass(e.labelSize)},o.toDisplayString(e.item.displayLabel),3)],64))],2)),e.isChild&&e.hasSlotChild?o.renderSlot(s.$slots,"list-item-menu-child",{key:2,item:e.item}):e.isChild?(o.openBlock(),o.createElementBlock("div",{key:3,class:o.normalizeClass(["whitespace-nowrap",[e.iconPosition==="top"||e.iconPosition==="bottom"?"flex flex-col items-start gap-1":"flex flex-row items-center gap-2"]])},[e.iconPosition==="top"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("i",{class:o.normalizeClass([e.item.mediumIcon,e.iconSize])},null,2),o.createElementVNode("span",{class:o.normalizeClass(e.labelSize)},o.toDisplayString(e.item.displayLabel),3)],64)):e.iconPosition==="bottom"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("span",{class:o.normalizeClass(e.labelSize)},o.toDisplayString(e.item.displayLabel),3),o.createElementVNode("i",{class:o.normalizeClass([e.item.mediumIcon,e.iconSize])},null,2)],64)):e.iconPosition==="right"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createElementVNode("span",{class:o.normalizeClass(e.labelSize)},o.toDisplayString(e.item.displayLabel),3),o.createElementVNode("i",{class:o.normalizeClass([e.item.mediumIcon,e.iconSize])},null,2)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:3},[o.createElementVNode("i",{class:o.normalizeClass([e.item.mediumIcon,e.iconSize])},null,2),o.createElementVNode("span",{class:o.normalizeClass(e.labelSize)},o.toDisplayString(e.item.displayLabel),3)],64))],2)):o.createCommentVNode("",!0)])],2),e.item.isOpen&&e.item.children.length?(o.openBlock(),o.createElementBlock("ul",{key:0,class:o.normalizeClass(["list-none mt-1",e.layoutType==="horizontal"?"absolute left-0 top-full ml-4":"ml-4 pl-2"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.item.children,c=>(o.openBlock(),o.createBlock(Sl,{key:c.id,item:c,layoutType:e.layoutType,iconPosition:e.iconPosition,iconSize:e.iconSize,labelSize:e.labelSize,openTrigger:e.openTrigger,isChild:!0,hasSlotParent:e.hasSlotParent,hasSlotChild:e.hasSlotChild,onToggle:e.onToggle,parentItems:e.item.children},o.createSlots({_:2},[e.hasSlotParent?{name:"list-item-menu-parent",fn:o.withCtx(u=>[o.renderSlot(s.$slots,"list-item-menu-parent",o.mergeProps({ref_for:!0},u))]),key:"0"}:void 0,e.hasSlotChild?{name:"list-item-menu-child",fn:o.withCtx(u=>[o.renderSlot(s.$slots,"list-item-menu-child",o.mergeProps({ref_for:!0},u))]),key:"1"}:void 0]),1032,["item","layoutType","iconPosition","iconSize","labelSize","openTrigger","hasSlotParent","hasSlotChild","onToggle","parentItems"]))),128))],2)):o.createCommentVNode("",!0)],32))}},Cl={__name:"Menu",props:{menuName:{type:String,required:!0},layoutType:{type:String,default:"vertical"},iconPosition:{type:String,default:"left"},iconSize:{type:String,default:"text-base"},labelSize:{type:String,default:"text-sm"},openTrigger:{type:String,default:"click"},gap:{type:String,default:"1"}},setup(e){const t=e,n=o.ref([]),r=xl(),a=s=>{s.forEach(d=>{d.isOpen=!1,d.children=d.children||[],d.children.length>0&&a(d.children)})},i=s=>{const d=c=>{c.forEach(u=>{u!==s&&(u.isOpen=!1),u.children&&u.children.length>0&&d(u.children)})};d(n.value),s.isOpen=!s.isOpen},l=async()=>{var c;const s=await r.getMenuByName(t.menuName),d=((c=s==null?void 0:s.response)==null?void 0:c.children)||[];a(d),n.value=d};return o.onMounted(l),(s,d)=>s.$slots["list-wrapper"]?o.renderSlot(s.$slots,"list-wrapper",{key:0,menuItems:n.value}):(o.openBlock(),o.createElementBlock("ul",{key:1,class:o.normalizeClass(["p-0",e.layoutType==="horizontal"?`flex flex-row gap-${t.gap}`:`flex flex-col gap-${t.gap}`])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.value,c=>(o.openBlock(),o.createBlock(Sl,{key:c.id,item:c,parentItems:n.value,layoutType:e.layoutType,iconPosition:e.iconPosition,iconSize:e.iconSize,labelSize:e.labelSize,openTrigger:e.openTrigger,hasSlotParent:s.$slots["list-item-menu-parent"],hasSlotChild:s.$slots["list-item-menu-child"],onToggle:i},o.createSlots({_:2},[s.$slots["list-item-menu-parent"]?{name:"list-item-menu-parent",fn:o.withCtx(u=>[o.renderSlot(s.$slots,"list-item-menu-parent",o.mergeProps({ref_for:!0},u))]),key:"0"}:void 0,s.$slots["list-item-menu-child"]?{name:"list-item-menu-child",fn:o.withCtx(u=>[o.renderSlot(s.$slots,"list-item-menu-child",o.mergeProps({ref_for:!0},u))]),key:"1"}:void 0]),1032,["item","parentItems","layoutType","iconPosition","iconSize","labelSize","openTrigger","hasSlotParent","hasSlotChild"]))),128))],2))}},El={__name:"TextInput",props:{modelValue:{type:String,default:""},invalid:{type:Boolean,default:!1}},emits:["update:modelValue","input"],setup(e,{emit:t}){const n=t;function r(a){n("update:modelValue",a.target.value),n("input",a)}return(a,i)=>{const l=o.resolveComponent("InputText");return o.openBlock(),o.createElementBlock("div",null,[o.createVNode(l,o.mergeProps({class:"w-full",value:e.modelValue,onInput:r},a.$attrs),null,16,["value"])])}}},f0={key:1},Bl={__name:"Button",props:{label:{type:String,default:"Button"},size:{type:String,default:"medium",validator:e=>["small","medium","large"].includes(e)},severity:{type:String,default:"primary",validator:e=>["primary","info","danger","success"].includes(e)},onClick:{type:Function,default:null},roles:{type:[Array,String],default:()=>[]},permissions:{type:[Array,String],default:()=>[]},iconName:{type:String,default:null}},setup(e){const t=e,n=o.ref(!0),{hasMatchingRoleAndPermissions:r}=zt();o.onMounted(async()=>{n.value=await r(t.roles,t.permissions)});function a(i){t.onClick&&t.onClick(i)}return(i,l)=>n.value?(o.openBlock(),o.createBlock(o.unref(ol),{key:0,label:e.label,size:e.size,onClick:a,severity:e.severity,icon:e.iconName},null,8,["label","size","severity","icon"])):(o.openBlock(),o.createElementBlock("p",f0,"You do not have the required permissions to access this feature."))}},m0={name:"StateFullText",props:{value:{type:String,required:!0}},model:{prop:"value",event:"input"}};function p0(e,t,n,r,a,i){return o.openBlock(),o.createElementBlock("span",null,o.toDisplayString(n.value),1)}const $l=Ie(m0,[["render",p0]]),g0=["value"],Nl={__name:"colorpicker",props:{modelValue:{type:String}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function r(a){n("update:modelValue",a.target.value)}return(a,i)=>(o.openBlock(),o.createElementBlock("input",{type:"color",value:e.modelValue,onInput:r,class:"w-14 h-10 border border-gray-300 rounded shadow cursor-pointer"},null,40,g0))}},h0=["min","max","value"],Ol={__name:"RangeInput",props:{modelValue:{type:[Number,String],default:0},min:{type:[Number,String],default:0},max:{type:[Number,String],default:100},type:{type:String,default:"range"}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;function r(a){n("update:modelValue",a.target.value)}return(a,i)=>e.type==="range"?(o.openBlock(),o.createElementBlock("input",{key:0,type:"range",min:e.min,max:e.max,value:e.modelValue,onInput:r,class:"w-full accent-blue-500"},null,40,h0)):o.createCommentVNode("",!0)}};function b0(){let e=[];const t=(l,s,d=999)=>{const c=a(l,s,d),u=c.value+(c.key===l?0:d)+1;return e.push({key:l,value:u}),u},n=l=>{e=e.filter(s=>s.value!==l)},r=(l,s)=>a(l).value,a=(l,s,d=0)=>[...e].reverse().find(c=>!0)||{key:l,value:d},i=l=>l&&parseInt(l.style.zIndex,10)||0;return{get:i,set:(l,s,d)=>{s&&(s.style.zIndex=String(t(l,!0,d)))},clear:l=>{l&&(n(i(l)),l.style.zIndex="")},getCurrent:l=>r(l)}}var wr=b0();function Tn(e){"@babel/helpers - typeof";return Tn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tn(e)}function y0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k0(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v0(r.key),r)}}function w0(e,t,n){return k0(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function v0(e){var t=x0(e,"string");return Tn(t)=="symbol"?t:t+""}function x0(e,t){if(Tn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Tn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var S0=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){};y0(this,e),this.element=t,this.listener=n}return w0(e,[{key:"bindScrollListener",value:function(){this.scrollableParents=fg(this.element);for(var n=0;n<this.scrollableParents.length;n++)this.scrollableParents[n].addEventListener("scroll",this.listener)}},{key:"unbindScrollListener",value:function(){if(this.scrollableParents)for(var n=0;n<this.scrollableParents.length;n++)this.scrollableParents[n].removeEventListener("scroll",this.listener)}},{key:"destroy",value:function(){this.unbindScrollListener(),this.element=null,this.listener=null,this.scrollableParents=null}}])}();function Tl(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"pv_id_";return gr(e)}var Vl={name:"BlankIcon",extends:nn};function C0(e,t,n,r,a,i){return o.openBlock(),o.createElementBlock("svg",o.mergeProps({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),t[0]||(t[0]=[o.createElementVNode("rect",{width:"1",height:"1",fill:"currentColor","fill-opacity":"0"},null,-1)]),16)}Vl.render=C0;var Il={name:"CheckIcon",extends:nn};function E0(e,t,n,r,a,i){return o.openBlock(),o.createElementBlock("svg",o.mergeProps({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),t[0]||(t[0]=[o.createElementVNode("path",{d:"M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z",fill:"currentColor"},null,-1)]),16)}Il.render=E0;var Fl={name:"SearchIcon",extends:nn};function B0(e,t,n,r,a,i){return o.openBlock(),o.createElementBlock("svg",o.mergeProps({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),t[0]||(t[0]=[o.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.67602 11.0265C3.6661 11.688 4.83011 12.0411 6.02086 12.0411C6.81149 12.0411 7.59438 11.8854 8.32483 11.5828C8.87005 11.357 9.37808 11.0526 9.83317 10.6803L12.9769 13.8241C13.0323 13.8801 13.0983 13.9245 13.171 13.9548C13.2438 13.985 13.3219 14.0003 13.4007 14C13.4795 14.0003 13.5575 13.985 13.6303 13.9548C13.7031 13.9245 13.7691 13.8801 13.8244 13.8241C13.9367 13.7116 13.9998 13.5592 13.9998 13.4003C13.9998 13.2414 13.9367 13.089 13.8244 12.9765L10.6807 9.8328C11.053 9.37773 11.3573 8.86972 11.5831 8.32452C11.8857 7.59408 12.0414 6.81119 12.0414 6.02056C12.0414 4.8298 11.6883 3.66579 11.0268 2.67572C10.3652 1.68564 9.42494 0.913972 8.32483 0.45829C7.22472 0.00260857 6.01418 -0.116618 4.84631 0.115686C3.67844 0.34799 2.60568 0.921393 1.76369 1.76338C0.921698 2.60537 0.348296 3.67813 0.115991 4.84601C-0.116313 6.01388 0.00291375 7.22441 0.458595 8.32452C0.914277 9.42464 1.68595 10.3649 2.67602 11.0265ZM3.35565 2.0158C4.14456 1.48867 5.07206 1.20731 6.02086 1.20731C7.29317 1.20731 8.51338 1.71274 9.41304 2.6124C10.3127 3.51206 10.8181 4.73226 10.8181 6.00457C10.8181 6.95337 10.5368 7.88088 10.0096 8.66978C9.48251 9.45868 8.73328 10.0736 7.85669 10.4367C6.98011 10.7997 6.01554 10.8947 5.08496 10.7096C4.15439 10.5245 3.2996 10.0676 2.62869 9.39674C1.95778 8.72583 1.50089 7.87104 1.31579 6.94046C1.13068 6.00989 1.22568 5.04532 1.58878 4.16874C1.95187 3.29215 2.56675 2.54292 3.35565 2.0158Z",fill:"currentColor"},null,-1)]),16)}Fl.render=B0;var Pl={name:"TimesIcon",extends:nn};function $0(e,t,n,r,a,i){return o.openBlock(),o.createElementBlock("svg",o.mergeProps({width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.pti()),t[0]||(t[0]=[o.createElementVNode("path",{d:"M8.01186 7.00933L12.27 2.75116C12.341 2.68501 12.398 2.60524 12.4375 2.51661C12.4769 2.42798 12.4982 2.3323 12.4999 2.23529C12.5016 2.13827 12.4838 2.0419 12.4474 1.95194C12.4111 1.86197 12.357 1.78024 12.2884 1.71163C12.2198 1.64302 12.138 1.58893 12.0481 1.55259C11.9581 1.51625 11.8617 1.4984 11.7647 1.50011C11.6677 1.50182 11.572 1.52306 11.4834 1.56255C11.3948 1.60204 11.315 1.65898 11.2488 1.72997L6.99067 5.98814L2.7325 1.72997C2.59553 1.60234 2.41437 1.53286 2.22718 1.53616C2.03999 1.53946 1.8614 1.61529 1.72901 1.74767C1.59663 1.88006 1.5208 2.05865 1.5175 2.24584C1.5142 2.43303 1.58368 2.61419 1.71131 2.75116L5.96948 7.00933L1.71131 11.2675C1.576 11.403 1.5 11.5866 1.5 11.7781C1.5 11.9696 1.576 12.1532 1.71131 12.2887C1.84679 12.424 2.03043 12.5 2.2219 12.5C2.41338 12.5 2.59702 12.424 2.7325 12.2887L6.99067 8.03052L11.2488 12.2887C11.3843 12.424 11.568 12.5 11.7594 12.5C11.9509 12.5 12.1346 12.424 12.27 12.2887C12.4053 12.1532 12.4813 11.9696 12.4813 11.7781C12.4813 11.5866 12.4053 11.403 12.27 11.2675L8.01186 7.00933Z",fill:"currentColor"},null,-1)]),16)}Pl.render=$0;var N0=function(t){var n=t.dt;return`
|
|
933
933
|
.p-iconfield {
|
|
934
934
|
position: relative;
|
|
935
935
|
}
|