@gemafajarramadhan/dynamic-ui 1.2.49 → 1.2.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,21 +1,21 @@
1
- (function(xe,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lucide-vue-next"),require("reka-ui"),require("@vueuse/core"),require("vue-i18n"),require("@vuepic/vue-datepicker"),require("@uppy/core"),require("@uppy/dashboard"),require("@uppy/image-editor"),require("vue-router"),require("vue3-lottie")):typeof define=="function"&&define.amd?define(["exports","vue","lucide-vue-next","reka-ui","@vueuse/core","vue-i18n","@vuepic/vue-datepicker","@uppy/core","@uppy/dashboard","@uppy/image-editor","vue-router","vue3-lottie"],e):(xe=typeof globalThis<"u"?globalThis:xe||self,e(xe.DynamicUI={},xe.Vue,xe.LucideIcons,xe.rekaUi,xe.core,xe.VueI18n,xe.VueDatePicker,xe.Uppy,xe.UppyDashboard,xe.UppyImageEditor,xe.VueRouter,xe.Vue3Lottie))})(this,(function(xe,e,ue,Ne,ft,Rt,bu,yu,di,xu,zn,ku){"use strict";var SA=Object.defineProperty;var AA=(xe,e,ue)=>e in xe?SA(xe,e,{enumerable:!0,configurable:!0,writable:!0,value:ue}):xe[e]=ue;var _e=(xe,e,ue)=>AA(xe,typeof e!="symbol"?e+"":e,ue);var xa;function wu(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const qt=wu(ue);let Gt={};function ui(t){Gt={...Gt,...t}}function Cu(){return Gt}function Eu(){return Gt.apiBaseUrl?Gt.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function Bu(){const t={"Content-Type":"application/json",Accept:"application/json"};let n=null;if(Gt.getAuthToken?n=Gt.getAuthToken():typeof window<"u"&&window.__MICRO_AUTH_TOKEN__?n=window.__MICRO_AUTH_TOKEN__:typeof localStorage<"u"&&(n=localStorage.getItem("token")||sessionStorage.getItem("token")),n&&(t.Authorization=`Bearer ${n}`),Gt.getHeaders){const o=Gt.getHeaders();return{...t,...o}}return t}function _u(){Gt.onUnauthorized&&Gt.onUnauthorized()}async function fi(t,n,o,r){const a=Cu();if(a.apiClient)return a.apiClient(t,n||"GET",o);if(!t||!t.trim())throw new Error("[DynamicUI][useApi] URL tidak boleh kosong. Pastikan prop `endpoint.apiUrl` sudah diisi dengan benar.");const s=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],i=(n||"").trim().toUpperCase(),l=s.includes(i)?i:"GET";s.includes(i)||console.warn(`[DynamicUI][useApi] HTTP method '${n}' tidak valid, fallback ke 'GET'.`);const c=Eu(),d=t.startsWith("http")?t:`${c}${t}`,u={method:l,headers:{...Bu(),...r||{}}};o&&!["GET","DELETE"].includes(l)&&(o instanceof FormData?(u.body=o,u.headers&&u.headers["Content-Type"]&&delete u.headers["Content-Type"],u.headers&&u.headers["content-type"]&&delete u.headers["content-type"]):u.body=JSON.stringify(o));let h=d;if(o&&l==="GET"){const g=new URLSearchParams;Object.entries(o).forEach(([x,p])=>{p!=null&&g.append(x,String(p))});const b=g.toString();b&&(h=`${d}${d.includes("?")?"&":"?"}${b}`)}const f=await fetch(h,u);if(f.status===401&&_u(),!f.ok){const g=await f.text();throw new Error(`HTTP ${f.status}: ${g}`)}return(f.headers.get("content-type")||"").includes("application/json")?f.json():{status:!0,data:await f.text()}}function mt(){return{apiUrl:(o,r,a,s)=>fi(o,r,a,s),DCodeApi:(o,r,a,s)=>{let i=o,l=r,c=a;return s&&s._url?(i=s._url,l=s._method||l||"POST",s._data&&(c={...c||{},...s._data})):o&&r&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(r.toUpperCase())||(i=`${o.endsWith("/")?o.slice(0,-1):o}/${r}`,l="POST")),fi(i,l,c,s==null?void 0:s.headers)}}}const no=Math.min,Mt=Math.max,sr=Math.round,ir=Math.floor,Qt=t=>({x:t,y:t}),Su={left:"right",right:"left",bottom:"top",top:"bottom"};function hi(t,n,o){return Mt(t,no(n,o))}function _o(t,n){return typeof t=="function"?t(n):t}function En(t){return t.split("-")[0]}function So(t){return t.split("-")[1]}function mi(t){return t==="x"?"y":"x"}function pi(t){return t==="y"?"height":"width"}function un(t){const n=t[0];return n==="t"||n==="b"?"y":"x"}function gi(t){return mi(un(t))}function Au(t,n,o){o===void 0&&(o=!1);const r=So(t),a=gi(t),s=pi(a);let i=a==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return n.reference[s]>n.floating[s]&&(i=lr(i)),[i,lr(i)]}function Vu(t){const n=lr(t);return[Ea(t),n,Ea(n)]}function Ea(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const bi=["left","right"],yi=["right","left"],Du=["top","bottom"],Nu=["bottom","top"];function Mu(t,n,o){switch(t){case"top":case"bottom":return o?n?yi:bi:n?bi:yi;case"left":case"right":return n?Du:Nu;default:return[]}}function vu(t,n,o,r){const a=So(t);let s=Mu(En(t),o==="start",r);return a&&(s=s.map(i=>i+"-"+a),n&&(s=s.concat(s.map(Ea)))),s}function lr(t){const n=En(t);return Su[n]+t.slice(n.length)}function Pu(t){return{top:0,right:0,bottom:0,left:0,...t}}function Tu(t){return typeof t!="number"?Pu(t):{top:t,right:t,bottom:t,left:t}}function cr(t){const{x:n,y:o,width:r,height:a}=t;return{width:r,height:a,top:o,left:n,right:n+r,bottom:o+a,x:n,y:o}}function xi(t,n,o){let{reference:r,floating:a}=t;const s=un(n),i=gi(n),l=pi(i),c=En(n),d=s==="y",u=r.x+r.width/2-a.width/2,h=r.y+r.height/2-a.height/2,f=r[l]/2-a[l]/2;let m;switch(c){case"top":m={x:u,y:r.y-a.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-a.width,y:h};break;default:m={x:r.x,y:r.y}}switch(So(n)){case"start":m[i]-=f*(o&&d?-1:1);break;case"end":m[i]+=f*(o&&d?-1:1);break}return m}async function Ou(t,n){var o;n===void 0&&(n={});const{x:r,y:a,platform:s,rects:i,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:f=!1,padding:m=0}=_o(n,t),g=Tu(m),x=l[f?h==="floating"?"reference":"floating":h],p=cr(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(x)))==null||o?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),C=h==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),E=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},_=cr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:w,strategy:c}):C);return{top:(p.top-_.top+g.top)/E.y,bottom:(_.bottom-p.bottom+g.bottom)/E.y,left:(p.left-_.left+g.left)/E.x,right:(_.right-p.right+g.right)/E.x}}const Fu=50,zu=async(t,n,o)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:i}=o,l=i.detectOverflow?i:{...i,detectOverflow:Ou},c=await(i.isRTL==null?void 0:i.isRTL(n));let d=await i.getElementRects({reference:t,floating:n,strategy:a}),{x:u,y:h}=xi(d,r,c),f=r,m=0;const g={};for(let b=0;b<s.length;b++){const x=s[b];if(!x)continue;const{name:p,fn:C}=x,{x:w,y:E,data:_,reset:B}=await C({x:u,y:h,initialPlacement:r,placement:f,strategy:a,middlewareData:g,rects:d,platform:l,elements:{reference:t,floating:n}});u=w??u,h=E??h,g[p]={...g[p],..._},B&&m<Fu&&(m++,typeof B=="object"&&(B.placement&&(f=B.placement),B.rects&&(d=B.rects===!0?await i.getElementRects({reference:t,floating:n,strategy:a}):B.rects),{x:u,y:h}=xi(d,f,c)),b=-1)}return{x:u,y:h,placement:f,strategy:a,middlewareData:g}},Iu=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var o,r;const{placement:a,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=n,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...x}=_o(t,n);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const p=En(a),C=un(l),w=En(l)===l,E=await(c.isRTL==null?void 0:c.isRTL(d.floating)),_=f||(w||!b?[lr(l)]:Vu(l)),B=g!=="none";!f&&B&&_.push(...vu(l,b,g,E));const k=[l,..._],y=await c.detectOverflow(n,x),V=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&V.push(y[p]),h){const P=Au(a,i,E);V.push(y[P[0]],y[P[1]])}if(D=[...D,{placement:a,overflows:V}],!V.every(P=>P<=0)){var N,A;const P=(((N=s.flip)==null?void 0:N.index)||0)+1,X=k[P];if(X&&(!(h==="alignment"?C!==un(X):!1)||D.every(ne=>un(ne.placement)===C?ne.overflows[0]>0:!0)))return{data:{index:P,overflows:D},reset:{placement:X}};let $=(A=D.filter(G=>G.overflows[0]<=0).sort((G,ne)=>G.overflows[1]-ne.overflows[1])[0])==null?void 0:A.placement;if(!$)switch(m){case"bestFit":{var T;const G=(T=D.filter(ne=>{if(B){const K=un(ne.placement);return K===C||K==="y"}return!0}).map(ne=>[ne.placement,ne.overflows.filter(K=>K>0).reduce((K,R)=>K+R,0)]).sort((ne,K)=>ne[1]-K[1])[0])==null?void 0:T[0];G&&($=G);break}case"initialPlacement":$=l;break}if(a!==$)return{reset:{placement:$}}}return{}}}},Ru=new Set(["left","top"]);async function Lu(t,n){const{placement:o,platform:r,elements:a}=t,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=En(o),l=So(o),c=un(o)==="y",d=Ru.has(i)?-1:1,u=s&&c?-1:1,h=_o(n,t);let{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*u,y:f*d}:{x:f*d,y:m*u}}const $u=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var o,r;const{x:a,y:s,placement:i,middlewareData:l}=n,c=await Lu(n,t);return i===((o=l.offset)==null?void 0:o.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:s+c.y,data:{...c,placement:i}}}}},ju=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:o,y:r,placement:a,platform:s}=n,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:p=>{let{x:C,y:w}=p;return{x:C,y:w}}},...d}=_o(t,n),u={x:o,y:r},h=await s.detectOverflow(n,d),f=un(En(a)),m=mi(f);let g=u[m],b=u[f];if(i){const p=m==="y"?"top":"left",C=m==="y"?"bottom":"right",w=g+h[p],E=g-h[C];g=hi(w,g,E)}if(l){const p=f==="y"?"top":"left",C=f==="y"?"bottom":"right",w=b+h[p],E=b-h[C];b=hi(w,b,E)}const x=c.fn({...n,[m]:g,[f]:b});return{...x,data:{x:x.x-o,y:x.y-r,enabled:{[m]:i,[f]:l}}}}}},Wu=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(n){var o,r;const{placement:a,rects:s,platform:i,elements:l}=n,{apply:c=()=>{},...d}=_o(t,n),u=await i.detectOverflow(n,d),h=En(a),f=So(a),m=un(a)==="y",{width:g,height:b}=s.floating;let x,p;h==="top"||h==="bottom"?(x=h,p=f===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(p=h,x=f==="end"?"top":"bottom");const C=b-u.top-u.bottom,w=g-u.left-u.right,E=no(b-u[x],C),_=no(g-u[p],w),B=!n.middlewareData.shift;let k=E,y=_;if((o=n.middlewareData.shift)!=null&&o.enabled.x&&(y=w),(r=n.middlewareData.shift)!=null&&r.enabled.y&&(k=C),B&&!f){const D=Mt(u.left,0),N=Mt(u.right,0),A=Mt(u.top,0),T=Mt(u.bottom,0);m?y=g-2*(D!==0||N!==0?D+N:Mt(u.left,u.right)):k=b-2*(A!==0||T!==0?A+T:Mt(u.top,u.bottom))}await c({...n,availableWidth:y,availableHeight:k});const V=await i.getDimensions(l.floating);return g!==V.width||b!==V.height?{reset:{rects:!0}}:{}}}};function dr(){return typeof window<"u"}function In(t){return Ba(t)?(t.nodeName||"").toLowerCase():"#document"}function vt(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function Zt(t){var n;return(n=(Ba(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function Ba(t){return dr()?t instanceof Node||t instanceof vt(t).Node:!1}function Xt(t){return dr()?t instanceof Element||t instanceof vt(t).Element:!1}function fn(t){return dr()?t instanceof HTMLElement||t instanceof vt(t).HTMLElement:!1}function ki(t){return!dr()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof vt(t).ShadowRoot}function Ao(t){const{overflow:n,overflowX:o,overflowY:r,display:a}=Kt(t);return/auto|scroll|overlay|hidden|clip/.test(n+r+o)&&a!=="inline"&&a!=="contents"}function Uu(t){return/^(table|td|th)$/.test(In(t))}function ur(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Hu=/transform|translate|scale|rotate|perspective|filter/,qu=/paint|layout|strict|content/,Rn=t=>!!t&&t!=="none";let _a;function Sa(t){const n=Xt(t)?Kt(t):t;return Rn(n.transform)||Rn(n.translate)||Rn(n.scale)||Rn(n.rotate)||Rn(n.perspective)||!Aa()&&(Rn(n.backdropFilter)||Rn(n.filter))||Hu.test(n.willChange||"")||qu.test(n.contain||"")}function Gu(t){let n=Bn(t);for(;fn(n)&&!oo(n);){if(Sa(n))return n;if(ur(n))return null;n=Bn(n)}return null}function Aa(){return _a==null&&(_a=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_a}function oo(t){return/^(html|body|#document)$/.test(In(t))}function Kt(t){return vt(t).getComputedStyle(t)}function fr(t){return Xt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Bn(t){if(In(t)==="html")return t;const n=t.assignedSlot||t.parentNode||ki(t)&&t.host||Zt(t);return ki(n)?n.host:n}function wi(t){const n=Bn(t);return oo(n)?t.ownerDocument?t.ownerDocument.body:t.body:fn(n)&&Ao(n)?n:wi(n)}function Vo(t,n,o){var r;n===void 0&&(n=[]),o===void 0&&(o=!0);const a=wi(t),s=a===((r=t.ownerDocument)==null?void 0:r.body),i=vt(a);if(s){const l=Va(i);return n.concat(i,i.visualViewport||[],Ao(a)?a:[],l&&o?Vo(l):[])}else return n.concat(a,Vo(a,[],o))}function Va(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ci(t){const n=Kt(t);let o=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const a=fn(t),s=a?t.offsetWidth:o,i=a?t.offsetHeight:r,l=sr(o)!==s||sr(r)!==i;return l&&(o=s,r=i),{width:o,height:r,$:l}}function Da(t){return Xt(t)?t:t.contextElement}function ro(t){const n=Da(t);if(!fn(n))return Qt(1);const o=n.getBoundingClientRect(),{width:r,height:a,$:s}=Ci(n);let i=(s?sr(o.width):o.width)/r,l=(s?sr(o.height):o.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Xu=Qt(0);function Ei(t){const n=vt(t);return!Aa()||!n.visualViewport?Xu:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Ku(t,n,o){return n===void 0&&(n=!1),!o||n&&o!==vt(t)?!1:n}function Ln(t,n,o,r){n===void 0&&(n=!1),o===void 0&&(o=!1);const a=t.getBoundingClientRect(),s=Da(t);let i=Qt(1);n&&(r?Xt(r)&&(i=ro(r)):i=ro(t));const l=Ku(s,o,r)?Ei(s):Qt(0);let c=(a.left+l.x)/i.x,d=(a.top+l.y)/i.y,u=a.width/i.x,h=a.height/i.y;if(s){const f=vt(s),m=r&&Xt(r)?vt(r):r;let g=f,b=Va(g);for(;b&&r&&m!==g;){const x=ro(b),p=b.getBoundingClientRect(),C=Kt(b),w=p.left+(b.clientLeft+parseFloat(C.paddingLeft))*x.x,E=p.top+(b.clientTop+parseFloat(C.paddingTop))*x.y;c*=x.x,d*=x.y,u*=x.x,h*=x.y,c+=w,d+=E,g=vt(b),b=Va(g)}}return cr({width:u,height:h,x:c,y:d})}function hr(t,n){const o=fr(t).scrollLeft;return n?n.left+o:Ln(Zt(t)).left+o}function Bi(t,n){const o=t.getBoundingClientRect(),r=o.left+n.scrollLeft-hr(t,o),a=o.top+n.scrollTop;return{x:r,y:a}}function Yu(t){let{elements:n,rect:o,offsetParent:r,strategy:a}=t;const s=a==="fixed",i=Zt(r),l=n?ur(n.floating):!1;if(r===i||l&&s)return o;let c={scrollLeft:0,scrollTop:0},d=Qt(1);const u=Qt(0),h=fn(r);if((h||!h&&!s)&&((In(r)!=="body"||Ao(i))&&(c=fr(r)),h)){const m=Ln(r);d=ro(r),u.x=m.x+r.clientLeft,u.y=m.y+r.clientTop}const f=i&&!h&&!s?Bi(i,c):Qt(0);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-c.scrollLeft*d.x+u.x+f.x,y:o.y*d.y-c.scrollTop*d.y+u.y+f.y}}function Ju(t){return Array.from(t.getClientRects())}function Qu(t){const n=Zt(t),o=fr(t),r=t.ownerDocument.body,a=Mt(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),s=Mt(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let i=-o.scrollLeft+hr(t);const l=-o.scrollTop;return Kt(r).direction==="rtl"&&(i+=Mt(n.clientWidth,r.clientWidth)-a),{width:a,height:s,x:i,y:l}}const _i=25;function Zu(t,n){const o=vt(t),r=Zt(t),a=o.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,c=0;if(a){s=a.width,i=a.height;const u=Aa();(!u||u&&n==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const d=hr(r);if(d<=0){const u=r.ownerDocument,h=u.body,f=getComputedStyle(h),m=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,g=Math.abs(r.clientWidth-h.clientWidth-m);g<=_i&&(s-=g)}else d<=_i&&(s+=d);return{width:s,height:i,x:l,y:c}}function ef(t,n){const o=Ln(t,!0,n==="fixed"),r=o.top+t.clientTop,a=o.left+t.clientLeft,s=fn(t)?ro(t):Qt(1),i=t.clientWidth*s.x,l=t.clientHeight*s.y,c=a*s.x,d=r*s.y;return{width:i,height:l,x:c,y:d}}function Si(t,n,o){let r;if(n==="viewport")r=Zu(t,o);else if(n==="document")r=Qu(Zt(t));else if(Xt(n))r=ef(n,o);else{const a=Ei(t);r={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return cr(r)}function Ai(t,n){const o=Bn(t);return o===n||!Xt(o)||oo(o)?!1:Kt(o).position==="fixed"||Ai(o,n)}function tf(t,n){const o=n.get(t);if(o)return o;let r=Vo(t,[],!1).filter(l=>Xt(l)&&In(l)!=="body"),a=null;const s=Kt(t).position==="fixed";let i=s?Bn(t):t;for(;Xt(i)&&!oo(i);){const l=Kt(i),c=Sa(i);!c&&l.position==="fixed"&&(a=null),(s?!c&&!a:!c&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||Ao(i)&&!c&&Ai(t,i))?r=r.filter(u=>u!==i):a=l,i=Bn(i)}return n.set(t,r),r}function nf(t){let{element:n,boundary:o,rootBoundary:r,strategy:a}=t;const i=[...o==="clippingAncestors"?ur(n)?[]:tf(n,this._c):[].concat(o),r],l=Si(n,i[0],a);let c=l.top,d=l.right,u=l.bottom,h=l.left;for(let f=1;f<i.length;f++){const m=Si(n,i[f],a);c=Mt(m.top,c),d=no(m.right,d),u=no(m.bottom,u),h=Mt(m.left,h)}return{width:d-h,height:u-c,x:h,y:c}}function of(t){const{width:n,height:o}=Ci(t);return{width:n,height:o}}function rf(t,n,o){const r=fn(n),a=Zt(n),s=o==="fixed",i=Ln(t,!0,s,n);let l={scrollLeft:0,scrollTop:0};const c=Qt(0);function d(){c.x=hr(a)}if(r||!r&&!s)if((In(n)!=="body"||Ao(a))&&(l=fr(n)),r){const m=Ln(n,!0,s,n);c.x=m.x+n.clientLeft,c.y=m.y+n.clientTop}else a&&d();s&&!r&&a&&d();const u=a&&!r&&!s?Bi(a,l):Qt(0),h=i.left+l.scrollLeft-c.x-u.x,f=i.top+l.scrollTop-c.y-u.y;return{x:h,y:f,width:i.width,height:i.height}}function Na(t){return Kt(t).position==="static"}function Vi(t,n){if(!fn(t)||Kt(t).position==="fixed")return null;if(n)return n(t);let o=t.offsetParent;return Zt(t)===o&&(o=o.ownerDocument.body),o}function Di(t,n){const o=vt(t);if(ur(t))return o;if(!fn(t)){let a=Bn(t);for(;a&&!oo(a);){if(Xt(a)&&!Na(a))return a;a=Bn(a)}return o}let r=Vi(t,n);for(;r&&Uu(r)&&Na(r);)r=Vi(r,n);return r&&oo(r)&&Na(r)&&!Sa(r)?o:r||Gu(t)||o}const af=async function(t){const n=this.getOffsetParent||Di,o=this.getDimensions,r=await o(t.floating);return{reference:rf(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sf(t){return Kt(t).direction==="rtl"}const lf={convertOffsetParentRelativeRectToViewportRelativeRect:Yu,getDocumentElement:Zt,getClippingRect:nf,getOffsetParent:Di,getElementRects:af,getClientRects:Ju,getDimensions:of,getScale:ro,isElement:Xt,isRTL:sf};function Ni(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function cf(t,n){let o=null,r;const a=Zt(t);function s(){var l;clearTimeout(r),(l=o)==null||l.disconnect(),o=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=t.getBoundingClientRect(),{left:u,top:h,width:f,height:m}=d;if(l||n(),!f||!m)return;const g=ir(h),b=ir(a.clientWidth-(u+f)),x=ir(a.clientHeight-(h+m)),p=ir(u),w={rootMargin:-g+"px "+-b+"px "+-x+"px "+-p+"px",threshold:Mt(0,no(1,c))||1};let E=!0;function _(B){const k=B[0].intersectionRatio;if(k!==c){if(!E)return i();k?i(!1,k):r=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!Ni(d,t.getBoundingClientRect())&&i(),E=!1}try{o=new IntersectionObserver(_,{...w,root:a.ownerDocument})}catch{o=new IntersectionObserver(_,w)}o.observe(t)}return i(!0),s}function Ma(t,n,o,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Da(t),u=a||s?[...d?Vo(d):[],...n?Vo(n):[]]:[];u.forEach(p=>{a&&p.addEventListener("scroll",o,{passive:!0}),s&&p.addEventListener("resize",o)});const h=d&&l?cf(d,o):null;let f=-1,m=null;i&&(m=new ResizeObserver(p=>{let[C]=p;C&&C.target===d&&m&&n&&(m.unobserve(n),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(n)})),o()}),d&&!c&&m.observe(d),n&&m.observe(n));let g,b=c?Ln(t):null;c&&x();function x(){const p=Ln(t);b&&!Ni(b,p)&&o(),b=p,g=requestAnimationFrame(x)}return o(),()=>{var p;u.forEach(C=>{a&&C.removeEventListener("scroll",o),s&&C.removeEventListener("resize",o)}),h==null||h(),(p=m)==null||p.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const va=$u,Pa=ju,Ta=Iu,Oa=Wu,df=(t,n,o)=>{const r=new Map,a={platform:lf,...o},s={...a.platform,_c:r};return zu(t,n,{...a,platform:s})};function uf(t){return t!=null&&typeof t=="object"&&"$el"in t}function Mi(t){if(uf(t)){const n=t.$el;return Ba(n)&&In(n)==="#comment"?null:n}return t}function Do(t){return typeof t=="function"?t():e.unref(t)}function vi(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Pi(t,n){const o=vi(t);return Math.round(n*o)/o}function Fa(t,n,o){o===void 0&&(o={});const r=o.whileElementsMounted,a=e.computed(()=>{var k;return(k=Do(o.open))!=null?k:!0}),s=e.computed(()=>Do(o.middleware)),i=e.computed(()=>{var k;return(k=Do(o.placement))!=null?k:"bottom"}),l=e.computed(()=>{var k;return(k=Do(o.strategy))!=null?k:"absolute"}),c=e.computed(()=>{var k;return(k=Do(o.transform))!=null?k:!0}),d=e.computed(()=>Mi(t.value)),u=e.computed(()=>Mi(n.value)),h=e.ref(0),f=e.ref(0),m=e.ref(l.value),g=e.ref(i.value),b=e.shallowRef({}),x=e.ref(!1),p=e.computed(()=>{const k={position:m.value,left:"0",top:"0"};if(!u.value)return k;const y=Pi(u.value,h.value),V=Pi(u.value,f.value);return c.value?{...k,transform:"translate("+y+"px, "+V+"px)",...vi(u.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:y+"px",top:V+"px"}});let C;function w(){if(d.value==null||u.value==null)return;const k=a.value;df(d.value,u.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(y=>{h.value=y.x,f.value=y.y,m.value=y.strategy,g.value=y.placement,b.value=y.middlewareData,x.value=k!==!1})}function E(){typeof C=="function"&&(C(),C=void 0)}function _(){if(E(),r===void 0){w();return}if(d.value!=null&&u.value!=null){C=r(d.value,u.value,w);return}}function B(){a.value||(x.value=!1)}return e.watch([s,i,l,a],w,{flush:"sync"}),e.watch([d,u],_,{flush:"sync"}),e.watch(a,B,{flush:"sync"}),e.getCurrentScope()&&e.onScopeDispose(E),{x:e.shallowReadonly(h),y:e.shallowReadonly(f),strategy:e.shallowReadonly(m),placement:e.shallowReadonly(g),middlewareData:e.shallowReadonly(b),isPositioned:e.shallowReadonly(x),floatingStyles:p,update:w}}const ff=["aria-busy"],hf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},mf=["for"],pf={key:0,class:"ml-1 text-destructive"},gf={class:"relative"},bf={key:0,class:"flex items-center text-gray-500 gap-2"},yf=["id","placeholder","disabled","readonly","value"],xf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},kf=["disabled"],wf={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},Cf=["onMouseenter","onClick"],Ef={key:0},Bf={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},_f={key:0},Sf={key:1},Af={key:2},Vf={key:1,class:"mt-1 text-xs text-red-600"},mr=e.defineComponent({name:"DCodeAutoComplete",inheritAttrs:!1,__name:"DCodeAutoComplete",props:{modelValue:{},apiModule:{},apiAction:{},apiOptions:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},error:{default:null},errorMessage:{default:null},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},returnObject:{type:Boolean,default:!1},endpoint:{},apiParams:{default:()=>({})},fetchItems:{},icon:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.computed(()=>a.label??void 0),i=H=>{const he=a[H];return he===""||he===!0||he==="true"||he===1||he==="1"},l=e.ref(!1),c=e.computed(()=>o.itemTitle||a["item-title"]||a.itemTitle||"name"),d=e.computed(()=>o.itemValue||a["item-value"]||a.itemValue||"id"),u=e.computed(()=>o.disabled),h=e.computed(()=>i("required")),f=e.computed(()=>i("readonly")),m=e.computed(()=>o.returnObject||i("return-object")||i("returnObject")),g=e.computed(()=>h.value||i("aria-required")),b=e.computed(()=>o.error||o.errorMessage||a["error-message"]),x=e.computed(()=>a.placeholder??""),p=e.computed(()=>{const H=a.minChars??a["min-chars"];if(H==null||H==="")return 0;const he=typeof H=="number"?H:Number.parseInt(String(H),10);return Number.isFinite(he)&&he>0?he:0}),C=e.computed(()=>{const H=a.rules;return Array.isArray(H)?H:[]}),w=e.computed(()=>{const H=a.id||a.label;return H?`app-autocomplete-${H}-${Math.random().toString(36).slice(2,7)}`:void 0}),E=e.ref(o.modelValue),_=e.ref([]),B=e.ref(!1),k=e.ref(!1),y=e.computed(()=>a.items),V=e.computed(()=>{const H=P.value;return H.apiModule&&H.apiAction||H.apiUrl||o.fetchItems?_.value:y.value??[]}),D=e.computed(()=>!!a.loading),N=e.computed(()=>D.value||B.value),A=e.computed(()=>{const{label:H,items:he,loading:ye,rules:He,"item-title":Le,"item-value":ae,itemTitle:fe,itemValue:be,minChars:Te,"min-chars":lt,clearable:Ut,required:M,"aria-required":I,disabled:U,readonly:v,visible:L,"return-object":J,returnObject:te,class:q,"fetch-items":ce,fetchItems:ke,error:pe,errorMessage:de,"error-message":we,...Se}=a||{};return Se}),T=()=>{if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions},P=e.computed(()=>{const H=o.endpoint||{};return{apiModule:o.apiModule||H.apiModule,apiAction:o.apiAction||H.apiAction,apiUrl:H.apiUrl,apiMethod:H.apiMethod||"GET"}}),X=e.ref(null),$=e.ref(null),G=e.ref(null),{floatingStyles:ne}=Fa($,G,{placement:"bottom-start",whileElementsMounted:Ma,middleware:[va(4),Ta(),Pa(),Oa({apply({rects:H,elements:he,availableHeight:ye}){Object.assign(he.floating.style,{width:`${H.reference.width}px`,maxHeight:`${ye}px`})}})]}),K=e.ref(!1),R=e.ref(""),j=e.ref(-1),se=e.ref(null),ee=e.computed(()=>!p.value||(R.value||"").trim().length>=p.value?"":`Ketik minimal ${p.value} karakter`),Y=H=>{if(H==null)return"";if(typeof H=="string"||typeof H=="number")return String(H);const he=c.value;return typeof he=="function"?he(H):(H==null?void 0:H[he])??(H==null?void 0:H.name)??(H==null?void 0:H.nama)??(H==null?void 0:H.label)??(H==null?void 0:H.title)??"-"},le=H=>{if(H==null)return null;if(typeof H=="string"||typeof H=="number")return H;const he=d.value;return typeof he=="function"?he(H):(H==null?void 0:H[he])??(H==null?void 0:H.id)??(H==null?void 0:H.value)??(H==null?void 0:H.code)??null},ge=e.computed(()=>{const H=E.value;if(H==null||H==="")return"";if(Array.isArray(H))return H.length?H.map(He=>{if(m.value&&typeof He=="object"||typeof He=="object")return Y(He);const Le=V.value.find(ae=>le(ae)==He);return Le?Y(Le):String(He)}).join(", "):"";if(typeof H=="object")return Y(H);const he=V.value.find(ye=>le(ye)==H);return he?Y(he):String(H)}),Me=e.computed(()=>{const H=V.value||[],he=(R.value||"").trim().toLowerCase(),ye=(ge.value||"").toLowerCase(),He=!he||he===ye;let Le=H;if(He||(Le=H.filter(ae=>Y(ae).toLowerCase().includes(he))),Le.length>0){const ae=fe=>{const be=le(fe);return Array.isArray(E.value)?E.value.some(Te=>Te==be):E.value==be};Le=[...Le].sort((fe,be)=>{const Te=ae(fe),lt=ae(be);return Te&&!lt?-1:!Te&&lt?1:0})}return Le}),ve=H=>Array.isArray(H)?H.length===0:H==null||H==="",Ee=H=>{if(se.value=null,h.value&&ve(H)&&!C.value.length)return se.value="This field is required",!1;for(const he of C.value){const ye=he(H);if(ye===!1)return se.value="Invalid value",!1;if(typeof ye=="string")return se.value=ye,!1}return!0},Z=async()=>{if(u.value||f.value)return;K.value=!0,j.value=Me.value.length?0:-1,R.value=ge.value||"";const H=P.value,he=H.apiModule&&H.apiAction||H.apiUrl||o.fetchItems;o.autoFetchOnOpen&&he&&!k.value&&(await Qe(),j.value=Me.value.length?0:-1)},O=()=>{K.value=!1,j.value=-1,R.value=ge.value||""},Q=H=>{const he=m.value?H:le(H);let ye=he;Array.isArray(E.value)&&(ye=[he]),E.value=ye,r("update:modelValue",ye),se.value=null,Ee(ye),R.value=Y(H),O()},ie=()=>{_.value=[],k.value=!1,E.value=Array.isArray(E.value)?[]:null,r("update:modelValue",E.value),R.value="",se.value=null},Ae=()=>{l.value=!0,ie(),O(),setTimeout(()=>{l.value=!1},0)},ze=H=>{if(u.value||f.value)return;const he=H.target.value;R.value=he,se.value&&(se.value=null),K.value||(K.value=!0),j.value=Me.value.length?0:-1;const ye=P.value.apiModule&&P.value.apiAction||P.value.apiUrl||o.fetchItems;o.autoFetchOnOpen&&ye&&!N.value&&!k.value&&Qe()},Ye=H=>{var ye;if(u.value||f.value)return;const he={ArrowDown:()=>{if(H.preventDefault(),!K.value){Z();return}Me.value.length&&(j.value=Math.min(j.value+1,Me.value.length-1))},ArrowUp:()=>{!K.value||!Me.value.length||(H.preventDefault(),j.value=Math.max(j.value-1,0))},Enter:()=>{if(!K.value)return;H.preventDefault();const He=Me.value[j.value];He&&Q(He)},Escape:()=>{H.preventDefault(),O()},Tab:()=>{O()}};(ye=he[H.key])==null||ye.call(he)},Qe=async()=>{const H=P.value;if(H.apiModule&&H.apiAction||H.apiUrl||o.fetchItems){B.value=!0;try{let ye;if(o.fetchItems){const He=T()||{},Le={page:1,perPage:100,search:(R.value||"").trim(),...He,...o.apiParams},ae=await o.fetchItems(Le),fe=(ae==null?void 0:ae.data)??ae;ye=(fe==null?void 0:fe.data)??fe}else{const Le=mt().DCodeApi;if(typeof Le!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const fe={page:1,perPage:100,...T()||{},...o.apiParams};let be;H.apiUrl?be=await Le("","",fe,{_url:H.apiUrl,_method:H.apiMethod||"POST"}):be=await Le(H.apiModule,H.apiAction,fe);const Te=(be==null?void 0:be.data)??be;ye=(Te==null?void 0:Te.data)??Te}_.value=Array.isArray(ye)?ye:[],k.value=!0}catch(ye){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",ye),se.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(ye==null?void 0:ye.message)||(ye==null?void 0:ye.toString())||"Failed to load options"}`,_.value=[],k.value=!0}finally{B.value=!1}}},at=H=>{const he=le(H);return m.value?E.value?Array.isArray(E.value)?E.value.some(ye=>le(ye)==he):le(E.value)==he:!1:Array.isArray(E.value)?E.value.some(ye=>ye==he):E.value==he};e.watch(()=>[T(),P.value,o.apiParams],([H,he,ye],[He,Le,ae])=>{const fe=P.value;if(!(fe.apiModule&&fe.apiAction||fe.apiUrl||o.fetchItems)){ie();return}const Te=JSON.stringify(H??null)===JSON.stringify(He??null),lt=JSON.stringify(ye??null)===JSON.stringify(ae??null);Te&&lt||(ie(),lt||Qe())},{deep:!0}),e.watch(()=>o.modelValue,(H,he)=>{E.value=H,!l.value&&(H==null||H==="")&&he!=null&&o.apiModule&&o.apiAction&&(_.value=[],k.value=!1),R.value=ge.value||""},{immediate:!0});const je=P.value;(je.apiModule&&je.apiAction||je.apiUrl||o.fetchItems)&&(o.autoFetchOnMount||!ve(o.modelValue))&&Qe();const Ct=H=>{const he=X.value,ye=G.value,He=H.target;he&&he.contains(He)||ye&&ye.contains(He)||K.value&&O()},yt=e.computed(()=>{const H=o.modelValue;return H==null?!1:typeof H=="string"?H.trim().length>0:Array.isArray(H)?H.length>0:typeof H=="object"?Object.keys(H).length>0:!0}),Vt=e.computed(()=>!!o.clearable&&yt.value&&!o.disabled);return e.onMounted(()=>{document.addEventListener("mousedown",Ct)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Ct)}),(H,he)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:X,class:e.normalizeClass(["w-full",e.unref(a).class]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",hf)):e.createCommentVNode("",!0),he[6]||(he[6]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:w.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),g.value?(e.openBlock(),e.createElementBlock("span",pf,"*")):e.createCommentVNode("",!0)],8,mf)):e.createCommentVNode("",!0),e.createElementVNode("div",gf,[e.createElementVNode("div",{ref_key:"reference",ref:$,class:e.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[u.value||f.value?"opacity-60 cursor-not-allowed":"",se.value||b.value?"border-red-500 focus-within:ring-red-500":""]])},[o.icon||H.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",bf,[e.renderSlot(H.$slots,"prepend-inner",{},()=>[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps(A.value,{id:w.value,type:"text",class:["w-full bg-transparent outline-none text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400",u.value||f.value?"cursor-not-allowed":"cursor-text"],placeholder:x.value,disabled:u.value,readonly:f.value,value:K.value?R.value:ge.value||R.value,onFocus:he[0]||(he[0]=()=>{K.value||Z()}),onClick:he[1]||(he[1]=()=>{K.value||Z()}),onInput:ze,onKeydown:Ye,onBlur:he[2]||(he[2]=()=>Ee(E.value))}),null,16,yf),N.value?(e.openBlock(),e.createElementBlock("svg",xf,[...he[7]||(he[7]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):Vt.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onMousedown:he[3]||(he[3]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(Ae,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:u.value||f.value,onClick:he[4]||(he[4]=ye=>K.value?O():Z()),"aria-label":"Toggle"},[e.createVNode(e.unref(ue.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":K.value}])},null,8,["class"])],8,kf))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[K.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:G,style:e.normalizeStyle(e.unref(ne)),class:"z-[50] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-neutral-700/50 dark:bg-neutral-800"},[e.createElementVNode("div",wf,[Me.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Me.value,(ye,He)=>(e.openBlock(),e.createElementBlock("button",{key:le(ye)??He,type:"button",class:e.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",He===j.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:Le=>j.value=He,onMousedown:he[5]||(he[5]=e.withModifiers(()=>{},["prevent"])),onClick:Le=>Q(ye)},[e.createTextVNode(e.toDisplayString(Y(ye))+" ",1),at(ye)?(e.openBlock(),e.createElementBlock("span",Ef," ✓ ")):e.createCommentVNode("",!0)],42,Cf))),128)):e.renderSlot(H.$slots,"no-data",{key:1},()=>[e.createElementVNode("div",Bf,[N.value?(e.openBlock(),e.createElementBlock("span",_f,"Loading data…")):ee.value?(e.openBlock(),e.createElementBlock("span",Sf,e.toDisplayString(ee.value),1)):(e.openBlock(),e.createElementBlock("span",Af,"No data available"))])])])],4)):e.createCommentVNode("",!0)]))]),se.value||b.value?(e.openBlock(),e.createElementBlock("p",Vf,e.toDisplayString(se.value||b.value),1)):e.createCommentVNode("",!0)],64))],10,ff)),[[e.vShow,t.visible]])}}),Df=["aria-busy"],Nf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Mf=["for"],vf={key:0,class:"ml-1 text-destructive"},Pf={class:"relative"},Tf={key:0,class:"flex items-center text-gray-500 gap-2"},Of=["id","placeholder","disabled","value"],Ff={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},zf=["disabled"],If={key:0,class:"p-3 space-y-2"},Rf=["onMouseenter","onClick"],Lf={class:"flex items-center space-x-3"},$f={class:"flex-1"},jf={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Wf={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},Uf={key:0},Hf={key:2,class:"p-3 text-center"},qf={class:"inline-flex items-center space-x-2"},Gf={class:"text-sm text-gray-500"},Xf={key:3,class:"p-3 text-center"},Kf={class:"text-xs text-gray-400"},Yf={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Jf={key:1,class:"mt-1 text-xs text-red-600"},Qf={key:2,class:"mt-1 text-xs text-gray-500"},Ti=e.defineComponent({name:"DCodeInfiniteAutoComplete",inheritAttrs:!1,__name:"DCodeInfiniteAutoComplete",props:{modelValue:{},apiModule:{},apiAction:{},apiOptions:{},autoFetchOnOpen:{type:Boolean,default:!0},refreshOnOpen:{type:Boolean,default:!1},autoFetchOnMount:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},error:{default:null},errorMessage:{default:null},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},itemSubtitle:{},returnObject:{type:Boolean,default:!1},endpoint:{},apiParams:{},fetchItems:{},icon:{},label:{},placeholder:{default:"Select an option"},required:{type:Boolean,default:!1},inputType:{default:"text"},helperText:{default:""},noResultsText:{default:"No results found"},loadingText:{default:"Loading more..."},endOfResultsText:{default:"End of results"},pageSize:{default:10},threshold:{default:100},debounceMs:{default:300}},emits:["update:modelValue","focus","blur","select","search","load-more","end-of-results","error"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.ref(),i=e.ref(),l=e.ref(),c=e.ref(),d=e.ref(),u=e.computed(()=>{const j=o.label||o.placeholder;return j?`app-infinite-autocomplete-${j}-${Math.random().toString(36).slice(2,7)}`:void 0}),h=e.ref(""),f=e.ref([]),m=e.ref(!1),g=e.ref(!1),b=e.ref(-1),x=e.ref(1),p=e.ref(!0),C=e.ref(0),w=e.ref(),{floatingStyles:E}=Fa(c,d,{placement:"bottom-start",whileElementsMounted:Ma,middleware:[va(4),Ta(),Pa(),Oa({apply({rects:j,elements:se}){Object.assign(se.floating.style,{width:`${j.reference.width}px`})}})]});e.computed(()=>({"opacity-50 pointer-events-none":o.disabled,relative:!0}));const _=e.computed(()=>h.value?f.value.filter(j=>V(j).toLowerCase().includes(h.value.toLowerCase())):f.value),B=e.computed(()=>{if(g.value&&h.value)return h.value;if(o.modelValue){if(o.returnObject)return V(o.modelValue);{const j=f.value.find(se=>D(se)===o.modelValue);return j?V(j):String(o.modelValue)}}return""}),k=()=>{g.value=!0},y=()=>{g.value=!1},V=j=>typeof o.itemTitle=="function"?o.itemTitle(j):j[o.itemTitle]||"",D=j=>typeof o.itemValue=="function"?o.itemValue(j):j[o.itemValue]||j,N=j=>o.itemSubtitle?typeof o.itemSubtitle=="function"?o.itemSubtitle(j):j[o.itemSubtitle]||"":"",A=j=>o.modelValue?o.returnObject?D(j)===D(o.modelValue):D(j)===o.modelValue:!1,T=j=>{var ee;const se=o.returnObject?j:D(j);r("update:modelValue",se),r("select",j),g.value=!1,h.value="",(ee=s.value)==null||ee.blur()},P=()=>{var j;r("update:modelValue",null),h.value="",(j=s.value)==null||j.focus()},X=j=>{g.value=!0,r("focus",j),o.autoFetchOnOpen&&!m.value&&(o.refreshOnOpen||f.value.length===0)&&R(!0)},$=j=>{setTimeout(()=>{g.value=!1,r("blur",j)},200)},G=j=>{const se=j.target;h.value=se.value,w.value&&clearTimeout(w.value),w.value=setTimeout(()=>{r("search",h.value),x.value=1,p.value=!0,R(!0)},o.debounceMs)},ne=j=>{if(g.value)switch(j.key){case"ArrowDown":j.preventDefault(),b.value=Math.min(b.value+1,_.value.length-1);break;case"ArrowUp":j.preventDefault(),b.value=Math.max(b.value-1,0);break;case"Enter":j.preventDefault(),b.value>=0&&_.value[b.value]&&T(_.value[b.value]);break;case"Escape":g.value=!1;break}},K=j=>{if(!p.value||m.value)return;const se=j.target,{scrollTop:ee,scrollHeight:Y,clientHeight:le}=se;ee+le>=Y-o.threshold&&R()},R=async(j=!1)=>{var se,ee;if(!m.value){m.value=!0;try{let Y=[];if(o.fetchItems)Y=await o.fetchItems();else{const le=mt(),ge=((se=o.endpoint)==null?void 0:se.apiModule)||o.apiModule,Me=((ee=o.endpoint)==null?void 0:ee.apiAction)||o.apiAction;if(!ge||!Me)throw new Error("API module and action are required");const ve={page:j?1:x.value,pageSize:o.pageSize,search:h.value,...o.apiParams},Ee=await le.apiUrl(`/${ge}/${Me}`,"GET",ve);Y=Ee.data||Ee.items||Ee||[],C.value=Ee.total||Ee.totalItems||Y.length}j?(f.value=Y,x.value=1):(f.value.push(...Y),x.value++),p.value=Y.length>=o.pageSize,p.value||r("end-of-results"),r("load-more",{items:Y,page:x.value,hasMore:p.value,total:C.value})}catch(Y){console.error("Error fetching items:",Y),r("error",Y)}finally{m.value=!1}}};return e.onMounted(()=>{o.autoFetchOnMount&&R()}),e.onUnmounted(()=>{w.value&&clearTimeout(w.value)}),e.watch(()=>o.modelValue,j=>{j||(h.value="")}),(j,se)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:l,class:e.normalizeClass(["w-full",e.unref(a).class]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Nf)):e.createCommentVNode("",!0),se[3]||(se[3]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",vf,"*")):e.createCommentVNode("",!0)],8,Mf)):e.createCommentVNode("",!0),e.createElementVNode("div",Pf,[e.createElementVNode("div",{ref_key:"reference",ref:c,class:e.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[t.disabled?"opacity-60 cursor-not-allowed":"",t.error?"border-red-500 focus-within:ring-red-500":""]])},[o.icon?(e.openBlock(),e.createElementBlock("div",Tf,[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({ref_key:"inputRef",ref:s},j.$attrs,{id:u.value,type:"text",class:["w-full bg-transparent outline-none text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400",t.disabled?"cursor-not-allowed":"cursor-text"],placeholder:t.placeholder,disabled:t.disabled,value:B.value,onFocus:X,onBlur:$,onInput:G,onKeydown:ne}),null,16,Of),m.value?(e.openBlock(),e.createElementBlock("svg",Ff,[...se[4]||(se[4]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):t.clearable&&t.modelValue?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onMousedown:se[0]||(se[0]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(P,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:t.disabled,onClick:se[1]||(se[1]=ee=>g.value?y():k()),"aria-label":"Toggle"},[e.createVNode(e.unref(ue.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":g.value}])},null,8,["class"])],8,zf))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[g.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:e.normalizeStyle(e.unref(E)),class:"z-[9999] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-neutral-700/50 dark:bg-neutral-800"},[e.createElementVNode("div",{ref_key:"scrollContainer",ref:i,class:"max-h-64 overflow-auto",onScroll:K},[m.value&&f.value.length===0?(e.openBlock(),e.createElementBlock("div",If,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,ee=>e.createElementVNode("div",{key:ee,class:"flex items-center space-x-3"},[...se[5]||(se[5]=[e.createElementVNode("div",{class:"skeleton h-4 w-4 bg-gray-200 rounded"},null,-1),e.createElementVNode("div",{class:"skeleton h-4 flex-1 bg-gray-200 rounded"},null,-1)])])),64))])):_.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(_.value,(ee,Y)=>(e.openBlock(),e.createElementBlock("button",{key:D(ee)??Y,type:"button",class:e.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",Y===b.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:le=>b.value=Y,onMousedown:se[2]||(se[2]=e.withModifiers(()=>{},["prevent"])),onClick:le=>T(ee)},[e.renderSlot(j.$slots,"item",{item:ee,index:Y},()=>[e.createElementVNode("div",Lf,[e.createElementVNode("div",$f,[e.createElementVNode("div",jf,e.toDisplayString(V(ee)),1),t.itemSubtitle?(e.openBlock(),e.createElementBlock("div",Wf,e.toDisplayString(N(ee)),1)):e.createCommentVNode("",!0)])])]),A(ee)?(e.openBlock(),e.createElementBlock("span",Uf," ✓ ")):e.createCommentVNode("",!0)],42,Rf))),128)):e.createCommentVNode("",!0),m.value&&f.value.length>0?(e.openBlock(),e.createElementBlock("div",Hf,[e.createElementVNode("div",qf,[se[6]||(se[6]=e.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),e.createElementVNode("span",Gf,e.toDisplayString(t.loadingText),1)])])):e.createCommentVNode("",!0),!p.value&&f.value.length>0?(e.openBlock(),e.createElementBlock("div",Xf,[e.createElementVNode("div",Kf,e.toDisplayString(t.endOfResultsText),1)])):!m.value&&f.value.length===0?(e.openBlock(),e.createElementBlock("div",Yf,e.toDisplayString(t.noResultsText),1)):e.createCommentVNode("",!0)],544)],4)):e.createCommentVNode("",!0)]))]),t.error?(e.openBlock(),e.createElementBlock("p",Jf,e.toDisplayString(t.errorMessage||t.error),1)):t.helperText?(e.openBlock(),e.createElementBlock("p",Qf,e.toDisplayString(t.helperText),1)):e.createCommentVNode("",!0)],64))],10,Df)),[[e.vShow,t.visible]])}});function Oi(t){var n,o,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(o=Oi(t[n]))&&(r&&(r+=" "),r+=o)}else for(o in t)t[o]&&(r&&(r+=" "),r+=o);return r}function Fi(){for(var t,n,o=0,r="",a=arguments.length;o<a;o++)(t=arguments[o])&&(n=Oi(t))&&(r&&(r+=" "),r+=n);return r}const Zf=(t,n)=>{const o=new Array(t.length+n.length);for(let r=0;r<t.length;r++)o[r]=t[r];for(let r=0;r<n.length;r++)o[t.length+r]=n[r];return o},eh=(t,n)=>({classGroupId:t,validator:n}),zi=(t=new Map,n=null,o)=>({nextPart:t,validators:n,classGroupId:o}),pr="-",Ii=[],th="arbitrary..",nh=t=>{const n=rh(t),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return oh(i);const l=i.split(pr),c=l[0]===""&&l.length>1?1:0;return Ri(l,c,n)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=r[i],d=o[i];return c?d?Zf(d,c):c:d||Ii}return o[i]||Ii}}},Ri=(t,n,o)=>{if(t.length-n===0)return o.classGroupId;const a=t[n],s=o.nextPart.get(a);if(s){const d=Ri(t,n+1,s);if(d)return d}const i=o.validators;if(i===null)return;const l=n===0?t.join(pr):t.slice(n).join(pr),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},oh=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=t.slice(1,-1),o=n.indexOf(":"),r=n.slice(0,o);return r?th+r:void 0})(),rh=t=>{const{theme:n,classGroups:o}=t;return ah(o,n)},ah=(t,n)=>{const o=zi();for(const r in t){const a=t[r];za(a,o,r,n)}return o},za=(t,n,o,r)=>{const a=t.length;for(let s=0;s<a;s++){const i=t[s];sh(i,n,o,r)}},sh=(t,n,o,r)=>{if(typeof t=="string"){ih(t,n,o);return}if(typeof t=="function"){lh(t,n,o,r);return}ch(t,n,o,r)},ih=(t,n,o)=>{const r=t===""?n:Li(n,t);r.classGroupId=o},lh=(t,n,o,r)=>{if(dh(t)){za(t(r),n,o,r);return}n.validators===null&&(n.validators=[]),n.validators.push(eh(o,t))},ch=(t,n,o,r)=>{const a=Object.entries(t),s=a.length;for(let i=0;i<s;i++){const[l,c]=a[i];za(c,Li(n,l),o,r)}},Li=(t,n)=>{let o=t;const r=n.split(pr),a=r.length;for(let s=0;s<a;s++){const i=r[s];let l=o.nextPart.get(i);l||(l=zi(),o.nextPart.set(i,l)),o=l}return o},dh=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,uh=t=>{if(t<1)return{get:()=>{},set:()=>{}};let n=0,o=Object.create(null),r=Object.create(null);const a=(s,i)=>{o[s]=i,n++,n>t&&(n=0,r=o,o=Object.create(null))};return{get(s){let i=o[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return a(s,i),i},set(s,i){s in o?o[s]=i:a(s,i)}}},Ia="!",$i=":",fh=[],ji=(t,n,o,r,a)=>({modifiers:t,hasImportantModifier:n,baseClassName:o,maybePostfixModifierPosition:r,isExternal:a}),hh=t=>{const{prefix:n,experimentalParseClassName:o}=t;let r=a=>{const s=[];let i=0,l=0,c=0,d;const u=a.length;for(let b=0;b<u;b++){const x=a[b];if(i===0&&l===0){if(x===$i){s.push(a.slice(c,b)),c=b+1;continue}if(x==="/"){d=b;continue}}x==="["?i++:x==="]"?i--:x==="("?l++:x===")"&&l--}const h=s.length===0?a:a.slice(c);let f=h,m=!1;h.endsWith(Ia)?(f=h.slice(0,-1),m=!0):h.startsWith(Ia)&&(f=h.slice(1),m=!0);const g=d&&d>c?d-c:void 0;return ji(s,m,f,g)};if(n){const a=n+$i,s=r;r=i=>i.startsWith(a)?s(i.slice(a.length)):ji(fh,!1,i,void 0,!0)}if(o){const a=r;r=s=>o({className:s,parseClassName:a})}return r},mh=t=>{const n=new Map;return t.orderSensitiveModifiers.forEach((o,r)=>{n.set(o,1e6+r)}),o=>{const r=[];let a=[];for(let s=0;s<o.length;s++){const i=o[s],l=i[0]==="[",c=n.has(i);l||c?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(i)):a.push(i)}return a.length>0&&(a.sort(),r.push(...a)),r}},ph=t=>({cache:uh(t.cacheSize),parseClassName:hh(t),sortModifiers:mh(t),...nh(t)}),gh=/\s+/,bh=(t,n)=>{const{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=n,i=[],l=t.trim().split(gh);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:h,modifiers:f,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:b}=o(u);if(h){c=u+(c.length>0?" "+c:c);continue}let x=!!b,p=r(x?g.substring(0,b):g);if(!p){if(!x){c=u+(c.length>0?" "+c:c);continue}if(p=r(g),!p){c=u+(c.length>0?" "+c:c);continue}x=!1}const C=f.length===0?"":f.length===1?f[0]:s(f).join(":"),w=m?C+Ia:C,E=w+p;if(i.indexOf(E)>-1)continue;i.push(E);const _=a(p,x);for(let B=0;B<_.length;++B){const k=_[B];i.push(w+k)}c=u+(c.length>0?" "+c:c)}return c},yh=(...t)=>{let n=0,o,r,a="";for(;n<t.length;)(o=t[n++])&&(r=Wi(o))&&(a&&(a+=" "),a+=r);return a},Wi=t=>{if(typeof t=="string")return t;let n,o="";for(let r=0;r<t.length;r++)t[r]&&(n=Wi(t[r]))&&(o&&(o+=" "),o+=n);return o},xh=(t,...n)=>{let o,r,a,s;const i=c=>{const d=n.reduce((u,h)=>h(u),t());return o=ph(d),r=o.cache.get,a=o.cache.set,s=l,l(c)},l=c=>{const d=r(c);if(d)return d;const u=bh(c,o);return a(c,u),u};return s=i,(...c)=>s(yh(...c))},kh=[],xt=t=>{const n=o=>o[t]||kh;return n.isThemeGetter=!0,n},Ui=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Hi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,wh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ch=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Eh=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Bh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,_h=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Sh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_n=t=>wh.test(t),$e=t=>!!t&&!Number.isNaN(Number(t)),Sn=t=>!!t&&Number.isInteger(Number(t)),Ra=t=>t.endsWith("%")&&$e(t.slice(0,-1)),hn=t=>Ch.test(t),qi=()=>!0,Ah=t=>Eh.test(t)&&!Bh.test(t),La=()=>!1,Vh=t=>_h.test(t),Dh=t=>Sh.test(t),Nh=t=>!Ce(t)&&!Be(t),Mh=t=>An(t,Qi,La),Ce=t=>Ui.test(t),$n=t=>An(t,Zi,Ah),Gi=t=>An(t,Rh,$e),vh=t=>An(t,tl,qi),Ph=t=>An(t,el,La),Xi=t=>An(t,Yi,La),Th=t=>An(t,Ji,Dh),gr=t=>An(t,nl,Vh),Be=t=>Hi.test(t),No=t=>jn(t,Zi),Oh=t=>jn(t,el),Ki=t=>jn(t,Yi),Fh=t=>jn(t,Qi),zh=t=>jn(t,Ji),br=t=>jn(t,nl,!0),Ih=t=>jn(t,tl,!0),An=(t,n,o)=>{const r=Ui.exec(t);return r?r[1]?n(r[1]):o(r[2]):!1},jn=(t,n,o=!1)=>{const r=Hi.exec(t);return r?r[1]?n(r[1]):o:!1},Yi=t=>t==="position"||t==="percentage",Ji=t=>t==="image"||t==="url",Qi=t=>t==="length"||t==="size"||t==="bg-size",Zi=t=>t==="length",Rh=t=>t==="number",el=t=>t==="family-name",tl=t=>t==="number"||t==="weight",nl=t=>t==="shadow",Lh=xh(()=>{const t=xt("color"),n=xt("font"),o=xt("text"),r=xt("font-weight"),a=xt("tracking"),s=xt("leading"),i=xt("breakpoint"),l=xt("container"),c=xt("spacing"),d=xt("radius"),u=xt("shadow"),h=xt("inset-shadow"),f=xt("text-shadow"),m=xt("drop-shadow"),g=xt("blur"),b=xt("perspective"),x=xt("aspect"),p=xt("ease"),C=xt("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...E(),Be,Ce],B=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],y=()=>[Be,Ce,c],V=()=>[_n,"full","auto",...y()],D=()=>[Sn,"none","subgrid",Be,Ce],N=()=>["auto",{span:["full",Sn,Be,Ce]},Sn,Be,Ce],A=()=>[Sn,"auto",Be,Ce],T=()=>["auto","min","max","fr",Be,Ce],P=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...y()],G=()=>[_n,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...y()],ne=()=>[_n,"screen","full","dvw","lvw","svw","min","max","fit",...y()],K=()=>[_n,"screen","full","lh","dvh","lvh","svh","min","max","fit",...y()],R=()=>[t,Be,Ce],j=()=>[...E(),Ki,Xi,{position:[Be,Ce]}],se=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ee=()=>["auto","cover","contain",Fh,Mh,{size:[Be,Ce]}],Y=()=>[Ra,No,$n],le=()=>["","none","full",d,Be,Ce],ge=()=>["",$e,No,$n],Me=()=>["solid","dashed","dotted","double"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ee=()=>[$e,Ra,Ki,Xi],Z=()=>["","none",g,Be,Ce],O=()=>["none",$e,Be,Ce],Q=()=>["none",$e,Be,Ce],ie=()=>[$e,Be,Ce],Ae=()=>[_n,"full",...y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[hn],breakpoint:[hn],color:[qi],container:[hn],"drop-shadow":[hn],ease:["in","out","in-out"],font:[Nh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[hn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[hn],shadow:[hn],spacing:["px",$e],text:[hn],"text-shadow":[hn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",_n,Ce,Be,x]}],container:["container"],columns:[{columns:[$e,Ce,Be,l]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:_()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[Sn,"auto",Be,Ce]}],basis:[{basis:[_n,"full","auto",l,...y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[$e,_n,"auto","initial","none",Ce]}],grow:[{grow:["",$e,Be,Ce]}],shrink:[{shrink:["",$e,Be,Ce]}],order:[{order:[Sn,"first","last","none",Be,Ce]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:y()}],"gap-x":[{"gap-x":y()}],"gap-y":[{"gap-y":y()}],"justify-content":[{justify:[...P(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...P()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":P()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:y()}],px:[{px:y()}],py:[{py:y()}],ps:[{ps:y()}],pe:[{pe:y()}],pbs:[{pbs:y()}],pbe:[{pbe:y()}],pt:[{pt:y()}],pr:[{pr:y()}],pb:[{pb:y()}],pl:[{pl:y()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":y()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...ne()]}],"min-inline-size":[{"min-inline":["auto",...ne()]}],"max-inline-size":[{"max-inline":["none",...ne()]}],"block-size":[{block:["auto",...K()]}],"min-block-size":[{"min-block":["auto",...K()]}],"max-block-size":[{"max-block":["none",...K()]}],w:[{w:[l,"screen",...G()]}],"min-w":[{"min-w":[l,"screen","none",...G()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",o,No,$n]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ih,vh]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ra,Ce]}],"font-family":[{font:[Oh,Ph,n]}],"font-features":[{"font-features":[Ce]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Be,Ce]}],"line-clamp":[{"line-clamp":[$e,"none",Be,Gi]}],leading:[{leading:[s,...y()]}],"list-image":[{"list-image":["none",Be,Ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Be,Ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Me(),"wavy"]}],"text-decoration-thickness":[{decoration:[$e,"from-font","auto",Be,$n]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[$e,"auto",Be,Ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Be,Ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Be,Ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:se()}],"bg-size":[{bg:ee()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Sn,Be,Ce],radial:["",Be,Ce],conic:[Sn,Be,Ce]},zh,Th]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:ge()}],"border-w-x":[{"border-x":ge()}],"border-w-y":[{"border-y":ge()}],"border-w-s":[{"border-s":ge()}],"border-w-e":[{"border-e":ge()}],"border-w-bs":[{"border-bs":ge()}],"border-w-be":[{"border-be":ge()}],"border-w-t":[{"border-t":ge()}],"border-w-r":[{"border-r":ge()}],"border-w-b":[{"border-b":ge()}],"border-w-l":[{"border-l":ge()}],"divide-x":[{"divide-x":ge()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ge()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Me(),"hidden","none"]}],"divide-style":[{divide:[...Me(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...Me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[$e,Be,Ce]}],"outline-w":[{outline:["",$e,No,$n]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",u,br,gr]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",h,br,gr]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:ge()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[$e,$n]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":ge()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",f,br,gr]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[$e,Be,Ce]}],"mix-blend":[{"mix-blend":[...ve(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ve()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[$e]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ee()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":Ee()}],"mask-image-t-to-pos":[{"mask-t-to":Ee()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":Ee()}],"mask-image-r-to-pos":[{"mask-r-to":Ee()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":Ee()}],"mask-image-b-to-pos":[{"mask-b-to":Ee()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":Ee()}],"mask-image-l-to-pos":[{"mask-l-to":Ee()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":Ee()}],"mask-image-x-to-pos":[{"mask-x-to":Ee()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":Ee()}],"mask-image-y-to-pos":[{"mask-y-to":Ee()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[Be,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ee()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[$e]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ee()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:se()}],"mask-size":[{mask:ee()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Be,Ce]}],filter:[{filter:["","none",Be,Ce]}],blur:[{blur:Z()}],brightness:[{brightness:[$e,Be,Ce]}],contrast:[{contrast:[$e,Be,Ce]}],"drop-shadow":[{"drop-shadow":["","none",m,br,gr]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",$e,Be,Ce]}],"hue-rotate":[{"hue-rotate":[$e,Be,Ce]}],invert:[{invert:["",$e,Be,Ce]}],saturate:[{saturate:[$e,Be,Ce]}],sepia:[{sepia:["",$e,Be,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Be,Ce]}],"backdrop-blur":[{"backdrop-blur":Z()}],"backdrop-brightness":[{"backdrop-brightness":[$e,Be,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[$e,Be,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",$e,Be,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[$e,Be,Ce]}],"backdrop-invert":[{"backdrop-invert":["",$e,Be,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[$e,Be,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[$e,Be,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",$e,Be,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":y()}],"border-spacing-x":[{"border-spacing-x":y()}],"border-spacing-y":[{"border-spacing-y":y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Be,Ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[$e,"initial",Be,Ce]}],ease:[{ease:["linear","initial",p,Be,Ce]}],delay:[{delay:[$e,Be,Ce]}],animate:[{animate:["none",C,Be,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Be,Ce]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:O()}],"rotate-x":[{"rotate-x":O()}],"rotate-y":[{"rotate-y":O()}],"rotate-z":[{"rotate-z":O()}],scale:[{scale:Q()}],"scale-x":[{"scale-x":Q()}],"scale-y":[{"scale-y":Q()}],"scale-z":[{"scale-z":Q()}],"scale-3d":["scale-3d"],skew:[{skew:ie()}],"skew-x":[{"skew-x":ie()}],"skew-y":[{"skew-y":ie()}],transform:[{transform:[Be,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ae()}],"translate-x":[{"translate-x":Ae()}],"translate-y":[{"translate-y":Ae()}],"translate-z":[{"translate-z":Ae()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Be,Ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":y()}],"scroll-mx":[{"scroll-mx":y()}],"scroll-my":[{"scroll-my":y()}],"scroll-ms":[{"scroll-ms":y()}],"scroll-me":[{"scroll-me":y()}],"scroll-mbs":[{"scroll-mbs":y()}],"scroll-mbe":[{"scroll-mbe":y()}],"scroll-mt":[{"scroll-mt":y()}],"scroll-mr":[{"scroll-mr":y()}],"scroll-mb":[{"scroll-mb":y()}],"scroll-ml":[{"scroll-ml":y()}],"scroll-p":[{"scroll-p":y()}],"scroll-px":[{"scroll-px":y()}],"scroll-py":[{"scroll-py":y()}],"scroll-ps":[{"scroll-ps":y()}],"scroll-pe":[{"scroll-pe":y()}],"scroll-pbs":[{"scroll-pbs":y()}],"scroll-pbe":[{"scroll-pbe":y()}],"scroll-pt":[{"scroll-pt":y()}],"scroll-pr":[{"scroll-pr":y()}],"scroll-pb":[{"scroll-pb":y()}],"scroll-pl":[{"scroll-pl":y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Be,Ce]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[$e,No,$n,Gi]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function We(...t){return Lh(Fi(t))}function ol(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $a={},ja={},yr={exports:{}},rl;function $h(){if(rl)return yr.exports;rl=1;var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};return yr.exports=n(),yr.exports.createColors=n,yr.exports}var al;function jh(){return al||(al=1,(function(t){var n={};Object.defineProperty(t,"__esModule",{value:!0});function o(d,u){for(var h in u)Object.defineProperty(d,h,{enumerable:!0,get:u[h]})}o(t,{dim:function(){return l},default:function(){return c}});const r=a($h());function a(d){return d&&d.__esModule?d:{default:d}}let s=new Set;function i(d,u,h){typeof process<"u"&&n.JEST_WORKER_ID||h&&s.has(h)||(h&&s.add(h),console.warn(""),u.forEach(f=>console.warn(d,"-",f)))}function l(d){return r.default.dim(d)}const c={info(d,u){i(r.default.bold(r.default.cyan("info")),...Array.isArray(d)?[d]:[u,d])},warn(d,u){i(r.default.bold(r.default.yellow("warn")),...Array.isArray(d)?[d]:[u,d])},risk(d,u){i(r.default.bold(r.default.magenta("risk")),...Array.isArray(d)?[d]:[u,d])}}})(ja)),ja}var sl;function Wh(){return sl||(sl=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});const n=o(jh());function o(s){return s&&s.__esModule?s:{default:s}}function r({version:s,from:i,to:l}){n.default.warn(`${i}-color-renamed`,[`As of Tailwind CSS ${s}, \`${i}\` has been renamed to \`${l}\`.`,"Update your configuration file to silence this warning."])}const a={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})($a)),$a}var Wa,il;function Uh(){if(il)return Wa;il=1;let t=Wh();return Wa=(t.__esModule?t:{default:t}).default,Wa}var Hh=Uh();const qh=ol(Hh),ll=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,cl=Fi,xr=(t,n)=>o=>{var r;if((n==null?void 0:n.variants)==null)return cl(t,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:a,defaultVariants:s}=n,i=Object.keys(a).map(d=>{const u=o==null?void 0:o[d],h=s==null?void 0:s[d];if(u===null)return null;const f=ll(u)||ll(h);return a[d][f]}),l=o&&Object.entries(o).reduce((d,u)=>{let[h,f]=u;return f===void 0||(d[h]=f),d},{}),c=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:h,className:f,...m}=u;return Object.entries(m).every(g=>{let[b,x]=g;return Array.isArray(x)?x.includes({...s,...l}[b]):{...s,...l}[b]===x})?[...d,h,f]:d},[]);return cl(t,i,c,o==null?void 0:o.class,o==null?void 0:o.className)},Yt=e.defineComponent({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Ne.Primitive),{as:t.as,"as-child":t.asChild,class:e.normalizeClass(e.unref(We)(e.unref(ao)({variant:t.variant,size:t.size}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),ao=xr("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",xs:"h-7 rounded px-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-8 w-8","icon-sm":"size-7","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),dl=e.defineComponent({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(t,{emit:n}){const o=t,r=n,a=Ne.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(Ne.TooltipRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),ul=e.defineComponent({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:n}){const o=t,r=n,a=ft.reactiveOmit(o,"class"),s=Ne.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Ne.TooltipPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ne.TooltipContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(We)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),fl=e.defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Ne.TooltipProvider),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),hl=e.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Ne.TooltipTrigger),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Gh={class:"relative z-10"},Xh="font-medium transition-all duration-300 ease-in-out hover:-translate-y-0.5 hover:scale-[1.02] active:translate-y-0 active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-60 disabled:cursor-not-allowed disabled:shadow-none disabled:translate-y-0 disabled:scale-100 relative overflow-hidden before:absolute before:inset-0 before:bg-white/20 before:translate-y-full before:transition-transform before:duration-300 hover:before:translate-y-0",Kh=e.defineComponent({name:"DCodeButton",inheritAttrs:!1,__name:"DCodeButton",props:{icon:{},text:{default:""},variant:{default:"default"},size:{default:"default"},tooltip:{default:""},bgColor:{default:""},textColor:{default:""},borderColor:{default:""},rounded:{default:"lg"},borderStyle:{default:"solid"},disabled:{type:Boolean,default:!1},type:{default:"button"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},setup(t){const n=e.useAttrs(),o=t,r=e.computed(()=>o.icon&&qt[o.icon]||null),a=e.computed(()=>!!o.tooltip),s=e.computed(()=>o.visible??!0),i=e.computed(()=>{const ee=String(o.variant||"default").toLowerCase();return ee==="tonal"?"secondary":ee==="elevated"?"default":ee}),l=e.computed(()=>String(o.bgColor||"").toLowerCase()),c=e.computed(()=>String(o.type||"button").toLowerCase()),d=e.computed(()=>{const{class:ee,...Y}=n;return Y}),u=e.computed(()=>We(n.class)),h=e.computed(()=>((u.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),f=e.computed(()=>o.size==="sm"?"h-9":o.size==="lg"?"h-11":o.size==="icon"?"h-10 w-10":"h-10"),m=e.computed(()=>o.size==="icon"?"":!o.text&&o.icon?"w-10":"w-28"),g=e.computed(()=>o.rounded?o.rounded.startsWith("rounded")?o.rounded:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl","3xl":"rounded-3xl",full:"rounded-full"}[o.rounded]||`rounded-${o.rounded}`:""),b=e.computed(()=>!o.borderStyle||o.borderStyle==="none"?"border-0":o.borderStyle==="solid"?"border-2":{dashed:"border-[3px] border-dashed",dotted:"border-[3px] border-dotted",double:"border-[6px] border-double"}[o.borderStyle]||"border-2"),x=e.computed(()=>We("inline-flex items-center justify-center bg-gray-200 dark:bg-gray-700 animate-pulse",g.value,f.value,m.value,h.value)),p=e.computed(()=>{const Y=(u.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return Y?Y[0]:null}),C=e.computed(()=>{const Y=(u.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return Y?Y[0]:null}),w=e.computed(()=>!!p.value),E=e.computed(()=>/\bborder-/.test(u.value??"")),_=e.computed(()=>/\bhover:/.test(u.value??"")),B=e.computed(()=>{const ee=u.value??"";return i.value!=="outline"?ee:ee.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),k=e.ref(null),y=ee=>{const Y=ee.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return Y?{r:Number(Y[1]),g:Number(Y[2]),b:Number(Y[3]),a:Y[4]?Number(Y[4]):1}:null},V=(ee,Y)=>{const le=y(ee);if(!le)return ee;const ge=Me=>Math.max(0,Math.min(255,Math.round(Me)));return`rgba(${ge(le.r*(1-Y))}, ${ge(le.g*(1-Y))}, ${ge(le.b*(1-Y))}, ${le.a})`},D=ee=>{if(globalThis.window===void 0)return null;const Y=document.createElement("div");Y.className=ee,Y.style.position="absolute",Y.style.visibility="hidden",Y.style.pointerEvents="none",Y.style.width="1px",Y.style.height="1px",document.body.appendChild(Y);const le=globalThis.getComputedStyle(Y).backgroundColor;return Y.remove(),!le||le==="transparent"||le==="rgba(0, 0, 0, 0)"?null:le},N=[50,100,200,300,400,500,600,700,800,900,950],A=ee=>{const Y=N.indexOf(ee);return Y===-1?ee:N[Math.min(N.length-1,Y+2)]},T=(ee,Y)=>{const le=qh[ee];if(!le)return null;if(typeof le=="string")return le;if(!Y)return null;const ge=le[Y];return typeof ge=="string"?ge:null},P=(ee,Y=!1)=>{if(!ee)return null;const le=Y?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,ge=ee.match(le);return ge?{colorName:ge[1],shade:ge[2]?Number.parseInt(ge[2],10):null}:null},X=()=>{const ee=p.value;if(!ee){k.value=null;return}const Y=P(ee),le=Y==null?void 0:Y.colorName,ge=(Y==null?void 0:Y.shade)??null,Me=(le?T(le,ge):null)??D(ee);if(!Me){k.value=null;return}let ve;const Ee=P(C.value,!0),Z=Ee?T(Ee.colorName,Ee.shade??null):null;if(Z)ve=Z;else if(le&&ge){const O=A(ge);ve=T(le,O)??V(Me,.2)}else ve=V(Me,.2);k.value={"--btn-color":Me,"--btn-color-hover":ve}};e.onMounted(()=>{X()}),e.watch([p,C],async()=>{await e.nextTick(),X()});const $=e.computed(()=>{const ee=/\bdark:bg-/.test(u.value??"");return!w.value||i.value==="outline"||ee?"":k.value?"dcode-btn--fill dcode-btn--fill-hover":_.value?"":"hover:brightness-90"}),G=e.computed(()=>{if(!w.value||i.value!=="outline")return"";const ee=["dcode-btn--outline","dcode-btn--outline-hover"];return E.value||ee.push("border"),!k.value&&!_.value&&ee.push("hover:brightness-90"),ee.join(" ")}),ne=e.computed(()=>k.value??void 0),K={primary:{bg:"bg-blue-600 dark:bg-blue-500",border:"border-blue-700 dark:border-blue-400",text:"text-white",hoverBg:"hover:bg-blue-700 dark:hover:bg-blue-600",hoverBorder:"hover:border-blue-800 dark:hover:border-blue-500",hoverText:"hover:text-white"},success:{bg:"bg-green-600 dark:bg-green-500",border:"border-green-700 dark:border-green-400",text:"text-white",hoverBg:"hover:bg-green-700 dark:hover:bg-green-600",hoverBorder:"hover:border-green-800 dark:hover:border-green-500",hoverText:"hover:text-white"},warning:{bg:"bg-yellow-500 dark:bg-yellow-400",border:"border-yellow-600 dark:border-yellow-300",text:"text-white",hoverBg:"hover:bg-yellow-600 dark:hover:bg-yellow-500",hoverBorder:"hover:border-yellow-700 dark:hover:border-yellow-400",hoverText:"hover:text-white"},danger:{bg:"bg-red-600 dark:bg-red-500",border:"border-red-700 dark:border-red-400",text:"text-white",hoverBg:"hover:bg-red-700 dark:hover:bg-red-600",hoverBorder:"hover:border-red-800 dark:hover:border-red-500",hoverText:"hover:text-white"},info:{bg:"bg-cyan-600 dark:bg-cyan-500",border:"border-cyan-700 dark:border-cyan-400",text:"text-white",hoverBg:"hover:bg-cyan-700 dark:hover:bg-cyan-600",hoverBorder:"hover:border-cyan-800 dark:hover:border-cyan-500",hoverText:"hover:text-white"},secondary:{bg:"bg-gray-600 dark:bg-gray-500",border:"border-gray-700 dark:border-gray-400",text:"text-white",hoverBg:"hover:bg-gray-700 dark:hover:bg-gray-600",hoverBorder:"hover:border-gray-800 dark:hover:border-gray-500",hoverText:"hover:text-white"},purple:{bg:"bg-purple-600 dark:bg-purple-500",border:"border-purple-700 dark:border-purple-400",text:"text-white",hoverBg:"hover:bg-purple-700 dark:hover:bg-purple-600",hoverBorder:"hover:border-purple-800 dark:hover:border-purple-500",hoverText:"hover:text-white"},pink:{bg:"bg-pink-600 dark:bg-pink-500",border:"border-pink-700 dark:border-pink-400",text:"text-white",hoverBg:"hover:bg-pink-700 dark:hover:bg-pink-600",hoverBorder:"hover:border-pink-800 dark:hover:border-pink-500",hoverText:"hover:text-white"},dark:{bg:"bg-gray-900 dark:bg-gray-800",border:"border-black dark:border-gray-700",text:"text-white",hoverBg:"hover:bg-black dark:hover:bg-gray-950",hoverBorder:"hover:border-black dark:hover:border-gray-600",hoverText:"hover:text-white"},light:{bg:"bg-gray-100 dark:bg-gray-800",border:"border-gray-300 dark:border-gray-600",text:"text-gray-900 dark:text-gray-100",hoverBg:"hover:bg-gray-200 dark:hover:bg-gray-700",hoverBorder:"hover:border-gray-400 dark:hover:border-gray-500",hoverText:"hover:text-gray-900 dark:hover:text-gray-100"}},R={"gradient-blue":{bg:"bg-gradient-to-r from-blue-500 to-cyan-500",text:"text-white",hover:"hover:from-blue-600 hover:to-cyan-600"},"gradient-purple":{bg:"bg-gradient-to-r from-purple-500 to-pink-500",text:"text-white",hover:"hover:from-purple-600 hover:to-pink-600"},"gradient-sunset":{bg:"bg-gradient-to-r from-orange-500 to-red-500",text:"text-white",hover:"hover:from-orange-600 hover:to-red-600"},"gradient-emerald":{bg:"bg-gradient-to-r from-emerald-500 to-teal-500",text:"text-white",hover:"hover:from-emerald-600 hover:to-teal-600"}},j=e.computed(()=>{const ee=[],Y=l.value,le=String(o.borderColor||"").toLowerCase(),ge=Y?K[Y]:null,Me=Y?R[Y]:null,ve=le?K[le]:null;return Y&&(ge?ve&&le!==Y?(ee.push(ge.bg,ve.hoverBg),o.textColor||ee.push(ge.text,ve.hoverText)):(ee.push(ge.bg,ge.hoverBg),o.textColor||ee.push(ge.text,ge.hoverText)):Me?(ee.push(Me.bg,Me.hover),o.textColor||ee.push(Me.text)):Y==="transparent"?ve?(ee.push("bg-transparent",ve.hoverBg),o.textColor||ee.push("text-inherit",ve.hoverText)):ee.push("bg-transparent hover:bg-black/5 dark:hover:bg-white/5"):ee.push(Y)),le?ve?ee.push(ve.border,ve.hoverBorder):ee.push(le):ge&&i.value!=="ghost"&&i.value!=="link"&&ee.push(ge.border,ge.hoverBorder),o.textColor&&ee.push(o.textColor),ee.join(" ")}),se=e.computed(()=>We(Xh,g.value,b.value,B.value,$.value,G.value,j.value));return(ee,Y)=>s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(x.value),"aria-hidden":"true"},null,2)):(e.openBlock(),e.createBlock(e.unref(fl),{key:1,"delay-duration":0},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createBlock(e.unref(dl),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(hl),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(Yt),e.mergeProps({variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:se.value,style:ne.value},d.value),{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:"h-[18px] w-[18px]"})):e.createCommentVNode("",!0),o.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value?"ml-1":"")},e.toDisplayString(o.text),3)):e.createCommentVNode("",!0)]),_:1},16,["variant","size","disabled","type","class","style"])]),_:1}),e.createVNode(e.unref(ul),{side:"top","side-offset":8,class:"animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-900 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0"},{default:e.withCtx(()=>[e.createElementVNode("span",Gh,e.toDisplayString(o.tooltip),1)]),_:1})]),_:1})):(e.openBlock(),e.createBlock(e.unref(Yt),e.mergeProps({key:1,variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:se.value,style:ne.value},d.value),{default:e.withCtx(()=>[e.renderSlot(ee.$slots,"default",{},()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:"h-[18px] w-[18px]"})):e.createCommentVNode("",!0),o.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value?"ml-1":"")},e.toDisplayString(o.text),3)):e.createCommentVNode("",!0)],!0)]),_:3},16,["variant","size","disabled","type","class","style"]))]),_:3}))],64)):e.createCommentVNode("",!0)}}),Pt=(t,n)=>{const o=t.__vccOpts||t;for(const[r,a]of n)o[r]=a;return o},st=Pt(Kh,[["__scopeId","data-v-fed1b675"]]),Yh={key:0,class:"flex items-center justify-between bg-neutral-50/50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 px-4 py-3 backdrop-blur-sm"},Jh={class:"flex flex-col gap-1"},Qh={key:0,class:"text-sm font-semibold text-neutral-900 dark:text-neutral-100 leading-tight"},Zh={key:1,class:"text-xs text-neutral-500 dark:text-neutral-400"},em={key:0,class:"flex items-center gap-2"},tm={name:"DCodeCard"},ml=e.defineComponent({...tm,props:{level:{default:1},title:{},subtitle:{},shadow:{type:Boolean,default:!1},border:{type:Boolean,default:!0},padding:{default:"p-6"}},setup(t){const n=t,o=e.computed(()=>{switch(n.level){case 2:return"bg-neutral-50 dark:bg-neutral-700";case 3:return"bg-neutral-100 dark:bg-neutral-600";case 1:default:return"bg-white dark:bg-neutral-800"}});return(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["transition-shadow duration-300 dcode-card",[o.value,{"shadow-md":t.shadow},{"border-transparent":!t.border},{"border-neutral-200/60 dark:border-neutral-700/50":t.border&&t.level===1},{"border-neutral-300/60 dark:border-neutral-600/50":t.border&&t.level!==1},"overflow-hidden"]])},[t.title||r.$slots.header||r.$slots.actions?(e.openBlock(),e.createElementBlock("div",Yh,[e.createElementVNode("div",Jh,[e.renderSlot(r.$slots,"header",{},()=>[t.title?(e.openBlock(),e.createElementBlock("h3",Qh,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.subtitle?(e.openBlock(),e.createElementBlock("p",Zh,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0)])]),r.$slots.actions?(e.openBlock(),e.createElementBlock("div",em,[e.renderSlot(r.$slots,"actions")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["relative z-10",t.padding])},[e.renderSlot(r.$slots,"default")],2),r.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["mt-6 pt-6 border-t border-neutral-200/60 dark:border-neutral-700/50",t.padding])},[e.renderSlot(r.$slots,"footer")],2)):e.createCommentVNode("",!0)],2))}}),nm={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},om={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},rm={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},am={class:"flex items-center justify-between"},sm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},im={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl relative group"},lm={class:"font-mono text-[11px] leading-relaxed text-blue-700 dark:text-blue-300 whitespace-pre-wrap break-all"},cm={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},dm={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},um={class:"flex items-center justify-between"},fm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},hm={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl"},mm={class:"font-mono text-[11px] leading-relaxed text-emerald-700 dark:text-emerald-400 whitespace-pre-wrap break-all"},Ua=e.defineComponent({name:"DCodeBeforeAfter",__name:"DCodeBeforeAfter",props:{dataBefore:{type:[Object,Array,String,Number,Boolean,null],required:!0},dataAfter:{type:[Object,Array,String,Number,Boolean,null],required:!0}},setup(t){const{t:n}=Rt.useI18n(),o=e.ref(null),r=e.ref(null);let a=!1;const s=l=>{if(a)return;a=!0;const c=l==="before"?o.value:r.value,d=l==="before"?r.value:o.value;if(c&&d){const u=c.scrollTop,h=c.scrollLeft;requestAnimationFrame(()=>{d.scrollTop=u,d.scrollLeft=h,requestAnimationFrame(()=>{a=!1})})}else a=!1},i=l=>{try{if(!l)return"";let c=l;if(typeof l=="string")try{(l.trim().startsWith("{")||l.trim().startsWith("["))&&(c=JSON.parse(l))}catch{}return JSON.stringify(c,null,2)}catch{return String(l)}};return(l,c)=>(e.openBlock(),e.createElementBlock("div",nm,[e.createElementVNode("div",om,[e.createElementVNode("div",rm,[e.createElementVNode("div",am,[e.createElementVNode("h3",sm,[c[2]||(c[2]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-danger-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataBefore")),1)]),c[3]||(c[3]=e.createElementVNode("span",{class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border border-neutral-200 dark:border-neutral-700 shadow-sm"}," ORIGINAL ",-1))])]),e.createElementVNode("div",im,[e.createElementVNode("div",{ref_key:"beforeContainer",ref:o,onScroll:c[0]||(c[0]=d=>s("before")),class:"p-4 overflow-auto max-h-[500px] custom-scrollbar"},[e.createElementVNode("pre",lm,e.toDisplayString(i(t.dataBefore)),1)],544)])]),e.createElementVNode("div",cm,[e.createElementVNode("div",dm,[e.createElementVNode("div",um,[e.createElementVNode("h3",fm,[c[4]||(c[4]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-success-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataAfter")),1)]),c[5]||(c[5]=e.createElementVNode("span",{class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-primary-600 dark:text-primary-400 border border-primary-100 dark:border-primary-900/50 shadow-sm"}," MODIFIED ",-1))])]),e.createElementVNode("div",hm,[e.createElementVNode("div",{ref_key:"afterContainer",ref:r,onScroll:c[1]||(c[1]=d=>s("after")),class:"p-4 overflow-auto max-h-[500px] custom-scrollbar"},[e.createElementVNode("pre",mm,e.toDisplayString(i(t.dataAfter)),1)],544)])])]))}}),pm=["aria-busy"],gm={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},bm={key:1,class:"flex justify-end"},ym=["for"],xm={key:0,class:"ml-1 text-destructive"},km={class:"relative w-full group"},wm={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},Cm={key:1},Em=["id","value","placeholder"],Bm={key:1,class:"absolute inset-y-0 right-4 flex items-center"},_m={key:2,class:"absolute inset-y-0 right-4 flex items-center"},Sm={key:3,class:"absolute top-full right-0 z-10 text-[11px] text-gray-500 dark:text-gray-400 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100"},Am={key:1,class:"text-xs text-destructive"},so=e.defineComponent({name:"DCodeTextField",inheritAttrs:!1,__name:"DCodeTextField",props:{modelValue:{},prependInner:{},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1},error:{default:null},placeholder:{default:""},icon:{},disabled:{type:Boolean,default:!1},maxLength:{},minLength:{},maxValue:{},minValue:{}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=e.computed(()=>{var O;return((O=l.valueType)==null?void 0:O.toLowerCase())==="password"||o.type==="password"}),a=e.ref(!1),s=()=>{a.value=!a.value},i=n,l=t,c=e.computed(()=>o.label);e.computed(()=>l.visible??!0);const d=Math.random().toString(36).slice(2,7),u=e.computed(()=>`app-text-field-${o.id||c.value||"field"}-${d}`),h=e.computed(()=>{const O=o.required,Q=o["aria-required"];return O===""||O===!0||O==="true"||(Q==="true"||Q===!0)}),f=e.computed(()=>{const{label:O,class:Q,id:ie,required:Ae,"aria-required":ze,...Ye}=o;return Ye}),m=e.computed(()=>{var Q,ie;const O={...f.value};return((Q=l.valueType)==null?void 0:Q.toLowerCase())==="number"&&(O.type="text",O.inputmode="numeric",O.pattern="[0-9]*"),((ie=l.valueType)==null?void 0:ie.toLowerCase())==="email"&&(O.type="email",O.inputmode="email"),r.value&&(O.type=a.value?"text":"password"),l.disabled&&(O.disabled=!0),l.maxLength&&(O.maxlength=l.maxLength),l.minLength&&(O.minlength=l.minLength),l.maxValue&&(O.max=l.maxValue),l.minValue&&(O.min=l.minValue),O}),g=e.computed(()=>{const O=l.modelValue;return O==null||String(O).length===0}),b=e.computed(()=>l.clearable?l.hideClearWhenEmpty?!g.value:!0:!1),x=e.computed(()=>{switch(l.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),p=e.ref(String(l.modelValue??""));e.watch(()=>l.modelValue,O=>{const Q=String(O??"");Q!==p.value&&(p.value=Q)});const C=e.ref(!1),w=e.ref(!1),E=O=>O.split(/(\s+)/).map(Q=>{if(Q.trim()==="")return Q;const ie=Q.toLowerCase();return ie.charAt(0).toUpperCase()+ie.slice(1)}).join(""),_=O=>{const Q=O.toLowerCase(),ie=Q.search(new RegExp("\\p{L}","u"));return ie<0?Q:Q.slice(0,ie)+Q.charAt(ie).toUpperCase()+Q.slice(ie+1)},B=O=>{switch(l.textCase){case"uppercase":return O.toUpperCase();case"lowercase":return O.toLowerCase();case"titlecase":return E(O);case"sentencecase":return _(O);case"none":default:return O}},k=O=>{if(!O)return null;const Q=Array.isArray(O)?O.join(""):O;return Q?new Set(Q):null},y=e.computed(()=>k(l.allowChars)),V=(O,Q)=>(O.lastIndex=0,O.test(Q)),D=O=>{var at;const Q=(at=l.valueType)==null?void 0:at.toLowerCase();if(Q==="free"||Q==="email"||Q==="password")return!0;const ie=O===" ",Ae=/\d/.test(O),ze=new RegExp("\\p{L}","u").test(O),Ye=new RegExp("\\p{N}","u").test(O),Qe=/[\/\-_.,]/.test(O);return Q==="number"?Ae:Q==="letter"?ze||Qe||l.allowSpaces&&ie:Q==="letternumber"?ze||Ye||Qe||l.allowSpaces&&ie:!0},N=O=>{let Q="";for(const ie of O){const Ae=!!y.value&&y.value.has(ie);l.pattern&&!Ae&&!V(l.pattern,ie)||!Ae&&!D(ie)||(Q+=ie)}return Q},A=e.computed(()=>{const O=l.maxLength??o.maxlength??o.maxLength;let Q=Number.NaN;return typeof O=="number"?Q=O:typeof O=="string"&&(Q=Number.parseInt(O,10)),Number.isFinite(Q)&&Q>0?Q:-1}),T=e.computed(()=>p.value.length),P=e.computed(()=>l.showCharCount?A.value>0:!1),X=O=>A.value>0?O.slice(0,A.value):O,$=O=>{const Q=N(O),ie=l.applyTextCaseToValue?B(Q):Q;return X(ie)};let G=null;const ne=O=>{var Q;if(O==="")return null;if(((Q=l.valueType)==null?void 0:Q.toLowerCase())==="number"&&l.returnNumber){const ie=Number(O);return Number.isFinite(ie)?ie:null}return O},K=O=>{p.value=O,i("update:modelValue",ne(O))},R=(O,Q)=>{const ie=X(Q);w.value=!0,O.value=ie,K(ie),queueMicrotask(()=>w.value=!1)},j=(O,Q)=>{const ie=O.selectionStart??O.value.length,Ae=O.selectionEnd??O.value.length;if(A.value>0){const ze=O.value.length-(Ae-ie),Ye=A.value-ze;if(Ye<=0)return;Q=Q.slice(0,Ye)}O.setRangeText(Q,ie,Ae,"end"),R(O,$(O.value))},se=O=>{var Ae;if(!G||C.value||w.value||!((Ae=O.inputType)!=null&&Ae.startsWith("insert")))return;const Q=O.data;if(Q==null)return;const ie=$(Q);ie!==Q&&(O.preventDefault(),ie.length>0&&j(G,ie))},ee=O=>{var Ae;if(!G||C.value||w.value)return;const Q=((Ae=O.clipboardData)==null?void 0:Ae.getData("text"))??"",ie=$(Q);ie!==Q&&(O.preventDefault(),ie.length>0&&j(G,ie))},Y=O=>{if(!G||C.value||w.value)return;const Q=O.target,ie=Q.value??"",Ae=$(ie);Ae===ie?K(Ae):R(Q,Ae)},le=()=>C.value=!0,ge=()=>{if(C.value=!1,!G)return;const O=G.value??"",Q=$(O);Q===O?K(Q):R(G,Q)};e.onMounted(()=>{if(G=document.getElementById(u.value),!G)return;G.addEventListener("beforeinput",se),G.addEventListener("paste",ee),G.addEventListener("input",Y),G.addEventListener("compositionstart",le),G.addEventListener("compositionend",ge);const O=G.value??"",Q=$(O);Q===O?K(Q):R(G,Q)}),e.onBeforeUnmount(()=>{G&&(G.removeEventListener("beforeinput",se),G.removeEventListener("paste",ee),G.removeEventListener("input",Y),G.removeEventListener("compositionstart",le),G.removeEventListener("compositionend",ge),G=null)});const Me=()=>{p.value="",G&&(G.value=""),i("update:modelValue",null),i("clear")},ve=e.computed(()=>P.value&&T.value>0),Ee=e.computed(()=>`${T.value} / ${A.value}`),Z=e.computed(()=>!!l.error);return(O,Q)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":l.skeleton},[l.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c.value?(e.openBlock(),e.createElementBlock("div",gm)):e.createCommentVNode("",!0),Q[1]||(Q[1]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),P.value?(e.openBlock(),e.createElementBlock("div",bm,[...Q[0]||(Q[0]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(c.value)+" ",1),h.value?(e.openBlock(),e.createElementBlock("span",xm,"*")):e.createCommentVNode("",!0)],8,ym)):e.createCommentVNode("",!0),e.createElementVNode("div",km,[l.icon||l.prependInner||O.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",wm,[e.renderSlot(O.$slots,"prepend-inner",{},()=>[l.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.icon),{key:0,class:"h-4 w-4"})):l.prependInner?(e.openBlock(),e.createElementBlock("span",Cm,e.toDisplayString(l.prependInner),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:u.value,value:p.value},m.value,{placeholder:l.placeholder,style:`text-transform: ${x.value}; padding-left: ${l.icon||l.prependInner||O.$slots["prepend-inner"]?"2.5rem":"0.75rem"} !important; padding-right: ${b.value||r.value?"2.5rem":"0.75rem"} !important;`,class:["w-full h-10 flex items-center gap-2 rounded-lg border py-2 bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600","text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",Z.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,Em),r.value?(e.openBlock(),e.createElementBlock("div",Bm,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground",tabindex:"-1",onClick:s},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value?e.unref(ue.Eye):e.unref(ue.EyeOff)),{class:"w-4 h-4"}))])])):e.createCommentVNode("",!0),b.value&&!r.value?(e.openBlock(),e.createElementBlock("div",_m,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:Me}," ✕ ")])):e.createCommentVNode("",!0),ve.value&&!Z.value?(e.openBlock(),e.createElementBlock("p",Sm,e.toDisplayString(Ee.value),1)):e.createCommentVNode("",!0)]),Z.value?(e.openBlock(),e.createElementBlock("p",Am,e.toDisplayString(l.error),1)):e.createCommentVNode("",!0)],64))],10,pm)),[[e.vShow,t.visible]])}}),Vm={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Dm={class:"dcode-card h-full flex flex-col border border-neutral-200/60 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 rounded-xl overflow-hidden"},Nm={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},Mm={class:"flex items-center justify-between"},vm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Pm={class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border border-neutral-200/60 dark:border-neutral-700/50 shadow-sm"},Tm={class:"p-6 flex-1"},Om={class:"flex flex-col gap-4"},Fm={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},zm={class:"dcode-card h-full flex flex-col border border-neutral-200/60 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 rounded-xl overflow-hidden"},Im={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},Rm={class:"flex items-center justify-between"},Lm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},$m={class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-primary-600 dark:text-primary-400 border border-primary-100 dark:border-primary-900/30 shadow-sm"},jm={class:"p-6 flex-1"},Wm={class:"flex flex-col gap-4"},Um={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Ha=e.defineComponent({name:"DCodeListLabels",__name:"DCodeListLabels",props:{dataBefore:{},dataAfter:{}},setup(t){const{t:n}=Rt.useI18n(),o=t,r=c=>{if(!c)return{};if(typeof c=="string")try{if(c.trim().startsWith("{")||c.trim().startsWith("["))return JSON.parse(c)}catch(d){return console.error("Failed to parse data string:",d),{raw:c}}return typeof c=="object"&&c!==null?c:{value:c}},a=e.computed(()=>r(o.dataBefore)),s=e.computed(()=>r(o.dataAfter)),i=c=>c.replaceAll(/([A-Z])/g," $1").replace(/^./,d=>d.toUpperCase()).trim(),l=c=>c==null?"-":typeof c=="boolean"?n(c?"common.yes":"common.no"):typeof c=="object"?JSON.stringify(c):String(c);return(c,d)=>(e.openBlock(),e.createElementBlock("div",Vm,[e.createElementVNode("div",Dm,[e.createElementVNode("div",Nm,[e.createElementVNode("div",Mm,[e.createElementVNode("h3",vm,[d[0]||(d[0]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-danger-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataBefore")),1)]),e.createElementVNode("span",Pm,e.toDisplayString(e.unref(n)("beforeAfter.original")),1)])]),e.createElementVNode("div",Tm,[e.createElementVNode("div",Om,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(u,h)=>(e.openBlock(),e.createBlock(so,{key:h,"model-value":l(u),label:i(String(h)),disabled:"",variant:"underlined",class:"w-full"},null,8,["model-value","label"]))),128)),Object.keys(a.value).length===0?(e.openBlock(),e.createElementBlock("div",Fm)):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",zm,[e.createElementVNode("div",Im,[e.createElementVNode("div",Rm,[e.createElementVNode("h3",Lm,[d[1]||(d[1]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-success-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataAfter")),1)]),e.createElementVNode("span",$m,e.toDisplayString(e.unref(n)("beforeAfter.modified")),1)])]),e.createElementVNode("div",jm,[e.createElementVNode("div",Wm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(u,h)=>(e.openBlock(),e.createBlock(so,{key:h,"model-value":l(u),label:i(String(h)),disabled:"",variant:"underlined",class:"w-full"},null,8,["model-value","label"]))),128)),Object.keys(s.value).length===0?(e.openBlock(),e.createElementBlock("div",Um,e.toDisplayString(e.unref(n)("beforeAfter.noModifiedData")),1)):e.createCommentVNode("",!0)])])])]))}});/*!
1
+ (function(pe,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lucide-vue-next"),require("reka-ui"),require("@vueuse/core"),require("vue-i18n"),require("@vuepic/vue-datepicker"),require("@uppy/core"),require("@uppy/dashboard"),require("@uppy/image-editor"),require("vue-router"),require("vue3-lottie")):typeof define=="function"&&define.amd?define(["exports","vue","lucide-vue-next","reka-ui","@vueuse/core","vue-i18n","@vuepic/vue-datepicker","@uppy/core","@uppy/dashboard","@uppy/image-editor","vue-router","vue3-lottie"],e):(pe=typeof globalThis<"u"?globalThis:pe||self,e(pe.DynamicUI={},pe.Vue,pe.LucideIcons,pe.rekaUi,pe.core,pe.VueI18n,pe.VueDatePicker,pe.Uppy,pe.UppyDashboard,pe.UppyImageEditor,pe.VueRouter,pe.Vue3Lottie))})(this,(function(pe,e,ce,Se,lt,$t,bu,yu,hi,xu,In,ku){"use strict";var WV=Object.defineProperty;var UV=(pe,e,ce)=>e in pe?WV(pe,e,{enumerable:!0,configurable:!0,writable:!0,value:ce}):pe[e]=ce;var ke=(pe,e,ce)=>UV(pe,typeof e!="symbol"?e+"":e,ce);var wa;function wu(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const Gt=wu(ce);let Xt={};function mi(t){Xt={...Xt,...t}}function Cu(){return Xt}function Eu(){return Xt.apiBaseUrl?Xt.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function Bu(){const t={"Content-Type":"application/json",Accept:"application/json"};let n=null;if(Xt.getAuthToken?n=Xt.getAuthToken():typeof window<"u"&&window.__MICRO_AUTH_TOKEN__?n=window.__MICRO_AUTH_TOKEN__:typeof localStorage<"u"&&(n=localStorage.getItem("token")||sessionStorage.getItem("token")),n&&(t.Authorization=`Bearer ${n}`),Xt.getHeaders){const o=Xt.getHeaders();return{...t,...o}}return t}function _u(){Xt.onUnauthorized&&Xt.onUnauthorized()}async function pi(t,n,o,r){const a=Cu();if(a.apiClient)return a.apiClient(t,n||"GET",o);if(!t||!t.trim())throw new Error("[DynamicUI][useApi] URL tidak boleh kosong. Pastikan prop `endpoint.apiUrl` sudah diisi dengan benar.");const s=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],i=(n||"").trim().toUpperCase(),l=s.includes(i)?i:"GET";s.includes(i)||console.warn(`[DynamicUI][useApi] HTTP method '${n}' tidak valid, fallback ke 'GET'.`);const c=Eu(),d=t.startsWith("http")?t:`${c}${t}`,u={method:l,headers:{...Bu(),...r||{}}};o&&!["GET","DELETE"].includes(l)&&(o instanceof FormData?(u.body=o,u.headers&&u.headers["Content-Type"]&&delete u.headers["Content-Type"],u.headers&&u.headers["content-type"]&&delete u.headers["content-type"]):u.body=JSON.stringify(o));let f=d;if(o&&l==="GET"){const g=new URLSearchParams;Object.entries(o).forEach(([y,p])=>{p!=null&&g.append(y,String(p))});const k=g.toString();k&&(f=`${d}${d.includes("?")?"&":"?"}${k}`)}const h=await fetch(f,u);if(h.status===401&&_u(),!h.ok){const g=await h.text();throw new Error(`HTTP ${h.status}: ${g}`)}return(h.headers.get("content-type")||"").includes("application/json")?h.json():{status:!0,data:await h.text()}}function ft(){return{apiUrl:(o,r,a,s)=>pi(o,r,a,s),DCodeApi:(o,r,a,s)=>{let i=o,l=r,c=a;return s&&s._url?(i=s._url,l=s._method||l||"POST",s._data&&(c={...c||{},...s._data})):o&&r&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(r.toUpperCase())||(i=`${o.endsWith("/")?o.slice(0,-1):o}/${r}`,l="POST")),pi(i,l,c,s==null?void 0:s.headers)}}}const ro=Math.min,Pt=Math.max,lr=Math.round,cr=Math.floor,en=t=>({x:t,y:t}),Su={left:"right",right:"left",bottom:"top",top:"bottom"};function gi(t,n,o){return Pt(t,ro(n,o))}function Ao(t,n){return typeof t=="function"?t(n):t}function En(t){return t.split("-")[0]}function Do(t){return t.split("-")[1]}function bi(t){return t==="x"?"y":"x"}function yi(t){return t==="y"?"height":"width"}function un(t){const n=t[0];return n==="t"||n==="b"?"y":"x"}function xi(t){return bi(un(t))}function Vu(t,n,o){o===void 0&&(o=!1);const r=Do(t),a=xi(t),s=yi(a);let i=a==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return n.reference[s]>n.floating[s]&&(i=dr(i)),[i,dr(i)]}function Au(t){const n=dr(t);return[Va(t),n,Va(n)]}function Va(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const ki=["left","right"],wi=["right","left"],Du=["top","bottom"],Nu=["bottom","top"];function Mu(t,n,o){switch(t){case"top":case"bottom":return o?n?wi:ki:n?ki:wi;case"left":case"right":return n?Du:Nu;default:return[]}}function vu(t,n,o,r){const a=Do(t);let s=Mu(En(t),o==="start",r);return a&&(s=s.map(i=>i+"-"+a),n&&(s=s.concat(s.map(Va)))),s}function dr(t){const n=En(t);return Su[n]+t.slice(n.length)}function Pu(t){return{top:0,right:0,bottom:0,left:0,...t}}function Tu(t){return typeof t!="number"?Pu(t):{top:t,right:t,bottom:t,left:t}}function ur(t){const{x:n,y:o,width:r,height:a}=t;return{width:r,height:a,top:o,left:n,right:n+r,bottom:o+a,x:n,y:o}}function Ci(t,n,o){let{reference:r,floating:a}=t;const s=un(n),i=xi(n),l=yi(i),c=En(n),d=s==="y",u=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,h=r[l]/2-a[l]/2;let m;switch(c){case"top":m={x:u,y:r.y-a.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-a.width,y:f};break;default:m={x:r.x,y:r.y}}switch(Do(n)){case"start":m[i]-=h*(o&&d?-1:1);break;case"end":m[i]+=h*(o&&d?-1:1);break}return m}async function Ou(t,n){var o;n===void 0&&(n={});const{x:r,y:a,platform:s,rects:i,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Ao(n,t),g=Tu(m),y=l[h?f==="floating"?"reference":"floating":f],p=ur(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(y)))==null||o?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),E=f==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),B=await(s.isElement==null?void 0:s.isElement(_))?await(s.getScale==null?void 0:s.getScale(_))||{x:1,y:1}:{x:1,y:1},S=ur(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:_,strategy:c}):E);return{top:(p.top-S.top+g.top)/B.y,bottom:(S.bottom-p.bottom+g.bottom)/B.y,left:(p.left-S.left+g.left)/B.x,right:(S.right-p.right+g.right)/B.x}}const Fu=50,zu=async(t,n,o)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:i}=o,l=i.detectOverflow?i:{...i,detectOverflow:Ou},c=await(i.isRTL==null?void 0:i.isRTL(n));let d=await i.getElementRects({reference:t,floating:n,strategy:a}),{x:u,y:f}=Ci(d,r,c),h=r,m=0;const g={};for(let k=0;k<s.length;k++){const y=s[k];if(!y)continue;const{name:p,fn:E}=y,{x:_,y:B,data:S,reset:w}=await E({x:u,y:f,initialPlacement:r,placement:h,strategy:a,middlewareData:g,rects:d,platform:l,elements:{reference:t,floating:n}});u=_??u,f=B??f,g[p]={...g[p],...S},w&&m<Fu&&(m++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(d=w.rects===!0?await i.getElementRects({reference:t,floating:n,strategy:a}):w.rects),{x:u,y:f}=Ci(d,h,c)),k=-1)}return{x:u,y:f,placement:h,strategy:a,middlewareData:g}},Iu=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var o,r;const{placement:a,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=n,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:k=!0,...y}=Ao(t,n);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const p=En(a),E=un(l),_=En(l)===l,B=await(c.isRTL==null?void 0:c.isRTL(d.floating)),S=h||(_||!k?[dr(l)]:Au(l)),w=g!=="none";!h&&w&&S.push(...vu(l,k,g,B));const x=[l,...S],b=await c.detectOverflow(n,y),V=[];let A=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&V.push(b[p]),f){const v=Vu(a,i,B);V.push(b[v[0]],b[v[1]])}if(A=[...A,{placement:a,overflows:V}],!V.every(v=>v<=0)){var D,N;const v=(((D=s.flip)==null?void 0:D.index)||0)+1,Q=x[v];if(Q&&(!(f==="alignment"?E!==un(Q):!1)||A.every(Y=>un(Y.placement)===E?Y.overflows[0]>0:!0)))return{data:{index:v,overflows:A},reset:{placement:Q}};let $=(N=A.filter(q=>q.overflows[0]<=0).sort((q,Y)=>q.overflows[1]-Y.overflows[1])[0])==null?void 0:N.placement;if(!$)switch(m){case"bestFit":{var P;const q=(P=A.filter(Y=>{if(w){const X=un(Y.placement);return X===E||X==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(X=>X>0).reduce((X,T)=>X+T,0)]).sort((Y,X)=>Y[1]-X[1])[0])==null?void 0:P[0];q&&($=q);break}case"initialPlacement":$=l;break}if(a!==$)return{reset:{placement:$}}}return{}}}},Ru=new Set(["left","top"]);async function Lu(t,n){const{placement:o,platform:r,elements:a}=t,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=En(o),l=Do(o),c=un(o)==="y",d=Ru.has(i)?-1:1,u=s&&c?-1:1,f=Ao(n,t);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*u,y:h*d}:{x:h*d,y:m*u}}const $u=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var o,r;const{x:a,y:s,placement:i,middlewareData:l}=n,c=await Lu(n,t);return i===((o=l.offset)==null?void 0:o.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:s+c.y,data:{...c,placement:i}}}}},ju=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:o,y:r,placement:a,platform:s}=n,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:p=>{let{x:E,y:_}=p;return{x:E,y:_}}},...d}=Ao(t,n),u={x:o,y:r},f=await s.detectOverflow(n,d),h=un(En(a)),m=bi(h);let g=u[m],k=u[h];if(i){const p=m==="y"?"top":"left",E=m==="y"?"bottom":"right",_=g+f[p],B=g-f[E];g=gi(_,g,B)}if(l){const p=h==="y"?"top":"left",E=h==="y"?"bottom":"right",_=k+f[p],B=k-f[E];k=gi(_,k,B)}const y=c.fn({...n,[m]:g,[h]:k});return{...y,data:{x:y.x-o,y:y.y-r,enabled:{[m]:i,[h]:l}}}}}},Wu=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(n){var o,r;const{placement:a,rects:s,platform:i,elements:l}=n,{apply:c=()=>{},...d}=Ao(t,n),u=await i.detectOverflow(n,d),f=En(a),h=Do(a),m=un(a)==="y",{width:g,height:k}=s.floating;let y,p;f==="top"||f==="bottom"?(y=f,p=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(p=f,y=h==="end"?"top":"bottom");const E=k-u.top-u.bottom,_=g-u.left-u.right,B=ro(k-u[y],E),S=ro(g-u[p],_),w=!n.middlewareData.shift;let x=B,b=S;if((o=n.middlewareData.shift)!=null&&o.enabled.x&&(b=_),(r=n.middlewareData.shift)!=null&&r.enabled.y&&(x=E),w&&!h){const A=Pt(u.left,0),D=Pt(u.right,0),N=Pt(u.top,0),P=Pt(u.bottom,0);m?b=g-2*(A!==0||D!==0?A+D:Pt(u.left,u.right)):x=k-2*(N!==0||P!==0?N+P:Pt(u.top,u.bottom))}await c({...n,availableWidth:b,availableHeight:x});const V=await i.getDimensions(l.floating);return g!==V.width||k!==V.height?{reset:{rects:!0}}:{}}}};function fr(){return typeof window<"u"}function Rn(t){return Aa(t)?(t.nodeName||"").toLowerCase():"#document"}function Tt(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function tn(t){var n;return(n=(Aa(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function Aa(t){return fr()?t instanceof Node||t instanceof Tt(t).Node:!1}function Kt(t){return fr()?t instanceof Element||t instanceof Tt(t).Element:!1}function fn(t){return fr()?t instanceof HTMLElement||t instanceof Tt(t).HTMLElement:!1}function Ei(t){return!fr()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Tt(t).ShadowRoot}function No(t){const{overflow:n,overflowX:o,overflowY:r,display:a}=Yt(t);return/auto|scroll|overlay|hidden|clip/.test(n+r+o)&&a!=="inline"&&a!=="contents"}function Uu(t){return/^(table|td|th)$/.test(Rn(t))}function hr(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Hu=/transform|translate|scale|rotate|perspective|filter/,qu=/paint|layout|strict|content/,Ln=t=>!!t&&t!=="none";let Da;function Na(t){const n=Kt(t)?Yt(t):t;return Ln(n.transform)||Ln(n.translate)||Ln(n.scale)||Ln(n.rotate)||Ln(n.perspective)||!Ma()&&(Ln(n.backdropFilter)||Ln(n.filter))||Hu.test(n.willChange||"")||qu.test(n.contain||"")}function Gu(t){let n=Bn(t);for(;fn(n)&&!ao(n);){if(Na(n))return n;if(hr(n))return null;n=Bn(n)}return null}function Ma(){return Da==null&&(Da=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Da}function ao(t){return/^(html|body|#document)$/.test(Rn(t))}function Yt(t){return Tt(t).getComputedStyle(t)}function mr(t){return Kt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Bn(t){if(Rn(t)==="html")return t;const n=t.assignedSlot||t.parentNode||Ei(t)&&t.host||tn(t);return Ei(n)?n.host:n}function Bi(t){const n=Bn(t);return ao(n)?t.ownerDocument?t.ownerDocument.body:t.body:fn(n)&&No(n)?n:Bi(n)}function Mo(t,n,o){var r;n===void 0&&(n=[]),o===void 0&&(o=!0);const a=Bi(t),s=a===((r=t.ownerDocument)==null?void 0:r.body),i=Tt(a);if(s){const l=va(i);return n.concat(i,i.visualViewport||[],No(a)?a:[],l&&o?Mo(l):[])}else return n.concat(a,Mo(a,[],o))}function va(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function _i(t){const n=Yt(t);let o=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const a=fn(t),s=a?t.offsetWidth:o,i=a?t.offsetHeight:r,l=lr(o)!==s||lr(r)!==i;return l&&(o=s,r=i),{width:o,height:r,$:l}}function Pa(t){return Kt(t)?t:t.contextElement}function so(t){const n=Pa(t);if(!fn(n))return en(1);const o=n.getBoundingClientRect(),{width:r,height:a,$:s}=_i(n);let i=(s?lr(o.width):o.width)/r,l=(s?lr(o.height):o.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Xu=en(0);function Si(t){const n=Tt(t);return!Ma()||!n.visualViewport?Xu:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Ku(t,n,o){return n===void 0&&(n=!1),!o||n&&o!==Tt(t)?!1:n}function $n(t,n,o,r){n===void 0&&(n=!1),o===void 0&&(o=!1);const a=t.getBoundingClientRect(),s=Pa(t);let i=en(1);n&&(r?Kt(r)&&(i=so(r)):i=so(t));const l=Ku(s,o,r)?Si(s):en(0);let c=(a.left+l.x)/i.x,d=(a.top+l.y)/i.y,u=a.width/i.x,f=a.height/i.y;if(s){const h=Tt(s),m=r&&Kt(r)?Tt(r):r;let g=h,k=va(g);for(;k&&r&&m!==g;){const y=so(k),p=k.getBoundingClientRect(),E=Yt(k),_=p.left+(k.clientLeft+parseFloat(E.paddingLeft))*y.x,B=p.top+(k.clientTop+parseFloat(E.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,f*=y.y,c+=_,d+=B,g=Tt(k),k=va(g)}}return ur({width:u,height:f,x:c,y:d})}function pr(t,n){const o=mr(t).scrollLeft;return n?n.left+o:$n(tn(t)).left+o}function Vi(t,n){const o=t.getBoundingClientRect(),r=o.left+n.scrollLeft-pr(t,o),a=o.top+n.scrollTop;return{x:r,y:a}}function Yu(t){let{elements:n,rect:o,offsetParent:r,strategy:a}=t;const s=a==="fixed",i=tn(r),l=n?hr(n.floating):!1;if(r===i||l&&s)return o;let c={scrollLeft:0,scrollTop:0},d=en(1);const u=en(0),f=fn(r);if((f||!f&&!s)&&((Rn(r)!=="body"||No(i))&&(c=mr(r)),f)){const m=$n(r);d=so(r),u.x=m.x+r.clientLeft,u.y=m.y+r.clientTop}const h=i&&!f&&!s?Vi(i,c):en(0);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-c.scrollLeft*d.x+u.x+h.x,y:o.y*d.y-c.scrollTop*d.y+u.y+h.y}}function Ju(t){return Array.from(t.getClientRects())}function Qu(t){const n=tn(t),o=mr(t),r=t.ownerDocument.body,a=Pt(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),s=Pt(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let i=-o.scrollLeft+pr(t);const l=-o.scrollTop;return Yt(r).direction==="rtl"&&(i+=Pt(n.clientWidth,r.clientWidth)-a),{width:a,height:s,x:i,y:l}}const Ai=25;function Zu(t,n){const o=Tt(t),r=tn(t),a=o.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,c=0;if(a){s=a.width,i=a.height;const u=Ma();(!u||u&&n==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const d=pr(r);if(d<=0){const u=r.ownerDocument,f=u.body,h=getComputedStyle(f),m=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-m);g<=Ai&&(s-=g)}else d<=Ai&&(s+=d);return{width:s,height:i,x:l,y:c}}function ef(t,n){const o=$n(t,!0,n==="fixed"),r=o.top+t.clientTop,a=o.left+t.clientLeft,s=fn(t)?so(t):en(1),i=t.clientWidth*s.x,l=t.clientHeight*s.y,c=a*s.x,d=r*s.y;return{width:i,height:l,x:c,y:d}}function Di(t,n,o){let r;if(n==="viewport")r=Zu(t,o);else if(n==="document")r=Qu(tn(t));else if(Kt(n))r=ef(n,o);else{const a=Si(t);r={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return ur(r)}function Ni(t,n){const o=Bn(t);return o===n||!Kt(o)||ao(o)?!1:Yt(o).position==="fixed"||Ni(o,n)}function tf(t,n){const o=n.get(t);if(o)return o;let r=Mo(t,[],!1).filter(l=>Kt(l)&&Rn(l)!=="body"),a=null;const s=Yt(t).position==="fixed";let i=s?Bn(t):t;for(;Kt(i)&&!ao(i);){const l=Yt(i),c=Na(i);!c&&l.position==="fixed"&&(a=null),(s?!c&&!a:!c&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||No(i)&&!c&&Ni(t,i))?r=r.filter(u=>u!==i):a=l,i=Bn(i)}return n.set(t,r),r}function nf(t){let{element:n,boundary:o,rootBoundary:r,strategy:a}=t;const i=[...o==="clippingAncestors"?hr(n)?[]:tf(n,this._c):[].concat(o),r],l=Di(n,i[0],a);let c=l.top,d=l.right,u=l.bottom,f=l.left;for(let h=1;h<i.length;h++){const m=Di(n,i[h],a);c=Pt(m.top,c),d=ro(m.right,d),u=ro(m.bottom,u),f=Pt(m.left,f)}return{width:d-f,height:u-c,x:f,y:c}}function of(t){const{width:n,height:o}=_i(t);return{width:n,height:o}}function rf(t,n,o){const r=fn(n),a=tn(n),s=o==="fixed",i=$n(t,!0,s,n);let l={scrollLeft:0,scrollTop:0};const c=en(0);function d(){c.x=pr(a)}if(r||!r&&!s)if((Rn(n)!=="body"||No(a))&&(l=mr(n)),r){const m=$n(n,!0,s,n);c.x=m.x+n.clientLeft,c.y=m.y+n.clientTop}else a&&d();s&&!r&&a&&d();const u=a&&!r&&!s?Vi(a,l):en(0),f=i.left+l.scrollLeft-c.x-u.x,h=i.top+l.scrollTop-c.y-u.y;return{x:f,y:h,width:i.width,height:i.height}}function Ta(t){return Yt(t).position==="static"}function Mi(t,n){if(!fn(t)||Yt(t).position==="fixed")return null;if(n)return n(t);let o=t.offsetParent;return tn(t)===o&&(o=o.ownerDocument.body),o}function vi(t,n){const o=Tt(t);if(hr(t))return o;if(!fn(t)){let a=Bn(t);for(;a&&!ao(a);){if(Kt(a)&&!Ta(a))return a;a=Bn(a)}return o}let r=Mi(t,n);for(;r&&Uu(r)&&Ta(r);)r=Mi(r,n);return r&&ao(r)&&Ta(r)&&!Na(r)?o:r||Gu(t)||o}const af=async function(t){const n=this.getOffsetParent||vi,o=this.getDimensions,r=await o(t.floating);return{reference:rf(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sf(t){return Yt(t).direction==="rtl"}const lf={convertOffsetParentRelativeRectToViewportRelativeRect:Yu,getDocumentElement:tn,getClippingRect:nf,getOffsetParent:vi,getElementRects:af,getClientRects:Ju,getDimensions:of,getScale:so,isElement:Kt,isRTL:sf};function Pi(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function cf(t,n){let o=null,r;const a=tn(t);function s(){var l;clearTimeout(r),(l=o)==null||l.disconnect(),o=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=t.getBoundingClientRect(),{left:u,top:f,width:h,height:m}=d;if(l||n(),!h||!m)return;const g=cr(f),k=cr(a.clientWidth-(u+h)),y=cr(a.clientHeight-(f+m)),p=cr(u),_={rootMargin:-g+"px "+-k+"px "+-y+"px "+-p+"px",threshold:Pt(0,ro(1,c))||1};let B=!0;function S(w){const x=w[0].intersectionRatio;if(x!==c){if(!B)return i();x?i(!1,x):r=setTimeout(()=>{i(!1,1e-7)},1e3)}x===1&&!Pi(d,t.getBoundingClientRect())&&i(),B=!1}try{o=new IntersectionObserver(S,{..._,root:a.ownerDocument})}catch{o=new IntersectionObserver(S,_)}o.observe(t)}return i(!0),s}function Oa(t,n,o,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Pa(t),u=a||s?[...d?Mo(d):[],...n?Mo(n):[]]:[];u.forEach(p=>{a&&p.addEventListener("scroll",o,{passive:!0}),s&&p.addEventListener("resize",o)});const f=d&&l?cf(d,o):null;let h=-1,m=null;i&&(m=new ResizeObserver(p=>{let[E]=p;E&&E.target===d&&m&&n&&(m.unobserve(n),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(n)})),o()}),d&&!c&&m.observe(d),n&&m.observe(n));let g,k=c?$n(t):null;c&&y();function y(){const p=$n(t);k&&!Pi(k,p)&&o(),k=p,g=requestAnimationFrame(y)}return o(),()=>{var p;u.forEach(E=>{a&&E.removeEventListener("scroll",o),s&&E.removeEventListener("resize",o)}),f==null||f(),(p=m)==null||p.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const Fa=$u,za=ju,Ia=Iu,Ra=Wu,df=(t,n,o)=>{const r=new Map,a={platform:lf,...o},s={...a.platform,_c:r};return zu(t,n,{...a,platform:s})};function uf(t){return t!=null&&typeof t=="object"&&"$el"in t}function Ti(t){if(uf(t)){const n=t.$el;return Aa(n)&&Rn(n)==="#comment"?null:n}return t}function vo(t){return typeof t=="function"?t():e.unref(t)}function Oi(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Fi(t,n){const o=Oi(t);return Math.round(n*o)/o}function La(t,n,o){o===void 0&&(o={});const r=o.whileElementsMounted,a=e.computed(()=>{var x;return(x=vo(o.open))!=null?x:!0}),s=e.computed(()=>vo(o.middleware)),i=e.computed(()=>{var x;return(x=vo(o.placement))!=null?x:"bottom"}),l=e.computed(()=>{var x;return(x=vo(o.strategy))!=null?x:"absolute"}),c=e.computed(()=>{var x;return(x=vo(o.transform))!=null?x:!0}),d=e.computed(()=>Ti(t.value)),u=e.computed(()=>Ti(n.value)),f=e.ref(0),h=e.ref(0),m=e.ref(l.value),g=e.ref(i.value),k=e.shallowRef({}),y=e.ref(!1),p=e.computed(()=>{const x={position:m.value,left:"0",top:"0"};if(!u.value)return x;const b=Fi(u.value,f.value),V=Fi(u.value,h.value);return c.value?{...x,transform:"translate("+b+"px, "+V+"px)",...Oi(u.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:b+"px",top:V+"px"}});let E;function _(){if(d.value==null||u.value==null)return;const x=a.value;df(d.value,u.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(b=>{f.value=b.x,h.value=b.y,m.value=b.strategy,g.value=b.placement,k.value=b.middlewareData,y.value=x!==!1})}function B(){typeof E=="function"&&(E(),E=void 0)}function S(){if(B(),r===void 0){_();return}if(d.value!=null&&u.value!=null){E=r(d.value,u.value,_);return}}function w(){a.value||(y.value=!1)}return e.watch([s,i,l,a],_,{flush:"sync"}),e.watch([d,u],S,{flush:"sync"}),e.watch(a,w,{flush:"sync"}),e.getCurrentScope()&&e.onScopeDispose(B),{x:e.shallowReadonly(f),y:e.shallowReadonly(h),strategy:e.shallowReadonly(m),placement:e.shallowReadonly(g),middlewareData:e.shallowReadonly(k),isPositioned:e.shallowReadonly(y),floatingStyles:p,update:_}}const ff=["aria-busy"],hf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},mf=["for"],pf={key:0,class:"ml-1 text-destructive"},gf={class:"relative"},bf={key:0,class:"flex items-center text-gray-500 gap-2"},yf=["id","placeholder","disabled","readonly","value"],xf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},kf=["disabled"],wf={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},Cf=["onMouseenter","onClick"],Ef={key:0},Bf={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},_f={key:0},Sf={key:1},Vf={key:2},Af={key:1,class:"mt-1 text-xs text-red-600"},gr=e.defineComponent({name:"DCodeAutoComplete",inheritAttrs:!1,__name:"DCodeAutoComplete",props:{modelValue:{},apiModule:{},apiAction:{},apiOptions:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},error:{default:null},errorMessage:{default:null},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},returnObject:{type:Boolean,default:!1},endpoint:{},apiParams:{default:()=>({})},fetchItems:{},icon:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.computed(()=>a.label??void 0),i=G=>{const fe=a[G];return fe===""||fe===!0||fe==="true"||fe===1||fe==="1"},l=e.ref(!1),c=e.computed(()=>o.itemTitle||a["item-title"]||a.itemTitle||"name"),d=e.computed(()=>o.itemValue||a["item-value"]||a.itemValue||"id"),u=e.computed(()=>o.disabled),f=e.computed(()=>i("required")),h=e.computed(()=>i("readonly")),m=e.computed(()=>o.returnObject||i("return-object")||i("returnObject")),g=e.computed(()=>f.value||i("aria-required")),k=e.computed(()=>o.error||o.errorMessage||a["error-message"]),y=e.computed(()=>a.placeholder??""),p=e.computed(()=>{const G=a.minChars??a["min-chars"];if(G==null||G==="")return 0;const fe=typeof G=="number"?G:Number.parseInt(String(G),10);return Number.isFinite(fe)&&fe>0?fe:0}),E=e.computed(()=>{const G=a.rules;return Array.isArray(G)?G:[]}),_=e.computed(()=>{const G=a.id||a.label;return G?`app-autocomplete-${G}-${Math.random().toString(36).slice(2,7)}`:void 0}),B=e.ref(o.modelValue),S=e.ref([]),w=e.ref(!1),x=e.ref(!1),b=e.computed(()=>a.items),V=e.computed(()=>{const G=v.value;return G.apiModule&&G.apiAction||G.apiUrl||o.fetchItems?S.value:b.value??[]}),A=e.computed(()=>!!a.loading),D=e.computed(()=>A.value||w.value),N=e.computed(()=>{const{label:G,items:fe,loading:_e,rules:$e,"item-title":Ve,"item-value":re,itemTitle:de,itemValue:me,minChars:Ae,"min-chars":nt,clearable:Bt,required:So,"aria-required":Ca,disabled:Vo,readonly:no,visible:mt,"return-object":Ea,returnObject:oo,class:ir,"fetch-items":M,fetchItems:O,error:L,errorMessage:F,"error-message":H,...le}=a||{};return le}),P=()=>{if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions},v=e.computed(()=>{const G=o.endpoint||{};return{apiModule:o.apiModule||G.apiModule,apiAction:o.apiAction||G.apiAction,apiUrl:G.apiUrl,apiMethod:G.apiMethod||"GET"}}),Q=e.ref(null),$=e.ref(null),q=e.ref(null),{floatingStyles:Y}=La($,q,{placement:"bottom-start",whileElementsMounted:Oa,middleware:[Fa(4),Ia(),za(),Ra({apply({rects:G,elements:fe,availableHeight:_e}){Object.assign(fe.floating.style,{width:`${G.reference.width}px`,maxHeight:`${_e}px`})}})]}),X=e.ref(!1),T=e.ref(""),W=e.ref(-1),ne=e.ref(null),Z=e.computed(()=>!p.value||(T.value||"").trim().length>=p.value?"":`Ketik minimal ${p.value} karakter`),K=G=>{if(G==null)return"";if(typeof G=="string"||typeof G=="number")return String(G);const fe=c.value;return typeof fe=="function"?fe(G):(G==null?void 0:G[fe])??(G==null?void 0:G.name)??(G==null?void 0:G.nama)??(G==null?void 0:G.label)??(G==null?void 0:G.title)??"-"},ae=G=>{if(G==null)return null;if(typeof G=="string"||typeof G=="number")return G;const fe=d.value;return typeof fe=="function"?fe(G):(G==null?void 0:G[fe])??(G==null?void 0:G.id)??(G==null?void 0:G.value)??(G==null?void 0:G.code)??null},ue=e.computed(()=>{const G=B.value;if(G==null||G==="")return"";if(Array.isArray(G))return G.length?G.map($e=>{if(m.value&&typeof $e=="object"||typeof $e=="object")return K($e);const Ve=V.value.find(re=>ae(re)==$e);return Ve?K(Ve):String($e)}).join(", "):"";if(typeof G=="object")return K(G);const fe=V.value.find(_e=>ae(_e)==G);return fe?K(fe):String(G)}),xe=e.computed(()=>{const G=V.value||[],fe=(T.value||"").trim().toLowerCase(),_e=(ue.value||"").toLowerCase(),$e=!fe||fe===_e;let Ve=G;if($e||(Ve=G.filter(re=>K(re).toLowerCase().includes(fe))),Ve.length>0){const re=de=>{const me=ae(de);return Array.isArray(B.value)?B.value.some(Ae=>Ae==me):B.value==me};Ve=[...Ve].sort((de,me)=>{const Ae=re(de),nt=re(me);return Ae&&!nt?-1:!Ae&&nt?1:0})}return Ve}),De=G=>Array.isArray(G)?G.length===0:G==null||G==="",we=G=>{if(ne.value=null,f.value&&De(G)&&!E.value.length)return ne.value="This field is required",!1;for(const fe of E.value){const _e=fe(G);if(_e===!1)return ne.value="Invalid value",!1;if(typeof _e=="string")return ne.value=_e,!1}return!0},ee=async()=>{if(u.value||h.value)return;X.value=!0,W.value=xe.value.length?0:-1,T.value=ue.value||"";const G=v.value,fe=G.apiModule&&G.apiAction||G.apiUrl||o.fetchItems;o.autoFetchOnOpen&&fe&&!x.value&&(await Ge(),W.value=xe.value.length?0:-1)},z=()=>{X.value=!1,W.value=-1,T.value=ue.value||""},J=G=>{const fe=m.value?G:ae(G);let _e=fe;Array.isArray(B.value)&&(_e=[fe]),B.value=_e,r("update:modelValue",_e),ne.value=null,we(_e),T.value=K(G),z()},se=()=>{S.value=[],x.value=!1,B.value=Array.isArray(B.value)?[]:null,r("update:modelValue",B.value),T.value="",ne.value=null},Ee=()=>{l.value=!0,se(),z(),setTimeout(()=>{l.value=!1},0)},ve=G=>{if(u.value||h.value)return;const fe=G.target.value;T.value=fe,ne.value&&(ne.value=null),X.value||(X.value=!0),W.value=xe.value.length?0:-1;const _e=v.value.apiModule&&v.value.apiAction||v.value.apiUrl||o.fetchItems;o.autoFetchOnOpen&&_e&&!D.value&&!x.value&&Ge()},qe=G=>{var _e;if(u.value||h.value)return;const fe={ArrowDown:()=>{if(G.preventDefault(),!X.value){ee();return}xe.value.length&&(W.value=Math.min(W.value+1,xe.value.length-1))},ArrowUp:()=>{!X.value||!xe.value.length||(G.preventDefault(),W.value=Math.max(W.value-1,0))},Enter:()=>{if(!X.value)return;G.preventDefault();const $e=xe.value[W.value];$e&&J($e)},Escape:()=>{G.preventDefault(),z()},Tab:()=>{z()}};(_e=fe[G.key])==null||_e.call(fe)},Ge=async()=>{const G=v.value;if(G.apiModule&&G.apiAction||G.apiUrl||o.fetchItems){w.value=!0;try{let _e;if(o.fetchItems){const $e=P()||{},Ve={page:1,perPage:100,search:(T.value||"").trim(),...$e,...o.apiParams},re=await o.fetchItems(Ve),de=(re==null?void 0:re.data)??re;_e=(de==null?void 0:de.data)??de}else{const Ve=ft().DCodeApi;if(typeof Ve!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const de={page:1,perPage:100,...P()||{},...o.apiParams};let me;G.apiUrl?me=await Ve("","",de,{_url:G.apiUrl,_method:G.apiMethod||"POST"}):me=await Ve(G.apiModule,G.apiAction,de);const Ae=(me==null?void 0:me.data)??me;_e=(Ae==null?void 0:Ae.data)??Ae}S.value=Array.isArray(_e)?_e:[],x.value=!0}catch(_e){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",_e),ne.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(_e==null?void 0:_e.message)||(_e==null?void 0:_e.toString())||"Failed to load options"}`,S.value=[],x.value=!0}finally{w.value=!1}}},tt=G=>{const fe=ae(G);return m.value?B.value?Array.isArray(B.value)?B.value.some(_e=>ae(_e)==fe):ae(B.value)==fe:!1:Array.isArray(B.value)?B.value.some(_e=>_e==fe):B.value==fe};e.watch(()=>[P(),v.value,o.apiParams],([G,fe,_e],[$e,Ve,re])=>{const de=v.value;if(!(de.apiModule&&de.apiAction||de.apiUrl||o.fetchItems)){se();return}const Ae=JSON.stringify(G??null)===JSON.stringify($e??null),nt=JSON.stringify(_e??null)===JSON.stringify(re??null);Ae&&nt||(se(),nt||Ge())},{deep:!0}),e.watch(()=>o.modelValue,(G,fe)=>{B.value=G,!l.value&&(G==null||G==="")&&fe!=null&&o.apiModule&&o.apiAction&&(S.value=[],x.value=!1),T.value=ue.value||""},{immediate:!0});const ze=v.value;(ze.apiModule&&ze.apiAction||ze.apiUrl||o.fetchItems)&&(o.autoFetchOnMount||!De(o.modelValue))&&Ge();const bt=G=>{const fe=Q.value,_e=q.value,$e=G.target;fe&&fe.contains($e)||_e&&_e.contains($e)||X.value&&z()},It=e.computed(()=>{const G=o.modelValue;return G==null?!1:typeof G=="string"?G.trim().length>0:Array.isArray(G)?G.length>0:typeof G=="object"?Object.keys(G).length>0:!0}),Mt=e.computed(()=>!!o.clearable&&It.value&&!o.disabled);return e.onMounted(()=>{document.addEventListener("mousedown",bt)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",bt)}),(G,fe)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:Q,class:e.normalizeClass(["w-full",e.unref(a).class]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",hf)):e.createCommentVNode("",!0),fe[6]||(fe[6]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:_.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),g.value?(e.openBlock(),e.createElementBlock("span",pf,"*")):e.createCommentVNode("",!0)],8,mf)):e.createCommentVNode("",!0),e.createElementVNode("div",gf,[e.createElementVNode("div",{ref_key:"reference",ref:$,class:e.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[u.value||h.value?"opacity-60 cursor-not-allowed":"",ne.value||k.value?"border-red-500 focus-within:ring-red-500":""]])},[o.icon||G.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",bf,[e.renderSlot(G.$slots,"prepend-inner",{},()=>[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps(N.value,{id:_.value,type:"text",class:["w-full bg-transparent outline-none text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400",u.value||h.value?"cursor-not-allowed":"cursor-text"],placeholder:y.value,disabled:u.value,readonly:h.value,value:X.value?T.value:ue.value||T.value,onFocus:fe[0]||(fe[0]=()=>{X.value||ee()}),onClick:fe[1]||(fe[1]=()=>{X.value||ee()}),onInput:ve,onKeydown:qe,onBlur:fe[2]||(fe[2]=()=>we(B.value))}),null,16,yf),D.value?(e.openBlock(),e.createElementBlock("svg",xf,[...fe[7]||(fe[7]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):Mt.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onMousedown:fe[3]||(fe[3]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(Ee,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:u.value||h.value,onClick:fe[4]||(fe[4]=_e=>X.value?z():ee()),"aria-label":"Toggle"},[e.createVNode(e.unref(ce.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":X.value}])},null,8,["class"])],8,kf))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:q,style:e.normalizeStyle(e.unref(Y)),class:"z-[50] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-neutral-700/50 dark:bg-neutral-800"},[e.createElementVNode("div",wf,[xe.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(xe.value,(_e,$e)=>(e.openBlock(),e.createElementBlock("button",{key:ae(_e)??$e,type:"button",class:e.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",$e===W.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:Ve=>W.value=$e,onMousedown:fe[5]||(fe[5]=e.withModifiers(()=>{},["prevent"])),onClick:Ve=>J(_e)},[e.createTextVNode(e.toDisplayString(K(_e))+" ",1),tt(_e)?(e.openBlock(),e.createElementBlock("span",Ef," ✓ ")):e.createCommentVNode("",!0)],42,Cf))),128)):e.renderSlot(G.$slots,"no-data",{key:1},()=>[e.createElementVNode("div",Bf,[D.value?(e.openBlock(),e.createElementBlock("span",_f,"Loading data…")):Z.value?(e.openBlock(),e.createElementBlock("span",Sf,e.toDisplayString(Z.value),1)):(e.openBlock(),e.createElementBlock("span",Vf,"No data available"))])])])],4)):e.createCommentVNode("",!0)]))]),ne.value||k.value?(e.openBlock(),e.createElementBlock("p",Af,e.toDisplayString(ne.value||k.value),1)):e.createCommentVNode("",!0)],64))],10,ff)),[[e.vShow,t.visible]])}}),Df=["aria-busy"],Nf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Mf=["for"],vf={key:0,class:"ml-1 text-destructive"},Pf={class:"relative"},Tf={key:0,class:"flex items-center text-gray-500 gap-2"},Of=["id","placeholder","disabled","value"],Ff={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},zf=["disabled"],If={key:0,class:"p-3 space-y-2"},Rf=["onMouseenter","onClick"],Lf={class:"flex items-center space-x-3"},$f={class:"flex-1"},jf={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Wf={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},Uf={key:0},Hf={key:2,class:"p-3 text-center"},qf={class:"inline-flex items-center space-x-2"},Gf={class:"text-sm text-gray-500"},Xf={key:3,class:"p-3 text-center"},Kf={class:"text-xs text-gray-400"},Yf={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Jf={key:1,class:"mt-1 text-xs text-red-600"},Qf={key:2,class:"mt-1 text-xs text-gray-500"},zi=e.defineComponent({name:"DCodeInfiniteAutoComplete",inheritAttrs:!1,__name:"DCodeInfiniteAutoComplete",props:{modelValue:{},apiModule:{},apiAction:{},apiOptions:{},autoFetchOnOpen:{type:Boolean,default:!0},refreshOnOpen:{type:Boolean,default:!1},autoFetchOnMount:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},error:{default:null},errorMessage:{default:null},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},itemSubtitle:{},returnObject:{type:Boolean,default:!1},endpoint:{},apiParams:{},fetchItems:{},icon:{},label:{},placeholder:{default:"Select an option"},required:{type:Boolean,default:!1},inputType:{default:"text"},helperText:{default:""},noResultsText:{default:"No results found"},loadingText:{default:"Loading more..."},endOfResultsText:{default:"End of results"},pageSize:{default:10},threshold:{default:100},debounceMs:{default:300}},emits:["update:modelValue","focus","blur","select","search","load-more","end-of-results","error"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.ref(),i=e.ref(),l=e.ref(),c=e.ref(),d=e.ref(),u=e.computed(()=>{const W=o.label||o.placeholder;return W?`app-infinite-autocomplete-${W}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=e.ref(""),h=e.ref([]),m=e.ref(!1),g=e.ref(!1),k=e.ref(-1),y=e.ref(1),p=e.ref(!0),E=e.ref(0),_=e.ref(),{floatingStyles:B}=La(c,d,{placement:"bottom-start",whileElementsMounted:Oa,middleware:[Fa(4),Ia(),za(),Ra({apply({rects:W,elements:ne}){Object.assign(ne.floating.style,{width:`${W.reference.width}px`})}})]});e.computed(()=>({"opacity-50 pointer-events-none":o.disabled,relative:!0}));const S=e.computed(()=>f.value?h.value.filter(W=>V(W).toLowerCase().includes(f.value.toLowerCase())):h.value),w=e.computed(()=>{if(g.value&&f.value)return f.value;if(o.modelValue){if(o.returnObject)return V(o.modelValue);{const W=h.value.find(ne=>A(ne)===o.modelValue);return W?V(W):String(o.modelValue)}}return""}),x=()=>{g.value=!0},b=()=>{g.value=!1},V=W=>typeof o.itemTitle=="function"?o.itemTitle(W):W[o.itemTitle]||"",A=W=>typeof o.itemValue=="function"?o.itemValue(W):W[o.itemValue]||W,D=W=>o.itemSubtitle?typeof o.itemSubtitle=="function"?o.itemSubtitle(W):W[o.itemSubtitle]||"":"",N=W=>o.modelValue?o.returnObject?A(W)===A(o.modelValue):A(W)===o.modelValue:!1,P=W=>{var Z;const ne=o.returnObject?W:A(W);r("update:modelValue",ne),r("select",W),g.value=!1,f.value="",(Z=s.value)==null||Z.blur()},v=()=>{var W;r("update:modelValue",null),f.value="",(W=s.value)==null||W.focus()},Q=W=>{g.value=!0,r("focus",W),o.autoFetchOnOpen&&!m.value&&(o.refreshOnOpen||h.value.length===0)&&T(!0)},$=W=>{setTimeout(()=>{g.value=!1,r("blur",W)},200)},q=W=>{const ne=W.target;f.value=ne.value,_.value&&clearTimeout(_.value),_.value=setTimeout(()=>{r("search",f.value),y.value=1,p.value=!0,T(!0)},o.debounceMs)},Y=W=>{if(g.value)switch(W.key){case"ArrowDown":W.preventDefault(),k.value=Math.min(k.value+1,S.value.length-1);break;case"ArrowUp":W.preventDefault(),k.value=Math.max(k.value-1,0);break;case"Enter":W.preventDefault(),k.value>=0&&S.value[k.value]&&P(S.value[k.value]);break;case"Escape":g.value=!1;break}},X=W=>{if(!p.value||m.value)return;const ne=W.target,{scrollTop:Z,scrollHeight:K,clientHeight:ae}=ne;Z+ae>=K-o.threshold&&T()},T=async(W=!1)=>{var ne,Z;if(!m.value){m.value=!0;try{let K=[];if(o.fetchItems)K=await o.fetchItems();else{const ae=ft(),ue=((ne=o.endpoint)==null?void 0:ne.apiModule)||o.apiModule,xe=((Z=o.endpoint)==null?void 0:Z.apiAction)||o.apiAction;if(!ue||!xe)throw new Error("API module and action are required");const De={page:W?1:y.value,pageSize:o.pageSize,search:f.value,...o.apiParams},we=await ae.apiUrl(`/${ue}/${xe}`,"GET",De);K=we.data||we.items||we||[],E.value=we.total||we.totalItems||K.length}W?(h.value=K,y.value=1):(h.value.push(...K),y.value++),p.value=K.length>=o.pageSize,p.value||r("end-of-results"),r("load-more",{items:K,page:y.value,hasMore:p.value,total:E.value})}catch(K){console.error("Error fetching items:",K),r("error",K)}finally{m.value=!1}}};return e.onMounted(()=>{o.autoFetchOnMount&&T()}),e.onUnmounted(()=>{_.value&&clearTimeout(_.value)}),e.watch(()=>o.modelValue,W=>{W||(f.value="")}),(W,ne)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:l,class:e.normalizeClass(["w-full",e.unref(a).class]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Nf)):e.createCommentVNode("",!0),ne[3]||(ne[3]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",vf,"*")):e.createCommentVNode("",!0)],8,Mf)):e.createCommentVNode("",!0),e.createElementVNode("div",Pf,[e.createElementVNode("div",{ref_key:"reference",ref:c,class:e.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[t.disabled?"opacity-60 cursor-not-allowed":"",t.error?"border-red-500 focus-within:ring-red-500":""]])},[o.icon?(e.openBlock(),e.createElementBlock("div",Tf,[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({ref_key:"inputRef",ref:s},W.$attrs,{id:u.value,type:"text",class:["w-full bg-transparent outline-none text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400",t.disabled?"cursor-not-allowed":"cursor-text"],placeholder:t.placeholder,disabled:t.disabled,value:w.value,onFocus:Q,onBlur:$,onInput:q,onKeydown:Y}),null,16,Of),m.value?(e.openBlock(),e.createElementBlock("svg",Ff,[...ne[4]||(ne[4]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):t.clearable&&t.modelValue?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onMousedown:ne[0]||(ne[0]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(v,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:t.disabled,onClick:ne[1]||(ne[1]=Z=>g.value?b():x()),"aria-label":"Toggle"},[e.createVNode(e.unref(ce.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":g.value}])},null,8,["class"])],8,zf))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[g.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:e.normalizeStyle(e.unref(B)),class:"z-[9999] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-neutral-700/50 dark:bg-neutral-800"},[e.createElementVNode("div",{ref_key:"scrollContainer",ref:i,class:"max-h-64 overflow-auto",onScroll:X},[m.value&&h.value.length===0?(e.openBlock(),e.createElementBlock("div",If,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,Z=>e.createElementVNode("div",{key:Z,class:"flex items-center space-x-3"},[...ne[5]||(ne[5]=[e.createElementVNode("div",{class:"skeleton h-4 w-4 bg-gray-200 rounded"},null,-1),e.createElementVNode("div",{class:"skeleton h-4 flex-1 bg-gray-200 rounded"},null,-1)])])),64))])):S.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(S.value,(Z,K)=>(e.openBlock(),e.createElementBlock("button",{key:A(Z)??K,type:"button",class:e.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",K===k.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:ae=>k.value=K,onMousedown:ne[2]||(ne[2]=e.withModifiers(()=>{},["prevent"])),onClick:ae=>P(Z)},[e.renderSlot(W.$slots,"item",{item:Z,index:K},()=>[e.createElementVNode("div",Lf,[e.createElementVNode("div",$f,[e.createElementVNode("div",jf,e.toDisplayString(V(Z)),1),t.itemSubtitle?(e.openBlock(),e.createElementBlock("div",Wf,e.toDisplayString(D(Z)),1)):e.createCommentVNode("",!0)])])]),N(Z)?(e.openBlock(),e.createElementBlock("span",Uf," ✓ ")):e.createCommentVNode("",!0)],42,Rf))),128)):e.createCommentVNode("",!0),m.value&&h.value.length>0?(e.openBlock(),e.createElementBlock("div",Hf,[e.createElementVNode("div",qf,[ne[6]||(ne[6]=e.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),e.createElementVNode("span",Gf,e.toDisplayString(t.loadingText),1)])])):e.createCommentVNode("",!0),!p.value&&h.value.length>0?(e.openBlock(),e.createElementBlock("div",Xf,[e.createElementVNode("div",Kf,e.toDisplayString(t.endOfResultsText),1)])):!m.value&&h.value.length===0?(e.openBlock(),e.createElementBlock("div",Yf,e.toDisplayString(t.noResultsText),1)):e.createCommentVNode("",!0)],544)],4)):e.createCommentVNode("",!0)]))]),t.error?(e.openBlock(),e.createElementBlock("p",Jf,e.toDisplayString(t.errorMessage||t.error),1)):t.helperText?(e.openBlock(),e.createElementBlock("p",Qf,e.toDisplayString(t.helperText),1)):e.createCommentVNode("",!0)],64))],10,Df)),[[e.vShow,t.visible]])}});function Ii(t){var n,o,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(o=Ii(t[n]))&&(r&&(r+=" "),r+=o)}else for(o in t)t[o]&&(r&&(r+=" "),r+=o);return r}function Ri(){for(var t,n,o=0,r="",a=arguments.length;o<a;o++)(t=arguments[o])&&(n=Ii(t))&&(r&&(r+=" "),r+=n);return r}const Zf=(t,n)=>{const o=new Array(t.length+n.length);for(let r=0;r<t.length;r++)o[r]=t[r];for(let r=0;r<n.length;r++)o[t.length+r]=n[r];return o},eh=(t,n)=>({classGroupId:t,validator:n}),Li=(t=new Map,n=null,o)=>({nextPart:t,validators:n,classGroupId:o}),br="-",$i=[],th="arbitrary..",nh=t=>{const n=rh(t),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return oh(i);const l=i.split(br),c=l[0]===""&&l.length>1?1:0;return ji(l,c,n)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=r[i],d=o[i];return c?d?Zf(d,c):c:d||$i}return o[i]||$i}}},ji=(t,n,o)=>{if(t.length-n===0)return o.classGroupId;const a=t[n],s=o.nextPart.get(a);if(s){const d=ji(t,n+1,s);if(d)return d}const i=o.validators;if(i===null)return;const l=n===0?t.join(br):t.slice(n).join(br),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},oh=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=t.slice(1,-1),o=n.indexOf(":"),r=n.slice(0,o);return r?th+r:void 0})(),rh=t=>{const{theme:n,classGroups:o}=t;return ah(o,n)},ah=(t,n)=>{const o=Li();for(const r in t){const a=t[r];$a(a,o,r,n)}return o},$a=(t,n,o,r)=>{const a=t.length;for(let s=0;s<a;s++){const i=t[s];sh(i,n,o,r)}},sh=(t,n,o,r)=>{if(typeof t=="string"){ih(t,n,o);return}if(typeof t=="function"){lh(t,n,o,r);return}ch(t,n,o,r)},ih=(t,n,o)=>{const r=t===""?n:Wi(n,t);r.classGroupId=o},lh=(t,n,o,r)=>{if(dh(t)){$a(t(r),n,o,r);return}n.validators===null&&(n.validators=[]),n.validators.push(eh(o,t))},ch=(t,n,o,r)=>{const a=Object.entries(t),s=a.length;for(let i=0;i<s;i++){const[l,c]=a[i];$a(c,Wi(n,l),o,r)}},Wi=(t,n)=>{let o=t;const r=n.split(br),a=r.length;for(let s=0;s<a;s++){const i=r[s];let l=o.nextPart.get(i);l||(l=Li(),o.nextPart.set(i,l)),o=l}return o},dh=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,uh=t=>{if(t<1)return{get:()=>{},set:()=>{}};let n=0,o=Object.create(null),r=Object.create(null);const a=(s,i)=>{o[s]=i,n++,n>t&&(n=0,r=o,o=Object.create(null))};return{get(s){let i=o[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return a(s,i),i},set(s,i){s in o?o[s]=i:a(s,i)}}},ja="!",Ui=":",fh=[],Hi=(t,n,o,r,a)=>({modifiers:t,hasImportantModifier:n,baseClassName:o,maybePostfixModifierPosition:r,isExternal:a}),hh=t=>{const{prefix:n,experimentalParseClassName:o}=t;let r=a=>{const s=[];let i=0,l=0,c=0,d;const u=a.length;for(let k=0;k<u;k++){const y=a[k];if(i===0&&l===0){if(y===Ui){s.push(a.slice(c,k)),c=k+1;continue}if(y==="/"){d=k;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const f=s.length===0?a:a.slice(c);let h=f,m=!1;f.endsWith(ja)?(h=f.slice(0,-1),m=!0):f.startsWith(ja)&&(h=f.slice(1),m=!0);const g=d&&d>c?d-c:void 0;return Hi(s,m,h,g)};if(n){const a=n+Ui,s=r;r=i=>i.startsWith(a)?s(i.slice(a.length)):Hi(fh,!1,i,void 0,!0)}if(o){const a=r;r=s=>o({className:s,parseClassName:a})}return r},mh=t=>{const n=new Map;return t.orderSensitiveModifiers.forEach((o,r)=>{n.set(o,1e6+r)}),o=>{const r=[];let a=[];for(let s=0;s<o.length;s++){const i=o[s],l=i[0]==="[",c=n.has(i);l||c?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(i)):a.push(i)}return a.length>0&&(a.sort(),r.push(...a)),r}},ph=t=>({cache:uh(t.cacheSize),parseClassName:hh(t),sortModifiers:mh(t),...nh(t)}),gh=/\s+/,bh=(t,n)=>{const{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=n,i=[],l=t.trim().split(gh);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:h,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:k}=o(u);if(f){c=u+(c.length>0?" "+c:c);continue}let y=!!k,p=r(y?g.substring(0,k):g);if(!p){if(!y){c=u+(c.length>0?" "+c:c);continue}if(p=r(g),!p){c=u+(c.length>0?" "+c:c);continue}y=!1}const E=h.length===0?"":h.length===1?h[0]:s(h).join(":"),_=m?E+ja:E,B=_+p;if(i.indexOf(B)>-1)continue;i.push(B);const S=a(p,y);for(let w=0;w<S.length;++w){const x=S[w];i.push(_+x)}c=u+(c.length>0?" "+c:c)}return c},yh=(...t)=>{let n=0,o,r,a="";for(;n<t.length;)(o=t[n++])&&(r=qi(o))&&(a&&(a+=" "),a+=r);return a},qi=t=>{if(typeof t=="string")return t;let n,o="";for(let r=0;r<t.length;r++)t[r]&&(n=qi(t[r]))&&(o&&(o+=" "),o+=n);return o},xh=(t,...n)=>{let o,r,a,s;const i=c=>{const d=n.reduce((u,f)=>f(u),t());return o=ph(d),r=o.cache.get,a=o.cache.set,s=l,l(c)},l=c=>{const d=r(c);if(d)return d;const u=bh(c,o);return a(c,u),u};return s=i,(...c)=>s(yh(...c))},kh=[],pt=t=>{const n=o=>o[t]||kh;return n.isThemeGetter=!0,n},Gi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Xi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,wh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Ch=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Eh=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Bh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,_h=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Sh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_n=t=>wh.test(t),Fe=t=>!!t&&!Number.isNaN(Number(t)),Sn=t=>!!t&&Number.isInteger(Number(t)),Wa=t=>t.endsWith("%")&&Fe(t.slice(0,-1)),hn=t=>Ch.test(t),Ki=()=>!0,Vh=t=>Eh.test(t)&&!Bh.test(t),Ua=()=>!1,Ah=t=>_h.test(t),Dh=t=>Sh.test(t),Nh=t=>!ge(t)&&!ye(t),Mh=t=>Vn(t,tl,Ua),ge=t=>Gi.test(t),jn=t=>Vn(t,nl,Vh),Yi=t=>Vn(t,Rh,Fe),vh=t=>Vn(t,rl,Ki),Ph=t=>Vn(t,ol,Ua),Ji=t=>Vn(t,Zi,Ua),Th=t=>Vn(t,el,Dh),yr=t=>Vn(t,al,Ah),ye=t=>Xi.test(t),Po=t=>Wn(t,nl),Oh=t=>Wn(t,ol),Qi=t=>Wn(t,Zi),Fh=t=>Wn(t,tl),zh=t=>Wn(t,el),xr=t=>Wn(t,al,!0),Ih=t=>Wn(t,rl,!0),Vn=(t,n,o)=>{const r=Gi.exec(t);return r?r[1]?n(r[1]):o(r[2]):!1},Wn=(t,n,o=!1)=>{const r=Xi.exec(t);return r?r[1]?n(r[1]):o:!1},Zi=t=>t==="position"||t==="percentage",el=t=>t==="image"||t==="url",tl=t=>t==="length"||t==="size"||t==="bg-size",nl=t=>t==="length",Rh=t=>t==="number",ol=t=>t==="family-name",rl=t=>t==="number"||t==="weight",al=t=>t==="shadow",Lh=xh(()=>{const t=pt("color"),n=pt("font"),o=pt("text"),r=pt("font-weight"),a=pt("tracking"),s=pt("leading"),i=pt("breakpoint"),l=pt("container"),c=pt("spacing"),d=pt("radius"),u=pt("shadow"),f=pt("inset-shadow"),h=pt("text-shadow"),m=pt("drop-shadow"),g=pt("blur"),k=pt("perspective"),y=pt("aspect"),p=pt("ease"),E=pt("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...B(),ye,ge],w=()=>["auto","hidden","clip","visible","scroll"],x=()=>["auto","contain","none"],b=()=>[ye,ge,c],V=()=>[_n,"full","auto",...b()],A=()=>[Sn,"none","subgrid",ye,ge],D=()=>["auto",{span:["full",Sn,ye,ge]},Sn,ye,ge],N=()=>[Sn,"auto",ye,ge],P=()=>["auto","min","max","fr",ye,ge],v=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...b()],q=()=>[_n,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],Y=()=>[_n,"screen","full","dvw","lvw","svw","min","max","fit",...b()],X=()=>[_n,"screen","full","lh","dvh","lvh","svh","min","max","fit",...b()],T=()=>[t,ye,ge],W=()=>[...B(),Qi,Ji,{position:[ye,ge]}],ne=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",Fh,Mh,{size:[ye,ge]}],K=()=>[Wa,Po,jn],ae=()=>["","none","full",d,ye,ge],ue=()=>["",Fe,Po,jn],xe=()=>["solid","dashed","dotted","double"],De=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],we=()=>[Fe,Wa,Qi,Ji],ee=()=>["","none",g,ye,ge],z=()=>["none",Fe,ye,ge],J=()=>["none",Fe,ye,ge],se=()=>[Fe,ye,ge],Ee=()=>[_n,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[hn],breakpoint:[hn],color:[Ki],container:[hn],"drop-shadow":[hn],ease:["in","out","in-out"],font:[Nh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[hn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[hn],shadow:[hn],spacing:["px",Fe],text:[hn],"text-shadow":[hn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",_n,ge,ye,y]}],container:["container"],columns:[{columns:[Fe,ge,ye,l]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:w()}],"overflow-x":[{"overflow-x":w()}],"overflow-y":[{"overflow-y":w()}],overscroll:[{overscroll:x()}],"overscroll-x":[{"overscroll-x":x()}],"overscroll-y":[{"overscroll-y":x()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[Sn,"auto",ye,ge]}],basis:[{basis:[_n,"full","auto",l,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Fe,_n,"auto","initial","none",ge]}],grow:[{grow:["",Fe,ye,ge]}],shrink:[{shrink:["",Fe,ye,ge]}],order:[{order:[Sn,"first","last","none",ye,ge]}],"grid-cols":[{"grid-cols":A()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":A()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":P()}],"auto-rows":[{"auto-rows":P()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...v(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...v()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":v()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pbs:[{pbs:b()}],pbe:[{pbe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],"inline-size":[{inline:["auto",...Y()]}],"min-inline-size":[{"min-inline":["auto",...Y()]}],"max-inline-size":[{"max-inline":["none",...Y()]}],"block-size":[{block:["auto",...X()]}],"min-block-size":[{"min-block":["auto",...X()]}],"max-block-size":[{"max-block":["none",...X()]}],w:[{w:[l,"screen",...q()]}],"min-w":[{"min-w":[l,"screen","none",...q()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",o,Po,jn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ih,vh]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Wa,ge]}],"font-family":[{font:[Oh,Ph,n]}],"font-features":[{"font-features":[ge]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ye,ge]}],"line-clamp":[{"line-clamp":[Fe,"none",ye,Yi]}],leading:[{leading:[s,...b()]}],"list-image":[{"list-image":["none",ye,ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ye,ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Fe,"from-font","auto",ye,jn]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[Fe,"auto",ye,ge]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ye,ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ye,ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:ne()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Sn,ye,ge],radial:["",ye,ge],conic:[Sn,ye,ge]},zh,Th]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Fe,ye,ge]}],"outline-w":[{outline:["",Fe,Po,jn]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",u,xr,yr]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",f,xr,yr]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[Fe,jn]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",h,xr,yr]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[Fe,ye,ge]}],"mix-blend":[{"mix-blend":[...De(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":De()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Fe]}],"mask-image-linear-from-pos":[{"mask-linear-from":we()}],"mask-image-linear-to-pos":[{"mask-linear-to":we()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":we()}],"mask-image-t-to-pos":[{"mask-t-to":we()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":we()}],"mask-image-r-to-pos":[{"mask-r-to":we()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":we()}],"mask-image-b-to-pos":[{"mask-b-to":we()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":we()}],"mask-image-l-to-pos":[{"mask-l-to":we()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":we()}],"mask-image-x-to-pos":[{"mask-x-to":we()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":we()}],"mask-image-y-to-pos":[{"mask-y-to":we()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[ye,ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":we()}],"mask-image-radial-to-pos":[{"mask-radial-to":we()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":B()}],"mask-image-conic-pos":[{"mask-conic":[Fe]}],"mask-image-conic-from-pos":[{"mask-conic-from":we()}],"mask-image-conic-to-pos":[{"mask-conic-to":we()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:ne()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ye,ge]}],filter:[{filter:["","none",ye,ge]}],blur:[{blur:ee()}],brightness:[{brightness:[Fe,ye,ge]}],contrast:[{contrast:[Fe,ye,ge]}],"drop-shadow":[{"drop-shadow":["","none",m,xr,yr]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",Fe,ye,ge]}],"hue-rotate":[{"hue-rotate":[Fe,ye,ge]}],invert:[{invert:["",Fe,ye,ge]}],saturate:[{saturate:[Fe,ye,ge]}],sepia:[{sepia:["",Fe,ye,ge]}],"backdrop-filter":[{"backdrop-filter":["","none",ye,ge]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[Fe,ye,ge]}],"backdrop-contrast":[{"backdrop-contrast":[Fe,ye,ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Fe,ye,ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Fe,ye,ge]}],"backdrop-invert":[{"backdrop-invert":["",Fe,ye,ge]}],"backdrop-opacity":[{"backdrop-opacity":[Fe,ye,ge]}],"backdrop-saturate":[{"backdrop-saturate":[Fe,ye,ge]}],"backdrop-sepia":[{"backdrop-sepia":["",Fe,ye,ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ye,ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Fe,"initial",ye,ge]}],ease:[{ease:["linear","initial",p,ye,ge]}],delay:[{delay:[Fe,ye,ge]}],animate:[{animate:["none",E,ye,ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,ye,ge]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:J()}],"scale-x":[{"scale-x":J()}],"scale-y":[{"scale-y":J()}],"scale-z":[{"scale-z":J()}],"scale-3d":["scale-3d"],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[ye,ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ye,ge]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mbs":[{"scroll-mbs":b()}],"scroll-mbe":[{"scroll-mbe":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pbs":[{"scroll-pbs":b()}],"scroll-pbe":[{"scroll-pbe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ye,ge]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[Fe,Po,jn,Yi]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Ie(...t){return Lh(Ri(t))}function sl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ha={},qa={},kr={exports:{}},il;function $h(){if(il)return kr.exports;il=1;var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};return kr.exports=n(),kr.exports.createColors=n,kr.exports}var ll;function jh(){return ll||(ll=1,(function(t){var n={};Object.defineProperty(t,"__esModule",{value:!0});function o(d,u){for(var f in u)Object.defineProperty(d,f,{enumerable:!0,get:u[f]})}o(t,{dim:function(){return l},default:function(){return c}});const r=a($h());function a(d){return d&&d.__esModule?d:{default:d}}let s=new Set;function i(d,u,f){typeof process<"u"&&n.JEST_WORKER_ID||f&&s.has(f)||(f&&s.add(f),console.warn(""),u.forEach(h=>console.warn(d,"-",h)))}function l(d){return r.default.dim(d)}const c={info(d,u){i(r.default.bold(r.default.cyan("info")),...Array.isArray(d)?[d]:[u,d])},warn(d,u){i(r.default.bold(r.default.yellow("warn")),...Array.isArray(d)?[d]:[u,d])},risk(d,u){i(r.default.bold(r.default.magenta("risk")),...Array.isArray(d)?[d]:[u,d])}}})(qa)),qa}var cl;function Wh(){return cl||(cl=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});const n=o(jh());function o(s){return s&&s.__esModule?s:{default:s}}function r({version:s,from:i,to:l}){n.default.warn(`${i}-color-renamed`,[`As of Tailwind CSS ${s}, \`${i}\` has been renamed to \`${l}\`.`,"Update your configuration file to silence this warning."])}const a={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(Ha)),Ha}var Ga,dl;function Uh(){if(dl)return Ga;dl=1;let t=Wh();return Ga=(t.__esModule?t:{default:t}).default,Ga}var Hh=Uh();const qh=sl(Hh),ul=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,fl=Ri,wr=(t,n)=>o=>{var r;if((n==null?void 0:n.variants)==null)return fl(t,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:a,defaultVariants:s}=n,i=Object.keys(a).map(d=>{const u=o==null?void 0:o[d],f=s==null?void 0:s[d];if(u===null)return null;const h=ul(u)||ul(f);return a[d][h]}),l=o&&Object.entries(o).reduce((d,u)=>{let[f,h]=u;return h===void 0||(d[f]=h),d},{}),c=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:f,className:h,...m}=u;return Object.entries(m).every(g=>{let[k,y]=g;return Array.isArray(y)?y.includes({...s,...l}[k]):{...s,...l}[k]===y})?[...d,f,h]:d},[]);return fl(t,i,c,o==null?void 0:o.class,o==null?void 0:o.className)},Jt=e.defineComponent({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Se.Primitive),{as:t.as,"as-child":t.asChild,class:e.normalizeClass(e.unref(Ie)(e.unref(io)({variant:t.variant,size:t.size}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),io=wr("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",xs:"h-7 rounded px-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-8 w-8","icon-sm":"size-7","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),hl=e.defineComponent({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(t,{emit:n}){const o=t,r=n,a=Se.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(Se.TooltipRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),ml=e.defineComponent({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:n}){const o=t,r=n,a=lt.reactiveOmit(o,"class"),s=Se.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Se.TooltipPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Se.TooltipContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(Ie)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),pl=e.defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Se.TooltipProvider),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),gl=e.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Se.TooltipTrigger),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Gh={class:"relative z-10"},Xh="font-medium transition-all duration-300 ease-in-out hover:-translate-y-0.5 hover:scale-[1.02] active:translate-y-0 active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-60 disabled:cursor-not-allowed disabled:shadow-none disabled:translate-y-0 disabled:scale-100 relative overflow-hidden before:absolute before:inset-0 before:bg-white/20 before:translate-y-full before:transition-transform before:duration-300 hover:before:translate-y-0",Kh=e.defineComponent({name:"DCodeButton",inheritAttrs:!1,__name:"DCodeButton",props:{icon:{},text:{default:""},variant:{default:"default"},size:{default:"default"},tooltip:{default:""},bgColor:{default:""},textColor:{default:""},borderColor:{default:""},rounded:{default:"lg"},borderStyle:{default:"solid"},disabled:{type:Boolean,default:!1},type:{default:"button"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},setup(t){const n=e.useAttrs(),o=t,r=e.computed(()=>o.icon&&Gt[o.icon]||null),a=e.computed(()=>!!o.tooltip),s=e.computed(()=>o.visible??!0),i=e.computed(()=>{const Z=String(o.variant||"default").toLowerCase();return Z==="tonal"?"secondary":Z==="elevated"?"default":Z}),l=e.computed(()=>String(o.bgColor||"").toLowerCase()),c=e.computed(()=>String(o.type||"button").toLowerCase()),d=e.computed(()=>{const{class:Z,...K}=n;return K}),u=e.computed(()=>Ie(n.class)),f=e.computed(()=>((u.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),h=e.computed(()=>o.size==="sm"?"h-9":o.size==="lg"?"h-11":o.size==="icon"?"h-10 w-10":"h-10"),m=e.computed(()=>o.size==="icon"?"":!o.text&&o.icon?"w-10":"w-28"),g=e.computed(()=>o.rounded?o.rounded.startsWith("rounded")?o.rounded:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl","3xl":"rounded-3xl",full:"rounded-full"}[o.rounded]||`rounded-${o.rounded}`:""),k=e.computed(()=>!o.borderStyle||o.borderStyle==="none"?"border-0":o.borderStyle==="solid"?"border-2":{dashed:"border-[3px] border-dashed",dotted:"border-[3px] border-dotted",double:"border-[6px] border-double"}[o.borderStyle]||"border-2"),y=e.computed(()=>Ie("inline-flex items-center justify-center bg-gray-200 dark:bg-gray-700 animate-pulse",g.value,h.value,m.value,f.value)),p=e.computed(()=>{const K=(u.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return K?K[0]:null}),E=e.computed(()=>{const K=(u.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return K?K[0]:null}),_=e.computed(()=>!!p.value),B=e.computed(()=>/\bborder-/.test(u.value??"")),S=e.computed(()=>/\bhover:/.test(u.value??"")),w=e.computed(()=>{const Z=u.value??"";return i.value!=="outline"?Z:Z.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),x=e.ref(null),b=Z=>{const K=Z.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return K?{r:Number(K[1]),g:Number(K[2]),b:Number(K[3]),a:K[4]?Number(K[4]):1}:null},V=(Z,K)=>{const ae=b(Z);if(!ae)return Z;const ue=xe=>Math.max(0,Math.min(255,Math.round(xe)));return`rgba(${ue(ae.r*(1-K))}, ${ue(ae.g*(1-K))}, ${ue(ae.b*(1-K))}, ${ae.a})`},A=Z=>{if(globalThis.window===void 0)return null;const K=document.createElement("div");K.className=Z,K.style.position="absolute",K.style.visibility="hidden",K.style.pointerEvents="none",K.style.width="1px",K.style.height="1px",document.body.appendChild(K);const ae=globalThis.getComputedStyle(K).backgroundColor;return K.remove(),!ae||ae==="transparent"||ae==="rgba(0, 0, 0, 0)"?null:ae},D=[50,100,200,300,400,500,600,700,800,900,950],N=Z=>{const K=D.indexOf(Z);return K===-1?Z:D[Math.min(D.length-1,K+2)]},P=(Z,K)=>{const ae=qh[Z];if(!ae)return null;if(typeof ae=="string")return ae;if(!K)return null;const ue=ae[K];return typeof ue=="string"?ue:null},v=(Z,K=!1)=>{if(!Z)return null;const ae=K?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,ue=Z.match(ae);return ue?{colorName:ue[1],shade:ue[2]?Number.parseInt(ue[2],10):null}:null},Q=()=>{const Z=p.value;if(!Z){x.value=null;return}const K=v(Z),ae=K==null?void 0:K.colorName,ue=(K==null?void 0:K.shade)??null,xe=(ae?P(ae,ue):null)??A(Z);if(!xe){x.value=null;return}let De;const we=v(E.value,!0),ee=we?P(we.colorName,we.shade??null):null;if(ee)De=ee;else if(ae&&ue){const z=N(ue);De=P(ae,z)??V(xe,.2)}else De=V(xe,.2);x.value={"--btn-color":xe,"--btn-color-hover":De}};e.onMounted(()=>{Q()}),e.watch([p,E],async()=>{await e.nextTick(),Q()});const $=e.computed(()=>{const Z=/\bdark:bg-/.test(u.value??"");return!_.value||i.value==="outline"||Z?"":x.value?"dcode-btn--fill dcode-btn--fill-hover":S.value?"":"hover:brightness-90"}),q=e.computed(()=>{if(!_.value||i.value!=="outline")return"";const Z=["dcode-btn--outline","dcode-btn--outline-hover"];return B.value||Z.push("border"),!x.value&&!S.value&&Z.push("hover:brightness-90"),Z.join(" ")}),Y=e.computed(()=>x.value??void 0),X={primary:{bg:"bg-blue-600 dark:bg-blue-500",border:"border-blue-700 dark:border-blue-400",text:"text-white",hoverBg:"hover:bg-blue-700 dark:hover:bg-blue-600",hoverBorder:"hover:border-blue-800 dark:hover:border-blue-500",hoverText:"hover:text-white"},success:{bg:"bg-green-600 dark:bg-green-500",border:"border-green-700 dark:border-green-400",text:"text-white",hoverBg:"hover:bg-green-700 dark:hover:bg-green-600",hoverBorder:"hover:border-green-800 dark:hover:border-green-500",hoverText:"hover:text-white"},warning:{bg:"bg-yellow-500 dark:bg-yellow-400",border:"border-yellow-600 dark:border-yellow-300",text:"text-white",hoverBg:"hover:bg-yellow-600 dark:hover:bg-yellow-500",hoverBorder:"hover:border-yellow-700 dark:hover:border-yellow-400",hoverText:"hover:text-white"},danger:{bg:"bg-red-600 dark:bg-red-500",border:"border-red-700 dark:border-red-400",text:"text-white",hoverBg:"hover:bg-red-700 dark:hover:bg-red-600",hoverBorder:"hover:border-red-800 dark:hover:border-red-500",hoverText:"hover:text-white"},info:{bg:"bg-cyan-600 dark:bg-cyan-500",border:"border-cyan-700 dark:border-cyan-400",text:"text-white",hoverBg:"hover:bg-cyan-700 dark:hover:bg-cyan-600",hoverBorder:"hover:border-cyan-800 dark:hover:border-cyan-500",hoverText:"hover:text-white"},secondary:{bg:"bg-gray-600 dark:bg-gray-500",border:"border-gray-700 dark:border-gray-400",text:"text-white",hoverBg:"hover:bg-gray-700 dark:hover:bg-gray-600",hoverBorder:"hover:border-gray-800 dark:hover:border-gray-500",hoverText:"hover:text-white"},purple:{bg:"bg-purple-600 dark:bg-purple-500",border:"border-purple-700 dark:border-purple-400",text:"text-white",hoverBg:"hover:bg-purple-700 dark:hover:bg-purple-600",hoverBorder:"hover:border-purple-800 dark:hover:border-purple-500",hoverText:"hover:text-white"},pink:{bg:"bg-pink-600 dark:bg-pink-500",border:"border-pink-700 dark:border-pink-400",text:"text-white",hoverBg:"hover:bg-pink-700 dark:hover:bg-pink-600",hoverBorder:"hover:border-pink-800 dark:hover:border-pink-500",hoverText:"hover:text-white"},dark:{bg:"bg-gray-900 dark:bg-gray-800",border:"border-black dark:border-gray-700",text:"text-white",hoverBg:"hover:bg-black dark:hover:bg-gray-950",hoverBorder:"hover:border-black dark:hover:border-gray-600",hoverText:"hover:text-white"},light:{bg:"bg-gray-100 dark:bg-gray-800",border:"border-gray-300 dark:border-gray-600",text:"text-gray-900 dark:text-gray-100",hoverBg:"hover:bg-gray-200 dark:hover:bg-gray-700",hoverBorder:"hover:border-gray-400 dark:hover:border-gray-500",hoverText:"hover:text-gray-900 dark:hover:text-gray-100"}},T={"gradient-blue":{bg:"bg-gradient-to-r from-blue-500 to-cyan-500",text:"text-white",hover:"hover:from-blue-600 hover:to-cyan-600"},"gradient-purple":{bg:"bg-gradient-to-r from-purple-500 to-pink-500",text:"text-white",hover:"hover:from-purple-600 hover:to-pink-600"},"gradient-sunset":{bg:"bg-gradient-to-r from-orange-500 to-red-500",text:"text-white",hover:"hover:from-orange-600 hover:to-red-600"},"gradient-emerald":{bg:"bg-gradient-to-r from-emerald-500 to-teal-500",text:"text-white",hover:"hover:from-emerald-600 hover:to-teal-600"}},W=e.computed(()=>{const Z=[],K=l.value,ae=String(o.borderColor||"").toLowerCase(),ue=K?X[K]:null,xe=K?T[K]:null,De=ae?X[ae]:null;return K&&(ue?De&&ae!==K?(Z.push(ue.bg,De.hoverBg),o.textColor||Z.push(ue.text,De.hoverText)):(Z.push(ue.bg,ue.hoverBg),o.textColor||Z.push(ue.text,ue.hoverText)):xe?(Z.push(xe.bg,xe.hover),o.textColor||Z.push(xe.text)):K==="transparent"?De?(Z.push("bg-transparent",De.hoverBg),o.textColor||Z.push("text-inherit",De.hoverText)):Z.push("bg-transparent hover:bg-black/5 dark:hover:bg-white/5"):Z.push(K)),ae?De?Z.push(De.border,De.hoverBorder):Z.push(ae):ue&&i.value!=="ghost"&&i.value!=="link"&&Z.push(ue.border,ue.hoverBorder),o.textColor&&Z.push(o.textColor),Z.join(" ")}),ne=e.computed(()=>Ie(Xh,g.value,k.value,w.value,$.value,q.value,W.value));return(Z,K)=>s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(y.value),"aria-hidden":"true"},null,2)):(e.openBlock(),e.createBlock(e.unref(pl),{key:1,"delay-duration":0},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createBlock(e.unref(hl),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(gl),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(Jt),e.mergeProps({variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:ne.value,style:Y.value},d.value),{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:"h-[18px] w-[18px]"})):e.createCommentVNode("",!0),o.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value?"ml-1":"")},e.toDisplayString(o.text),3)):e.createCommentVNode("",!0)]),_:1},16,["variant","size","disabled","type","class","style"])]),_:1}),e.createVNode(e.unref(ml),{side:"top","side-offset":8,class:"animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-900 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0"},{default:e.withCtx(()=>[e.createElementVNode("span",Gh,e.toDisplayString(o.tooltip),1)]),_:1})]),_:1})):(e.openBlock(),e.createBlock(e.unref(Jt),e.mergeProps({key:1,variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:ne.value,style:Y.value},d.value),{default:e.withCtx(()=>[e.renderSlot(Z.$slots,"default",{},()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:"h-[18px] w-[18px]"})):e.createCommentVNode("",!0),o.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value?"ml-1":"")},e.toDisplayString(o.text),3)):e.createCommentVNode("",!0)],!0)]),_:3},16,["variant","size","disabled","type","class","style"]))]),_:3}))],64)):e.createCommentVNode("",!0)}}),Ot=(t,n)=>{const o=t.__vccOpts||t;for(const[r,a]of n)o[r]=a;return o},et=Ot(Kh,[["__scopeId","data-v-fed1b675"]]),Yh={key:0,class:"flex items-center justify-between bg-neutral-50/50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 px-4 py-3 backdrop-blur-sm"},Jh={class:"flex flex-col gap-1"},Qh={key:0,class:"text-sm font-semibold text-neutral-900 dark:text-neutral-100 leading-tight"},Zh={key:1,class:"text-xs text-neutral-500 dark:text-neutral-400"},em={key:0,class:"flex items-center gap-2"},tm={name:"DCodeCard"},bl=e.defineComponent({...tm,props:{level:{default:1},title:{},subtitle:{},shadow:{type:Boolean,default:!1},border:{type:Boolean,default:!0},padding:{default:"p-6"}},setup(t){const n=t,o=e.computed(()=>{switch(n.level){case 2:return"bg-neutral-50 dark:bg-neutral-700";case 3:return"bg-neutral-100 dark:bg-neutral-600";case 1:default:return"bg-white dark:bg-neutral-800"}});return(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["transition-shadow duration-300 dcode-card",[o.value,{"shadow-md":t.shadow},{"border-transparent":!t.border},{"border-neutral-200/60 dark:border-neutral-700/50":t.border&&t.level===1},{"border-neutral-300/60 dark:border-neutral-600/50":t.border&&t.level!==1},"overflow-hidden"]])},[t.title||r.$slots.header||r.$slots.actions?(e.openBlock(),e.createElementBlock("div",Yh,[e.createElementVNode("div",Jh,[e.renderSlot(r.$slots,"header",{},()=>[t.title?(e.openBlock(),e.createElementBlock("h3",Qh,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.subtitle?(e.openBlock(),e.createElementBlock("p",Zh,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0)])]),r.$slots.actions?(e.openBlock(),e.createElementBlock("div",em,[e.renderSlot(r.$slots,"actions")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["relative z-10",t.padding])},[e.renderSlot(r.$slots,"default")],2),r.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["mt-6 pt-6 border-t border-neutral-200/60 dark:border-neutral-700/50",t.padding])},[e.renderSlot(r.$slots,"footer")],2)):e.createCommentVNode("",!0)],2))}}),nm={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},om={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},rm={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},am={class:"flex items-center justify-between"},sm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},im={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl relative group"},lm={class:"font-mono text-[11px] leading-relaxed text-blue-700 dark:text-blue-300 whitespace-pre-wrap break-all"},cm={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},dm={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},um={class:"flex items-center justify-between"},fm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},hm={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl"},mm={class:"font-mono text-[11px] leading-relaxed text-emerald-700 dark:text-emerald-400 whitespace-pre-wrap break-all"},Xa=e.defineComponent({name:"DCodeBeforeAfter",__name:"DCodeBeforeAfter",props:{dataBefore:{type:[Object,Array,String,Number,Boolean,null],required:!0},dataAfter:{type:[Object,Array,String,Number,Boolean,null],required:!0}},setup(t){const{t:n}=$t.useI18n(),o=e.ref(null),r=e.ref(null);let a=!1;const s=l=>{if(a)return;a=!0;const c=l==="before"?o.value:r.value,d=l==="before"?r.value:o.value;if(c&&d){const u=c.scrollTop,f=c.scrollLeft;requestAnimationFrame(()=>{d.scrollTop=u,d.scrollLeft=f,requestAnimationFrame(()=>{a=!1})})}else a=!1},i=l=>{try{if(!l)return"";let c=l;if(typeof l=="string")try{(l.trim().startsWith("{")||l.trim().startsWith("["))&&(c=JSON.parse(l))}catch{}return JSON.stringify(c,null,2)}catch{return String(l)}};return(l,c)=>(e.openBlock(),e.createElementBlock("div",nm,[e.createElementVNode("div",om,[e.createElementVNode("div",rm,[e.createElementVNode("div",am,[e.createElementVNode("h3",sm,[c[2]||(c[2]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-danger-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataBefore")),1)]),c[3]||(c[3]=e.createElementVNode("span",{class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border border-neutral-200 dark:border-neutral-700 shadow-sm"}," ORIGINAL ",-1))])]),e.createElementVNode("div",im,[e.createElementVNode("div",{ref_key:"beforeContainer",ref:o,onScroll:c[0]||(c[0]=d=>s("before")),class:"p-4 overflow-auto max-h-[500px] custom-scrollbar"},[e.createElementVNode("pre",lm,e.toDisplayString(i(t.dataBefore)),1)],544)])]),e.createElementVNode("div",cm,[e.createElementVNode("div",dm,[e.createElementVNode("div",um,[e.createElementVNode("h3",fm,[c[4]||(c[4]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-success-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataAfter")),1)]),c[5]||(c[5]=e.createElementVNode("span",{class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-primary-600 dark:text-primary-400 border border-primary-100 dark:border-primary-900/50 shadow-sm"}," MODIFIED ",-1))])]),e.createElementVNode("div",hm,[e.createElementVNode("div",{ref_key:"afterContainer",ref:r,onScroll:c[1]||(c[1]=d=>s("after")),class:"p-4 overflow-auto max-h-[500px] custom-scrollbar"},[e.createElementVNode("pre",mm,e.toDisplayString(i(t.dataAfter)),1)],544)])])]))}}),pm=["aria-busy"],gm={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},bm={key:1,class:"flex justify-end"},ym=["for"],xm={key:0,class:"ml-1 text-destructive"},km={class:"relative w-full group"},wm={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},Cm={key:1},Em=["id","value","placeholder"],Bm={key:1,class:"absolute inset-y-0 right-4 flex items-center"},_m={key:2,class:"absolute inset-y-0 right-4 flex items-center"},Sm={key:3,class:"absolute top-full right-0 z-10 text-[11px] text-gray-500 dark:text-gray-400 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100"},Vm={key:1,class:"text-xs text-destructive"},lo=e.defineComponent({name:"DCodeTextField",inheritAttrs:!1,__name:"DCodeTextField",props:{modelValue:{},prependInner:{},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1},error:{default:null},placeholder:{default:""},icon:{},disabled:{type:Boolean,default:!1},maxLength:{},minLength:{},maxValue:{},minValue:{}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=e.computed(()=>{var z;return((z=l.valueType)==null?void 0:z.toLowerCase())==="password"||o.type==="password"}),a=e.ref(!1),s=()=>{a.value=!a.value},i=n,l=t,c=e.computed(()=>o.label);e.computed(()=>l.visible??!0);const d=Math.random().toString(36).slice(2,7),u=e.computed(()=>`app-text-field-${o.id||c.value||"field"}-${d}`),f=e.computed(()=>{const z=o.required,J=o["aria-required"];return z===""||z===!0||z==="true"||(J==="true"||J===!0)}),h=e.computed(()=>{const{label:z,class:J,id:se,required:Ee,"aria-required":ve,...qe}=o;return qe}),m=e.computed(()=>{var J,se;const z={...h.value};return((J=l.valueType)==null?void 0:J.toLowerCase())==="number"&&(z.type="text",z.inputmode="numeric",z.pattern="[0-9]*"),((se=l.valueType)==null?void 0:se.toLowerCase())==="email"&&(z.type="email",z.inputmode="email"),r.value&&(z.type=a.value?"text":"password"),l.disabled&&(z.disabled=!0),l.maxLength&&(z.maxlength=l.maxLength),l.minLength&&(z.minlength=l.minLength),l.maxValue&&(z.max=l.maxValue),l.minValue&&(z.min=l.minValue),z}),g=e.computed(()=>{const z=l.modelValue;return z==null||String(z).length===0}),k=e.computed(()=>l.clearable?l.hideClearWhenEmpty?!g.value:!0:!1),y=e.computed(()=>{switch(l.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),p=e.ref(String(l.modelValue??""));e.watch(()=>l.modelValue,z=>{const J=String(z??"");J!==p.value&&(p.value=J)});const E=e.ref(!1),_=e.ref(!1),B=z=>z.split(/(\s+)/).map(J=>{if(J.trim()==="")return J;const se=J.toLowerCase();return se.charAt(0).toUpperCase()+se.slice(1)}).join(""),S=z=>{const J=z.toLowerCase(),se=J.search(new RegExp("\\p{L}","u"));return se<0?J:J.slice(0,se)+J.charAt(se).toUpperCase()+J.slice(se+1)},w=z=>{switch(l.textCase){case"uppercase":return z.toUpperCase();case"lowercase":return z.toLowerCase();case"titlecase":return B(z);case"sentencecase":return S(z);case"none":default:return z}},x=z=>{if(!z)return null;const J=Array.isArray(z)?z.join(""):z;return J?new Set(J):null},b=e.computed(()=>x(l.allowChars)),V=(z,J)=>(z.lastIndex=0,z.test(J)),A=z=>{var tt;const J=(tt=l.valueType)==null?void 0:tt.toLowerCase();if(J==="free"||J==="email"||J==="password")return!0;const se=z===" ",Ee=/\d/.test(z),ve=new RegExp("\\p{L}","u").test(z),qe=new RegExp("\\p{N}","u").test(z),Ge=/[\/\-_.,]/.test(z);return J==="number"?Ee:J==="letter"?ve||Ge||l.allowSpaces&&se:J==="letternumber"?ve||qe||Ge||l.allowSpaces&&se:!0},D=z=>{let J="";for(const se of z){const Ee=!!b.value&&b.value.has(se);l.pattern&&!Ee&&!V(l.pattern,se)||!Ee&&!A(se)||(J+=se)}return J},N=e.computed(()=>{const z=l.maxLength??o.maxlength??o.maxLength;let J=Number.NaN;return typeof z=="number"?J=z:typeof z=="string"&&(J=Number.parseInt(z,10)),Number.isFinite(J)&&J>0?J:-1}),P=e.computed(()=>p.value.length),v=e.computed(()=>l.showCharCount?N.value>0:!1),Q=z=>N.value>0?z.slice(0,N.value):z,$=z=>{const J=D(z),se=l.applyTextCaseToValue?w(J):J;return Q(se)};let q=null;const Y=z=>{var J;if(z==="")return null;if(((J=l.valueType)==null?void 0:J.toLowerCase())==="number"&&l.returnNumber){const se=Number(z);return Number.isFinite(se)?se:null}return z},X=z=>{p.value=z,i("update:modelValue",Y(z))},T=(z,J)=>{const se=Q(J);_.value=!0,z.value=se,X(se),queueMicrotask(()=>_.value=!1)},W=(z,J)=>{const se=z.selectionStart??z.value.length,Ee=z.selectionEnd??z.value.length;if(N.value>0){const ve=z.value.length-(Ee-se),qe=N.value-ve;if(qe<=0)return;J=J.slice(0,qe)}z.setRangeText(J,se,Ee,"end"),T(z,$(z.value))},ne=z=>{var Ee;if(!q||E.value||_.value||!((Ee=z.inputType)!=null&&Ee.startsWith("insert")))return;const J=z.data;if(J==null)return;const se=$(J);se!==J&&(z.preventDefault(),se.length>0&&W(q,se))},Z=z=>{var Ee;if(!q||E.value||_.value)return;const J=((Ee=z.clipboardData)==null?void 0:Ee.getData("text"))??"",se=$(J);se!==J&&(z.preventDefault(),se.length>0&&W(q,se))},K=z=>{if(!q||E.value||_.value)return;const J=z.target,se=J.value??"",Ee=$(se);Ee===se?X(Ee):T(J,Ee)},ae=()=>E.value=!0,ue=()=>{if(E.value=!1,!q)return;const z=q.value??"",J=$(z);J===z?X(J):T(q,J)};e.onMounted(()=>{if(q=document.getElementById(u.value),!q)return;q.addEventListener("beforeinput",ne),q.addEventListener("paste",Z),q.addEventListener("input",K),q.addEventListener("compositionstart",ae),q.addEventListener("compositionend",ue);const z=q.value??"",J=$(z);J===z?X(J):T(q,J)}),e.onBeforeUnmount(()=>{q&&(q.removeEventListener("beforeinput",ne),q.removeEventListener("paste",Z),q.removeEventListener("input",K),q.removeEventListener("compositionstart",ae),q.removeEventListener("compositionend",ue),q=null)});const xe=()=>{p.value="",q&&(q.value=""),i("update:modelValue",null),i("clear")},De=e.computed(()=>v.value&&P.value>0),we=e.computed(()=>`${P.value} / ${N.value}`),ee=e.computed(()=>!!l.error);return(z,J)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":l.skeleton},[l.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c.value?(e.openBlock(),e.createElementBlock("div",gm)):e.createCommentVNode("",!0),J[1]||(J[1]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),v.value?(e.openBlock(),e.createElementBlock("div",bm,[...J[0]||(J[0]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(c.value)+" ",1),f.value?(e.openBlock(),e.createElementBlock("span",xm,"*")):e.createCommentVNode("",!0)],8,ym)):e.createCommentVNode("",!0),e.createElementVNode("div",km,[l.icon||l.prependInner||z.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",wm,[e.renderSlot(z.$slots,"prepend-inner",{},()=>[l.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.icon),{key:0,class:"h-4 w-4"})):l.prependInner?(e.openBlock(),e.createElementBlock("span",Cm,e.toDisplayString(l.prependInner),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:u.value,value:p.value},m.value,{placeholder:l.placeholder,style:`text-transform: ${y.value}; padding-left: ${l.icon||l.prependInner||z.$slots["prepend-inner"]?"2.5rem":"0.75rem"} !important; padding-right: ${k.value||r.value?"2.5rem":"0.75rem"} !important;`,class:["w-full h-10 flex items-center gap-2 rounded-lg border py-2 bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600","text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",ee.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,Em),r.value?(e.openBlock(),e.createElementBlock("div",Bm,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground",tabindex:"-1",onClick:s},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value?e.unref(ce.Eye):e.unref(ce.EyeOff)),{class:"w-4 h-4"}))])])):e.createCommentVNode("",!0),k.value&&!r.value?(e.openBlock(),e.createElementBlock("div",_m,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:xe}," ✕ ")])):e.createCommentVNode("",!0),De.value&&!ee.value?(e.openBlock(),e.createElementBlock("p",Sm,e.toDisplayString(we.value),1)):e.createCommentVNode("",!0)]),ee.value?(e.openBlock(),e.createElementBlock("p",Vm,e.toDisplayString(l.error),1)):e.createCommentVNode("",!0)],64))],10,pm)),[[e.vShow,t.visible]])}}),Am={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Dm={class:"dcode-card h-full flex flex-col border border-neutral-200/60 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 rounded-xl overflow-hidden"},Nm={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},Mm={class:"flex items-center justify-between"},vm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Pm={class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border border-neutral-200/60 dark:border-neutral-700/50 shadow-sm"},Tm={class:"p-6 flex-1"},Om={class:"flex flex-col gap-4"},Fm={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},zm={class:"dcode-card h-full flex flex-col border border-neutral-200/60 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 rounded-xl overflow-hidden"},Im={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},Rm={class:"flex items-center justify-between"},Lm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},$m={class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-primary-600 dark:text-primary-400 border border-primary-100 dark:border-primary-900/30 shadow-sm"},jm={class:"p-6 flex-1"},Wm={class:"flex flex-col gap-4"},Um={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Ka=e.defineComponent({name:"DCodeListLabels",__name:"DCodeListLabels",props:{dataBefore:{},dataAfter:{}},setup(t){const{t:n}=$t.useI18n(),o=t,r=c=>{if(!c)return{};if(typeof c=="string")try{if(c.trim().startsWith("{")||c.trim().startsWith("["))return JSON.parse(c)}catch(d){return console.error("Failed to parse data string:",d),{raw:c}}return typeof c=="object"&&c!==null?c:{value:c}},a=e.computed(()=>r(o.dataBefore)),s=e.computed(()=>r(o.dataAfter)),i=c=>c.replaceAll(/([A-Z])/g," $1").replace(/^./,d=>d.toUpperCase()).trim(),l=c=>c==null?"-":typeof c=="boolean"?n(c?"common.yes":"common.no"):typeof c=="object"?JSON.stringify(c):String(c);return(c,d)=>(e.openBlock(),e.createElementBlock("div",Am,[e.createElementVNode("div",Dm,[e.createElementVNode("div",Nm,[e.createElementVNode("div",Mm,[e.createElementVNode("h3",vm,[d[0]||(d[0]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-danger-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataBefore")),1)]),e.createElementVNode("span",Pm,e.toDisplayString(e.unref(n)("beforeAfter.original")),1)])]),e.createElementVNode("div",Tm,[e.createElementVNode("div",Om,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(u,f)=>(e.openBlock(),e.createBlock(lo,{key:f,"model-value":l(u),label:i(String(f)),disabled:"",variant:"underlined",class:"w-full"},null,8,["model-value","label"]))),128)),Object.keys(a.value).length===0?(e.openBlock(),e.createElementBlock("div",Fm)):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",zm,[e.createElementVNode("div",Im,[e.createElementVNode("div",Rm,[e.createElementVNode("h3",Lm,[d[1]||(d[1]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-success-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataAfter")),1)]),e.createElementVNode("span",$m,e.toDisplayString(e.unref(n)("beforeAfter.modified")),1)])]),e.createElementVNode("div",jm,[e.createElementVNode("div",Wm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(u,f)=>(e.openBlock(),e.createBlock(lo,{key:f,"model-value":l(u),label:i(String(f)),disabled:"",variant:"underlined",class:"w-full"},null,8,["model-value","label"]))),128)),Object.keys(s.value).length===0?(e.openBlock(),e.createElementBlock("div",Um,e.toDisplayString(e.unref(n)("beforeAfter.noModifiedData")),1)):e.createCommentVNode("",!0)])])])]))}});/*!
2
2
  * @kurkle/color v0.3.4
3
3
  * https://github.com/kurkle/color#readme
4
4
  * (c) 2024 Jukka Kurkela
5
5
  * Released under the MIT License
6
- */function Mo(t){return t+.5|0}const Vn=(t,n,o)=>Math.max(Math.min(t,o),n);function vo(t){return Vn(Mo(t*2.55),0,255)}function Dn(t){return Vn(Mo(t*255),0,255)}function mn(t){return Vn(Mo(t/2.55)/100,0,1)}function pl(t){return Vn(Mo(t*100),0,100)}const Lt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},qa=[..."0123456789ABCDEF"],Hm=t=>qa[t&15],qm=t=>qa[(t&240)>>4]+qa[t&15],kr=t=>(t&240)>>4===(t&15),Gm=t=>kr(t.r)&&kr(t.g)&&kr(t.b)&&kr(t.a);function Xm(t){var n=t.length,o;return t[0]==="#"&&(n===4||n===5?o={r:255&Lt[t[1]]*17,g:255&Lt[t[2]]*17,b:255&Lt[t[3]]*17,a:n===5?Lt[t[4]]*17:255}:(n===7||n===9)&&(o={r:Lt[t[1]]<<4|Lt[t[2]],g:Lt[t[3]]<<4|Lt[t[4]],b:Lt[t[5]]<<4|Lt[t[6]],a:n===9?Lt[t[7]]<<4|Lt[t[8]]:255})),o}const Km=(t,n)=>t<255?n(t):"";function Ym(t){var n=Gm(t)?Hm:qm;return t?"#"+n(t.r)+n(t.g)+n(t.b)+Km(t.a,n):void 0}const Jm=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function gl(t,n,o){const r=n*Math.min(o,1-o),a=(s,i=(s+t/30)%12)=>o-r*Math.max(Math.min(i-3,9-i,1),-1);return[a(0),a(8),a(4)]}function Qm(t,n,o){const r=(a,s=(a+t/60)%6)=>o-o*n*Math.max(Math.min(s,4-s,1),0);return[r(5),r(3),r(1)]}function Zm(t,n,o){const r=gl(t,1,.5);let a;for(n+o>1&&(a=1/(n+o),n*=a,o*=a),a=0;a<3;a++)r[a]*=1-n-o,r[a]+=n;return r}function ep(t,n,o,r,a){return t===a?(n-o)/r+(n<o?6:0):n===a?(o-t)/r+2:(t-n)/r+4}function Ga(t){const o=t.r/255,r=t.g/255,a=t.b/255,s=Math.max(o,r,a),i=Math.min(o,r,a),l=(s+i)/2;let c,d,u;return s!==i&&(u=s-i,d=l>.5?u/(2-s-i):u/(s+i),c=ep(o,r,a,u,s),c=c*60+.5),[c|0,d||0,l]}function Xa(t,n,o,r){return(Array.isArray(n)?t(n[0],n[1],n[2]):t(n,o,r)).map(Dn)}function Ka(t,n,o){return Xa(gl,t,n,o)}function tp(t,n,o){return Xa(Zm,t,n,o)}function np(t,n,o){return Xa(Qm,t,n,o)}function bl(t){return(t%360+360)%360}function op(t){const n=Jm.exec(t);let o=255,r;if(!n)return;n[5]!==r&&(o=n[6]?vo(+n[5]):Dn(+n[5]));const a=bl(+n[2]),s=+n[3]/100,i=+n[4]/100;return n[1]==="hwb"?r=tp(a,s,i):n[1]==="hsv"?r=np(a,s,i):r=Ka(a,s,i),{r:r[0],g:r[1],b:r[2],a:o}}function rp(t,n){var o=Ga(t);o[0]=bl(o[0]+n),o=Ka(o),t.r=o[0],t.g=o[1],t.b=o[2]}function ap(t){if(!t)return;const n=Ga(t),o=n[0],r=pl(n[1]),a=pl(n[2]);return t.a<255?`hsla(${o}, ${r}%, ${a}%, ${mn(t.a)})`:`hsl(${o}, ${r}%, ${a}%)`}const yl={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},xl={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function sp(){const t={},n=Object.keys(xl),o=Object.keys(yl);let r,a,s,i,l;for(r=0;r<n.length;r++){for(i=l=n[r],a=0;a<o.length;a++)s=o[a],l=l.replace(s,yl[s]);s=parseInt(xl[i],16),t[l]=[s>>16&255,s>>8&255,s&255]}return t}let wr;function ip(t){wr||(wr=sp(),wr.transparent=[0,0,0,0]);const n=wr[t.toLowerCase()];return n&&{r:n[0],g:n[1],b:n[2],a:n.length===4?n[3]:255}}const lp=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function cp(t){const n=lp.exec(t);let o=255,r,a,s;if(n){if(n[7]!==r){const i=+n[7];o=n[8]?vo(i):Vn(i*255,0,255)}return r=+n[1],a=+n[3],s=+n[5],r=255&(n[2]?vo(r):Vn(r,0,255)),a=255&(n[4]?vo(a):Vn(a,0,255)),s=255&(n[6]?vo(s):Vn(s,0,255)),{r,g:a,b:s,a:o}}}function dp(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${mn(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Ya=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,io=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function up(t,n,o){const r=io(mn(t.r)),a=io(mn(t.g)),s=io(mn(t.b));return{r:Dn(Ya(r+o*(io(mn(n.r))-r))),g:Dn(Ya(a+o*(io(mn(n.g))-a))),b:Dn(Ya(s+o*(io(mn(n.b))-s))),a:t.a+o*(n.a-t.a)}}function Cr(t,n,o){if(t){let r=Ga(t);r[n]=Math.max(0,Math.min(r[n]+r[n]*o,n===0?360:1)),r=Ka(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function kl(t,n){return t&&Object.assign(n||{},t)}function wl(t){var n={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(n={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(n.a=Dn(t[3]))):(n=kl(t,{r:0,g:0,b:0,a:1}),n.a=Dn(n.a)),n}function fp(t){return t.charAt(0)==="r"?cp(t):op(t)}class Po{constructor(n){if(n instanceof Po)return n;const o=typeof n;let r;o==="object"?r=wl(n):o==="string"&&(r=Xm(n)||ip(n)||fp(n)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var n=kl(this._rgb);return n&&(n.a=mn(n.a)),n}set rgb(n){this._rgb=wl(n)}rgbString(){return this._valid?dp(this._rgb):void 0}hexString(){return this._valid?Ym(this._rgb):void 0}hslString(){return this._valid?ap(this._rgb):void 0}mix(n,o){if(n){const r=this.rgb,a=n.rgb;let s;const i=o===s?.5:o,l=2*i-1,c=r.a-a.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;s=1-d,r.r=255&d*r.r+s*a.r+.5,r.g=255&d*r.g+s*a.g+.5,r.b=255&d*r.b+s*a.b+.5,r.a=i*r.a+(1-i)*a.a,this.rgb=r}return this}interpolate(n,o){return n&&(this._rgb=up(this._rgb,n._rgb,o)),this}clone(){return new Po(this.rgb)}alpha(n){return this._rgb.a=Dn(n),this}clearer(n){const o=this._rgb;return o.a*=1-n,this}greyscale(){const n=this._rgb,o=Mo(n.r*.3+n.g*.59+n.b*.11);return n.r=n.g=n.b=o,this}opaquer(n){const o=this._rgb;return o.a*=1+n,this}negate(){const n=this._rgb;return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,this}lighten(n){return Cr(this._rgb,2,n),this}darken(n){return Cr(this._rgb,2,-n),this}saturate(n){return Cr(this._rgb,1,n),this}desaturate(n){return Cr(this._rgb,1,-n),this}rotate(n){return rp(this._rgb,n),this}}/*!
6
+ */function To(t){return t+.5|0}const An=(t,n,o)=>Math.max(Math.min(t,o),n);function Oo(t){return An(To(t*2.55),0,255)}function Dn(t){return An(To(t*255),0,255)}function mn(t){return An(To(t/2.55)/100,0,1)}function yl(t){return An(To(t*100),0,100)}const jt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ya=[..."0123456789ABCDEF"],Hm=t=>Ya[t&15],qm=t=>Ya[(t&240)>>4]+Ya[t&15],Cr=t=>(t&240)>>4===(t&15),Gm=t=>Cr(t.r)&&Cr(t.g)&&Cr(t.b)&&Cr(t.a);function Xm(t){var n=t.length,o;return t[0]==="#"&&(n===4||n===5?o={r:255&jt[t[1]]*17,g:255&jt[t[2]]*17,b:255&jt[t[3]]*17,a:n===5?jt[t[4]]*17:255}:(n===7||n===9)&&(o={r:jt[t[1]]<<4|jt[t[2]],g:jt[t[3]]<<4|jt[t[4]],b:jt[t[5]]<<4|jt[t[6]],a:n===9?jt[t[7]]<<4|jt[t[8]]:255})),o}const Km=(t,n)=>t<255?n(t):"";function Ym(t){var n=Gm(t)?Hm:qm;return t?"#"+n(t.r)+n(t.g)+n(t.b)+Km(t.a,n):void 0}const Jm=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function xl(t,n,o){const r=n*Math.min(o,1-o),a=(s,i=(s+t/30)%12)=>o-r*Math.max(Math.min(i-3,9-i,1),-1);return[a(0),a(8),a(4)]}function Qm(t,n,o){const r=(a,s=(a+t/60)%6)=>o-o*n*Math.max(Math.min(s,4-s,1),0);return[r(5),r(3),r(1)]}function Zm(t,n,o){const r=xl(t,1,.5);let a;for(n+o>1&&(a=1/(n+o),n*=a,o*=a),a=0;a<3;a++)r[a]*=1-n-o,r[a]+=n;return r}function ep(t,n,o,r,a){return t===a?(n-o)/r+(n<o?6:0):n===a?(o-t)/r+2:(t-n)/r+4}function Ja(t){const o=t.r/255,r=t.g/255,a=t.b/255,s=Math.max(o,r,a),i=Math.min(o,r,a),l=(s+i)/2;let c,d,u;return s!==i&&(u=s-i,d=l>.5?u/(2-s-i):u/(s+i),c=ep(o,r,a,u,s),c=c*60+.5),[c|0,d||0,l]}function Qa(t,n,o,r){return(Array.isArray(n)?t(n[0],n[1],n[2]):t(n,o,r)).map(Dn)}function Za(t,n,o){return Qa(xl,t,n,o)}function tp(t,n,o){return Qa(Zm,t,n,o)}function np(t,n,o){return Qa(Qm,t,n,o)}function kl(t){return(t%360+360)%360}function op(t){const n=Jm.exec(t);let o=255,r;if(!n)return;n[5]!==r&&(o=n[6]?Oo(+n[5]):Dn(+n[5]));const a=kl(+n[2]),s=+n[3]/100,i=+n[4]/100;return n[1]==="hwb"?r=tp(a,s,i):n[1]==="hsv"?r=np(a,s,i):r=Za(a,s,i),{r:r[0],g:r[1],b:r[2],a:o}}function rp(t,n){var o=Ja(t);o[0]=kl(o[0]+n),o=Za(o),t.r=o[0],t.g=o[1],t.b=o[2]}function ap(t){if(!t)return;const n=Ja(t),o=n[0],r=yl(n[1]),a=yl(n[2]);return t.a<255?`hsla(${o}, ${r}%, ${a}%, ${mn(t.a)})`:`hsl(${o}, ${r}%, ${a}%)`}const wl={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Cl={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function sp(){const t={},n=Object.keys(Cl),o=Object.keys(wl);let r,a,s,i,l;for(r=0;r<n.length;r++){for(i=l=n[r],a=0;a<o.length;a++)s=o[a],l=l.replace(s,wl[s]);s=parseInt(Cl[i],16),t[l]=[s>>16&255,s>>8&255,s&255]}return t}let Er;function ip(t){Er||(Er=sp(),Er.transparent=[0,0,0,0]);const n=Er[t.toLowerCase()];return n&&{r:n[0],g:n[1],b:n[2],a:n.length===4?n[3]:255}}const lp=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function cp(t){const n=lp.exec(t);let o=255,r,a,s;if(n){if(n[7]!==r){const i=+n[7];o=n[8]?Oo(i):An(i*255,0,255)}return r=+n[1],a=+n[3],s=+n[5],r=255&(n[2]?Oo(r):An(r,0,255)),a=255&(n[4]?Oo(a):An(a,0,255)),s=255&(n[6]?Oo(s):An(s,0,255)),{r,g:a,b:s,a:o}}}function dp(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${mn(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const es=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,co=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function up(t,n,o){const r=co(mn(t.r)),a=co(mn(t.g)),s=co(mn(t.b));return{r:Dn(es(r+o*(co(mn(n.r))-r))),g:Dn(es(a+o*(co(mn(n.g))-a))),b:Dn(es(s+o*(co(mn(n.b))-s))),a:t.a+o*(n.a-t.a)}}function Br(t,n,o){if(t){let r=Ja(t);r[n]=Math.max(0,Math.min(r[n]+r[n]*o,n===0?360:1)),r=Za(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function El(t,n){return t&&Object.assign(n||{},t)}function Bl(t){var n={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(n={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(n.a=Dn(t[3]))):(n=El(t,{r:0,g:0,b:0,a:1}),n.a=Dn(n.a)),n}function fp(t){return t.charAt(0)==="r"?cp(t):op(t)}class Fo{constructor(n){if(n instanceof Fo)return n;const o=typeof n;let r;o==="object"?r=Bl(n):o==="string"&&(r=Xm(n)||ip(n)||fp(n)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var n=El(this._rgb);return n&&(n.a=mn(n.a)),n}set rgb(n){this._rgb=Bl(n)}rgbString(){return this._valid?dp(this._rgb):void 0}hexString(){return this._valid?Ym(this._rgb):void 0}hslString(){return this._valid?ap(this._rgb):void 0}mix(n,o){if(n){const r=this.rgb,a=n.rgb;let s;const i=o===s?.5:o,l=2*i-1,c=r.a-a.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;s=1-d,r.r=255&d*r.r+s*a.r+.5,r.g=255&d*r.g+s*a.g+.5,r.b=255&d*r.b+s*a.b+.5,r.a=i*r.a+(1-i)*a.a,this.rgb=r}return this}interpolate(n,o){return n&&(this._rgb=up(this._rgb,n._rgb,o)),this}clone(){return new Fo(this.rgb)}alpha(n){return this._rgb.a=Dn(n),this}clearer(n){const o=this._rgb;return o.a*=1-n,this}greyscale(){const n=this._rgb,o=To(n.r*.3+n.g*.59+n.b*.11);return n.r=n.g=n.b=o,this}opaquer(n){const o=this._rgb;return o.a*=1+n,this}negate(){const n=this._rgb;return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,this}lighten(n){return Br(this._rgb,2,n),this}darken(n){return Br(this._rgb,2,-n),this}saturate(n){return Br(this._rgb,1,n),this}desaturate(n){return Br(this._rgb,1,-n),this}rotate(n){return rp(this._rgb,n),this}}/*!
7
7
  * Chart.js v4.5.1
8
8
  * https://www.chartjs.org
9
9
  * (c) 2025 Chart.js Contributors
10
10
  * Released under the MIT License
11
- */function pn(){}const hp=(()=>{let t=0;return()=>t++})();function Je(t){return t==null}function gt(t){if(Array.isArray&&Array.isArray(t))return!0;const n=Object.prototype.toString.call(t);return n.slice(0,7)==="[object"&&n.slice(-6)==="Array]"}function Ue(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function Et(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function en(t,n){return Et(t)?t:n}function Re(t,n){return typeof t>"u"?n:t}const mp=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/n,Cl=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*n:+t;function it(t,n,o){if(t&&typeof t.call=="function")return t.apply(o,n)}function nt(t,n,o,r){let a,s,i;if(gt(t))for(s=t.length,a=0;a<s;a++)n.call(o,t[a],a);else if(Ue(t))for(i=Object.keys(t),s=i.length,a=0;a<s;a++)n.call(o,t[i[a]],i[a])}function Er(t,n){let o,r,a,s;if(!t||!n||t.length!==n.length)return!1;for(o=0,r=t.length;o<r;++o)if(a=t[o],s=n[o],a.datasetIndex!==s.datasetIndex||a.index!==s.index)return!1;return!0}function Br(t){if(gt(t))return t.map(Br);if(Ue(t)){const n=Object.create(null),o=Object.keys(t),r=o.length;let a=0;for(;a<r;++a)n[o[a]]=Br(t[o[a]]);return n}return t}function El(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function pp(t,n,o,r){if(!El(t))return;const a=n[t],s=o[t];Ue(a)&&Ue(s)?To(a,s,r):n[t]=Br(s)}function To(t,n,o){const r=gt(n)?n:[n],a=r.length;if(!Ue(t))return t;o=o||{};const s=o.merger||pp;let i;for(let l=0;l<a;++l){if(i=r[l],!Ue(i))continue;const c=Object.keys(i);for(let d=0,u=c.length;d<u;++d)s(c[d],t,i,o)}return t}function Oo(t,n){return To(t,n,{merger:gp})}function gp(t,n,o){if(!El(t))return;const r=n[t],a=o[t];Ue(r)&&Ue(a)?Oo(r,a):Object.prototype.hasOwnProperty.call(n,t)||(n[t]=Br(a))}const Bl={"":t=>t,x:t=>t.x,y:t=>t.y};function bp(t){const n=t.split("."),o=[];let r="";for(const a of n)r+=a,r.endsWith("\\")?r=r.slice(0,-1)+".":(o.push(r),r="");return o}function yp(t){const n=bp(t);return o=>{for(const r of n){if(r==="")break;o=o&&o[r]}return o}}function Wn(t,n){return(Bl[n]||(Bl[n]=yp(n)))(t)}function Ja(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Fo=t=>typeof t<"u",Nn=t=>typeof t=="function",_l=(t,n)=>{if(t.size!==n.size)return!1;for(const o of t)if(!n.has(o))return!1;return!0};function xp(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const ot=Math.PI,dt=2*ot,kp=dt+ot,_r=Number.POSITIVE_INFINITY,wp=ot/180,kt=ot/2,Un=ot/4,Sl=ot*2/3,Al=Math.log10,tn=Math.sign;function zo(t,n,o){return Math.abs(t-n)<o}function Vl(t){const n=Math.round(t);t=zo(t,n,t/1e3)?n:t;const o=Math.pow(10,Math.floor(Al(t))),r=t/o;return(r<=1?1:r<=2?2:r<=5?5:10)*o}function Cp(t){const n=[],o=Math.sqrt(t);let r;for(r=1;r<o;r++)t%r===0&&(n.push(r),n.push(t/r));return o===(o|0)&&n.push(o),n.sort((a,s)=>a-s).pop(),n}function Ep(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Io(t){return!Ep(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function Bp(t,n){const o=Math.round(t);return o-n<=t&&o+n>=t}function _p(t,n,o){let r,a,s;for(r=0,a=t.length;r<a;r++)s=t[r][o],isNaN(s)||(n.min=Math.min(n.min,s),n.max=Math.max(n.max,s))}function gn(t){return t*(ot/180)}function Sp(t){return t*(180/ot)}function Dl(t){if(!Et(t))return;let n=1,o=0;for(;Math.round(t*n)/n!==t;)n*=10,o++;return o}function Nl(t,n){const o=n.x-t.x,r=n.y-t.y,a=Math.sqrt(o*o+r*r);let s=Math.atan2(r,o);return s<-.5*ot&&(s+=dt),{angle:s,distance:a}}function Qa(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function Ap(t,n){return(t-n+kp)%dt-ot}function Tt(t){return(t%dt+dt)%dt}function Ro(t,n,o,r){const a=Tt(t),s=Tt(n),i=Tt(o),l=Tt(s-a),c=Tt(i-a),d=Tt(a-s),u=Tt(a-i);return a===s||a===i||r&&s===i||l>c&&d<u}function Bt(t,n,o){return Math.max(n,Math.min(o,t))}function Vp(t){return Bt(t,-32768,32767)}function bn(t,n,o,r=1e-6){return t>=Math.min(n,o)-r&&t<=Math.max(n,o)+r}function Za(t,n,o){o=o||(i=>t[i]<n);let r=t.length-1,a=0,s;for(;r-a>1;)s=a+r>>1,o(s)?a=s:r=s;return{lo:a,hi:r}}const Hn=(t,n,o,r)=>Za(t,o,r?a=>{const s=t[a][n];return s<o||s===o&&t[a+1][n]===o}:a=>t[a][n]<o),Dp=(t,n,o)=>Za(t,o,r=>t[r][n]>=o);function Np(t,n,o){let r=0,a=t.length;for(;r<a&&t[r]<n;)r++;for(;a>r&&t[a-1]>o;)a--;return r>0||a<t.length?t.slice(r,a):t}const Ml=["push","pop","shift","splice","unshift"];function Mp(t,n){if(t._chartjs){t._chartjs.listeners.push(n);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[n]}}),Ml.forEach(o=>{const r="_onData"+Ja(o),a=t[o];Object.defineProperty(t,o,{configurable:!0,enumerable:!1,value(...s){const i=a.apply(this,s);return t._chartjs.listeners.forEach(l=>{typeof l[r]=="function"&&l[r](...s)}),i}})})}function vl(t,n){const o=t._chartjs;if(!o)return;const r=o.listeners,a=r.indexOf(n);a!==-1&&r.splice(a,1),!(r.length>0)&&(Ml.forEach(s=>{delete t[s]}),delete t._chartjs)}function Pl(t){const n=new Set(t);return n.size===t.length?t:Array.from(n)}const Tl=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function Ol(t,n){let o=[],r=!1;return function(...a){o=a,r||(r=!0,Tl.call(window,()=>{r=!1,t.apply(n,o)}))}}function vp(t,n){let o;return function(...r){return n?(clearTimeout(o),o=setTimeout(t,n,r)):t.apply(this,r),n}}const es=t=>t==="start"?"left":t==="end"?"right":"center",_t=(t,n,o)=>t==="start"?n:t==="end"?o:(n+o)/2,Pp=(t,n,o,r)=>t===(r?"left":"right")?o:t==="center"?(n+o)/2:n;function Tp(t,n,o){const r=n.length;let a=0,s=r;if(t._sorted){const{iScale:i,vScale:l,_parsed:c}=t,d=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,u=i.axis,{min:h,max:f,minDefined:m,maxDefined:g}=i.getUserBounds();if(m){if(a=Math.min(Hn(c,u,h).lo,o?r:Hn(n,u,i.getPixelForValue(h)).lo),d){const b=c.slice(0,a+1).reverse().findIndex(x=>!Je(x[l.axis]));a-=Math.max(0,b)}a=Bt(a,0,r-1)}if(g){let b=Math.max(Hn(c,i.axis,f,!0).hi+1,o?0:Hn(n,u,i.getPixelForValue(f),!0).hi+1);if(d){const x=c.slice(b-1).findIndex(p=>!Je(p[l.axis]));b+=Math.max(0,x)}s=Bt(b,a,r)-a}else s=r-a}return{start:a,count:s}}function Op(t){const{xScale:n,yScale:o,_scaleRanges:r}=t,a={xmin:n.min,xmax:n.max,ymin:o.min,ymax:o.max};if(!r)return t._scaleRanges=a,!0;const s=r.xmin!==n.min||r.xmax!==n.max||r.ymin!==o.min||r.ymax!==o.max;return Object.assign(r,a),s}const Sr=t=>t===0||t===1,Fl=(t,n,o)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-n)*dt/o)),zl=(t,n,o)=>Math.pow(2,-10*t)*Math.sin((t-n)*dt/o)+1,Lo={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*kt)+1,easeOutSine:t=>Math.sin(t*kt),easeInOutSine:t=>-.5*(Math.cos(ot*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Sr(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Sr(t)?t:Fl(t,.075,.3),easeOutElastic:t=>Sr(t)?t:zl(t,.075,.3),easeInOutElastic(t){return Sr(t)?t:t<.5?.5*Fl(t*2,.1125,.45):.5+.5*zl(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let n=1.70158;return(t/=.5)<1?.5*(t*t*(((n*=1.525)+1)*t-n)):.5*((t-=2)*t*(((n*=1.525)+1)*t+n)+2)},easeInBounce:t=>1-Lo.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?Lo.easeInBounce(t*2)*.5:Lo.easeOutBounce(t*2-1)*.5+.5};function ts(t){if(t&&typeof t=="object"){const n=t.toString();return n==="[object CanvasPattern]"||n==="[object CanvasGradient]"}return!1}function Il(t){return ts(t)?t:new Po(t)}function ns(t){return ts(t)?t:new Po(t).saturate(.5).darken(.1).hexString()}const Fp=["x","y","borderWidth","radius","tension"],zp=["color","borderColor","backgroundColor"];function Ip(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"}),t.set("animations",{colors:{type:"color",properties:zp},numbers:{type:"number",properties:Fp}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}})}function Rp(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Rl=new Map;function Lp(t,n){n=n||{};const o=t+JSON.stringify(n);let r=Rl.get(o);return r||(r=new Intl.NumberFormat(t,n),Rl.set(o,r)),r}function os(t,n,o){return Lp(n,o).format(t)}const $p={values(t){return gt(t)?t:""+t},numeric(t,n,o){if(t===0)return"0";const r=this.chart.options.locale;let a,s=t;if(o.length>1){const d=Math.max(Math.abs(o[0].value),Math.abs(o[o.length-1].value));(d<1e-4||d>1e15)&&(a="scientific"),s=jp(t,o)}const i=Al(Math.abs(s)),l=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:a,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),os(t,r,c)}};function jp(t,n){let o=n.length>3?n[2].value-n[1].value:n[1].value-n[0].value;return Math.abs(o)>=1&&t!==Math.floor(t)&&(o=t-Math.floor(t)),o}var Ll={formatters:$p};function Wp(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,o)=>o.lineWidth,tickColor:(n,o)=>o.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ll.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"&&n!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"})}const qn=Object.create(null),rs=Object.create(null);function $o(t,n){if(!n)return t;const o=n.split(".");for(let r=0,a=o.length;r<a;++r){const s=o[r];t=t[s]||(t[s]=Object.create(null))}return t}function as(t,n,o){return typeof n=="string"?To($o(t,n),o):To($o(t,""),n)}class Up{constructor(n,o){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,a)=>ns(a.backgroundColor),this.hoverBorderColor=(r,a)=>ns(a.borderColor),this.hoverColor=(r,a)=>ns(a.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(n),this.apply(o)}set(n,o){return as(this,n,o)}get(n){return $o(this,n)}describe(n,o){return as(rs,n,o)}override(n,o){return as(qn,n,o)}route(n,o,r,a){const s=$o(this,n),i=$o(this,r),l="_"+o;Object.defineProperties(s,{[l]:{value:s[o],writable:!0},[o]:{enumerable:!0,get(){const c=this[l],d=i[a];return Ue(c)?Object.assign({},d,c):Re(c,d)},set(c){this[l]=c}}})}apply(n){n.forEach(o=>o(this))}}var pt=new Up({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ip,Rp,Wp]);function Hp(t){return!t||Je(t.size)||Je(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function $l(t,n,o,r,a){let s=n[a];return s||(s=n[a]=t.measureText(a).width,o.push(a)),s>r&&(r=s),r}function Gn(t,n,o){const r=t.currentDevicePixelRatio,a=o!==0?Math.max(o/2,.5):0;return Math.round((n-a)*r)/r+a}function jl(t,n){!n&&!t||(n=n||t.getContext("2d"),n.save(),n.resetTransform(),n.clearRect(0,0,t.width,t.height),n.restore())}function ss(t,n,o,r){Wl(t,n,o,r,null)}function Wl(t,n,o,r,a){let s,i,l,c,d,u,h,f;const m=n.pointStyle,g=n.rotation,b=n.radius;let x=(g||0)*wp;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(o,r),t.rotate(x),t.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),t.restore();return}if(!(isNaN(b)||b<=0)){switch(t.beginPath(),m){default:a?t.ellipse(o,r,a/2,b,0,0,dt):t.arc(o,r,b,0,dt),t.closePath();break;case"triangle":u=a?a/2:b,t.moveTo(o+Math.sin(x)*u,r-Math.cos(x)*b),x+=Sl,t.lineTo(o+Math.sin(x)*u,r-Math.cos(x)*b),x+=Sl,t.lineTo(o+Math.sin(x)*u,r-Math.cos(x)*b),t.closePath();break;case"rectRounded":d=b*.516,c=b-d,i=Math.cos(x+Un)*c,h=Math.cos(x+Un)*(a?a/2-d:c),l=Math.sin(x+Un)*c,f=Math.sin(x+Un)*(a?a/2-d:c),t.arc(o-h,r-l,d,x-ot,x-kt),t.arc(o+f,r-i,d,x-kt,x),t.arc(o+h,r+l,d,x,x+kt),t.arc(o-f,r+i,d,x+kt,x+ot),t.closePath();break;case"rect":if(!g){c=Math.SQRT1_2*b,u=a?a/2:c,t.rect(o-u,r-c,2*u,2*c);break}x+=Un;case"rectRot":h=Math.cos(x)*(a?a/2:b),i=Math.cos(x)*b,l=Math.sin(x)*b,f=Math.sin(x)*(a?a/2:b),t.moveTo(o-h,r-l),t.lineTo(o+f,r-i),t.lineTo(o+h,r+l),t.lineTo(o-f,r+i),t.closePath();break;case"crossRot":x+=Un;case"cross":h=Math.cos(x)*(a?a/2:b),i=Math.cos(x)*b,l=Math.sin(x)*b,f=Math.sin(x)*(a?a/2:b),t.moveTo(o-h,r-l),t.lineTo(o+h,r+l),t.moveTo(o+f,r-i),t.lineTo(o-f,r+i);break;case"star":h=Math.cos(x)*(a?a/2:b),i=Math.cos(x)*b,l=Math.sin(x)*b,f=Math.sin(x)*(a?a/2:b),t.moveTo(o-h,r-l),t.lineTo(o+h,r+l),t.moveTo(o+f,r-i),t.lineTo(o-f,r+i),x+=Un,h=Math.cos(x)*(a?a/2:b),i=Math.cos(x)*b,l=Math.sin(x)*b,f=Math.sin(x)*(a?a/2:b),t.moveTo(o-h,r-l),t.lineTo(o+h,r+l),t.moveTo(o+f,r-i),t.lineTo(o-f,r+i);break;case"line":i=a?a/2:Math.cos(x)*b,l=Math.sin(x)*b,t.moveTo(o-i,r-l),t.lineTo(o+i,r+l);break;case"dash":t.moveTo(o,r),t.lineTo(o+Math.cos(x)*(a?a/2:b),r+Math.sin(x)*b);break;case!1:t.closePath();break}t.fill(),n.borderWidth>0&&t.stroke()}}function jo(t,n,o){return o=o||.5,!n||t&&t.x>n.left-o&&t.x<n.right+o&&t.y>n.top-o&&t.y<n.bottom+o}function Ar(t,n){t.save(),t.beginPath(),t.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),t.clip()}function Vr(t){t.restore()}function qp(t,n,o,r,a){if(!n)return t.lineTo(o.x,o.y);if(a==="middle"){const s=(n.x+o.x)/2;t.lineTo(s,n.y),t.lineTo(s,o.y)}else a==="after"!=!!r?t.lineTo(n.x,o.y):t.lineTo(o.x,n.y);t.lineTo(o.x,o.y)}function Gp(t,n,o,r){if(!n)return t.lineTo(o.x,o.y);t.bezierCurveTo(r?n.cp1x:n.cp2x,r?n.cp1y:n.cp2y,r?o.cp2x:o.cp1x,r?o.cp2y:o.cp1y,o.x,o.y)}function Xp(t,n){n.translation&&t.translate(n.translation[0],n.translation[1]),Je(n.rotation)||t.rotate(n.rotation),n.color&&(t.fillStyle=n.color),n.textAlign&&(t.textAlign=n.textAlign),n.textBaseline&&(t.textBaseline=n.textBaseline)}function Kp(t,n,o,r,a){if(a.strikethrough||a.underline){const s=t.measureText(r),i=n-s.actualBoundingBoxLeft,l=n+s.actualBoundingBoxRight,c=o-s.actualBoundingBoxAscent,d=o+s.actualBoundingBoxDescent,u=a.strikethrough?(c+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=a.decorationWidth||2,t.moveTo(i,u),t.lineTo(l,u),t.stroke()}}function Yp(t,n){const o=t.fillStyle;t.fillStyle=n.color,t.fillRect(n.left,n.top,n.width,n.height),t.fillStyle=o}function Wo(t,n,o,r,a,s={}){const i=gt(n)?n:[n],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(t.save(),t.font=a.string,Xp(t,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&Yp(t,s.backdrop),l&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),Je(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,o,r,s.maxWidth)),t.fillText(d,o,r,s.maxWidth),Kp(t,o,r,d,s),r+=Number(a.lineHeight);t.restore()}function Dr(t,n){const{x:o,y:r,w:a,h:s,radius:i}=n;t.arc(o+i.topLeft,r+i.topLeft,i.topLeft,1.5*ot,ot,!0),t.lineTo(o,r+s-i.bottomLeft),t.arc(o+i.bottomLeft,r+s-i.bottomLeft,i.bottomLeft,ot,kt,!0),t.lineTo(o+a-i.bottomRight,r+s),t.arc(o+a-i.bottomRight,r+s-i.bottomRight,i.bottomRight,kt,0,!0),t.lineTo(o+a,r+i.topRight),t.arc(o+a-i.topRight,r+i.topRight,i.topRight,0,-kt,!0),t.lineTo(o+i.topLeft,r)}const Jp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Qp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Zp(t,n){const o=(""+t).match(Jp);if(!o||o[1]==="normal")return n*1.2;switch(t=+o[2],o[3]){case"px":return t;case"%":t/=100;break}return n*t}const eg=t=>+t||0;function is(t,n){const o={},r=Ue(n),a=r?Object.keys(n):n,s=Ue(t)?r?i=>Re(t[i],t[n[i]]):i=>t[i]:()=>t;for(const i of a)o[i]=eg(s(i));return o}function Ul(t){return is(t,{top:"y",right:"x",bottom:"y",left:"x"})}function lo(t){return is(t,["topLeft","topRight","bottomLeft","bottomRight"])}function $t(t){const n=Ul(t);return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function St(t,n){t=t||{},n=n||pt.font;let o=Re(t.size,n.size);typeof o=="string"&&(o=parseInt(o,10));let r=Re(t.style,n.style);r&&!(""+r).match(Qp)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const a={family:Re(t.family,n.family),lineHeight:Zp(Re(t.lineHeight,n.lineHeight),o),size:o,style:r,weight:Re(t.weight,n.weight),string:""};return a.string=Hp(a),a}function Nr(t,n,o,r){let a,s,i;for(a=0,s=t.length;a<s;++a)if(i=t[a],i!==void 0&&i!==void 0)return i}function tg(t,n,o){const{min:r,max:a}=t,s=Cl(n,(a-r)/2),i=(l,c)=>o&&l===0?0:l+c;return{min:i(r,-Math.abs(s)),max:i(a,s)}}function Xn(t,n){return Object.assign(Object.create(t),n)}function ls(t,n=[""],o,r,a=()=>t[0]){const s=o||t;typeof r>"u"&&(r=Kl("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:r,_getTarget:a,override:l=>ls([l,...t],n,s,r)};return new Proxy(i,{deleteProperty(l,c){return delete l[c],delete l._keys,delete t[0][c],!0},get(l,c){return ql(l,c,()=>cg(c,n,t,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(l,c){return Yl(l).includes(c)},ownKeys(l){return Yl(l)},set(l,c,d){const u=l._storage||(l._storage=a());return l[c]=u[c]=d,delete l._keys,!0}})}function co(t,n,o,r){const a={_cacheable:!1,_proxy:t,_context:n,_subProxy:o,_stack:new Set,_descriptors:Hl(t,r),setContext:s=>co(t,s,o,r),override:s=>co(t.override(s),n,o,r)};return new Proxy(a,{deleteProperty(s,i){return delete s[i],delete t[i],!0},get(s,i,l){return ql(s,i,()=>og(s,i,l))},getOwnPropertyDescriptor(s,i){return s._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(s,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(s,i,l){return t[i]=l,delete s[i],!0}})}function Hl(t,n={scriptable:!0,indexable:!0}){const{_scriptable:o=n.scriptable,_indexable:r=n.indexable,_allKeys:a=n.allKeys}=t;return{allKeys:a,scriptable:o,indexable:r,isScriptable:Nn(o)?o:()=>o,isIndexable:Nn(r)?r:()=>r}}const ng=(t,n)=>t?t+Ja(n):n,cs=(t,n)=>Ue(n)&&t!=="adapters"&&(Object.getPrototypeOf(n)===null||n.constructor===Object);function ql(t,n,o){if(Object.prototype.hasOwnProperty.call(t,n)||n==="constructor")return t[n];const r=o();return t[n]=r,r}function og(t,n,o){const{_proxy:r,_context:a,_subProxy:s,_descriptors:i}=t;let l=r[n];return Nn(l)&&i.isScriptable(n)&&(l=rg(n,l,t,o)),gt(l)&&l.length&&(l=ag(n,l,t,i.isIndexable)),cs(n,l)&&(l=co(l,a,s&&s[n],i)),l}function rg(t,n,o,r){const{_proxy:a,_context:s,_subProxy:i,_stack:l}=o;if(l.has(t))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+t);l.add(t);let c=n(s,i||r);return l.delete(t),cs(t,c)&&(c=ds(a._scopes,a,t,c)),c}function ag(t,n,o,r){const{_proxy:a,_context:s,_subProxy:i,_descriptors:l}=o;if(typeof s.index<"u"&&r(t))return n[s.index%n.length];if(Ue(n[0])){const c=n,d=a._scopes.filter(u=>u!==c);n=[];for(const u of c){const h=ds(d,a,t,u);n.push(co(h,s,i&&i[t],l))}}return n}function Gl(t,n,o){return Nn(t)?t(n,o):t}const sg=(t,n)=>t===!0?n:typeof t=="string"?Wn(n,t):void 0;function ig(t,n,o,r,a){for(const s of n){const i=sg(o,s);if(i){t.add(i);const l=Gl(i._fallback,o,a);if(typeof l<"u"&&l!==o&&l!==r)return l}else if(i===!1&&typeof r<"u"&&o!==r)return null}return!1}function ds(t,n,o,r){const a=n._rootScopes,s=Gl(n._fallback,o,r),i=[...t,...a],l=new Set;l.add(r);let c=Xl(l,i,o,s||o,r);return c===null||typeof s<"u"&&s!==o&&(c=Xl(l,i,s,c,r),c===null)?!1:ls(Array.from(l),[""],a,s,()=>lg(n,o,r))}function Xl(t,n,o,r,a){for(;o;)o=ig(t,n,o,r,a);return o}function lg(t,n,o){const r=t._getTarget();n in r||(r[n]={});const a=r[n];return gt(a)&&Ue(o)?o:a||{}}function cg(t,n,o,r){let a;for(const s of n)if(a=Kl(ng(s,t),o),typeof a<"u")return cs(t,a)?ds(o,r,t,a):a}function Kl(t,n){for(const o of n){if(!o)continue;const r=o[t];if(typeof r<"u")return r}}function Yl(t){let n=t._keys;return n||(n=t._keys=dg(t._scopes)),n}function dg(t){const n=new Set;for(const o of t)for(const r of Object.keys(o).filter(a=>!a.startsWith("_")))n.add(r);return Array.from(n)}const ug=Number.EPSILON||1e-14,uo=(t,n)=>n<t.length&&!t[n].skip&&t[n],Jl=t=>t==="x"?"y":"x";function fg(t,n,o,r){const a=t.skip?n:t,s=n,i=o.skip?n:o,l=Qa(s,a),c=Qa(i,s);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const h=r*d,f=r*u;return{previous:{x:s.x-h*(i.x-a.x),y:s.y-h*(i.y-a.y)},next:{x:s.x+f*(i.x-a.x),y:s.y+f*(i.y-a.y)}}}function hg(t,n,o){const r=t.length;let a,s,i,l,c,d=uo(t,0);for(let u=0;u<r-1;++u)if(c=d,d=uo(t,u+1),!(!c||!d)){if(zo(n[u],0,ug)){o[u]=o[u+1]=0;continue}a=o[u]/n[u],s=o[u+1]/n[u],l=Math.pow(a,2)+Math.pow(s,2),!(l<=9)&&(i=3/Math.sqrt(l),o[u]=a*i*n[u],o[u+1]=s*i*n[u])}}function mg(t,n,o="x"){const r=Jl(o),a=t.length;let s,i,l,c=uo(t,0);for(let d=0;d<a;++d){if(i=l,l=c,c=uo(t,d+1),!l)continue;const u=l[o],h=l[r];i&&(s=(u-i[o])/3,l[`cp1${o}`]=u-s,l[`cp1${r}`]=h-s*n[d]),c&&(s=(c[o]-u)/3,l[`cp2${o}`]=u+s,l[`cp2${r}`]=h+s*n[d])}}function pg(t,n="x"){const o=Jl(n),r=t.length,a=Array(r).fill(0),s=Array(r);let i,l,c,d=uo(t,0);for(i=0;i<r;++i)if(l=c,c=d,d=uo(t,i+1),!!c){if(d){const u=d[n]-c[n];a[i]=u!==0?(d[o]-c[o])/u:0}s[i]=l?d?tn(a[i-1])!==tn(a[i])?0:(a[i-1]+a[i])/2:a[i-1]:a[i]}hg(t,a,s),mg(t,s,n)}function Mr(t,n,o){return Math.max(Math.min(t,o),n)}function gg(t,n){let o,r,a,s,i,l=jo(t[0],n);for(o=0,r=t.length;o<r;++o)i=s,s=l,l=o<r-1&&jo(t[o+1],n),s&&(a=t[o],i&&(a.cp1x=Mr(a.cp1x,n.left,n.right),a.cp1y=Mr(a.cp1y,n.top,n.bottom)),l&&(a.cp2x=Mr(a.cp2x,n.left,n.right),a.cp2y=Mr(a.cp2y,n.top,n.bottom)))}function bg(t,n,o,r,a){let s,i,l,c;if(n.spanGaps&&(t=t.filter(d=>!d.skip)),n.cubicInterpolationMode==="monotone")pg(t,a);else{let d=r?t[t.length-1]:t[0];for(s=0,i=t.length;s<i;++s)l=t[s],c=fg(d,l,t[Math.min(s+1,i-(r?0:1))%i],n.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}n.capBezierPoints&&gg(t,o)}function us(){return typeof window<"u"&&typeof document<"u"}function fs(t){let n=t.parentNode;return n&&n.toString()==="[object ShadowRoot]"&&(n=n.host),n}function vr(t,n,o){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*n.parentNode[o])):r=t,r}const Pr=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function yg(t,n){return Pr(t).getPropertyValue(n)}const xg=["top","right","bottom","left"];function Kn(t,n,o){const r={};o=o?"-"+o:"";for(let a=0;a<4;a++){const s=xg[a];r[s]=parseFloat(t[n+"-"+s+o])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const kg=(t,n,o)=>(t>0||n>0)&&(!o||!o.shadowRoot);function wg(t,n){const o=t.touches,r=o&&o.length?o[0]:t,{offsetX:a,offsetY:s}=r;let i=!1,l,c;if(kg(a,s,t.target))l=a,c=s;else{const d=n.getBoundingClientRect();l=r.clientX-d.left,c=r.clientY-d.top,i=!0}return{x:l,y:c,box:i}}function Yn(t,n){if("native"in t)return t;const{canvas:o,currentDevicePixelRatio:r}=n,a=Pr(o),s=a.boxSizing==="border-box",i=Kn(a,"padding"),l=Kn(a,"border","width"),{x:c,y:d,box:u}=wg(t,o),h=i.left+(u&&l.left),f=i.top+(u&&l.top);let{width:m,height:g}=n;return s&&(m-=i.width+l.width,g-=i.height+l.height),{x:Math.round((c-h)/m*o.width/r),y:Math.round((d-f)/g*o.height/r)}}function Cg(t,n,o){let r,a;if(n===void 0||o===void 0){const s=t&&fs(t);if(!s)n=t.clientWidth,o=t.clientHeight;else{const i=s.getBoundingClientRect(),l=Pr(s),c=Kn(l,"border","width"),d=Kn(l,"padding");n=i.width-d.width-c.width,o=i.height-d.height-c.height,r=vr(l.maxWidth,s,"clientWidth"),a=vr(l.maxHeight,s,"clientHeight")}}return{width:n,height:o,maxWidth:r||_r,maxHeight:a||_r}}const Mn=t=>Math.round(t*10)/10;function Eg(t,n,o,r){const a=Pr(t),s=Kn(a,"margin"),i=vr(a.maxWidth,t,"clientWidth")||_r,l=vr(a.maxHeight,t,"clientHeight")||_r,c=Cg(t,n,o);let{width:d,height:u}=c;if(a.boxSizing==="content-box"){const f=Kn(a,"border","width"),m=Kn(a,"padding");d-=m.width+f.width,u-=m.height+f.height}return d=Math.max(0,d-s.width),u=Math.max(0,r?d/r:u-s.height),d=Mn(Math.min(d,i,c.maxWidth)),u=Mn(Math.min(u,l,c.maxHeight)),d&&!u&&(u=Mn(d/2)),(n!==void 0||o!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,d=Mn(Math.floor(u*r))),{width:d,height:u}}function Ql(t,n,o){const r=n||1,a=Mn(t.height*r),s=Mn(t.width*r);t.height=Mn(t.height),t.width=Mn(t.width);const i=t.canvas;return i.style&&(o||!i.style.height&&!i.style.width)&&(i.style.height=`${t.height}px`,i.style.width=`${t.width}px`),t.currentDevicePixelRatio!==r||i.height!==a||i.width!==s?(t.currentDevicePixelRatio=r,i.height=a,i.width=s,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const Bg=(function(){let t=!1;try{const n={get passive(){return t=!0,!1}};us()&&(window.addEventListener("test",null,n),window.removeEventListener("test",null,n))}catch{}return t})();function Zl(t,n){const o=yg(t,n),r=o&&o.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Jn(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:t.y+o*(n.y-t.y)}}function _g(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:r==="middle"?o<.5?t.y:n.y:r==="after"?o<1?t.y:n.y:o>0?n.y:t.y}}function Sg(t,n,o,r){const a={x:t.cp2x,y:t.cp2y},s={x:n.cp1x,y:n.cp1y},i=Jn(t,a,o),l=Jn(a,s,o),c=Jn(s,n,o),d=Jn(i,l,o),u=Jn(l,c,o);return Jn(d,u,o)}const Ag=function(t,n){return{x(o){return t+t+n-o},setWidth(o){n=o},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,r){return o-r},leftForLtr(o,r){return o-r}}},Vg=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,n){return t+n},leftForLtr(t,n){return t}}};function fo(t,n,o){return t?Ag(n,o):Vg()}function ec(t,n){let o,r;(n==="ltr"||n==="rtl")&&(o=t.canvas.style,r=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",n,"important"),t.prevTextDirection=r)}function tc(t,n){n!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",n[0],n[1]))}function nc(t){return t==="angle"?{between:Ro,compare:Ap,normalize:Tt}:{between:bn,compare:(n,o)=>n-o,normalize:n=>n}}function oc({start:t,end:n,count:o,loop:r,style:a}){return{start:t%o,end:n%o,loop:r&&(n-t+1)%o===0,style:a}}function Dg(t,n,o){const{property:r,start:a,end:s}=o,{between:i,normalize:l}=nc(r),c=n.length;let{start:d,end:u,loop:h}=t,f,m;if(h){for(d+=c,u+=c,f=0,m=c;f<m&&i(l(n[d%c][r]),a,s);++f)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:h,style:t.style}}function rc(t,n,o){if(!o)return[t];const{property:r,start:a,end:s}=o,i=n.length,{compare:l,between:c,normalize:d}=nc(r),{start:u,end:h,loop:f,style:m}=Dg(t,n,o),g=[];let b=!1,x=null,p,C,w;const E=()=>c(a,w,p)&&l(a,w)!==0,_=()=>l(s,p)===0||c(s,w,p),B=()=>b||E(),k=()=>!b||_();for(let y=u,V=u;y<=h;++y)C=n[y%i],!C.skip&&(p=d(C[r]),p!==w&&(b=c(p,a,s),x===null&&B()&&(x=l(p,a)===0?y:V),x!==null&&k()&&(g.push(oc({start:x,end:y,loop:f,count:i,style:m})),x=null),V=y,w=p));return x!==null&&g.push(oc({start:x,end:h,loop:f,count:i,style:m})),g}function ac(t,n){const o=[],r=t.segments;for(let a=0;a<r.length;a++){const s=rc(r[a],t.points,n);s.length&&o.push(...s)}return o}function Ng(t,n,o,r){let a=0,s=n-1;if(o&&!r)for(;a<n&&!t[a].skip;)a++;for(;a<n&&t[a].skip;)a++;for(a%=n,o&&(s+=a);s>a&&t[s%n].skip;)s--;return s%=n,{start:a,end:s}}function Mg(t,n,o,r){const a=t.length,s=[];let i=n,l=t[n],c;for(c=n+1;c<=o;++c){const d=t[c%a];d.skip||d.stop?l.skip||(r=!1,s.push({start:n%a,end:(c-1)%a,loop:r}),n=i=d.stop?c:null):(i=c,l.skip&&(n=c)),l=d}return i!==null&&s.push({start:n%a,end:i%a,loop:r}),s}function vg(t,n){const o=t.points,r=t.options.spanGaps,a=o.length;if(!a)return[];const s=!!t._loop,{start:i,end:l}=Ng(o,a,s,r);if(r===!0)return sc(t,[{start:i,end:l,loop:s}],o,n);const c=l<i?l+a:l,d=!!t._fullLoop&&i===0&&l===a-1;return sc(t,Mg(o,i,c,d),o,n)}function sc(t,n,o,r){return!r||!r.setContext||!o?n:Pg(t,n,o,r)}function Pg(t,n,o,r){const a=t._chart.getContext(),s=ic(t.options),{_datasetIndex:i,options:{spanGaps:l}}=t,c=o.length,d=[];let u=s,h=n[0].start,f=h;function m(g,b,x,p){const C=l?-1:1;if(g!==b){for(g+=c;o[g%c].skip;)g-=C;for(;o[b%c].skip;)b+=C;g%c!==b%c&&(d.push({start:g%c,end:b%c,loop:x,style:p}),u=p,h=b%c)}}for(const g of n){h=l?h:g.start;let b=o[h%c],x;for(f=h+1;f<=g.end;f++){const p=o[f%c];x=ic(r.setContext(Xn(a,{type:"segment",p0:b,p1:p,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:i}))),Tg(x,u)&&m(h,f-1,g.loop,u),b=p,u=x}h<f-1&&m(h,f-1,g.loop,u)}return d}function ic(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Tg(t,n){if(!n)return!1;const o=[],r=function(a,s){return ts(s)?(o.includes(s)||o.push(s),o.indexOf(s)):s};return JSON.stringify(t,r)!==JSON.stringify(n,r)}function Tr(t,n,o){return t.options.clip?t[o]:n[o]}function Og(t,n){const{xScale:o,yScale:r}=t;return o&&r?{left:Tr(o,n,"left"),right:Tr(o,n,"right"),top:Tr(r,n,"top"),bottom:Tr(r,n,"bottom")}:n}function lc(t,n){const o=n._clip;if(o.disabled)return!1;const r=Og(n,t.chartArea);return{left:o.left===!1?0:r.left-(o.left===!0?0:o.left),right:o.right===!1?t.width:r.right+(o.right===!0?0:o.right),top:o.top===!1?0:r.top-(o.top===!0?0:o.top),bottom:o.bottom===!1?t.height:r.bottom+(o.bottom===!0?0:o.bottom)}}/*!
11
+ */function pn(){}const hp=(()=>{let t=0;return()=>t++})();function He(t){return t==null}function ht(t){if(Array.isArray&&Array.isArray(t))return!0;const n=Object.prototype.toString.call(t);return n.slice(0,7)==="[object"&&n.slice(-6)==="Array]"}function Re(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function kt(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function nn(t,n){return kt(t)?t:n}function Oe(t,n){return typeof t>"u"?n:t}const mp=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/n,_l=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*n:+t;function at(t,n,o){if(t&&typeof t.call=="function")return t.apply(o,n)}function Ye(t,n,o,r){let a,s,i;if(ht(t))for(s=t.length,a=0;a<s;a++)n.call(o,t[a],a);else if(Re(t))for(i=Object.keys(t),s=i.length,a=0;a<s;a++)n.call(o,t[i[a]],i[a])}function _r(t,n){let o,r,a,s;if(!t||!n||t.length!==n.length)return!1;for(o=0,r=t.length;o<r;++o)if(a=t[o],s=n[o],a.datasetIndex!==s.datasetIndex||a.index!==s.index)return!1;return!0}function Sr(t){if(ht(t))return t.map(Sr);if(Re(t)){const n=Object.create(null),o=Object.keys(t),r=o.length;let a=0;for(;a<r;++a)n[o[a]]=Sr(t[o[a]]);return n}return t}function Sl(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function pp(t,n,o,r){if(!Sl(t))return;const a=n[t],s=o[t];Re(a)&&Re(s)?zo(a,s,r):n[t]=Sr(s)}function zo(t,n,o){const r=ht(n)?n:[n],a=r.length;if(!Re(t))return t;o=o||{};const s=o.merger||pp;let i;for(let l=0;l<a;++l){if(i=r[l],!Re(i))continue;const c=Object.keys(i);for(let d=0,u=c.length;d<u;++d)s(c[d],t,i,o)}return t}function Io(t,n){return zo(t,n,{merger:gp})}function gp(t,n,o){if(!Sl(t))return;const r=n[t],a=o[t];Re(r)&&Re(a)?Io(r,a):Object.prototype.hasOwnProperty.call(n,t)||(n[t]=Sr(a))}const Vl={"":t=>t,x:t=>t.x,y:t=>t.y};function bp(t){const n=t.split("."),o=[];let r="";for(const a of n)r+=a,r.endsWith("\\")?r=r.slice(0,-1)+".":(o.push(r),r="");return o}function yp(t){const n=bp(t);return o=>{for(const r of n){if(r==="")break;o=o&&o[r]}return o}}function Un(t,n){return(Vl[n]||(Vl[n]=yp(n)))(t)}function ts(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Ro=t=>typeof t<"u",Nn=t=>typeof t=="function",Al=(t,n)=>{if(t.size!==n.size)return!1;for(const o of t)if(!n.has(o))return!1;return!0};function xp(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Je=Math.PI,it=2*Je,kp=it+Je,Vr=Number.POSITIVE_INFINITY,wp=Je/180,gt=Je/2,Hn=Je/4,Dl=Je*2/3,Nl=Math.log10,on=Math.sign;function Lo(t,n,o){return Math.abs(t-n)<o}function Ml(t){const n=Math.round(t);t=Lo(t,n,t/1e3)?n:t;const o=Math.pow(10,Math.floor(Nl(t))),r=t/o;return(r<=1?1:r<=2?2:r<=5?5:10)*o}function Cp(t){const n=[],o=Math.sqrt(t);let r;for(r=1;r<o;r++)t%r===0&&(n.push(r),n.push(t/r));return o===(o|0)&&n.push(o),n.sort((a,s)=>a-s).pop(),n}function Ep(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function $o(t){return!Ep(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function Bp(t,n){const o=Math.round(t);return o-n<=t&&o+n>=t}function _p(t,n,o){let r,a,s;for(r=0,a=t.length;r<a;r++)s=t[r][o],isNaN(s)||(n.min=Math.min(n.min,s),n.max=Math.max(n.max,s))}function gn(t){return t*(Je/180)}function Sp(t){return t*(180/Je)}function vl(t){if(!kt(t))return;let n=1,o=0;for(;Math.round(t*n)/n!==t;)n*=10,o++;return o}function Pl(t,n){const o=n.x-t.x,r=n.y-t.y,a=Math.sqrt(o*o+r*r);let s=Math.atan2(r,o);return s<-.5*Je&&(s+=it),{angle:s,distance:a}}function ns(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function Vp(t,n){return(t-n+kp)%it-Je}function Ft(t){return(t%it+it)%it}function jo(t,n,o,r){const a=Ft(t),s=Ft(n),i=Ft(o),l=Ft(s-a),c=Ft(i-a),d=Ft(a-s),u=Ft(a-i);return a===s||a===i||r&&s===i||l>c&&d<u}function wt(t,n,o){return Math.max(n,Math.min(o,t))}function Ap(t){return wt(t,-32768,32767)}function bn(t,n,o,r=1e-6){return t>=Math.min(n,o)-r&&t<=Math.max(n,o)+r}function os(t,n,o){o=o||(i=>t[i]<n);let r=t.length-1,a=0,s;for(;r-a>1;)s=a+r>>1,o(s)?a=s:r=s;return{lo:a,hi:r}}const qn=(t,n,o,r)=>os(t,o,r?a=>{const s=t[a][n];return s<o||s===o&&t[a+1][n]===o}:a=>t[a][n]<o),Dp=(t,n,o)=>os(t,o,r=>t[r][n]>=o);function Np(t,n,o){let r=0,a=t.length;for(;r<a&&t[r]<n;)r++;for(;a>r&&t[a-1]>o;)a--;return r>0||a<t.length?t.slice(r,a):t}const Tl=["push","pop","shift","splice","unshift"];function Mp(t,n){if(t._chartjs){t._chartjs.listeners.push(n);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[n]}}),Tl.forEach(o=>{const r="_onData"+ts(o),a=t[o];Object.defineProperty(t,o,{configurable:!0,enumerable:!1,value(...s){const i=a.apply(this,s);return t._chartjs.listeners.forEach(l=>{typeof l[r]=="function"&&l[r](...s)}),i}})})}function Ol(t,n){const o=t._chartjs;if(!o)return;const r=o.listeners,a=r.indexOf(n);a!==-1&&r.splice(a,1),!(r.length>0)&&(Tl.forEach(s=>{delete t[s]}),delete t._chartjs)}function Fl(t){const n=new Set(t);return n.size===t.length?t:Array.from(n)}const zl=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function Il(t,n){let o=[],r=!1;return function(...a){o=a,r||(r=!0,zl.call(window,()=>{r=!1,t.apply(n,o)}))}}function vp(t,n){let o;return function(...r){return n?(clearTimeout(o),o=setTimeout(t,n,r)):t.apply(this,r),n}}const rs=t=>t==="start"?"left":t==="end"?"right":"center",Ct=(t,n,o)=>t==="start"?n:t==="end"?o:(n+o)/2,Pp=(t,n,o,r)=>t===(r?"left":"right")?o:t==="center"?(n+o)/2:n;function Tp(t,n,o){const r=n.length;let a=0,s=r;if(t._sorted){const{iScale:i,vScale:l,_parsed:c}=t,d=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,u=i.axis,{min:f,max:h,minDefined:m,maxDefined:g}=i.getUserBounds();if(m){if(a=Math.min(qn(c,u,f).lo,o?r:qn(n,u,i.getPixelForValue(f)).lo),d){const k=c.slice(0,a+1).reverse().findIndex(y=>!He(y[l.axis]));a-=Math.max(0,k)}a=wt(a,0,r-1)}if(g){let k=Math.max(qn(c,i.axis,h,!0).hi+1,o?0:qn(n,u,i.getPixelForValue(h),!0).hi+1);if(d){const y=c.slice(k-1).findIndex(p=>!He(p[l.axis]));k+=Math.max(0,y)}s=wt(k,a,r)-a}else s=r-a}return{start:a,count:s}}function Op(t){const{xScale:n,yScale:o,_scaleRanges:r}=t,a={xmin:n.min,xmax:n.max,ymin:o.min,ymax:o.max};if(!r)return t._scaleRanges=a,!0;const s=r.xmin!==n.min||r.xmax!==n.max||r.ymin!==o.min||r.ymax!==o.max;return Object.assign(r,a),s}const Ar=t=>t===0||t===1,Rl=(t,n,o)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-n)*it/o)),Ll=(t,n,o)=>Math.pow(2,-10*t)*Math.sin((t-n)*it/o)+1,Wo={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*gt)+1,easeOutSine:t=>Math.sin(t*gt),easeInOutSine:t=>-.5*(Math.cos(Je*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Ar(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Ar(t)?t:Rl(t,.075,.3),easeOutElastic:t=>Ar(t)?t:Ll(t,.075,.3),easeInOutElastic(t){return Ar(t)?t:t<.5?.5*Rl(t*2,.1125,.45):.5+.5*Ll(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let n=1.70158;return(t/=.5)<1?.5*(t*t*(((n*=1.525)+1)*t-n)):.5*((t-=2)*t*(((n*=1.525)+1)*t+n)+2)},easeInBounce:t=>1-Wo.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?Wo.easeInBounce(t*2)*.5:Wo.easeOutBounce(t*2-1)*.5+.5};function as(t){if(t&&typeof t=="object"){const n=t.toString();return n==="[object CanvasPattern]"||n==="[object CanvasGradient]"}return!1}function $l(t){return as(t)?t:new Fo(t)}function ss(t){return as(t)?t:new Fo(t).saturate(.5).darken(.1).hexString()}const Fp=["x","y","borderWidth","radius","tension"],zp=["color","borderColor","backgroundColor"];function Ip(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"}),t.set("animations",{colors:{type:"color",properties:zp},numbers:{type:"number",properties:Fp}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}})}function Rp(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const jl=new Map;function Lp(t,n){n=n||{};const o=t+JSON.stringify(n);let r=jl.get(o);return r||(r=new Intl.NumberFormat(t,n),jl.set(o,r)),r}function is(t,n,o){return Lp(n,o).format(t)}const $p={values(t){return ht(t)?t:""+t},numeric(t,n,o){if(t===0)return"0";const r=this.chart.options.locale;let a,s=t;if(o.length>1){const d=Math.max(Math.abs(o[0].value),Math.abs(o[o.length-1].value));(d<1e-4||d>1e15)&&(a="scientific"),s=jp(t,o)}const i=Nl(Math.abs(s)),l=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:a,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),is(t,r,c)}};function jp(t,n){let o=n.length>3?n[2].value-n[1].value:n[1].value-n[0].value;return Math.abs(o)>=1&&t!==Math.floor(t)&&(o=t-Math.floor(t)),o}var Wl={formatters:$p};function Wp(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,o)=>o.lineWidth,tickColor:(n,o)=>o.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Wl.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"&&n!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"})}const Gn=Object.create(null),ls=Object.create(null);function Uo(t,n){if(!n)return t;const o=n.split(".");for(let r=0,a=o.length;r<a;++r){const s=o[r];t=t[s]||(t[s]=Object.create(null))}return t}function cs(t,n,o){return typeof n=="string"?zo(Uo(t,n),o):zo(Uo(t,""),n)}class Up{constructor(n,o){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,a)=>ss(a.backgroundColor),this.hoverBorderColor=(r,a)=>ss(a.borderColor),this.hoverColor=(r,a)=>ss(a.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(n),this.apply(o)}set(n,o){return cs(this,n,o)}get(n){return Uo(this,n)}describe(n,o){return cs(ls,n,o)}override(n,o){return cs(Gn,n,o)}route(n,o,r,a){const s=Uo(this,n),i=Uo(this,r),l="_"+o;Object.defineProperties(s,{[l]:{value:s[o],writable:!0},[o]:{enumerable:!0,get(){const c=this[l],d=i[a];return Re(c)?Object.assign({},d,c):Oe(c,d)},set(c){this[l]=c}}})}apply(n){n.forEach(o=>o(this))}}var dt=new Up({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ip,Rp,Wp]);function Hp(t){return!t||He(t.size)||He(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Ul(t,n,o,r,a){let s=n[a];return s||(s=n[a]=t.measureText(a).width,o.push(a)),s>r&&(r=s),r}function Xn(t,n,o){const r=t.currentDevicePixelRatio,a=o!==0?Math.max(o/2,.5):0;return Math.round((n-a)*r)/r+a}function Hl(t,n){!n&&!t||(n=n||t.getContext("2d"),n.save(),n.resetTransform(),n.clearRect(0,0,t.width,t.height),n.restore())}function ds(t,n,o,r){ql(t,n,o,r,null)}function ql(t,n,o,r,a){let s,i,l,c,d,u,f,h;const m=n.pointStyle,g=n.rotation,k=n.radius;let y=(g||0)*wp;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(o,r),t.rotate(y),t.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),t.restore();return}if(!(isNaN(k)||k<=0)){switch(t.beginPath(),m){default:a?t.ellipse(o,r,a/2,k,0,0,it):t.arc(o,r,k,0,it),t.closePath();break;case"triangle":u=a?a/2:k,t.moveTo(o+Math.sin(y)*u,r-Math.cos(y)*k),y+=Dl,t.lineTo(o+Math.sin(y)*u,r-Math.cos(y)*k),y+=Dl,t.lineTo(o+Math.sin(y)*u,r-Math.cos(y)*k),t.closePath();break;case"rectRounded":d=k*.516,c=k-d,i=Math.cos(y+Hn)*c,f=Math.cos(y+Hn)*(a?a/2-d:c),l=Math.sin(y+Hn)*c,h=Math.sin(y+Hn)*(a?a/2-d:c),t.arc(o-f,r-l,d,y-Je,y-gt),t.arc(o+h,r-i,d,y-gt,y),t.arc(o+f,r+l,d,y,y+gt),t.arc(o-h,r+i,d,y+gt,y+Je),t.closePath();break;case"rect":if(!g){c=Math.SQRT1_2*k,u=a?a/2:c,t.rect(o-u,r-c,2*u,2*c);break}y+=Hn;case"rectRot":f=Math.cos(y)*(a?a/2:k),i=Math.cos(y)*k,l=Math.sin(y)*k,h=Math.sin(y)*(a?a/2:k),t.moveTo(o-f,r-l),t.lineTo(o+h,r-i),t.lineTo(o+f,r+l),t.lineTo(o-h,r+i),t.closePath();break;case"crossRot":y+=Hn;case"cross":f=Math.cos(y)*(a?a/2:k),i=Math.cos(y)*k,l=Math.sin(y)*k,h=Math.sin(y)*(a?a/2:k),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+h,r-i),t.lineTo(o-h,r+i);break;case"star":f=Math.cos(y)*(a?a/2:k),i=Math.cos(y)*k,l=Math.sin(y)*k,h=Math.sin(y)*(a?a/2:k),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+h,r-i),t.lineTo(o-h,r+i),y+=Hn,f=Math.cos(y)*(a?a/2:k),i=Math.cos(y)*k,l=Math.sin(y)*k,h=Math.sin(y)*(a?a/2:k),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+h,r-i),t.lineTo(o-h,r+i);break;case"line":i=a?a/2:Math.cos(y)*k,l=Math.sin(y)*k,t.moveTo(o-i,r-l),t.lineTo(o+i,r+l);break;case"dash":t.moveTo(o,r),t.lineTo(o+Math.cos(y)*(a?a/2:k),r+Math.sin(y)*k);break;case!1:t.closePath();break}t.fill(),n.borderWidth>0&&t.stroke()}}function Ho(t,n,o){return o=o||.5,!n||t&&t.x>n.left-o&&t.x<n.right+o&&t.y>n.top-o&&t.y<n.bottom+o}function Dr(t,n){t.save(),t.beginPath(),t.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),t.clip()}function Nr(t){t.restore()}function qp(t,n,o,r,a){if(!n)return t.lineTo(o.x,o.y);if(a==="middle"){const s=(n.x+o.x)/2;t.lineTo(s,n.y),t.lineTo(s,o.y)}else a==="after"!=!!r?t.lineTo(n.x,o.y):t.lineTo(o.x,n.y);t.lineTo(o.x,o.y)}function Gp(t,n,o,r){if(!n)return t.lineTo(o.x,o.y);t.bezierCurveTo(r?n.cp1x:n.cp2x,r?n.cp1y:n.cp2y,r?o.cp2x:o.cp1x,r?o.cp2y:o.cp1y,o.x,o.y)}function Xp(t,n){n.translation&&t.translate(n.translation[0],n.translation[1]),He(n.rotation)||t.rotate(n.rotation),n.color&&(t.fillStyle=n.color),n.textAlign&&(t.textAlign=n.textAlign),n.textBaseline&&(t.textBaseline=n.textBaseline)}function Kp(t,n,o,r,a){if(a.strikethrough||a.underline){const s=t.measureText(r),i=n-s.actualBoundingBoxLeft,l=n+s.actualBoundingBoxRight,c=o-s.actualBoundingBoxAscent,d=o+s.actualBoundingBoxDescent,u=a.strikethrough?(c+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=a.decorationWidth||2,t.moveTo(i,u),t.lineTo(l,u),t.stroke()}}function Yp(t,n){const o=t.fillStyle;t.fillStyle=n.color,t.fillRect(n.left,n.top,n.width,n.height),t.fillStyle=o}function qo(t,n,o,r,a,s={}){const i=ht(n)?n:[n],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(t.save(),t.font=a.string,Xp(t,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&Yp(t,s.backdrop),l&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),He(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,o,r,s.maxWidth)),t.fillText(d,o,r,s.maxWidth),Kp(t,o,r,d,s),r+=Number(a.lineHeight);t.restore()}function Mr(t,n){const{x:o,y:r,w:a,h:s,radius:i}=n;t.arc(o+i.topLeft,r+i.topLeft,i.topLeft,1.5*Je,Je,!0),t.lineTo(o,r+s-i.bottomLeft),t.arc(o+i.bottomLeft,r+s-i.bottomLeft,i.bottomLeft,Je,gt,!0),t.lineTo(o+a-i.bottomRight,r+s),t.arc(o+a-i.bottomRight,r+s-i.bottomRight,i.bottomRight,gt,0,!0),t.lineTo(o+a,r+i.topRight),t.arc(o+a-i.topRight,r+i.topRight,i.topRight,0,-gt,!0),t.lineTo(o+i.topLeft,r)}const Jp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Qp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Zp(t,n){const o=(""+t).match(Jp);if(!o||o[1]==="normal")return n*1.2;switch(t=+o[2],o[3]){case"px":return t;case"%":t/=100;break}return n*t}const eg=t=>+t||0;function us(t,n){const o={},r=Re(n),a=r?Object.keys(n):n,s=Re(t)?r?i=>Oe(t[i],t[n[i]]):i=>t[i]:()=>t;for(const i of a)o[i]=eg(s(i));return o}function Gl(t){return us(t,{top:"y",right:"x",bottom:"y",left:"x"})}function uo(t){return us(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Wt(t){const n=Gl(t);return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function Et(t,n){t=t||{},n=n||dt.font;let o=Oe(t.size,n.size);typeof o=="string"&&(o=parseInt(o,10));let r=Oe(t.style,n.style);r&&!(""+r).match(Qp)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const a={family:Oe(t.family,n.family),lineHeight:Zp(Oe(t.lineHeight,n.lineHeight),o),size:o,style:r,weight:Oe(t.weight,n.weight),string:""};return a.string=Hp(a),a}function vr(t,n,o,r){let a,s,i;for(a=0,s=t.length;a<s;++a)if(i=t[a],i!==void 0&&i!==void 0)return i}function tg(t,n,o){const{min:r,max:a}=t,s=_l(n,(a-r)/2),i=(l,c)=>o&&l===0?0:l+c;return{min:i(r,-Math.abs(s)),max:i(a,s)}}function Kn(t,n){return Object.assign(Object.create(t),n)}function fs(t,n=[""],o,r,a=()=>t[0]){const s=o||t;typeof r>"u"&&(r=Ql("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:r,_getTarget:a,override:l=>fs([l,...t],n,s,r)};return new Proxy(i,{deleteProperty(l,c){return delete l[c],delete l._keys,delete t[0][c],!0},get(l,c){return Kl(l,c,()=>cg(c,n,t,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(l,c){return Zl(l).includes(c)},ownKeys(l){return Zl(l)},set(l,c,d){const u=l._storage||(l._storage=a());return l[c]=u[c]=d,delete l._keys,!0}})}function fo(t,n,o,r){const a={_cacheable:!1,_proxy:t,_context:n,_subProxy:o,_stack:new Set,_descriptors:Xl(t,r),setContext:s=>fo(t,s,o,r),override:s=>fo(t.override(s),n,o,r)};return new Proxy(a,{deleteProperty(s,i){return delete s[i],delete t[i],!0},get(s,i,l){return Kl(s,i,()=>og(s,i,l))},getOwnPropertyDescriptor(s,i){return s._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(s,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(s,i,l){return t[i]=l,delete s[i],!0}})}function Xl(t,n={scriptable:!0,indexable:!0}){const{_scriptable:o=n.scriptable,_indexable:r=n.indexable,_allKeys:a=n.allKeys}=t;return{allKeys:a,scriptable:o,indexable:r,isScriptable:Nn(o)?o:()=>o,isIndexable:Nn(r)?r:()=>r}}const ng=(t,n)=>t?t+ts(n):n,hs=(t,n)=>Re(n)&&t!=="adapters"&&(Object.getPrototypeOf(n)===null||n.constructor===Object);function Kl(t,n,o){if(Object.prototype.hasOwnProperty.call(t,n)||n==="constructor")return t[n];const r=o();return t[n]=r,r}function og(t,n,o){const{_proxy:r,_context:a,_subProxy:s,_descriptors:i}=t;let l=r[n];return Nn(l)&&i.isScriptable(n)&&(l=rg(n,l,t,o)),ht(l)&&l.length&&(l=ag(n,l,t,i.isIndexable)),hs(n,l)&&(l=fo(l,a,s&&s[n],i)),l}function rg(t,n,o,r){const{_proxy:a,_context:s,_subProxy:i,_stack:l}=o;if(l.has(t))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+t);l.add(t);let c=n(s,i||r);return l.delete(t),hs(t,c)&&(c=ms(a._scopes,a,t,c)),c}function ag(t,n,o,r){const{_proxy:a,_context:s,_subProxy:i,_descriptors:l}=o;if(typeof s.index<"u"&&r(t))return n[s.index%n.length];if(Re(n[0])){const c=n,d=a._scopes.filter(u=>u!==c);n=[];for(const u of c){const f=ms(d,a,t,u);n.push(fo(f,s,i&&i[t],l))}}return n}function Yl(t,n,o){return Nn(t)?t(n,o):t}const sg=(t,n)=>t===!0?n:typeof t=="string"?Un(n,t):void 0;function ig(t,n,o,r,a){for(const s of n){const i=sg(o,s);if(i){t.add(i);const l=Yl(i._fallback,o,a);if(typeof l<"u"&&l!==o&&l!==r)return l}else if(i===!1&&typeof r<"u"&&o!==r)return null}return!1}function ms(t,n,o,r){const a=n._rootScopes,s=Yl(n._fallback,o,r),i=[...t,...a],l=new Set;l.add(r);let c=Jl(l,i,o,s||o,r);return c===null||typeof s<"u"&&s!==o&&(c=Jl(l,i,s,c,r),c===null)?!1:fs(Array.from(l),[""],a,s,()=>lg(n,o,r))}function Jl(t,n,o,r,a){for(;o;)o=ig(t,n,o,r,a);return o}function lg(t,n,o){const r=t._getTarget();n in r||(r[n]={});const a=r[n];return ht(a)&&Re(o)?o:a||{}}function cg(t,n,o,r){let a;for(const s of n)if(a=Ql(ng(s,t),o),typeof a<"u")return hs(t,a)?ms(o,r,t,a):a}function Ql(t,n){for(const o of n){if(!o)continue;const r=o[t];if(typeof r<"u")return r}}function Zl(t){let n=t._keys;return n||(n=t._keys=dg(t._scopes)),n}function dg(t){const n=new Set;for(const o of t)for(const r of Object.keys(o).filter(a=>!a.startsWith("_")))n.add(r);return Array.from(n)}const ug=Number.EPSILON||1e-14,ho=(t,n)=>n<t.length&&!t[n].skip&&t[n],ec=t=>t==="x"?"y":"x";function fg(t,n,o,r){const a=t.skip?n:t,s=n,i=o.skip?n:o,l=ns(s,a),c=ns(i,s);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=r*d,h=r*u;return{previous:{x:s.x-f*(i.x-a.x),y:s.y-f*(i.y-a.y)},next:{x:s.x+h*(i.x-a.x),y:s.y+h*(i.y-a.y)}}}function hg(t,n,o){const r=t.length;let a,s,i,l,c,d=ho(t,0);for(let u=0;u<r-1;++u)if(c=d,d=ho(t,u+1),!(!c||!d)){if(Lo(n[u],0,ug)){o[u]=o[u+1]=0;continue}a=o[u]/n[u],s=o[u+1]/n[u],l=Math.pow(a,2)+Math.pow(s,2),!(l<=9)&&(i=3/Math.sqrt(l),o[u]=a*i*n[u],o[u+1]=s*i*n[u])}}function mg(t,n,o="x"){const r=ec(o),a=t.length;let s,i,l,c=ho(t,0);for(let d=0;d<a;++d){if(i=l,l=c,c=ho(t,d+1),!l)continue;const u=l[o],f=l[r];i&&(s=(u-i[o])/3,l[`cp1${o}`]=u-s,l[`cp1${r}`]=f-s*n[d]),c&&(s=(c[o]-u)/3,l[`cp2${o}`]=u+s,l[`cp2${r}`]=f+s*n[d])}}function pg(t,n="x"){const o=ec(n),r=t.length,a=Array(r).fill(0),s=Array(r);let i,l,c,d=ho(t,0);for(i=0;i<r;++i)if(l=c,c=d,d=ho(t,i+1),!!c){if(d){const u=d[n]-c[n];a[i]=u!==0?(d[o]-c[o])/u:0}s[i]=l?d?on(a[i-1])!==on(a[i])?0:(a[i-1]+a[i])/2:a[i-1]:a[i]}hg(t,a,s),mg(t,s,n)}function Pr(t,n,o){return Math.max(Math.min(t,o),n)}function gg(t,n){let o,r,a,s,i,l=Ho(t[0],n);for(o=0,r=t.length;o<r;++o)i=s,s=l,l=o<r-1&&Ho(t[o+1],n),s&&(a=t[o],i&&(a.cp1x=Pr(a.cp1x,n.left,n.right),a.cp1y=Pr(a.cp1y,n.top,n.bottom)),l&&(a.cp2x=Pr(a.cp2x,n.left,n.right),a.cp2y=Pr(a.cp2y,n.top,n.bottom)))}function bg(t,n,o,r,a){let s,i,l,c;if(n.spanGaps&&(t=t.filter(d=>!d.skip)),n.cubicInterpolationMode==="monotone")pg(t,a);else{let d=r?t[t.length-1]:t[0];for(s=0,i=t.length;s<i;++s)l=t[s],c=fg(d,l,t[Math.min(s+1,i-(r?0:1))%i],n.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}n.capBezierPoints&&gg(t,o)}function ps(){return typeof window<"u"&&typeof document<"u"}function gs(t){let n=t.parentNode;return n&&n.toString()==="[object ShadowRoot]"&&(n=n.host),n}function Tr(t,n,o){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*n.parentNode[o])):r=t,r}const Or=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function yg(t,n){return Or(t).getPropertyValue(n)}const xg=["top","right","bottom","left"];function Yn(t,n,o){const r={};o=o?"-"+o:"";for(let a=0;a<4;a++){const s=xg[a];r[s]=parseFloat(t[n+"-"+s+o])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const kg=(t,n,o)=>(t>0||n>0)&&(!o||!o.shadowRoot);function wg(t,n){const o=t.touches,r=o&&o.length?o[0]:t,{offsetX:a,offsetY:s}=r;let i=!1,l,c;if(kg(a,s,t.target))l=a,c=s;else{const d=n.getBoundingClientRect();l=r.clientX-d.left,c=r.clientY-d.top,i=!0}return{x:l,y:c,box:i}}function Jn(t,n){if("native"in t)return t;const{canvas:o,currentDevicePixelRatio:r}=n,a=Or(o),s=a.boxSizing==="border-box",i=Yn(a,"padding"),l=Yn(a,"border","width"),{x:c,y:d,box:u}=wg(t,o),f=i.left+(u&&l.left),h=i.top+(u&&l.top);let{width:m,height:g}=n;return s&&(m-=i.width+l.width,g-=i.height+l.height),{x:Math.round((c-f)/m*o.width/r),y:Math.round((d-h)/g*o.height/r)}}function Cg(t,n,o){let r,a;if(n===void 0||o===void 0){const s=t&&gs(t);if(!s)n=t.clientWidth,o=t.clientHeight;else{const i=s.getBoundingClientRect(),l=Or(s),c=Yn(l,"border","width"),d=Yn(l,"padding");n=i.width-d.width-c.width,o=i.height-d.height-c.height,r=Tr(l.maxWidth,s,"clientWidth"),a=Tr(l.maxHeight,s,"clientHeight")}}return{width:n,height:o,maxWidth:r||Vr,maxHeight:a||Vr}}const Mn=t=>Math.round(t*10)/10;function Eg(t,n,o,r){const a=Or(t),s=Yn(a,"margin"),i=Tr(a.maxWidth,t,"clientWidth")||Vr,l=Tr(a.maxHeight,t,"clientHeight")||Vr,c=Cg(t,n,o);let{width:d,height:u}=c;if(a.boxSizing==="content-box"){const h=Yn(a,"border","width"),m=Yn(a,"padding");d-=m.width+h.width,u-=m.height+h.height}return d=Math.max(0,d-s.width),u=Math.max(0,r?d/r:u-s.height),d=Mn(Math.min(d,i,c.maxWidth)),u=Mn(Math.min(u,l,c.maxHeight)),d&&!u&&(u=Mn(d/2)),(n!==void 0||o!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,d=Mn(Math.floor(u*r))),{width:d,height:u}}function tc(t,n,o){const r=n||1,a=Mn(t.height*r),s=Mn(t.width*r);t.height=Mn(t.height),t.width=Mn(t.width);const i=t.canvas;return i.style&&(o||!i.style.height&&!i.style.width)&&(i.style.height=`${t.height}px`,i.style.width=`${t.width}px`),t.currentDevicePixelRatio!==r||i.height!==a||i.width!==s?(t.currentDevicePixelRatio=r,i.height=a,i.width=s,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const Bg=(function(){let t=!1;try{const n={get passive(){return t=!0,!1}};ps()&&(window.addEventListener("test",null,n),window.removeEventListener("test",null,n))}catch{}return t})();function nc(t,n){const o=yg(t,n),r=o&&o.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Qn(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:t.y+o*(n.y-t.y)}}function _g(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:r==="middle"?o<.5?t.y:n.y:r==="after"?o<1?t.y:n.y:o>0?n.y:t.y}}function Sg(t,n,o,r){const a={x:t.cp2x,y:t.cp2y},s={x:n.cp1x,y:n.cp1y},i=Qn(t,a,o),l=Qn(a,s,o),c=Qn(s,n,o),d=Qn(i,l,o),u=Qn(l,c,o);return Qn(d,u,o)}const Vg=function(t,n){return{x(o){return t+t+n-o},setWidth(o){n=o},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,r){return o-r},leftForLtr(o,r){return o-r}}},Ag=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,n){return t+n},leftForLtr(t,n){return t}}};function mo(t,n,o){return t?Vg(n,o):Ag()}function oc(t,n){let o,r;(n==="ltr"||n==="rtl")&&(o=t.canvas.style,r=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",n,"important"),t.prevTextDirection=r)}function rc(t,n){n!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",n[0],n[1]))}function ac(t){return t==="angle"?{between:jo,compare:Vp,normalize:Ft}:{between:bn,compare:(n,o)=>n-o,normalize:n=>n}}function sc({start:t,end:n,count:o,loop:r,style:a}){return{start:t%o,end:n%o,loop:r&&(n-t+1)%o===0,style:a}}function Dg(t,n,o){const{property:r,start:a,end:s}=o,{between:i,normalize:l}=ac(r),c=n.length;let{start:d,end:u,loop:f}=t,h,m;if(f){for(d+=c,u+=c,h=0,m=c;h<m&&i(l(n[d%c][r]),a,s);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function ic(t,n,o){if(!o)return[t];const{property:r,start:a,end:s}=o,i=n.length,{compare:l,between:c,normalize:d}=ac(r),{start:u,end:f,loop:h,style:m}=Dg(t,n,o),g=[];let k=!1,y=null,p,E,_;const B=()=>c(a,_,p)&&l(a,_)!==0,S=()=>l(s,p)===0||c(s,_,p),w=()=>k||B(),x=()=>!k||S();for(let b=u,V=u;b<=f;++b)E=n[b%i],!E.skip&&(p=d(E[r]),p!==_&&(k=c(p,a,s),y===null&&w()&&(y=l(p,a)===0?b:V),y!==null&&x()&&(g.push(sc({start:y,end:b,loop:h,count:i,style:m})),y=null),V=b,_=p));return y!==null&&g.push(sc({start:y,end:f,loop:h,count:i,style:m})),g}function lc(t,n){const o=[],r=t.segments;for(let a=0;a<r.length;a++){const s=ic(r[a],t.points,n);s.length&&o.push(...s)}return o}function Ng(t,n,o,r){let a=0,s=n-1;if(o&&!r)for(;a<n&&!t[a].skip;)a++;for(;a<n&&t[a].skip;)a++;for(a%=n,o&&(s+=a);s>a&&t[s%n].skip;)s--;return s%=n,{start:a,end:s}}function Mg(t,n,o,r){const a=t.length,s=[];let i=n,l=t[n],c;for(c=n+1;c<=o;++c){const d=t[c%a];d.skip||d.stop?l.skip||(r=!1,s.push({start:n%a,end:(c-1)%a,loop:r}),n=i=d.stop?c:null):(i=c,l.skip&&(n=c)),l=d}return i!==null&&s.push({start:n%a,end:i%a,loop:r}),s}function vg(t,n){const o=t.points,r=t.options.spanGaps,a=o.length;if(!a)return[];const s=!!t._loop,{start:i,end:l}=Ng(o,a,s,r);if(r===!0)return cc(t,[{start:i,end:l,loop:s}],o,n);const c=l<i?l+a:l,d=!!t._fullLoop&&i===0&&l===a-1;return cc(t,Mg(o,i,c,d),o,n)}function cc(t,n,o,r){return!r||!r.setContext||!o?n:Pg(t,n,o,r)}function Pg(t,n,o,r){const a=t._chart.getContext(),s=dc(t.options),{_datasetIndex:i,options:{spanGaps:l}}=t,c=o.length,d=[];let u=s,f=n[0].start,h=f;function m(g,k,y,p){const E=l?-1:1;if(g!==k){for(g+=c;o[g%c].skip;)g-=E;for(;o[k%c].skip;)k+=E;g%c!==k%c&&(d.push({start:g%c,end:k%c,loop:y,style:p}),u=p,f=k%c)}}for(const g of n){f=l?f:g.start;let k=o[f%c],y;for(h=f+1;h<=g.end;h++){const p=o[h%c];y=dc(r.setContext(Kn(a,{type:"segment",p0:k,p1:p,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:i}))),Tg(y,u)&&m(f,h-1,g.loop,u),k=p,u=y}f<h-1&&m(f,h-1,g.loop,u)}return d}function dc(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Tg(t,n){if(!n)return!1;const o=[],r=function(a,s){return as(s)?(o.includes(s)||o.push(s),o.indexOf(s)):s};return JSON.stringify(t,r)!==JSON.stringify(n,r)}function Fr(t,n,o){return t.options.clip?t[o]:n[o]}function Og(t,n){const{xScale:o,yScale:r}=t;return o&&r?{left:Fr(o,n,"left"),right:Fr(o,n,"right"),top:Fr(r,n,"top"),bottom:Fr(r,n,"bottom")}:n}function uc(t,n){const o=n._clip;if(o.disabled)return!1;const r=Og(n,t.chartArea);return{left:o.left===!1?0:r.left-(o.left===!0?0:o.left),right:o.right===!1?t.width:r.right+(o.right===!0?0:o.right),top:o.top===!1?0:r.top-(o.top===!0?0:o.top),bottom:o.bottom===!1?t.height:r.bottom+(o.bottom===!0?0:o.bottom)}}/*!
12
12
  * Chart.js v4.5.1
13
13
  * https://www.chartjs.org
14
14
  * (c) 2025 Chart.js Contributors
15
15
  * Released under the MIT License
16
- */class Fg{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(n,o,r,a){const s=o.listeners[a],i=o.duration;s.forEach(l=>l({chart:n,initial:o.initial,numSteps:i,currentStep:Math.min(r-o.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=Tl.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(n=Date.now()){let o=0;this._charts.forEach((r,a)=>{if(!r.running||!r.items.length)return;const s=r.items;let i=s.length-1,l=!1,c;for(;i>=0;--i)c=s[i],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(n),l=!0):(s[i]=s[s.length-1],s.pop());l&&(a.draw(),this._notify(a,r,n,"progress")),s.length||(r.running=!1,this._notify(a,r,n,"complete"),r.initial=!1),o+=s.length}),this._lastDate=n,o===0&&(this._running=!1)}_getAnims(n){const o=this._charts;let r=o.get(n);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},o.set(n,r)),r}listen(n,o,r){this._getAnims(n).listeners[o].push(r)}add(n,o){!o||!o.length||this._getAnims(n).items.push(...o)}has(n){return this._getAnims(n).items.length>0}start(n){const o=this._charts.get(n);o&&(o.running=!0,o.start=Date.now(),o.duration=o.items.reduce((r,a)=>Math.max(r,a._duration),0),this._refresh())}running(n){if(!this._running)return!1;const o=this._charts.get(n);return!(!o||!o.running||!o.items.length)}stop(n){const o=this._charts.get(n);if(!o||!o.items.length)return;const r=o.items;let a=r.length-1;for(;a>=0;--a)r[a].cancel();o.items=[],this._notify(n,o,Date.now(),"complete")}remove(n){return this._charts.delete(n)}}var yn=new Fg;const cc="transparent",zg={boolean(t,n,o){return o>.5?n:t},color(t,n,o){const r=Il(t||cc),a=r.valid&&Il(n||cc);return a&&a.valid?a.mix(r,o).hexString():n},number(t,n,o){return t+(n-t)*o}};class Ig{constructor(n,o,r,a){const s=o[r];a=Nr([n.to,a,s,n.from]);const i=Nr([n.from,s,a]);this._active=!0,this._fn=n.fn||zg[n.type||typeof i],this._easing=Lo[n.easing]||Lo.linear,this._start=Math.floor(Date.now()+(n.delay||0)),this._duration=this._total=Math.floor(n.duration),this._loop=!!n.loop,this._target=o,this._prop=r,this._from=i,this._to=a,this._promises=void 0}active(){return this._active}update(n,o,r){if(this._active){this._notify(!1);const a=this._target[this._prop],s=r-this._start,i=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(i,n.duration)),this._total+=s,this._loop=!!n.loop,this._to=Nr([n.to,o,a,n.from]),this._from=Nr([n.from,a,o])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(n){const o=n-this._start,r=this._duration,a=this._prop,s=this._from,i=this._loop,l=this._to;let c;if(this._active=s!==l&&(i||o<r),!this._active){this._target[a]=l,this._notify(!0);return}if(o<0){this._target[a]=s;return}c=o/r%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[a]=this._fn(s,l,c)}wait(){const n=this._promises||(this._promises=[]);return new Promise((o,r)=>{n.push({res:o,rej:r})})}_notify(n){const o=n?"res":"rej",r=this._promises||[];for(let a=0;a<r.length;a++)r[a][o]()}}class dc{constructor(n,o){this._chart=n,this._properties=new Map,this.configure(o)}configure(n){if(!Ue(n))return;const o=Object.keys(pt.animation),r=this._properties;Object.getOwnPropertyNames(n).forEach(a=>{const s=n[a];if(!Ue(s))return;const i={};for(const l of o)i[l]=s[l];(gt(s.properties)&&s.properties||[a]).forEach(l=>{(l===a||!r.has(l))&&r.set(l,i)})})}_animateOptions(n,o){const r=o.options,a=Lg(n,r);if(!a)return[];const s=this._createAnimations(a,r);return r.$shared&&Rg(n.options.$animations,r).then(()=>{n.options=r},()=>{}),s}_createAnimations(n,o){const r=this._properties,a=[],s=n.$animations||(n.$animations={}),i=Object.keys(o),l=Date.now();let c;for(c=i.length-1;c>=0;--c){const d=i[c];if(d.charAt(0)==="$")continue;if(d==="options"){a.push(...this._animateOptions(n,o));continue}const u=o[d];let h=s[d];const f=r.get(d);if(h)if(f&&h.active()){h.update(f,u,l);continue}else h.cancel();if(!f||!f.duration){n[d]=u;continue}s[d]=h=new Ig(f,n,d,u),a.push(h)}return a}update(n,o){if(this._properties.size===0){Object.assign(n,o);return}const r=this._createAnimations(n,o);if(r.length)return yn.add(this._chart,r),!0}}function Rg(t,n){const o=[],r=Object.keys(n);for(let a=0;a<r.length;a++){const s=t[r[a]];s&&s.active()&&o.push(s.wait())}return Promise.all(o)}function Lg(t,n){if(!n)return;let o=t.options;if(!o){t.options=n;return}return o.$shared&&(t.options=o=Object.assign({},o,{$shared:!1,$animations:{}})),o}function uc(t,n){const o=t&&t.options||{},r=o.reverse,a=o.min===void 0?n:0,s=o.max===void 0?n:0;return{start:r?s:a,end:r?a:s}}function $g(t,n,o){if(o===!1)return!1;const r=uc(t,o),a=uc(n,o);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}function jg(t){let n,o,r,a;return Ue(t)?(n=t.top,o=t.right,r=t.bottom,a=t.left):n=o=r=a=t,{top:n,right:o,bottom:r,left:a,disabled:t===!1}}function fc(t,n){const o=[],r=t._getSortedDatasetMetas(n);let a,s;for(a=0,s=r.length;a<s;++a)o.push(r[a].index);return o}function hc(t,n,o,r={}){const a=t.keys,s=r.mode==="single";let i,l,c,d;if(n===null)return;let u=!1;for(i=0,l=a.length;i<l;++i){if(c=+a[i],c===o){if(u=!0,r.all)continue;break}d=t.values[c],Et(d)&&(s||n===0||tn(n)===tn(d))&&(n+=d)}return!u&&!r.all?0:n}function Wg(t,n){const{iScale:o,vScale:r}=n,a=o.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",i=Object.keys(t),l=new Array(i.length);let c,d,u;for(c=0,d=i.length;c<d;++c)u=i[c],l[c]={[a]:u,[s]:t[u]};return l}function hs(t,n){const o=t&&t.options.stacked;return o||o===void 0&&n.stack!==void 0}function Ug(t,n,o){return`${t.id}.${n.id}.${o.stack||o.type}`}function Hg(t){const{min:n,max:o,minDefined:r,maxDefined:a}=t.getUserBounds();return{min:r?n:Number.NEGATIVE_INFINITY,max:a?o:Number.POSITIVE_INFINITY}}function qg(t,n,o){const r=t[n]||(t[n]={});return r[o]||(r[o]={})}function mc(t,n,o,r){for(const a of n.getMatchingVisibleMetas(r).reverse()){const s=t[a.index];if(o&&s>0||!o&&s<0)return a.index}return null}function pc(t,n){const{chart:o,_cachedMeta:r}=t,a=o._stacks||(o._stacks={}),{iScale:s,vScale:i,index:l}=r,c=s.axis,d=i.axis,u=Ug(s,i,r),h=n.length;let f;for(let m=0;m<h;++m){const g=n[m],{[c]:b,[d]:x}=g,p=g._stacks||(g._stacks={});f=p[d]=qg(a,u,b),f[l]=x,f._top=mc(f,i,!0,r.type),f._bottom=mc(f,i,!1,r.type);const C=f._visualValues||(f._visualValues={});C[l]=x}}function ms(t,n){const o=t.scales;return Object.keys(o).filter(r=>o[r].axis===n).shift()}function Gg(t,n){return Xn(t,{active:!1,dataset:void 0,datasetIndex:n,index:n,mode:"default",type:"dataset"})}function Xg(t,n,o){return Xn(t,{active:!1,dataIndex:n,parsed:void 0,raw:void 0,element:o,index:n,mode:"default",type:"data"})}function Uo(t,n){const o=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){n=n||t._parsed;for(const a of n){const s=a._stacks;if(!s||s[r]===void 0||s[r][o]===void 0)return;delete s[r][o],s[r]._visualValues!==void 0&&s[r]._visualValues[o]!==void 0&&delete s[r]._visualValues[o]}}}const ps=t=>t==="reset"||t==="none",gc=(t,n)=>n?t:Object.assign({},t),Kg=(t,n,o)=>t&&!n.hidden&&n._stacked&&{keys:fc(o,!0),values:null};class Qn{constructor(n,o){this.chart=n,this._ctx=n.ctx,this.index=o,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const n=this._cachedMeta;this.configure(),this.linkScales(),n._stacked=hs(n.vScale,n),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(n){this.index!==n&&Uo(this._cachedMeta),this.index=n}linkScales(){const n=this.chart,o=this._cachedMeta,r=this.getDataset(),a=(h,f,m,g)=>h==="x"?f:h==="r"?g:m,s=o.xAxisID=Re(r.xAxisID,ms(n,"x")),i=o.yAxisID=Re(r.yAxisID,ms(n,"y")),l=o.rAxisID=Re(r.rAxisID,ms(n,"r")),c=o.indexAxis,d=o.iAxisID=a(c,s,i,l),u=o.vAxisID=a(c,i,s,l);o.xScale=this.getScaleForId(s),o.yScale=this.getScaleForId(i),o.rScale=this.getScaleForId(l),o.iScale=this.getScaleForId(d),o.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(n){return this.chart.scales[n]}_getOtherScale(n){const o=this._cachedMeta;return n===o.iScale?o.vScale:o.iScale}reset(){this._update("reset")}_destroy(){const n=this._cachedMeta;this._data&&vl(this._data,this),n._stacked&&Uo(n)}_dataCheck(){const n=this.getDataset(),o=n.data||(n.data=[]),r=this._data;if(Ue(o)){const a=this._cachedMeta;this._data=Wg(o,a)}else if(r!==o){if(r){vl(r,this);const a=this._cachedMeta;Uo(a),a._parsed=[]}o&&Object.isExtensible(o)&&Mp(o,this),this._syncList=[],this._data=o}}addElements(){const n=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(n.dataset=new this.datasetElementType)}buildOrUpdateElements(n){const o=this._cachedMeta,r=this.getDataset();let a=!1;this._dataCheck();const s=o._stacked;o._stacked=hs(o.vScale,o),o.stack!==r.stack&&(a=!0,Uo(o),o.stack=r.stack),this._resyncElements(n),(a||s!==o._stacked)&&(pc(this,o._parsed),o._stacked=hs(o.vScale,o))}configure(){const n=this.chart.config,o=n.datasetScopeKeys(this._type),r=n.getOptionScopes(this.getDataset(),o,!0);this.options=n.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(n,o){const{_cachedMeta:r,_data:a}=this,{iScale:s,_stacked:i}=r,l=s.axis;let c=n===0&&o===a.length?!0:r._sorted,d=n>0&&r._parsed[n-1],u,h,f;if(this._parsing===!1)r._parsed=a,r._sorted=!0,f=a;else{gt(a[n])?f=this.parseArrayData(r,a,n,o):Ue(a[n])?f=this.parseObjectData(r,a,n,o):f=this.parsePrimitiveData(r,a,n,o);const m=()=>h[l]===null||d&&h[l]<d[l];for(u=0;u<o;++u)r._parsed[u+n]=h=f[u],c&&(m()&&(c=!1),d=h);r._sorted=c}i&&pc(this,f)}parsePrimitiveData(n,o,r,a){const{iScale:s,vScale:i}=n,l=s.axis,c=i.axis,d=s.getLabels(),u=s===i,h=new Array(a);let f,m,g;for(f=0,m=a;f<m;++f)g=f+r,h[f]={[l]:u||s.parse(d[g],g),[c]:i.parse(o[g],g)};return h}parseArrayData(n,o,r,a){const{xScale:s,yScale:i}=n,l=new Array(a);let c,d,u,h;for(c=0,d=a;c<d;++c)u=c+r,h=o[u],l[c]={x:s.parse(h[0],u),y:i.parse(h[1],u)};return l}parseObjectData(n,o,r,a){const{xScale:s,yScale:i}=n,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(a);let u,h,f,m;for(u=0,h=a;u<h;++u)f=u+r,m=o[f],d[u]={x:s.parse(Wn(m,l),f),y:i.parse(Wn(m,c),f)};return d}getParsed(n){return this._cachedMeta._parsed[n]}getDataElement(n){return this._cachedMeta.data[n]}applyStack(n,o,r){const a=this.chart,s=this._cachedMeta,i=o[n.axis],l={keys:fc(a,!0),values:o._stacks[n.axis]._visualValues};return hc(l,i,s.index,{mode:r})}updateRangeFromParsed(n,o,r,a){const s=r[o.axis];let i=s===null?NaN:s;const l=a&&r._stacks[o.axis];a&&l&&(a.values=l,i=hc(a,s,this._cachedMeta.index)),n.min=Math.min(n.min,i),n.max=Math.max(n.max,i)}getMinMax(n,o){const r=this._cachedMeta,a=r._parsed,s=r._sorted&&n===r.iScale,i=a.length,l=this._getOtherScale(n),c=Kg(o,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=Hg(l);let f,m;function g(){m=a[f];const b=m[l.axis];return!Et(m[n.axis])||u>b||h<b}for(f=0;f<i&&!(!g()&&(this.updateRangeFromParsed(d,n,m,c),s));++f);if(s){for(f=i-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(d,n,m,c);break}}return d}getAllParsedValues(n){const o=this._cachedMeta._parsed,r=[];let a,s,i;for(a=0,s=o.length;a<s;++a)i=o[a][n.axis],Et(i)&&r.push(i);return r}getMaxOverflow(){return!1}getLabelAndValue(n){const o=this._cachedMeta,r=o.iScale,a=o.vScale,s=this.getParsed(n);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:a?""+a.getLabelForValue(s[a.axis]):""}}_update(n){const o=this._cachedMeta;this.update(n||"default"),o._clip=jg(Re(this.options.clip,$g(o.xScale,o.yScale,this.getMaxOverflow())))}update(n){}draw(){const n=this._ctx,o=this.chart,r=this._cachedMeta,a=r.data||[],s=o.chartArea,i=[],l=this._drawStart||0,c=this._drawCount||a.length-l,d=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(n,s,l,c),u=l;u<l+c;++u){const h=a[u];h.hidden||(h.active&&d?i.push(h):h.draw(n,s))}for(u=0;u<i.length;++u)i[u].draw(n,s)}getStyle(n,o){const r=o?"active":"default";return n===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(n||0,r)}getContext(n,o,r){const a=this.getDataset();let s;if(n>=0&&n<this._cachedMeta.data.length){const i=this._cachedMeta.data[n];s=i.$context||(i.$context=Xg(this.getContext(),n,i)),s.parsed=this.getParsed(n),s.raw=a.data[n],s.index=s.dataIndex=n}else s=this.$context||(this.$context=Gg(this.chart.getContext(),this.index)),s.dataset=a,s.index=s.datasetIndex=this.index;return s.active=!!o,s.mode=r,s}resolveDatasetElementOptions(n){return this._resolveElementOptions(this.datasetElementType.id,n)}resolveDataElementOptions(n,o){return this._resolveElementOptions(this.dataElementType.id,o,n)}_resolveElementOptions(n,o="default",r){const a=o==="active",s=this._cachedDataOpts,i=n+"-"+o,l=s[i],c=this.enableOptionSharing&&Fo(r);if(l)return gc(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,n),h=a?[`${n}Hover`,"hover",n,""]:[n,""],f=d.getOptionScopes(this.getDataset(),u),m=Object.keys(pt.elements[n]),g=()=>this.getContext(r,a,o),b=d.resolveNamedOptions(f,m,g,h);return b.$shared&&(b.$shared=c,s[i]=Object.freeze(gc(b,c))),b}_resolveAnimations(n,o,r){const a=this.chart,s=this._cachedDataOpts,i=`animation-${o}`,l=s[i];if(l)return l;let c;if(a.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,o),f=u.getOptionScopes(this.getDataset(),h);c=u.createResolver(f,this.getContext(n,r,o))}const d=new dc(a,c&&c.animations);return c&&c._cacheable&&(s[i]=Object.freeze(d)),d}getSharedOptions(n){if(n.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},n))}includeOptions(n,o){return!o||ps(n)||this.chart._animationsDisabled}_getSharedOptions(n,o){const r=this.resolveDataElementOptions(n,o),a=this._sharedOptions,s=this.getSharedOptions(r),i=this.includeOptions(o,s)||s!==a;return this.updateSharedOptions(s,o,r),{sharedOptions:s,includeOptions:i}}updateElement(n,o,r,a){ps(a)?Object.assign(n,r):this._resolveAnimations(o,a).update(n,r)}updateSharedOptions(n,o,r){n&&!ps(o)&&this._resolveAnimations(void 0,o).update(n,r)}_setStyle(n,o,r,a){n.active=a;const s=this.getStyle(o,a);this._resolveAnimations(o,r,a).update(n,{options:!a&&this.getSharedOptions(s)||s})}removeHoverStyle(n,o,r){this._setStyle(n,r,"active",!1)}setHoverStyle(n,o,r){this._setStyle(n,r,"active",!0)}_removeDatasetHoverStyle(){const n=this._cachedMeta.dataset;n&&this._setStyle(n,void 0,"active",!1)}_setDatasetHoverStyle(){const n=this._cachedMeta.dataset;n&&this._setStyle(n,void 0,"active",!0)}_resyncElements(n){const o=this._data,r=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const a=r.length,s=o.length,i=Math.min(s,a);i&&this.parse(0,i),s>a?this._insertElements(a,s-a,n):s<a&&this._removeElements(s,a-s)}_insertElements(n,o,r=!0){const a=this._cachedMeta,s=a.data,i=n+o;let l;const c=d=>{for(d.length+=o,l=d.length-1;l>=i;l--)d[l]=d[l-o]};for(c(s),l=n;l<i;++l)s[l]=new this.dataElementType;this._parsing&&c(a._parsed),this.parse(n,o),r&&this.updateElements(s,n,o,"reset")}updateElements(n,o,r,a){}_removeElements(n,o){const r=this._cachedMeta;if(this._parsing){const a=r._parsed.splice(n,o);r._stacked&&Uo(r,a)}r.data.splice(n,o)}_sync(n){if(this._parsing)this._syncList.push(n);else{const[o,r,a]=n;this[o](r,a)}this.chart._dataChanges.push([this.index,...n])}_onDataPush(){const n=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-n,n])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(n,o){o&&this._sync(["_removeElements",n,o]);const r=arguments.length-2;r&&this._sync(["_insertElements",n,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}_e(Qn,"defaults",{}),_e(Qn,"datasetElementType",null),_e(Qn,"dataElementType",null);function Yg(t,n){if(!t._cache.$bar){const o=t.getMatchingVisibleMetas(n);let r=[];for(let a=0,s=o.length;a<s;a++)r=r.concat(o[a].controller.getAllParsedValues(t));t._cache.$bar=Pl(r.sort((a,s)=>a-s))}return t._cache.$bar}function Jg(t){const n=t.iScale,o=Yg(n,t.type);let r=n._length,a,s,i,l;const c=()=>{i===32767||i===-32768||(Fo(l)&&(r=Math.min(r,Math.abs(i-l)||r)),l=i)};for(a=0,s=o.length;a<s;++a)i=n.getPixelForValue(o[a]),c();for(l=void 0,a=0,s=n.ticks.length;a<s;++a)i=n.getPixelForTick(a),c();return r}function Qg(t,n,o,r){const a=o.barThickness;let s,i;return Je(a)?(s=n.min*o.categoryPercentage,i=o.barPercentage):(s=a*r,i=1),{chunk:s/r,ratio:i,start:n.pixels[t]-s/2}}function Zg(t,n,o,r){const a=n.pixels,s=a[t];let i=t>0?a[t-1]:null,l=t<a.length-1?a[t+1]:null;const c=o.categoryPercentage;i===null&&(i=s-(l===null?n.end-n.start:l-s)),l===null&&(l=s+s-i);const d=s-(s-Math.min(i,l))/2*c;return{chunk:Math.abs(l-i)/2*c/r,ratio:o.barPercentage,start:d}}function e0(t,n,o,r){const a=o.parse(t[0],r),s=o.parse(t[1],r),i=Math.min(a,s),l=Math.max(a,s);let c=i,d=l;Math.abs(i)>Math.abs(l)&&(c=l,d=i),n[o.axis]=d,n._custom={barStart:c,barEnd:d,start:a,end:s,min:i,max:l}}function bc(t,n,o,r){return gt(t)?e0(t,n,o,r):n[o.axis]=o.parse(t,r),n}function yc(t,n,o,r){const a=t.iScale,s=t.vScale,i=a.getLabels(),l=a===s,c=[];let d,u,h,f;for(d=o,u=o+r;d<u;++d)f=n[d],h={},h[a.axis]=l||a.parse(i[d],d),c.push(bc(f,h,s,d));return c}function gs(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function t0(t,n,o){return t!==0?tn(t):(n.isHorizontal()?1:-1)*(n.min>=o?1:-1)}function n0(t){let n,o,r,a,s;return t.horizontal?(n=t.base>t.x,o="left",r="right"):(n=t.base<t.y,o="bottom",r="top"),n?(a="end",s="start"):(a="start",s="end"),{start:o,end:r,reverse:n,top:a,bottom:s}}function o0(t,n,o,r){let a=n.borderSkipped;const s={};if(!a){t.borderSkipped=s;return}if(a===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:l,reverse:c,top:d,bottom:u}=n0(t);a==="middle"&&o&&(t.enableBorderRadius=!0,(o._top||0)===r?a=d:(o._bottom||0)===r?a=u:(s[xc(u,i,l,c)]=!0,a=d)),s[xc(a,i,l,c)]=!0,t.borderSkipped=s}function xc(t,n,o,r){return r?(t=r0(t,n,o),t=kc(t,o,n)):t=kc(t,n,o),t}function r0(t,n,o){return t===n?o:t===o?n:t}function kc(t,n,o){return t==="start"?n:t==="end"?o:t}function a0(t,{inflateAmount:n},o){t.inflateAmount=n==="auto"?o===1?.33:0:n}class Or extends Qn{parsePrimitiveData(n,o,r,a){return yc(n,o,r,a)}parseArrayData(n,o,r,a){return yc(n,o,r,a)}parseObjectData(n,o,r,a){const{iScale:s,vScale:i}=n,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?l:c,u=i.axis==="x"?l:c,h=[];let f,m,g,b;for(f=r,m=r+a;f<m;++f)b=o[f],g={},g[s.axis]=s.parse(Wn(b,d),f),h.push(bc(Wn(b,u),g,i,f));return h}updateRangeFromParsed(n,o,r,a){super.updateRangeFromParsed(n,o,r,a);const s=r._custom;s&&o===this._cachedMeta.vScale&&(n.min=Math.min(n.min,s.min),n.max=Math.max(n.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(n){const o=this._cachedMeta,{iScale:r,vScale:a}=o,s=this.getParsed(n),i=s._custom,l=gs(i)?"["+i.start+", "+i.end+"]":""+a.getLabelForValue(s[a.axis]);return{label:""+r.getLabelForValue(s[r.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const n=this._cachedMeta;n.stack=this.getDataset().stack}update(n){const o=this._cachedMeta;this.updateElements(o.data,0,o.data.length,n)}updateElements(n,o,r,a){const s=a==="reset",{index:i,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(o,a);for(let m=o;m<o+r;m++){const g=this.getParsed(m),b=s||Je(g[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),x=this._calculateBarIndexPixels(m,u),p=(g._stacks||{})[l.axis],C={horizontal:d,base:b.base,enableBorderRadius:!p||gs(g._custom)||i===p._top||i===p._bottom,x:d?b.head:x.center,y:d?x.center:b.head,height:d?x.size:Math.abs(b.size),width:d?Math.abs(b.size):x.size};f&&(C.options=h||this.resolveDataElementOptions(m,n[m].active?"active":a));const w=C.options||n[m].options;o0(C,w,p,i),a0(C,w,u.ratio),this.updateElement(n[m],m,C,a)}}_getStacks(n,o){const{iScale:r}=this._cachedMeta,a=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=r.options.stacked,i=[],l=this._cachedMeta.controller.getParsed(o),c=l&&l[r.axis],d=u=>{const h=u._parsed.find(m=>m[r.axis]===c),f=h&&h[u.vScale.axis];if(Je(f)||isNaN(f))return!0};for(const u of a)if(!(o!==void 0&&d(u))&&((s===!1||i.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&i.push(u.stack),u.index===n))break;return i.length||i.push(void 0),i}_getStackCount(n){return this._getStacks(void 0,n).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const n=this.chart.scales,o=this.chart.options.indexAxis;return Object.keys(n).filter(r=>n[r].axis===o).shift()}_getAxis(){const n={},o=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)n[Re(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,o)]=!0;return Object.keys(n)}_getStackIndex(n,o,r){const a=this._getStacks(n,r),s=o!==void 0?a.indexOf(o):-1;return s===-1?a.length-1:s}_getRuler(){const n=this.options,o=this._cachedMeta,r=o.iScale,a=[];let s,i;for(s=0,i=o.data.length;s<i;++s)a.push(r.getPixelForValue(this.getParsed(s)[r.axis],s));const l=n.barThickness;return{min:l||Jg(o),pixels:a,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:n.grouped,ratio:l?1:n.categoryPercentage*n.barPercentage}}_calculateBarValuePixels(n){const{_cachedMeta:{vScale:o,_stacked:r,index:a},options:{base:s,minBarLength:i}}=this,l=s||0,c=this.getParsed(n),d=c._custom,u=gs(d);let h=c[o.axis],f=0,m=r?this.applyStack(o,c,r):h,g,b;m!==h&&(f=m-h,m=h),u&&(h=d.barStart,m=d.barEnd-d.barStart,h!==0&&tn(h)!==tn(d.barEnd)&&(f=0),f+=h);const x=!Je(s)&&!u?s:f;let p=o.getPixelForValue(x);if(this.chart.getDataVisibility(n)?g=o.getPixelForValue(f+m):g=p,b=g-p,Math.abs(b)<i){b=t0(b,o,l)*i,h===l&&(p-=b/2);const C=o.getPixelForDecimal(0),w=o.getPixelForDecimal(1),E=Math.min(C,w),_=Math.max(C,w);p=Math.max(Math.min(p,_),E),g=p+b,r&&!u&&(c._stacks[o.axis]._visualValues[a]=o.getValueForPixel(g)-o.getValueForPixel(p))}if(p===o.getPixelForValue(l)){const C=tn(b)*o.getLineWidthForValue(l)/2;p+=C,b-=C}return{size:b,base:p,head:g,center:g+b/2}}_calculateBarIndexPixels(n,o){const r=o.scale,a=this.options,s=a.skipNull,i=Re(a.maxBarThickness,1/0);let l,c;const d=this._getAxisCount();if(o.grouped){const u=s?this._getStackCount(n):o.stackCount,h=a.barThickness==="flex"?Zg(n,o,a,u*d):Qg(n,o,a,u*d),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(Re(f,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,s?n:void 0)+m;l=h.start+h.chunk*g+h.chunk/2,c=Math.min(i,h.chunk*h.ratio)}else l=r.getPixelForValue(this.getParsed(n)[r.axis],n),c=Math.min(i,o.min*o.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const n=this._cachedMeta,o=n.vScale,r=n.data,a=r.length;let s=0;for(;s<a;++s)this.getParsed(s)[o.axis]!==null&&!r[s].hidden&&r[s].draw(this._ctx)}}_e(Or,"id","bar"),_e(Or,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),_e(Or,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function s0(t,n,o){let r=1,a=1,s=0,i=0;if(n<dt){const l=t,c=l+n,d=Math.cos(l),u=Math.sin(l),h=Math.cos(c),f=Math.sin(c),m=(w,E,_)=>Ro(w,l,c,!0)?1:Math.max(E,E*o,_,_*o),g=(w,E,_)=>Ro(w,l,c,!0)?-1:Math.min(E,E*o,_,_*o),b=m(0,d,h),x=m(kt,u,f),p=g(ot,d,h),C=g(ot+kt,u,f);r=(b-p)/2,a=(x-C)/2,s=-(b+p)/2,i=-(x+C)/2}return{ratioX:r,ratioY:a,offsetX:s,offsetY:i}}class ho extends Qn{constructor(n,o){super(n,o),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(n,o){const r=this.getDataset().data,a=this._cachedMeta;if(this._parsing===!1)a._parsed=r;else{let s=c=>+r[c];if(Ue(r[n])){const{key:c="value"}=this._parsing;s=d=>+Wn(r[d],c)}let i,l;for(i=n,l=n+o;i<l;++i)a._parsed[i]=s(i)}}_getRotation(){return gn(this.options.rotation-90)}_getCircumference(){return gn(this.options.circumference)}_getRotationExtents(){let n=dt,o=-dt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const a=this.chart.getDatasetMeta(r).controller,s=a._getRotation(),i=a._getCircumference();n=Math.min(n,s),o=Math.max(o,s+i)}return{rotation:n,circumference:o-n}}update(n){const o=this.chart,{chartArea:r}=o,a=this._cachedMeta,s=a.data,i=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(r.width,r.height)-i)/2,0),c=Math.min(mp(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:g,offsetY:b}=s0(h,u,c),x=(r.width-i)/f,p=(r.height-i)/m,C=Math.max(Math.min(x,p)/2,0),w=Cl(this.options.radius,C),E=Math.max(w*c,0),_=(w-E)/this._getVisibleDatasetWeightTotal();this.offsetX=g*w,this.offsetY=b*w,a.total=this.calculateTotal(),this.outerRadius=w-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*d,0),this.updateElements(s,0,s.length,n)}_circumference(n,o){const r=this.options,a=this._cachedMeta,s=this._getCircumference();return o&&r.animation.animateRotate||!this.chart.getDataVisibility(n)||a._parsed[n]===null||a.data[n].hidden?0:this.calculateCircumference(a._parsed[n]*s/dt)}updateElements(n,o,r,a){const s=a==="reset",i=this.chart,l=i.chartArea,d=i.options.animation,u=(l.left+l.right)/2,h=(l.top+l.bottom)/2,f=s&&d.animateScale,m=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:b,includeOptions:x}=this._getSharedOptions(o,a);let p=this._getRotation(),C;for(C=0;C<o;++C)p+=this._circumference(C,s);for(C=o;C<o+r;++C){const w=this._circumference(C,s),E=n[C],_={x:u+this.offsetX,y:h+this.offsetY,startAngle:p,endAngle:p+w,circumference:w,outerRadius:g,innerRadius:m};x&&(_.options=b||this.resolveDataElementOptions(C,E.active?"active":a)),p+=w,this.updateElement(E,C,_,a)}}calculateTotal(){const n=this._cachedMeta,o=n.data;let r=0,a;for(a=0;a<o.length;a++){const s=n._parsed[a];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(a)&&!o[a].hidden&&(r+=Math.abs(s))}return r}calculateCircumference(n){const o=this._cachedMeta.total;return o>0&&!isNaN(n)?dt*(Math.abs(n)/o):0}getLabelAndValue(n){const o=this._cachedMeta,r=this.chart,a=r.data.labels||[],s=os(o._parsed[n],r.options.locale);return{label:a[n]||"",value:s}}getMaxBorderWidth(n){let o=0;const r=this.chart;let a,s,i,l,c;if(!n){for(a=0,s=r.data.datasets.length;a<s;++a)if(r.isDatasetVisible(a)){i=r.getDatasetMeta(a),n=i.data,l=i.controller;break}}if(!n)return 0;for(a=0,s=n.length;a<s;++a)c=l.resolveDataElementOptions(a),c.borderAlign!=="inner"&&(o=Math.max(o,c.borderWidth||0,c.hoverBorderWidth||0));return o}getMaxOffset(n){let o=0;for(let r=0,a=n.length;r<a;++r){const s=this.resolveDataElementOptions(r);o=Math.max(o,s.offset||0,s.hoverOffset||0)}return o}_getRingWeightOffset(n){let o=0;for(let r=0;r<n;++r)this.chart.isDatasetVisible(r)&&(o+=this._getRingWeight(r));return o}_getRingWeight(n){return Math.max(Re(this.chart.data.datasets[n].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}_e(ho,"id","doughnut"),_e(ho,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),_e(ho,"descriptors",{_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"&&!n.startsWith("borderDash")&&!n.startsWith("hoverBorderDash")}),_e(ho,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const o=n.data,{labels:{pointStyle:r,textAlign:a,color:s,useBorderRadius:i,borderRadius:l}}=n.legend.options;return o.labels.length&&o.datasets.length?o.labels.map((c,d)=>{const h=n.getDatasetMeta(0).controller.getStyle(d);return{text:c,fillStyle:h.backgroundColor,fontColor:s,hidden:!n.getDataVisibility(d),lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:h.borderWidth,strokeStyle:h.borderColor,textAlign:a,pointStyle:r,borderRadius:i&&(l||h.borderRadius),index:d}}):[]}},onClick(n,o,r){r.chart.toggleDataVisibility(o.index),r.chart.update()}}}});class Fr extends Qn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(n){const o=this._cachedMeta,{dataset:r,data:a=[],_dataset:s}=o,i=this.chart._animationsDisabled;let{start:l,count:c}=Tp(o,a,i);this._drawStart=l,this._drawCount=c,Op(o)&&(l=0,c=a.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=a;const d=this.resolveDatasetElementOptions(n);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(r,void 0,{animated:!i,options:d},n),this.updateElements(a,l,c,n)}updateElements(n,o,r,a){const s=a==="reset",{iScale:i,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(o,a),f=i.axis,m=l.axis,{spanGaps:g,segment:b}=this.options,x=Io(g)?g:Number.POSITIVE_INFINITY,p=this.chart._animationsDisabled||s||a==="none",C=o+r,w=n.length;let E=o>0&&this.getParsed(o-1);for(let _=0;_<w;++_){const B=n[_],k=p?B:{};if(_<o||_>=C){k.skip=!0;continue}const y=this.getParsed(_),V=Je(y[m]),D=k[f]=i.getPixelForValue(y[f],_),N=k[m]=s||V?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,y,c):y[m],_);k.skip=isNaN(D)||isNaN(N)||V,k.stop=_>0&&Math.abs(y[f]-E[f])>x,b&&(k.parsed=y,k.raw=d.data[_]),h&&(k.options=u||this.resolveDataElementOptions(_,B.active?"active":a)),p||this.updateElement(B,_,k,a),E=y}}getMaxOverflow(){const n=this._cachedMeta,o=n.dataset,r=o.options&&o.options.borderWidth||0,a=n.data||[];if(!a.length)return r;const s=a[0].size(this.resolveDataElementOptions(0)),i=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(r,s,i)/2}draw(){const n=this._cachedMeta;n.dataset.updateControlPoints(this.chart.chartArea,n.iScale.axis),super.draw()}}_e(Fr,"id","line"),_e(Fr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),_e(Fr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class bs extends ho{}_e(bs,"id","pie"),_e(bs,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function Zn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ys{constructor(n){_e(this,"options");this.options=n||{}}static override(n){Object.assign(ys.prototype,n)}init(){}formats(){return Zn()}parse(){return Zn()}format(){return Zn()}add(){return Zn()}diff(){return Zn()}startOf(){return Zn()}endOf(){return Zn()}}var i0={_date:ys};function l0(t,n,o,r){const{controller:a,data:s,_sorted:i}=t,l=a._cachedMeta.iScale,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(l&&n===l.axis&&n!=="r"&&i&&s.length){const d=l._reversePixels?Dp:Hn;if(r){if(a._sharedOptions){const u=s[0],h=typeof u.getRange=="function"&&u.getRange(n);if(h){const f=d(s,n,o-h),m=d(s,n,o+h);return{lo:f.lo,hi:m.hi}}}}else{const u=d(s,n,o);if(c){const{vScale:h}=a._cachedMeta,{_parsed:f}=t,m=f.slice(0,u.lo+1).reverse().findIndex(b=>!Je(b[h.axis]));u.lo-=Math.max(0,m);const g=f.slice(u.hi).findIndex(b=>!Je(b[h.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function zr(t,n,o,r,a){const s=t.getSortedVisibleDatasetMetas(),i=o[n];for(let l=0,c=s.length;l<c;++l){const{index:d,data:u}=s[l],{lo:h,hi:f}=l0(s[l],n,i,a);for(let m=h;m<=f;++m){const g=u[m];g.skip||r(g,d,m)}}}function c0(t){const n=t.indexOf("x")!==-1,o=t.indexOf("y")!==-1;return function(r,a){const s=n?Math.abs(r.x-a.x):0,i=o?Math.abs(r.y-a.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(i,2))}}function xs(t,n,o,r,a){const s=[];return!a&&!t.isPointInArea(n)||zr(t,o,n,function(l,c,d){!a&&!jo(l,t.chartArea,0)||l.inRange(n.x,n.y,r)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function d0(t,n,o,r){let a=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],r),{angle:h}=Nl(i,{x:n.x,y:n.y});Ro(h,d,u)&&a.push({element:i,datasetIndex:l,index:c})}return zr(t,o,n,s),a}function u0(t,n,o,r,a,s){let i=[];const l=c0(o);let c=Number.POSITIVE_INFINITY;function d(u,h,f){const m=u.inRange(n.x,n.y,a);if(r&&!m)return;const g=u.getCenterPoint(a);if(!(!!s||t.isPointInArea(g))&&!m)return;const x=l(n,g);x<c?(i=[{element:u,datasetIndex:h,index:f}],c=x):x===c&&i.push({element:u,datasetIndex:h,index:f})}return zr(t,o,n,d),i}function ks(t,n,o,r,a,s){return!s&&!t.isPointInArea(n)?[]:o==="r"&&!r?d0(t,n,o,a):u0(t,n,o,r,a,s)}function wc(t,n,o,r,a){const s=[],i=o==="x"?"inXRange":"inYRange";let l=!1;return zr(t,o,n,(c,d,u)=>{c[i]&&c[i](n[o],a)&&(s.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(n.x,n.y,a))}),r&&!l?[]:s}var f0={modes:{index(t,n,o,r){const a=Yn(n,t),s=o.axis||"x",i=o.includeInvisible||!1,l=o.intersect?xs(t,a,s,r,i):ks(t,a,s,!1,r,i),c=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach(d=>{const u=l[0].index,h=d.data[u];h&&!h.skip&&c.push({element:h,datasetIndex:d.index,index:u})}),c):[]},dataset(t,n,o,r){const a=Yn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;let l=o.intersect?xs(t,a,s,r,i):ks(t,a,s,!1,r,i);if(l.length>0){const c=l[0].datasetIndex,d=t.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(t,n,o,r){const a=Yn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return xs(t,a,s,r,i)},nearest(t,n,o,r){const a=Yn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return ks(t,a,s,o.intersect,r,i)},x(t,n,o,r){const a=Yn(n,t);return wc(t,a,"x",o.intersect,r)},y(t,n,o,r){const a=Yn(n,t);return wc(t,a,"y",o.intersect,r)}}};const Cc=["left","top","right","bottom"];function Ho(t,n){return t.filter(o=>o.pos===n)}function Ec(t,n){return t.filter(o=>Cc.indexOf(o.pos)===-1&&o.box.axis===n)}function qo(t,n){return t.sort((o,r)=>{const a=n?r:o,s=n?o:r;return a.weight===s.weight?a.index-s.index:a.weight-s.weight})}function h0(t){const n=[];let o,r,a,s,i,l;for(o=0,r=(t||[]).length;o<r;++o)a=t[o],{position:s,options:{stack:i,stackWeight:l=1}}=a,n.push({index:o,box:a,pos:s,horizontal:a.isHorizontal(),weight:a.weight,stack:i&&s+i,stackWeight:l});return n}function m0(t){const n={};for(const o of t){const{stack:r,pos:a,stackWeight:s}=o;if(!r||!Cc.includes(a))continue;const i=n[r]||(n[r]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=s}return n}function p0(t,n){const o=m0(t),{vBoxMaxWidth:r,hBoxMaxHeight:a}=n;let s,i,l;for(s=0,i=t.length;s<i;++s){l=t[s];const{fullSize:c}=l.box,d=o[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*r:c&&n.availableWidth,l.height=a):(l.width=r,l.height=u?u*a:c&&n.availableHeight)}return o}function g0(t){const n=h0(t),o=qo(n.filter(d=>d.box.fullSize),!0),r=qo(Ho(n,"left"),!0),a=qo(Ho(n,"right")),s=qo(Ho(n,"top"),!0),i=qo(Ho(n,"bottom")),l=Ec(n,"x"),c=Ec(n,"y");return{fullSize:o,leftAndTop:r.concat(s),rightAndBottom:a.concat(c).concat(i).concat(l),chartArea:Ho(n,"chartArea"),vertical:r.concat(a).concat(c),horizontal:s.concat(i).concat(l)}}function Bc(t,n,o,r){return Math.max(t[o],n[o])+Math.max(t[r],n[r])}function _c(t,n){t.top=Math.max(t.top,n.top),t.left=Math.max(t.left,n.left),t.bottom=Math.max(t.bottom,n.bottom),t.right=Math.max(t.right,n.right)}function b0(t,n,o,r){const{pos:a,box:s}=o,i=t.maxPadding;if(!Ue(a)){o.size&&(t[a]-=o.size);const h=r[o.stack]||{size:0,count:1};h.size=Math.max(h.size,o.horizontal?s.height:s.width),o.size=h.size/h.count,t[a]+=o.size}s.getPadding&&_c(i,s.getPadding());const l=Math.max(0,n.outerWidth-Bc(i,t,"left","right")),c=Math.max(0,n.outerHeight-Bc(i,t,"top","bottom")),d=l!==t.w,u=c!==t.h;return t.w=l,t.h=c,o.horizontal?{same:d,other:u}:{same:u,other:d}}function y0(t){const n=t.maxPadding;function o(r){const a=Math.max(n[r]-t[r],0);return t[r]+=a,a}t.y+=o("top"),t.x+=o("left"),o("right"),o("bottom")}function x0(t,n){const o=n.maxPadding;function r(a){const s={left:0,top:0,right:0,bottom:0};return a.forEach(i=>{s[i]=Math.max(n[i],o[i])}),s}return r(t?["left","right"]:["top","bottom"])}function Go(t,n,o,r){const a=[];let s,i,l,c,d,u;for(s=0,i=t.length,d=0;s<i;++s){l=t[s],c=l.box,c.update(l.width||n.w,l.height||n.h,x0(l.horizontal,n));const{same:h,other:f}=b0(n,o,l,r);d|=h&&a.length,u=u||f,c.fullSize||a.push(l)}return d&&Go(a,n,o,r)||u}function Ir(t,n,o,r,a){t.top=o,t.left=n,t.right=n+r,t.bottom=o+a,t.width=r,t.height=a}function Sc(t,n,o,r){const a=o.padding;let{x:s,y:i}=n;for(const l of t){const c=l.box,d=r[l.stack]||{placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const h=n.w*u,f=d.size||c.height;Fo(d.start)&&(i=d.start),c.fullSize?Ir(c,a.left,i,o.outerWidth-a.right-a.left,f):Ir(c,n.left+d.placed,i,h,f),d.start=i,d.placed+=h,i=c.bottom}else{const h=n.h*u,f=d.size||c.width;Fo(d.start)&&(s=d.start),c.fullSize?Ir(c,s,a.top,f,o.outerHeight-a.bottom-a.top):Ir(c,s,n.top+d.placed,f,h),d.start=s,d.placed+=h,s=c.right}}n.x=s,n.y=i}var jt={addBox(t,n){t.boxes||(t.boxes=[]),n.fullSize=n.fullSize||!1,n.position=n.position||"top",n.weight=n.weight||0,n._layers=n._layers||function(){return[{z:0,draw(o){n.draw(o)}}]},t.boxes.push(n)},removeBox(t,n){const o=t.boxes?t.boxes.indexOf(n):-1;o!==-1&&t.boxes.splice(o,1)},configure(t,n,o){n.fullSize=o.fullSize,n.position=o.position,n.weight=o.weight},update(t,n,o,r){if(!t)return;const a=$t(t.options.layout.padding),s=Math.max(n-a.width,0),i=Math.max(o-a.height,0),l=g0(t.boxes),c=l.vertical,d=l.horizontal;nt(t.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=c.reduce((b,x)=>x.box.options&&x.box.options.display===!1?b:b+1,0)||1,h=Object.freeze({outerWidth:n,outerHeight:o,padding:a,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),f=Object.assign({},a);_c(f,$t(r));const m=Object.assign({maxPadding:f,w:s,h:i,x:a.left,y:a.top},a),g=p0(c.concat(d),h);Go(l.fullSize,m,h,g),Go(c,m,h,g),Go(d,m,h,g)&&Go(c,m,h,g),y0(m),Sc(l.leftAndTop,m,h,g),m.x+=m.w,m.y+=m.h,Sc(l.rightAndBottom,m,h,g),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},nt(l.chartArea,b=>{const x=b.box;Object.assign(x,t.chartArea),x.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Ac{acquireContext(n,o){}releaseContext(n){return!1}addEventListener(n,o,r){}removeEventListener(n,o,r){}getDevicePixelRatio(){return 1}getMaximumSize(n,o,r,a){return o=Math.max(0,o||n.width),r=r||n.height,{width:o,height:Math.max(0,a?Math.floor(o/a):r)}}isAttached(n){return!0}updateConfig(n){}}class k0 extends Ac{acquireContext(n){return n&&n.getContext&&n.getContext("2d")||null}updateConfig(n){n.options.animation=!1}}const Rr="$chartjs",w0={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Vc=t=>t===null||t==="";function C0(t,n){const o=t.style,r=t.getAttribute("height"),a=t.getAttribute("width");if(t[Rr]={initial:{height:r,width:a,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",Vc(a)){const s=Zl(t,"width");s!==void 0&&(t.width=s)}if(Vc(r))if(t.style.height==="")t.height=t.width/(n||2);else{const s=Zl(t,"height");s!==void 0&&(t.height=s)}return t}const Dc=Bg?{passive:!0}:!1;function E0(t,n,o){t&&t.addEventListener(n,o,Dc)}function B0(t,n,o){t&&t.canvas&&t.canvas.removeEventListener(n,o,Dc)}function _0(t,n){const o=w0[t.type]||t.type,{x:r,y:a}=Yn(t,n);return{type:o,chart:n,native:t,x:r!==void 0?r:null,y:a!==void 0?a:null}}function Lr(t,n){for(const o of t)if(o===n||o.contains(n))return!0}function S0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||Lr(l.addedNodes,r),i=i&&!Lr(l.removedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}function A0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||Lr(l.removedNodes,r),i=i&&!Lr(l.addedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}const Xo=new Map;let Nc=0;function Mc(){const t=window.devicePixelRatio;t!==Nc&&(Nc=t,Xo.forEach((n,o)=>{o.currentDevicePixelRatio!==t&&n()}))}function V0(t,n){Xo.size||window.addEventListener("resize",Mc),Xo.set(t,n)}function D0(t){Xo.delete(t),Xo.size||window.removeEventListener("resize",Mc)}function N0(t,n,o){const r=t.canvas,a=r&&fs(r);if(!a)return;const s=Ol((l,c)=>{const d=a.clientWidth;o(l,c),d<a.clientWidth&&o()},window),i=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||s(d,u)});return i.observe(a),V0(t,s),i}function ws(t,n,o){o&&o.disconnect(),n==="resize"&&D0(t)}function M0(t,n,o){const r=t.canvas,a=Ol(s=>{t.ctx!==null&&o(_0(s,t))},t);return E0(r,n,a),a}class v0 extends Ac{acquireContext(n,o){const r=n&&n.getContext&&n.getContext("2d");return r&&r.canvas===n?(C0(n,o),r):null}releaseContext(n){const o=n.canvas;if(!o[Rr])return!1;const r=o[Rr].initial;["height","width"].forEach(s=>{const i=r[s];Je(i)?o.removeAttribute(s):o.setAttribute(s,i)});const a=r.style||{};return Object.keys(a).forEach(s=>{o.style[s]=a[s]}),o.width=o.width,delete o[Rr],!0}addEventListener(n,o,r){this.removeEventListener(n,o);const a=n.$proxies||(n.$proxies={}),i={attach:S0,detach:A0,resize:N0}[o]||M0;a[o]=i(n,o,r)}removeEventListener(n,o){const r=n.$proxies||(n.$proxies={}),a=r[o];if(!a)return;({attach:ws,detach:ws,resize:ws}[o]||B0)(n,o,a),r[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(n,o,r,a){return Eg(n,o,r,a)}isAttached(n){const o=n&&fs(n);return!!(o&&o.isConnected)}}function P0(t){return!us()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?k0:v0}let xn=(xa=class{constructor(){_e(this,"x");_e(this,"y");_e(this,"active",!1);_e(this,"options");_e(this,"$animations")}tooltipPosition(n){const{x:o,y:r}=this.getProps(["x","y"],n);return{x:o,y:r}}hasValue(){return Io(this.x)&&Io(this.y)}getProps(n,o){const r=this.$animations;if(!o||!r)return this;const a={};return n.forEach(s=>{a[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),a}},_e(xa,"defaults",{}),_e(xa,"defaultRoutes"),xa);function T0(t,n){const o=t.options.ticks,r=O0(t),a=Math.min(o.maxTicksLimit||r,r),s=o.major.enabled?z0(n):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>a)return I0(n,d,s,i/a),d;const u=F0(s,n,a);if(i>0){let h,f;const m=i>1?Math.round((c-l)/(i-1)):null;for($r(n,d,u,Je(m)?0:l-m,l),h=0,f=i-1;h<f;h++)$r(n,d,u,s[h],s[h+1]);return $r(n,d,u,c,Je(m)?n.length:c+m),d}return $r(n,d,u),d}function O0(t){const n=t.options.offset,o=t._tickSize(),r=t._length/o+(n?0:1),a=t._maxLength/o;return Math.floor(Math.min(r,a))}function F0(t,n,o){const r=R0(t),a=n.length/o;if(!r)return Math.max(a,1);const s=Cp(r);for(let i=0,l=s.length-1;i<l;i++){const c=s[i];if(c>a)return c}return Math.max(a,1)}function z0(t){const n=[];let o,r;for(o=0,r=t.length;o<r;o++)t[o].major&&n.push(o);return n}function I0(t,n,o,r){let a=0,s=o[0],i;for(r=Math.ceil(r),i=0;i<t.length;i++)i===s&&(n.push(t[i]),a++,s=o[a*r])}function $r(t,n,o,r,a){const s=Re(r,0),i=Math.min(Re(a,t.length),t.length);let l=0,c,d,u;for(o=Math.ceil(o),a&&(c=a-r,o=c/Math.floor(c/o)),u=s;u<0;)l++,u=Math.round(s+l*o);for(d=Math.max(s,0);d<i;d++)d===u&&(n.push(t[d]),l++,u=Math.round(s+l*o))}function R0(t){const n=t.length;let o,r;if(n<2)return!1;for(r=t[0],o=1;o<n;++o)if(t[o]-t[o-1]!==r)return!1;return r}const L0=t=>t==="left"?"right":t==="right"?"left":t,vc=(t,n,o)=>n==="top"||n==="left"?t[n]+o:t[n]-o,Pc=(t,n)=>Math.min(n||t,t);function Tc(t,n){const o=[],r=t.length/n,a=t.length;let s=0;for(;s<a;s+=r)o.push(t[Math.floor(s)]);return o}function $0(t,n,o){const r=t.ticks.length,a=Math.min(n,r-1),s=t._startPixel,i=t._endPixel,l=1e-6;let c=t.getPixelForTick(a),d;if(!(o&&(r===1?d=Math.max(c-s,i-c):n===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(a-1))/2,c+=a<n?d:-d,c<s-l||c>i+l)))return c}function j0(t,n){nt(t,o=>{const r=o.gc,a=r.length/2;let s;if(a>n){for(s=0;s<a;++s)delete o.data[r[s]];r.splice(0,a)}})}function Ko(t){return t.drawTicks?t.tickLength:0}function Oc(t,n){if(!t.display)return 0;const o=St(t.font,n),r=$t(t.padding);return(gt(t.text)?t.text.length:1)*o.lineHeight+r.height}function W0(t,n){return Xn(t,{scale:n,type:"scale"})}function U0(t,n,o){return Xn(t,{tick:o,index:n,type:"tick"})}function H0(t,n,o){let r=es(t);return(o&&n!=="right"||!o&&n==="right")&&(r=L0(r)),r}function q0(t,n,o,r){const{top:a,left:s,bottom:i,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let h=0,f,m,g;const b=i-a,x=l-s;if(t.isHorizontal()){if(m=_t(r,s,l),Ue(o)){const p=Object.keys(o)[0],C=o[p];g=u[p].getPixelForValue(C)+b-n}else o==="center"?g=(d.bottom+d.top)/2+b-n:g=vc(t,o,n);f=l-s}else{if(Ue(o)){const p=Object.keys(o)[0],C=o[p];m=u[p].getPixelForValue(C)-x+n}else o==="center"?m=(d.left+d.right)/2-x+n:m=vc(t,o,n);g=_t(r,i,a),h=o==="left"?-kt:kt}return{titleX:m,titleY:g,maxWidth:f,rotation:h}}class mo extends xn{constructor(n){super(),this.id=n.id,this.type=n.type,this.options=void 0,this.ctx=n.ctx,this.chart=n.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(n){this.options=n.setContext(this.getContext()),this.axis=n.axis,this._userMin=this.parse(n.min),this._userMax=this.parse(n.max),this._suggestedMin=this.parse(n.suggestedMin),this._suggestedMax=this.parse(n.suggestedMax)}parse(n,o){return n}getUserBounds(){let{_userMin:n,_userMax:o,_suggestedMin:r,_suggestedMax:a}=this;return n=en(n,Number.POSITIVE_INFINITY),o=en(o,Number.NEGATIVE_INFINITY),r=en(r,Number.POSITIVE_INFINITY),a=en(a,Number.NEGATIVE_INFINITY),{min:en(n,r),max:en(o,a),minDefined:Et(n),maxDefined:Et(o)}}getMinMax(n){let{min:o,max:r,minDefined:a,maxDefined:s}=this.getUserBounds(),i;if(a&&s)return{min:o,max:r};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)i=l[c].controller.getMinMax(this,n),a||(o=Math.min(o,i.min)),s||(r=Math.max(r,i.max));return o=s&&o>r?r:o,r=a&&o>r?o:r,{min:en(o,en(r,o)),max:en(r,en(o,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const n=this.chart.data;return this.options.labels||(this.isHorizontal()?n.xLabels:n.yLabels)||n.labels||[]}getLabelItems(n=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(n))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){it(this.options.beforeUpdate,[this])}update(n,o,r){const{beginAtZero:a,grace:s,ticks:i}=this.options,l=i.sampleSize;this.beforeUpdate(),this.maxWidth=n,this.maxHeight=o,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=tg(this,s,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?Tc(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=T0(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let n=this.options.reverse,o,r;this.isHorizontal()?(o=this.left,r=this.right):(o=this.top,r=this.bottom,n=!n),this._startPixel=o,this._endPixel=r,this._reversePixels=n,this._length=r-o,this._alignToPixels=this.options.alignToPixels}afterUpdate(){it(this.options.afterUpdate,[this])}beforeSetDimensions(){it(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){it(this.options.afterSetDimensions,[this])}_callHooks(n){this.chart.notifyPlugins(n,this.getContext()),it(this.options[n],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){it(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(n){const o=this.options.ticks;let r,a,s;for(r=0,a=n.length;r<a;r++)s=n[r],s.label=it(o.callback,[s.value,r,n],this)}afterTickToLabelConversion(){it(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){it(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const n=this.options,o=n.ticks,r=Pc(this.ticks.length,n.ticks.maxTicksLimit),a=o.minRotation||0,s=o.maxRotation;let i=a,l,c,d;if(!this._isVisible()||!o.display||a>=s||r<=1||!this.isHorizontal()){this.labelRotation=a;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,m=Bt(this.chart.width-h,0,this.maxWidth);l=n.offset?this.maxWidth/r:m/(r-1),h+6>l&&(l=m/(r-(n.offset?.5:1)),c=this.maxHeight-Ko(n.grid)-o.padding-Oc(n.title,this.chart.options.font),d=Math.sqrt(h*h+f*f),i=Sp(Math.min(Math.asin(Bt((u.highest.height+6)/l,-1,1)),Math.asin(Bt(c/d,-1,1))-Math.asin(Bt(f/d,-1,1)))),i=Math.max(a,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){it(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){it(this.options.beforeFit,[this])}fit(){const n={width:0,height:0},{chart:o,options:{ticks:r,title:a,grid:s}}=this,i=this._isVisible(),l=this.isHorizontal();if(i){const c=Oc(a,o.options.font);if(l?(n.width=this.maxWidth,n.height=Ko(s)+c):(n.height=this.maxHeight,n.width=Ko(s)+c),r.display&&this.ticks.length){const{first:d,last:u,widest:h,highest:f}=this._getLabelSizes(),m=r.padding*2,g=gn(this.labelRotation),b=Math.cos(g),x=Math.sin(g);if(l){const p=r.mirror?0:x*h.width+b*f.height;n.height=Math.min(this.maxHeight,n.height+p+m)}else{const p=r.mirror?0:b*h.width+x*f.height;n.width=Math.min(this.maxWidth,n.width+p+m)}this._calculatePadding(d,u,x,b)}}this._handleMargins(),l?(this.width=this._length=o.width-this._margins.left-this._margins.right,this.height=n.height):(this.width=n.width,this.height=this._length=o.height-this._margins.top-this._margins.bottom)}_calculatePadding(n,o,r,a){const{ticks:{align:s,padding:i},position:l}=this.options,c=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,m=0;c?d?(f=a*n.width,m=r*o.height):(f=r*n.height,m=a*o.width):s==="start"?m=o.width:s==="end"?f=n.width:s!=="inner"&&(f=n.width/2,m=o.width/2),this.paddingLeft=Math.max((f-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+i)*this.width/(this.width-h),0)}else{let u=o.height/2,h=n.height/2;s==="start"?(u=0,h=n.height):s==="end"&&(u=o.height,h=0),this.paddingTop=u+i,this.paddingBottom=h+i}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){it(this.options.afterFit,[this])}isHorizontal(){const{axis:n,position:o}=this.options;return o==="top"||o==="bottom"||n==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(n){this.beforeTickToLabelConversion(),this.generateTickLabels(n);let o,r;for(o=0,r=n.length;o<r;o++)Je(n[o].label)&&(n.splice(o,1),r--,o--);this.afterTickToLabelConversion()}_getLabelSizes(){let n=this._labelSizes;if(!n){const o=this.options.ticks.sampleSize;let r=this.ticks;o<r.length&&(r=Tc(r,o)),this._labelSizes=n=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return n}_computeLabelSizes(n,o,r){const{ctx:a,_longestTextCache:s}=this,i=[],l=[],c=Math.floor(o/Pc(o,r));let d=0,u=0,h,f,m,g,b,x,p,C,w,E,_;for(h=0;h<o;h+=c){if(g=n[h].label,b=this._resolveTickFontOptions(h),a.font=x=b.string,p=s[x]=s[x]||{data:{},gc:[]},C=b.lineHeight,w=E=0,!Je(g)&&!gt(g))w=$l(a,p.data,p.gc,w,g),E=C;else if(gt(g))for(f=0,m=g.length;f<m;++f)_=g[f],!Je(_)&&!gt(_)&&(w=$l(a,p.data,p.gc,w,_),E+=C);i.push(w),l.push(E),d=Math.max(w,d),u=Math.max(E,u)}j0(s,o);const B=i.indexOf(d),k=l.indexOf(u),y=V=>({width:i[V]||0,height:l[V]||0});return{first:y(0),last:y(o-1),widest:y(B),highest:y(k),widths:i,heights:l}}getLabelForValue(n){return n}getPixelForValue(n,o){return NaN}getValueForPixel(n){}getPixelForTick(n){const o=this.ticks;return n<0||n>o.length-1?null:this.getPixelForValue(o[n].value)}getPixelForDecimal(n){this._reversePixels&&(n=1-n);const o=this._startPixel+n*this._length;return Vp(this._alignToPixels?Gn(this.chart,o,0):o)}getDecimalForPixel(n){const o=(n-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:n,max:o}=this;return n<0&&o<0?o:n>0&&o>0?n:0}getContext(n){const o=this.ticks||[];if(n>=0&&n<o.length){const r=o[n];return r.$context||(r.$context=U0(this.getContext(),n,r))}return this.$context||(this.$context=W0(this.chart.getContext(),this))}_tickSize(){const n=this.options.ticks,o=gn(this.labelRotation),r=Math.abs(Math.cos(o)),a=Math.abs(Math.sin(o)),s=this._getLabelSizes(),i=n.autoSkipPadding||0,l=s?s.widest.width+i:0,c=s?s.highest.height+i:0;return this.isHorizontal()?c*r>l*a?l/r:c/a:c*a<l*r?c/r:l/a}_isVisible(){const n=this.options.display;return n!=="auto"?!!n:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(n){const o=this.axis,r=this.chart,a=this.options,{grid:s,position:i,border:l}=a,c=s.offset,d=this.isHorizontal(),h=this.ticks.length+(c?1:0),f=Ko(s),m=[],g=l.setContext(this.getContext()),b=g.display?g.width:0,x=b/2,p=function($){return Gn(r,$,b)};let C,w,E,_,B,k,y,V,D,N,A,T;if(i==="top")C=p(this.bottom),k=this.bottom-f,V=C-x,N=p(n.top)+x,T=n.bottom;else if(i==="bottom")C=p(this.top),N=n.top,T=p(n.bottom)-x,k=C+x,V=this.top+f;else if(i==="left")C=p(this.right),B=this.right-f,y=C-x,D=p(n.left)+x,A=n.right;else if(i==="right")C=p(this.left),D=n.left,A=p(n.right)-x,B=C+x,y=this.left+f;else if(o==="x"){if(i==="center")C=p((n.top+n.bottom)/2+.5);else if(Ue(i)){const $=Object.keys(i)[0],G=i[$];C=p(this.chart.scales[$].getPixelForValue(G))}N=n.top,T=n.bottom,k=C+x,V=k+f}else if(o==="y"){if(i==="center")C=p((n.left+n.right)/2);else if(Ue(i)){const $=Object.keys(i)[0],G=i[$];C=p(this.chart.scales[$].getPixelForValue(G))}B=C-x,y=B-f,D=n.left,A=n.right}const P=Re(a.ticks.maxTicksLimit,h),X=Math.max(1,Math.ceil(h/P));for(w=0;w<h;w+=X){const $=this.getContext(w),G=s.setContext($),ne=l.setContext($),K=G.lineWidth,R=G.color,j=ne.dash||[],se=ne.dashOffset,ee=G.tickWidth,Y=G.tickColor,le=G.tickBorderDash||[],ge=G.tickBorderDashOffset;E=$0(this,w,c),E!==void 0&&(_=Gn(r,E,K),d?B=y=D=A=_:k=V=N=T=_,m.push({tx1:B,ty1:k,tx2:y,ty2:V,x1:D,y1:N,x2:A,y2:T,width:K,color:R,borderDash:j,borderDashOffset:se,tickWidth:ee,tickColor:Y,tickBorderDash:le,tickBorderDashOffset:ge}))}return this._ticksLength=h,this._borderValue=C,m}_computeLabelItems(n){const o=this.axis,r=this.options,{position:a,ticks:s}=r,i=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:h}=s,f=Ko(r.grid),m=f+u,g=h?-u:m,b=-gn(this.labelRotation),x=[];let p,C,w,E,_,B,k,y,V,D,N,A,T="middle";if(a==="top")B=this.bottom-g,k=this._getXAxisLabelAlignment();else if(a==="bottom")B=this.top+g,k=this._getXAxisLabelAlignment();else if(a==="left"){const X=this._getYAxisLabelAlignment(f);k=X.textAlign,_=X.x}else if(a==="right"){const X=this._getYAxisLabelAlignment(f);k=X.textAlign,_=X.x}else if(o==="x"){if(a==="center")B=(n.top+n.bottom)/2+m;else if(Ue(a)){const X=Object.keys(a)[0],$=a[X];B=this.chart.scales[X].getPixelForValue($)+m}k=this._getXAxisLabelAlignment()}else if(o==="y"){if(a==="center")_=(n.left+n.right)/2-m;else if(Ue(a)){const X=Object.keys(a)[0],$=a[X];_=this.chart.scales[X].getPixelForValue($)}k=this._getYAxisLabelAlignment(f).textAlign}o==="y"&&(c==="start"?T="top":c==="end"&&(T="bottom"));const P=this._getLabelSizes();for(p=0,C=l.length;p<C;++p){w=l[p],E=w.label;const X=s.setContext(this.getContext(p));y=this.getPixelForTick(p)+s.labelOffset,V=this._resolveTickFontOptions(p),D=V.lineHeight,N=gt(E)?E.length:1;const $=N/2,G=X.color,ne=X.textStrokeColor,K=X.textStrokeWidth;let R=k;i?(_=y,k==="inner"&&(p===C-1?R=this.options.reverse?"left":"right":p===0?R=this.options.reverse?"right":"left":R="center"),a==="top"?d==="near"||b!==0?A=-N*D+D/2:d==="center"?A=-P.highest.height/2-$*D+D:A=-P.highest.height+D/2:d==="near"||b!==0?A=D/2:d==="center"?A=P.highest.height/2-$*D:A=P.highest.height-N*D,h&&(A*=-1),b!==0&&!X.showLabelBackdrop&&(_+=D/2*Math.sin(b))):(B=y,A=(1-N)*D/2);let j;if(X.showLabelBackdrop){const se=$t(X.backdropPadding),ee=P.heights[p],Y=P.widths[p];let le=A-se.top,ge=0-se.left;switch(T){case"middle":le-=ee/2;break;case"bottom":le-=ee;break}switch(k){case"center":ge-=Y/2;break;case"right":ge-=Y;break;case"inner":p===C-1?ge-=Y:p>0&&(ge-=Y/2);break}j={left:ge,top:le,width:Y+se.width,height:ee+se.height,color:X.backdropColor}}x.push({label:E,font:V,textOffset:A,options:{rotation:b,color:G,strokeColor:ne,strokeWidth:K,textAlign:R,textBaseline:T,translation:[_,B],backdrop:j}})}return x}_getXAxisLabelAlignment(){const{position:n,ticks:o}=this.options;if(-gn(this.labelRotation))return n==="top"?"left":"right";let a="center";return o.align==="start"?a="left":o.align==="end"?a="right":o.align==="inner"&&(a="inner"),a}_getYAxisLabelAlignment(n){const{position:o,ticks:{crossAlign:r,mirror:a,padding:s}}=this.options,i=this._getLabelSizes(),l=n+s,c=i.widest.width;let d,u;return o==="left"?a?(u=this.right+s,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u=this.left)):o==="right"?a?(u=this.left+s,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const n=this.chart,o=this.options.position;if(o==="left"||o==="right")return{top:0,left:this.left,bottom:n.height,right:this.right};if(o==="top"||o==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:n.width}}drawBackground(){const{ctx:n,options:{backgroundColor:o},left:r,top:a,width:s,height:i}=this;o&&(n.save(),n.fillStyle=o,n.fillRect(r,a,s,i),n.restore())}getLineWidthForValue(n){const o=this.options.grid;if(!this._isVisible()||!o.display)return 0;const a=this.ticks.findIndex(s=>s.value===n);return a>=0?o.setContext(this.getContext(a)).lineWidth:0}drawGrid(n){const o=this.options.grid,r=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(n));let s,i;const l=(c,d,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(d.x,d.y),r.stroke(),r.restore())};if(o.display)for(s=0,i=a.length;s<i;++s){const c=a[s];o.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),o.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:n,ctx:o,options:{border:r,grid:a}}=this,s=r.setContext(this.getContext()),i=r.display?s.width:0;if(!i)return;const l=a.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,h,f;this.isHorizontal()?(d=Gn(n,this.left,i)-i/2,u=Gn(n,this.right,l)+l/2,h=f=c):(h=Gn(n,this.top,i)-i/2,f=Gn(n,this.bottom,l)+l/2,d=u=c),o.save(),o.lineWidth=s.width,o.strokeStyle=s.color,o.beginPath(),o.moveTo(d,h),o.lineTo(u,f),o.stroke(),o.restore()}drawLabels(n){if(!this.options.ticks.display)return;const r=this.ctx,a=this._computeLabelArea();a&&Ar(r,a);const s=this.getLabelItems(n);for(const i of s){const l=i.options,c=i.font,d=i.label,u=i.textOffset;Wo(r,d,0,u,c,l)}a&&Vr(r)}drawTitle(){const{ctx:n,options:{position:o,title:r,reverse:a}}=this;if(!r.display)return;const s=St(r.font),i=$t(r.padding),l=r.align;let c=s.lineHeight/2;o==="bottom"||o==="center"||Ue(o)?(c+=i.bottom,gt(r.text)&&(c+=s.lineHeight*(r.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:h,rotation:f}=q0(this,c,o,l);Wo(n,r.text,0,0,s,{color:r.color,maxWidth:h,rotation:f,textAlign:H0(l,o,a),textBaseline:"middle",translation:[d,u]})}draw(n){this._isVisible()&&(this.drawBackground(),this.drawGrid(n),this.drawBorder(),this.drawTitle(),this.drawLabels(n))}_layers(){const n=this.options,o=n.ticks&&n.ticks.z||0,r=Re(n.grid&&n.grid.z,-1),a=Re(n.border&&n.border.z,0);return!this._isVisible()||this.draw!==mo.prototype.draw?[{z:o,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:o,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(n){const o=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",a=[];let s,i;for(s=0,i=o.length;s<i;++s){const l=o[s];l[r]===this.id&&(!n||l.type===n)&&a.push(l)}return a}_resolveTickFontOptions(n){const o=this.options.ticks.setContext(this.getContext(n));return St(o.font)}_maxDigits(){const n=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/n}}class jr{constructor(n,o,r){this.type=n,this.scope=o,this.override=r,this.items=Object.create(null)}isForType(n){return Object.prototype.isPrototypeOf.call(this.type.prototype,n.prototype)}register(n){const o=Object.getPrototypeOf(n);let r;K0(o)&&(r=this.register(o));const a=this.items,s=n.id,i=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+n);return s in a||(a[s]=n,G0(n,i,r),this.override&&pt.override(n.id,n.overrides)),i}get(n){return this.items[n]}unregister(n){const o=this.items,r=n.id,a=this.scope;r in o&&delete o[r],a&&r in pt[a]&&(delete pt[a][r],this.override&&delete qn[r])}}function G0(t,n,o){const r=To(Object.create(null),[o?pt.get(o):{},pt.get(n),t.defaults]);pt.set(n,r),t.defaultRoutes&&X0(n,t.defaultRoutes),t.descriptors&&pt.describe(n,t.descriptors)}function X0(t,n){Object.keys(n).forEach(o=>{const r=o.split("."),a=r.pop(),s=[t].concat(r).join("."),i=n[o].split("."),l=i.pop(),c=i.join(".");pt.route(s,a,c,l)})}function K0(t){return"id"in t&&"defaults"in t}class Y0{constructor(){this.controllers=new jr(Qn,"datasets",!0),this.elements=new jr(xn,"elements"),this.plugins=new jr(Object,"plugins"),this.scales=new jr(mo,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...n){this._each("register",n)}remove(...n){this._each("unregister",n)}addControllers(...n){this._each("register",n,this.controllers)}addElements(...n){this._each("register",n,this.elements)}addPlugins(...n){this._each("register",n,this.plugins)}addScales(...n){this._each("register",n,this.scales)}getController(n){return this._get(n,this.controllers,"controller")}getElement(n){return this._get(n,this.elements,"element")}getPlugin(n){return this._get(n,this.plugins,"plugin")}getScale(n){return this._get(n,this.scales,"scale")}removeControllers(...n){this._each("unregister",n,this.controllers)}removeElements(...n){this._each("unregister",n,this.elements)}removePlugins(...n){this._each("unregister",n,this.plugins)}removeScales(...n){this._each("unregister",n,this.scales)}_each(n,o,r){[...o].forEach(a=>{const s=r||this._getRegistryForType(a);r||s.isForType(a)||s===this.plugins&&a.id?this._exec(n,s,a):nt(a,i=>{const l=r||this._getRegistryForType(i);this._exec(n,l,i)})})}_exec(n,o,r){const a=Ja(n);it(r["before"+a],[],r),o[n](r),it(r["after"+a],[],r)}_getRegistryForType(n){for(let o=0;o<this._typedRegistries.length;o++){const r=this._typedRegistries[o];if(r.isForType(n))return r}return this.plugins}_get(n,o,r){const a=o.get(n);if(a===void 0)throw new Error('"'+n+'" is not a registered '+r+".");return a}}var nn=new Y0;class J0{constructor(){this._init=void 0}notify(n,o,r,a){if(o==="beforeInit"&&(this._init=this._createDescriptors(n,!0),this._notify(this._init,n,"install")),this._init===void 0)return;const s=a?this._descriptors(n).filter(a):this._descriptors(n),i=this._notify(s,n,o,r);return o==="afterDestroy"&&(this._notify(s,n,"stop"),this._notify(this._init,n,"uninstall"),this._init=void 0),i}_notify(n,o,r,a){a=a||{};for(const s of n){const i=s.plugin,l=i[r],c=[o,a,s.options];if(it(l,c,i)===!1&&a.cancelable)return!1}return!0}invalidate(){Je(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(n){if(this._cache)return this._cache;const o=this._cache=this._createDescriptors(n);return this._notifyStateChanges(n),o}_createDescriptors(n,o){const r=n&&n.config,a=Re(r.options&&r.options.plugins,{}),s=Q0(r);return a===!1&&!o?[]:eb(n,s,a,o)}_notifyStateChanges(n){const o=this._oldCache||[],r=this._cache,a=(s,i)=>s.filter(l=>!i.some(c=>l.plugin.id===c.plugin.id));this._notify(a(o,r),n,"stop"),this._notify(a(r,o),n,"start")}}function Q0(t){const n={},o=[],r=Object.keys(nn.plugins.items);for(let s=0;s<r.length;s++)o.push(nn.getPlugin(r[s]));const a=t.plugins||[];for(let s=0;s<a.length;s++){const i=a[s];o.indexOf(i)===-1&&(o.push(i),n[i.id]=!0)}return{plugins:o,localIds:n}}function Z0(t,n){return!n&&t===!1?null:t===!0?{}:t}function eb(t,{plugins:n,localIds:o},r,a){const s=[],i=t.getContext();for(const l of n){const c=l.id,d=Z0(r[c],a);d!==null&&s.push({plugin:l,options:tb(t.config,{plugin:l,local:o[c]},d,i)})}return s}function tb(t,{plugin:n,local:o},r,a){const s=t.pluginScopeKeys(n),i=t.getOptionScopes(r,s);return o&&n.defaults&&i.push(n.defaults),t.createResolver(i,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Cs(t,n){const o=pt.datasets[t]||{};return((n.datasets||{})[t]||{}).indexAxis||n.indexAxis||o.indexAxis||"x"}function nb(t,n){let o=t;return t==="_index_"?o=n:t==="_value_"&&(o=n==="x"?"y":"x"),o}function ob(t,n){return t===n?"_index_":"_value_"}function Fc(t){if(t==="x"||t==="y"||t==="r")return t}function rb(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Es(t,...n){if(Fc(t))return t;for(const o of n){const r=o.axis||rb(o.position)||t.length>1&&Fc(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function zc(t,n,o){if(o[n+"AxisID"]===t)return{axis:n}}function ab(t,n){if(n.data&&n.data.datasets){const o=n.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(o.length)return zc(t,"x",o[0])||zc(t,"y",o[0])}return{}}function sb(t,n){const o=qn[t.type]||{scales:{}},r=n.scales||{},a=Cs(t.type,n),s=Object.create(null);return Object.keys(r).forEach(i=>{const l=r[i];if(!Ue(l))return console.error(`Invalid scale configuration for scale: ${i}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const c=Es(i,l,ab(i,t),pt.scales[l.type]),d=ob(c,a),u=o.scales||{};s[i]=Oo(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(i=>{const l=i.type||t.type,c=i.indexAxis||Cs(l,n),u=(qn[l]||{}).scales||{};Object.keys(u).forEach(h=>{const f=nb(h,c),m=i[f+"AxisID"]||f;s[m]=s[m]||Object.create(null),Oo(s[m],[{axis:f},r[m],u[h]])})}),Object.keys(s).forEach(i=>{const l=s[i];Oo(l,[pt.scales[l.type],pt.scale])}),s}function Ic(t){const n=t.options||(t.options={});n.plugins=Re(n.plugins,{}),n.scales=sb(t,n)}function Rc(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function ib(t){return t=t||{},t.data=Rc(t.data),Ic(t),t}const Lc=new Map,$c=new Set;function Wr(t,n){let o=Lc.get(t);return o||(o=n(),Lc.set(t,o),$c.add(o)),o}const Yo=(t,n,o)=>{const r=Wn(n,o);r!==void 0&&t.add(r)};class lb{constructor(n){this._config=ib(n),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(n){this._config.type=n}get data(){return this._config.data}set data(n){this._config.data=Rc(n)}get options(){return this._config.options}set options(n){this._config.options=n}get plugins(){return this._config.plugins}update(){const n=this._config;this.clearCache(),Ic(n)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(n){return Wr(n,()=>[[`datasets.${n}`,""]])}datasetAnimationScopeKeys(n,o){return Wr(`${n}.transition.${o}`,()=>[[`datasets.${n}.transitions.${o}`,`transitions.${o}`],[`datasets.${n}`,""]])}datasetElementScopeKeys(n,o){return Wr(`${n}-${o}`,()=>[[`datasets.${n}.elements.${o}`,`datasets.${n}`,`elements.${o}`,""]])}pluginScopeKeys(n){const o=n.id,r=this.type;return Wr(`${r}-plugin-${o}`,()=>[[`plugins.${o}`,...n.additionalOptionScopes||[]]])}_cachedScopes(n,o){const r=this._scopeCache;let a=r.get(n);return(!a||o)&&(a=new Map,r.set(n,a)),a}getOptionScopes(n,o,r){const{options:a,type:s}=this,i=this._cachedScopes(n,r),l=i.get(o);if(l)return l;const c=new Set;o.forEach(u=>{n&&(c.add(n),u.forEach(h=>Yo(c,n,h))),u.forEach(h=>Yo(c,a,h)),u.forEach(h=>Yo(c,qn[s]||{},h)),u.forEach(h=>Yo(c,pt,h)),u.forEach(h=>Yo(c,rs,h))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),$c.has(o)&&i.set(o,d),d}chartOptionScopes(){const{options:n,type:o}=this;return[n,qn[o]||{},pt.datasets[o]||{},{type:o},pt,rs]}resolveNamedOptions(n,o,r,a=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=jc(this._resolverCache,n,a);let c=i;if(db(i,o)){s.$shared=!1,r=Nn(r)?r():r;const d=this.createResolver(n,r,l);c=co(i,r,d)}for(const d of o)s[d]=c[d];return s}createResolver(n,o,r=[""],a){const{resolver:s}=jc(this._resolverCache,n,r);return Ue(o)?co(s,o,void 0,a):s}}function jc(t,n,o){let r=t.get(n);r||(r=new Map,t.set(n,r));const a=o.join();let s=r.get(a);return s||(s={resolver:ls(n,o),subPrefixes:o.filter(l=>!l.toLowerCase().includes("hover"))},r.set(a,s)),s}const cb=t=>Ue(t)&&Object.getOwnPropertyNames(t).some(n=>Nn(t[n]));function db(t,n){const{isScriptable:o,isIndexable:r}=Hl(t);for(const a of n){const s=o(a),i=r(a),l=(i||s)&&t[a];if(s&&(Nn(l)||cb(l))||i&&gt(l))return!0}return!1}var ub="4.5.1";const fb=["top","bottom","left","right","chartArea"];function Wc(t,n){return t==="top"||t==="bottom"||fb.indexOf(t)===-1&&n==="x"}function Uc(t,n){return function(o,r){return o[t]===r[t]?o[n]-r[n]:o[t]-r[t]}}function Hc(t){const n=t.chart,o=n.options.animation;n.notifyPlugins("afterRender"),it(o&&o.onComplete,[t],n)}function hb(t){const n=t.chart,o=n.options.animation;it(o&&o.onProgress,[t],n)}function qc(t){return us()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Ur={},Gc=t=>{const n=qc(t);return Object.values(Ur).filter(o=>o.canvas===n).pop()};function mb(t,n,o){const r=Object.keys(t);for(const a of r){const s=+a;if(s>=n){const i=t[a];delete t[a],(o>0||s>n)&&(t[s+o]=i)}}}function pb(t,n,o,r){return!o||t.type==="mouseout"?null:r?n:t}class kn{static register(...n){nn.add(...n),Xc()}static unregister(...n){nn.remove(...n),Xc()}constructor(n,o){const r=this.config=new lb(o),a=qc(n),s=Gc(a);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const i=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||P0(a)),this.platform.updateConfig(r);const l=this.platform.acquireContext(a,i.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=hp(),this.ctx=l,this.canvas=c,this.width=u,this.height=d,this._options=i,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new J0,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=vp(h=>this.update(h),i.resizeDelay||0),this._dataChanges=[],Ur[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}yn.listen(this,"complete",Hc),yn.listen(this,"progress",hb),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:n,maintainAspectRatio:o},width:r,height:a,_aspectRatio:s}=this;return Je(n)?o&&s?s:a?r/a:null:n}get data(){return this.config.data}set data(n){this.config.data=n}get options(){return this._options}set options(n){this.config.options=n}get registry(){return nn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ql(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return jl(this.canvas,this.ctx),this}stop(){return yn.stop(this),this}resize(n,o){yn.running(this)?this._resizeBeforeDraw={width:n,height:o}:this._resize(n,o)}_resize(n,o){const r=this.options,a=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(a,n,o,s),l=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,Ql(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),it(r.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};nt(o,(r,a)=>{r.id=a})}buildOrUpdateScales(){const n=this.options,o=n.scales,r=this.scales,a=Object.keys(r).reduce((i,l)=>(i[l]=!1,i),{});let s=[];o&&(s=s.concat(Object.keys(o).map(i=>{const l=o[i],c=Es(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),nt(s,i=>{const l=i.options,c=l.id,d=Es(c,l),u=Re(l.type,i.dtype);(l.position===void 0||Wc(l.position,d)!==Wc(i.dposition))&&(l.position=i.dposition),a[c]=!0;let h=null;if(c in r&&r[c].type===u)h=r[c];else{const f=nn.getScale(u);h=new f({id:c,type:u,ctx:this.ctx,chart:this}),r[h.id]=h}h.init(l,n)}),nt(a,(i,l)=>{i||delete r[l]}),nt(r,i=>{jt.configure(this,i,i.options),jt.addBox(this,i)})}_updateMetasets(){const n=this._metasets,o=this.data.datasets.length,r=n.length;if(n.sort((a,s)=>a.index-s.index),r>o){for(let a=o;a<r;++a)this._destroyDatasetMeta(a);n.splice(o,r-o)}this._sortedMetasets=n.slice(0).sort(Uc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:n,data:{datasets:o}}=this;n.length>o.length&&delete this._stacks,n.forEach((r,a)=>{o.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(a)})}buildOrUpdateControllers(){const n=[],o=this.data.datasets;let r,a;for(this._removeUnreferencedMetasets(),r=0,a=o.length;r<a;r++){const s=o[r];let i=this.getDatasetMeta(r);const l=s.type||this.config.type;if(i.type&&i.type!==l&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=l,i.indexAxis=s.indexAxis||Cs(l,this.options),i.order=s.order||0,i.index=r,i.label=""+s.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const c=nn.getController(l),{datasetElementType:d,dataElementType:u}=pt.datasets[l];Object.assign(c,{dataElementType:nn.getElement(u),datasetElementType:d&&nn.getElement(d)}),i.controller=new c(this,r),n.push(i.controller)}}return this._updateMetasets(),n}_resetElements(){nt(this.data.datasets,(n,o)=>{this.getDatasetMeta(o).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(n){const o=this.config;o.update();const r=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:n,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:h}=this.getDatasetMeta(d),f=!a&&s.indexOf(h)===-1;h.buildOrUpdateElements(f),i=Math.max(+h.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),a||nt(s,d=>{d.reset()}),this._updateDatasets(n),this.notifyPlugins("afterUpdate",{mode:n}),this._layers.sort(Uc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){nt(this.scales,n=>{jt.removeBox(this,n)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const n=this.options,o=new Set(Object.keys(this._listeners)),r=new Set(n.events);(!_l(o,r)||!!this._responsiveListeners!==n.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:n}=this,o=this._getUniformDataChanges()||[];for(const{method:r,start:a,count:s}of o){const i=r==="_removeElements"?-s:s;mb(n,a,i)}}_getUniformDataChanges(){const n=this._dataChanges;if(!n||!n.length)return;this._dataChanges=[];const o=this.data.datasets.length,r=s=>new Set(n.filter(i=>i[0]===s).map((i,l)=>l+","+i.splice(1).join(","))),a=r(0);for(let s=1;s<o;s++)if(!_l(a,r(s)))return;return Array.from(a).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(n){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;jt.update(this,this.width,this.height,n);const o=this.chartArea,r=o.width<=0||o.height<=0;this._layers=[],nt(this.boxes,a=>{r&&a.position==="chartArea"||(a.configure&&a.configure(),this._layers.push(...a._layers()))},this),this._layers.forEach((a,s)=>{a._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(n){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:n,cancelable:!0})!==!1){for(let o=0,r=this.data.datasets.length;o<r;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,r=this.data.datasets.length;o<r;++o)this._updateDataset(o,Nn(n)?n({datasetIndex:o}):n);this.notifyPlugins("afterDatasetsUpdate",{mode:n})}}_updateDataset(n,o){const r=this.getDatasetMeta(n),a={meta:r,index:n,mode:o,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",a)!==!1&&(r.controller._update(o),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(yn.has(this)?this.attached&&!yn.running(this)&&yn.start(this):(this.draw(),Hc({chart:this})))}draw(){let n;if(this._resizeBeforeDraw){const{width:r,height:a}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,a)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const o=this._layers;for(n=0;n<o.length&&o[n].z<=0;++n)o[n].draw(this.chartArea);for(this._drawDatasets();n<o.length;++n)o[n].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(n){const o=this._sortedMetasets,r=[];let a,s;for(a=0,s=o.length;a<s;++a){const i=o[a];(!n||i.visible)&&r.push(i)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const n=this.getSortedVisibleDatasetMetas();for(let o=n.length-1;o>=0;--o)this._drawDataset(n[o]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(n){const o=this.ctx,r={meta:n,index:n.index,cancelable:!0},a=lc(this,n);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(a&&Ar(o,a),n.controller.draw(),a&&Vr(o),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(n){return jo(n,this.chartArea,this._minPadding)}getElementsAtEventForMode(n,o,r,a){const s=f0.modes[o];return typeof s=="function"?s(this,n,r,a):[]}getDatasetMeta(n){const o=this.data.datasets[n],r=this._metasets;let a=r.filter(s=>s&&s._dataset===o).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:o&&o.order||0,index:n,_dataset:o,_parsed:[],_sorted:!1},r.push(a)),a}getContext(){return this.$context||(this.$context=Xn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(n){const o=this.data.datasets[n];if(!o)return!1;const r=this.getDatasetMeta(n);return typeof r.hidden=="boolean"?!r.hidden:!o.hidden}setDatasetVisibility(n,o){const r=this.getDatasetMeta(n);r.hidden=!o}toggleDataVisibility(n){this._hiddenIndices[n]=!this._hiddenIndices[n]}getDataVisibility(n){return!this._hiddenIndices[n]}_updateVisibility(n,o,r){const a=r?"show":"hide",s=this.getDatasetMeta(n),i=s.controller._resolveAnimations(void 0,a);Fo(o)?(s.data[o].hidden=!r,this.update()):(this.setDatasetVisibility(n,r),i.update(s,{visible:r}),this.update(l=>l.datasetIndex===n?a:void 0))}hide(n,o){this._updateVisibility(n,o,!1)}show(n,o){this._updateVisibility(n,o,!0)}_destroyDatasetMeta(n){const o=this._metasets[n];o&&o.controller&&o.controller._destroy(),delete this._metasets[n]}_stop(){let n,o;for(this.stop(),yn.remove(this),n=0,o=this.data.datasets.length;n<o;++n)this._destroyDatasetMeta(n)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:n,ctx:o}=this;this._stop(),this.config.clearCache(),n&&(this.unbindEvents(),jl(n,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete Ur[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...n){return this.canvas.toDataURL(...n)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const n=this._listeners,o=this.platform,r=(s,i)=>{o.addEventListener(this,s,i),n[s]=i},a=(s,i,l)=>{s.offsetX=i,s.offsetY=l,this._eventHandler(s)};nt(this.options.events,s=>r(s,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const n=this._responsiveListeners,o=this.platform,r=(c,d)=>{o.addEventListener(this,c,d),n[c]=d},a=(c,d)=>{n[c]&&(o.removeEventListener(this,c,d),delete n[c])},s=(c,d)=>{this.canvas&&this.resize(c,d)};let i;const l=()=>{a("attach",l),this.attached=!0,this.resize(),r("resize",s),r("detach",i)};i=()=>{this.attached=!1,a("resize",s),this._stop(),this._resize(0,0),r("attach",l)},o.isAttached(this.canvas)?l():i()}unbindEvents(){nt(this._listeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._listeners={},nt(this._responsiveListeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._responsiveListeners=void 0}updateHoverStyle(n,o,r){const a=r?"set":"remove";let s,i,l,c;for(o==="dataset"&&(s=this.getDatasetMeta(n[0].datasetIndex),s.controller["_"+a+"DatasetHoverStyle"]()),l=0,c=n.length;l<c;++l){i=n[l];const d=i&&this.getDatasetMeta(i.datasetIndex).controller;d&&d[a+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(n){const o=this._active||[],r=n.map(({datasetIndex:s,index:i})=>{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[i],index:i}});!Er(r,o)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,o))}notifyPlugins(n,o,r){return this._plugins.notify(this,n,o,r)}isPluginEnabled(n){return this._plugins._cache.filter(o=>o.plugin.id===n).length===1}_updateHoverStyles(n,o,r){const a=this.options.hover,s=(c,d)=>c.filter(u=>!d.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),i=s(o,n),l=r?n:s(n,o);i.length&&this.updateHoverStyle(i,a.mode,!1),l.length&&a.mode&&this.updateHoverStyle(l,a.mode,!0)}_eventHandler(n,o){const r={event:n,replay:o,cancelable:!0,inChartArea:this.isPointInArea(n)},a=i=>(i.options.events||this.options.events).includes(n.native.type);if(this.notifyPlugins("beforeEvent",r,a)===!1)return;const s=this._handleEvent(n,o,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,a),(s||r.changed)&&this.render(),this}_handleEvent(n,o,r){const{_active:a=[],options:s}=this,i=o,l=this._getActiveElements(n,a,r,i),c=xp(n),d=pb(n,this._lastEvent,r,c);r&&(this._lastEvent=null,it(s.onHover,[n,l,this],this),c&&it(s.onClick,[n,l,this],this));const u=!Er(l,a);return(u||o)&&(this._active=l,this._updateHoverStyles(l,a,o)),this._lastEvent=d,u}_getActiveElements(n,o,r,a){if(n.type==="mouseout")return[];if(!r)return o;const s=this.options.hover;return this.getElementsAtEventForMode(n,s.mode,s,a)}}_e(kn,"defaults",pt),_e(kn,"instances",Ur),_e(kn,"overrides",qn),_e(kn,"registry",nn),_e(kn,"version",ub),_e(kn,"getChart",Gc);function Xc(){return nt(kn.instances,t=>t._plugins.invalidate())}function gb(t,n,o){const{startAngle:r,x:a,y:s,outerRadius:i,innerRadius:l,options:c}=n,{borderWidth:d,borderJoinStyle:u}=c,h=Math.min(d/i,Tt(r-o));if(t.beginPath(),t.arc(a,s,i-d/2,r+h/2,o-h/2),l>0){const f=Math.min(d/l,Tt(r-o));t.arc(a,s,l+d/2,o-f/2,r+f/2,!0)}else{const f=Math.min(d/2,i*Tt(r-o));if(u==="round")t.arc(a,s,f,o-ot/2,r+ot/2,!0);else if(u==="bevel"){const m=2*f*f,g=-m*Math.cos(o+ot/2)+a,b=-m*Math.sin(o+ot/2)+s,x=m*Math.cos(r+ot/2)+a,p=m*Math.sin(r+ot/2)+s;t.lineTo(g,b),t.lineTo(x,p)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function bb(t,n,o){const{startAngle:r,pixelMargin:a,x:s,y:i,outerRadius:l,innerRadius:c}=n;let d=a/l;t.beginPath(),t.arc(s,i,l,r-d,o+d),c>a?(d=a/c,t.arc(s,i,c,o+d,r-d,!0)):t.arc(s,i,a,o+kt,r-kt),t.closePath(),t.clip()}function yb(t){return is(t,["outerStart","outerEnd","innerStart","innerEnd"])}function xb(t,n,o,r){const a=yb(t.options.borderRadius),s=(o-n)/2,i=Math.min(s,r*n/2),l=c=>{const d=(o-Math.min(s,c))*r/2;return Bt(c,0,Math.min(s,d))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:Bt(a.innerStart,0,i),innerEnd:Bt(a.innerEnd,0,i)}}function po(t,n,o,r){return{x:o+t*Math.cos(n),y:r+t*Math.sin(n)}}function Hr(t,n,o,r,a,s){const{x:i,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=n,h=Math.max(n.outerRadius+r+o-d,0),f=u>0?u+r+o+d:0;let m=0;const g=a-c;if(r){const X=u>0?u-r:0,$=h>0?h-r:0,G=(X+$)/2,ne=G!==0?g*G/(G+r):g;m=(g-ne)/2}const b=Math.max(.001,g*h-o/ot)/h,x=(g-b)/2,p=c+x+m,C=a-x-m,{outerStart:w,outerEnd:E,innerStart:_,innerEnd:B}=xb(n,f,h,C-p),k=h-w,y=h-E,V=p+w/k,D=C-E/y,N=f+_,A=f+B,T=p+_/N,P=C-B/A;if(t.beginPath(),s){const X=(V+D)/2;if(t.arc(i,l,h,V,X),t.arc(i,l,h,X,D),E>0){const K=po(y,D,i,l);t.arc(K.x,K.y,E,D,C+kt)}const $=po(A,C,i,l);if(t.lineTo($.x,$.y),B>0){const K=po(A,P,i,l);t.arc(K.x,K.y,B,C+kt,P+Math.PI)}const G=(C-B/f+(p+_/f))/2;if(t.arc(i,l,f,C-B/f,G,!0),t.arc(i,l,f,G,p+_/f,!0),_>0){const K=po(N,T,i,l);t.arc(K.x,K.y,_,T+Math.PI,p-kt)}const ne=po(k,p,i,l);if(t.lineTo(ne.x,ne.y),w>0){const K=po(k,V,i,l);t.arc(K.x,K.y,w,p-kt,V)}}else{t.moveTo(i,l);const X=Math.cos(V)*h+i,$=Math.sin(V)*h+l;t.lineTo(X,$);const G=Math.cos(D)*h+i,ne=Math.sin(D)*h+l;t.lineTo(G,ne)}t.closePath()}function kb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l}=n;let c=n.endAngle;if(s){Hr(t,n,o,r,c,a);for(let d=0;d<s;++d)t.fill();isNaN(l)||(c=i+(l%dt||dt))}return Hr(t,n,o,r,c,a),t.fill(),c}function wb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l,options:c}=n,{borderWidth:d,borderJoinStyle:u,borderDash:h,borderDashOffset:f,borderRadius:m}=c,g=c.borderAlign==="inner";if(!d)return;t.setLineDash(h||[]),t.lineDashOffset=f,g?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let b=n.endAngle;if(s){Hr(t,n,o,r,b,a);for(let x=0;x<s;++x)t.stroke();isNaN(l)||(b=i+(l%dt||dt))}g&&bb(t,n,b),c.selfJoin&&b-i>=ot&&m===0&&u!=="miter"&&gb(t,n,b),s||(Hr(t,n,o,r,b,a),t.stroke())}class Jo extends xn{constructor(o){super();_e(this,"circumference");_e(this,"endAngle");_e(this,"fullCircles");_e(this,"innerRadius");_e(this,"outerRadius");_e(this,"pixelMargin");_e(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,o&&Object.assign(this,o)}inRange(o,r,a){const s=this.getProps(["x","y"],a),{angle:i,distance:l}=Nl(s,{x:o,y:r}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),m=(this.options.spacing+this.options.borderWidth)/2,g=Re(f,d-c),b=Ro(i,c,d)&&c!==d,x=g>=dt||b,p=bn(l,u+m,h+m);return x&&p}getCenterPoint(o){const{x:r,y:a,startAngle:s,endAngle:i,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],o),{offset:d,spacing:u}=this.options,h=(s+i)/2,f=(l+c+u+d)/2;return{x:r+Math.cos(h)*f,y:a+Math.sin(h)*f}}tooltipPosition(o){return this.getCenterPoint(o)}draw(o){const{options:r,circumference:a}=this,s=(r.offset||0)/4,i=(r.spacing||0)/2,l=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=a>dt?Math.floor(a/dt):0,a===0||this.innerRadius<0||this.outerRadius<0)return;o.save();const c=(this.startAngle+this.endAngle)/2;o.translate(Math.cos(c)*s,Math.sin(c)*s);const d=1-Math.sin(Math.min(ot,a||0)),u=s*d;o.fillStyle=r.backgroundColor,o.strokeStyle=r.borderColor,kb(o,this,u,i,l),wb(o,this,u,i,l),o.restore()}}_e(Jo,"id","arc"),_e(Jo,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),_e(Jo,"defaultRoutes",{backgroundColor:"backgroundColor"}),_e(Jo,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function Kc(t,n,o=n){t.lineCap=Re(o.borderCapStyle,n.borderCapStyle),t.setLineDash(Re(o.borderDash,n.borderDash)),t.lineDashOffset=Re(o.borderDashOffset,n.borderDashOffset),t.lineJoin=Re(o.borderJoinStyle,n.borderJoinStyle),t.lineWidth=Re(o.borderWidth,n.borderWidth),t.strokeStyle=Re(o.borderColor,n.borderColor)}function Cb(t,n,o){t.lineTo(o.x,o.y)}function Eb(t){return t.stepped?qp:t.tension||t.cubicInterpolationMode==="monotone"?Gp:Cb}function Yc(t,n,o={}){const r=t.length,{start:a=0,end:s=r-1}=o,{start:i,end:l}=n,c=Math.max(a,i),d=Math.min(s,l),u=a<i&&s<i||a>l&&s>l;return{count:r,start:c,loop:n.loop,ilen:d<c&&!u?r+d-c:d-c}}function Bb(t,n,o,r){const{points:a,options:s}=n,{count:i,start:l,loop:c,ilen:d}=Yc(a,o,r),u=Eb(s);let{move:h=!0,reverse:f}=r||{},m,g,b;for(m=0;m<=d;++m)g=a[(l+(f?d-m:m))%i],!g.skip&&(h?(t.moveTo(g.x,g.y),h=!1):u(t,b,g,f,s.stepped),b=g);return c&&(g=a[(l+(f?d:0))%i],u(t,b,g,f,s.stepped)),!!c}function _b(t,n,o,r){const a=n.points,{count:s,start:i,ilen:l}=Yc(a,o,r),{move:c=!0,reverse:d}=r||{};let u=0,h=0,f,m,g,b,x,p;const C=E=>(i+(d?l-E:E))%s,w=()=>{b!==x&&(t.lineTo(u,x),t.lineTo(u,b),t.lineTo(u,p))};for(c&&(m=a[C(0)],t.moveTo(m.x,m.y)),f=0;f<=l;++f){if(m=a[C(f)],m.skip)continue;const E=m.x,_=m.y,B=E|0;B===g?(_<b?b=_:_>x&&(x=_),u=(h*u+E)/++h):(w(),t.lineTo(E,_),g=B,h=0,b=x=_),p=_}w()}function Bs(t){const n=t.options,o=n.borderDash&&n.borderDash.length;return!t._decimated&&!t._loop&&!n.tension&&n.cubicInterpolationMode!=="monotone"&&!n.stepped&&!o?_b:Bb}function Sb(t){return t.stepped?_g:t.tension||t.cubicInterpolationMode==="monotone"?Sg:Jn}function Ab(t,n,o,r){let a=n._path;a||(a=n._path=new Path2D,n.path(a,o,r)&&a.closePath()),Kc(t,n.options),t.stroke(a)}function Vb(t,n,o,r){const{segments:a,options:s}=n,i=Bs(n);for(const l of a)Kc(t,s,l.style),t.beginPath(),i(t,n,l,{start:o,end:o+r-1})&&t.closePath(),t.stroke()}const Db=typeof Path2D=="function";function Nb(t,n,o,r){Db&&!n.options.segment?Ab(t,n,o,r):Vb(t,n,o,r)}class vn extends xn{constructor(n){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,n&&Object.assign(this,n)}updateControlPoints(n,o){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const a=r.spanGaps?this._loop:this._fullLoop;bg(this._points,r,n,a,o),this._pointsUpdated=!0}}set points(n){this._points=n,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=vg(this,this.options.segment))}first(){const n=this.segments,o=this.points;return n.length&&o[n[0].start]}last(){const n=this.segments,o=this.points,r=n.length;return r&&o[n[r-1].end]}interpolate(n,o){const r=this.options,a=n[o],s=this.points,i=ac(this,{property:o,start:a,end:a});if(!i.length)return;const l=[],c=Sb(r);let d,u;for(d=0,u=i.length;d<u;++d){const{start:h,end:f}=i[d],m=s[h],g=s[f];if(m===g){l.push(m);continue}const b=Math.abs((a-m[o])/(g[o]-m[o])),x=c(m,g,b,r.stepped);x[o]=n[o],l.push(x)}return l.length===1?l[0]:l}pathSegment(n,o,r){return Bs(this)(n,this,o,r)}path(n,o,r){const a=this.segments,s=Bs(this);let i=this._loop;o=o||0,r=r||this.points.length-o;for(const l of a)i&=s(n,this,l,{start:o,end:o+r-1});return!!i}draw(n,o,r,a){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(n.save(),Nb(n,this,r,a),n.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}_e(vn,"id","line"),_e(vn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),_e(vn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),_e(vn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"});function Jc(t,n,o,r){const a=t.options,{[o]:s}=t.getProps([o],r);return Math.abs(n-s)<a.radius+a.hitRadius}class qr extends xn{constructor(o){super();_e(this,"parsed");_e(this,"skip");_e(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,o&&Object.assign(this,o)}inRange(o,r,a){const s=this.options,{x:i,y:l}=this.getProps(["x","y"],a);return Math.pow(o-i,2)+Math.pow(r-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(o,r){return Jc(this,o,"x",r)}inYRange(o,r){return Jc(this,o,"y",r)}getCenterPoint(o){const{x:r,y:a}=this.getProps(["x","y"],o);return{x:r,y:a}}size(o){o=o||this.options||{};let r=o.radius||0;r=Math.max(r,r&&o.hoverRadius||0);const a=r&&o.borderWidth||0;return(r+a)*2}draw(o,r){const a=this.options;this.skip||a.radius<.1||!jo(this,r,this.size(a)/2)||(o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.fillStyle=a.backgroundColor,ss(o,a,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}_e(qr,"id","point"),_e(qr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),_e(qr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Qc(t,n){const{x:o,y:r,base:a,width:s,height:i}=t.getProps(["x","y","base","width","height"],n);let l,c,d,u,h;return t.horizontal?(h=i/2,l=Math.min(o,a),c=Math.max(o,a),d=r-h,u=r+h):(h=s/2,l=o-h,c=o+h,d=Math.min(r,a),u=Math.max(r,a)),{left:l,top:d,right:c,bottom:u}}function Pn(t,n,o,r){return t?0:Bt(n,o,r)}function Mb(t,n,o){const r=t.options.borderWidth,a=t.borderSkipped,s=Ul(r);return{t:Pn(a.top,s.top,0,o),r:Pn(a.right,s.right,0,n),b:Pn(a.bottom,s.bottom,0,o),l:Pn(a.left,s.left,0,n)}}function vb(t,n,o){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,s=lo(a),i=Math.min(n,o),l=t.borderSkipped,c=r||Ue(a);return{topLeft:Pn(!c||l.top||l.left,s.topLeft,0,i),topRight:Pn(!c||l.top||l.right,s.topRight,0,i),bottomLeft:Pn(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:Pn(!c||l.bottom||l.right,s.bottomRight,0,i)}}function Pb(t){const n=Qc(t),o=n.right-n.left,r=n.bottom-n.top,a=Mb(t,o/2,r/2),s=vb(t,o/2,r/2);return{outer:{x:n.left,y:n.top,w:o,h:r,radius:s},inner:{x:n.left+a.l,y:n.top+a.t,w:o-a.l-a.r,h:r-a.t-a.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,s.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(a.b,a.r))}}}}function _s(t,n,o,r){const a=n===null,s=o===null,l=t&&!(a&&s)&&Qc(t,r);return l&&(a||bn(n,l.left,l.right))&&(s||bn(o,l.top,l.bottom))}function Tb(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function Ob(t,n){t.rect(n.x,n.y,n.w,n.h)}function Ss(t,n,o={}){const r=t.x!==o.x?-n:0,a=t.y!==o.y?-n:0,s=(t.x+t.w!==o.x+o.w?n:0)-r,i=(t.y+t.h!==o.y+o.h?n:0)-a;return{x:t.x+r,y:t.y+a,w:t.w+s,h:t.h+i,radius:t.radius}}class Gr extends xn{constructor(n){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,n&&Object.assign(this,n)}draw(n){const{inflateAmount:o,options:{borderColor:r,backgroundColor:a}}=this,{inner:s,outer:i}=Pb(this),l=Tb(i.radius)?Dr:Ob;n.save(),(i.w!==s.w||i.h!==s.h)&&(n.beginPath(),l(n,Ss(i,o,s)),n.clip(),l(n,Ss(s,-o,i)),n.fillStyle=r,n.fill("evenodd")),n.beginPath(),l(n,Ss(s,o)),n.fillStyle=a,n.fill(),n.restore()}inRange(n,o,r){return _s(this,n,o,r)}inXRange(n,o){return _s(this,n,null,o)}inYRange(n,o){return _s(this,null,n,o)}getCenterPoint(n){const{x:o,y:r,base:a,horizontal:s}=this.getProps(["x","y","base","horizontal"],n);return{x:s?(o+a)/2:o,y:s?r:(r+a)/2}}getRange(n){return n==="x"?this.width/2:this.height/2}}_e(Gr,"id","bar"),_e(Gr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),_e(Gr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Fb(t,n,o){const r=t.segments,a=t.points,s=n.points,i=[];for(const l of r){let{start:c,end:d}=l;d=Xr(c,d,a);const u=As(o,a[c],a[d],l.loop);if(!n.segments){i.push({source:l,target:u,start:a[c],end:a[d]});continue}const h=ac(n,u);for(const f of h){const m=As(o,s[f.start],s[f.end],f.loop),g=rc(l,a,m);for(const b of g)i.push({source:b,target:f,start:{[o]:Zc(u,m,"start",Math.max)},end:{[o]:Zc(u,m,"end",Math.min)}})}}return i}function As(t,n,o,r){if(r)return;let a=n[t],s=o[t];return t==="angle"&&(a=Tt(a),s=Tt(s)),{property:t,start:a,end:s}}function zb(t,n){const{x:o=null,y:r=null}=t||{},a=n.points,s=[];return n.segments.forEach(({start:i,end:l})=>{l=Xr(i,l,a);const c=a[i],d=a[l];r!==null?(s.push({x:c.x,y:r}),s.push({x:d.x,y:r})):o!==null&&(s.push({x:o,y:c.y}),s.push({x:o,y:d.y}))}),s}function Xr(t,n,o){for(;n>t;n--){const r=o[n];if(!isNaN(r.x)&&!isNaN(r.y))break}return n}function Zc(t,n,o,r){return t&&n?r(t[o],n[o]):t?t[o]:n?n[o]:0}function ed(t,n){let o=[],r=!1;return gt(t)?(r=!0,o=t):o=zb(t,n),o.length?new vn({points:o,options:{tension:0},_loop:r,_fullLoop:r}):null}function td(t){return t&&t.fill!==!1}function Ib(t,n,o){let a=t[n].fill;const s=[n];let i;if(!o)return a;for(;a!==!1&&s.indexOf(a)===-1;){if(!Et(a))return a;if(i=t[a],!i)return!1;if(i.visible)return a;s.push(a),a=i.fill}return!1}function Rb(t,n,o){const r=Wb(t);if(Ue(r))return isNaN(r.value)?!1:r;let a=parseFloat(r);return Et(a)&&Math.floor(a)===a?Lb(r[0],n,a,o):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Lb(t,n,o,r){return(t==="-"||t==="+")&&(o=n+o),o===n||o<0||o>=r?!1:o}function $b(t,n){let o=null;return t==="start"?o=n.bottom:t==="end"?o=n.top:Ue(t)?o=n.getPixelForValue(t.value):n.getBasePixel&&(o=n.getBasePixel()),o}function jb(t,n,o){let r;return t==="start"?r=o:t==="end"?r=n.options.reverse?n.min:n.max:Ue(t)?r=t.value:r=n.getBaseValue(),r}function Wb(t){const n=t.options,o=n.fill;let r=Re(o&&o.target,o);return r===void 0&&(r=!!n.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Ub(t){const{scale:n,index:o,line:r}=t,a=[],s=r.segments,i=r.points,l=Hb(n,o);l.push(ed({x:null,y:n.bottom},r));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)qb(a,i[u],l)}return new vn({points:a,options:{}})}function Hb(t,n){const o=[],r=t.getMatchingVisibleMetas("line");for(let a=0;a<r.length;a++){const s=r[a];if(s.index===n)break;s.hidden||o.unshift(s.dataset)}return o}function qb(t,n,o){const r=[];for(let a=0;a<o.length;a++){const s=o[a],{first:i,last:l,point:c}=Gb(s,n,"x");if(!(!c||i&&l)){if(i)r.unshift(c);else if(t.push(c),!l)break}}t.push(...r)}function Gb(t,n,o){const r=t.interpolate(n,o);if(!r)return{};const a=r[o],s=t.segments,i=t.points;let l=!1,c=!1;for(let d=0;d<s.length;d++){const u=s[d],h=i[u.start][o],f=i[u.end][o];if(bn(a,h,f)){l=a===h,c=a===f;break}}return{first:l,last:c,point:r}}class nd{constructor(n){this.x=n.x,this.y=n.y,this.radius=n.radius}pathSegment(n,o,r){const{x:a,y:s,radius:i}=this;return o=o||{start:0,end:dt},n.arc(a,s,i,o.end,o.start,!0),!r.bounds}interpolate(n){const{x:o,y:r,radius:a}=this,s=n.angle;return{x:o+Math.cos(s)*a,y:r+Math.sin(s)*a,angle:s}}}function Xb(t){const{chart:n,fill:o,line:r}=t;if(Et(o))return Kb(n,o);if(o==="stack")return Ub(t);if(o==="shape")return!0;const a=Yb(t);return a instanceof nd?a:ed(a,r)}function Kb(t,n){const o=t.getDatasetMeta(n);return o&&t.isDatasetVisible(n)?o.dataset:null}function Yb(t){return(t.scale||{}).getPointPositionForValue?Qb(t):Jb(t)}function Jb(t){const{scale:n={},fill:o}=t,r=$b(o,n);if(Et(r)){const a=n.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}function Qb(t){const{scale:n,fill:o}=t,r=n.options,a=n.getLabels().length,s=r.reverse?n.max:n.min,i=jb(o,n,s),l=[];if(r.grid.circular){const c=n.getPointPositionForValue(0,s);return new nd({x:c.x,y:c.y,radius:n.getDistanceFromCenterForValue(i)})}for(let c=0;c<a;++c)l.push(n.getPointPositionForValue(c,i));return l}function Vs(t,n,o){const r=Xb(n),{chart:a,index:s,line:i,scale:l,axis:c}=n,d=i.options,u=d.fill,h=d.backgroundColor,{above:f=h,below:m=h}=u||{},g=a.getDatasetMeta(s),b=lc(a,g);r&&i.points.length&&(Ar(t,o),Zb(t,{line:i,target:r,above:f,below:m,area:o,scale:l,axis:c,clip:b}),Vr(t))}function Zb(t,n){const{line:o,target:r,above:a,below:s,area:i,scale:l,clip:c}=n,d=o._loop?"angle":n.axis;t.save();let u=s;s!==a&&(d==="x"?(od(t,r,i.top),Ds(t,{line:o,target:r,color:a,scale:l,property:d,clip:c}),t.restore(),t.save(),od(t,r,i.bottom)):d==="y"&&(rd(t,r,i.left),Ds(t,{line:o,target:r,color:s,scale:l,property:d,clip:c}),t.restore(),t.save(),rd(t,r,i.right),u=a)),Ds(t,{line:o,target:r,color:u,scale:l,property:d,clip:c}),t.restore()}function od(t,n,o){const{segments:r,points:a}=n;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],h=a[Xr(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(u.x,o),t.lineTo(u.x,u.y)),i=!!n.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(h.x,o)}t.lineTo(n.first().x,o),t.closePath(),t.clip()}function rd(t,n,o){const{segments:r,points:a}=n;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],h=a[Xr(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(o,u.y),t.lineTo(u.x,u.y)),i=!!n.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(o,h.y)}t.lineTo(o,n.first().y),t.closePath(),t.clip()}function Ds(t,n){const{line:o,target:r,property:a,color:s,scale:i,clip:l}=n,c=Fb(o,r,a);for(const{source:d,target:u,start:h,end:f}of c){const{style:{backgroundColor:m=s}={}}=d,g=r!==!0;t.save(),t.fillStyle=m,ey(t,i,l,g&&As(a,h,f)),t.beginPath();const b=!!o.pathSegment(t,d);let x;if(g){b?t.closePath():ad(t,r,f,a);const p=!!r.pathSegment(t,u,{move:b,reverse:!0});x=b&&p,x||ad(t,r,h,a)}t.closePath(),t.fill(x?"evenodd":"nonzero"),t.restore()}}function ey(t,n,o,r){const a=n.chart.chartArea,{property:s,start:i,end:l}=r||{};if(s==="x"||s==="y"){let c,d,u,h;s==="x"?(c=i,d=a.top,u=l,h=a.bottom):(c=a.left,d=i,u=a.right,h=l),t.beginPath(),o&&(c=Math.max(c,o.left),u=Math.min(u,o.right),d=Math.max(d,o.top),h=Math.min(h,o.bottom)),t.rect(c,d,u-c,h-d),t.clip()}}function ad(t,n,o,r){const a=n.interpolate(o,r);a&&t.lineTo(a.x,a.y)}var ty={id:"filler",afterDatasetsUpdate(t,n,o){const r=(t.data.datasets||[]).length,a=[];let s,i,l,c;for(i=0;i<r;++i)s=t.getDatasetMeta(i),l=s.dataset,c=null,l&&l.options&&l instanceof vn&&(c={visible:t.isDatasetVisible(i),index:i,fill:Rb(l,i,r),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=c,a.push(c);for(i=0;i<r;++i)c=a[i],!(!c||c.fill===!1)&&(c.fill=Ib(a,i,o.propagate))},beforeDraw(t,n,o){const r=o.drawTime==="beforeDraw",a=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let i=a.length-1;i>=0;--i){const l=a[i].$filler;l&&(l.line.updateControlPoints(s,l.axis),r&&l.fill&&Vs(t.ctx,l,s))}},beforeDatasetsDraw(t,n,o){if(o.drawTime!=="beforeDatasetsDraw")return;const r=t.getSortedVisibleDatasetMetas();for(let a=r.length-1;a>=0;--a){const s=r[a].$filler;td(s)&&Vs(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,n,o){const r=n.meta.$filler;!td(r)||o.drawTime!=="beforeDatasetDraw"||Vs(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const sd=(t,n)=>{let{boxHeight:o=n,boxWidth:r=n}=t;return t.usePointStyle&&(o=Math.min(o,n),r=t.pointStyleWidth||Math.min(r,n)),{boxWidth:r,boxHeight:o,itemHeight:Math.max(n,o)}},ny=(t,n)=>t!==null&&n!==null&&t.datasetIndex===n.datasetIndex&&t.index===n.index;class id extends xn{constructor(n){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=n.chart,this.options=n.options,this.ctx=n.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(n,o,r){this.maxWidth=n,this.maxHeight=o,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const n=this.options.labels||{};let o=it(n.generateLabels,[this.chart],this)||[];n.filter&&(o=o.filter(r=>n.filter(r,this.chart.data))),n.sort&&(o=o.sort((r,a)=>n.sort(r,a,this.chart.data))),this.options.reverse&&o.reverse(),this.legendItems=o}fit(){const{options:n,ctx:o}=this;if(!n.display){this.width=this.height=0;return}const r=n.labels,a=St(r.font),s=a.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=sd(r,s);let d,u;o.font=a.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(i,s,l,c)+10):(u=this.maxHeight,d=this._fitCols(i,a,l,c)+10),this.width=Math.min(d,n.maxWidth||this.maxWidth),this.height=Math.min(u,n.maxHeight||this.maxHeight)}_fitRows(n,o,r,a){const{ctx:s,maxWidth:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=a+l;let h=n;s.textAlign="left",s.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((g,b)=>{const x=r+o/2+s.measureText(g.text).width;(b===0||d[d.length-1]+x+2*l>i)&&(h+=u,d[d.length-(b>0?0:1)]=0,m+=u,f++),c[b]={left:0,top:m,row:f,width:x,height:a},d[d.length-1]+=x+l}),h}_fitCols(n,o,r,a){const{ctx:s,maxHeight:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=i-n;let h=l,f=0,m=0,g=0,b=0;return this.legendItems.forEach((x,p)=>{const{itemWidth:C,itemHeight:w}=oy(r,o,s,x,a);p>0&&m+w+2*l>u&&(h+=f+l,d.push({width:f,height:m}),g+=f+l,b++,f=m=0),c[p]={left:g,top:m,col:b,width:C,height:w},f=Math.max(f,C),m+=w+l}),h+=f,d.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const n=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:r,labels:{padding:a},rtl:s}}=this,i=fo(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=_t(r,this.left+a,this.right-this.lineWidths[l]);for(const d of o)l!==d.row&&(l=d.row,c=_t(r,this.left+a,this.right-this.lineWidths[l])),d.top+=this.top+n+a,d.left=i.leftForLtr(i.x(c),d.width),c+=d.width+a}else{let l=0,c=_t(r,this.top+n+a,this.bottom-this.columnSizes[l].height);for(const d of o)d.col!==l&&(l=d.col,c=_t(r,this.top+n+a,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+a,d.left=i.leftForLtr(i.x(d.left),d.width),c+=d.height+a}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const n=this.ctx;Ar(n,this),this._draw(),Vr(n)}}_draw(){const{options:n,columnSizes:o,lineWidths:r,ctx:a}=this,{align:s,labels:i}=n,l=pt.color,c=fo(n.rtl,this.left,this.width),d=St(i.font),{padding:u}=i,h=d.size,f=h/2;let m;this.drawTitle(),a.textAlign=c.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=d.string;const{boxWidth:g,boxHeight:b,itemHeight:x}=sd(i,h),p=function(B,k,y){if(isNaN(g)||g<=0||isNaN(b)||b<0)return;a.save();const V=Re(y.lineWidth,1);if(a.fillStyle=Re(y.fillStyle,l),a.lineCap=Re(y.lineCap,"butt"),a.lineDashOffset=Re(y.lineDashOffset,0),a.lineJoin=Re(y.lineJoin,"miter"),a.lineWidth=V,a.strokeStyle=Re(y.strokeStyle,l),a.setLineDash(Re(y.lineDash,[])),i.usePointStyle){const D={radius:b*Math.SQRT2/2,pointStyle:y.pointStyle,rotation:y.rotation,borderWidth:V},N=c.xPlus(B,g/2),A=k+f;Wl(a,D,N,A,i.pointStyleWidth&&g)}else{const D=k+Math.max((h-b)/2,0),N=c.leftForLtr(B,g),A=lo(y.borderRadius);a.beginPath(),Object.values(A).some(T=>T!==0)?Dr(a,{x:N,y:D,w:g,h:b,radius:A}):a.rect(N,D,g,b),a.fill(),V!==0&&a.stroke()}a.restore()},C=function(B,k,y){Wo(a,y.text,B,k+x/2,d,{strikethrough:y.hidden,textAlign:c.textAlign(y.textAlign)})},w=this.isHorizontal(),E=this._computeTitleHeight();w?m={x:_t(s,this.left+u,this.right-r[0]),y:this.top+u+E,line:0}:m={x:this.left+u,y:_t(s,this.top+E+u,this.bottom-o[0].height),line:0},ec(this.ctx,n.textDirection);const _=x+u;this.legendItems.forEach((B,k)=>{a.strokeStyle=B.fontColor,a.fillStyle=B.fontColor;const y=a.measureText(B.text).width,V=c.textAlign(B.textAlign||(B.textAlign=i.textAlign)),D=g+f+y;let N=m.x,A=m.y;c.setWidth(this.width),w?k>0&&N+D+u>this.right&&(A=m.y+=_,m.line++,N=m.x=_t(s,this.left+u,this.right-r[m.line])):k>0&&A+_>this.bottom&&(N=m.x=N+o[m.line].width+u,m.line++,A=m.y=_t(s,this.top+E+u,this.bottom-o[m.line].height));const T=c.x(N);if(p(T,A,B),N=Pp(V,N+g+f,w?N+D:this.right,n.rtl),C(c.x(N),A,B),w)m.x+=D+u;else if(typeof B.text!="string"){const P=d.lineHeight;m.y+=ld(B,P)+u}else m.y+=_}),tc(this.ctx,n.textDirection)}drawTitle(){const n=this.options,o=n.title,r=St(o.font),a=$t(o.padding);if(!o.display)return;const s=fo(n.rtl,this.left,this.width),i=this.ctx,l=o.position,c=r.size/2,d=a.top+c;let u,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+d,h=_t(n.align,h,this.right-f);else{const g=this.columnSizes.reduce((b,x)=>Math.max(b,x.height),0);u=d+_t(n.align,this.top,this.bottom-g-n.labels.padding-this._computeTitleHeight())}const m=_t(l,h,h+f);i.textAlign=s.textAlign(es(l)),i.textBaseline="middle",i.strokeStyle=o.color,i.fillStyle=o.color,i.font=r.string,Wo(i,o.text,m,u,r)}_computeTitleHeight(){const n=this.options.title,o=St(n.font),r=$t(n.padding);return n.display?o.lineHeight+r.height:0}_getLegendItemAt(n,o){let r,a,s;if(bn(n,this.left,this.right)&&bn(o,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(a=s[r],bn(n,a.left,a.left+a.width)&&bn(o,a.top,a.top+a.height))return this.legendItems[r]}return null}handleEvent(n){const o=this.options;if(!sy(n.type,o))return;const r=this._getLegendItemAt(n.x,n.y);if(n.type==="mousemove"||n.type==="mouseout"){const a=this._hoveredItem,s=ny(a,r);a&&!s&&it(o.onLeave,[n,a,this],this),this._hoveredItem=r,r&&!s&&it(o.onHover,[n,r,this],this)}else r&&it(o.onClick,[n,r,this],this)}}function oy(t,n,o,r,a){const s=ry(r,t,n,o),i=ay(a,r,n.lineHeight);return{itemWidth:s,itemHeight:i}}function ry(t,n,o,r){let a=t.text;return a&&typeof a!="string"&&(a=a.reduce((s,i)=>s.length>i.length?s:i)),n+o.size/2+r.measureText(a).width}function ay(t,n,o){let r=t;return typeof n.text!="string"&&(r=ld(n,o)),r}function ld(t,n){const o=t.text?t.text.length:0;return n*o}function sy(t,n){return!!((t==="mousemove"||t==="mouseout")&&(n.onHover||n.onLeave)||n.onClick&&(t==="click"||t==="mouseup"))}var iy={id:"legend",_element:id,start(t,n,o){const r=t.legend=new id({ctx:t.ctx,options:o,chart:t});jt.configure(t,r,o),jt.addBox(t,r)},stop(t){jt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,n,o){const r=t.legend;jt.configure(t,r,o),r.options=o},afterUpdate(t){const n=t.legend;n.buildLabels(),n.adjustHitBoxes()},afterEvent(t,n){n.replay||t.legend.handleEvent(n.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,n,o){const r=n.datasetIndex,a=o.chart;a.isDatasetVisible(r)?(a.hide(r),n.hidden=!0):(a.show(r),n.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const n=t.data.datasets,{labels:{usePointStyle:o,pointStyle:r,textAlign:a,color:s,useBorderRadius:i,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(o?0:void 0),u=$t(d.borderWidth);return{text:n[c.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:r||d.pointStyle,rotation:d.rotation,textAlign:a||d.textAlign,borderRadius:i&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class cd extends xn{constructor(n){super(),this.chart=n.chart,this.options=n.options,this.ctx=n.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(n,o){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=n,this.height=this.bottom=o;const a=gt(r.text)?r.text.length:1;this._padding=$t(r.padding);const s=a*St(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const n=this.options.position;return n==="top"||n==="bottom"}_drawArgs(n){const{top:o,left:r,bottom:a,right:s,options:i}=this,l=i.align;let c=0,d,u,h;return this.isHorizontal()?(u=_t(l,r,s),h=o+n,d=s-r):(i.position==="left"?(u=r+n,h=_t(l,a,o),c=ot*-.5):(u=s-n,h=_t(l,o,a),c=ot*.5),d=a-o),{titleX:u,titleY:h,maxWidth:d,rotation:c}}draw(){const n=this.ctx,o=this.options;if(!o.display)return;const r=St(o.font),s=r.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);Wo(n,o.text,0,0,r,{color:o.color,maxWidth:c,rotation:d,textAlign:es(o.align),textBaseline:"middle",translation:[i,l]})}}function ly(t,n){const o=new cd({ctx:t.ctx,options:n,chart:t});jt.configure(t,o,n),jt.addBox(t,o),t.titleBlock=o}var cy={id:"title",_element:cd,start(t,n,o){ly(t,o)},stop(t){const n=t.titleBlock;jt.removeBox(t,n),delete t.titleBlock},beforeUpdate(t,n,o){const r=t.titleBlock;jt.configure(t,r,o),r.options=o},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Qo={average(t){if(!t.length)return!1;let n,o,r=new Set,a=0,s=0;for(n=0,o=t.length;n<o;++n){const l=t[n].element;if(l&&l.hasValue()){const c=l.tooltipPosition();r.add(c.x),a+=c.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((l,c)=>l+c)/r.size,y:a/s}},nearest(t,n){if(!t.length)return!1;let o=n.x,r=n.y,a=Number.POSITIVE_INFINITY,s,i,l;for(s=0,i=t.length;s<i;++s){const c=t[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=Qa(n,d);u<a&&(a=u,l=c)}}if(l){const c=l.tooltipPosition();o=c.x,r=c.y}return{x:o,y:r}}};function on(t,n){return n&&(gt(n)?Array.prototype.push.apply(t,n):t.push(n)),t}function wn(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
16
+ */class Fg{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(n,o,r,a){const s=o.listeners[a],i=o.duration;s.forEach(l=>l({chart:n,initial:o.initial,numSteps:i,currentStep:Math.min(r-o.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=zl.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(n=Date.now()){let o=0;this._charts.forEach((r,a)=>{if(!r.running||!r.items.length)return;const s=r.items;let i=s.length-1,l=!1,c;for(;i>=0;--i)c=s[i],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(n),l=!0):(s[i]=s[s.length-1],s.pop());l&&(a.draw(),this._notify(a,r,n,"progress")),s.length||(r.running=!1,this._notify(a,r,n,"complete"),r.initial=!1),o+=s.length}),this._lastDate=n,o===0&&(this._running=!1)}_getAnims(n){const o=this._charts;let r=o.get(n);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},o.set(n,r)),r}listen(n,o,r){this._getAnims(n).listeners[o].push(r)}add(n,o){!o||!o.length||this._getAnims(n).items.push(...o)}has(n){return this._getAnims(n).items.length>0}start(n){const o=this._charts.get(n);o&&(o.running=!0,o.start=Date.now(),o.duration=o.items.reduce((r,a)=>Math.max(r,a._duration),0),this._refresh())}running(n){if(!this._running)return!1;const o=this._charts.get(n);return!(!o||!o.running||!o.items.length)}stop(n){const o=this._charts.get(n);if(!o||!o.items.length)return;const r=o.items;let a=r.length-1;for(;a>=0;--a)r[a].cancel();o.items=[],this._notify(n,o,Date.now(),"complete")}remove(n){return this._charts.delete(n)}}var yn=new Fg;const fc="transparent",zg={boolean(t,n,o){return o>.5?n:t},color(t,n,o){const r=$l(t||fc),a=r.valid&&$l(n||fc);return a&&a.valid?a.mix(r,o).hexString():n},number(t,n,o){return t+(n-t)*o}};class Ig{constructor(n,o,r,a){const s=o[r];a=vr([n.to,a,s,n.from]);const i=vr([n.from,s,a]);this._active=!0,this._fn=n.fn||zg[n.type||typeof i],this._easing=Wo[n.easing]||Wo.linear,this._start=Math.floor(Date.now()+(n.delay||0)),this._duration=this._total=Math.floor(n.duration),this._loop=!!n.loop,this._target=o,this._prop=r,this._from=i,this._to=a,this._promises=void 0}active(){return this._active}update(n,o,r){if(this._active){this._notify(!1);const a=this._target[this._prop],s=r-this._start,i=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(i,n.duration)),this._total+=s,this._loop=!!n.loop,this._to=vr([n.to,o,a,n.from]),this._from=vr([n.from,a,o])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(n){const o=n-this._start,r=this._duration,a=this._prop,s=this._from,i=this._loop,l=this._to;let c;if(this._active=s!==l&&(i||o<r),!this._active){this._target[a]=l,this._notify(!0);return}if(o<0){this._target[a]=s;return}c=o/r%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[a]=this._fn(s,l,c)}wait(){const n=this._promises||(this._promises=[]);return new Promise((o,r)=>{n.push({res:o,rej:r})})}_notify(n){const o=n?"res":"rej",r=this._promises||[];for(let a=0;a<r.length;a++)r[a][o]()}}class hc{constructor(n,o){this._chart=n,this._properties=new Map,this.configure(o)}configure(n){if(!Re(n))return;const o=Object.keys(dt.animation),r=this._properties;Object.getOwnPropertyNames(n).forEach(a=>{const s=n[a];if(!Re(s))return;const i={};for(const l of o)i[l]=s[l];(ht(s.properties)&&s.properties||[a]).forEach(l=>{(l===a||!r.has(l))&&r.set(l,i)})})}_animateOptions(n,o){const r=o.options,a=Lg(n,r);if(!a)return[];const s=this._createAnimations(a,r);return r.$shared&&Rg(n.options.$animations,r).then(()=>{n.options=r},()=>{}),s}_createAnimations(n,o){const r=this._properties,a=[],s=n.$animations||(n.$animations={}),i=Object.keys(o),l=Date.now();let c;for(c=i.length-1;c>=0;--c){const d=i[c];if(d.charAt(0)==="$")continue;if(d==="options"){a.push(...this._animateOptions(n,o));continue}const u=o[d];let f=s[d];const h=r.get(d);if(f)if(h&&f.active()){f.update(h,u,l);continue}else f.cancel();if(!h||!h.duration){n[d]=u;continue}s[d]=f=new Ig(h,n,d,u),a.push(f)}return a}update(n,o){if(this._properties.size===0){Object.assign(n,o);return}const r=this._createAnimations(n,o);if(r.length)return yn.add(this._chart,r),!0}}function Rg(t,n){const o=[],r=Object.keys(n);for(let a=0;a<r.length;a++){const s=t[r[a]];s&&s.active()&&o.push(s.wait())}return Promise.all(o)}function Lg(t,n){if(!n)return;let o=t.options;if(!o){t.options=n;return}return o.$shared&&(t.options=o=Object.assign({},o,{$shared:!1,$animations:{}})),o}function mc(t,n){const o=t&&t.options||{},r=o.reverse,a=o.min===void 0?n:0,s=o.max===void 0?n:0;return{start:r?s:a,end:r?a:s}}function $g(t,n,o){if(o===!1)return!1;const r=mc(t,o),a=mc(n,o);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}function jg(t){let n,o,r,a;return Re(t)?(n=t.top,o=t.right,r=t.bottom,a=t.left):n=o=r=a=t,{top:n,right:o,bottom:r,left:a,disabled:t===!1}}function pc(t,n){const o=[],r=t._getSortedDatasetMetas(n);let a,s;for(a=0,s=r.length;a<s;++a)o.push(r[a].index);return o}function gc(t,n,o,r={}){const a=t.keys,s=r.mode==="single";let i,l,c,d;if(n===null)return;let u=!1;for(i=0,l=a.length;i<l;++i){if(c=+a[i],c===o){if(u=!0,r.all)continue;break}d=t.values[c],kt(d)&&(s||n===0||on(n)===on(d))&&(n+=d)}return!u&&!r.all?0:n}function Wg(t,n){const{iScale:o,vScale:r}=n,a=o.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",i=Object.keys(t),l=new Array(i.length);let c,d,u;for(c=0,d=i.length;c<d;++c)u=i[c],l[c]={[a]:u,[s]:t[u]};return l}function bs(t,n){const o=t&&t.options.stacked;return o||o===void 0&&n.stack!==void 0}function Ug(t,n,o){return`${t.id}.${n.id}.${o.stack||o.type}`}function Hg(t){const{min:n,max:o,minDefined:r,maxDefined:a}=t.getUserBounds();return{min:r?n:Number.NEGATIVE_INFINITY,max:a?o:Number.POSITIVE_INFINITY}}function qg(t,n,o){const r=t[n]||(t[n]={});return r[o]||(r[o]={})}function bc(t,n,o,r){for(const a of n.getMatchingVisibleMetas(r).reverse()){const s=t[a.index];if(o&&s>0||!o&&s<0)return a.index}return null}function yc(t,n){const{chart:o,_cachedMeta:r}=t,a=o._stacks||(o._stacks={}),{iScale:s,vScale:i,index:l}=r,c=s.axis,d=i.axis,u=Ug(s,i,r),f=n.length;let h;for(let m=0;m<f;++m){const g=n[m],{[c]:k,[d]:y}=g,p=g._stacks||(g._stacks={});h=p[d]=qg(a,u,k),h[l]=y,h._top=bc(h,i,!0,r.type),h._bottom=bc(h,i,!1,r.type);const E=h._visualValues||(h._visualValues={});E[l]=y}}function ys(t,n){const o=t.scales;return Object.keys(o).filter(r=>o[r].axis===n).shift()}function Gg(t,n){return Kn(t,{active:!1,dataset:void 0,datasetIndex:n,index:n,mode:"default",type:"dataset"})}function Xg(t,n,o){return Kn(t,{active:!1,dataIndex:n,parsed:void 0,raw:void 0,element:o,index:n,mode:"default",type:"data"})}function Go(t,n){const o=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){n=n||t._parsed;for(const a of n){const s=a._stacks;if(!s||s[r]===void 0||s[r][o]===void 0)return;delete s[r][o],s[r]._visualValues!==void 0&&s[r]._visualValues[o]!==void 0&&delete s[r]._visualValues[o]}}}const xs=t=>t==="reset"||t==="none",xc=(t,n)=>n?t:Object.assign({},t),Kg=(t,n,o)=>t&&!n.hidden&&n._stacked&&{keys:pc(o,!0),values:null};class Zn{constructor(n,o){this.chart=n,this._ctx=n.ctx,this.index=o,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const n=this._cachedMeta;this.configure(),this.linkScales(),n._stacked=bs(n.vScale,n),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(n){this.index!==n&&Go(this._cachedMeta),this.index=n}linkScales(){const n=this.chart,o=this._cachedMeta,r=this.getDataset(),a=(f,h,m,g)=>f==="x"?h:f==="r"?g:m,s=o.xAxisID=Oe(r.xAxisID,ys(n,"x")),i=o.yAxisID=Oe(r.yAxisID,ys(n,"y")),l=o.rAxisID=Oe(r.rAxisID,ys(n,"r")),c=o.indexAxis,d=o.iAxisID=a(c,s,i,l),u=o.vAxisID=a(c,i,s,l);o.xScale=this.getScaleForId(s),o.yScale=this.getScaleForId(i),o.rScale=this.getScaleForId(l),o.iScale=this.getScaleForId(d),o.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(n){return this.chart.scales[n]}_getOtherScale(n){const o=this._cachedMeta;return n===o.iScale?o.vScale:o.iScale}reset(){this._update("reset")}_destroy(){const n=this._cachedMeta;this._data&&Ol(this._data,this),n._stacked&&Go(n)}_dataCheck(){const n=this.getDataset(),o=n.data||(n.data=[]),r=this._data;if(Re(o)){const a=this._cachedMeta;this._data=Wg(o,a)}else if(r!==o){if(r){Ol(r,this);const a=this._cachedMeta;Go(a),a._parsed=[]}o&&Object.isExtensible(o)&&Mp(o,this),this._syncList=[],this._data=o}}addElements(){const n=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(n.dataset=new this.datasetElementType)}buildOrUpdateElements(n){const o=this._cachedMeta,r=this.getDataset();let a=!1;this._dataCheck();const s=o._stacked;o._stacked=bs(o.vScale,o),o.stack!==r.stack&&(a=!0,Go(o),o.stack=r.stack),this._resyncElements(n),(a||s!==o._stacked)&&(yc(this,o._parsed),o._stacked=bs(o.vScale,o))}configure(){const n=this.chart.config,o=n.datasetScopeKeys(this._type),r=n.getOptionScopes(this.getDataset(),o,!0);this.options=n.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(n,o){const{_cachedMeta:r,_data:a}=this,{iScale:s,_stacked:i}=r,l=s.axis;let c=n===0&&o===a.length?!0:r._sorted,d=n>0&&r._parsed[n-1],u,f,h;if(this._parsing===!1)r._parsed=a,r._sorted=!0,h=a;else{ht(a[n])?h=this.parseArrayData(r,a,n,o):Re(a[n])?h=this.parseObjectData(r,a,n,o):h=this.parsePrimitiveData(r,a,n,o);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<o;++u)r._parsed[u+n]=f=h[u],c&&(m()&&(c=!1),d=f);r._sorted=c}i&&yc(this,h)}parsePrimitiveData(n,o,r,a){const{iScale:s,vScale:i}=n,l=s.axis,c=i.axis,d=s.getLabels(),u=s===i,f=new Array(a);let h,m,g;for(h=0,m=a;h<m;++h)g=h+r,f[h]={[l]:u||s.parse(d[g],g),[c]:i.parse(o[g],g)};return f}parseArrayData(n,o,r,a){const{xScale:s,yScale:i}=n,l=new Array(a);let c,d,u,f;for(c=0,d=a;c<d;++c)u=c+r,f=o[u],l[c]={x:s.parse(f[0],u),y:i.parse(f[1],u)};return l}parseObjectData(n,o,r,a){const{xScale:s,yScale:i}=n,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(a);let u,f,h,m;for(u=0,f=a;u<f;++u)h=u+r,m=o[h],d[u]={x:s.parse(Un(m,l),h),y:i.parse(Un(m,c),h)};return d}getParsed(n){return this._cachedMeta._parsed[n]}getDataElement(n){return this._cachedMeta.data[n]}applyStack(n,o,r){const a=this.chart,s=this._cachedMeta,i=o[n.axis],l={keys:pc(a,!0),values:o._stacks[n.axis]._visualValues};return gc(l,i,s.index,{mode:r})}updateRangeFromParsed(n,o,r,a){const s=r[o.axis];let i=s===null?NaN:s;const l=a&&r._stacks[o.axis];a&&l&&(a.values=l,i=gc(a,s,this._cachedMeta.index)),n.min=Math.min(n.min,i),n.max=Math.max(n.max,i)}getMinMax(n,o){const r=this._cachedMeta,a=r._parsed,s=r._sorted&&n===r.iScale,i=a.length,l=this._getOtherScale(n),c=Kg(o,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Hg(l);let h,m;function g(){m=a[h];const k=m[l.axis];return!kt(m[n.axis])||u>k||f<k}for(h=0;h<i&&!(!g()&&(this.updateRangeFromParsed(d,n,m,c),s));++h);if(s){for(h=i-1;h>=0;--h)if(!g()){this.updateRangeFromParsed(d,n,m,c);break}}return d}getAllParsedValues(n){const o=this._cachedMeta._parsed,r=[];let a,s,i;for(a=0,s=o.length;a<s;++a)i=o[a][n.axis],kt(i)&&r.push(i);return r}getMaxOverflow(){return!1}getLabelAndValue(n){const o=this._cachedMeta,r=o.iScale,a=o.vScale,s=this.getParsed(n);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:a?""+a.getLabelForValue(s[a.axis]):""}}_update(n){const o=this._cachedMeta;this.update(n||"default"),o._clip=jg(Oe(this.options.clip,$g(o.xScale,o.yScale,this.getMaxOverflow())))}update(n){}draw(){const n=this._ctx,o=this.chart,r=this._cachedMeta,a=r.data||[],s=o.chartArea,i=[],l=this._drawStart||0,c=this._drawCount||a.length-l,d=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(n,s,l,c),u=l;u<l+c;++u){const f=a[u];f.hidden||(f.active&&d?i.push(f):f.draw(n,s))}for(u=0;u<i.length;++u)i[u].draw(n,s)}getStyle(n,o){const r=o?"active":"default";return n===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(n||0,r)}getContext(n,o,r){const a=this.getDataset();let s;if(n>=0&&n<this._cachedMeta.data.length){const i=this._cachedMeta.data[n];s=i.$context||(i.$context=Xg(this.getContext(),n,i)),s.parsed=this.getParsed(n),s.raw=a.data[n],s.index=s.dataIndex=n}else s=this.$context||(this.$context=Gg(this.chart.getContext(),this.index)),s.dataset=a,s.index=s.datasetIndex=this.index;return s.active=!!o,s.mode=r,s}resolveDatasetElementOptions(n){return this._resolveElementOptions(this.datasetElementType.id,n)}resolveDataElementOptions(n,o){return this._resolveElementOptions(this.dataElementType.id,o,n)}_resolveElementOptions(n,o="default",r){const a=o==="active",s=this._cachedDataOpts,i=n+"-"+o,l=s[i],c=this.enableOptionSharing&&Ro(r);if(l)return xc(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,n),f=a?[`${n}Hover`,"hover",n,""]:[n,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(dt.elements[n]),g=()=>this.getContext(r,a,o),k=d.resolveNamedOptions(h,m,g,f);return k.$shared&&(k.$shared=c,s[i]=Object.freeze(xc(k,c))),k}_resolveAnimations(n,o,r){const a=this.chart,s=this._cachedDataOpts,i=`animation-${o}`,l=s[i];if(l)return l;let c;if(a.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,o),h=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(h,this.getContext(n,r,o))}const d=new hc(a,c&&c.animations);return c&&c._cacheable&&(s[i]=Object.freeze(d)),d}getSharedOptions(n){if(n.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},n))}includeOptions(n,o){return!o||xs(n)||this.chart._animationsDisabled}_getSharedOptions(n,o){const r=this.resolveDataElementOptions(n,o),a=this._sharedOptions,s=this.getSharedOptions(r),i=this.includeOptions(o,s)||s!==a;return this.updateSharedOptions(s,o,r),{sharedOptions:s,includeOptions:i}}updateElement(n,o,r,a){xs(a)?Object.assign(n,r):this._resolveAnimations(o,a).update(n,r)}updateSharedOptions(n,o,r){n&&!xs(o)&&this._resolveAnimations(void 0,o).update(n,r)}_setStyle(n,o,r,a){n.active=a;const s=this.getStyle(o,a);this._resolveAnimations(o,r,a).update(n,{options:!a&&this.getSharedOptions(s)||s})}removeHoverStyle(n,o,r){this._setStyle(n,r,"active",!1)}setHoverStyle(n,o,r){this._setStyle(n,r,"active",!0)}_removeDatasetHoverStyle(){const n=this._cachedMeta.dataset;n&&this._setStyle(n,void 0,"active",!1)}_setDatasetHoverStyle(){const n=this._cachedMeta.dataset;n&&this._setStyle(n,void 0,"active",!0)}_resyncElements(n){const o=this._data,r=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const a=r.length,s=o.length,i=Math.min(s,a);i&&this.parse(0,i),s>a?this._insertElements(a,s-a,n):s<a&&this._removeElements(s,a-s)}_insertElements(n,o,r=!0){const a=this._cachedMeta,s=a.data,i=n+o;let l;const c=d=>{for(d.length+=o,l=d.length-1;l>=i;l--)d[l]=d[l-o]};for(c(s),l=n;l<i;++l)s[l]=new this.dataElementType;this._parsing&&c(a._parsed),this.parse(n,o),r&&this.updateElements(s,n,o,"reset")}updateElements(n,o,r,a){}_removeElements(n,o){const r=this._cachedMeta;if(this._parsing){const a=r._parsed.splice(n,o);r._stacked&&Go(r,a)}r.data.splice(n,o)}_sync(n){if(this._parsing)this._syncList.push(n);else{const[o,r,a]=n;this[o](r,a)}this.chart._dataChanges.push([this.index,...n])}_onDataPush(){const n=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-n,n])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(n,o){o&&this._sync(["_removeElements",n,o]);const r=arguments.length-2;r&&this._sync(["_insertElements",n,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}ke(Zn,"defaults",{}),ke(Zn,"datasetElementType",null),ke(Zn,"dataElementType",null);function Yg(t,n){if(!t._cache.$bar){const o=t.getMatchingVisibleMetas(n);let r=[];for(let a=0,s=o.length;a<s;a++)r=r.concat(o[a].controller.getAllParsedValues(t));t._cache.$bar=Fl(r.sort((a,s)=>a-s))}return t._cache.$bar}function Jg(t){const n=t.iScale,o=Yg(n,t.type);let r=n._length,a,s,i,l;const c=()=>{i===32767||i===-32768||(Ro(l)&&(r=Math.min(r,Math.abs(i-l)||r)),l=i)};for(a=0,s=o.length;a<s;++a)i=n.getPixelForValue(o[a]),c();for(l=void 0,a=0,s=n.ticks.length;a<s;++a)i=n.getPixelForTick(a),c();return r}function Qg(t,n,o,r){const a=o.barThickness;let s,i;return He(a)?(s=n.min*o.categoryPercentage,i=o.barPercentage):(s=a*r,i=1),{chunk:s/r,ratio:i,start:n.pixels[t]-s/2}}function Zg(t,n,o,r){const a=n.pixels,s=a[t];let i=t>0?a[t-1]:null,l=t<a.length-1?a[t+1]:null;const c=o.categoryPercentage;i===null&&(i=s-(l===null?n.end-n.start:l-s)),l===null&&(l=s+s-i);const d=s-(s-Math.min(i,l))/2*c;return{chunk:Math.abs(l-i)/2*c/r,ratio:o.barPercentage,start:d}}function e0(t,n,o,r){const a=o.parse(t[0],r),s=o.parse(t[1],r),i=Math.min(a,s),l=Math.max(a,s);let c=i,d=l;Math.abs(i)>Math.abs(l)&&(c=l,d=i),n[o.axis]=d,n._custom={barStart:c,barEnd:d,start:a,end:s,min:i,max:l}}function kc(t,n,o,r){return ht(t)?e0(t,n,o,r):n[o.axis]=o.parse(t,r),n}function wc(t,n,o,r){const a=t.iScale,s=t.vScale,i=a.getLabels(),l=a===s,c=[];let d,u,f,h;for(d=o,u=o+r;d<u;++d)h=n[d],f={},f[a.axis]=l||a.parse(i[d],d),c.push(kc(h,f,s,d));return c}function ks(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function t0(t,n,o){return t!==0?on(t):(n.isHorizontal()?1:-1)*(n.min>=o?1:-1)}function n0(t){let n,o,r,a,s;return t.horizontal?(n=t.base>t.x,o="left",r="right"):(n=t.base<t.y,o="bottom",r="top"),n?(a="end",s="start"):(a="start",s="end"),{start:o,end:r,reverse:n,top:a,bottom:s}}function o0(t,n,o,r){let a=n.borderSkipped;const s={};if(!a){t.borderSkipped=s;return}if(a===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:l,reverse:c,top:d,bottom:u}=n0(t);a==="middle"&&o&&(t.enableBorderRadius=!0,(o._top||0)===r?a=d:(o._bottom||0)===r?a=u:(s[Cc(u,i,l,c)]=!0,a=d)),s[Cc(a,i,l,c)]=!0,t.borderSkipped=s}function Cc(t,n,o,r){return r?(t=r0(t,n,o),t=Ec(t,o,n)):t=Ec(t,n,o),t}function r0(t,n,o){return t===n?o:t===o?n:t}function Ec(t,n,o){return t==="start"?n:t==="end"?o:t}function a0(t,{inflateAmount:n},o){t.inflateAmount=n==="auto"?o===1?.33:0:n}class zr extends Zn{parsePrimitiveData(n,o,r,a){return wc(n,o,r,a)}parseArrayData(n,o,r,a){return wc(n,o,r,a)}parseObjectData(n,o,r,a){const{iScale:s,vScale:i}=n,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?l:c,u=i.axis==="x"?l:c,f=[];let h,m,g,k;for(h=r,m=r+a;h<m;++h)k=o[h],g={},g[s.axis]=s.parse(Un(k,d),h),f.push(kc(Un(k,u),g,i,h));return f}updateRangeFromParsed(n,o,r,a){super.updateRangeFromParsed(n,o,r,a);const s=r._custom;s&&o===this._cachedMeta.vScale&&(n.min=Math.min(n.min,s.min),n.max=Math.max(n.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(n){const o=this._cachedMeta,{iScale:r,vScale:a}=o,s=this.getParsed(n),i=s._custom,l=ks(i)?"["+i.start+", "+i.end+"]":""+a.getLabelForValue(s[a.axis]);return{label:""+r.getLabelForValue(s[r.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const n=this._cachedMeta;n.stack=this.getDataset().stack}update(n){const o=this._cachedMeta;this.updateElements(o.data,0,o.data.length,n)}updateElements(n,o,r,a){const s=a==="reset",{index:i,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(o,a);for(let m=o;m<o+r;m++){const g=this.getParsed(m),k=s||He(g[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),y=this._calculateBarIndexPixels(m,u),p=(g._stacks||{})[l.axis],E={horizontal:d,base:k.base,enableBorderRadius:!p||ks(g._custom)||i===p._top||i===p._bottom,x:d?k.head:y.center,y:d?y.center:k.head,height:d?y.size:Math.abs(k.size),width:d?Math.abs(k.size):y.size};h&&(E.options=f||this.resolveDataElementOptions(m,n[m].active?"active":a));const _=E.options||n[m].options;o0(E,_,p,i),a0(E,_,u.ratio),this.updateElement(n[m],m,E,a)}}_getStacks(n,o){const{iScale:r}=this._cachedMeta,a=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=r.options.stacked,i=[],l=this._cachedMeta.controller.getParsed(o),c=l&&l[r.axis],d=u=>{const f=u._parsed.find(m=>m[r.axis]===c),h=f&&f[u.vScale.axis];if(He(h)||isNaN(h))return!0};for(const u of a)if(!(o!==void 0&&d(u))&&((s===!1||i.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&i.push(u.stack),u.index===n))break;return i.length||i.push(void 0),i}_getStackCount(n){return this._getStacks(void 0,n).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const n=this.chart.scales,o=this.chart.options.indexAxis;return Object.keys(n).filter(r=>n[r].axis===o).shift()}_getAxis(){const n={},o=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)n[Oe(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,o)]=!0;return Object.keys(n)}_getStackIndex(n,o,r){const a=this._getStacks(n,r),s=o!==void 0?a.indexOf(o):-1;return s===-1?a.length-1:s}_getRuler(){const n=this.options,o=this._cachedMeta,r=o.iScale,a=[];let s,i;for(s=0,i=o.data.length;s<i;++s)a.push(r.getPixelForValue(this.getParsed(s)[r.axis],s));const l=n.barThickness;return{min:l||Jg(o),pixels:a,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:n.grouped,ratio:l?1:n.categoryPercentage*n.barPercentage}}_calculateBarValuePixels(n){const{_cachedMeta:{vScale:o,_stacked:r,index:a},options:{base:s,minBarLength:i}}=this,l=s||0,c=this.getParsed(n),d=c._custom,u=ks(d);let f=c[o.axis],h=0,m=r?this.applyStack(o,c,r):f,g,k;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&on(f)!==on(d.barEnd)&&(h=0),h+=f);const y=!He(s)&&!u?s:h;let p=o.getPixelForValue(y);if(this.chart.getDataVisibility(n)?g=o.getPixelForValue(h+m):g=p,k=g-p,Math.abs(k)<i){k=t0(k,o,l)*i,f===l&&(p-=k/2);const E=o.getPixelForDecimal(0),_=o.getPixelForDecimal(1),B=Math.min(E,_),S=Math.max(E,_);p=Math.max(Math.min(p,S),B),g=p+k,r&&!u&&(c._stacks[o.axis]._visualValues[a]=o.getValueForPixel(g)-o.getValueForPixel(p))}if(p===o.getPixelForValue(l)){const E=on(k)*o.getLineWidthForValue(l)/2;p+=E,k-=E}return{size:k,base:p,head:g,center:g+k/2}}_calculateBarIndexPixels(n,o){const r=o.scale,a=this.options,s=a.skipNull,i=Oe(a.maxBarThickness,1/0);let l,c;const d=this._getAxisCount();if(o.grouped){const u=s?this._getStackCount(n):o.stackCount,f=a.barThickness==="flex"?Zg(n,o,a,u*d):Qg(n,o,a,u*d),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(Oe(h,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,s?n:void 0)+m;l=f.start+f.chunk*g+f.chunk/2,c=Math.min(i,f.chunk*f.ratio)}else l=r.getPixelForValue(this.getParsed(n)[r.axis],n),c=Math.min(i,o.min*o.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const n=this._cachedMeta,o=n.vScale,r=n.data,a=r.length;let s=0;for(;s<a;++s)this.getParsed(s)[o.axis]!==null&&!r[s].hidden&&r[s].draw(this._ctx)}}ke(zr,"id","bar"),ke(zr,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),ke(zr,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function s0(t,n,o){let r=1,a=1,s=0,i=0;if(n<it){const l=t,c=l+n,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(_,B,S)=>jo(_,l,c,!0)?1:Math.max(B,B*o,S,S*o),g=(_,B,S)=>jo(_,l,c,!0)?-1:Math.min(B,B*o,S,S*o),k=m(0,d,f),y=m(gt,u,h),p=g(Je,d,f),E=g(Je+gt,u,h);r=(k-p)/2,a=(y-E)/2,s=-(k+p)/2,i=-(y+E)/2}return{ratioX:r,ratioY:a,offsetX:s,offsetY:i}}class po extends Zn{constructor(n,o){super(n,o),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(n,o){const r=this.getDataset().data,a=this._cachedMeta;if(this._parsing===!1)a._parsed=r;else{let s=c=>+r[c];if(Re(r[n])){const{key:c="value"}=this._parsing;s=d=>+Un(r[d],c)}let i,l;for(i=n,l=n+o;i<l;++i)a._parsed[i]=s(i)}}_getRotation(){return gn(this.options.rotation-90)}_getCircumference(){return gn(this.options.circumference)}_getRotationExtents(){let n=it,o=-it;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const a=this.chart.getDatasetMeta(r).controller,s=a._getRotation(),i=a._getCircumference();n=Math.min(n,s),o=Math.max(o,s+i)}return{rotation:n,circumference:o-n}}update(n){const o=this.chart,{chartArea:r}=o,a=this._cachedMeta,s=a.data,i=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(r.width,r.height)-i)/2,0),c=Math.min(mp(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:g,offsetY:k}=s0(f,u,c),y=(r.width-i)/h,p=(r.height-i)/m,E=Math.max(Math.min(y,p)/2,0),_=_l(this.options.radius,E),B=Math.max(_*c,0),S=(_-B)/this._getVisibleDatasetWeightTotal();this.offsetX=g*_,this.offsetY=k*_,a.total=this.calculateTotal(),this.outerRadius=_-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*d,0),this.updateElements(s,0,s.length,n)}_circumference(n,o){const r=this.options,a=this._cachedMeta,s=this._getCircumference();return o&&r.animation.animateRotate||!this.chart.getDataVisibility(n)||a._parsed[n]===null||a.data[n].hidden?0:this.calculateCircumference(a._parsed[n]*s/it)}updateElements(n,o,r,a){const s=a==="reset",i=this.chart,l=i.chartArea,d=i.options.animation,u=(l.left+l.right)/2,f=(l.top+l.bottom)/2,h=s&&d.animateScale,m=h?0:this.innerRadius,g=h?0:this.outerRadius,{sharedOptions:k,includeOptions:y}=this._getSharedOptions(o,a);let p=this._getRotation(),E;for(E=0;E<o;++E)p+=this._circumference(E,s);for(E=o;E<o+r;++E){const _=this._circumference(E,s),B=n[E],S={x:u+this.offsetX,y:f+this.offsetY,startAngle:p,endAngle:p+_,circumference:_,outerRadius:g,innerRadius:m};y&&(S.options=k||this.resolveDataElementOptions(E,B.active?"active":a)),p+=_,this.updateElement(B,E,S,a)}}calculateTotal(){const n=this._cachedMeta,o=n.data;let r=0,a;for(a=0;a<o.length;a++){const s=n._parsed[a];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(a)&&!o[a].hidden&&(r+=Math.abs(s))}return r}calculateCircumference(n){const o=this._cachedMeta.total;return o>0&&!isNaN(n)?it*(Math.abs(n)/o):0}getLabelAndValue(n){const o=this._cachedMeta,r=this.chart,a=r.data.labels||[],s=is(o._parsed[n],r.options.locale);return{label:a[n]||"",value:s}}getMaxBorderWidth(n){let o=0;const r=this.chart;let a,s,i,l,c;if(!n){for(a=0,s=r.data.datasets.length;a<s;++a)if(r.isDatasetVisible(a)){i=r.getDatasetMeta(a),n=i.data,l=i.controller;break}}if(!n)return 0;for(a=0,s=n.length;a<s;++a)c=l.resolveDataElementOptions(a),c.borderAlign!=="inner"&&(o=Math.max(o,c.borderWidth||0,c.hoverBorderWidth||0));return o}getMaxOffset(n){let o=0;for(let r=0,a=n.length;r<a;++r){const s=this.resolveDataElementOptions(r);o=Math.max(o,s.offset||0,s.hoverOffset||0)}return o}_getRingWeightOffset(n){let o=0;for(let r=0;r<n;++r)this.chart.isDatasetVisible(r)&&(o+=this._getRingWeight(r));return o}_getRingWeight(n){return Math.max(Oe(this.chart.data.datasets[n].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}ke(po,"id","doughnut"),ke(po,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),ke(po,"descriptors",{_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"&&!n.startsWith("borderDash")&&!n.startsWith("hoverBorderDash")}),ke(po,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const o=n.data,{labels:{pointStyle:r,textAlign:a,color:s,useBorderRadius:i,borderRadius:l}}=n.legend.options;return o.labels.length&&o.datasets.length?o.labels.map((c,d)=>{const f=n.getDatasetMeta(0).controller.getStyle(d);return{text:c,fillStyle:f.backgroundColor,fontColor:s,hidden:!n.getDataVisibility(d),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:a,pointStyle:r,borderRadius:i&&(l||f.borderRadius),index:d}}):[]}},onClick(n,o,r){r.chart.toggleDataVisibility(o.index),r.chart.update()}}}});class Ir extends Zn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(n){const o=this._cachedMeta,{dataset:r,data:a=[],_dataset:s}=o,i=this.chart._animationsDisabled;let{start:l,count:c}=Tp(o,a,i);this._drawStart=l,this._drawCount=c,Op(o)&&(l=0,c=a.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=a;const d=this.resolveDatasetElementOptions(n);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(r,void 0,{animated:!i,options:d},n),this.updateElements(a,l,c,n)}updateElements(n,o,r,a){const s=a==="reset",{iScale:i,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(o,a),h=i.axis,m=l.axis,{spanGaps:g,segment:k}=this.options,y=$o(g)?g:Number.POSITIVE_INFINITY,p=this.chart._animationsDisabled||s||a==="none",E=o+r,_=n.length;let B=o>0&&this.getParsed(o-1);for(let S=0;S<_;++S){const w=n[S],x=p?w:{};if(S<o||S>=E){x.skip=!0;continue}const b=this.getParsed(S),V=He(b[m]),A=x[h]=i.getPixelForValue(b[h],S),D=x[m]=s||V?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,b,c):b[m],S);x.skip=isNaN(A)||isNaN(D)||V,x.stop=S>0&&Math.abs(b[h]-B[h])>y,k&&(x.parsed=b,x.raw=d.data[S]),f&&(x.options=u||this.resolveDataElementOptions(S,w.active?"active":a)),p||this.updateElement(w,S,x,a),B=b}}getMaxOverflow(){const n=this._cachedMeta,o=n.dataset,r=o.options&&o.options.borderWidth||0,a=n.data||[];if(!a.length)return r;const s=a[0].size(this.resolveDataElementOptions(0)),i=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(r,s,i)/2}draw(){const n=this._cachedMeta;n.dataset.updateControlPoints(this.chart.chartArea,n.iScale.axis),super.draw()}}ke(Ir,"id","line"),ke(Ir,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ke(Ir,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ws extends po{}ke(ws,"id","pie"),ke(ws,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function eo(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Cs{constructor(n){ke(this,"options");this.options=n||{}}static override(n){Object.assign(Cs.prototype,n)}init(){}formats(){return eo()}parse(){return eo()}format(){return eo()}add(){return eo()}diff(){return eo()}startOf(){return eo()}endOf(){return eo()}}var i0={_date:Cs};function l0(t,n,o,r){const{controller:a,data:s,_sorted:i}=t,l=a._cachedMeta.iScale,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(l&&n===l.axis&&n!=="r"&&i&&s.length){const d=l._reversePixels?Dp:qn;if(r){if(a._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(n);if(f){const h=d(s,n,o-f),m=d(s,n,o+f);return{lo:h.lo,hi:m.hi}}}}else{const u=d(s,n,o);if(c){const{vScale:f}=a._cachedMeta,{_parsed:h}=t,m=h.slice(0,u.lo+1).reverse().findIndex(k=>!He(k[f.axis]));u.lo-=Math.max(0,m);const g=h.slice(u.hi).findIndex(k=>!He(k[f.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function Rr(t,n,o,r,a){const s=t.getSortedVisibleDatasetMetas(),i=o[n];for(let l=0,c=s.length;l<c;++l){const{index:d,data:u}=s[l],{lo:f,hi:h}=l0(s[l],n,i,a);for(let m=f;m<=h;++m){const g=u[m];g.skip||r(g,d,m)}}}function c0(t){const n=t.indexOf("x")!==-1,o=t.indexOf("y")!==-1;return function(r,a){const s=n?Math.abs(r.x-a.x):0,i=o?Math.abs(r.y-a.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(i,2))}}function Es(t,n,o,r,a){const s=[];return!a&&!t.isPointInArea(n)||Rr(t,o,n,function(l,c,d){!a&&!Ho(l,t.chartArea,0)||l.inRange(n.x,n.y,r)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function d0(t,n,o,r){let a=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],r),{angle:f}=Pl(i,{x:n.x,y:n.y});jo(f,d,u)&&a.push({element:i,datasetIndex:l,index:c})}return Rr(t,o,n,s),a}function u0(t,n,o,r,a,s){let i=[];const l=c0(o);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(n.x,n.y,a);if(r&&!m)return;const g=u.getCenterPoint(a);if(!(!!s||t.isPointInArea(g))&&!m)return;const y=l(n,g);y<c?(i=[{element:u,datasetIndex:f,index:h}],c=y):y===c&&i.push({element:u,datasetIndex:f,index:h})}return Rr(t,o,n,d),i}function Bs(t,n,o,r,a,s){return!s&&!t.isPointInArea(n)?[]:o==="r"&&!r?d0(t,n,o,a):u0(t,n,o,r,a,s)}function Bc(t,n,o,r,a){const s=[],i=o==="x"?"inXRange":"inYRange";let l=!1;return Rr(t,o,n,(c,d,u)=>{c[i]&&c[i](n[o],a)&&(s.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(n.x,n.y,a))}),r&&!l?[]:s}var f0={modes:{index(t,n,o,r){const a=Jn(n,t),s=o.axis||"x",i=o.includeInvisible||!1,l=o.intersect?Es(t,a,s,r,i):Bs(t,a,s,!1,r,i),c=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach(d=>{const u=l[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(t,n,o,r){const a=Jn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;let l=o.intersect?Es(t,a,s,r,i):Bs(t,a,s,!1,r,i);if(l.length>0){const c=l[0].datasetIndex,d=t.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(t,n,o,r){const a=Jn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return Es(t,a,s,r,i)},nearest(t,n,o,r){const a=Jn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return Bs(t,a,s,o.intersect,r,i)},x(t,n,o,r){const a=Jn(n,t);return Bc(t,a,"x",o.intersect,r)},y(t,n,o,r){const a=Jn(n,t);return Bc(t,a,"y",o.intersect,r)}}};const _c=["left","top","right","bottom"];function Xo(t,n){return t.filter(o=>o.pos===n)}function Sc(t,n){return t.filter(o=>_c.indexOf(o.pos)===-1&&o.box.axis===n)}function Ko(t,n){return t.sort((o,r)=>{const a=n?r:o,s=n?o:r;return a.weight===s.weight?a.index-s.index:a.weight-s.weight})}function h0(t){const n=[];let o,r,a,s,i,l;for(o=0,r=(t||[]).length;o<r;++o)a=t[o],{position:s,options:{stack:i,stackWeight:l=1}}=a,n.push({index:o,box:a,pos:s,horizontal:a.isHorizontal(),weight:a.weight,stack:i&&s+i,stackWeight:l});return n}function m0(t){const n={};for(const o of t){const{stack:r,pos:a,stackWeight:s}=o;if(!r||!_c.includes(a))continue;const i=n[r]||(n[r]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=s}return n}function p0(t,n){const o=m0(t),{vBoxMaxWidth:r,hBoxMaxHeight:a}=n;let s,i,l;for(s=0,i=t.length;s<i;++s){l=t[s];const{fullSize:c}=l.box,d=o[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*r:c&&n.availableWidth,l.height=a):(l.width=r,l.height=u?u*a:c&&n.availableHeight)}return o}function g0(t){const n=h0(t),o=Ko(n.filter(d=>d.box.fullSize),!0),r=Ko(Xo(n,"left"),!0),a=Ko(Xo(n,"right")),s=Ko(Xo(n,"top"),!0),i=Ko(Xo(n,"bottom")),l=Sc(n,"x"),c=Sc(n,"y");return{fullSize:o,leftAndTop:r.concat(s),rightAndBottom:a.concat(c).concat(i).concat(l),chartArea:Xo(n,"chartArea"),vertical:r.concat(a).concat(c),horizontal:s.concat(i).concat(l)}}function Vc(t,n,o,r){return Math.max(t[o],n[o])+Math.max(t[r],n[r])}function Ac(t,n){t.top=Math.max(t.top,n.top),t.left=Math.max(t.left,n.left),t.bottom=Math.max(t.bottom,n.bottom),t.right=Math.max(t.right,n.right)}function b0(t,n,o,r){const{pos:a,box:s}=o,i=t.maxPadding;if(!Re(a)){o.size&&(t[a]-=o.size);const f=r[o.stack]||{size:0,count:1};f.size=Math.max(f.size,o.horizontal?s.height:s.width),o.size=f.size/f.count,t[a]+=o.size}s.getPadding&&Ac(i,s.getPadding());const l=Math.max(0,n.outerWidth-Vc(i,t,"left","right")),c=Math.max(0,n.outerHeight-Vc(i,t,"top","bottom")),d=l!==t.w,u=c!==t.h;return t.w=l,t.h=c,o.horizontal?{same:d,other:u}:{same:u,other:d}}function y0(t){const n=t.maxPadding;function o(r){const a=Math.max(n[r]-t[r],0);return t[r]+=a,a}t.y+=o("top"),t.x+=o("left"),o("right"),o("bottom")}function x0(t,n){const o=n.maxPadding;function r(a){const s={left:0,top:0,right:0,bottom:0};return a.forEach(i=>{s[i]=Math.max(n[i],o[i])}),s}return r(t?["left","right"]:["top","bottom"])}function Yo(t,n,o,r){const a=[];let s,i,l,c,d,u;for(s=0,i=t.length,d=0;s<i;++s){l=t[s],c=l.box,c.update(l.width||n.w,l.height||n.h,x0(l.horizontal,n));const{same:f,other:h}=b0(n,o,l,r);d|=f&&a.length,u=u||h,c.fullSize||a.push(l)}return d&&Yo(a,n,o,r)||u}function Lr(t,n,o,r,a){t.top=o,t.left=n,t.right=n+r,t.bottom=o+a,t.width=r,t.height=a}function Dc(t,n,o,r){const a=o.padding;let{x:s,y:i}=n;for(const l of t){const c=l.box,d=r[l.stack]||{placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=n.w*u,h=d.size||c.height;Ro(d.start)&&(i=d.start),c.fullSize?Lr(c,a.left,i,o.outerWidth-a.right-a.left,h):Lr(c,n.left+d.placed,i,f,h),d.start=i,d.placed+=f,i=c.bottom}else{const f=n.h*u,h=d.size||c.width;Ro(d.start)&&(s=d.start),c.fullSize?Lr(c,s,a.top,h,o.outerHeight-a.bottom-a.top):Lr(c,s,n.top+d.placed,h,f),d.start=s,d.placed+=f,s=c.right}}n.x=s,n.y=i}var Ut={addBox(t,n){t.boxes||(t.boxes=[]),n.fullSize=n.fullSize||!1,n.position=n.position||"top",n.weight=n.weight||0,n._layers=n._layers||function(){return[{z:0,draw(o){n.draw(o)}}]},t.boxes.push(n)},removeBox(t,n){const o=t.boxes?t.boxes.indexOf(n):-1;o!==-1&&t.boxes.splice(o,1)},configure(t,n,o){n.fullSize=o.fullSize,n.position=o.position,n.weight=o.weight},update(t,n,o,r){if(!t)return;const a=Wt(t.options.layout.padding),s=Math.max(n-a.width,0),i=Math.max(o-a.height,0),l=g0(t.boxes),c=l.vertical,d=l.horizontal;Ye(t.boxes,k=>{typeof k.beforeLayout=="function"&&k.beforeLayout()});const u=c.reduce((k,y)=>y.box.options&&y.box.options.display===!1?k:k+1,0)||1,f=Object.freeze({outerWidth:n,outerHeight:o,padding:a,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),h=Object.assign({},a);Ac(h,Wt(r));const m=Object.assign({maxPadding:h,w:s,h:i,x:a.left,y:a.top},a),g=p0(c.concat(d),f);Yo(l.fullSize,m,f,g),Yo(c,m,f,g),Yo(d,m,f,g)&&Yo(c,m,f,g),y0(m),Dc(l.leftAndTop,m,f,g),m.x+=m.w,m.y+=m.h,Dc(l.rightAndBottom,m,f,g),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Ye(l.chartArea,k=>{const y=k.box;Object.assign(y,t.chartArea),y.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Nc{acquireContext(n,o){}releaseContext(n){return!1}addEventListener(n,o,r){}removeEventListener(n,o,r){}getDevicePixelRatio(){return 1}getMaximumSize(n,o,r,a){return o=Math.max(0,o||n.width),r=r||n.height,{width:o,height:Math.max(0,a?Math.floor(o/a):r)}}isAttached(n){return!0}updateConfig(n){}}class k0 extends Nc{acquireContext(n){return n&&n.getContext&&n.getContext("2d")||null}updateConfig(n){n.options.animation=!1}}const $r="$chartjs",w0={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Mc=t=>t===null||t==="";function C0(t,n){const o=t.style,r=t.getAttribute("height"),a=t.getAttribute("width");if(t[$r]={initial:{height:r,width:a,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",Mc(a)){const s=nc(t,"width");s!==void 0&&(t.width=s)}if(Mc(r))if(t.style.height==="")t.height=t.width/(n||2);else{const s=nc(t,"height");s!==void 0&&(t.height=s)}return t}const vc=Bg?{passive:!0}:!1;function E0(t,n,o){t&&t.addEventListener(n,o,vc)}function B0(t,n,o){t&&t.canvas&&t.canvas.removeEventListener(n,o,vc)}function _0(t,n){const o=w0[t.type]||t.type,{x:r,y:a}=Jn(t,n);return{type:o,chart:n,native:t,x:r!==void 0?r:null,y:a!==void 0?a:null}}function jr(t,n){for(const o of t)if(o===n||o.contains(n))return!0}function S0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||jr(l.addedNodes,r),i=i&&!jr(l.removedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}function V0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||jr(l.removedNodes,r),i=i&&!jr(l.addedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}const Jo=new Map;let Pc=0;function Tc(){const t=window.devicePixelRatio;t!==Pc&&(Pc=t,Jo.forEach((n,o)=>{o.currentDevicePixelRatio!==t&&n()}))}function A0(t,n){Jo.size||window.addEventListener("resize",Tc),Jo.set(t,n)}function D0(t){Jo.delete(t),Jo.size||window.removeEventListener("resize",Tc)}function N0(t,n,o){const r=t.canvas,a=r&&gs(r);if(!a)return;const s=Il((l,c)=>{const d=a.clientWidth;o(l,c),d<a.clientWidth&&o()},window),i=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||s(d,u)});return i.observe(a),A0(t,s),i}function _s(t,n,o){o&&o.disconnect(),n==="resize"&&D0(t)}function M0(t,n,o){const r=t.canvas,a=Il(s=>{t.ctx!==null&&o(_0(s,t))},t);return E0(r,n,a),a}class v0 extends Nc{acquireContext(n,o){const r=n&&n.getContext&&n.getContext("2d");return r&&r.canvas===n?(C0(n,o),r):null}releaseContext(n){const o=n.canvas;if(!o[$r])return!1;const r=o[$r].initial;["height","width"].forEach(s=>{const i=r[s];He(i)?o.removeAttribute(s):o.setAttribute(s,i)});const a=r.style||{};return Object.keys(a).forEach(s=>{o.style[s]=a[s]}),o.width=o.width,delete o[$r],!0}addEventListener(n,o,r){this.removeEventListener(n,o);const a=n.$proxies||(n.$proxies={}),i={attach:S0,detach:V0,resize:N0}[o]||M0;a[o]=i(n,o,r)}removeEventListener(n,o){const r=n.$proxies||(n.$proxies={}),a=r[o];if(!a)return;({attach:_s,detach:_s,resize:_s}[o]||B0)(n,o,a),r[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(n,o,r,a){return Eg(n,o,r,a)}isAttached(n){const o=n&&gs(n);return!!(o&&o.isConnected)}}function P0(t){return!ps()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?k0:v0}let xn=(wa=class{constructor(){ke(this,"x");ke(this,"y");ke(this,"active",!1);ke(this,"options");ke(this,"$animations")}tooltipPosition(n){const{x:o,y:r}=this.getProps(["x","y"],n);return{x:o,y:r}}hasValue(){return $o(this.x)&&$o(this.y)}getProps(n,o){const r=this.$animations;if(!o||!r)return this;const a={};return n.forEach(s=>{a[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),a}},ke(wa,"defaults",{}),ke(wa,"defaultRoutes"),wa);function T0(t,n){const o=t.options.ticks,r=O0(t),a=Math.min(o.maxTicksLimit||r,r),s=o.major.enabled?z0(n):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>a)return I0(n,d,s,i/a),d;const u=F0(s,n,a);if(i>0){let f,h;const m=i>1?Math.round((c-l)/(i-1)):null;for(Wr(n,d,u,He(m)?0:l-m,l),f=0,h=i-1;f<h;f++)Wr(n,d,u,s[f],s[f+1]);return Wr(n,d,u,c,He(m)?n.length:c+m),d}return Wr(n,d,u),d}function O0(t){const n=t.options.offset,o=t._tickSize(),r=t._length/o+(n?0:1),a=t._maxLength/o;return Math.floor(Math.min(r,a))}function F0(t,n,o){const r=R0(t),a=n.length/o;if(!r)return Math.max(a,1);const s=Cp(r);for(let i=0,l=s.length-1;i<l;i++){const c=s[i];if(c>a)return c}return Math.max(a,1)}function z0(t){const n=[];let o,r;for(o=0,r=t.length;o<r;o++)t[o].major&&n.push(o);return n}function I0(t,n,o,r){let a=0,s=o[0],i;for(r=Math.ceil(r),i=0;i<t.length;i++)i===s&&(n.push(t[i]),a++,s=o[a*r])}function Wr(t,n,o,r,a){const s=Oe(r,0),i=Math.min(Oe(a,t.length),t.length);let l=0,c,d,u;for(o=Math.ceil(o),a&&(c=a-r,o=c/Math.floor(c/o)),u=s;u<0;)l++,u=Math.round(s+l*o);for(d=Math.max(s,0);d<i;d++)d===u&&(n.push(t[d]),l++,u=Math.round(s+l*o))}function R0(t){const n=t.length;let o,r;if(n<2)return!1;for(r=t[0],o=1;o<n;++o)if(t[o]-t[o-1]!==r)return!1;return r}const L0=t=>t==="left"?"right":t==="right"?"left":t,Oc=(t,n,o)=>n==="top"||n==="left"?t[n]+o:t[n]-o,Fc=(t,n)=>Math.min(n||t,t);function zc(t,n){const o=[],r=t.length/n,a=t.length;let s=0;for(;s<a;s+=r)o.push(t[Math.floor(s)]);return o}function $0(t,n,o){const r=t.ticks.length,a=Math.min(n,r-1),s=t._startPixel,i=t._endPixel,l=1e-6;let c=t.getPixelForTick(a),d;if(!(o&&(r===1?d=Math.max(c-s,i-c):n===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(a-1))/2,c+=a<n?d:-d,c<s-l||c>i+l)))return c}function j0(t,n){Ye(t,o=>{const r=o.gc,a=r.length/2;let s;if(a>n){for(s=0;s<a;++s)delete o.data[r[s]];r.splice(0,a)}})}function Qo(t){return t.drawTicks?t.tickLength:0}function Ic(t,n){if(!t.display)return 0;const o=Et(t.font,n),r=Wt(t.padding);return(ht(t.text)?t.text.length:1)*o.lineHeight+r.height}function W0(t,n){return Kn(t,{scale:n,type:"scale"})}function U0(t,n,o){return Kn(t,{tick:o,index:n,type:"tick"})}function H0(t,n,o){let r=rs(t);return(o&&n!=="right"||!o&&n==="right")&&(r=L0(r)),r}function q0(t,n,o,r){const{top:a,left:s,bottom:i,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,h,m,g;const k=i-a,y=l-s;if(t.isHorizontal()){if(m=Ct(r,s,l),Re(o)){const p=Object.keys(o)[0],E=o[p];g=u[p].getPixelForValue(E)+k-n}else o==="center"?g=(d.bottom+d.top)/2+k-n:g=Oc(t,o,n);h=l-s}else{if(Re(o)){const p=Object.keys(o)[0],E=o[p];m=u[p].getPixelForValue(E)-y+n}else o==="center"?m=(d.left+d.right)/2-y+n:m=Oc(t,o,n);g=Ct(r,i,a),f=o==="left"?-gt:gt}return{titleX:m,titleY:g,maxWidth:h,rotation:f}}class go extends xn{constructor(n){super(),this.id=n.id,this.type=n.type,this.options=void 0,this.ctx=n.ctx,this.chart=n.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(n){this.options=n.setContext(this.getContext()),this.axis=n.axis,this._userMin=this.parse(n.min),this._userMax=this.parse(n.max),this._suggestedMin=this.parse(n.suggestedMin),this._suggestedMax=this.parse(n.suggestedMax)}parse(n,o){return n}getUserBounds(){let{_userMin:n,_userMax:o,_suggestedMin:r,_suggestedMax:a}=this;return n=nn(n,Number.POSITIVE_INFINITY),o=nn(o,Number.NEGATIVE_INFINITY),r=nn(r,Number.POSITIVE_INFINITY),a=nn(a,Number.NEGATIVE_INFINITY),{min:nn(n,r),max:nn(o,a),minDefined:kt(n),maxDefined:kt(o)}}getMinMax(n){let{min:o,max:r,minDefined:a,maxDefined:s}=this.getUserBounds(),i;if(a&&s)return{min:o,max:r};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)i=l[c].controller.getMinMax(this,n),a||(o=Math.min(o,i.min)),s||(r=Math.max(r,i.max));return o=s&&o>r?r:o,r=a&&o>r?o:r,{min:nn(o,nn(r,o)),max:nn(r,nn(o,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const n=this.chart.data;return this.options.labels||(this.isHorizontal()?n.xLabels:n.yLabels)||n.labels||[]}getLabelItems(n=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(n))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){at(this.options.beforeUpdate,[this])}update(n,o,r){const{beginAtZero:a,grace:s,ticks:i}=this.options,l=i.sampleSize;this.beforeUpdate(),this.maxWidth=n,this.maxHeight=o,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=tg(this,s,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?zc(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=T0(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let n=this.options.reverse,o,r;this.isHorizontal()?(o=this.left,r=this.right):(o=this.top,r=this.bottom,n=!n),this._startPixel=o,this._endPixel=r,this._reversePixels=n,this._length=r-o,this._alignToPixels=this.options.alignToPixels}afterUpdate(){at(this.options.afterUpdate,[this])}beforeSetDimensions(){at(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){at(this.options.afterSetDimensions,[this])}_callHooks(n){this.chart.notifyPlugins(n,this.getContext()),at(this.options[n],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){at(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(n){const o=this.options.ticks;let r,a,s;for(r=0,a=n.length;r<a;r++)s=n[r],s.label=at(o.callback,[s.value,r,n],this)}afterTickToLabelConversion(){at(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){at(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const n=this.options,o=n.ticks,r=Fc(this.ticks.length,n.ticks.maxTicksLimit),a=o.minRotation||0,s=o.maxRotation;let i=a,l,c,d;if(!this._isVisible()||!o.display||a>=s||r<=1||!this.isHorizontal()){this.labelRotation=a;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=wt(this.chart.width-f,0,this.maxWidth);l=n.offset?this.maxWidth/r:m/(r-1),f+6>l&&(l=m/(r-(n.offset?.5:1)),c=this.maxHeight-Qo(n.grid)-o.padding-Ic(n.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),i=Sp(Math.min(Math.asin(wt((u.highest.height+6)/l,-1,1)),Math.asin(wt(c/d,-1,1))-Math.asin(wt(h/d,-1,1)))),i=Math.max(a,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){at(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){at(this.options.beforeFit,[this])}fit(){const n={width:0,height:0},{chart:o,options:{ticks:r,title:a,grid:s}}=this,i=this._isVisible(),l=this.isHorizontal();if(i){const c=Ic(a,o.options.font);if(l?(n.width=this.maxWidth,n.height=Qo(s)+c):(n.height=this.maxHeight,n.width=Qo(s)+c),r.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=r.padding*2,g=gn(this.labelRotation),k=Math.cos(g),y=Math.sin(g);if(l){const p=r.mirror?0:y*f.width+k*h.height;n.height=Math.min(this.maxHeight,n.height+p+m)}else{const p=r.mirror?0:k*f.width+y*h.height;n.width=Math.min(this.maxWidth,n.width+p+m)}this._calculatePadding(d,u,y,k)}}this._handleMargins(),l?(this.width=this._length=o.width-this._margins.left-this._margins.right,this.height=n.height):(this.width=n.width,this.height=this._length=o.height-this._margins.top-this._margins.bottom)}_calculatePadding(n,o,r,a){const{ticks:{align:s,padding:i},position:l}=this.options,c=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,m=0;c?d?(h=a*n.width,m=r*o.height):(h=r*n.height,m=a*o.width):s==="start"?m=o.width:s==="end"?h=n.width:s!=="inner"&&(h=n.width/2,m=o.width/2),this.paddingLeft=Math.max((h-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-f+i)*this.width/(this.width-f),0)}else{let u=o.height/2,f=n.height/2;s==="start"?(u=0,f=n.height):s==="end"&&(u=o.height,f=0),this.paddingTop=u+i,this.paddingBottom=f+i}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){at(this.options.afterFit,[this])}isHorizontal(){const{axis:n,position:o}=this.options;return o==="top"||o==="bottom"||n==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(n){this.beforeTickToLabelConversion(),this.generateTickLabels(n);let o,r;for(o=0,r=n.length;o<r;o++)He(n[o].label)&&(n.splice(o,1),r--,o--);this.afterTickToLabelConversion()}_getLabelSizes(){let n=this._labelSizes;if(!n){const o=this.options.ticks.sampleSize;let r=this.ticks;o<r.length&&(r=zc(r,o)),this._labelSizes=n=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return n}_computeLabelSizes(n,o,r){const{ctx:a,_longestTextCache:s}=this,i=[],l=[],c=Math.floor(o/Fc(o,r));let d=0,u=0,f,h,m,g,k,y,p,E,_,B,S;for(f=0;f<o;f+=c){if(g=n[f].label,k=this._resolveTickFontOptions(f),a.font=y=k.string,p=s[y]=s[y]||{data:{},gc:[]},E=k.lineHeight,_=B=0,!He(g)&&!ht(g))_=Ul(a,p.data,p.gc,_,g),B=E;else if(ht(g))for(h=0,m=g.length;h<m;++h)S=g[h],!He(S)&&!ht(S)&&(_=Ul(a,p.data,p.gc,_,S),B+=E);i.push(_),l.push(B),d=Math.max(_,d),u=Math.max(B,u)}j0(s,o);const w=i.indexOf(d),x=l.indexOf(u),b=V=>({width:i[V]||0,height:l[V]||0});return{first:b(0),last:b(o-1),widest:b(w),highest:b(x),widths:i,heights:l}}getLabelForValue(n){return n}getPixelForValue(n,o){return NaN}getValueForPixel(n){}getPixelForTick(n){const o=this.ticks;return n<0||n>o.length-1?null:this.getPixelForValue(o[n].value)}getPixelForDecimal(n){this._reversePixels&&(n=1-n);const o=this._startPixel+n*this._length;return Ap(this._alignToPixels?Xn(this.chart,o,0):o)}getDecimalForPixel(n){const o=(n-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:n,max:o}=this;return n<0&&o<0?o:n>0&&o>0?n:0}getContext(n){const o=this.ticks||[];if(n>=0&&n<o.length){const r=o[n];return r.$context||(r.$context=U0(this.getContext(),n,r))}return this.$context||(this.$context=W0(this.chart.getContext(),this))}_tickSize(){const n=this.options.ticks,o=gn(this.labelRotation),r=Math.abs(Math.cos(o)),a=Math.abs(Math.sin(o)),s=this._getLabelSizes(),i=n.autoSkipPadding||0,l=s?s.widest.width+i:0,c=s?s.highest.height+i:0;return this.isHorizontal()?c*r>l*a?l/r:c/a:c*a<l*r?c/r:l/a}_isVisible(){const n=this.options.display;return n!=="auto"?!!n:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(n){const o=this.axis,r=this.chart,a=this.options,{grid:s,position:i,border:l}=a,c=s.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),h=Qo(s),m=[],g=l.setContext(this.getContext()),k=g.display?g.width:0,y=k/2,p=function($){return Xn(r,$,k)};let E,_,B,S,w,x,b,V,A,D,N,P;if(i==="top")E=p(this.bottom),x=this.bottom-h,V=E-y,D=p(n.top)+y,P=n.bottom;else if(i==="bottom")E=p(this.top),D=n.top,P=p(n.bottom)-y,x=E+y,V=this.top+h;else if(i==="left")E=p(this.right),w=this.right-h,b=E-y,A=p(n.left)+y,N=n.right;else if(i==="right")E=p(this.left),A=n.left,N=p(n.right)-y,w=E+y,b=this.left+h;else if(o==="x"){if(i==="center")E=p((n.top+n.bottom)/2+.5);else if(Re(i)){const $=Object.keys(i)[0],q=i[$];E=p(this.chart.scales[$].getPixelForValue(q))}D=n.top,P=n.bottom,x=E+y,V=x+h}else if(o==="y"){if(i==="center")E=p((n.left+n.right)/2);else if(Re(i)){const $=Object.keys(i)[0],q=i[$];E=p(this.chart.scales[$].getPixelForValue(q))}w=E-y,b=w-h,A=n.left,N=n.right}const v=Oe(a.ticks.maxTicksLimit,f),Q=Math.max(1,Math.ceil(f/v));for(_=0;_<f;_+=Q){const $=this.getContext(_),q=s.setContext($),Y=l.setContext($),X=q.lineWidth,T=q.color,W=Y.dash||[],ne=Y.dashOffset,Z=q.tickWidth,K=q.tickColor,ae=q.tickBorderDash||[],ue=q.tickBorderDashOffset;B=$0(this,_,c),B!==void 0&&(S=Xn(r,B,X),d?w=b=A=N=S:x=V=D=P=S,m.push({tx1:w,ty1:x,tx2:b,ty2:V,x1:A,y1:D,x2:N,y2:P,width:X,color:T,borderDash:W,borderDashOffset:ne,tickWidth:Z,tickColor:K,tickBorderDash:ae,tickBorderDashOffset:ue}))}return this._ticksLength=f,this._borderValue=E,m}_computeLabelItems(n){const o=this.axis,r=this.options,{position:a,ticks:s}=r,i=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=s,h=Qo(r.grid),m=h+u,g=f?-u:m,k=-gn(this.labelRotation),y=[];let p,E,_,B,S,w,x,b,V,A,D,N,P="middle";if(a==="top")w=this.bottom-g,x=this._getXAxisLabelAlignment();else if(a==="bottom")w=this.top+g,x=this._getXAxisLabelAlignment();else if(a==="left"){const Q=this._getYAxisLabelAlignment(h);x=Q.textAlign,S=Q.x}else if(a==="right"){const Q=this._getYAxisLabelAlignment(h);x=Q.textAlign,S=Q.x}else if(o==="x"){if(a==="center")w=(n.top+n.bottom)/2+m;else if(Re(a)){const Q=Object.keys(a)[0],$=a[Q];w=this.chart.scales[Q].getPixelForValue($)+m}x=this._getXAxisLabelAlignment()}else if(o==="y"){if(a==="center")S=(n.left+n.right)/2-m;else if(Re(a)){const Q=Object.keys(a)[0],$=a[Q];S=this.chart.scales[Q].getPixelForValue($)}x=this._getYAxisLabelAlignment(h).textAlign}o==="y"&&(c==="start"?P="top":c==="end"&&(P="bottom"));const v=this._getLabelSizes();for(p=0,E=l.length;p<E;++p){_=l[p],B=_.label;const Q=s.setContext(this.getContext(p));b=this.getPixelForTick(p)+s.labelOffset,V=this._resolveTickFontOptions(p),A=V.lineHeight,D=ht(B)?B.length:1;const $=D/2,q=Q.color,Y=Q.textStrokeColor,X=Q.textStrokeWidth;let T=x;i?(S=b,x==="inner"&&(p===E-1?T=this.options.reverse?"left":"right":p===0?T=this.options.reverse?"right":"left":T="center"),a==="top"?d==="near"||k!==0?N=-D*A+A/2:d==="center"?N=-v.highest.height/2-$*A+A:N=-v.highest.height+A/2:d==="near"||k!==0?N=A/2:d==="center"?N=v.highest.height/2-$*A:N=v.highest.height-D*A,f&&(N*=-1),k!==0&&!Q.showLabelBackdrop&&(S+=A/2*Math.sin(k))):(w=b,N=(1-D)*A/2);let W;if(Q.showLabelBackdrop){const ne=Wt(Q.backdropPadding),Z=v.heights[p],K=v.widths[p];let ae=N-ne.top,ue=0-ne.left;switch(P){case"middle":ae-=Z/2;break;case"bottom":ae-=Z;break}switch(x){case"center":ue-=K/2;break;case"right":ue-=K;break;case"inner":p===E-1?ue-=K:p>0&&(ue-=K/2);break}W={left:ue,top:ae,width:K+ne.width,height:Z+ne.height,color:Q.backdropColor}}y.push({label:B,font:V,textOffset:N,options:{rotation:k,color:q,strokeColor:Y,strokeWidth:X,textAlign:T,textBaseline:P,translation:[S,w],backdrop:W}})}return y}_getXAxisLabelAlignment(){const{position:n,ticks:o}=this.options;if(-gn(this.labelRotation))return n==="top"?"left":"right";let a="center";return o.align==="start"?a="left":o.align==="end"?a="right":o.align==="inner"&&(a="inner"),a}_getYAxisLabelAlignment(n){const{position:o,ticks:{crossAlign:r,mirror:a,padding:s}}=this.options,i=this._getLabelSizes(),l=n+s,c=i.widest.width;let d,u;return o==="left"?a?(u=this.right+s,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u=this.left)):o==="right"?a?(u=this.left+s,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const n=this.chart,o=this.options.position;if(o==="left"||o==="right")return{top:0,left:this.left,bottom:n.height,right:this.right};if(o==="top"||o==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:n.width}}drawBackground(){const{ctx:n,options:{backgroundColor:o},left:r,top:a,width:s,height:i}=this;o&&(n.save(),n.fillStyle=o,n.fillRect(r,a,s,i),n.restore())}getLineWidthForValue(n){const o=this.options.grid;if(!this._isVisible()||!o.display)return 0;const a=this.ticks.findIndex(s=>s.value===n);return a>=0?o.setContext(this.getContext(a)).lineWidth:0}drawGrid(n){const o=this.options.grid,r=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(n));let s,i;const l=(c,d,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(d.x,d.y),r.stroke(),r.restore())};if(o.display)for(s=0,i=a.length;s<i;++s){const c=a[s];o.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),o.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:n,ctx:o,options:{border:r,grid:a}}=this,s=r.setContext(this.getContext()),i=r.display?s.width:0;if(!i)return;const l=a.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,h;this.isHorizontal()?(d=Xn(n,this.left,i)-i/2,u=Xn(n,this.right,l)+l/2,f=h=c):(f=Xn(n,this.top,i)-i/2,h=Xn(n,this.bottom,l)+l/2,d=u=c),o.save(),o.lineWidth=s.width,o.strokeStyle=s.color,o.beginPath(),o.moveTo(d,f),o.lineTo(u,h),o.stroke(),o.restore()}drawLabels(n){if(!this.options.ticks.display)return;const r=this.ctx,a=this._computeLabelArea();a&&Dr(r,a);const s=this.getLabelItems(n);for(const i of s){const l=i.options,c=i.font,d=i.label,u=i.textOffset;qo(r,d,0,u,c,l)}a&&Nr(r)}drawTitle(){const{ctx:n,options:{position:o,title:r,reverse:a}}=this;if(!r.display)return;const s=Et(r.font),i=Wt(r.padding),l=r.align;let c=s.lineHeight/2;o==="bottom"||o==="center"||Re(o)?(c+=i.bottom,ht(r.text)&&(c+=s.lineHeight*(r.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=q0(this,c,o,l);qo(n,r.text,0,0,s,{color:r.color,maxWidth:f,rotation:h,textAlign:H0(l,o,a),textBaseline:"middle",translation:[d,u]})}draw(n){this._isVisible()&&(this.drawBackground(),this.drawGrid(n),this.drawBorder(),this.drawTitle(),this.drawLabels(n))}_layers(){const n=this.options,o=n.ticks&&n.ticks.z||0,r=Oe(n.grid&&n.grid.z,-1),a=Oe(n.border&&n.border.z,0);return!this._isVisible()||this.draw!==go.prototype.draw?[{z:o,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:o,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(n){const o=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",a=[];let s,i;for(s=0,i=o.length;s<i;++s){const l=o[s];l[r]===this.id&&(!n||l.type===n)&&a.push(l)}return a}_resolveTickFontOptions(n){const o=this.options.ticks.setContext(this.getContext(n));return Et(o.font)}_maxDigits(){const n=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/n}}class Ur{constructor(n,o,r){this.type=n,this.scope=o,this.override=r,this.items=Object.create(null)}isForType(n){return Object.prototype.isPrototypeOf.call(this.type.prototype,n.prototype)}register(n){const o=Object.getPrototypeOf(n);let r;K0(o)&&(r=this.register(o));const a=this.items,s=n.id,i=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+n);return s in a||(a[s]=n,G0(n,i,r),this.override&&dt.override(n.id,n.overrides)),i}get(n){return this.items[n]}unregister(n){const o=this.items,r=n.id,a=this.scope;r in o&&delete o[r],a&&r in dt[a]&&(delete dt[a][r],this.override&&delete Gn[r])}}function G0(t,n,o){const r=zo(Object.create(null),[o?dt.get(o):{},dt.get(n),t.defaults]);dt.set(n,r),t.defaultRoutes&&X0(n,t.defaultRoutes),t.descriptors&&dt.describe(n,t.descriptors)}function X0(t,n){Object.keys(n).forEach(o=>{const r=o.split("."),a=r.pop(),s=[t].concat(r).join("."),i=n[o].split("."),l=i.pop(),c=i.join(".");dt.route(s,a,c,l)})}function K0(t){return"id"in t&&"defaults"in t}class Y0{constructor(){this.controllers=new Ur(Zn,"datasets",!0),this.elements=new Ur(xn,"elements"),this.plugins=new Ur(Object,"plugins"),this.scales=new Ur(go,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...n){this._each("register",n)}remove(...n){this._each("unregister",n)}addControllers(...n){this._each("register",n,this.controllers)}addElements(...n){this._each("register",n,this.elements)}addPlugins(...n){this._each("register",n,this.plugins)}addScales(...n){this._each("register",n,this.scales)}getController(n){return this._get(n,this.controllers,"controller")}getElement(n){return this._get(n,this.elements,"element")}getPlugin(n){return this._get(n,this.plugins,"plugin")}getScale(n){return this._get(n,this.scales,"scale")}removeControllers(...n){this._each("unregister",n,this.controllers)}removeElements(...n){this._each("unregister",n,this.elements)}removePlugins(...n){this._each("unregister",n,this.plugins)}removeScales(...n){this._each("unregister",n,this.scales)}_each(n,o,r){[...o].forEach(a=>{const s=r||this._getRegistryForType(a);r||s.isForType(a)||s===this.plugins&&a.id?this._exec(n,s,a):Ye(a,i=>{const l=r||this._getRegistryForType(i);this._exec(n,l,i)})})}_exec(n,o,r){const a=ts(n);at(r["before"+a],[],r),o[n](r),at(r["after"+a],[],r)}_getRegistryForType(n){for(let o=0;o<this._typedRegistries.length;o++){const r=this._typedRegistries[o];if(r.isForType(n))return r}return this.plugins}_get(n,o,r){const a=o.get(n);if(a===void 0)throw new Error('"'+n+'" is not a registered '+r+".");return a}}var rn=new Y0;class J0{constructor(){this._init=void 0}notify(n,o,r,a){if(o==="beforeInit"&&(this._init=this._createDescriptors(n,!0),this._notify(this._init,n,"install")),this._init===void 0)return;const s=a?this._descriptors(n).filter(a):this._descriptors(n),i=this._notify(s,n,o,r);return o==="afterDestroy"&&(this._notify(s,n,"stop"),this._notify(this._init,n,"uninstall"),this._init=void 0),i}_notify(n,o,r,a){a=a||{};for(const s of n){const i=s.plugin,l=i[r],c=[o,a,s.options];if(at(l,c,i)===!1&&a.cancelable)return!1}return!0}invalidate(){He(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(n){if(this._cache)return this._cache;const o=this._cache=this._createDescriptors(n);return this._notifyStateChanges(n),o}_createDescriptors(n,o){const r=n&&n.config,a=Oe(r.options&&r.options.plugins,{}),s=Q0(r);return a===!1&&!o?[]:eb(n,s,a,o)}_notifyStateChanges(n){const o=this._oldCache||[],r=this._cache,a=(s,i)=>s.filter(l=>!i.some(c=>l.plugin.id===c.plugin.id));this._notify(a(o,r),n,"stop"),this._notify(a(r,o),n,"start")}}function Q0(t){const n={},o=[],r=Object.keys(rn.plugins.items);for(let s=0;s<r.length;s++)o.push(rn.getPlugin(r[s]));const a=t.plugins||[];for(let s=0;s<a.length;s++){const i=a[s];o.indexOf(i)===-1&&(o.push(i),n[i.id]=!0)}return{plugins:o,localIds:n}}function Z0(t,n){return!n&&t===!1?null:t===!0?{}:t}function eb(t,{plugins:n,localIds:o},r,a){const s=[],i=t.getContext();for(const l of n){const c=l.id,d=Z0(r[c],a);d!==null&&s.push({plugin:l,options:tb(t.config,{plugin:l,local:o[c]},d,i)})}return s}function tb(t,{plugin:n,local:o},r,a){const s=t.pluginScopeKeys(n),i=t.getOptionScopes(r,s);return o&&n.defaults&&i.push(n.defaults),t.createResolver(i,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ss(t,n){const o=dt.datasets[t]||{};return((n.datasets||{})[t]||{}).indexAxis||n.indexAxis||o.indexAxis||"x"}function nb(t,n){let o=t;return t==="_index_"?o=n:t==="_value_"&&(o=n==="x"?"y":"x"),o}function ob(t,n){return t===n?"_index_":"_value_"}function Rc(t){if(t==="x"||t==="y"||t==="r")return t}function rb(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Vs(t,...n){if(Rc(t))return t;for(const o of n){const r=o.axis||rb(o.position)||t.length>1&&Rc(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Lc(t,n,o){if(o[n+"AxisID"]===t)return{axis:n}}function ab(t,n){if(n.data&&n.data.datasets){const o=n.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(o.length)return Lc(t,"x",o[0])||Lc(t,"y",o[0])}return{}}function sb(t,n){const o=Gn[t.type]||{scales:{}},r=n.scales||{},a=Ss(t.type,n),s=Object.create(null);return Object.keys(r).forEach(i=>{const l=r[i];if(!Re(l))return console.error(`Invalid scale configuration for scale: ${i}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const c=Vs(i,l,ab(i,t),dt.scales[l.type]),d=ob(c,a),u=o.scales||{};s[i]=Io(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(i=>{const l=i.type||t.type,c=i.indexAxis||Ss(l,n),u=(Gn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=nb(f,c),m=i[h+"AxisID"]||h;s[m]=s[m]||Object.create(null),Io(s[m],[{axis:h},r[m],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];Io(l,[dt.scales[l.type],dt.scale])}),s}function $c(t){const n=t.options||(t.options={});n.plugins=Oe(n.plugins,{}),n.scales=sb(t,n)}function jc(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function ib(t){return t=t||{},t.data=jc(t.data),$c(t),t}const Wc=new Map,Uc=new Set;function Hr(t,n){let o=Wc.get(t);return o||(o=n(),Wc.set(t,o),Uc.add(o)),o}const Zo=(t,n,o)=>{const r=Un(n,o);r!==void 0&&t.add(r)};class lb{constructor(n){this._config=ib(n),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(n){this._config.type=n}get data(){return this._config.data}set data(n){this._config.data=jc(n)}get options(){return this._config.options}set options(n){this._config.options=n}get plugins(){return this._config.plugins}update(){const n=this._config;this.clearCache(),$c(n)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(n){return Hr(n,()=>[[`datasets.${n}`,""]])}datasetAnimationScopeKeys(n,o){return Hr(`${n}.transition.${o}`,()=>[[`datasets.${n}.transitions.${o}`,`transitions.${o}`],[`datasets.${n}`,""]])}datasetElementScopeKeys(n,o){return Hr(`${n}-${o}`,()=>[[`datasets.${n}.elements.${o}`,`datasets.${n}`,`elements.${o}`,""]])}pluginScopeKeys(n){const o=n.id,r=this.type;return Hr(`${r}-plugin-${o}`,()=>[[`plugins.${o}`,...n.additionalOptionScopes||[]]])}_cachedScopes(n,o){const r=this._scopeCache;let a=r.get(n);return(!a||o)&&(a=new Map,r.set(n,a)),a}getOptionScopes(n,o,r){const{options:a,type:s}=this,i=this._cachedScopes(n,r),l=i.get(o);if(l)return l;const c=new Set;o.forEach(u=>{n&&(c.add(n),u.forEach(f=>Zo(c,n,f))),u.forEach(f=>Zo(c,a,f)),u.forEach(f=>Zo(c,Gn[s]||{},f)),u.forEach(f=>Zo(c,dt,f)),u.forEach(f=>Zo(c,ls,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Uc.has(o)&&i.set(o,d),d}chartOptionScopes(){const{options:n,type:o}=this;return[n,Gn[o]||{},dt.datasets[o]||{},{type:o},dt,ls]}resolveNamedOptions(n,o,r,a=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=Hc(this._resolverCache,n,a);let c=i;if(db(i,o)){s.$shared=!1,r=Nn(r)?r():r;const d=this.createResolver(n,r,l);c=fo(i,r,d)}for(const d of o)s[d]=c[d];return s}createResolver(n,o,r=[""],a){const{resolver:s}=Hc(this._resolverCache,n,r);return Re(o)?fo(s,o,void 0,a):s}}function Hc(t,n,o){let r=t.get(n);r||(r=new Map,t.set(n,r));const a=o.join();let s=r.get(a);return s||(s={resolver:fs(n,o),subPrefixes:o.filter(l=>!l.toLowerCase().includes("hover"))},r.set(a,s)),s}const cb=t=>Re(t)&&Object.getOwnPropertyNames(t).some(n=>Nn(t[n]));function db(t,n){const{isScriptable:o,isIndexable:r}=Xl(t);for(const a of n){const s=o(a),i=r(a),l=(i||s)&&t[a];if(s&&(Nn(l)||cb(l))||i&&ht(l))return!0}return!1}var ub="4.5.1";const fb=["top","bottom","left","right","chartArea"];function qc(t,n){return t==="top"||t==="bottom"||fb.indexOf(t)===-1&&n==="x"}function Gc(t,n){return function(o,r){return o[t]===r[t]?o[n]-r[n]:o[t]-r[t]}}function Xc(t){const n=t.chart,o=n.options.animation;n.notifyPlugins("afterRender"),at(o&&o.onComplete,[t],n)}function hb(t){const n=t.chart,o=n.options.animation;at(o&&o.onProgress,[t],n)}function Kc(t){return ps()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const qr={},Yc=t=>{const n=Kc(t);return Object.values(qr).filter(o=>o.canvas===n).pop()};function mb(t,n,o){const r=Object.keys(t);for(const a of r){const s=+a;if(s>=n){const i=t[a];delete t[a],(o>0||s>n)&&(t[s+o]=i)}}}function pb(t,n,o,r){return!o||t.type==="mouseout"?null:r?n:t}class kn{static register(...n){rn.add(...n),Jc()}static unregister(...n){rn.remove(...n),Jc()}constructor(n,o){const r=this.config=new lb(o),a=Kc(n),s=Yc(a);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const i=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||P0(a)),this.platform.updateConfig(r);const l=this.platform.acquireContext(a,i.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=hp(),this.ctx=l,this.canvas=c,this.width=u,this.height=d,this._options=i,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new J0,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=vp(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],qr[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}yn.listen(this,"complete",Xc),yn.listen(this,"progress",hb),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:n,maintainAspectRatio:o},width:r,height:a,_aspectRatio:s}=this;return He(n)?o&&s?s:a?r/a:null:n}get data(){return this.config.data}set data(n){this.config.data=n}get options(){return this._options}set options(n){this.config.options=n}get registry(){return rn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Hl(this.canvas,this.ctx),this}stop(){return yn.stop(this),this}resize(n,o){yn.running(this)?this._resizeBeforeDraw={width:n,height:o}:this._resize(n,o)}_resize(n,o){const r=this.options,a=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(a,n,o,s),l=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,tc(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),at(r.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};Ye(o,(r,a)=>{r.id=a})}buildOrUpdateScales(){const n=this.options,o=n.scales,r=this.scales,a=Object.keys(r).reduce((i,l)=>(i[l]=!1,i),{});let s=[];o&&(s=s.concat(Object.keys(o).map(i=>{const l=o[i],c=Vs(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Ye(s,i=>{const l=i.options,c=l.id,d=Vs(c,l),u=Oe(l.type,i.dtype);(l.position===void 0||qc(l.position,d)!==qc(i.dposition))&&(l.position=i.dposition),a[c]=!0;let f=null;if(c in r&&r[c].type===u)f=r[c];else{const h=rn.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(l,n)}),Ye(a,(i,l)=>{i||delete r[l]}),Ye(r,i=>{Ut.configure(this,i,i.options),Ut.addBox(this,i)})}_updateMetasets(){const n=this._metasets,o=this.data.datasets.length,r=n.length;if(n.sort((a,s)=>a.index-s.index),r>o){for(let a=o;a<r;++a)this._destroyDatasetMeta(a);n.splice(o,r-o)}this._sortedMetasets=n.slice(0).sort(Gc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:n,data:{datasets:o}}=this;n.length>o.length&&delete this._stacks,n.forEach((r,a)=>{o.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(a)})}buildOrUpdateControllers(){const n=[],o=this.data.datasets;let r,a;for(this._removeUnreferencedMetasets(),r=0,a=o.length;r<a;r++){const s=o[r];let i=this.getDatasetMeta(r);const l=s.type||this.config.type;if(i.type&&i.type!==l&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=l,i.indexAxis=s.indexAxis||Ss(l,this.options),i.order=s.order||0,i.index=r,i.label=""+s.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const c=rn.getController(l),{datasetElementType:d,dataElementType:u}=dt.datasets[l];Object.assign(c,{dataElementType:rn.getElement(u),datasetElementType:d&&rn.getElement(d)}),i.controller=new c(this,r),n.push(i.controller)}}return this._updateMetasets(),n}_resetElements(){Ye(this.data.datasets,(n,o)=>{this.getDatasetMeta(o).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(n){const o=this.config;o.update();const r=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:n,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:f}=this.getDatasetMeta(d),h=!a&&s.indexOf(f)===-1;f.buildOrUpdateElements(h),i=Math.max(+f.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),a||Ye(s,d=>{d.reset()}),this._updateDatasets(n),this.notifyPlugins("afterUpdate",{mode:n}),this._layers.sort(Gc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Ye(this.scales,n=>{Ut.removeBox(this,n)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const n=this.options,o=new Set(Object.keys(this._listeners)),r=new Set(n.events);(!Al(o,r)||!!this._responsiveListeners!==n.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:n}=this,o=this._getUniformDataChanges()||[];for(const{method:r,start:a,count:s}of o){const i=r==="_removeElements"?-s:s;mb(n,a,i)}}_getUniformDataChanges(){const n=this._dataChanges;if(!n||!n.length)return;this._dataChanges=[];const o=this.data.datasets.length,r=s=>new Set(n.filter(i=>i[0]===s).map((i,l)=>l+","+i.splice(1).join(","))),a=r(0);for(let s=1;s<o;s++)if(!Al(a,r(s)))return;return Array.from(a).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(n){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ut.update(this,this.width,this.height,n);const o=this.chartArea,r=o.width<=0||o.height<=0;this._layers=[],Ye(this.boxes,a=>{r&&a.position==="chartArea"||(a.configure&&a.configure(),this._layers.push(...a._layers()))},this),this._layers.forEach((a,s)=>{a._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(n){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:n,cancelable:!0})!==!1){for(let o=0,r=this.data.datasets.length;o<r;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,r=this.data.datasets.length;o<r;++o)this._updateDataset(o,Nn(n)?n({datasetIndex:o}):n);this.notifyPlugins("afterDatasetsUpdate",{mode:n})}}_updateDataset(n,o){const r=this.getDatasetMeta(n),a={meta:r,index:n,mode:o,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",a)!==!1&&(r.controller._update(o),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(yn.has(this)?this.attached&&!yn.running(this)&&yn.start(this):(this.draw(),Xc({chart:this})))}draw(){let n;if(this._resizeBeforeDraw){const{width:r,height:a}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,a)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const o=this._layers;for(n=0;n<o.length&&o[n].z<=0;++n)o[n].draw(this.chartArea);for(this._drawDatasets();n<o.length;++n)o[n].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(n){const o=this._sortedMetasets,r=[];let a,s;for(a=0,s=o.length;a<s;++a){const i=o[a];(!n||i.visible)&&r.push(i)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const n=this.getSortedVisibleDatasetMetas();for(let o=n.length-1;o>=0;--o)this._drawDataset(n[o]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(n){const o=this.ctx,r={meta:n,index:n.index,cancelable:!0},a=uc(this,n);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(a&&Dr(o,a),n.controller.draw(),a&&Nr(o),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(n){return Ho(n,this.chartArea,this._minPadding)}getElementsAtEventForMode(n,o,r,a){const s=f0.modes[o];return typeof s=="function"?s(this,n,r,a):[]}getDatasetMeta(n){const o=this.data.datasets[n],r=this._metasets;let a=r.filter(s=>s&&s._dataset===o).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:o&&o.order||0,index:n,_dataset:o,_parsed:[],_sorted:!1},r.push(a)),a}getContext(){return this.$context||(this.$context=Kn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(n){const o=this.data.datasets[n];if(!o)return!1;const r=this.getDatasetMeta(n);return typeof r.hidden=="boolean"?!r.hidden:!o.hidden}setDatasetVisibility(n,o){const r=this.getDatasetMeta(n);r.hidden=!o}toggleDataVisibility(n){this._hiddenIndices[n]=!this._hiddenIndices[n]}getDataVisibility(n){return!this._hiddenIndices[n]}_updateVisibility(n,o,r){const a=r?"show":"hide",s=this.getDatasetMeta(n),i=s.controller._resolveAnimations(void 0,a);Ro(o)?(s.data[o].hidden=!r,this.update()):(this.setDatasetVisibility(n,r),i.update(s,{visible:r}),this.update(l=>l.datasetIndex===n?a:void 0))}hide(n,o){this._updateVisibility(n,o,!1)}show(n,o){this._updateVisibility(n,o,!0)}_destroyDatasetMeta(n){const o=this._metasets[n];o&&o.controller&&o.controller._destroy(),delete this._metasets[n]}_stop(){let n,o;for(this.stop(),yn.remove(this),n=0,o=this.data.datasets.length;n<o;++n)this._destroyDatasetMeta(n)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:n,ctx:o}=this;this._stop(),this.config.clearCache(),n&&(this.unbindEvents(),Hl(n,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete qr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...n){return this.canvas.toDataURL(...n)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const n=this._listeners,o=this.platform,r=(s,i)=>{o.addEventListener(this,s,i),n[s]=i},a=(s,i,l)=>{s.offsetX=i,s.offsetY=l,this._eventHandler(s)};Ye(this.options.events,s=>r(s,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const n=this._responsiveListeners,o=this.platform,r=(c,d)=>{o.addEventListener(this,c,d),n[c]=d},a=(c,d)=>{n[c]&&(o.removeEventListener(this,c,d),delete n[c])},s=(c,d)=>{this.canvas&&this.resize(c,d)};let i;const l=()=>{a("attach",l),this.attached=!0,this.resize(),r("resize",s),r("detach",i)};i=()=>{this.attached=!1,a("resize",s),this._stop(),this._resize(0,0),r("attach",l)},o.isAttached(this.canvas)?l():i()}unbindEvents(){Ye(this._listeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._listeners={},Ye(this._responsiveListeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._responsiveListeners=void 0}updateHoverStyle(n,o,r){const a=r?"set":"remove";let s,i,l,c;for(o==="dataset"&&(s=this.getDatasetMeta(n[0].datasetIndex),s.controller["_"+a+"DatasetHoverStyle"]()),l=0,c=n.length;l<c;++l){i=n[l];const d=i&&this.getDatasetMeta(i.datasetIndex).controller;d&&d[a+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(n){const o=this._active||[],r=n.map(({datasetIndex:s,index:i})=>{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[i],index:i}});!_r(r,o)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,o))}notifyPlugins(n,o,r){return this._plugins.notify(this,n,o,r)}isPluginEnabled(n){return this._plugins._cache.filter(o=>o.plugin.id===n).length===1}_updateHoverStyles(n,o,r){const a=this.options.hover,s=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),i=s(o,n),l=r?n:s(n,o);i.length&&this.updateHoverStyle(i,a.mode,!1),l.length&&a.mode&&this.updateHoverStyle(l,a.mode,!0)}_eventHandler(n,o){const r={event:n,replay:o,cancelable:!0,inChartArea:this.isPointInArea(n)},a=i=>(i.options.events||this.options.events).includes(n.native.type);if(this.notifyPlugins("beforeEvent",r,a)===!1)return;const s=this._handleEvent(n,o,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,a),(s||r.changed)&&this.render(),this}_handleEvent(n,o,r){const{_active:a=[],options:s}=this,i=o,l=this._getActiveElements(n,a,r,i),c=xp(n),d=pb(n,this._lastEvent,r,c);r&&(this._lastEvent=null,at(s.onHover,[n,l,this],this),c&&at(s.onClick,[n,l,this],this));const u=!_r(l,a);return(u||o)&&(this._active=l,this._updateHoverStyles(l,a,o)),this._lastEvent=d,u}_getActiveElements(n,o,r,a){if(n.type==="mouseout")return[];if(!r)return o;const s=this.options.hover;return this.getElementsAtEventForMode(n,s.mode,s,a)}}ke(kn,"defaults",dt),ke(kn,"instances",qr),ke(kn,"overrides",Gn),ke(kn,"registry",rn),ke(kn,"version",ub),ke(kn,"getChart",Yc);function Jc(){return Ye(kn.instances,t=>t._plugins.invalidate())}function gb(t,n,o){const{startAngle:r,x:a,y:s,outerRadius:i,innerRadius:l,options:c}=n,{borderWidth:d,borderJoinStyle:u}=c,f=Math.min(d/i,Ft(r-o));if(t.beginPath(),t.arc(a,s,i-d/2,r+f/2,o-f/2),l>0){const h=Math.min(d/l,Ft(r-o));t.arc(a,s,l+d/2,o-h/2,r+h/2,!0)}else{const h=Math.min(d/2,i*Ft(r-o));if(u==="round")t.arc(a,s,h,o-Je/2,r+Je/2,!0);else if(u==="bevel"){const m=2*h*h,g=-m*Math.cos(o+Je/2)+a,k=-m*Math.sin(o+Je/2)+s,y=m*Math.cos(r+Je/2)+a,p=m*Math.sin(r+Je/2)+s;t.lineTo(g,k),t.lineTo(y,p)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function bb(t,n,o){const{startAngle:r,pixelMargin:a,x:s,y:i,outerRadius:l,innerRadius:c}=n;let d=a/l;t.beginPath(),t.arc(s,i,l,r-d,o+d),c>a?(d=a/c,t.arc(s,i,c,o+d,r-d,!0)):t.arc(s,i,a,o+gt,r-gt),t.closePath(),t.clip()}function yb(t){return us(t,["outerStart","outerEnd","innerStart","innerEnd"])}function xb(t,n,o,r){const a=yb(t.options.borderRadius),s=(o-n)/2,i=Math.min(s,r*n/2),l=c=>{const d=(o-Math.min(s,c))*r/2;return wt(c,0,Math.min(s,d))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:wt(a.innerStart,0,i),innerEnd:wt(a.innerEnd,0,i)}}function bo(t,n,o,r){return{x:o+t*Math.cos(n),y:r+t*Math.sin(n)}}function Gr(t,n,o,r,a,s){const{x:i,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=n,f=Math.max(n.outerRadius+r+o-d,0),h=u>0?u+r+o+d:0;let m=0;const g=a-c;if(r){const Q=u>0?u-r:0,$=f>0?f-r:0,q=(Q+$)/2,Y=q!==0?g*q/(q+r):g;m=(g-Y)/2}const k=Math.max(.001,g*f-o/Je)/f,y=(g-k)/2,p=c+y+m,E=a-y-m,{outerStart:_,outerEnd:B,innerStart:S,innerEnd:w}=xb(n,h,f,E-p),x=f-_,b=f-B,V=p+_/x,A=E-B/b,D=h+S,N=h+w,P=p+S/D,v=E-w/N;if(t.beginPath(),s){const Q=(V+A)/2;if(t.arc(i,l,f,V,Q),t.arc(i,l,f,Q,A),B>0){const X=bo(b,A,i,l);t.arc(X.x,X.y,B,A,E+gt)}const $=bo(N,E,i,l);if(t.lineTo($.x,$.y),w>0){const X=bo(N,v,i,l);t.arc(X.x,X.y,w,E+gt,v+Math.PI)}const q=(E-w/h+(p+S/h))/2;if(t.arc(i,l,h,E-w/h,q,!0),t.arc(i,l,h,q,p+S/h,!0),S>0){const X=bo(D,P,i,l);t.arc(X.x,X.y,S,P+Math.PI,p-gt)}const Y=bo(x,p,i,l);if(t.lineTo(Y.x,Y.y),_>0){const X=bo(x,V,i,l);t.arc(X.x,X.y,_,p-gt,V)}}else{t.moveTo(i,l);const Q=Math.cos(V)*f+i,$=Math.sin(V)*f+l;t.lineTo(Q,$);const q=Math.cos(A)*f+i,Y=Math.sin(A)*f+l;t.lineTo(q,Y)}t.closePath()}function kb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l}=n;let c=n.endAngle;if(s){Gr(t,n,o,r,c,a);for(let d=0;d<s;++d)t.fill();isNaN(l)||(c=i+(l%it||it))}return Gr(t,n,o,r,c,a),t.fill(),c}function wb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l,options:c}=n,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h,borderRadius:m}=c,g=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=h,g?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let k=n.endAngle;if(s){Gr(t,n,o,r,k,a);for(let y=0;y<s;++y)t.stroke();isNaN(l)||(k=i+(l%it||it))}g&&bb(t,n,k),c.selfJoin&&k-i>=Je&&m===0&&u!=="miter"&&gb(t,n,k),s||(Gr(t,n,o,r,k,a),t.stroke())}class er extends xn{constructor(o){super();ke(this,"circumference");ke(this,"endAngle");ke(this,"fullCircles");ke(this,"innerRadius");ke(this,"outerRadius");ke(this,"pixelMargin");ke(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,o&&Object.assign(this,o)}inRange(o,r,a){const s=this.getProps(["x","y"],a),{angle:i,distance:l}=Pl(s,{x:o,y:r}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),m=(this.options.spacing+this.options.borderWidth)/2,g=Oe(h,d-c),k=jo(i,c,d)&&c!==d,y=g>=it||k,p=bn(l,u+m,f+m);return y&&p}getCenterPoint(o){const{x:r,y:a,startAngle:s,endAngle:i,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],o),{offset:d,spacing:u}=this.options,f=(s+i)/2,h=(l+c+u+d)/2;return{x:r+Math.cos(f)*h,y:a+Math.sin(f)*h}}tooltipPosition(o){return this.getCenterPoint(o)}draw(o){const{options:r,circumference:a}=this,s=(r.offset||0)/4,i=(r.spacing||0)/2,l=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=a>it?Math.floor(a/it):0,a===0||this.innerRadius<0||this.outerRadius<0)return;o.save();const c=(this.startAngle+this.endAngle)/2;o.translate(Math.cos(c)*s,Math.sin(c)*s);const d=1-Math.sin(Math.min(Je,a||0)),u=s*d;o.fillStyle=r.backgroundColor,o.strokeStyle=r.borderColor,kb(o,this,u,i,l),wb(o,this,u,i,l),o.restore()}}ke(er,"id","arc"),ke(er,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),ke(er,"defaultRoutes",{backgroundColor:"backgroundColor"}),ke(er,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function Qc(t,n,o=n){t.lineCap=Oe(o.borderCapStyle,n.borderCapStyle),t.setLineDash(Oe(o.borderDash,n.borderDash)),t.lineDashOffset=Oe(o.borderDashOffset,n.borderDashOffset),t.lineJoin=Oe(o.borderJoinStyle,n.borderJoinStyle),t.lineWidth=Oe(o.borderWidth,n.borderWidth),t.strokeStyle=Oe(o.borderColor,n.borderColor)}function Cb(t,n,o){t.lineTo(o.x,o.y)}function Eb(t){return t.stepped?qp:t.tension||t.cubicInterpolationMode==="monotone"?Gp:Cb}function Zc(t,n,o={}){const r=t.length,{start:a=0,end:s=r-1}=o,{start:i,end:l}=n,c=Math.max(a,i),d=Math.min(s,l),u=a<i&&s<i||a>l&&s>l;return{count:r,start:c,loop:n.loop,ilen:d<c&&!u?r+d-c:d-c}}function Bb(t,n,o,r){const{points:a,options:s}=n,{count:i,start:l,loop:c,ilen:d}=Zc(a,o,r),u=Eb(s);let{move:f=!0,reverse:h}=r||{},m,g,k;for(m=0;m<=d;++m)g=a[(l+(h?d-m:m))%i],!g.skip&&(f?(t.moveTo(g.x,g.y),f=!1):u(t,k,g,h,s.stepped),k=g);return c&&(g=a[(l+(h?d:0))%i],u(t,k,g,h,s.stepped)),!!c}function _b(t,n,o,r){const a=n.points,{count:s,start:i,ilen:l}=Zc(a,o,r),{move:c=!0,reverse:d}=r||{};let u=0,f=0,h,m,g,k,y,p;const E=B=>(i+(d?l-B:B))%s,_=()=>{k!==y&&(t.lineTo(u,y),t.lineTo(u,k),t.lineTo(u,p))};for(c&&(m=a[E(0)],t.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=a[E(h)],m.skip)continue;const B=m.x,S=m.y,w=B|0;w===g?(S<k?k=S:S>y&&(y=S),u=(f*u+B)/++f):(_(),t.lineTo(B,S),g=w,f=0,k=y=S),p=S}_()}function As(t){const n=t.options,o=n.borderDash&&n.borderDash.length;return!t._decimated&&!t._loop&&!n.tension&&n.cubicInterpolationMode!=="monotone"&&!n.stepped&&!o?_b:Bb}function Sb(t){return t.stepped?_g:t.tension||t.cubicInterpolationMode==="monotone"?Sg:Qn}function Vb(t,n,o,r){let a=n._path;a||(a=n._path=new Path2D,n.path(a,o,r)&&a.closePath()),Qc(t,n.options),t.stroke(a)}function Ab(t,n,o,r){const{segments:a,options:s}=n,i=As(n);for(const l of a)Qc(t,s,l.style),t.beginPath(),i(t,n,l,{start:o,end:o+r-1})&&t.closePath(),t.stroke()}const Db=typeof Path2D=="function";function Nb(t,n,o,r){Db&&!n.options.segment?Vb(t,n,o,r):Ab(t,n,o,r)}class vn extends xn{constructor(n){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,n&&Object.assign(this,n)}updateControlPoints(n,o){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const a=r.spanGaps?this._loop:this._fullLoop;bg(this._points,r,n,a,o),this._pointsUpdated=!0}}set points(n){this._points=n,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=vg(this,this.options.segment))}first(){const n=this.segments,o=this.points;return n.length&&o[n[0].start]}last(){const n=this.segments,o=this.points,r=n.length;return r&&o[n[r-1].end]}interpolate(n,o){const r=this.options,a=n[o],s=this.points,i=lc(this,{property:o,start:a,end:a});if(!i.length)return;const l=[],c=Sb(r);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:h}=i[d],m=s[f],g=s[h];if(m===g){l.push(m);continue}const k=Math.abs((a-m[o])/(g[o]-m[o])),y=c(m,g,k,r.stepped);y[o]=n[o],l.push(y)}return l.length===1?l[0]:l}pathSegment(n,o,r){return As(this)(n,this,o,r)}path(n,o,r){const a=this.segments,s=As(this);let i=this._loop;o=o||0,r=r||this.points.length-o;for(const l of a)i&=s(n,this,l,{start:o,end:o+r-1});return!!i}draw(n,o,r,a){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(n.save(),Nb(n,this,r,a),n.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ke(vn,"id","line"),ke(vn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ke(vn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ke(vn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"});function ed(t,n,o,r){const a=t.options,{[o]:s}=t.getProps([o],r);return Math.abs(n-s)<a.radius+a.hitRadius}class Xr extends xn{constructor(o){super();ke(this,"parsed");ke(this,"skip");ke(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,o&&Object.assign(this,o)}inRange(o,r,a){const s=this.options,{x:i,y:l}=this.getProps(["x","y"],a);return Math.pow(o-i,2)+Math.pow(r-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(o,r){return ed(this,o,"x",r)}inYRange(o,r){return ed(this,o,"y",r)}getCenterPoint(o){const{x:r,y:a}=this.getProps(["x","y"],o);return{x:r,y:a}}size(o){o=o||this.options||{};let r=o.radius||0;r=Math.max(r,r&&o.hoverRadius||0);const a=r&&o.borderWidth||0;return(r+a)*2}draw(o,r){const a=this.options;this.skip||a.radius<.1||!Ho(this,r,this.size(a)/2)||(o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.fillStyle=a.backgroundColor,ds(o,a,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}ke(Xr,"id","point"),ke(Xr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ke(Xr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function td(t,n){const{x:o,y:r,base:a,width:s,height:i}=t.getProps(["x","y","base","width","height"],n);let l,c,d,u,f;return t.horizontal?(f=i/2,l=Math.min(o,a),c=Math.max(o,a),d=r-f,u=r+f):(f=s/2,l=o-f,c=o+f,d=Math.min(r,a),u=Math.max(r,a)),{left:l,top:d,right:c,bottom:u}}function Pn(t,n,o,r){return t?0:wt(n,o,r)}function Mb(t,n,o){const r=t.options.borderWidth,a=t.borderSkipped,s=Gl(r);return{t:Pn(a.top,s.top,0,o),r:Pn(a.right,s.right,0,n),b:Pn(a.bottom,s.bottom,0,o),l:Pn(a.left,s.left,0,n)}}function vb(t,n,o){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,s=uo(a),i=Math.min(n,o),l=t.borderSkipped,c=r||Re(a);return{topLeft:Pn(!c||l.top||l.left,s.topLeft,0,i),topRight:Pn(!c||l.top||l.right,s.topRight,0,i),bottomLeft:Pn(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:Pn(!c||l.bottom||l.right,s.bottomRight,0,i)}}function Pb(t){const n=td(t),o=n.right-n.left,r=n.bottom-n.top,a=Mb(t,o/2,r/2),s=vb(t,o/2,r/2);return{outer:{x:n.left,y:n.top,w:o,h:r,radius:s},inner:{x:n.left+a.l,y:n.top+a.t,w:o-a.l-a.r,h:r-a.t-a.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,s.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(a.b,a.r))}}}}function Ds(t,n,o,r){const a=n===null,s=o===null,l=t&&!(a&&s)&&td(t,r);return l&&(a||bn(n,l.left,l.right))&&(s||bn(o,l.top,l.bottom))}function Tb(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function Ob(t,n){t.rect(n.x,n.y,n.w,n.h)}function Ns(t,n,o={}){const r=t.x!==o.x?-n:0,a=t.y!==o.y?-n:0,s=(t.x+t.w!==o.x+o.w?n:0)-r,i=(t.y+t.h!==o.y+o.h?n:0)-a;return{x:t.x+r,y:t.y+a,w:t.w+s,h:t.h+i,radius:t.radius}}class Kr extends xn{constructor(n){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,n&&Object.assign(this,n)}draw(n){const{inflateAmount:o,options:{borderColor:r,backgroundColor:a}}=this,{inner:s,outer:i}=Pb(this),l=Tb(i.radius)?Mr:Ob;n.save(),(i.w!==s.w||i.h!==s.h)&&(n.beginPath(),l(n,Ns(i,o,s)),n.clip(),l(n,Ns(s,-o,i)),n.fillStyle=r,n.fill("evenodd")),n.beginPath(),l(n,Ns(s,o)),n.fillStyle=a,n.fill(),n.restore()}inRange(n,o,r){return Ds(this,n,o,r)}inXRange(n,o){return Ds(this,n,null,o)}inYRange(n,o){return Ds(this,null,n,o)}getCenterPoint(n){const{x:o,y:r,base:a,horizontal:s}=this.getProps(["x","y","base","horizontal"],n);return{x:s?(o+a)/2:o,y:s?r:(r+a)/2}}getRange(n){return n==="x"?this.width/2:this.height/2}}ke(Kr,"id","bar"),ke(Kr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),ke(Kr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Fb(t,n,o){const r=t.segments,a=t.points,s=n.points,i=[];for(const l of r){let{start:c,end:d}=l;d=Yr(c,d,a);const u=Ms(o,a[c],a[d],l.loop);if(!n.segments){i.push({source:l,target:u,start:a[c],end:a[d]});continue}const f=lc(n,u);for(const h of f){const m=Ms(o,s[h.start],s[h.end],h.loop),g=ic(l,a,m);for(const k of g)i.push({source:k,target:h,start:{[o]:nd(u,m,"start",Math.max)},end:{[o]:nd(u,m,"end",Math.min)}})}}return i}function Ms(t,n,o,r){if(r)return;let a=n[t],s=o[t];return t==="angle"&&(a=Ft(a),s=Ft(s)),{property:t,start:a,end:s}}function zb(t,n){const{x:o=null,y:r=null}=t||{},a=n.points,s=[];return n.segments.forEach(({start:i,end:l})=>{l=Yr(i,l,a);const c=a[i],d=a[l];r!==null?(s.push({x:c.x,y:r}),s.push({x:d.x,y:r})):o!==null&&(s.push({x:o,y:c.y}),s.push({x:o,y:d.y}))}),s}function Yr(t,n,o){for(;n>t;n--){const r=o[n];if(!isNaN(r.x)&&!isNaN(r.y))break}return n}function nd(t,n,o,r){return t&&n?r(t[o],n[o]):t?t[o]:n?n[o]:0}function od(t,n){let o=[],r=!1;return ht(t)?(r=!0,o=t):o=zb(t,n),o.length?new vn({points:o,options:{tension:0},_loop:r,_fullLoop:r}):null}function rd(t){return t&&t.fill!==!1}function Ib(t,n,o){let a=t[n].fill;const s=[n];let i;if(!o)return a;for(;a!==!1&&s.indexOf(a)===-1;){if(!kt(a))return a;if(i=t[a],!i)return!1;if(i.visible)return a;s.push(a),a=i.fill}return!1}function Rb(t,n,o){const r=Wb(t);if(Re(r))return isNaN(r.value)?!1:r;let a=parseFloat(r);return kt(a)&&Math.floor(a)===a?Lb(r[0],n,a,o):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Lb(t,n,o,r){return(t==="-"||t==="+")&&(o=n+o),o===n||o<0||o>=r?!1:o}function $b(t,n){let o=null;return t==="start"?o=n.bottom:t==="end"?o=n.top:Re(t)?o=n.getPixelForValue(t.value):n.getBasePixel&&(o=n.getBasePixel()),o}function jb(t,n,o){let r;return t==="start"?r=o:t==="end"?r=n.options.reverse?n.min:n.max:Re(t)?r=t.value:r=n.getBaseValue(),r}function Wb(t){const n=t.options,o=n.fill;let r=Oe(o&&o.target,o);return r===void 0&&(r=!!n.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Ub(t){const{scale:n,index:o,line:r}=t,a=[],s=r.segments,i=r.points,l=Hb(n,o);l.push(od({x:null,y:n.bottom},r));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)qb(a,i[u],l)}return new vn({points:a,options:{}})}function Hb(t,n){const o=[],r=t.getMatchingVisibleMetas("line");for(let a=0;a<r.length;a++){const s=r[a];if(s.index===n)break;s.hidden||o.unshift(s.dataset)}return o}function qb(t,n,o){const r=[];for(let a=0;a<o.length;a++){const s=o[a],{first:i,last:l,point:c}=Gb(s,n,"x");if(!(!c||i&&l)){if(i)r.unshift(c);else if(t.push(c),!l)break}}t.push(...r)}function Gb(t,n,o){const r=t.interpolate(n,o);if(!r)return{};const a=r[o],s=t.segments,i=t.points;let l=!1,c=!1;for(let d=0;d<s.length;d++){const u=s[d],f=i[u.start][o],h=i[u.end][o];if(bn(a,f,h)){l=a===f,c=a===h;break}}return{first:l,last:c,point:r}}class ad{constructor(n){this.x=n.x,this.y=n.y,this.radius=n.radius}pathSegment(n,o,r){const{x:a,y:s,radius:i}=this;return o=o||{start:0,end:it},n.arc(a,s,i,o.end,o.start,!0),!r.bounds}interpolate(n){const{x:o,y:r,radius:a}=this,s=n.angle;return{x:o+Math.cos(s)*a,y:r+Math.sin(s)*a,angle:s}}}function Xb(t){const{chart:n,fill:o,line:r}=t;if(kt(o))return Kb(n,o);if(o==="stack")return Ub(t);if(o==="shape")return!0;const a=Yb(t);return a instanceof ad?a:od(a,r)}function Kb(t,n){const o=t.getDatasetMeta(n);return o&&t.isDatasetVisible(n)?o.dataset:null}function Yb(t){return(t.scale||{}).getPointPositionForValue?Qb(t):Jb(t)}function Jb(t){const{scale:n={},fill:o}=t,r=$b(o,n);if(kt(r)){const a=n.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}function Qb(t){const{scale:n,fill:o}=t,r=n.options,a=n.getLabels().length,s=r.reverse?n.max:n.min,i=jb(o,n,s),l=[];if(r.grid.circular){const c=n.getPointPositionForValue(0,s);return new ad({x:c.x,y:c.y,radius:n.getDistanceFromCenterForValue(i)})}for(let c=0;c<a;++c)l.push(n.getPointPositionForValue(c,i));return l}function vs(t,n,o){const r=Xb(n),{chart:a,index:s,line:i,scale:l,axis:c}=n,d=i.options,u=d.fill,f=d.backgroundColor,{above:h=f,below:m=f}=u||{},g=a.getDatasetMeta(s),k=uc(a,g);r&&i.points.length&&(Dr(t,o),Zb(t,{line:i,target:r,above:h,below:m,area:o,scale:l,axis:c,clip:k}),Nr(t))}function Zb(t,n){const{line:o,target:r,above:a,below:s,area:i,scale:l,clip:c}=n,d=o._loop?"angle":n.axis;t.save();let u=s;s!==a&&(d==="x"?(sd(t,r,i.top),Ps(t,{line:o,target:r,color:a,scale:l,property:d,clip:c}),t.restore(),t.save(),sd(t,r,i.bottom)):d==="y"&&(id(t,r,i.left),Ps(t,{line:o,target:r,color:s,scale:l,property:d,clip:c}),t.restore(),t.save(),id(t,r,i.right),u=a)),Ps(t,{line:o,target:r,color:u,scale:l,property:d,clip:c}),t.restore()}function sd(t,n,o){const{segments:r,points:a}=n;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],f=a[Yr(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(u.x,o),t.lineTo(u.x,u.y)),i=!!n.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(f.x,o)}t.lineTo(n.first().x,o),t.closePath(),t.clip()}function id(t,n,o){const{segments:r,points:a}=n;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],f=a[Yr(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(o,u.y),t.lineTo(u.x,u.y)),i=!!n.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(o,f.y)}t.lineTo(o,n.first().y),t.closePath(),t.clip()}function Ps(t,n){const{line:o,target:r,property:a,color:s,scale:i,clip:l}=n,c=Fb(o,r,a);for(const{source:d,target:u,start:f,end:h}of c){const{style:{backgroundColor:m=s}={}}=d,g=r!==!0;t.save(),t.fillStyle=m,ey(t,i,l,g&&Ms(a,f,h)),t.beginPath();const k=!!o.pathSegment(t,d);let y;if(g){k?t.closePath():ld(t,r,h,a);const p=!!r.pathSegment(t,u,{move:k,reverse:!0});y=k&&p,y||ld(t,r,f,a)}t.closePath(),t.fill(y?"evenodd":"nonzero"),t.restore()}}function ey(t,n,o,r){const a=n.chart.chartArea,{property:s,start:i,end:l}=r||{};if(s==="x"||s==="y"){let c,d,u,f;s==="x"?(c=i,d=a.top,u=l,f=a.bottom):(c=a.left,d=i,u=a.right,f=l),t.beginPath(),o&&(c=Math.max(c,o.left),u=Math.min(u,o.right),d=Math.max(d,o.top),f=Math.min(f,o.bottom)),t.rect(c,d,u-c,f-d),t.clip()}}function ld(t,n,o,r){const a=n.interpolate(o,r);a&&t.lineTo(a.x,a.y)}var ty={id:"filler",afterDatasetsUpdate(t,n,o){const r=(t.data.datasets||[]).length,a=[];let s,i,l,c;for(i=0;i<r;++i)s=t.getDatasetMeta(i),l=s.dataset,c=null,l&&l.options&&l instanceof vn&&(c={visible:t.isDatasetVisible(i),index:i,fill:Rb(l,i,r),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=c,a.push(c);for(i=0;i<r;++i)c=a[i],!(!c||c.fill===!1)&&(c.fill=Ib(a,i,o.propagate))},beforeDraw(t,n,o){const r=o.drawTime==="beforeDraw",a=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let i=a.length-1;i>=0;--i){const l=a[i].$filler;l&&(l.line.updateControlPoints(s,l.axis),r&&l.fill&&vs(t.ctx,l,s))}},beforeDatasetsDraw(t,n,o){if(o.drawTime!=="beforeDatasetsDraw")return;const r=t.getSortedVisibleDatasetMetas();for(let a=r.length-1;a>=0;--a){const s=r[a].$filler;rd(s)&&vs(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,n,o){const r=n.meta.$filler;!rd(r)||o.drawTime!=="beforeDatasetDraw"||vs(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const cd=(t,n)=>{let{boxHeight:o=n,boxWidth:r=n}=t;return t.usePointStyle&&(o=Math.min(o,n),r=t.pointStyleWidth||Math.min(r,n)),{boxWidth:r,boxHeight:o,itemHeight:Math.max(n,o)}},ny=(t,n)=>t!==null&&n!==null&&t.datasetIndex===n.datasetIndex&&t.index===n.index;class dd extends xn{constructor(n){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=n.chart,this.options=n.options,this.ctx=n.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(n,o,r){this.maxWidth=n,this.maxHeight=o,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const n=this.options.labels||{};let o=at(n.generateLabels,[this.chart],this)||[];n.filter&&(o=o.filter(r=>n.filter(r,this.chart.data))),n.sort&&(o=o.sort((r,a)=>n.sort(r,a,this.chart.data))),this.options.reverse&&o.reverse(),this.legendItems=o}fit(){const{options:n,ctx:o}=this;if(!n.display){this.width=this.height=0;return}const r=n.labels,a=Et(r.font),s=a.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=cd(r,s);let d,u;o.font=a.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(i,s,l,c)+10):(u=this.maxHeight,d=this._fitCols(i,a,l,c)+10),this.width=Math.min(d,n.maxWidth||this.maxWidth),this.height=Math.min(u,n.maxHeight||this.maxHeight)}_fitRows(n,o,r,a){const{ctx:s,maxWidth:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=a+l;let f=n;s.textAlign="left",s.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((g,k)=>{const y=r+o/2+s.measureText(g.text).width;(k===0||d[d.length-1]+y+2*l>i)&&(f+=u,d[d.length-(k>0?0:1)]=0,m+=u,h++),c[k]={left:0,top:m,row:h,width:y,height:a},d[d.length-1]+=y+l}),f}_fitCols(n,o,r,a){const{ctx:s,maxHeight:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=i-n;let f=l,h=0,m=0,g=0,k=0;return this.legendItems.forEach((y,p)=>{const{itemWidth:E,itemHeight:_}=oy(r,o,s,y,a);p>0&&m+_+2*l>u&&(f+=h+l,d.push({width:h,height:m}),g+=h+l,k++,h=m=0),c[p]={left:g,top:m,col:k,width:E,height:_},h=Math.max(h,E),m+=_+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const n=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:r,labels:{padding:a},rtl:s}}=this,i=mo(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=Ct(r,this.left+a,this.right-this.lineWidths[l]);for(const d of o)l!==d.row&&(l=d.row,c=Ct(r,this.left+a,this.right-this.lineWidths[l])),d.top+=this.top+n+a,d.left=i.leftForLtr(i.x(c),d.width),c+=d.width+a}else{let l=0,c=Ct(r,this.top+n+a,this.bottom-this.columnSizes[l].height);for(const d of o)d.col!==l&&(l=d.col,c=Ct(r,this.top+n+a,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+a,d.left=i.leftForLtr(i.x(d.left),d.width),c+=d.height+a}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const n=this.ctx;Dr(n,this),this._draw(),Nr(n)}}_draw(){const{options:n,columnSizes:o,lineWidths:r,ctx:a}=this,{align:s,labels:i}=n,l=dt.color,c=mo(n.rtl,this.left,this.width),d=Et(i.font),{padding:u}=i,f=d.size,h=f/2;let m;this.drawTitle(),a.textAlign=c.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=d.string;const{boxWidth:g,boxHeight:k,itemHeight:y}=cd(i,f),p=function(w,x,b){if(isNaN(g)||g<=0||isNaN(k)||k<0)return;a.save();const V=Oe(b.lineWidth,1);if(a.fillStyle=Oe(b.fillStyle,l),a.lineCap=Oe(b.lineCap,"butt"),a.lineDashOffset=Oe(b.lineDashOffset,0),a.lineJoin=Oe(b.lineJoin,"miter"),a.lineWidth=V,a.strokeStyle=Oe(b.strokeStyle,l),a.setLineDash(Oe(b.lineDash,[])),i.usePointStyle){const A={radius:k*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:V},D=c.xPlus(w,g/2),N=x+h;ql(a,A,D,N,i.pointStyleWidth&&g)}else{const A=x+Math.max((f-k)/2,0),D=c.leftForLtr(w,g),N=uo(b.borderRadius);a.beginPath(),Object.values(N).some(P=>P!==0)?Mr(a,{x:D,y:A,w:g,h:k,radius:N}):a.rect(D,A,g,k),a.fill(),V!==0&&a.stroke()}a.restore()},E=function(w,x,b){qo(a,b.text,w,x+y/2,d,{strikethrough:b.hidden,textAlign:c.textAlign(b.textAlign)})},_=this.isHorizontal(),B=this._computeTitleHeight();_?m={x:Ct(s,this.left+u,this.right-r[0]),y:this.top+u+B,line:0}:m={x:this.left+u,y:Ct(s,this.top+B+u,this.bottom-o[0].height),line:0},oc(this.ctx,n.textDirection);const S=y+u;this.legendItems.forEach((w,x)=>{a.strokeStyle=w.fontColor,a.fillStyle=w.fontColor;const b=a.measureText(w.text).width,V=c.textAlign(w.textAlign||(w.textAlign=i.textAlign)),A=g+h+b;let D=m.x,N=m.y;c.setWidth(this.width),_?x>0&&D+A+u>this.right&&(N=m.y+=S,m.line++,D=m.x=Ct(s,this.left+u,this.right-r[m.line])):x>0&&N+S>this.bottom&&(D=m.x=D+o[m.line].width+u,m.line++,N=m.y=Ct(s,this.top+B+u,this.bottom-o[m.line].height));const P=c.x(D);if(p(P,N,w),D=Pp(V,D+g+h,_?D+A:this.right,n.rtl),E(c.x(D),N,w),_)m.x+=A+u;else if(typeof w.text!="string"){const v=d.lineHeight;m.y+=ud(w,v)+u}else m.y+=S}),rc(this.ctx,n.textDirection)}drawTitle(){const n=this.options,o=n.title,r=Et(o.font),a=Wt(o.padding);if(!o.display)return;const s=mo(n.rtl,this.left,this.width),i=this.ctx,l=o.position,c=r.size/2,d=a.top+c;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+d,f=Ct(n.align,f,this.right-h);else{const g=this.columnSizes.reduce((k,y)=>Math.max(k,y.height),0);u=d+Ct(n.align,this.top,this.bottom-g-n.labels.padding-this._computeTitleHeight())}const m=Ct(l,f,f+h);i.textAlign=s.textAlign(rs(l)),i.textBaseline="middle",i.strokeStyle=o.color,i.fillStyle=o.color,i.font=r.string,qo(i,o.text,m,u,r)}_computeTitleHeight(){const n=this.options.title,o=Et(n.font),r=Wt(n.padding);return n.display?o.lineHeight+r.height:0}_getLegendItemAt(n,o){let r,a,s;if(bn(n,this.left,this.right)&&bn(o,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(a=s[r],bn(n,a.left,a.left+a.width)&&bn(o,a.top,a.top+a.height))return this.legendItems[r]}return null}handleEvent(n){const o=this.options;if(!sy(n.type,o))return;const r=this._getLegendItemAt(n.x,n.y);if(n.type==="mousemove"||n.type==="mouseout"){const a=this._hoveredItem,s=ny(a,r);a&&!s&&at(o.onLeave,[n,a,this],this),this._hoveredItem=r,r&&!s&&at(o.onHover,[n,r,this],this)}else r&&at(o.onClick,[n,r,this],this)}}function oy(t,n,o,r,a){const s=ry(r,t,n,o),i=ay(a,r,n.lineHeight);return{itemWidth:s,itemHeight:i}}function ry(t,n,o,r){let a=t.text;return a&&typeof a!="string"&&(a=a.reduce((s,i)=>s.length>i.length?s:i)),n+o.size/2+r.measureText(a).width}function ay(t,n,o){let r=t;return typeof n.text!="string"&&(r=ud(n,o)),r}function ud(t,n){const o=t.text?t.text.length:0;return n*o}function sy(t,n){return!!((t==="mousemove"||t==="mouseout")&&(n.onHover||n.onLeave)||n.onClick&&(t==="click"||t==="mouseup"))}var iy={id:"legend",_element:dd,start(t,n,o){const r=t.legend=new dd({ctx:t.ctx,options:o,chart:t});Ut.configure(t,r,o),Ut.addBox(t,r)},stop(t){Ut.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,n,o){const r=t.legend;Ut.configure(t,r,o),r.options=o},afterUpdate(t){const n=t.legend;n.buildLabels(),n.adjustHitBoxes()},afterEvent(t,n){n.replay||t.legend.handleEvent(n.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,n,o){const r=n.datasetIndex,a=o.chart;a.isDatasetVisible(r)?(a.hide(r),n.hidden=!0):(a.show(r),n.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const n=t.data.datasets,{labels:{usePointStyle:o,pointStyle:r,textAlign:a,color:s,useBorderRadius:i,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(o?0:void 0),u=Wt(d.borderWidth);return{text:n[c.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:r||d.pointStyle,rotation:d.rotation,textAlign:a||d.textAlign,borderRadius:i&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class fd extends xn{constructor(n){super(),this.chart=n.chart,this.options=n.options,this.ctx=n.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(n,o){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=n,this.height=this.bottom=o;const a=ht(r.text)?r.text.length:1;this._padding=Wt(r.padding);const s=a*Et(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const n=this.options.position;return n==="top"||n==="bottom"}_drawArgs(n){const{top:o,left:r,bottom:a,right:s,options:i}=this,l=i.align;let c=0,d,u,f;return this.isHorizontal()?(u=Ct(l,r,s),f=o+n,d=s-r):(i.position==="left"?(u=r+n,f=Ct(l,a,o),c=Je*-.5):(u=s-n,f=Ct(l,o,a),c=Je*.5),d=a-o),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const n=this.ctx,o=this.options;if(!o.display)return;const r=Et(o.font),s=r.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);qo(n,o.text,0,0,r,{color:o.color,maxWidth:c,rotation:d,textAlign:rs(o.align),textBaseline:"middle",translation:[i,l]})}}function ly(t,n){const o=new fd({ctx:t.ctx,options:n,chart:t});Ut.configure(t,o,n),Ut.addBox(t,o),t.titleBlock=o}var cy={id:"title",_element:fd,start(t,n,o){ly(t,o)},stop(t){const n=t.titleBlock;Ut.removeBox(t,n),delete t.titleBlock},beforeUpdate(t,n,o){const r=t.titleBlock;Ut.configure(t,r,o),r.options=o},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const tr={average(t){if(!t.length)return!1;let n,o,r=new Set,a=0,s=0;for(n=0,o=t.length;n<o;++n){const l=t[n].element;if(l&&l.hasValue()){const c=l.tooltipPosition();r.add(c.x),a+=c.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((l,c)=>l+c)/r.size,y:a/s}},nearest(t,n){if(!t.length)return!1;let o=n.x,r=n.y,a=Number.POSITIVE_INFINITY,s,i,l;for(s=0,i=t.length;s<i;++s){const c=t[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=ns(n,d);u<a&&(a=u,l=c)}}if(l){const c=l.tooltipPosition();o=c.x,r=c.y}return{x:o,y:r}}};function an(t,n){return n&&(ht(n)?Array.prototype.push.apply(t,n):t.push(n)),t}function wn(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
17
17
  `)>-1?t.split(`
18
- `):t}function dy(t,n){const{element:o,datasetIndex:r,index:a}=n,s=t.getDatasetMeta(r).controller,{label:i,value:l}=s.getLabelAndValue(a);return{chart:t,label:i,parsed:s.getParsed(a),raw:t.data.datasets[r].data[a],formattedValue:l,dataset:s.getDataset(),dataIndex:a,datasetIndex:r,element:o}}function dd(t,n){const o=t.chart.ctx,{body:r,footer:a,title:s}=t,{boxWidth:i,boxHeight:l}=n,c=St(n.bodyFont),d=St(n.titleFont),u=St(n.footerFont),h=s.length,f=a.length,m=r.length,g=$t(n.padding);let b=g.height,x=0,p=r.reduce((E,_)=>E+_.before.length+_.lines.length+_.after.length,0);if(p+=t.beforeBody.length+t.afterBody.length,h&&(b+=h*d.lineHeight+(h-1)*n.titleSpacing+n.titleMarginBottom),p){const E=n.displayColors?Math.max(l,c.lineHeight):c.lineHeight;b+=m*E+(p-m)*c.lineHeight+(p-1)*n.bodySpacing}f&&(b+=n.footerMarginTop+f*u.lineHeight+(f-1)*n.footerSpacing);let C=0;const w=function(E){x=Math.max(x,o.measureText(E).width+C)};return o.save(),o.font=d.string,nt(t.title,w),o.font=c.string,nt(t.beforeBody.concat(t.afterBody),w),C=n.displayColors?i+2+n.boxPadding:0,nt(r,E=>{nt(E.before,w),nt(E.lines,w),nt(E.after,w)}),C=0,o.font=u.string,nt(t.footer,w),o.restore(),x+=g.width,{width:x,height:b}}function uy(t,n){const{y:o,height:r}=n;return o<r/2?"top":o>t.height-r/2?"bottom":"center"}function fy(t,n,o,r){const{x:a,width:s}=r,i=o.caretSize+o.caretPadding;if(t==="left"&&a+s+i>n.width||t==="right"&&a-s-i<0)return!0}function hy(t,n,o,r){const{x:a,width:s}=o,{width:i,chartArea:{left:l,right:c}}=t;let d="center";return r==="center"?d=a<=(l+c)/2?"left":"right":a<=s/2?d="left":a>=i-s/2&&(d="right"),fy(d,t,n,o)&&(d="center"),d}function ud(t,n,o){const r=o.yAlign||n.yAlign||uy(t,o);return{xAlign:o.xAlign||n.xAlign||hy(t,n,o,r),yAlign:r}}function my(t,n){let{x:o,width:r}=t;return n==="right"?o-=r:n==="center"&&(o-=r/2),o}function py(t,n,o){let{y:r,height:a}=t;return n==="top"?r+=o:n==="bottom"?r-=a+o:r-=a/2,r}function fd(t,n,o,r){const{caretSize:a,caretPadding:s,cornerRadius:i}=t,{xAlign:l,yAlign:c}=o,d=a+s,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=lo(i);let g=my(n,l);const b=py(n,c,d);return c==="center"?l==="left"?g+=d:l==="right"&&(g-=d):l==="left"?g-=Math.max(u,f)+a:l==="right"&&(g+=Math.max(h,m)+a),{x:Bt(g,0,r.width-n.width),y:Bt(b,0,r.height-n.height)}}function Kr(t,n,o){const r=$t(o.padding);return n==="center"?t.x+t.width/2:n==="right"?t.x+t.width-r.right:t.x+r.left}function hd(t){return on([],wn(t))}function gy(t,n,o){return Xn(t,{tooltip:n,tooltipItems:o,type:"tooltip"})}function md(t,n){const o=n&&n.dataset&&n.dataset.tooltip&&n.dataset.tooltip.callbacks;return o?t.override(o):t}const pd={beforeTitle:pn,title(t){if(t.length>0){const n=t[0],o=n.chart.data.labels,r=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return n.dataset.label||"";if(n.label)return n.label;if(r>0&&n.dataIndex<r)return o[n.dataIndex]}return""},afterTitle:pn,beforeBody:pn,beforeLabel:pn,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let n=t.dataset.label||"";n&&(n+=": ");const o=t.formattedValue;return Je(o)||(n+=o),n},labelColor(t){const o=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:o.borderColor,backgroundColor:o.backgroundColor,borderWidth:o.borderWidth,borderDash:o.borderDash,borderDashOffset:o.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const o=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:pn,afterBody:pn,beforeFooter:pn,footer:pn,afterFooter:pn};function Dt(t,n,o,r){const a=t[n].call(o,r);return typeof a>"u"?pd[n].call(o,r):a}class Ns extends xn{constructor(n){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=n.chart,this.options=n.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(n){this.options=n,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const n=this._cachedAnimations;if(n)return n;const o=this.chart,r=this.options.setContext(this.getContext()),a=r.enabled&&o.options.animation&&r.animations,s=new dc(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=gy(this.chart.getContext(),this,this._tooltipItems))}getTitle(n,o){const{callbacks:r}=o,a=Dt(r,"beforeTitle",this,n),s=Dt(r,"title",this,n),i=Dt(r,"afterTitle",this,n);let l=[];return l=on(l,wn(a)),l=on(l,wn(s)),l=on(l,wn(i)),l}getBeforeBody(n,o){return hd(Dt(o.callbacks,"beforeBody",this,n))}getBody(n,o){const{callbacks:r}=o,a=[];return nt(n,s=>{const i={before:[],lines:[],after:[]},l=md(r,s);on(i.before,wn(Dt(l,"beforeLabel",this,s))),on(i.lines,Dt(l,"label",this,s)),on(i.after,wn(Dt(l,"afterLabel",this,s))),a.push(i)}),a}getAfterBody(n,o){return hd(Dt(o.callbacks,"afterBody",this,n))}getFooter(n,o){const{callbacks:r}=o,a=Dt(r,"beforeFooter",this,n),s=Dt(r,"footer",this,n),i=Dt(r,"afterFooter",this,n);let l=[];return l=on(l,wn(a)),l=on(l,wn(s)),l=on(l,wn(i)),l}_createItems(n){const o=this._active,r=this.chart.data,a=[],s=[],i=[];let l=[],c,d;for(c=0,d=o.length;c<d;++c)l.push(dy(this.chart,o[c]));return n.filter&&(l=l.filter((u,h,f)=>n.filter(u,h,f,r))),n.itemSort&&(l=l.sort((u,h)=>n.itemSort(u,h,r))),nt(l,u=>{const h=md(n.callbacks,u);a.push(Dt(h,"labelColor",this,u)),s.push(Dt(h,"labelPointStyle",this,u)),i.push(Dt(h,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(n,o){const r=this.options.setContext(this.getContext()),a=this._active;let s,i=[];if(!a.length)this.opacity!==0&&(s={opacity:0});else{const l=Qo[r.position].call(this,a,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const c=this._size=dd(this,r),d=Object.assign({},l,c),u=ud(this.chart,r,d),h=fd(r,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:h.x,y:h.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=i,this.$context=void 0,s&&this._resolveAnimations().update(this,s),n&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:o})}drawCaret(n,o,r,a){const s=this.getCaretPosition(n,r,a);o.lineTo(s.x1,s.y1),o.lineTo(s.x2,s.y2),o.lineTo(s.x3,s.y3)}getCaretPosition(n,o,r){const{xAlign:a,yAlign:s}=this,{caretSize:i,cornerRadius:l}=r,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:h}=lo(l),{x:f,y:m}=n,{width:g,height:b}=o;let x,p,C,w,E,_;return s==="center"?(E=m+b/2,a==="left"?(x=f,p=x-i,w=E+i,_=E-i):(x=f+g,p=x+i,w=E-i,_=E+i),C=x):(a==="left"?p=f+Math.max(c,u)+i:a==="right"?p=f+g-Math.max(d,h)-i:p=this.caretX,s==="top"?(w=m,E=w-i,x=p-i,C=p+i):(w=m+b,E=w+i,x=p+i,C=p-i),_=w),{x1:x,x2:p,x3:C,y1:w,y2:E,y3:_}}drawTitle(n,o,r){const a=this.title,s=a.length;let i,l,c;if(s){const d=fo(r.rtl,this.x,this.width);for(n.x=Kr(this,r.titleAlign,r),o.textAlign=d.textAlign(r.titleAlign),o.textBaseline="middle",i=St(r.titleFont),l=r.titleSpacing,o.fillStyle=r.titleColor,o.font=i.string,c=0;c<s;++c)o.fillText(a[c],d.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+l,c+1===s&&(n.y+=r.titleMarginBottom-l)}}_drawColorBox(n,o,r,a,s){const i=this.labelColors[r],l=this.labelPointStyles[r],{boxHeight:c,boxWidth:d}=s,u=St(s.bodyFont),h=Kr(this,"left",s),f=a.x(h),m=c<u.lineHeight?(u.lineHeight-c)/2:0,g=o.y+m;if(s.usePointStyle){const b={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},x=a.leftForLtr(f,d)+d/2,p=g+c/2;n.strokeStyle=s.multiKeyBackground,n.fillStyle=s.multiKeyBackground,ss(n,b,x,p),n.strokeStyle=i.borderColor,n.fillStyle=i.backgroundColor,ss(n,b,x,p)}else{n.lineWidth=Ue(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,n.strokeStyle=i.borderColor,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset||0;const b=a.leftForLtr(f,d),x=a.leftForLtr(a.xPlus(f,1),d-2),p=lo(i.borderRadius);Object.values(p).some(C=>C!==0)?(n.beginPath(),n.fillStyle=s.multiKeyBackground,Dr(n,{x:b,y:g,w:d,h:c,radius:p}),n.fill(),n.stroke(),n.fillStyle=i.backgroundColor,n.beginPath(),Dr(n,{x,y:g+1,w:d-2,h:c-2,radius:p}),n.fill()):(n.fillStyle=s.multiKeyBackground,n.fillRect(b,g,d,c),n.strokeRect(b,g,d,c),n.fillStyle=i.backgroundColor,n.fillRect(x,g+1,d-2,c-2))}n.fillStyle=this.labelTextColors[r]}drawBody(n,o,r){const{body:a}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=r,h=St(r.bodyFont);let f=h.lineHeight,m=0;const g=fo(r.rtl,this.x,this.width),b=function(y){o.fillText(y,g.x(n.x+m),n.y+f/2),n.y+=f+s},x=g.textAlign(i);let p,C,w,E,_,B,k;for(o.textAlign=i,o.textBaseline="middle",o.font=h.string,n.x=Kr(this,x,r),o.fillStyle=r.bodyColor,nt(this.beforeBody,b),m=l&&x!=="right"?i==="center"?d/2+u:d+2+u:0,E=0,B=a.length;E<B;++E){for(p=a[E],C=this.labelTextColors[E],o.fillStyle=C,nt(p.before,b),w=p.lines,l&&w.length&&(this._drawColorBox(o,n,E,g,r),f=Math.max(h.lineHeight,c)),_=0,k=w.length;_<k;++_)b(w[_]),f=h.lineHeight;nt(p.after,b)}m=0,f=h.lineHeight,nt(this.afterBody,b),n.y-=s}drawFooter(n,o,r){const a=this.footer,s=a.length;let i,l;if(s){const c=fo(r.rtl,this.x,this.width);for(n.x=Kr(this,r.footerAlign,r),n.y+=r.footerMarginTop,o.textAlign=c.textAlign(r.footerAlign),o.textBaseline="middle",i=St(r.footerFont),o.fillStyle=r.footerColor,o.font=i.string,l=0;l<s;++l)o.fillText(a[l],c.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+r.footerSpacing}}drawBackground(n,o,r,a){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=n,{width:d,height:u}=r,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:g}=lo(a.cornerRadius);o.fillStyle=a.backgroundColor,o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.beginPath(),o.moveTo(l+h,c),i==="top"&&this.drawCaret(n,o,r,a),o.lineTo(l+d-f,c),o.quadraticCurveTo(l+d,c,l+d,c+f),i==="center"&&s==="right"&&this.drawCaret(n,o,r,a),o.lineTo(l+d,c+u-g),o.quadraticCurveTo(l+d,c+u,l+d-g,c+u),i==="bottom"&&this.drawCaret(n,o,r,a),o.lineTo(l+m,c+u),o.quadraticCurveTo(l,c+u,l,c+u-m),i==="center"&&s==="left"&&this.drawCaret(n,o,r,a),o.lineTo(l,c+h),o.quadraticCurveTo(l,c,l+h,c),o.closePath(),o.fill(),a.borderWidth>0&&o.stroke()}_updateAnimationTarget(n){const o=this.chart,r=this.$animations,a=r&&r.x,s=r&&r.y;if(a||s){const i=Qo[n.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=dd(this,n),c=Object.assign({},i,this._size),d=ud(o,n,c),u=fd(n,c,d,o);(a._to!==u.x||s._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(n){const o=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(o);const a={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=$t(o.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;o.enabled&&l&&(n.save(),n.globalAlpha=r,this.drawBackground(s,n,a,o),ec(n,o.textDirection),s.y+=i.top,this.drawTitle(s,n,o),this.drawBody(s,n,o),this.drawFooter(s,n,o),tc(n,o.textDirection),n.restore())}getActiveElements(){return this._active||[]}setActiveElements(n,o){const r=this._active,a=n.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),s=!Er(r,a),i=this._positionChanged(a,o);(s||i)&&(this._active=a,this._eventPosition=o,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(n,o,r=!0){if(o&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,s=this._active||[],i=this._getActiveElements(n,s,o,r),l=this._positionChanged(i,n),c=o||!Er(i,s)||l;return c&&(this._active=i,(a.enabled||a.external)&&(this._eventPosition={x:n.x,y:n.y},this.update(!0,o))),c}_getActiveElements(n,o,r,a){const s=this.options;if(n.type==="mouseout")return[];if(!a)return o.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const i=this.chart.getElementsAtEventForMode(n,s.mode,s,r);return s.reverse&&i.reverse(),i}_positionChanged(n,o){const{caretX:r,caretY:a,options:s}=this,i=Qo[s.position].call(this,n,o);return i!==!1&&(r!==i.x||a!==i.y)}}_e(Ns,"positioners",Qo);var by={id:"tooltip",_element:Ns,positioners:Qo,afterInit(t,n,o){o&&(t.tooltip=new Ns({chart:t,options:o}))},beforeUpdate(t,n,o){t.tooltip&&t.tooltip.initialize(o)},reset(t,n,o){t.tooltip&&t.tooltip.initialize(o)},afterDraw(t){const n=t.tooltip;if(n&&n._willRender()){const o={tooltip:n};if(t.notifyPlugins("beforeTooltipDraw",{...o,cancelable:!0})===!1)return;n.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",o)}},afterEvent(t,n){if(t.tooltip){const o=n.replay;t.tooltip.handleEvent(n.event,o,n.inChartArea)&&(n.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,n)=>n.bodyFont.size,boxWidth:(t,n)=>n.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:pd},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const yy=(t,n,o,r)=>(typeof n=="string"?(o=t.push(n)-1,r.unshift({index:o,label:n})):isNaN(n)&&(o=null),o);function xy(t,n,o,r){const a=t.indexOf(n);if(a===-1)return yy(t,n,o,r);const s=t.lastIndexOf(n);return a!==s?o:a}const ky=(t,n)=>t===null?null:Bt(Math.round(t),0,n);function gd(t){const n=this.getLabels();return t>=0&&t<n.length?n[t]:t}class Ms extends mo{constructor(n){super(n),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(n){const o=this._addedLabels;if(o.length){const r=this.getLabels();for(const{index:a,label:s}of o)r[a]===s&&r.splice(a,1);this._addedLabels=[]}super.init(n)}parse(n,o){if(Je(n))return null;const r=this.getLabels();return o=isFinite(o)&&r[o]===n?o:xy(r,n,Re(o,n),this._addedLabels),ky(o,r.length-1)}determineDataLimits(){const{minDefined:n,maxDefined:o}=this.getUserBounds();let{min:r,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(n||(r=0),o||(a=this.getLabels().length-1)),this.min=r,this.max=a}buildTicks(){const n=this.min,o=this.max,r=this.options.offset,a=[];let s=this.getLabels();s=n===0&&o===s.length-1?s:s.slice(n,o+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let i=n;i<=o;i++)a.push({value:i});return a}getLabelForValue(n){return gd.call(this,n)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(n){return typeof n!="number"&&(n=this.parse(n)),n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getPixelForTick(n){const o=this.ticks;return n<0||n>o.length-1?null:this.getPixelForValue(o[n].value)}getValueForPixel(n){return Math.round(this._startValue+this.getDecimalForPixel(n)*this._valueRange)}getBasePixel(){return this.bottom}}_e(Ms,"id","category"),_e(Ms,"defaults",{ticks:{callback:gd}});function wy(t,n){const o=[],{bounds:a,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:h,includeBounds:f}=t,m=s||1,g=u-1,{min:b,max:x}=n,p=!Je(i),C=!Je(l),w=!Je(d),E=(x-b)/(h+1);let _=Vl((x-b)/g/m)*m,B,k,y,V;if(_<1e-14&&!p&&!C)return[{value:b},{value:x}];V=Math.ceil(x/_)-Math.floor(b/_),V>g&&(_=Vl(V*_/g/m)*m),Je(c)||(B=Math.pow(10,c),_=Math.ceil(_*B)/B),a==="ticks"?(k=Math.floor(b/_)*_,y=Math.ceil(x/_)*_):(k=b,y=x),p&&C&&s&&Bp((l-i)/s,_/1e3)?(V=Math.round(Math.min((l-i)/_,u)),_=(l-i)/V,k=i,y=l):w?(k=p?i:k,y=C?l:y,V=d-1,_=(y-k)/V):(V=(y-k)/_,zo(V,Math.round(V),_/1e3)?V=Math.round(V):V=Math.ceil(V));const D=Math.max(Dl(_),Dl(k));B=Math.pow(10,Je(c)?D:c),k=Math.round(k*B)/B,y=Math.round(y*B)/B;let N=0;for(p&&(f&&k!==i?(o.push({value:i}),k<i&&N++,zo(Math.round((k+N*_)*B)/B,i,bd(i,E,t))&&N++):k<i&&N++);N<V;++N){const A=Math.round((k+N*_)*B)/B;if(C&&A>l)break;o.push({value:A})}return C&&f&&y!==l?o.length&&zo(o[o.length-1].value,l,bd(l,E,t))?o[o.length-1].value=l:o.push({value:l}):(!C||y===l)&&o.push({value:y}),o}function bd(t,n,{horizontal:o,minRotation:r}){const a=gn(r),s=(o?Math.sin(a):Math.cos(a))||.001,i=.75*n*(""+t).length;return Math.min(n/s,i)}class Cy extends mo{constructor(n){super(n),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(n,o){return Je(n)||(typeof n=="number"||n instanceof Number)&&!isFinite(+n)?null:+n}handleTickRangeOptions(){const{beginAtZero:n}=this.options,{minDefined:o,maxDefined:r}=this.getUserBounds();let{min:a,max:s}=this;const i=c=>a=o?a:c,l=c=>s=r?s:c;if(n){const c=tn(a),d=tn(s);c<0&&d<0?l(0):c>0&&d>0&&i(0)}if(a===s){let c=s===0?1:Math.abs(s*.05);l(s+c),n||i(a-c)}this.min=a,this.max=s}getTickLimit(){const n=this.options.ticks;let{maxTicksLimit:o,stepSize:r}=n,a;return r?(a=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),o=o||11),o&&(a=Math.min(o,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const n=this.options,o=n.ticks;let r=this.getTickLimit();r=Math.max(2,r);const a={maxTicks:r,bounds:n.bounds,min:n.min,max:n.max,precision:o.precision,step:o.stepSize,count:o.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:o.minRotation||0,includeBounds:o.includeBounds!==!1},s=this._range||this,i=wy(a,s);return n.bounds==="ticks"&&_p(i,this,"value"),n.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const n=this.ticks;let o=this.min,r=this.max;if(super.configure(),this.options.offset&&n.length){const a=(r-o)/Math.max(n.length-1,1)/2;o-=a,r+=a}this._startValue=o,this._endValue=r,this._valueRange=r-o}getLabelForValue(n){return os(n,this.chart.options.locale,this.options.ticks.format)}}class vs extends Cy{determineDataLimits(){const{min:n,max:o}=this.getMinMax(!0);this.min=Et(n)?n:0,this.max=Et(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const n=this.isHorizontal(),o=n?this.width:this.height,r=gn(this.options.ticks.minRotation),a=(n?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,s.lineHeight/a))}getPixelForValue(n){return n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getValueForPixel(n){return this._startValue+this.getDecimalForPixel(n)*this._valueRange}}_e(vs,"id","linear"),_e(vs,"defaults",{ticks:{callback:Ll.formatters.numeric}});const Yr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Nt=Object.keys(Yr);function yd(t,n){return t-n}function xd(t,n){if(Je(n))return null;const o=t._adapter,{parser:r,round:a,isoWeekday:s}=t._parseOpts;let i=n;return typeof r=="function"&&(i=r(i)),Et(i)||(i=typeof r=="string"?o.parse(i,r):o.parse(i)),i===null?null:(a&&(i=a==="week"&&(Io(s)||s===!0)?o.startOf(i,"isoWeek",s):o.startOf(i,a)),+i)}function kd(t,n,o,r){const a=Nt.length;for(let s=Nt.indexOf(t);s<a-1;++s){const i=Yr[Nt[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((o-n)/(l*i.size))<=r)return Nt[s]}return Nt[a-1]}function Ey(t,n,o,r,a){for(let s=Nt.length-1;s>=Nt.indexOf(o);s--){const i=Nt[s];if(Yr[i].common&&t._adapter.diff(a,r,i)>=n-1)return i}return Nt[o?Nt.indexOf(o):0]}function By(t){for(let n=Nt.indexOf(t)+1,o=Nt.length;n<o;++n)if(Yr[Nt[n]].common)return Nt[n]}function wd(t,n,o){if(!o)t[n]=!0;else if(o.length){const{lo:r,hi:a}=Za(o,n),s=o[r]>=n?o[r]:o[a];t[s]=!0}}function _y(t,n,o,r){const a=t._adapter,s=+a.startOf(n[0].value,r),i=n[n.length-1].value;let l,c;for(l=s;l<=i;l=+a.add(l,1,r))c=o[l],c>=0&&(n[c].major=!0);return n}function Cd(t,n,o){const r=[],a={},s=n.length;let i,l;for(i=0;i<s;++i)l=n[i],a[l]=i,r.push({value:l,major:!1});return s===0||!o?r:_y(t,r,a,o)}class Jr extends mo{constructor(n){super(n),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(n,o={}){const r=n.time||(n.time={}),a=this._adapter=new i0._date(n.adapters.date);a.init(o),Oo(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(n),this._normalized=o.normalized}parse(n,o){return n===void 0?null:xd(this,n)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const n=this.options,o=this._adapter,r=n.time.unit||"day";let{min:a,max:s,minDefined:i,maxDefined:l}=this.getUserBounds();function c(d){!i&&!isNaN(d.min)&&(a=Math.min(a,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!i||!l)&&(c(this._getLabelBounds()),(n.bounds!=="ticks"||n.ticks.source!=="labels")&&c(this.getMinMax(!1))),a=Et(a)&&!isNaN(a)?a:+o.startOf(Date.now(),r),s=Et(s)&&!isNaN(s)?s:+o.endOf(Date.now(),r)+1,this.min=Math.min(a,s-1),this.max=Math.max(a+1,s)}_getLabelBounds(){const n=this.getLabelTimestamps();let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return n.length&&(o=n[0],r=n[n.length-1]),{min:o,max:r}}buildTicks(){const n=this.options,o=n.time,r=n.ticks,a=r.source==="labels"?this.getLabelTimestamps():this._generate();n.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const s=this.min,i=this.max,l=Np(a,s,i);return this._unit=o.unit||(r.autoSkip?kd(o.minUnit,this.min,this.max,this._getLabelCapacity(s)):Ey(this,l.length,o.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:By(this._unit),this.initOffsets(a),n.reverse&&l.reverse(),Cd(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(n=>+n.value))}initOffsets(n=[]){let o=0,r=0,a,s;this.options.offset&&n.length&&(a=this.getDecimalForValue(n[0]),n.length===1?o=1-a:o=(this.getDecimalForValue(n[1])-a)/2,s=this.getDecimalForValue(n[n.length-1]),n.length===1?r=s:r=(s-this.getDecimalForValue(n[n.length-2]))/2);const i=n.length<3?.5:.25;o=Bt(o,0,i),r=Bt(r,0,i),this._offsets={start:o,end:r,factor:1/(o+1+r)}}_generate(){const n=this._adapter,o=this.min,r=this.max,a=this.options,s=a.time,i=s.unit||kd(s.minUnit,o,r,this._getLabelCapacity(o)),l=Re(a.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=Io(c)||c===!0,u={};let h=o,f,m;if(d&&(h=+n.startOf(h,"isoWeek",c)),h=+n.startOf(h,d?"day":i),n.diff(r,o,i)>1e5*l)throw new Error(o+" and "+r+" are too far apart with stepSize of "+l+" "+i);const g=a.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<r;f=+n.add(f,l,i),m++)wd(u,f,g);return(f===r||a.bounds==="ticks"||m===1)&&wd(u,f,g),Object.keys(u).sort(yd).map(b=>+b)}getLabelForValue(n){const o=this._adapter,r=this.options.time;return r.tooltipFormat?o.format(n,r.tooltipFormat):o.format(n,r.displayFormats.datetime)}format(n,o){const a=this.options.time.displayFormats,s=this._unit,i=o||a[s];return this._adapter.format(n,i)}_tickFormatFunction(n,o,r,a){const s=this.options,i=s.ticks.callback;if(i)return it(i,[n,o,r],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],h=d&&l[d],f=r[o],m=d&&h&&f&&f.major;return this._adapter.format(n,a||(m?h:u))}generateTickLabels(n){let o,r,a;for(o=0,r=n.length;o<r;++o)a=n[o],a.label=this._tickFormatFunction(a.value,o,n)}getDecimalForValue(n){return n===null?NaN:(n-this.min)/(this.max-this.min)}getPixelForValue(n){const o=this._offsets,r=this.getDecimalForValue(n);return this.getPixelForDecimal((o.start+r)*o.factor)}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return this.min+r*(this.max-this.min)}_getLabelSize(n){const o=this.options.ticks,r=this.ctx.measureText(n).width,a=gn(this.isHorizontal()?o.maxRotation:o.minRotation),s=Math.cos(a),i=Math.sin(a),l=this._resolveTickFontOptions(0).size;return{w:r*s+l*i,h:r*i+l*s}}_getLabelCapacity(n){const o=this.options.time,r=o.displayFormats,a=r[o.unit]||r.millisecond,s=this._tickFormatFunction(n,0,Cd(this,[n],this._majorUnit),a),i=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return l>0?l:1}getDataTimestamps(){let n=this._cache.data||[],o,r;if(n.length)return n;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(o=0,r=a.length;o<r;++o)n=n.concat(a[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const n=this._cache.labels||[];let o,r;if(n.length)return n;const a=this.getLabels();for(o=0,r=a.length;o<r;++o)n.push(xd(this,a[o]));return this._cache.labels=this._normalized?n:this.normalize(n)}normalize(n){return Pl(n.sort(yd))}}_e(Jr,"id","time"),_e(Jr,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Qr(t,n,o){let r=0,a=t.length-1,s,i,l,c;o?(n>=t[r].pos&&n<=t[a].pos&&({lo:r,hi:a}=Hn(t,"pos",n)),{pos:s,time:l}=t[r],{pos:i,time:c}=t[a]):(n>=t[r].time&&n<=t[a].time&&({lo:r,hi:a}=Hn(t,"time",n)),{time:s,pos:l}=t[r],{time:i,pos:c}=t[a]);const d=i-s;return d?l+(c-l)*(n-s)/d:l}class Ed extends Jr{constructor(n){super(n),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const n=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(n);this._minPos=Qr(o,this.min),this._tableRange=Qr(o,this.max)-this._minPos,super.initOffsets(n)}buildLookupTable(n){const{min:o,max:r}=this,a=[],s=[];let i,l,c,d,u;for(i=0,l=n.length;i<l;++i)d=n[i],d>=o&&d<=r&&a.push(d);if(a.length<2)return[{time:o,pos:0},{time:r,pos:1}];for(i=0,l=a.length;i<l;++i)u=a[i+1],c=a[i-1],d=a[i],Math.round((u+c)/2)!==d&&s.push({time:d,pos:i/(l-1)});return s}_generate(){const n=this.min,o=this.max;let r=super.getDataTimestamps();return(!r.includes(n)||!r.length)&&r.splice(0,0,n),(!r.includes(o)||r.length===1)&&r.push(o),r.sort((a,s)=>a-s)}_getTimestampsForTable(){let n=this._cache.all||[];if(n.length)return n;const o=this.getDataTimestamps(),r=this.getLabelTimestamps();return o.length&&r.length?n=this.normalize(o.concat(r)):n=o.length?o:r,n=this._cache.all=n,n}getDecimalForValue(n){return(Qr(this._table,n)-this._minPos)/this._tableRange}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return Qr(this._table,r*this._tableRange+this._minPos,!0)}}_e(Ed,"id","timeseries"),_e(Ed,"defaults",Jr.defaults);const Sy={key:0,class:"mb-2 text-sm font-medium text-gray-700"},Ay={key:0,class:"text-red-500 ml-1"},Vy={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},Dy={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},Ny={class:"text-red-600 text-sm"},My={key:1,class:"mt-2 text-xs text-gray-500"},vy={key:0},Bd=Pt(e.defineComponent({name:"DCodeChart",__name:"DCodeChart",props:{type:{default:"line"},width:{default:400},height:{default:300},required:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},error:{default:null},showInfo:{type:Boolean,default:!1},responsive:{type:Boolean,default:!0},maintainAspectRatio:{type:Boolean,default:!1},theme:{default:"light"},colors:{default:()=>["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#14B8A6","#F97316","#6366F1","#84CC16"]},data:{},modelValue:{},options:{},onClick:{},onHover:{},label:{}},emits:["update:modelValue","click","hover","ready"],setup(t,{expose:n,emit:o}){kn.register(Ms,vs,qr,vn,Gr,Jo,cy,by,iy,ty,Fr,Or,bs,ho);const r=t,a=o,s=e.ref(null),i=e.shallowRef(null),l=e.ref(null),c=e.computed(()=>({"opacity-50 pointer-events-none":r.loading||r.error})),d=()=>{const f=r.theme==="dark";return{responsive:r.responsive,maintainAspectRatio:r.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:m=>{let g=0;return m.type==="data"&&m.mode==="default"&&(g=m.dataIndex*100+m.datasetIndex*50),g},onComplete:()=>{}},plugins:{legend:{position:"top",labels:{color:f?"#E5E7EB":"#374151",font:{size:12}}},tooltip:{backgroundColor:f?"#1F2937":"#FFFFFF",titleColor:f?"#F3F4F6":"#111827",bodyColor:f?"#D1D5DB":"#4B5563",borderColor:f?"#374151":"#E5E7EB",borderWidth:1,animation:{duration:200,easing:"easeInOutQuad"}}},scales:r.type!=="pie"&&r.type!=="doughnut"&&r.type!=="polarArea"?{x:{grid:{color:f?"#374151":"#E5E7EB"},ticks:{color:f?"#D1D5DB":"#6B7280"}},y:{grid:{color:f?"#374151":"#E5E7EB"},ticks:{color:f?"#D1D5DB":"#6B7280"}}}:void 0}},u=f=>!f||!f.datasets?f:{...f,datasets:f.datasets.map((m,g)=>{const b=g%r.colors.length,x=r.colors[b];let p=m.backgroundColor,C=m.borderColor;return["pie","doughnut","polarArea"].includes(r.type)&&(!p||p.length===0)?m.data&&(p=m.data.map((w,E)=>r.colors[E%r.colors.length]+"80"),C=m.data.map((w,E)=>r.colors[E%r.colors.length])):(p=p||x+"40",C=C||x),{...m,borderColor:C,backgroundColor:p,pointBackgroundColor:m.pointBackgroundColor||x,pointBorderColor:m.pointBorderColor||x,hoverBackgroundColor:m.hoverBackgroundColor||x+"60",hoverBorderColor:m.hoverBorderColor||x}})},h=async()=>{if(!s.value)return;await e.nextTick(),i.value&&i.value.destroy();const f=r.data||r.modelValue;let m=f;if(Array.isArray(f))if(f.length>0&&typeof f[0]=="object"&&f[0]!==null){const b=Object.keys(f[0]),x=b.find(C=>["label","name","x","category","title"].includes(C.toLowerCase()))||b[0],p=b.find(C=>C!==x&&["value","y","count","amount","total","data"].includes(C.toLowerCase()))||b.find(C=>C!==x&&typeof f[0][C]=="number")||(b.length>1?b.find(C=>C!==x):b[0]);m={labels:f.map(C=>C[x||""]),datasets:[{label:r.label||"Data",data:f.map(C=>C[p||""])}]}}else f.length>0?m={labels:f.map((b,x)=>`Data ${x+1}`),datasets:[{label:r.label||"Data",data:f}]}:m={labels:[],datasets:[]};if(l.value=u(m),!l.value)return;const g={...d(),...r.options,onClick:(b,x)=>{a("click",b,x),r.onClick&&r.onClick(b,x)},onHover:(b,x)=>{a("hover",b,x),r.onHover&&r.onHover(b,x)}};i.value=new kn(s.value,{type:r.type,data:l.value,options:g}),a("ready",i.value)};return e.watch(()=>[r.data,r.modelValue,r.type,r.options,r.theme],()=>{h()},{deep:!0}),e.watch(()=>[r.width,r.height],()=>{i.value&&i.value.resize()}),e.onMounted(()=>{h()}),e.onUnmounted(()=>{i.value&&i.value.destroy()}),n({chart:i,updateChart:h}),(f,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["d-code-chart",c.value])},[t.label?(e.openBlock(),e.createElementBlock("div",Sy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Ay,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"relative",style:e.normalizeStyle({height:t.height+"px"})},[e.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),t.loading?(e.openBlock(),e.createElementBlock("div",Vy,[...m[0]||(m[0]=[e.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createElementBlock("div",Dy,[e.createElementVNode("div",Ny,e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0)],4),t.showInfo&&l.value?(e.openBlock(),e.createElementBlock("div",My,[l.value.datasets?(e.openBlock(),e.createElementBlock("div",vy,e.toDisplayString(l.value.datasets.length)+" dataset(s) • "+e.toDisplayString(l.value.labels?l.value.labels.length:0)+" data points ",1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1c7c58f"]]),Zo=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=ft.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Ne.Label),e.mergeProps(e.unref(o),{class:e.unref(We)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Py={class:"grid gap-1.5"},Ty={key:0,class:"ml-1 text-destructive"},Oy=["aria-busy"],Fy={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},zy={key:1,class:"flex items-center"},Iy=["id","checked","indeterminate","disabled","required"],Cn=Pt(e.defineComponent({name:"DCodeCheckbox",inheritAttrs:!1,__name:"DCodeCheckbox",props:{id:{default:""},label:{default:""},title:{default:""},required:{type:Boolean,default:!1},modelValue:{type:[Boolean,null]},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>a.visible??!0),i=e.computed(()=>a.required),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-checkbox-${a.id||a.label||"checkbox"}-${l}`),d=e.ref(!!a.modelValue);e.watch(()=>a.modelValue,f=>{d.value=!!f},{immediate:!0});const u=()=>{if(a.disabled)return;const f=!d.value;d.value=f,r("update:modelValue",f)},h=f=>{(f.key===" "||f.key==="Enter")&&(f.preventDefault(),u())};return(f,m)=>(e.openBlock(),e.createElementBlock("div",Py,[t.label?(e.openBlock(),e.createBlock(Zo,{key:0,class:"text-sm font-medium mb-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Ty,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([e.unref(o).class,{"opacity-60 cursor-not-allowed":t.disabled}]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Fy)):e.createCommentVNode("",!0),m[0]||(m[0]=e.createElementVNode("div",{class:"flex items-center gap-2.5"},[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(e.openBlock(),e.createElementBlock("div",zy,[e.createElementVNode("label",{class:e.normalizeClass(["flex items-center gap-2.5 group relative",{"cursor-pointer":!t.disabled,"opacity-50 cursor-not-allowed":t.disabled}])},[e.createElementVNode("input",{type:"checkbox",id:c.value,class:"sr-only peer",checked:d.value,indeterminate:t.indeterminate,disabled:t.disabled,required:i.value,onChange:u,onKeydown:h},null,40,Iy),e.createElementVNode("div",{class:e.normalizeClass(["h-4 w-4 shrink-0 rounded-sm border shadow-sm transition-all focus:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-neutral-400 dark:peer-focus-visible:ring-neutral-600 peer-focus-visible:ring-offset-2 flex items-center justify-center",[d.value||t.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800",t.disabled?"cursor-not-allowed":"cursor-pointer"]]),"aria-hidden":"true"},[d.value&&!t.indeterminate?(e.openBlock(),e.createBlock(e.unref(ue.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):t.indeterminate?(e.openBlock(),e.createBlock(e.unref(ue.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):e.createCommentVNode("",!0)],2),t.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["text-sm leading-relaxed select-none transition-colors",[t.disabled?"text-gray-400 dark:text-gray-500":"text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-gray-100"]])},e.toDisplayString(t.title),3)):e.createCommentVNode("",!0)],2)]))],10,Oy),[[e.vShow,s.value]])]))}}),[["__scopeId","data-v-c233d0a6"]]),Ry={class:"w-full"},Ly={key:0,class:"mb-4"},$y={key:0,class:"h-6 w-48 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},jy={key:1,class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Wy={key:0,class:"ml-1 text-destructive"},Uy={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-4"},Hy={key:1,class:"flex flex-wrap gap-4"},qy={key:0,class:"text-center py-8 text-gray-500 dark:text-gray-400"},Gy={key:1,class:"flex flex-wrap gap-x-6 gap-y-4"},Xy={key:3,class:"flex items-center gap-1 text-sm text-red-500 mt-4"},Ps=Pt(e.defineComponent({name:"DCodeCardCheckboxList",inheritAttrs:!1,__name:"DCodeCardCheckboxList",props:{modelValue:{default:()=>[]},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},items:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},apiModule:{},apiAction:{},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""},columns:{default:2},apiParams:{default:()=>({})},returnArray:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=mt(),r=n,a=t,s=e.ref(new Set);e.watch(()=>a.modelValue,_=>{if(!_){s.value=new Set;return}const B=_.map(k=>typeof k=="object"&&k!==null?k.id!==void 0?k.id:k.value:k);s.value=new Set(B)},{immediate:!0,deep:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var B,k;const _=((B=a.endpoint)==null?void 0:B.apiUrl)||a.apiUrl;if(!(!_&&!a.apiModule&&!a.apiAction)){l.value=!0,c.value=null;try{let y;const V=((k=a.endpoint)==null?void 0:k.apiMethod)||a.apiMethod||"GET",D={page:1,perPage:100,...a.apiParams};if(_)y=await o(_,V,D);else if(a.apiModule&&a.apiAction){const{DCodeApi:A}=mt();y=await A(a.apiModule,a.apiAction,D)}let N=y;a.dataPath?N=a.dataPath.split(".").reduce((T,P)=>T&&T[P]!==void 0?T[P]:void 0,y):typeof y=="object"&&!Array.isArray(y)&&y.data&&(N=y.data),Array.isArray(N)?i.value=N:(console.warn("DCodeCardCheckboxList: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(y){console.error("DCodeCardCheckboxList fetch error:",y),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=e.ref(!1);let h=null;const f=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var _;((_=a.endpoint)!=null&&_.apiUrl||a.apiUrl||a.apiModule&&a.apiAction)&&d(),f(),typeof document<"u"&&(h=new MutationObserver(f),h.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),h.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{h&&h.disconnect()});const m=e.computed(()=>a.options&&a.options.length>0?a.options:a.items&&a.items.length>0?a.items:i.value),g=_=>{if(typeof _!="object"||_===null)return _;const B=a.itemValue||a.model||"id";return _[B]},b=_=>{if(typeof _!="object"||_===null)return String(_);const B=a.itemTitle||"name";return _[B]},x=_=>s.value.has(_),p=(_,B)=>{if(a.disabled)return;const k=new Set(s.value);B?k.add(_):k.delete(_),s.value=k;const y=Array.from(s.value);r("update:modelValue",y),r("change",y)},C=e.computed(()=>a.skeleton||l.value),w=e.computed(()=>!!a.error||!!c.value),E=e.computed(()=>a.error||c.value);return(_,B)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",Ry,[t.label||C.value?(e.openBlock(),e.createElementBlock("div",Ly,[C.value?(e.openBlock(),e.createElementBlock("div",$y)):(e.openBlock(),e.createElementBlock("h3",jy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Wy,"*")):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",Uy,[e.createVNode(e.unref(ue.Loader2),{class:"w-4 h-4 animate-spin"}),B[0]||(B[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("div",Hy,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,k=>e.createElementVNode("div",{key:`skeleton-${k}`,class:"flex items-center gap-2.5 min-w-[120px]"},[...B[1]||(B[1]=[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"},null,-1),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])),64))])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[m.value.length===0?(e.openBlock(),e.createElementBlock("div",qy," Tidak ada data ")):(e.openBlock(),e.createElementBlock("div",Gy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(k,y)=>(e.openBlock(),e.createElementBlock("div",{key:y,class:"flex items-start"},[e.createVNode(Cn,{"model-value":x(g(k)),title:b(k),disabled:t.disabled,"onUpdate:modelValue":V=>p(g(k),V)},null,8,["model-value","title","disabled","onUpdate:modelValue"])]))),128))]))],64)),w.value&&E.value?(e.openBlock(),e.createElementBlock("div",Xy,[e.createVNode(e.unref(ue.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(E.value),1)])):e.createCommentVNode("",!0)])],512)),[[e.vShow,t.visible]])}}),[["__scopeId","data-v-8f934d59"]]),Ky=["aria-busy"],Yy={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Jy={key:1,class:"flex justify-end"},Qy=["for"],Zy={key:0,class:"ml-1 text-destructive"},ex={class:"relative w-full group"},tx={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700"},nx={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},ox=["id","disabled","readonly","placeholder","maxlength"],rx={key:0,class:"absolute top-full right-0 z-10 text-[11px] text-gray-400 dark:text-gray-500 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100 mt-0.5"},ax={key:1,class:"flex items-center gap-1 text-xs text-destructive"},Ts=e.defineComponent({name:"DCodeCurrencyField",inheritAttrs:!1,__name:"DCodeCurrencyField",props:{modelValue:{},currency:{default:"IDR"},locale:{},label:{},placeholder:{},error:{},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},prependInner:{},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`app-currency-field-${o.id||a.label||"currency-field"}-${s}`),l=e.computed(()=>{const N=o.required,A=o["aria-required"];return N===""||N===!0||N==="true"||(A==="true"||A===!0)}),c=e.computed(()=>{const N=o.maxlength??o.maxLength;let A=Number.NaN;return typeof N=="number"?A=N:typeof N=="string"&&(A=Number.parseInt(N,10)),Number.isFinite(A)&&A>0?A:void 0}),d=e.computed(()=>a.locale?a.locale:"en-US"),u=e.computed(()=>a.prependInner?a.prependInner:a.currency==="USD"?"$":a.currency==="IDR"?"Rp":a.currency),h=e.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),f=N=>{const A=N.replaceAll(/\D/g,"");return A?Number(A):null},m=N=>h.value.format(N),g=e.ref(""),b=e.ref(null);e.watch(()=>a.modelValue,N=>{N==null?g.value="":f(g.value)!==N&&(g.value=m(N))},{immediate:!0});const x=(N,A)=>{let T=0;for(let P=0;P<A;P++)/\d/.test(N[P])&&T++;return T},p=(N,A)=>{let T=0;for(let P=0;P<N.length;P++)if(/\d/.test(N[P])&&(T++,T===A))return P+1;return N.length},C=N=>{const A=N.target,T=A.value,P=A.selectionStart??T.length,X=f(T);if(X===null){g.value="",r("update:modelValue",null);return}const $=m(X);if(T!==$){const G=x(T,P);g.value=$,e.nextTick(()=>{if(b.value){const ne=p($,G);b.value.setSelectionRange(ne,ne)}})}r("update:modelValue",X)},w=()=>{g.value="",r("update:modelValue",null),r("clear")},E=e.computed(()=>!a.clearable||a.disabled||a.readonly?!1:a.hideClearWhenEmpty?g.value.length>0:!0),_=e.computed(()=>!!a.error),B=e.computed(()=>{const{class:N,maxlength:A,maxLength:T,...P}=o;return P}),k=e.computed(()=>g.value.length),y=e.computed(()=>a.showCharCount?(c.value??0)>0:!1),V=e.computed(()=>y.value&&k.value>0),D=e.computed(()=>`${k.value} / ${c.value}`);return(N,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1.5 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Yy)):e.createCommentVNode("",!0),A[2]||(A[2]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),y.value?(e.openBlock(),e.createElementBlock("div",Jy,[...A[1]||(A[1]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",Zy,"*")):e.createCommentVNode("",!0)],8,Qy)):e.createCommentVNode("",!0),e.createElementVNode("div",ex,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50",_.value?"border-destructive ring-1 ring-destructive":"border-gray-300 dark:border-gray-700 focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500 dark:focus-within:border-blue-400",a.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":""])},[e.createElementVNode("div",tx,[e.createElementVNode("span",nx,e.toDisplayString(u.value),1)]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:i.value,ref_key:"inputRef",ref:b,"onUpdate:modelValue":A[0]||(A[0]=T=>g.value=T),onInput:C,type:"text",inputmode:"numeric"},B.value,{disabled:a.disabled,readonly:a.readonly,placeholder:a.placeholder,maxlength:c.value,class:["flex-1 h-10 px-3 py-2 text-sm bg-transparent text-foreground dark:text-gray-300 outline-none placeholder:text-gray-400",E.value?"pr-8":""]}),null,16,ox),[[e.vModelText,g.value]]),E.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center w-8 h-10 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors flex-shrink-0","aria-label":"Clear input",onClick:w},[e.createVNode(e.unref(ue.X),{class:"w-3.5 h-3.5"})])):e.createCommentVNode("",!0)],2),V.value&&!_.value?(e.openBlock(),e.createElementBlock("p",rx,e.toDisplayString(D.value),1)):e.createCommentVNode("",!0)]),_.value?(e.openBlock(),e.createElementBlock("p",ax,[e.createVNode(e.unref(ue.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(a.error),1)])):e.createCommentVNode("",!0)],64))],10,Ky))}}),_d=6048e5,sx=864e5,Sd=Symbol.for("constructDateFrom");function Tn(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&Sd in t?t[Sd](n):t instanceof Date?new t.constructor(n):new Date(n)}function Jt(t,n){return Tn(n||t,t)}let ix={};function Zr(){return ix}function er(t,n){var l,c,d,u;const o=Zr(),r=(n==null?void 0:n.weekStartsOn)??((c=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??o.weekStartsOn??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=Jt(t,n==null?void 0:n.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function ea(t,n){return er(t,{...n,weekStartsOn:1})}function Ad(t,n){const o=Jt(t,n==null?void 0:n.in),r=o.getFullYear(),a=Tn(o,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=ea(a),i=Tn(o,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const l=ea(i);return o.getTime()>=s.getTime()?r+1:o.getTime()>=l.getTime()?r:r-1}function Vd(t){const n=Jt(t),o=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return o.setUTCFullYear(n.getFullYear()),+t-+o}function lx(t,...n){const o=Tn.bind(null,n.find(r=>typeof r=="object"));return n.map(o)}function Dd(t,n){const o=Jt(t,n==null?void 0:n.in);return o.setHours(0,0,0,0),o}function cx(t,n,o){const[r,a]=lx(o==null?void 0:o.in,t,n),s=Dd(r),i=Dd(a),l=+s-Vd(s),c=+i-Vd(i);return Math.round((l-c)/sx)}function dx(t,n){const o=Ad(t,n),r=Tn(t,0);return r.setFullYear(o,0,4),r.setHours(0,0,0,0),ea(r)}function ux(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function fx(t){return!(!ux(t)&&typeof t!="number"||isNaN(+Jt(t)))}function hx(t,n){const o=Jt(t,n==null?void 0:n.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}const mx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},px=(t,n,o)=>{let r;const a=mx[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r};function go(t){return(n={})=>{const o=n.width?String(n.width):t.defaultWidth;return t.formats[o]||t.formats[t.defaultWidth]}}const gx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},yx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xx={date:go({formats:gx,defaultWidth:"full"}),time:go({formats:bx,defaultWidth:"full"}),dateTime:go({formats:yx,defaultWidth:"full"})},kx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},wx=(t,n,o,r)=>kx[t];function rn(t){return(n,o)=>{const r=o!=null&&o.context?String(o.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=o!=null&&o.width?String(o.width):i;a=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=o!=null&&o.width?String(o.width):t.defaultWidth;a=t.values[l]||t.values[i]}const s=t.argumentCallback?t.argumentCallback(n):n;return a[s]}}const Cx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ex={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Bx={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},_x={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Sx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ax={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Vx={ordinalNumber:(t,n)=>{const o=Number(t),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},era:rn({values:Cx,defaultWidth:"wide"}),quarter:rn({values:Ex,defaultWidth:"wide",argumentCallback:t=>t-1}),month:rn({values:Bx,defaultWidth:"wide"}),day:rn({values:_x,defaultWidth:"wide"}),dayPeriod:rn({values:Sx,defaultWidth:"wide",formattingValues:Ax,defaultFormattingWidth:"wide"})};function an(t){return(n,o={})=>{const r=o.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=n.match(a);if(!s)return null;const i=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?Nx(l,h=>h.test(i)):Dx(l,h=>h.test(i));let d;d=t.valueCallback?t.valueCallback(c):c,d=o.valueCallback?o.valueCallback(d):d;const u=n.slice(i.length);return{value:d,rest:u}}}function Dx(t,n){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&n(t[o]))return o}function Nx(t,n){for(let o=0;o<t.length;o++)if(n(t[o]))return o}function Nd(t){return(n,o={})=>{const r=n.match(t.matchPattern);if(!r)return null;const a=r[0],s=n.match(t.parsePattern);if(!s)return null;let i=t.valueCallback?t.valueCallback(s[0]):s[0];i=o.valueCallback?o.valueCallback(i):i;const l=n.slice(a.length);return{value:i,rest:l}}}const Mx=/^(\d+)(th|st|nd|rd)?/i,vx=/\d+/i,Px={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Tx={any:[/^b/i,/^(a|c)/i]},Ox={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Fx={any:[/1/i,/2/i,/3/i,/4/i]},zx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ix={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Rx={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Lx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},$x={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},jx={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Wx={ordinalNumber:Nd({matchPattern:Mx,parsePattern:vx,valueCallback:t=>parseInt(t,10)}),era:an({matchPatterns:Px,defaultMatchWidth:"wide",parsePatterns:Tx,defaultParseWidth:"any"}),quarter:an({matchPatterns:Ox,defaultMatchWidth:"wide",parsePatterns:Fx,defaultParseWidth:"any",valueCallback:t=>t+1}),month:an({matchPatterns:zx,defaultMatchWidth:"wide",parsePatterns:Ix,defaultParseWidth:"any"}),day:an({matchPatterns:Rx,defaultMatchWidth:"wide",parsePatterns:Lx,defaultParseWidth:"any"}),dayPeriod:an({matchPatterns:$x,defaultMatchWidth:"any",parsePatterns:jx,defaultParseWidth:"any"})},Md={code:"en-US",formatDistance:px,formatLong:xx,formatRelative:wx,localize:Vx,match:Wx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ux(t,n){const o=Jt(t,n==null?void 0:n.in);return cx(o,hx(o))+1}function Hx(t,n){const o=Jt(t,n==null?void 0:n.in),r=+ea(o)-+dx(o);return Math.round(r/_d)+1}function vd(t,n){var u,h,f,m;const o=Jt(t,n==null?void 0:n.in),r=o.getFullYear(),a=Zr(),s=(n==null?void 0:n.firstWeekContainsDate)??((h=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??a.firstWeekContainsDate??((m=(f=a.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,i=Tn((n==null?void 0:n.in)||t,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const l=er(i,n),c=Tn((n==null?void 0:n.in)||t,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const d=er(c,n);return+o>=+l?r+1:+o>=+d?r:r-1}function qx(t,n){var l,c,d,u;const o=Zr(),r=(n==null?void 0:n.firstWeekContainsDate)??((c=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??o.firstWeekContainsDate??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,a=vd(t,n),s=Tn((n==null?void 0:n.in)||t,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),er(s,n)}function Gx(t,n){const o=Jt(t,n==null?void 0:n.in),r=+er(o,n)-+qx(o,n);return Math.round(r/_d)+1}function rt(t,n){const o=t<0?"-":"",r=Math.abs(t).toString().padStart(n,"0");return o+r}const On={y(t,n){const o=t.getFullYear(),r=o>0?o:1-o;return rt(n==="yy"?r%100:r,n.length)},M(t,n){const o=t.getMonth();return n==="M"?String(o+1):rt(o+1,2)},d(t,n){return rt(t.getDate(),n.length)},a(t,n){const o=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];case"aaaa":default:return o==="am"?"a.m.":"p.m."}},h(t,n){return rt(t.getHours()%12||12,n.length)},H(t,n){return rt(t.getHours(),n.length)},m(t,n){return rt(t.getMinutes(),n.length)},s(t,n){return rt(t.getSeconds(),n.length)},S(t,n){const o=n.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,o-3));return rt(a,n.length)}},bo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Pd={G:function(t,n,o){const r=t.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return o.era(r,{width:"abbreviated"});case"GGGGG":return o.era(r,{width:"narrow"});case"GGGG":default:return o.era(r,{width:"wide"})}},y:function(t,n,o){if(n==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return o.ordinalNumber(a,{unit:"year"})}return On.y(t,n)},Y:function(t,n,o,r){const a=vd(t,r),s=a>0?a:1-a;if(n==="YY"){const i=s%100;return rt(i,2)}return n==="Yo"?o.ordinalNumber(s,{unit:"year"}):rt(s,n.length)},R:function(t,n){const o=Ad(t);return rt(o,n.length)},u:function(t,n){const o=t.getFullYear();return rt(o,n.length)},Q:function(t,n,o){const r=Math.ceil((t.getMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return rt(r,2);case"Qo":return o.ordinalNumber(r,{unit:"quarter"});case"QQQ":return o.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,o){const r=Math.ceil((t.getMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return rt(r,2);case"qo":return o.ordinalNumber(r,{unit:"quarter"});case"qqq":return o.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,o){const r=t.getMonth();switch(n){case"M":case"MM":return On.M(t,n);case"Mo":return o.ordinalNumber(r+1,{unit:"month"});case"MMM":return o.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,o){const r=t.getMonth();switch(n){case"L":return String(r+1);case"LL":return rt(r+1,2);case"Lo":return o.ordinalNumber(r+1,{unit:"month"});case"LLL":return o.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,o,r){const a=Gx(t,r);return n==="wo"?o.ordinalNumber(a,{unit:"week"}):rt(a,n.length)},I:function(t,n,o){const r=Hx(t);return n==="Io"?o.ordinalNumber(r,{unit:"week"}):rt(r,n.length)},d:function(t,n,o){return n==="do"?o.ordinalNumber(t.getDate(),{unit:"date"}):On.d(t,n)},D:function(t,n,o){const r=Ux(t);return n==="Do"?o.ordinalNumber(r,{unit:"dayOfYear"}):rt(r,n.length)},E:function(t,n,o){const r=t.getDay();switch(n){case"E":case"EE":case"EEE":return o.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(r,{width:"short",context:"formatting"});case"EEEE":default:return o.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,o,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return rt(s,2);case"eo":return o.ordinalNumber(s,{unit:"day"});case"eee":return o.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(a,{width:"short",context:"formatting"});case"eeee":default:return o.day(a,{width:"wide",context:"formatting"})}},c:function(t,n,o,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return rt(s,n.length);case"co":return o.ordinalNumber(s,{unit:"day"});case"ccc":return o.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(a,{width:"narrow",context:"standalone"});case"cccccc":return o.day(a,{width:"short",context:"standalone"});case"cccc":default:return o.day(a,{width:"wide",context:"standalone"})}},i:function(t,n,o){const r=t.getDay(),a=r===0?7:r;switch(n){case"i":return String(a);case"ii":return rt(a,n.length);case"io":return o.ordinalNumber(a,{unit:"day"});case"iii":return o.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(r,{width:"short",context:"formatting"});case"iiii":default:return o.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,o){const a=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,n,o){const r=t.getHours();let a;switch(r===12?a=bo.noon:r===0?a=bo.midnight:a=r/12>=1?"pm":"am",n){case"b":case"bb":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,n,o){const r=t.getHours();let a;switch(r>=17?a=bo.evening:r>=12?a=bo.afternoon:r>=4?a=bo.morning:a=bo.night,n){case"B":case"BB":case"BBB":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,n,o){if(n==="ho"){let r=t.getHours()%12;return r===0&&(r=12),o.ordinalNumber(r,{unit:"hour"})}return On.h(t,n)},H:function(t,n,o){return n==="Ho"?o.ordinalNumber(t.getHours(),{unit:"hour"}):On.H(t,n)},K:function(t,n,o){const r=t.getHours()%12;return n==="Ko"?o.ordinalNumber(r,{unit:"hour"}):rt(r,n.length)},k:function(t,n,o){let r=t.getHours();return r===0&&(r=24),n==="ko"?o.ordinalNumber(r,{unit:"hour"}):rt(r,n.length)},m:function(t,n,o){return n==="mo"?o.ordinalNumber(t.getMinutes(),{unit:"minute"}):On.m(t,n)},s:function(t,n,o){return n==="so"?o.ordinalNumber(t.getSeconds(),{unit:"second"}):On.s(t,n)},S:function(t,n){return On.S(t,n)},X:function(t,n,o){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(n){case"X":return Od(r);case"XXXX":case"XX":return eo(r);case"XXXXX":case"XXX":default:return eo(r,":")}},x:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"x":return Od(r);case"xxxx":case"xx":return eo(r);case"xxxxx":case"xxx":default:return eo(r,":")}},O:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Td(r,":");case"OOOO":default:return"GMT"+eo(r,":")}},z:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Td(r,":");case"zzzz":default:return"GMT"+eo(r,":")}},t:function(t,n,o){const r=Math.trunc(+t/1e3);return rt(r,n.length)},T:function(t,n,o){return rt(+t,n.length)}};function Td(t,n=""){const o=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),s=r%60;return s===0?o+String(a):o+String(a)+n+rt(s,2)}function Od(t,n){return t%60===0?(t>0?"-":"+")+rt(Math.abs(t)/60,2):eo(t,n)}function eo(t,n=""){const o=t>0?"-":"+",r=Math.abs(t),a=rt(Math.trunc(r/60),2),s=rt(r%60,2);return o+a+n+s}const Fd=(t,n)=>{switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},zd=(t,n)=>{switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},Xx={p:zd,P:(t,n)=>{const o=t.match(/(P+)(p+)?/)||[],r=o[1],a=o[2];if(!a)return Fd(t,n);let s;switch(r){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",Fd(r,n)).replace("{{time}}",zd(a,n))}},Kx=/^D+$/,Yx=/^Y+$/,Jx=["D","DD","YY","YYYY"];function Qx(t){return Kx.test(t)}function Zx(t){return Yx.test(t)}function ek(t,n,o){const r=tk(t,n,o);if(console.warn(r),Jx.includes(t))throw new RangeError(r)}function tk(t,n,o){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${r} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const nk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ok=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rk=/^'([^]*?)'?$/,ak=/''/g,sk=/[a-zA-Z]/;function Id(t,n,o){var u,h,f,m;const r=Zr(),a=r.locale??Md,s=r.firstWeekContainsDate??((h=(u=r.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??1,i=r.weekStartsOn??((m=(f=r.locale)==null?void 0:f.options)==null?void 0:m.weekStartsOn)??0,l=Jt(t,o==null?void 0:o.in);if(!fx(l))throw new RangeError("Invalid time value");let c=n.match(ok).map(g=>{const b=g[0];if(b==="p"||b==="P"){const x=Xx[b];return x(g,a.formatLong)}return g}).join("").match(nk).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const b=g[0];if(b==="'")return{isToken:!1,value:ik(g)};if(Pd[b])return{isToken:!0,value:g};if(b.match(sk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return c.map(g=>{if(!g.isToken)return g.value;const b=g.value;(Zx(b)||Qx(b))&&ek(b,n,String(t));const x=Pd[b[0]];return x(l,b,a.localize,d)}).join("")}function ik(t){const n=t.match(rk);return n?n[1].replace(ak,"'"):t}const lk={lessThanXSeconds:{one:"kurang dari 1 detik",other:"kurang dari {{count}} detik"},xSeconds:{one:"1 detik",other:"{{count}} detik"},halfAMinute:"setengah menit",lessThanXMinutes:{one:"kurang dari 1 menit",other:"kurang dari {{count}} menit"},xMinutes:{one:"1 menit",other:"{{count}} menit"},aboutXHours:{one:"sekitar 1 jam",other:"sekitar {{count}} jam"},xHours:{one:"1 jam",other:"{{count}} jam"},xDays:{one:"1 hari",other:"{{count}} hari"},aboutXWeeks:{one:"sekitar 1 minggu",other:"sekitar {{count}} minggu"},xWeeks:{one:"1 minggu",other:"{{count}} minggu"},aboutXMonths:{one:"sekitar 1 bulan",other:"sekitar {{count}} bulan"},xMonths:{one:"1 bulan",other:"{{count}} bulan"},aboutXYears:{one:"sekitar 1 tahun",other:"sekitar {{count}} tahun"},xYears:{one:"1 tahun",other:"{{count}} tahun"},overXYears:{one:"lebih dari 1 tahun",other:"lebih dari {{count}} tahun"},almostXYears:{one:"hampir 1 tahun",other:"hampir {{count}} tahun"}},ck=(t,n,o)=>{let r;const a=lk[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"dalam waktu "+r:r+" yang lalu":r},dk={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},uk={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},fk={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},hk={date:go({formats:dk,defaultWidth:"full"}),time:go({formats:uk,defaultWidth:"full"}),dateTime:go({formats:fk,defaultWidth:"full"})},mk={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},pk=(t,n,o,r)=>mk[t],gk={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},bk={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},yk={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agt","Sep","Okt","Nov","Des"],wide:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"]},xk={narrow:["M","S","S","R","K","J","S"],short:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],abbreviated:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],wide:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},kk={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},wk={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},Ck={ordinalNumber:(t,n)=>"ke-"+Number(t),era:rn({values:gk,defaultWidth:"wide"}),quarter:rn({values:bk,defaultWidth:"wide",argumentCallback:t=>t-1}),month:rn({values:yk,defaultWidth:"wide"}),day:rn({values:xk,defaultWidth:"wide"}),dayPeriod:rn({values:kk,defaultWidth:"wide",formattingValues:wk,defaultFormattingWidth:"wide"})},Ek=/^ke-(\d+)?/i,Bk=/\d+/i,_k={narrow:/^(sm|m)/i,abbreviated:/^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,wide:/^(sebelum masehi|sebelum era umum|masehi|era umum)/i},Sk={any:[/^s/i,/^(m|e)/i]},Ak={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},Vk={any:[/1/i,/2/i,/3/i,/4/i]},Dk={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,wide:/^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i},Nk={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^ma/i,/^ap/i,/^me/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},Mk={narrow:/^[srkjm]/i,short:/^(min|sen|sel|rab|kam|jum|sab)/i,abbreviated:/^(min|sen|sel|rab|kam|jum|sab)/i,wide:/^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i},vk={narrow:[/^m/i,/^s/i,/^s/i,/^r/i,/^k/i,/^j/i,/^s/i],any:[/^m/i,/^sen/i,/^sel/i,/^r/i,/^k/i,/^j/i,/^sa/i]},Pk={narrow:/^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,any:/^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i},Tk={any:{am:/^a/i,pm:/^pm/i,midnight:/^tengah m/i,noon:/^tengah h/i,morning:/pagi/i,afternoon:/siang/i,evening:/sore/i,night:/malam/i}},Ok={ordinalNumber:Nd({matchPattern:Ek,parsePattern:Bk,valueCallback:t=>parseInt(t,10)}),era:an({matchPatterns:_k,defaultMatchWidth:"wide",parsePatterns:Sk,defaultParseWidth:"any"}),quarter:an({matchPatterns:Ak,defaultMatchWidth:"wide",parsePatterns:Vk,defaultParseWidth:"any",valueCallback:t=>t+1}),month:an({matchPatterns:Dk,defaultMatchWidth:"wide",parsePatterns:Nk,defaultParseWidth:"any"}),day:an({matchPatterns:Mk,defaultMatchWidth:"wide",parsePatterns:vk,defaultParseWidth:"any"}),dayPeriod:an({matchPatterns:Pk,defaultMatchWidth:"any",parsePatterns:Tk,defaultParseWidth:"any"})},Fk={code:"id",formatDistance:ck,formatLong:hk,formatRelative:pk,localize:Ck,match:Ok,options:{weekStartsOn:1,firstWeekContainsDate:1}},Rd={primary:{light:{primary:"hsl(var(--primary))",text:"hsl(var(--primary-foreground))",hover:"hsl(var(--accent))",border:"hsl(var(--border))",range:"#bfdbfe"},dark:{primary:"hsl(var(--primary))",text:"hsl(var(--primary-foreground))",hover:"hsl(var(--accent))",border:"hsl(var(--border))",range:"rgba(30, 58, 138, 0.3)"}},emerald:{light:{primary:"#16a34a",text:"#ffffff",hover:"#dcfce7",border:"#16a34a",range:"#ecfdf5"},dark:{primary:"#22c55e",text:"#0b1220",hover:"#14532d",border:"#22c55e",range:"rgba(6, 78, 59, 0.3)"}},amber:{light:{primary:"#d97706",text:"#ffffff",hover:"#fffbeb",border:"#d97706",range:"#fffbeb"},dark:{primary:"#f59e0b",text:"#0b1220",hover:"#78350f",border:"#f59e0b",range:"rgba(120, 53, 15, 0.3)"}},violet:{light:{primary:"#7c3aed",text:"#ffffff",hover:"#f5f3ff",border:"#7c3aed",range:"#f5f3ff"},dark:{primary:"#8b5cf6",text:"#0b1220",hover:"#2e1065",border:"#8b5cf6",range:"rgba(46, 16, 101, 0.3)"}},destructive:{light:{primary:"hsl(var(--destructive))",text:"hsl(var(--destructive-foreground))",hover:"hsl(var(--destructive) / 0.10)",border:"hsl(var(--destructive))",range:"#fef2f2"},dark:{primary:"hsl(var(--destructive))",text:"hsl(var(--destructive-foreground))",hover:"hsl(var(--destructive) / 0.18)",border:"hsl(var(--destructive))",range:"rgba(127, 29, 29, 0.3)"}}},Ld="dcode-dp-theme-forced";function zk(t,n=Ld){const o=Rd[t]??Rd.primary,r=`
18
+ `):t}function dy(t,n){const{element:o,datasetIndex:r,index:a}=n,s=t.getDatasetMeta(r).controller,{label:i,value:l}=s.getLabelAndValue(a);return{chart:t,label:i,parsed:s.getParsed(a),raw:t.data.datasets[r].data[a],formattedValue:l,dataset:s.getDataset(),dataIndex:a,datasetIndex:r,element:o}}function hd(t,n){const o=t.chart.ctx,{body:r,footer:a,title:s}=t,{boxWidth:i,boxHeight:l}=n,c=Et(n.bodyFont),d=Et(n.titleFont),u=Et(n.footerFont),f=s.length,h=a.length,m=r.length,g=Wt(n.padding);let k=g.height,y=0,p=r.reduce((B,S)=>B+S.before.length+S.lines.length+S.after.length,0);if(p+=t.beforeBody.length+t.afterBody.length,f&&(k+=f*d.lineHeight+(f-1)*n.titleSpacing+n.titleMarginBottom),p){const B=n.displayColors?Math.max(l,c.lineHeight):c.lineHeight;k+=m*B+(p-m)*c.lineHeight+(p-1)*n.bodySpacing}h&&(k+=n.footerMarginTop+h*u.lineHeight+(h-1)*n.footerSpacing);let E=0;const _=function(B){y=Math.max(y,o.measureText(B).width+E)};return o.save(),o.font=d.string,Ye(t.title,_),o.font=c.string,Ye(t.beforeBody.concat(t.afterBody),_),E=n.displayColors?i+2+n.boxPadding:0,Ye(r,B=>{Ye(B.before,_),Ye(B.lines,_),Ye(B.after,_)}),E=0,o.font=u.string,Ye(t.footer,_),o.restore(),y+=g.width,{width:y,height:k}}function uy(t,n){const{y:o,height:r}=n;return o<r/2?"top":o>t.height-r/2?"bottom":"center"}function fy(t,n,o,r){const{x:a,width:s}=r,i=o.caretSize+o.caretPadding;if(t==="left"&&a+s+i>n.width||t==="right"&&a-s-i<0)return!0}function hy(t,n,o,r){const{x:a,width:s}=o,{width:i,chartArea:{left:l,right:c}}=t;let d="center";return r==="center"?d=a<=(l+c)/2?"left":"right":a<=s/2?d="left":a>=i-s/2&&(d="right"),fy(d,t,n,o)&&(d="center"),d}function md(t,n,o){const r=o.yAlign||n.yAlign||uy(t,o);return{xAlign:o.xAlign||n.xAlign||hy(t,n,o,r),yAlign:r}}function my(t,n){let{x:o,width:r}=t;return n==="right"?o-=r:n==="center"&&(o-=r/2),o}function py(t,n,o){let{y:r,height:a}=t;return n==="top"?r+=o:n==="bottom"?r-=a+o:r-=a/2,r}function pd(t,n,o,r){const{caretSize:a,caretPadding:s,cornerRadius:i}=t,{xAlign:l,yAlign:c}=o,d=a+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=uo(i);let g=my(n,l);const k=py(n,c,d);return c==="center"?l==="left"?g+=d:l==="right"&&(g-=d):l==="left"?g-=Math.max(u,h)+a:l==="right"&&(g+=Math.max(f,m)+a),{x:wt(g,0,r.width-n.width),y:wt(k,0,r.height-n.height)}}function Jr(t,n,o){const r=Wt(o.padding);return n==="center"?t.x+t.width/2:n==="right"?t.x+t.width-r.right:t.x+r.left}function gd(t){return an([],wn(t))}function gy(t,n,o){return Kn(t,{tooltip:n,tooltipItems:o,type:"tooltip"})}function bd(t,n){const o=n&&n.dataset&&n.dataset.tooltip&&n.dataset.tooltip.callbacks;return o?t.override(o):t}const yd={beforeTitle:pn,title(t){if(t.length>0){const n=t[0],o=n.chart.data.labels,r=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return n.dataset.label||"";if(n.label)return n.label;if(r>0&&n.dataIndex<r)return o[n.dataIndex]}return""},afterTitle:pn,beforeBody:pn,beforeLabel:pn,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let n=t.dataset.label||"";n&&(n+=": ");const o=t.formattedValue;return He(o)||(n+=o),n},labelColor(t){const o=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:o.borderColor,backgroundColor:o.backgroundColor,borderWidth:o.borderWidth,borderDash:o.borderDash,borderDashOffset:o.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const o=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:pn,afterBody:pn,beforeFooter:pn,footer:pn,afterFooter:pn};function Dt(t,n,o,r){const a=t[n].call(o,r);return typeof a>"u"?yd[n].call(o,r):a}class Ts extends xn{constructor(n){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=n.chart,this.options=n.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(n){this.options=n,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const n=this._cachedAnimations;if(n)return n;const o=this.chart,r=this.options.setContext(this.getContext()),a=r.enabled&&o.options.animation&&r.animations,s=new hc(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=gy(this.chart.getContext(),this,this._tooltipItems))}getTitle(n,o){const{callbacks:r}=o,a=Dt(r,"beforeTitle",this,n),s=Dt(r,"title",this,n),i=Dt(r,"afterTitle",this,n);let l=[];return l=an(l,wn(a)),l=an(l,wn(s)),l=an(l,wn(i)),l}getBeforeBody(n,o){return gd(Dt(o.callbacks,"beforeBody",this,n))}getBody(n,o){const{callbacks:r}=o,a=[];return Ye(n,s=>{const i={before:[],lines:[],after:[]},l=bd(r,s);an(i.before,wn(Dt(l,"beforeLabel",this,s))),an(i.lines,Dt(l,"label",this,s)),an(i.after,wn(Dt(l,"afterLabel",this,s))),a.push(i)}),a}getAfterBody(n,o){return gd(Dt(o.callbacks,"afterBody",this,n))}getFooter(n,o){const{callbacks:r}=o,a=Dt(r,"beforeFooter",this,n),s=Dt(r,"footer",this,n),i=Dt(r,"afterFooter",this,n);let l=[];return l=an(l,wn(a)),l=an(l,wn(s)),l=an(l,wn(i)),l}_createItems(n){const o=this._active,r=this.chart.data,a=[],s=[],i=[];let l=[],c,d;for(c=0,d=o.length;c<d;++c)l.push(dy(this.chart,o[c]));return n.filter&&(l=l.filter((u,f,h)=>n.filter(u,f,h,r))),n.itemSort&&(l=l.sort((u,f)=>n.itemSort(u,f,r))),Ye(l,u=>{const f=bd(n.callbacks,u);a.push(Dt(f,"labelColor",this,u)),s.push(Dt(f,"labelPointStyle",this,u)),i.push(Dt(f,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(n,o){const r=this.options.setContext(this.getContext()),a=this._active;let s,i=[];if(!a.length)this.opacity!==0&&(s={opacity:0});else{const l=tr[r.position].call(this,a,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const c=this._size=hd(this,r),d=Object.assign({},l,c),u=md(this.chart,r,d),f=pd(r,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=i,this.$context=void 0,s&&this._resolveAnimations().update(this,s),n&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:o})}drawCaret(n,o,r,a){const s=this.getCaretPosition(n,r,a);o.lineTo(s.x1,s.y1),o.lineTo(s.x2,s.y2),o.lineTo(s.x3,s.y3)}getCaretPosition(n,o,r){const{xAlign:a,yAlign:s}=this,{caretSize:i,cornerRadius:l}=r,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=uo(l),{x:h,y:m}=n,{width:g,height:k}=o;let y,p,E,_,B,S;return s==="center"?(B=m+k/2,a==="left"?(y=h,p=y-i,_=B+i,S=B-i):(y=h+g,p=y+i,_=B-i,S=B+i),E=y):(a==="left"?p=h+Math.max(c,u)+i:a==="right"?p=h+g-Math.max(d,f)-i:p=this.caretX,s==="top"?(_=m,B=_-i,y=p-i,E=p+i):(_=m+k,B=_+i,y=p+i,E=p-i),S=_),{x1:y,x2:p,x3:E,y1:_,y2:B,y3:S}}drawTitle(n,o,r){const a=this.title,s=a.length;let i,l,c;if(s){const d=mo(r.rtl,this.x,this.width);for(n.x=Jr(this,r.titleAlign,r),o.textAlign=d.textAlign(r.titleAlign),o.textBaseline="middle",i=Et(r.titleFont),l=r.titleSpacing,o.fillStyle=r.titleColor,o.font=i.string,c=0;c<s;++c)o.fillText(a[c],d.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+l,c+1===s&&(n.y+=r.titleMarginBottom-l)}}_drawColorBox(n,o,r,a,s){const i=this.labelColors[r],l=this.labelPointStyles[r],{boxHeight:c,boxWidth:d}=s,u=Et(s.bodyFont),f=Jr(this,"left",s),h=a.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,g=o.y+m;if(s.usePointStyle){const k={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},y=a.leftForLtr(h,d)+d/2,p=g+c/2;n.strokeStyle=s.multiKeyBackground,n.fillStyle=s.multiKeyBackground,ds(n,k,y,p),n.strokeStyle=i.borderColor,n.fillStyle=i.backgroundColor,ds(n,k,y,p)}else{n.lineWidth=Re(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,n.strokeStyle=i.borderColor,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset||0;const k=a.leftForLtr(h,d),y=a.leftForLtr(a.xPlus(h,1),d-2),p=uo(i.borderRadius);Object.values(p).some(E=>E!==0)?(n.beginPath(),n.fillStyle=s.multiKeyBackground,Mr(n,{x:k,y:g,w:d,h:c,radius:p}),n.fill(),n.stroke(),n.fillStyle=i.backgroundColor,n.beginPath(),Mr(n,{x:y,y:g+1,w:d-2,h:c-2,radius:p}),n.fill()):(n.fillStyle=s.multiKeyBackground,n.fillRect(k,g,d,c),n.strokeRect(k,g,d,c),n.fillStyle=i.backgroundColor,n.fillRect(y,g+1,d-2,c-2))}n.fillStyle=this.labelTextColors[r]}drawBody(n,o,r){const{body:a}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=r,f=Et(r.bodyFont);let h=f.lineHeight,m=0;const g=mo(r.rtl,this.x,this.width),k=function(b){o.fillText(b,g.x(n.x+m),n.y+h/2),n.y+=h+s},y=g.textAlign(i);let p,E,_,B,S,w,x;for(o.textAlign=i,o.textBaseline="middle",o.font=f.string,n.x=Jr(this,y,r),o.fillStyle=r.bodyColor,Ye(this.beforeBody,k),m=l&&y!=="right"?i==="center"?d/2+u:d+2+u:0,B=0,w=a.length;B<w;++B){for(p=a[B],E=this.labelTextColors[B],o.fillStyle=E,Ye(p.before,k),_=p.lines,l&&_.length&&(this._drawColorBox(o,n,B,g,r),h=Math.max(f.lineHeight,c)),S=0,x=_.length;S<x;++S)k(_[S]),h=f.lineHeight;Ye(p.after,k)}m=0,h=f.lineHeight,Ye(this.afterBody,k),n.y-=s}drawFooter(n,o,r){const a=this.footer,s=a.length;let i,l;if(s){const c=mo(r.rtl,this.x,this.width);for(n.x=Jr(this,r.footerAlign,r),n.y+=r.footerMarginTop,o.textAlign=c.textAlign(r.footerAlign),o.textBaseline="middle",i=Et(r.footerFont),o.fillStyle=r.footerColor,o.font=i.string,l=0;l<s;++l)o.fillText(a[l],c.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+r.footerSpacing}}drawBackground(n,o,r,a){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=n,{width:d,height:u}=r,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:g}=uo(a.cornerRadius);o.fillStyle=a.backgroundColor,o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.beginPath(),o.moveTo(l+f,c),i==="top"&&this.drawCaret(n,o,r,a),o.lineTo(l+d-h,c),o.quadraticCurveTo(l+d,c,l+d,c+h),i==="center"&&s==="right"&&this.drawCaret(n,o,r,a),o.lineTo(l+d,c+u-g),o.quadraticCurveTo(l+d,c+u,l+d-g,c+u),i==="bottom"&&this.drawCaret(n,o,r,a),o.lineTo(l+m,c+u),o.quadraticCurveTo(l,c+u,l,c+u-m),i==="center"&&s==="left"&&this.drawCaret(n,o,r,a),o.lineTo(l,c+f),o.quadraticCurveTo(l,c,l+f,c),o.closePath(),o.fill(),a.borderWidth>0&&o.stroke()}_updateAnimationTarget(n){const o=this.chart,r=this.$animations,a=r&&r.x,s=r&&r.y;if(a||s){const i=tr[n.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=hd(this,n),c=Object.assign({},i,this._size),d=md(o,n,c),u=pd(n,c,d,o);(a._to!==u.x||s._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(n){const o=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(o);const a={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=Wt(o.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;o.enabled&&l&&(n.save(),n.globalAlpha=r,this.drawBackground(s,n,a,o),oc(n,o.textDirection),s.y+=i.top,this.drawTitle(s,n,o),this.drawBody(s,n,o),this.drawFooter(s,n,o),rc(n,o.textDirection),n.restore())}getActiveElements(){return this._active||[]}setActiveElements(n,o){const r=this._active,a=n.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),s=!_r(r,a),i=this._positionChanged(a,o);(s||i)&&(this._active=a,this._eventPosition=o,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(n,o,r=!0){if(o&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,s=this._active||[],i=this._getActiveElements(n,s,o,r),l=this._positionChanged(i,n),c=o||!_r(i,s)||l;return c&&(this._active=i,(a.enabled||a.external)&&(this._eventPosition={x:n.x,y:n.y},this.update(!0,o))),c}_getActiveElements(n,o,r,a){const s=this.options;if(n.type==="mouseout")return[];if(!a)return o.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const i=this.chart.getElementsAtEventForMode(n,s.mode,s,r);return s.reverse&&i.reverse(),i}_positionChanged(n,o){const{caretX:r,caretY:a,options:s}=this,i=tr[s.position].call(this,n,o);return i!==!1&&(r!==i.x||a!==i.y)}}ke(Ts,"positioners",tr);var by={id:"tooltip",_element:Ts,positioners:tr,afterInit(t,n,o){o&&(t.tooltip=new Ts({chart:t,options:o}))},beforeUpdate(t,n,o){t.tooltip&&t.tooltip.initialize(o)},reset(t,n,o){t.tooltip&&t.tooltip.initialize(o)},afterDraw(t){const n=t.tooltip;if(n&&n._willRender()){const o={tooltip:n};if(t.notifyPlugins("beforeTooltipDraw",{...o,cancelable:!0})===!1)return;n.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",o)}},afterEvent(t,n){if(t.tooltip){const o=n.replay;t.tooltip.handleEvent(n.event,o,n.inChartArea)&&(n.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,n)=>n.bodyFont.size,boxWidth:(t,n)=>n.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:yd},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const yy=(t,n,o,r)=>(typeof n=="string"?(o=t.push(n)-1,r.unshift({index:o,label:n})):isNaN(n)&&(o=null),o);function xy(t,n,o,r){const a=t.indexOf(n);if(a===-1)return yy(t,n,o,r);const s=t.lastIndexOf(n);return a!==s?o:a}const ky=(t,n)=>t===null?null:wt(Math.round(t),0,n);function xd(t){const n=this.getLabels();return t>=0&&t<n.length?n[t]:t}class Os extends go{constructor(n){super(n),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(n){const o=this._addedLabels;if(o.length){const r=this.getLabels();for(const{index:a,label:s}of o)r[a]===s&&r.splice(a,1);this._addedLabels=[]}super.init(n)}parse(n,o){if(He(n))return null;const r=this.getLabels();return o=isFinite(o)&&r[o]===n?o:xy(r,n,Oe(o,n),this._addedLabels),ky(o,r.length-1)}determineDataLimits(){const{minDefined:n,maxDefined:o}=this.getUserBounds();let{min:r,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(n||(r=0),o||(a=this.getLabels().length-1)),this.min=r,this.max=a}buildTicks(){const n=this.min,o=this.max,r=this.options.offset,a=[];let s=this.getLabels();s=n===0&&o===s.length-1?s:s.slice(n,o+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let i=n;i<=o;i++)a.push({value:i});return a}getLabelForValue(n){return xd.call(this,n)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(n){return typeof n!="number"&&(n=this.parse(n)),n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getPixelForTick(n){const o=this.ticks;return n<0||n>o.length-1?null:this.getPixelForValue(o[n].value)}getValueForPixel(n){return Math.round(this._startValue+this.getDecimalForPixel(n)*this._valueRange)}getBasePixel(){return this.bottom}}ke(Os,"id","category"),ke(Os,"defaults",{ticks:{callback:xd}});function wy(t,n){const o=[],{bounds:a,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=t,m=s||1,g=u-1,{min:k,max:y}=n,p=!He(i),E=!He(l),_=!He(d),B=(y-k)/(f+1);let S=Ml((y-k)/g/m)*m,w,x,b,V;if(S<1e-14&&!p&&!E)return[{value:k},{value:y}];V=Math.ceil(y/S)-Math.floor(k/S),V>g&&(S=Ml(V*S/g/m)*m),He(c)||(w=Math.pow(10,c),S=Math.ceil(S*w)/w),a==="ticks"?(x=Math.floor(k/S)*S,b=Math.ceil(y/S)*S):(x=k,b=y),p&&E&&s&&Bp((l-i)/s,S/1e3)?(V=Math.round(Math.min((l-i)/S,u)),S=(l-i)/V,x=i,b=l):_?(x=p?i:x,b=E?l:b,V=d-1,S=(b-x)/V):(V=(b-x)/S,Lo(V,Math.round(V),S/1e3)?V=Math.round(V):V=Math.ceil(V));const A=Math.max(vl(S),vl(x));w=Math.pow(10,He(c)?A:c),x=Math.round(x*w)/w,b=Math.round(b*w)/w;let D=0;for(p&&(h&&x!==i?(o.push({value:i}),x<i&&D++,Lo(Math.round((x+D*S)*w)/w,i,kd(i,B,t))&&D++):x<i&&D++);D<V;++D){const N=Math.round((x+D*S)*w)/w;if(E&&N>l)break;o.push({value:N})}return E&&h&&b!==l?o.length&&Lo(o[o.length-1].value,l,kd(l,B,t))?o[o.length-1].value=l:o.push({value:l}):(!E||b===l)&&o.push({value:b}),o}function kd(t,n,{horizontal:o,minRotation:r}){const a=gn(r),s=(o?Math.sin(a):Math.cos(a))||.001,i=.75*n*(""+t).length;return Math.min(n/s,i)}class Cy extends go{constructor(n){super(n),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(n,o){return He(n)||(typeof n=="number"||n instanceof Number)&&!isFinite(+n)?null:+n}handleTickRangeOptions(){const{beginAtZero:n}=this.options,{minDefined:o,maxDefined:r}=this.getUserBounds();let{min:a,max:s}=this;const i=c=>a=o?a:c,l=c=>s=r?s:c;if(n){const c=on(a),d=on(s);c<0&&d<0?l(0):c>0&&d>0&&i(0)}if(a===s){let c=s===0?1:Math.abs(s*.05);l(s+c),n||i(a-c)}this.min=a,this.max=s}getTickLimit(){const n=this.options.ticks;let{maxTicksLimit:o,stepSize:r}=n,a;return r?(a=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),o=o||11),o&&(a=Math.min(o,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const n=this.options,o=n.ticks;let r=this.getTickLimit();r=Math.max(2,r);const a={maxTicks:r,bounds:n.bounds,min:n.min,max:n.max,precision:o.precision,step:o.stepSize,count:o.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:o.minRotation||0,includeBounds:o.includeBounds!==!1},s=this._range||this,i=wy(a,s);return n.bounds==="ticks"&&_p(i,this,"value"),n.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const n=this.ticks;let o=this.min,r=this.max;if(super.configure(),this.options.offset&&n.length){const a=(r-o)/Math.max(n.length-1,1)/2;o-=a,r+=a}this._startValue=o,this._endValue=r,this._valueRange=r-o}getLabelForValue(n){return is(n,this.chart.options.locale,this.options.ticks.format)}}class Fs extends Cy{determineDataLimits(){const{min:n,max:o}=this.getMinMax(!0);this.min=kt(n)?n:0,this.max=kt(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const n=this.isHorizontal(),o=n?this.width:this.height,r=gn(this.options.ticks.minRotation),a=(n?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,s.lineHeight/a))}getPixelForValue(n){return n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getValueForPixel(n){return this._startValue+this.getDecimalForPixel(n)*this._valueRange}}ke(Fs,"id","linear"),ke(Fs,"defaults",{ticks:{callback:Wl.formatters.numeric}});const Qr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Nt=Object.keys(Qr);function wd(t,n){return t-n}function Cd(t,n){if(He(n))return null;const o=t._adapter,{parser:r,round:a,isoWeekday:s}=t._parseOpts;let i=n;return typeof r=="function"&&(i=r(i)),kt(i)||(i=typeof r=="string"?o.parse(i,r):o.parse(i)),i===null?null:(a&&(i=a==="week"&&($o(s)||s===!0)?o.startOf(i,"isoWeek",s):o.startOf(i,a)),+i)}function Ed(t,n,o,r){const a=Nt.length;for(let s=Nt.indexOf(t);s<a-1;++s){const i=Qr[Nt[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((o-n)/(l*i.size))<=r)return Nt[s]}return Nt[a-1]}function Ey(t,n,o,r,a){for(let s=Nt.length-1;s>=Nt.indexOf(o);s--){const i=Nt[s];if(Qr[i].common&&t._adapter.diff(a,r,i)>=n-1)return i}return Nt[o?Nt.indexOf(o):0]}function By(t){for(let n=Nt.indexOf(t)+1,o=Nt.length;n<o;++n)if(Qr[Nt[n]].common)return Nt[n]}function Bd(t,n,o){if(!o)t[n]=!0;else if(o.length){const{lo:r,hi:a}=os(o,n),s=o[r]>=n?o[r]:o[a];t[s]=!0}}function _y(t,n,o,r){const a=t._adapter,s=+a.startOf(n[0].value,r),i=n[n.length-1].value;let l,c;for(l=s;l<=i;l=+a.add(l,1,r))c=o[l],c>=0&&(n[c].major=!0);return n}function _d(t,n,o){const r=[],a={},s=n.length;let i,l;for(i=0;i<s;++i)l=n[i],a[l]=i,r.push({value:l,major:!1});return s===0||!o?r:_y(t,r,a,o)}class Zr extends go{constructor(n){super(n),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(n,o={}){const r=n.time||(n.time={}),a=this._adapter=new i0._date(n.adapters.date);a.init(o),Io(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(n),this._normalized=o.normalized}parse(n,o){return n===void 0?null:Cd(this,n)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const n=this.options,o=this._adapter,r=n.time.unit||"day";let{min:a,max:s,minDefined:i,maxDefined:l}=this.getUserBounds();function c(d){!i&&!isNaN(d.min)&&(a=Math.min(a,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!i||!l)&&(c(this._getLabelBounds()),(n.bounds!=="ticks"||n.ticks.source!=="labels")&&c(this.getMinMax(!1))),a=kt(a)&&!isNaN(a)?a:+o.startOf(Date.now(),r),s=kt(s)&&!isNaN(s)?s:+o.endOf(Date.now(),r)+1,this.min=Math.min(a,s-1),this.max=Math.max(a+1,s)}_getLabelBounds(){const n=this.getLabelTimestamps();let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return n.length&&(o=n[0],r=n[n.length-1]),{min:o,max:r}}buildTicks(){const n=this.options,o=n.time,r=n.ticks,a=r.source==="labels"?this.getLabelTimestamps():this._generate();n.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const s=this.min,i=this.max,l=Np(a,s,i);return this._unit=o.unit||(r.autoSkip?Ed(o.minUnit,this.min,this.max,this._getLabelCapacity(s)):Ey(this,l.length,o.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:By(this._unit),this.initOffsets(a),n.reverse&&l.reverse(),_d(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(n=>+n.value))}initOffsets(n=[]){let o=0,r=0,a,s;this.options.offset&&n.length&&(a=this.getDecimalForValue(n[0]),n.length===1?o=1-a:o=(this.getDecimalForValue(n[1])-a)/2,s=this.getDecimalForValue(n[n.length-1]),n.length===1?r=s:r=(s-this.getDecimalForValue(n[n.length-2]))/2);const i=n.length<3?.5:.25;o=wt(o,0,i),r=wt(r,0,i),this._offsets={start:o,end:r,factor:1/(o+1+r)}}_generate(){const n=this._adapter,o=this.min,r=this.max,a=this.options,s=a.time,i=s.unit||Ed(s.minUnit,o,r,this._getLabelCapacity(o)),l=Oe(a.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=$o(c)||c===!0,u={};let f=o,h,m;if(d&&(f=+n.startOf(f,"isoWeek",c)),f=+n.startOf(f,d?"day":i),n.diff(r,o,i)>1e5*l)throw new Error(o+" and "+r+" are too far apart with stepSize of "+l+" "+i);const g=a.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<r;h=+n.add(h,l,i),m++)Bd(u,h,g);return(h===r||a.bounds==="ticks"||m===1)&&Bd(u,h,g),Object.keys(u).sort(wd).map(k=>+k)}getLabelForValue(n){const o=this._adapter,r=this.options.time;return r.tooltipFormat?o.format(n,r.tooltipFormat):o.format(n,r.displayFormats.datetime)}format(n,o){const a=this.options.time.displayFormats,s=this._unit,i=o||a[s];return this._adapter.format(n,i)}_tickFormatFunction(n,o,r,a){const s=this.options,i=s.ticks.callback;if(i)return at(i,[n,o,r],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=r[o],m=d&&f&&h&&h.major;return this._adapter.format(n,a||(m?f:u))}generateTickLabels(n){let o,r,a;for(o=0,r=n.length;o<r;++o)a=n[o],a.label=this._tickFormatFunction(a.value,o,n)}getDecimalForValue(n){return n===null?NaN:(n-this.min)/(this.max-this.min)}getPixelForValue(n){const o=this._offsets,r=this.getDecimalForValue(n);return this.getPixelForDecimal((o.start+r)*o.factor)}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return this.min+r*(this.max-this.min)}_getLabelSize(n){const o=this.options.ticks,r=this.ctx.measureText(n).width,a=gn(this.isHorizontal()?o.maxRotation:o.minRotation),s=Math.cos(a),i=Math.sin(a),l=this._resolveTickFontOptions(0).size;return{w:r*s+l*i,h:r*i+l*s}}_getLabelCapacity(n){const o=this.options.time,r=o.displayFormats,a=r[o.unit]||r.millisecond,s=this._tickFormatFunction(n,0,_d(this,[n],this._majorUnit),a),i=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return l>0?l:1}getDataTimestamps(){let n=this._cache.data||[],o,r;if(n.length)return n;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(o=0,r=a.length;o<r;++o)n=n.concat(a[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const n=this._cache.labels||[];let o,r;if(n.length)return n;const a=this.getLabels();for(o=0,r=a.length;o<r;++o)n.push(Cd(this,a[o]));return this._cache.labels=this._normalized?n:this.normalize(n)}normalize(n){return Fl(n.sort(wd))}}ke(Zr,"id","time"),ke(Zr,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function ea(t,n,o){let r=0,a=t.length-1,s,i,l,c;o?(n>=t[r].pos&&n<=t[a].pos&&({lo:r,hi:a}=qn(t,"pos",n)),{pos:s,time:l}=t[r],{pos:i,time:c}=t[a]):(n>=t[r].time&&n<=t[a].time&&({lo:r,hi:a}=qn(t,"time",n)),{time:s,pos:l}=t[r],{time:i,pos:c}=t[a]);const d=i-s;return d?l+(c-l)*(n-s)/d:l}class Sd extends Zr{constructor(n){super(n),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const n=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(n);this._minPos=ea(o,this.min),this._tableRange=ea(o,this.max)-this._minPos,super.initOffsets(n)}buildLookupTable(n){const{min:o,max:r}=this,a=[],s=[];let i,l,c,d,u;for(i=0,l=n.length;i<l;++i)d=n[i],d>=o&&d<=r&&a.push(d);if(a.length<2)return[{time:o,pos:0},{time:r,pos:1}];for(i=0,l=a.length;i<l;++i)u=a[i+1],c=a[i-1],d=a[i],Math.round((u+c)/2)!==d&&s.push({time:d,pos:i/(l-1)});return s}_generate(){const n=this.min,o=this.max;let r=super.getDataTimestamps();return(!r.includes(n)||!r.length)&&r.splice(0,0,n),(!r.includes(o)||r.length===1)&&r.push(o),r.sort((a,s)=>a-s)}_getTimestampsForTable(){let n=this._cache.all||[];if(n.length)return n;const o=this.getDataTimestamps(),r=this.getLabelTimestamps();return o.length&&r.length?n=this.normalize(o.concat(r)):n=o.length?o:r,n=this._cache.all=n,n}getDecimalForValue(n){return(ea(this._table,n)-this._minPos)/this._tableRange}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return ea(this._table,r*this._tableRange+this._minPos,!0)}}ke(Sd,"id","timeseries"),ke(Sd,"defaults",Zr.defaults);const Sy={key:0,class:"mb-2 text-sm font-medium text-gray-700"},Vy={key:0,class:"text-red-500 ml-1"},Ay={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},Dy={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},Ny={class:"text-red-600 text-sm"},My={key:1,class:"mt-2 text-xs text-gray-500"},vy={key:0},Vd=Ot(e.defineComponent({name:"DCodeChart",__name:"DCodeChart",props:{type:{default:"line"},width:{default:400},height:{default:300},required:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},error:{default:null},showInfo:{type:Boolean,default:!1},responsive:{type:Boolean,default:!0},maintainAspectRatio:{type:Boolean,default:!1},theme:{default:"light"},colors:{default:()=>["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#14B8A6","#F97316","#6366F1","#84CC16"]},data:{},modelValue:{},options:{},onClick:{},onHover:{},label:{}},emits:["update:modelValue","click","hover","ready"],setup(t,{expose:n,emit:o}){kn.register(Os,Fs,Xr,vn,Kr,er,cy,by,iy,ty,Ir,zr,ws,po);const r=t,a=o,s=e.ref(null),i=e.shallowRef(null),l=e.ref(null),c=e.computed(()=>({"opacity-50 pointer-events-none":r.loading||r.error})),d=()=>{const h=r.theme==="dark";return{responsive:r.responsive,maintainAspectRatio:r.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:m=>{let g=0;return m.type==="data"&&m.mode==="default"&&(g=m.dataIndex*100+m.datasetIndex*50),g},onComplete:()=>{}},plugins:{legend:{position:"top",labels:{color:h?"#E5E7EB":"#374151",font:{size:12}}},tooltip:{backgroundColor:h?"#1F2937":"#FFFFFF",titleColor:h?"#F3F4F6":"#111827",bodyColor:h?"#D1D5DB":"#4B5563",borderColor:h?"#374151":"#E5E7EB",borderWidth:1,animation:{duration:200,easing:"easeInOutQuad"}}},scales:r.type!=="pie"&&r.type!=="doughnut"&&r.type!=="polarArea"?{x:{grid:{color:h?"#374151":"#E5E7EB"},ticks:{color:h?"#D1D5DB":"#6B7280"}},y:{grid:{color:h?"#374151":"#E5E7EB"},ticks:{color:h?"#D1D5DB":"#6B7280"}}}:void 0}},u=h=>!h||!h.datasets?h:{...h,datasets:h.datasets.map((m,g)=>{const k=g%r.colors.length,y=r.colors[k];let p=m.backgroundColor,E=m.borderColor;return["pie","doughnut","polarArea"].includes(r.type)&&(!p||p.length===0)?m.data&&(p=m.data.map((_,B)=>r.colors[B%r.colors.length]+"80"),E=m.data.map((_,B)=>r.colors[B%r.colors.length])):(p=p||y+"40",E=E||y),{...m,borderColor:E,backgroundColor:p,pointBackgroundColor:m.pointBackgroundColor||y,pointBorderColor:m.pointBorderColor||y,hoverBackgroundColor:m.hoverBackgroundColor||y+"60",hoverBorderColor:m.hoverBorderColor||y}})},f=async()=>{if(!s.value)return;await e.nextTick(),i.value&&i.value.destroy();const h=r.data||r.modelValue;let m=h;if(Array.isArray(h))if(h.length>0&&typeof h[0]=="object"&&h[0]!==null){const k=Object.keys(h[0]),y=k.find(E=>["label","name","x","category","title"].includes(E.toLowerCase()))||k[0],p=k.find(E=>E!==y&&["value","y","count","amount","total","data"].includes(E.toLowerCase()))||k.find(E=>E!==y&&typeof h[0][E]=="number")||(k.length>1?k.find(E=>E!==y):k[0]);m={labels:h.map(E=>E[y||""]),datasets:[{label:r.label||"Data",data:h.map(E=>E[p||""])}]}}else h.length>0?m={labels:h.map((k,y)=>`Data ${y+1}`),datasets:[{label:r.label||"Data",data:h}]}:m={labels:[],datasets:[]};if(l.value=u(m),!l.value)return;const g={...d(),...r.options,onClick:(k,y)=>{a("click",k,y),r.onClick&&r.onClick(k,y)},onHover:(k,y)=>{a("hover",k,y),r.onHover&&r.onHover(k,y)}};i.value=new kn(s.value,{type:r.type,data:l.value,options:g}),a("ready",i.value)};return e.watch(()=>[r.data,r.modelValue,r.type,r.options,r.theme],()=>{f()},{deep:!0}),e.watch(()=>[r.width,r.height],()=>{i.value&&i.value.resize()}),e.onMounted(()=>{f()}),e.onUnmounted(()=>{i.value&&i.value.destroy()}),n({chart:i,updateChart:f}),(h,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["d-code-chart",c.value])},[t.label?(e.openBlock(),e.createElementBlock("div",Sy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Vy,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"relative",style:e.normalizeStyle({height:t.height+"px"})},[e.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),t.loading?(e.openBlock(),e.createElementBlock("div",Ay,[...m[0]||(m[0]=[e.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createElementBlock("div",Dy,[e.createElementVNode("div",Ny,e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0)],4),t.showInfo&&l.value?(e.openBlock(),e.createElementBlock("div",My,[l.value.datasets?(e.openBlock(),e.createElementBlock("div",vy,e.toDisplayString(l.value.datasets.length)+" dataset(s) • "+e.toDisplayString(l.value.labels?l.value.labels.length:0)+" data points ",1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1c7c58f"]]),nr=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Se.Label),e.mergeProps(e.unref(o),{class:e.unref(Ie)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Py={class:"grid gap-1.5"},Ty={key:0,class:"ml-1 text-destructive"},Oy=["aria-busy"],Fy={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},zy={key:1,class:"flex items-center"},Iy=["id","checked","indeterminate","disabled","required"],Cn=Ot(e.defineComponent({name:"DCodeCheckbox",inheritAttrs:!1,__name:"DCodeCheckbox",props:{id:{default:""},label:{default:""},title:{default:""},required:{type:Boolean,default:!1},modelValue:{type:[Boolean,null]},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>a.visible??!0),i=e.computed(()=>a.required),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-checkbox-${a.id||a.label||"checkbox"}-${l}`),d=e.ref(!!a.modelValue);e.watch(()=>a.modelValue,h=>{d.value=!!h},{immediate:!0});const u=()=>{if(a.disabled)return;const h=!d.value;d.value=h,r("update:modelValue",h)},f=h=>{(h.key===" "||h.key==="Enter")&&(h.preventDefault(),u())};return(h,m)=>(e.openBlock(),e.createElementBlock("div",Py,[t.label?(e.openBlock(),e.createBlock(nr,{key:0,class:"text-sm font-medium mb-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Ty,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([e.unref(o).class,{"opacity-60 cursor-not-allowed":t.disabled}]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Fy)):e.createCommentVNode("",!0),m[0]||(m[0]=e.createElementVNode("div",{class:"flex items-center gap-2.5"},[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(e.openBlock(),e.createElementBlock("div",zy,[e.createElementVNode("label",{class:e.normalizeClass(["flex items-center gap-2.5 group relative",{"cursor-pointer":!t.disabled,"opacity-50 cursor-not-allowed":t.disabled}])},[e.createElementVNode("input",{type:"checkbox",id:c.value,class:"sr-only peer",checked:d.value,indeterminate:t.indeterminate,disabled:t.disabled,required:i.value,onChange:u,onKeydown:f},null,40,Iy),e.createElementVNode("div",{class:e.normalizeClass(["h-4 w-4 shrink-0 rounded-sm border shadow-sm transition-all focus:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-neutral-400 dark:peer-focus-visible:ring-neutral-600 peer-focus-visible:ring-offset-2 flex items-center justify-center",[d.value||t.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800",t.disabled?"cursor-not-allowed":"cursor-pointer"]]),"aria-hidden":"true"},[d.value&&!t.indeterminate?(e.openBlock(),e.createBlock(e.unref(ce.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):t.indeterminate?(e.openBlock(),e.createBlock(e.unref(ce.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):e.createCommentVNode("",!0)],2),t.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["text-sm leading-relaxed select-none transition-colors",[t.disabled?"text-gray-400 dark:text-gray-500":"text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-gray-100"]])},e.toDisplayString(t.title),3)):e.createCommentVNode("",!0)],2)]))],10,Oy),[[e.vShow,s.value]])]))}}),[["__scopeId","data-v-c233d0a6"]]),Ry={class:"w-full"},Ly={key:0,class:"mb-4"},$y={key:0,class:"h-6 w-48 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},jy={key:1,class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Wy={key:0,class:"ml-1 text-destructive"},Uy={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-4"},Hy={key:1,class:"flex flex-wrap gap-4"},qy={key:0,class:"text-center py-8 text-gray-500 dark:text-gray-400"},Gy={key:1,class:"flex flex-wrap gap-x-6 gap-y-4"},Xy={key:3,class:"flex items-center gap-1 text-sm text-red-500 mt-4"},zs=Ot(e.defineComponent({name:"DCodeCardCheckboxList",inheritAttrs:!1,__name:"DCodeCardCheckboxList",props:{modelValue:{default:()=>[]},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},items:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},apiModule:{},apiAction:{},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""},columns:{default:2},apiParams:{default:()=>({})},returnArray:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=ft(),r=n,a=t,s=e.ref(new Set);e.watch(()=>a.modelValue,S=>{if(!S){s.value=new Set;return}const w=S.map(x=>typeof x=="object"&&x!==null?x.id!==void 0?x.id:x.value:x);s.value=new Set(w)},{immediate:!0,deep:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var w,x;const S=((w=a.endpoint)==null?void 0:w.apiUrl)||a.apiUrl;if(!(!S&&!a.apiModule&&!a.apiAction)){l.value=!0,c.value=null;try{let b;const V=((x=a.endpoint)==null?void 0:x.apiMethod)||a.apiMethod||"GET",A={page:1,perPage:100,...a.apiParams};if(S)b=await o(S,V,A);else if(a.apiModule&&a.apiAction){const{DCodeApi:N}=ft();b=await N(a.apiModule,a.apiAction,A)}let D=b;a.dataPath?D=a.dataPath.split(".").reduce((P,v)=>P&&P[v]!==void 0?P[v]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(D=b.data),Array.isArray(D)?i.value=D:(console.warn("DCodeCardCheckboxList: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(b){console.error("DCodeCardCheckboxList fetch error:",b),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=e.ref(!1);let f=null;const h=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var S;((S=a.endpoint)!=null&&S.apiUrl||a.apiUrl||a.apiModule&&a.apiAction)&&d(),h(),typeof document<"u"&&(f=new MutationObserver(h),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const m=e.computed(()=>a.options&&a.options.length>0?a.options:a.items&&a.items.length>0?a.items:i.value),g=S=>{if(typeof S!="object"||S===null)return S;const w=a.itemValue||a.model||"id";return S[w]},k=S=>{if(typeof S!="object"||S===null)return String(S);const w=a.itemTitle||"name";return S[w]},y=S=>s.value.has(S),p=(S,w)=>{if(a.disabled)return;const x=new Set(s.value);w?x.add(S):x.delete(S),s.value=x;const b=Array.from(s.value);r("update:modelValue",b),r("change",b)},E=e.computed(()=>a.skeleton||l.value),_=e.computed(()=>!!a.error||!!c.value),B=e.computed(()=>a.error||c.value);return(S,w)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",Ry,[t.label||E.value?(e.openBlock(),e.createElementBlock("div",Ly,[E.value?(e.openBlock(),e.createElementBlock("div",$y)):(e.openBlock(),e.createElementBlock("h3",jy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Wy,"*")):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",Uy,[e.createVNode(e.unref(ce.Loader2),{class:"w-4 h-4 animate-spin"}),w[0]||(w[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createElementBlock("div",Hy,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,x=>e.createElementVNode("div",{key:`skeleton-${x}`,class:"flex items-center gap-2.5 min-w-[120px]"},[...w[1]||(w[1]=[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"},null,-1),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])),64))])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[m.value.length===0?(e.openBlock(),e.createElementBlock("div",qy," Tidak ada data ")):(e.openBlock(),e.createElementBlock("div",Gy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(x,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:"flex items-start"},[e.createVNode(Cn,{"model-value":y(g(x)),title:k(x),disabled:t.disabled,"onUpdate:modelValue":V=>p(g(x),V)},null,8,["model-value","title","disabled","onUpdate:modelValue"])]))),128))]))],64)),_.value&&B.value?(e.openBlock(),e.createElementBlock("div",Xy,[e.createVNode(e.unref(ce.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(B.value),1)])):e.createCommentVNode("",!0)])],512)),[[e.vShow,t.visible]])}}),[["__scopeId","data-v-8f934d59"]]),Ky=["aria-busy"],Yy={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Jy={key:1,class:"flex justify-end"},Qy=["for"],Zy={key:0,class:"ml-1 text-destructive"},ex={class:"relative w-full group"},tx={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700"},nx={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},ox=["id","disabled","readonly","placeholder","maxlength"],rx={key:0,class:"absolute top-full right-0 z-10 text-[11px] text-gray-400 dark:text-gray-500 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100 mt-0.5"},ax={key:1,class:"flex items-center gap-1 text-xs text-destructive"},Is=e.defineComponent({name:"DCodeCurrencyField",inheritAttrs:!1,__name:"DCodeCurrencyField",props:{modelValue:{},currency:{default:"IDR"},locale:{},label:{},placeholder:{},error:{},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},prependInner:{},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`app-currency-field-${o.id||a.label||"currency-field"}-${s}`),l=e.computed(()=>{const D=o.required,N=o["aria-required"];return D===""||D===!0||D==="true"||(N==="true"||N===!0)}),c=e.computed(()=>{const D=o.maxlength??o.maxLength;let N=Number.NaN;return typeof D=="number"?N=D:typeof D=="string"&&(N=Number.parseInt(D,10)),Number.isFinite(N)&&N>0?N:void 0}),d=e.computed(()=>a.locale?a.locale:"en-US"),u=e.computed(()=>a.prependInner?a.prependInner:a.currency==="USD"?"$":a.currency==="IDR"?"Rp":a.currency),f=e.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),h=D=>{const N=D.replaceAll(/\D/g,"");return N?Number(N):null},m=D=>f.value.format(D),g=e.ref(""),k=e.ref(null);e.watch(()=>a.modelValue,D=>{D==null?g.value="":h(g.value)!==D&&(g.value=m(D))},{immediate:!0});const y=(D,N)=>{let P=0;for(let v=0;v<N;v++)/\d/.test(D[v])&&P++;return P},p=(D,N)=>{let P=0;for(let v=0;v<D.length;v++)if(/\d/.test(D[v])&&(P++,P===N))return v+1;return D.length},E=D=>{const N=D.target,P=N.value,v=N.selectionStart??P.length,Q=h(P);if(Q===null){g.value="",r("update:modelValue",null);return}const $=m(Q);if(P!==$){const q=y(P,v);g.value=$,e.nextTick(()=>{if(k.value){const Y=p($,q);k.value.setSelectionRange(Y,Y)}})}r("update:modelValue",Q)},_=()=>{g.value="",r("update:modelValue",null),r("clear")},B=e.computed(()=>!a.clearable||a.disabled||a.readonly?!1:a.hideClearWhenEmpty?g.value.length>0:!0),S=e.computed(()=>!!a.error),w=e.computed(()=>{const{class:D,maxlength:N,maxLength:P,...v}=o;return v}),x=e.computed(()=>g.value.length),b=e.computed(()=>a.showCharCount?(c.value??0)>0:!1),V=e.computed(()=>b.value&&x.value>0),A=e.computed(()=>`${x.value} / ${c.value}`);return(D,N)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1.5 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Yy)):e.createCommentVNode("",!0),N[2]||(N[2]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),b.value?(e.openBlock(),e.createElementBlock("div",Jy,[...N[1]||(N[1]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",Zy,"*")):e.createCommentVNode("",!0)],8,Qy)):e.createCommentVNode("",!0),e.createElementVNode("div",ex,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50",S.value?"border-destructive ring-1 ring-destructive":"border-gray-300 dark:border-gray-700 focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500 dark:focus-within:border-blue-400",a.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":""])},[e.createElementVNode("div",tx,[e.createElementVNode("span",nx,e.toDisplayString(u.value),1)]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:i.value,ref_key:"inputRef",ref:k,"onUpdate:modelValue":N[0]||(N[0]=P=>g.value=P),onInput:E,type:"text",inputmode:"numeric"},w.value,{disabled:a.disabled,readonly:a.readonly,placeholder:a.placeholder,maxlength:c.value,class:["flex-1 h-10 px-3 py-2 text-sm bg-transparent text-foreground dark:text-gray-300 outline-none placeholder:text-gray-400",B.value?"pr-8":""]}),null,16,ox),[[e.vModelText,g.value]]),B.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center w-8 h-10 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors flex-shrink-0","aria-label":"Clear input",onClick:_},[e.createVNode(e.unref(ce.X),{class:"w-3.5 h-3.5"})])):e.createCommentVNode("",!0)],2),V.value&&!S.value?(e.openBlock(),e.createElementBlock("p",rx,e.toDisplayString(A.value),1)):e.createCommentVNode("",!0)]),S.value?(e.openBlock(),e.createElementBlock("p",ax,[e.createVNode(e.unref(ce.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(a.error),1)])):e.createCommentVNode("",!0)],64))],10,Ky))}}),Ad=6048e5,sx=864e5,Dd=Symbol.for("constructDateFrom");function Tn(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&Dd in t?t[Dd](n):t instanceof Date?new t.constructor(n):new Date(n)}function Qt(t,n){return Tn(n||t,t)}let ix={};function ta(){return ix}function or(t,n){var l,c,d,u;const o=ta(),r=(n==null?void 0:n.weekStartsOn)??((c=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??o.weekStartsOn??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=Qt(t,n==null?void 0:n.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function na(t,n){return or(t,{...n,weekStartsOn:1})}function Nd(t,n){const o=Qt(t,n==null?void 0:n.in),r=o.getFullYear(),a=Tn(o,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=na(a),i=Tn(o,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const l=na(i);return o.getTime()>=s.getTime()?r+1:o.getTime()>=l.getTime()?r:r-1}function Md(t){const n=Qt(t),o=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return o.setUTCFullYear(n.getFullYear()),+t-+o}function lx(t,...n){const o=Tn.bind(null,n.find(r=>typeof r=="object"));return n.map(o)}function vd(t,n){const o=Qt(t,n==null?void 0:n.in);return o.setHours(0,0,0,0),o}function cx(t,n,o){const[r,a]=lx(o==null?void 0:o.in,t,n),s=vd(r),i=vd(a),l=+s-Md(s),c=+i-Md(i);return Math.round((l-c)/sx)}function dx(t,n){const o=Nd(t,n),r=Tn(t,0);return r.setFullYear(o,0,4),r.setHours(0,0,0,0),na(r)}function ux(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function fx(t){return!(!ux(t)&&typeof t!="number"||isNaN(+Qt(t)))}function hx(t,n){const o=Qt(t,n==null?void 0:n.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}const mx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},px=(t,n,o)=>{let r;const a=mx[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r};function yo(t){return(n={})=>{const o=n.width?String(n.width):t.defaultWidth;return t.formats[o]||t.formats[t.defaultWidth]}}const gx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},yx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xx={date:yo({formats:gx,defaultWidth:"full"}),time:yo({formats:bx,defaultWidth:"full"}),dateTime:yo({formats:yx,defaultWidth:"full"})},kx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},wx=(t,n,o,r)=>kx[t];function sn(t){return(n,o)=>{const r=o!=null&&o.context?String(o.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=o!=null&&o.width?String(o.width):i;a=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=o!=null&&o.width?String(o.width):t.defaultWidth;a=t.values[l]||t.values[i]}const s=t.argumentCallback?t.argumentCallback(n):n;return a[s]}}const Cx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ex={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Bx={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},_x={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Sx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Vx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ax={ordinalNumber:(t,n)=>{const o=Number(t),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},era:sn({values:Cx,defaultWidth:"wide"}),quarter:sn({values:Ex,defaultWidth:"wide",argumentCallback:t=>t-1}),month:sn({values:Bx,defaultWidth:"wide"}),day:sn({values:_x,defaultWidth:"wide"}),dayPeriod:sn({values:Sx,defaultWidth:"wide",formattingValues:Vx,defaultFormattingWidth:"wide"})};function ln(t){return(n,o={})=>{const r=o.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=n.match(a);if(!s)return null;const i=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?Nx(l,f=>f.test(i)):Dx(l,f=>f.test(i));let d;d=t.valueCallback?t.valueCallback(c):c,d=o.valueCallback?o.valueCallback(d):d;const u=n.slice(i.length);return{value:d,rest:u}}}function Dx(t,n){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&n(t[o]))return o}function Nx(t,n){for(let o=0;o<t.length;o++)if(n(t[o]))return o}function Pd(t){return(n,o={})=>{const r=n.match(t.matchPattern);if(!r)return null;const a=r[0],s=n.match(t.parsePattern);if(!s)return null;let i=t.valueCallback?t.valueCallback(s[0]):s[0];i=o.valueCallback?o.valueCallback(i):i;const l=n.slice(a.length);return{value:i,rest:l}}}const Mx=/^(\d+)(th|st|nd|rd)?/i,vx=/\d+/i,Px={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Tx={any:[/^b/i,/^(a|c)/i]},Ox={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Fx={any:[/1/i,/2/i,/3/i,/4/i]},zx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ix={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Rx={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Lx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},$x={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},jx={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Wx={ordinalNumber:Pd({matchPattern:Mx,parsePattern:vx,valueCallback:t=>parseInt(t,10)}),era:ln({matchPatterns:Px,defaultMatchWidth:"wide",parsePatterns:Tx,defaultParseWidth:"any"}),quarter:ln({matchPatterns:Ox,defaultMatchWidth:"wide",parsePatterns:Fx,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ln({matchPatterns:zx,defaultMatchWidth:"wide",parsePatterns:Ix,defaultParseWidth:"any"}),day:ln({matchPatterns:Rx,defaultMatchWidth:"wide",parsePatterns:Lx,defaultParseWidth:"any"}),dayPeriod:ln({matchPatterns:$x,defaultMatchWidth:"any",parsePatterns:jx,defaultParseWidth:"any"})},Td={code:"en-US",formatDistance:px,formatLong:xx,formatRelative:wx,localize:Ax,match:Wx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ux(t,n){const o=Qt(t,n==null?void 0:n.in);return cx(o,hx(o))+1}function Hx(t,n){const o=Qt(t,n==null?void 0:n.in),r=+na(o)-+dx(o);return Math.round(r/Ad)+1}function Od(t,n){var u,f,h,m;const o=Qt(t,n==null?void 0:n.in),r=o.getFullYear(),a=ta(),s=(n==null?void 0:n.firstWeekContainsDate)??((f=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((m=(h=a.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,i=Tn((n==null?void 0:n.in)||t,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const l=or(i,n),c=Tn((n==null?void 0:n.in)||t,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const d=or(c,n);return+o>=+l?r+1:+o>=+d?r:r-1}function qx(t,n){var l,c,d,u;const o=ta(),r=(n==null?void 0:n.firstWeekContainsDate)??((c=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??o.firstWeekContainsDate??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,a=Od(t,n),s=Tn((n==null?void 0:n.in)||t,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),or(s,n)}function Gx(t,n){const o=Qt(t,n==null?void 0:n.in),r=+or(o,n)-+qx(o,n);return Math.round(r/Ad)+1}function Qe(t,n){const o=t<0?"-":"",r=Math.abs(t).toString().padStart(n,"0");return o+r}const On={y(t,n){const o=t.getFullYear(),r=o>0?o:1-o;return Qe(n==="yy"?r%100:r,n.length)},M(t,n){const o=t.getMonth();return n==="M"?String(o+1):Qe(o+1,2)},d(t,n){return Qe(t.getDate(),n.length)},a(t,n){const o=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];case"aaaa":default:return o==="am"?"a.m.":"p.m."}},h(t,n){return Qe(t.getHours()%12||12,n.length)},H(t,n){return Qe(t.getHours(),n.length)},m(t,n){return Qe(t.getMinutes(),n.length)},s(t,n){return Qe(t.getSeconds(),n.length)},S(t,n){const o=n.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,o-3));return Qe(a,n.length)}},xo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Fd={G:function(t,n,o){const r=t.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return o.era(r,{width:"abbreviated"});case"GGGGG":return o.era(r,{width:"narrow"});case"GGGG":default:return o.era(r,{width:"wide"})}},y:function(t,n,o){if(n==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return o.ordinalNumber(a,{unit:"year"})}return On.y(t,n)},Y:function(t,n,o,r){const a=Od(t,r),s=a>0?a:1-a;if(n==="YY"){const i=s%100;return Qe(i,2)}return n==="Yo"?o.ordinalNumber(s,{unit:"year"}):Qe(s,n.length)},R:function(t,n){const o=Nd(t);return Qe(o,n.length)},u:function(t,n){const o=t.getFullYear();return Qe(o,n.length)},Q:function(t,n,o){const r=Math.ceil((t.getMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return Qe(r,2);case"Qo":return o.ordinalNumber(r,{unit:"quarter"});case"QQQ":return o.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,o){const r=Math.ceil((t.getMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return Qe(r,2);case"qo":return o.ordinalNumber(r,{unit:"quarter"});case"qqq":return o.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,o){const r=t.getMonth();switch(n){case"M":case"MM":return On.M(t,n);case"Mo":return o.ordinalNumber(r+1,{unit:"month"});case"MMM":return o.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,o){const r=t.getMonth();switch(n){case"L":return String(r+1);case"LL":return Qe(r+1,2);case"Lo":return o.ordinalNumber(r+1,{unit:"month"});case"LLL":return o.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,o,r){const a=Gx(t,r);return n==="wo"?o.ordinalNumber(a,{unit:"week"}):Qe(a,n.length)},I:function(t,n,o){const r=Hx(t);return n==="Io"?o.ordinalNumber(r,{unit:"week"}):Qe(r,n.length)},d:function(t,n,o){return n==="do"?o.ordinalNumber(t.getDate(),{unit:"date"}):On.d(t,n)},D:function(t,n,o){const r=Ux(t);return n==="Do"?o.ordinalNumber(r,{unit:"dayOfYear"}):Qe(r,n.length)},E:function(t,n,o){const r=t.getDay();switch(n){case"E":case"EE":case"EEE":return o.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(r,{width:"short",context:"formatting"});case"EEEE":default:return o.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,o,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return Qe(s,2);case"eo":return o.ordinalNumber(s,{unit:"day"});case"eee":return o.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(a,{width:"short",context:"formatting"});case"eeee":default:return o.day(a,{width:"wide",context:"formatting"})}},c:function(t,n,o,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return Qe(s,n.length);case"co":return o.ordinalNumber(s,{unit:"day"});case"ccc":return o.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(a,{width:"narrow",context:"standalone"});case"cccccc":return o.day(a,{width:"short",context:"standalone"});case"cccc":default:return o.day(a,{width:"wide",context:"standalone"})}},i:function(t,n,o){const r=t.getDay(),a=r===0?7:r;switch(n){case"i":return String(a);case"ii":return Qe(a,n.length);case"io":return o.ordinalNumber(a,{unit:"day"});case"iii":return o.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(r,{width:"short",context:"formatting"});case"iiii":default:return o.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,o){const a=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,n,o){const r=t.getHours();let a;switch(r===12?a=xo.noon:r===0?a=xo.midnight:a=r/12>=1?"pm":"am",n){case"b":case"bb":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,n,o){const r=t.getHours();let a;switch(r>=17?a=xo.evening:r>=12?a=xo.afternoon:r>=4?a=xo.morning:a=xo.night,n){case"B":case"BB":case"BBB":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,n,o){if(n==="ho"){let r=t.getHours()%12;return r===0&&(r=12),o.ordinalNumber(r,{unit:"hour"})}return On.h(t,n)},H:function(t,n,o){return n==="Ho"?o.ordinalNumber(t.getHours(),{unit:"hour"}):On.H(t,n)},K:function(t,n,o){const r=t.getHours()%12;return n==="Ko"?o.ordinalNumber(r,{unit:"hour"}):Qe(r,n.length)},k:function(t,n,o){let r=t.getHours();return r===0&&(r=24),n==="ko"?o.ordinalNumber(r,{unit:"hour"}):Qe(r,n.length)},m:function(t,n,o){return n==="mo"?o.ordinalNumber(t.getMinutes(),{unit:"minute"}):On.m(t,n)},s:function(t,n,o){return n==="so"?o.ordinalNumber(t.getSeconds(),{unit:"second"}):On.s(t,n)},S:function(t,n){return On.S(t,n)},X:function(t,n,o){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(n){case"X":return Id(r);case"XXXX":case"XX":return to(r);case"XXXXX":case"XXX":default:return to(r,":")}},x:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"x":return Id(r);case"xxxx":case"xx":return to(r);case"xxxxx":case"xxx":default:return to(r,":")}},O:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+zd(r,":");case"OOOO":default:return"GMT"+to(r,":")}},z:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+zd(r,":");case"zzzz":default:return"GMT"+to(r,":")}},t:function(t,n,o){const r=Math.trunc(+t/1e3);return Qe(r,n.length)},T:function(t,n,o){return Qe(+t,n.length)}};function zd(t,n=""){const o=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),s=r%60;return s===0?o+String(a):o+String(a)+n+Qe(s,2)}function Id(t,n){return t%60===0?(t>0?"-":"+")+Qe(Math.abs(t)/60,2):to(t,n)}function to(t,n=""){const o=t>0?"-":"+",r=Math.abs(t),a=Qe(Math.trunc(r/60),2),s=Qe(r%60,2);return o+a+n+s}const Rd=(t,n)=>{switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},Ld=(t,n)=>{switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},Xx={p:Ld,P:(t,n)=>{const o=t.match(/(P+)(p+)?/)||[],r=o[1],a=o[2];if(!a)return Rd(t,n);let s;switch(r){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",Rd(r,n)).replace("{{time}}",Ld(a,n))}},Kx=/^D+$/,Yx=/^Y+$/,Jx=["D","DD","YY","YYYY"];function Qx(t){return Kx.test(t)}function Zx(t){return Yx.test(t)}function ek(t,n,o){const r=tk(t,n,o);if(console.warn(r),Jx.includes(t))throw new RangeError(r)}function tk(t,n,o){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${r} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const nk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ok=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,rk=/^'([^]*?)'?$/,ak=/''/g,sk=/[a-zA-Z]/;function $d(t,n,o){var u,f,h,m;const r=ta(),a=r.locale??Td,s=r.firstWeekContainsDate??((f=(u=r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,i=r.weekStartsOn??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=Qt(t,o==null?void 0:o.in);if(!fx(l))throw new RangeError("Invalid time value");let c=n.match(ok).map(g=>{const k=g[0];if(k==="p"||k==="P"){const y=Xx[k];return y(g,a.formatLong)}return g}).join("").match(nk).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const k=g[0];if(k==="'")return{isToken:!1,value:ik(g)};if(Fd[k])return{isToken:!0,value:g};if(k.match(sk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return c.map(g=>{if(!g.isToken)return g.value;const k=g.value;(Zx(k)||Qx(k))&&ek(k,n,String(t));const y=Fd[k[0]];return y(l,k,a.localize,d)}).join("")}function ik(t){const n=t.match(rk);return n?n[1].replace(ak,"'"):t}const lk={lessThanXSeconds:{one:"kurang dari 1 detik",other:"kurang dari {{count}} detik"},xSeconds:{one:"1 detik",other:"{{count}} detik"},halfAMinute:"setengah menit",lessThanXMinutes:{one:"kurang dari 1 menit",other:"kurang dari {{count}} menit"},xMinutes:{one:"1 menit",other:"{{count}} menit"},aboutXHours:{one:"sekitar 1 jam",other:"sekitar {{count}} jam"},xHours:{one:"1 jam",other:"{{count}} jam"},xDays:{one:"1 hari",other:"{{count}} hari"},aboutXWeeks:{one:"sekitar 1 minggu",other:"sekitar {{count}} minggu"},xWeeks:{one:"1 minggu",other:"{{count}} minggu"},aboutXMonths:{one:"sekitar 1 bulan",other:"sekitar {{count}} bulan"},xMonths:{one:"1 bulan",other:"{{count}} bulan"},aboutXYears:{one:"sekitar 1 tahun",other:"sekitar {{count}} tahun"},xYears:{one:"1 tahun",other:"{{count}} tahun"},overXYears:{one:"lebih dari 1 tahun",other:"lebih dari {{count}} tahun"},almostXYears:{one:"hampir 1 tahun",other:"hampir {{count}} tahun"}},ck=(t,n,o)=>{let r;const a=lk[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"dalam waktu "+r:r+" yang lalu":r},dk={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},uk={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},fk={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},hk={date:yo({formats:dk,defaultWidth:"full"}),time:yo({formats:uk,defaultWidth:"full"}),dateTime:yo({formats:fk,defaultWidth:"full"})},mk={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},pk=(t,n,o,r)=>mk[t],gk={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},bk={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},yk={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agt","Sep","Okt","Nov","Des"],wide:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"]},xk={narrow:["M","S","S","R","K","J","S"],short:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],abbreviated:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],wide:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},kk={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},wk={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},Ck={ordinalNumber:(t,n)=>"ke-"+Number(t),era:sn({values:gk,defaultWidth:"wide"}),quarter:sn({values:bk,defaultWidth:"wide",argumentCallback:t=>t-1}),month:sn({values:yk,defaultWidth:"wide"}),day:sn({values:xk,defaultWidth:"wide"}),dayPeriod:sn({values:kk,defaultWidth:"wide",formattingValues:wk,defaultFormattingWidth:"wide"})},Ek=/^ke-(\d+)?/i,Bk=/\d+/i,_k={narrow:/^(sm|m)/i,abbreviated:/^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,wide:/^(sebelum masehi|sebelum era umum|masehi|era umum)/i},Sk={any:[/^s/i,/^(m|e)/i]},Vk={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},Ak={any:[/1/i,/2/i,/3/i,/4/i]},Dk={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,wide:/^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i},Nk={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^ma/i,/^ap/i,/^me/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},Mk={narrow:/^[srkjm]/i,short:/^(min|sen|sel|rab|kam|jum|sab)/i,abbreviated:/^(min|sen|sel|rab|kam|jum|sab)/i,wide:/^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i},vk={narrow:[/^m/i,/^s/i,/^s/i,/^r/i,/^k/i,/^j/i,/^s/i],any:[/^m/i,/^sen/i,/^sel/i,/^r/i,/^k/i,/^j/i,/^sa/i]},Pk={narrow:/^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,any:/^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i},Tk={any:{am:/^a/i,pm:/^pm/i,midnight:/^tengah m/i,noon:/^tengah h/i,morning:/pagi/i,afternoon:/siang/i,evening:/sore/i,night:/malam/i}},Ok={ordinalNumber:Pd({matchPattern:Ek,parsePattern:Bk,valueCallback:t=>parseInt(t,10)}),era:ln({matchPatterns:_k,defaultMatchWidth:"wide",parsePatterns:Sk,defaultParseWidth:"any"}),quarter:ln({matchPatterns:Vk,defaultMatchWidth:"wide",parsePatterns:Ak,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ln({matchPatterns:Dk,defaultMatchWidth:"wide",parsePatterns:Nk,defaultParseWidth:"any"}),day:ln({matchPatterns:Mk,defaultMatchWidth:"wide",parsePatterns:vk,defaultParseWidth:"any"}),dayPeriod:ln({matchPatterns:Pk,defaultMatchWidth:"any",parsePatterns:Tk,defaultParseWidth:"any"})},Fk={code:"id",formatDistance:ck,formatLong:hk,formatRelative:pk,localize:Ck,match:Ok,options:{weekStartsOn:1,firstWeekContainsDate:1}},jd={primary:{light:{primary:"hsl(var(--primary))",text:"hsl(var(--primary-foreground))",hover:"hsl(var(--accent))",border:"hsl(var(--border))",range:"#bfdbfe"},dark:{primary:"hsl(var(--primary))",text:"hsl(var(--primary-foreground))",hover:"hsl(var(--accent))",border:"hsl(var(--border))",range:"rgba(30, 58, 138, 0.3)"}},emerald:{light:{primary:"#16a34a",text:"#ffffff",hover:"#dcfce7",border:"#16a34a",range:"#ecfdf5"},dark:{primary:"#22c55e",text:"#0b1220",hover:"#14532d",border:"#22c55e",range:"rgba(6, 78, 59, 0.3)"}},amber:{light:{primary:"#d97706",text:"#ffffff",hover:"#fffbeb",border:"#d97706",range:"#fffbeb"},dark:{primary:"#f59e0b",text:"#0b1220",hover:"#78350f",border:"#f59e0b",range:"rgba(120, 53, 15, 0.3)"}},violet:{light:{primary:"#7c3aed",text:"#ffffff",hover:"#f5f3ff",border:"#7c3aed",range:"#f5f3ff"},dark:{primary:"#8b5cf6",text:"#0b1220",hover:"#2e1065",border:"#8b5cf6",range:"rgba(46, 16, 101, 0.3)"}},destructive:{light:{primary:"hsl(var(--destructive))",text:"hsl(var(--destructive-foreground))",hover:"hsl(var(--destructive) / 0.10)",border:"hsl(var(--destructive))",range:"#fef2f2"},dark:{primary:"hsl(var(--destructive))",text:"hsl(var(--destructive-foreground))",hover:"hsl(var(--destructive) / 0.18)",border:"hsl(var(--destructive))",range:"rgba(127, 29, 29, 0.3)"}}},Wd="dcode-dp-theme-forced";function zk(t,n=Wd){const o=jd[t]??jd.primary,r=`
19
19
  .dp__theme_light {
20
20
  --dp-primary-color: ${o.light.primary} !important;
21
21
  --dp-primary-text-color: ${o.light.text} !important;
@@ -63,17 +63,17 @@
63
63
  .dcode-datepicker-menu .dp__menu_inner {
64
64
  padding: 0 !important;
65
65
  }
66
- `.trim();let a=document.getElementById(n);a||(a=document.createElement("style"),a.id=n,document.head.appendChild(a)),a.textContent=r}function Ik(t,n=Ld){e.watch(t,o=>zk(o,n),{immediate:!0})}const Rk={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Lk=["for"],$k={key:0,class:"ml-1 text-destructive"},jk=["disabled","onClick"],Wk={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},Uk=["id","value","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],Hk={class:"h-full p-2 flex flex-col gap-3 w-32"},qk=["onClick"],Gk={class:"flex items-center justify-end gap-2 w-full p-2"},Xk=["disabled","onClick"],Kk={key:1,class:"text-xs text-destructive"},ta=e.defineComponent({name:"DCodeDatePicker",inheritAttrs:!1,__name:"DCodeDatePicker",props:{modelValue:{},range:{type:Boolean,default:!1},autoRangeDays:{default:null},disablePast:{type:Boolean,default:!1},maxDaysAhead:{default:null},placeholder:{default:"Pilih tanggal"},label:{},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},displayFormat:{default:"dd/MM/yyyy"},modelType:{default:"yyyy-MM-dd"},locale:{default:"en"},placement:{default:"bottom-start"},prependInner:{default:void 0},error:{default:null},selectLabel:{default:"Select"},cancelLabel:{default:"Cancel"},tone:{default:"primary"},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=t,a=n,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`dcode-datepicker-${o.id||r.label||"date-picker"}-${s}`),l=e.computed(()=>{const T=o.required,P=o["aria-required"];return T===""||T===!0||T==="true"||P==="true"||P===!0}),c=e.computed(()=>!!r.error),d=e.computed({get:()=>r.modelValue,set:T=>{a("update:modelValue",T),a("change",T)}}),u=e.computed(()=>r.locale==="en"?Md:Fk),h=e.computed(()=>r.range?2:!1),f=e.computed(()=>{if(!r.range)return!1;const T={partialRange:!1};return r.autoRangeDays&&r.autoRangeDays>0&&(T.maxRange=r.autoRangeDays,T.autoRange=r.autoRangeDays),T}),m=T=>{const P=new Date(T);return P.setHours(0,0,0,0),P},g=T=>{const P=new Date(T);return P.setHours(23,59,59,999),P},b=(T,P)=>{const X=new Date(T);return X.setDate(X.getDate()+P),X},x=e.computed(()=>{if(r.disablePast)return m(new Date)}),p=e.computed(()=>{if(r.maxDaysAhead&&r.maxDaysAhead>0)return g(b(new Date,r.maxDaysAhead))}),C=e.ref(null),w=e.ref(null),E=T=>{w.value={month:T.month,year:T.year}},_=e.ref(!1);let B=null;e.onMounted(()=>{const T=document.documentElement,P=()=>_.value=T.classList.contains("dark");P(),B=new MutationObserver(P),B.observe(T,{attributes:!0,attributeFilter:["class"]})}),e.onBeforeUnmount(()=>{B==null||B.disconnect(),B=null}),Ik(e.toRef(r,"tone"));const k=T=>{const P=new Date(T),X=P.getDay(),$=P.getDate()-X+(X===0?-6:1);return P.setDate($),m(P)},y=T=>{const P=k(T);return P.setDate(P.getDate()+6),g(P)},V=T=>{const P=new Date(T);return P.setDate(1),m(P)},D=T=>{const P=new Date(T);return P.setMonth(P.getMonth()+1),P.setDate(0),g(P)},N=e.computed(()=>{if(!r.range)return[];const T=new Date,P=m(T),X=k(T),$=y(T),G=V(T),ne=D(T),K=(R,j)=>{let se=R;r.disablePast&&se<P&&(se=P);let ee=j;if(r.autoRangeDays&&r.autoRangeDays>0){const Y=g(b(se,r.autoRangeDays-1));ee>Y&&(ee=Y)}return ee<se&&(ee=g(new Date(se))),[se,ee]};return[{label:r.locale==="id"?"Minggu Ini":"This Week",range:K(X,$)},{label:r.locale==="id"?"Bulan Ini":"This Month",range:K(G,ne)}]}),A=async T=>{var j,se;const P=r.modelType||"yyyy-MM-dd";if(T.length===0){d.value=null;return}if(T.length<2)return;const X=Id(T[0],P),$=Id(T[1],P);d.value=[X,$],await e.nextTick();const G=T[0],ne=G.getMonth(),K=G.getFullYear();w.value&&w.value.month===ne&&w.value.year===K||(j=C.value)==null||j.setMonthYear({month:ne,year:K}),(se=C.value)==null||se.openMenu()};return(T,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class])},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Rk)):e.createCommentVNode("",!0),P[2]||(P[2]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",$k,"*")):e.createCommentVNode("",!0)],8,Lk)):e.createCommentVNode("",!0),e.createVNode(e.unref(bu.VueDatePicker),{ref_key:"dpRef",ref:C,modelValue:d.value,"onUpdate:modelValue":P[1]||(P[1]=X=>d.value=X),dark:_.value,range:f.value,"multi-calendars":h.value,disabled:t.disabled,clearable:!1,"text-input":"","enable-time-picker":!1,"time-config":{enableTimePicker:!1},"auto-apply":!1,"action-row":{showPreview:!0,showNow:!1},locale:u.value,"model-type":t.modelType,formats:{input:t.displayFormat},"min-date":x.value,"max-date":p.value,"preset-ranges":N.value,floating:{placement:t.placement,offset:8,arrow:!1,flip:!1,shift:!0},teleport:!0,"menu-class-name":"dcode-datepicker-menu","calendar-class-name":"dcode-datepicker-calendar",onUpdateMonthYear:E},e.createSlots({"dp-input":e.withCtx(({value:X,onInput:$,onEnter:G,onTab:ne,onBlur:K,onFocus:R,onKeypress:j,onPaste:se,toggleMenu:ee})=>[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 overflow-hidden shadow-none transition-all duration-200 focus-within:ring-1 focus-within:ring-neutral-400 dark:focus-within:ring-neutral-600 focus-within:border-neutral-400 dark:focus-within:border-neutral-600",[c.value?"border-destructive":"",t.disabled?"opacity-50 cursor-not-allowed":""]])},[e.createElementVNode("button",{type:"button",tabindex:"-1",disabled:t.disabled,class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none",onClick:Y=>ee()},[e.createVNode(e.unref(ue.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,jk),P[4]||(P[4]=e.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),t.prependInner?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",Wk,e.toDisplayString(t.prependInner),1),P[3]||(P[3]=e.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:i.value,value:X,placeholder:t.placeholder,disabled:t.disabled,autocomplete:"off",readonly:"",class:e.normalizeClass(["flex-1 min-w-0 px-3 h-full bg-transparent text-sm text-foreground dark:text-gray-300 placeholder:text-muted-foreground outline-none",t.disabled?"cursor-not-allowed":"cursor-pointer"]),onClick:Y=>ee(),onFocus:Y=>R(),onBlur:Y=>K(),onInput:Y=>$(Y),onKeydown:[e.withKeys(Y=>G(Y),["enter"]),e.withKeys(Y=>ne(Y),["tab"])],onKeypress:Y=>j(Y),onPaste:Y=>se()},null,42,Uk)],2)]),"action-buttons":e.withCtx(({selectDate:X,selectionDisabled:$})=>[e.createElementVNode("div",Gk,[e.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center rounded-md text-sm font-medium border border-input bg-background hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400",onClick:P[0]||(P[0]=G=>{var ne;return(ne=C.value)==null?void 0:ne.closeMenu()})},e.toDisplayString(t.cancelLabel),1),e.createElementVNode("button",{type:"button",disabled:$,class:"inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400 disabled:pointer-events-none disabled:opacity-50",onClick:G=>X()},e.toDisplayString(t.selectLabel),9,Xk)])]),_:2},[t.range?{name:"left-sidebar",fn:e.withCtx(()=>[e.createElementVNode("div",Hk,[N.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(N.value,X=>(e.openBlock(),e.createElementBlock("button",{key:X.label,type:"button",class:"w-full inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400",onClick:$=>A(X.range)},e.toDisplayString(X.label),9,qk))),128)):e.createCommentVNode("",!0)])]),key:"0"}:void 0]),1032,["modelValue","dark","range","multi-calendars","disabled","locale","model-type","formats","min-date","max-date","preset-ranges","floating"]),c.value?(e.openBlock(),e.createElementBlock("p",Kk,e.toDisplayString(r.error),1)):e.createCommentVNode("",!0)],64))],2))}}),Yk=e.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:n}){const o=t,r=n,a=Ne.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(Ne.DialogRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),Jk=e.defineComponent({inheritAttrs:!1,__name:"DialogContent",props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:n}){const o=t,r=n,a=ft.reactiveOmit(o,"class"),s=Ne.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Ne.DialogPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ne.DialogOverlay),{class:"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),e.createVNode(e.unref(Ne.DialogContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(We)("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",o.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),e.createVNode(e.unref(Ne.DialogClose),{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},{default:e.withCtx(()=>[e.createVNode(e.unref(ue.X),{class:"w-4 h-4"}),l[0]||(l[0]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),Qk=e.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=ft.reactiveOmit(n,"class"),r=Ne.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Ne.DialogDescription),e.mergeProps(e.unref(r),{class:e.unref(We)("text-sm text-muted-foreground",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),Zk=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=ft.reactiveOmit(n,"class"),r=Ne.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Ne.DialogTitle),e.mergeProps(e.unref(r),{class:e.unref(We)("text-lg font-medium leading-none tracking-tight",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),ew={key:0,class:"px-6 py-4 flex items-center justify-between border-b border-neutral-200/60 dark:border-neutral-700/50 bg-white/80 dark:bg-neutral-900/30 backdrop-blur-md sticky top-0 z-20"},tw={class:"flex items-center gap-3"},nw={class:"flex flex-col"},ow={key:0,class:"flex items-center gap-2"},rw={key:1,class:"px-6 py-4 border-t border-neutral-200/60 dark:border-neutral-700/50 bg-neutral-50/50 dark:bg-neutral-900/30 sticky bottom-0 z-20"},aw={class:"flex justify-end gap-3 flex-wrap"},yo=Pt(e.defineComponent({name:"DCodeDialog",inheritAttrs:!1,__name:"DCodeDialog",props:{modelValue:{type:Boolean,default:!1},title:{default:""},icon:{default:""},maxWidth:{default:500},persistent:{type:Boolean,default:!0},contentClass:{default:"p-5"},contentStyle:{default:()=>({})},iconClass:{default:""}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.computed(()=>{const{style:d,...u}=a;return u}),i=e.computed(()=>({maxWidth:typeof o.maxWidth=="number"?`${o.maxWidth}px`:o.maxWidth,width:"100%"})),l=e.computed(()=>o.icon?qt[o.icon]??null:null),c=d=>{r("update:modelValue",d)};return(d,u)=>(e.openBlock(),e.createBlock(e.unref(Yk),{open:t.modelValue,"onUpdate:open":c},{default:e.withCtx(()=>[e.createVNode(e.unref(Jk),e.mergeProps(s.value,{style:i.value,class:"p-0 overflow-hidden rounded-xl flex flex-col max-h-[90vh] bg-white dark:bg-neutral-800 border-0",onInteractOutside:u[0]||(u[0]=h=>t.persistent?h.preventDefault():null),onEscapeKeyDown:u[1]||(u[1]=h=>t.persistent?h.preventDefault():null)}),{default:e.withCtx(()=>[t.title||d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",ew,[e.createElementVNode("div",tw,[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["p-2 rounded-lg",t.iconClass||"bg-primary/10 text-primary"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),{class:"h-5 w-5"}))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",nw,[e.createVNode(e.unref(Zk),{class:"text-lg font-bold text-neutral-900 dark:text-neutral-50 leading-tight"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),e.createVNode(e.unref(Qk),{class:"hidden"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title||"Dialog Content"),1)]),_:1})])]),d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",ow,[e.renderSlot(d.$slots,"header-append",{},void 0,!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex-1 overflow-y-auto custom-scrollbar",t.contentClass]),style:e.normalizeStyle(t.contentStyle)},[e.renderSlot(d.$slots,"default",{},void 0,!0)],6),d.$slots.actions?(e.openBlock(),e.createElementBlock("div",rw,[e.createElementVNode("div",aw,[e.renderSlot(d.$slots,"actions",{},void 0,!0)])])):e.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-52781e0f"]]),xo=e.defineComponent({name:"DCodeLabel",inheritAttrs:!1,__name:"DCodeLabel",props:{label:{},text:{},textSize:{},textType:{},icon:{},iconClass:{}},setup(t){const n=e.useAttrs(),o=t,r=e.computed(()=>o.icon&&qt[o.icon]||null),a=e.computed(()=>o.textSize?`text-${o.textSize}`:"text-xs"),s={xs:"w-3 h-3",sm:"w-3.5 h-3.5",base:"w-4 h-4",lg:"w-5 h-5",xl:"w-5 h-5","2xl":"w-6 h-6","3xl":"w-7 h-7","4xl":"w-8 h-8","5xl":"w-10 h-10","6xl":"w-12 h-12"},i=e.computed(()=>s[o.textSize??"xs"]??"w-3 h-3"),l=e.computed(()=>o.textType==="BOLD"?"font-bold":o.textType==="ITALIC"?"italic font-normal":"font-normal"),c=e.computed(()=>{const u=`${a.value} ${l.value} text-slate-600 ml-1 inline-flex items-center gap-1`,h=n.class??"";return[u,h].filter(Boolean).join(" ")}),d=e.computed(()=>{const{class:u,...h}=n;return h});return(u,h)=>(e.openBlock(),e.createElementBlock("span",e.mergeProps({class:c.value},d.value),[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:e.normalizeClass(["shrink-0",i.value,t.iconClass])},null,8,["class"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label||t.text),1)],16))}}),sw={class:"flex flex-col gap-3 w-full"},iw={key:0,class:"col-span-full flex flex-col gap-2 p-3 bg-white dark:bg-neutral-800 border border-dashed border-slate-200 dark:border-neutral-700/50 rounded-lg opacity-70 pointer-events-none animate-pulse"},lw={class:"flex flex-col items-center justify-center gap-2 py-6 rounded-lg border border-dashed border-slate-300 dark:border-neutral-700/50 bg-slate-50 dark:bg-neutral-900/30 text-slate-400"},cw={key:1,class:"col-span-full flex flex-col items-center justify-center text-center gap-2 px-3 py-8 bg-slate-50 dark:bg-neutral-900/10 border border-slate-200 dark:border-neutral-700/50 rounded-lg opacity-70"},dw={class:"text-sm font-medium text-slate-500"},uw={key:0,class:"flex items-center gap-3 px-3 py-2 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-md"},fw={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},hw=["onClick"],mw=["for","onDrop"],pw={class:"text-xs text-slate-500 dark:text-slate-400"},gw={key:2,class:"text-xs text-slate-400"},bw=["id","disabled","accept","onChange"],Os=e.defineComponent({__name:"DCodeDynamicUploadList",props:{modelValue:{type:Array,default:()=>[]},label:{type:String,default:""},labelID:{type:String,default:"Documents"},labelEN:{type:String,default:"Documents"},endpoint:{type:Object,default:()=>null},endpointReference:{type:Object,default:()=>null},itemTitle:{type:String,default:"name"},itemValue:{type:String,default:"id"},disabled:Boolean,required:Boolean,typeFile:{type:String,default:void 0},sizeFile:{type:Number,default:void 0},items:{type:Array,default:void 0},baseUrl:{type:String,default:void 0}},emits:["update:modelValue","uploaded","success"],setup(t,{emit:n}){const o=t,r=n,{t:a,locale:s}=Rt.useI18n(),i=e.computed(()=>{const p=o.endpoint;if(!(p!=null&&p.apiUrl))return null;let C=p.apiUrl;if(!C.startsWith("http")&&o.baseUrl){const w=o.baseUrl.replace(/\/$/,""),E=C.startsWith("/")?C:`/${C}`;C=`${w}${E}`}return console.log(`[DynamicUploadList] Resolved upload URL: ${C}`),C}),l=e.computed(()=>{const p=c.value.length;return p<=1?"grid-cols-1":p===2?"grid-cols-1 md:grid-cols-2":p===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":p===4?"grid-cols-1 md:grid-cols-2 lg:grid-cols-3":"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}),c=e.ref([]),d=e.ref([]),u=e.ref(new Set),h=e.ref(!0),f=async()=>{var p;if(h.value=!0,o.items!==void 0){c.value=o.items,h.value=!1;return}if(!((p=o.endpointReference)!=null&&p.apiUrl)){h.value=!1;return}try{const{apiUrl:C}=mt(),w=await C(o.endpointReference.apiUrl,o.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(o.items!==void 0){h.value=!1;return}let E=(w==null?void 0:w.data)||w;Array.isArray(E)||(E=[E]),c.value=E}catch(C){console.error("Failed to fetch dynamic document list",C)}finally{h.value=!1}};e.onMounted(()=>{Array.isArray(o.modelValue)&&o.modelValue.length>0&&(d.value=JSON.parse(JSON.stringify(o.modelValue))),f()}),e.watch(()=>o.modelValue,p=>{Array.isArray(p)&&JSON.stringify(p)!==JSON.stringify(d.value)&&(d.value=JSON.parse(JSON.stringify(p)))},{deep:!0}),e.watch(()=>{var p;return(p=o.endpointReference)==null?void 0:p.apiUrl},(p,C)=>{p!==C&&f()}),e.watch(()=>{var p;return(p=o.endpointReference)==null?void 0:p.apiMethod},(p,C)=>{p!==C&&f()}),e.watch(()=>o.items,p=>{c.value=p??[],h.value=!1},{deep:!0,immediate:!0});const m=p=>{const C=p[o.itemValue]||p.id||p.typeDocument;return d.value.find(w=>w.typeDocument===C||w.idDocumentType===C||w[o.itemValue]===C)||null},g=async(p,C,w)=>{var k,y;const E=w.target,_=(k=E.files)==null?void 0:k[0];if(!_)return;const B=p[o.itemValue]||p.id||p.typeDocument;if(!i.value){const V=[...d.value],D=V.findIndex(A=>A.typeDocument===B||A.idDocumentType===B),N={id:null,idDocument:null,idDocumentType:B,filename:_.name,document:_.name,typeDocument:B};D>-1?V[D]={...V[D],...N}:V.push(N),d.value=V,r("update:modelValue",V);return}u.value.add(C);try{const{apiUrl:V}=mt(),D=new FormData;D.append("doc",_),D.append("typeDocument",String(B));const N=await V(i.value,((y=o.endpoint)==null?void 0:y.apiMethod)||"POST",D),A=Array.isArray(N==null?void 0:N.data)?N.data[0]:(N==null?void 0:N.data)||N,T=(A==null?void 0:A.url)||(A==null?void 0:A.document)||_.name,P=(A==null?void 0:A.id)||null,X=(A==null?void 0:A.filename)||(A==null?void 0:A.name)||_.name,$=[...d.value],G=$.findIndex(K=>K.typeDocument===B||K.idDocumentType===B),ne={...A,id:P||(A==null?void 0:A.idDocument)||(A==null?void 0:A.id_document)||null,idDocument:(A==null?void 0:A.idDocument)||P||(A==null?void 0:A.id_document)||null,idDocumentType:B,filename:X,document:T,typeDocument:B};G>-1?$[G]={...$[G],...ne}:$.push(ne),d.value=$,r("update:modelValue",$),r("uploaded",A),r("success",A)}catch(V){console.error("Upload failed",V)}finally{u.value.delete(C),E.value=""}},b=p=>{const C=p[o.itemValue]||p.id||p.typeDocument,w=d.value.filter(E=>E.typeDocument!==C&&E.idDocumentType!==C);d.value=w,r("update:modelValue",w)},x=(p,C,w)=>{var B,k;w.preventDefault();const E=(k=(B=w.dataTransfer)==null?void 0:B.files)==null?void 0:k[0];if(!E)return;g(p,C,{target:{files:[E],value:""}})};return(p,C)=>(e.openBlock(),e.createElementBlock("div",sw,[t.label||t.labelID||t.labelEN?(e.openBlock(),e.createBlock(xo,{key:0,text:t.label||(e.unref(s).toLowerCase().startsWith("en")?t.labelEN:t.labelID),class:"font-semibold text-sm text-slate-700 dark:text-slate-300",required:t.required},null,8,["text","required"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["w-full grid gap-4",l.value])},[c.value.length===0&&h.value?(e.openBlock(),e.createElementBlock("div",iw,[e.createVNode(xo,{text:e.unref(a)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-neutral-300"},null,8,["text"]),e.createElementVNode("div",lw,[e.createVNode(e.unref(ue.Loader2),{class:"w-6 h-6 animate-spin"})])])):c.value.length===0&&!h.value?(e.openBlock(),e.createElementBlock("div",cw,[e.createVNode(e.unref(ue.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),e.createElementVNode("span",dw,e.toDisplayString(e.unref(a)("dynamicUploadList.noDocsRequired")),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(w,E)=>{var _;return e.openBlock(),e.createElementBlock("div",{key:E,class:"flex flex-col gap-2 p-3 bg-white dark:bg-neutral-800 border border-slate-200 dark:border-neutral-700/50 rounded-lg shadow-sm"},[e.createVNode(xo,{text:w[t.itemTitle]||w.name||w.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-neutral-300"},null,8,["text"]),m(w)?(e.openBlock(),e.createElementBlock("div",uw,[e.createVNode(e.unref(ue.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),e.createElementVNode("span",fw,e.toDisplayString(((_=m(w))==null?void 0:_.filename)||e.unref(a)("dynamicUploadList.fileUploaded")),1),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"text-red-400 hover:text-red-600 transition-colors",onClick:B=>b(w)},[e.createVNode(e.unref(ue.X),{class:"w-4 h-4"})],8,hw))])):(e.openBlock(),e.createElementBlock("label",{key:1,for:`dyn-upload-input-${E}`,class:e.normalizeClass(["flex flex-col items-center justify-center gap-2 py-8 rounded-lg border-2 border-dashed transition-colors cursor-pointer",[t.disabled?"border-slate-200 bg-slate-50 cursor-not-allowed opacity-60":"border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-800 hover:border-primary-400 hover:bg-primary-50 dark:hover:bg-primary-900/10",u.value.has(E)?"pointer-events-none opacity-70":""]]),onDragover:C[0]||(C[0]=e.withModifiers(()=>{},["prevent"])),onDrop:B=>!t.disabled&&!u.value.has(E)&&x(w,E,B)},[u.value.has(E)?(e.openBlock(),e.createBlock(e.unref(ue.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(e.openBlock(),e.createBlock(e.unref(ue.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),e.createElementVNode("span",pw,e.toDisplayString(u.value.has(E)?e.unref(a)("dynamicUploadList.uploading"):e.unref(a)("dynamicUploadList.clickOrDrag")),1),t.typeFile?(e.openBlock(),e.createElementBlock("span",gw,e.toDisplayString(t.typeFile),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:`dyn-upload-input-${E}`,type:"file",class:"sr-only",disabled:t.disabled||u.value.has(E),accept:t.typeFile,onChange:B=>g(w,E,B)},null,40,bw)],42,mw))])}),128))],2)]))}}),$d=e.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(t){const n=t,o=e.computed(()=>qt[n.icon]??qt.X);return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Yt),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{size:Number(t.iconSize)},null,8,["size"]))]),_:1}))}}),yw=e.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(We)(e.unref(kw)({variant:t.variant}),n.class)),role:"alert"},[e.renderSlot(o.$slots,"default")],2))}}),xw=e.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(We)("text-sm [&_p]:leading-relaxed",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),kw=xr("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Fs=e.defineComponent({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(We)(e.unref(ww)({variant:t.variant}),n.class))},[e.renderSlot(o.$slots,"default")],2))}}),ww=xr("inline-flex gap-1 items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),zs=e.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(We)("rounded-xl border bg-card text-card-foreground shadow",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Is=e.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(We)("p-6 pt-0",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Rs=e.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(We)("flex flex-col gap-y-1.5 p-6",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Ls=e.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("h3",{class:e.normalizeClass(e.unref(We)("font-medium leading-none tracking-tight",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Cw={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},Ew={class:"flex flex-wrap items-center justify-center gap-2"},Bw=["accept","multiple"],na=Pt(e.defineComponent({name:"DCodeDropzone",__name:"DCodeDropzone",props:{label:{default:"Upload File"},hint:{default:"Drag & drop file di sini atau klik area ini"},accept:{default:"*/*"},maxSizeMb:{default:2},mode:{default:"single"},disabled:{type:Boolean,default:!1},showSelected:{type:Boolean,default:!0},error:{default:null}},emits:["picked","picked:multiple","error"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(null),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);e.computed(()=>o.accept||"file/*");const d=e.computed(()=>o.error??i.value);function u(){var k;o.disabled||(k=a.value)==null||k.click()}function h(k){const y=k/1024,V=y/1024;return V>=1?`${V.toFixed(2)} MB`:y>=1?`${y.toFixed(1)} KB`:`${k} B`}function f(k){var V;if(!k)return"File tidak valid";if((V=o.accept)!=null&&V.includes("image/")&&!k.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const y=(o.maxSizeMb??2)*1024*1024;return k.size>y?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null}function m(k){l.value=k.name,c.value=k.size}function g(k){if(i.value=null,!k.length)return;if(o.mode==="single"){const V=k[0],D=f(V);if(D){i.value=D,r("error",D);return}o.showSelected&&m(V),r("picked",V);return}const y=[];for(const V of k){const D=f(V);if(D){i.value=D,r("error",D);return}y.push(V)}y.length&&(o.showSelected&&m(y[0]),r("picked:multiple",y))}function b(k){const y=k.target,V=Array.from(y.files??[]);g(V),y.value=""}function x(){o.disabled||(s.value=!0)}function p(){o.disabled||(s.value=!0)}function C(){s.value=!1}function w(k){var D,N;if(o.disabled)return;s.value=!1;const y=Array.from(((D=k.dataTransfer)==null?void 0:D.files)??[]),V=(N=o.accept)!=null&&N.includes("image/")?y.filter(A=>A.type.startsWith("image/")):y;g(V)}const E=e.computed(()=>(o.accept||"file/*").split(",").map(k=>k.trim()).filter(Boolean).map(k=>k==="image/*"?"IMAGE":k.replace(/^image\//,"").replace(/^\./,"")).join(", "));e.computed(()=>`${o.maxSizeMb??0}MB`);const _=e.ref(!1),B=e.computed(()=>{if(o.disabled||!_.value)return{};const k=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark");return{borderColor:k?"hsl(var(--primary) / 0.5)":"hsl(var(--primary) / 0.6)",backgroundColor:k?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"}});return(k,y)=>(e.openBlock(),e.createBlock(e.unref(zs),{class:e.normalizeClass([t.disabled?"opacity-60":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(e.unref(Rs),{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ls),{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1})]),_:1}),e.createVNode(e.unref(Is),{class:"pt-2"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["d-dropzone-area flex justify-center items-center rounded-xl border-2 border-dashed transition cursor-pointer select-none",[s.value?"is-dragging border-primary bg-primary/10 dark:bg-primary/20 -translate-y-[1px]":"border-border dark:border-neutral-700 bg-muted/30 dark:bg-neutral-800/50",t.disabled?"is-disabled":""]]),style:e.normalizeStyle([{minHeight:"190px"},B.value]),onClick:u,onDragenter:e.withModifiers(x,["prevent"]),onDragover:e.withModifiers(p,["prevent"]),onDragleave:e.withModifiers(C,["prevent"]),onDrop:e.withModifiers(w,["prevent"]),onMouseenter:y[0]||(y[0]=V=>_.value=!0),onMouseleave:y[1]||(y[1]=V=>_.value=!1)},[e.createElementVNode("div",Cw,[y[2]||(y[2]=e.createElementVNode("div",{class:"text-sm font-medium dark:text-neutral-200"},"Drag & drop file di sini",-1)),y[3]||(y[3]=e.createElementVNode("div",{class:"text-xs text-muted-foreground dark:text-neutral-400"},"atau klik area ini untuk memilih file",-1)),e.createElementVNode("div",Ew,[e.createVNode(e.unref(Fs),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Allowed: "+e.toDisplayString(E.value),1)]),_:1}),e.createVNode(e.unref(Fs),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Max: "+e.toDisplayString(o.maxSizeMb)+"MB ",1)]),_:1})]),t.showSelected&&l.value?(e.openBlock(),e.createBlock(e.unref(Fs),{key:0,variant:"secondary",class:"mt-2 dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value)+" • "+e.toDisplayString(c.value?h(c.value):""),1)]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("input",{ref_key:"fileInputEl",ref:a,type:"file",class:"hidden",accept:t.accept,multiple:t.mode==="multiple",onChange:b},null,40,Bw)],38),d.value?(e.openBlock(),e.createBlock(e.unref(yw),{key:0,variant:"destructive",class:"mt-3"},{default:e.withCtx(()=>[e.createVNode(e.unref(xw),{class:"text-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"]))}}),[["__scopeId","data-v-d8943808"]]),_w={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Sw=["src"],Aw={key:1,class:"h-full w-full flex flex-col items-center justify-center text-muted-foreground dark:text-neutral-400 gap-2 p-4 text-center"},Vw={class:"space-y-0.5"},Dw={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},Nw={class:"text-xs opacity-70"},Mw=["disabled"],vw={key:1},Pw=["disabled"],Tw={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},Ow={class:"flex gap-2"},Fw={class:"font-medium truncate"},zw={class:"flex gap-2"},Iw={class:"font-medium"},Rw={class:"flex gap-2"},Lw={class:"font-medium truncate"},$s=Pt(e.defineComponent({name:"DCodeFileResult",__name:"DCodeFileResult",props:{file:{},title:{default:"File Terpilih"},description:{default:""},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:220},showEdit:{type:Boolean,default:!0},showReplace:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0},forceFileIcon:{type:Boolean,default:!1}},emits:["edit","replace","remove"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(null),s=e.computed(()=>o.forceFileIcon||!o.file?!1:(o.file.type||"").startsWith("image/"));e.watch(()=>o.file,m=>{a.value&&URL.revokeObjectURL(a.value),a.value=m?URL.createObjectURL(m):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),u&&u.disconnect()});function i(m){const g=m/1024,b=g/1024;return b>=1?`${b.toFixed(2)} MB`:g>=1?`${g.toFixed(1)} KB`:`${m} B`}const l=e.computed(()=>o.file?{name:o.file.name,size:i(o.file.size),type:o.file.type||"unknown"}:null),c=e.ref(!1),d=e.ref(!1);let u=null;const h=()=>{typeof document<"u"&&(d.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{h(),typeof document<"u"&&(u=new MutationObserver(h),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),u.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const f=e.computed(()=>o.disabled||!c.value?{}:{borderColor:d.value?"hsl(var(--primary) / 0.4)":"hsl(var(--primary) / 0.5)",backgroundColor:d.value?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"});return(m,g)=>t.file?(e.openBlock(),e.createBlock(zs,{key:0,class:e.normalizeClass([t.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(Rs,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(Ls,{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createElementBlock("div",_w,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Is,{class:"pt-2"},{default:e.withCtx(()=>{var b,x,p,C,w;return[e.createElementVNode("div",{class:"d-result-preview-wrap relative rounded-xl overflow-hidden border-2 border-dashed transition-colors duration-200 bg-muted dark:bg-neutral-900/30 border-border dark:border-neutral-700/50 w-full",style:e.normalizeStyle([{height:`${t.previewHeight}px`},f.value]),onMouseenter:g[2]||(g[2]=E=>c.value=!0),onMouseleave:g[3]||(g[3]=E=>c.value=!1)},[s.value&&a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Sw)):(e.openBlock(),e.createElementBlock("div",Aw,[e.createVNode(e.unref(ue.FileText),{class:"w-10 h-10"}),e.createElementVNode("div",Vw,[e.createElementVNode("p",Dw,e.toDisplayString((b=l.value)==null?void 0:b.name),1),e.createElementVNode("p",Nw,e.toDisplayString((x=l.value)==null?void 0:x.size),1)])])),e.createElementVNode("div",{class:"d-action-buttons",style:e.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:c.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:c.value?"auto":"none"})},[t.showEdit&&s.value?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:t.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:g[0]||(g[0]=E=>r("edit"))},[e.createVNode(e.unref(ue.Pencil),{style:{width:"16px",height:"16px"}})],12,Mw)):(e.openBlock(),e.createElementBlock("div",vw)),t.showRemove?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:t.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:g[1]||(g[1]=E=>r("remove"))},[e.createVNode(e.unref(ue.Trash2),{style:{width:"16px",height:"16px"}})],12,Pw)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"d-metadata-overlay",style:e.normalizeStyle({position:"absolute",left:"8px",bottom:"8px",zIndex:10,display:"inline-block",maxWidth:"calc(100% - 16px)",borderRadius:"12px",border:"1px solid rgba(0,0,0,0.1)",padding:"8px 12px",boxShadow:"0 10px 15px -3px rgba(0,0,0,0.1)",backdropFilter:"blur(8px)",transition:"all 0.2s ease-in-out",opacity:c.value?1:0,transform:c.value?"translateY(0) scale(1)":"translateY(4px) scale(0.99)",backgroundColor:d.value?"rgba(38, 38, 38, 0.8)":"rgba(255, 255, 255, 0.8)",color:d.value?"#e5e5e5":"#171717"})},[e.createElementVNode("div",Tw,[e.createElementVNode("div",Ow,[g[4]||(g[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",Fw,e.toDisplayString((p=l.value)==null?void 0:p.name),1)]),e.createElementVNode("div",zw,[g[5]||(g[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",Iw,e.toDisplayString((C=l.value)==null?void 0:C.size),1)]),e.createElementVNode("div",Rw,[g[6]||(g[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",Lw,e.toDisplayString((w=l.value)==null?void 0:w.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-bb5c9599"]]);function js(){const t=s=>{var c;const i={type:s.type||"info",title:s.title,message:s.message,duration:s.duration??3e3};typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:toast",{detail:i,bubbles:!0,composed:!0})),(i.type==="error"?console.error:i.type==="warning"?console.warn:console.log)(`[Toast][${(c=i.type)==null?void 0:c.toUpperCase()}]`,i.title||"",i.message)};return{show:t,success:(s,i)=>t({type:"success",message:s,title:i}),error:(s,i)=>t({type:"error",message:s,title:i}),warning:(s,i)=>t({type:"warning",message:s,title:i}),info:(s,i)=>t({type:"info",message:s,title:i})}}const $w={class:"space-y-3"},jw={key:1,class:"flex items-center justify-center p-6 border rounded-lg bg-muted/30 dark:bg-neutral-800/20 dark:border-neutral-800"},jd=e.defineComponent({name:"DCodeFileField",inheritAttrs:!1,__name:"DCodeFileField",props:{modelValue:{default:null},label:{default:"Upload File"},hint:{},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:void 0},allowedTypes:{default:null},accept:{default:"*/*"},minSizeMb:{default:null},maxSizeMb:{default:1},endpoint:{},uploadFn:{}},emits:["update:modelValue","error","uploaded"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:B=>r("update:modelValue",B)}),s=e.ref(null),i=e.ref(null);function l(B){i.value=B,r("error",B)}function c(){i.value=null}const d=e.computed(()=>{const B=(o.allowedTypes??"").trim();return B?B.split(/[,\s;]+/g).map(y=>y.trim().toLowerCase()).filter(Boolean).map(y=>y.includes("/")||y.startsWith(".")?y:`.${y}`):[]});function u(B){const k=B.lastIndexOf(".");return k>=0?B.slice(k).toLowerCase():""}const h=e.computed(()=>{if(d.value.length){const B=d.value.filter(y=>y.startsWith("."));return[...d.value.filter(y=>y.includes("/")),...B].join(",")}return o.accept}),f=e.computed(()=>d.value.length?d.value.join(", "):o.accept||"Semua File");function m(B){if(d.value.length){const k=(B.type||"").toLowerCase(),y=u(B.name);return d.value.some(V=>V.includes("/")?k===V:V.startsWith(".")?y===V:y===`.${V}`)}if(o.accept){if(o.accept==="*/*")return!0;const k=o.accept.split(",").map(D=>D.trim().toLowerCase()),y=(B.type||"").toLowerCase(),V=u(B.name);return k.some(D=>{if(D.endsWith("/*")){const N=D.slice(0,-2);return y.startsWith(N)}return D.startsWith(".")?V===D:y===D})}return!0}function g(B){return B*1024*1024}async function b(B){return B?m(B)?o.minSizeMb!=null&&B.size<g(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&B.size>g(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${f.value}`:"File tidak valid"}const{DCodeApi:x}=mt(),p=js(),C=e.ref(!1);async function w(B){var k;if(o.uploadFn){try{C.value=!0;const y=await o.uploadFn(B);a.value=B,r("uploaded",y)}catch(y){console.error("Upload Error",y),p.error("Upload Failed",(y==null?void 0:y.message)||"Unknown error"),l((y==null?void 0:y.message)||"Upload Failed")}finally{C.value=!1}return}if(!((k=o.endpoint)!=null&&k.apiUrl)){a.value=B;return}if(typeof x!="function"){l("useApi() must expose DCodeApi()");return}try{C.value=!0;const y=new FormData;y.append("doc",B);const V=(o.endpoint.apiMethod||"POST").toUpperCase(),D=o.endpoint.apiUrl,N=await x("","",y,{_url:D,_method:V,withCredentials:!0,transformRequest:[(T,P)=>(P&&(delete P["Content-Type"],delete P["content-type"]),T)]}),A=(N==null?void 0:N.data)??N;a.value=B,r("uploaded",A)}catch(y){console.error("Upload Error",y),p.error("Upload Failed",(y==null?void 0:y.message)||"Unknown error"),l((y==null?void 0:y.message)||"Upload Failed")}finally{C.value=!1}}async function E(B){var y;if(o.disabled)return;c();const k=await b(B);if(k){l(k);return}s.value=B,o.uploadFn||(y=o.endpoint)!=null&&y.apiUrl?await w(B):a.value=B}function _(){c(),a.value=null,s.value=null}return e.watch(()=>o.modelValue,B=>{B&&!s.value&&(s.value=B),B||(s.value=null)},{immediate:!0}),(B,k)=>(e.openBlock(),e.createElementBlock("div",$w,[a.value?C.value?(e.openBlock(),e.createElementBlock("div",jw,[...k[1]||(k[1]=[e.createElementVNode("span",{class:"text-sm text-muted-foreground dark:text-neutral-400 animate-pulse"},"Uploading...",-1)])])):(e.openBlock(),e.createBlock($s,{key:2,file:a.value,title:t.label,description:t.hint,disabled:t.disabled,"show-edit":!1,"show-replace":!1,"show-remove":!0,"force-file-icon":!0,"preview-height":t.previewHeight,"preview-width":t.previewWidth,onRemove:_},null,8,["file","title","description","disabled","preview-height","preview-width"])):(e.openBlock(),e.createBlock(na,{key:0,label:t.label,hint:t.hint,accept:h.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled||C.value,onPicked:E,error:i.value,onError:k[0]||(k[0]=y=>l(y))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),Ww=["for"],Uw={key:0,class:"!ml-1 !text-destructive"},Hw={class:"relative w-full block box-border"},qw={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},Gw=["id","readonly","disabled","placeholder"],Xw={class:"absolute inset-y-0 right-4 flex items-center z-10"},Kw={key:1,class:"absolute z-50 mt-1 w-full rounded-xl border bg-white dark:bg-neutral-800 border-neutral-200/60 dark:border-neutral-700/50 shadow-lg box-border"},Yw={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},Jw={key:1,class:"text-sm text-muted-foreground text-center"},Qw=["onClick","title"],Zw={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},e1={class:"flex items-center justify-center flex-1"},t1={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},n1={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},Wd=e.defineComponent({name:"DCodeIconDropdown",__name:"DCodeIconDropdown",props:{modelValue:{},label:{},placeholder:{default:"Pilih icon…"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},columns:{default:4},maxHeight:{default:"335px"},iconSize:{default:20},pageSize:{default:120}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=t,r=n,a=qt,s=e.ref(null),i=e.ref(null),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-icon-dropdown-${o.label||"icon-dropdown"}-${l}`),d=e.ref(!1),u=e.computed(()=>(o.modelValue??"").trim()||""),h=e.ref(""),f=e.ref(!1),m=e.ref(!1),g=e.ref(!1),b=e.shallowRef([]),x=e.ref(o.pageSize),p=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),C=async()=>{if(m.value||g.value)return;g.value=!0,await new Promise(j=>setTimeout(j,0));const R=Object.keys(a).filter(j=>!p.has(j)).filter(j=>/^[A-Z]/.test(j)).filter(j=>typeof a[j]=="function"||typeof a[j]=="object"&&a[j]).sort((j,se)=>j.localeCompare(se));b.value=R,m.value=!0,g.value=!1},w=e.computed(()=>!m.value||!u.value||!b.value.includes(u.value)?null:a[u.value]),E=e.ref(u.value),_=e.computed(()=>!!u.value&&!d.value),B=e.computed(()=>{if(!m.value)return[];const R=(h.value??"").trim().toLowerCase();return R?b.value.filter(j=>j.toLowerCase().includes(R)):b.value}),k=e.computed(()=>B.value.slice(0,x.value)),y=e.computed(()=>{const R=o.columns;return R<=2?"grid-cols-2":R===3?"grid-cols-3":R===4?"grid-cols-4":R===5?"grid-cols-5":R>=8?"grid-cols-8":"grid-cols-6"});e.computed(()=>o.clearable?"!pr-10":"!pr-3"),e.computed(()=>w.value&&!d.value?"!pl-12":"!pl-3");const V=async()=>{var R;await e.nextTick(),(R=i.value)==null||R.focus()},D=async R=>{if(o.disabled)return;const j=R!==!1;if(f.value){f.value=!1;return}d.value=!0,await C(),j&&(h.value="",E.value=""),x.value=o.pageSize,await V()},N=()=>{d.value=!1,h.value="",E.value=u.value,x.value=o.pageSize},A=async()=>{o.disabled||(d.value?N():await D())};let T=null;const P=async R=>{if(o.disabled)return;r("update:modelValue",null),d.value||await D(!1),T&&clearTimeout(T);const j=E.value;T=setTimeout(()=>{h.value=j},300)},X=R=>{o.disabled||(r("update:modelValue",R),N(),queueMicrotask(()=>{var j;return(j=i.value)==null?void 0:j.blur()}))},$=()=>{o.disabled||(r("update:modelValue",null),r("clear"),f.value=!0,N(),queueMicrotask(()=>{var R;return(R=i.value)==null?void 0:R.focus()}))},G=R=>{if(R.key==="Escape"){R.preventDefault(),N();return}if(R.key==="Enter"&&d.value){const j=B.value[0];j&&(R.preventDefault(),X(j))}},ne=R=>{if(!d.value)return;const j=R.target;s.value&&!s.value.contains(j)&&N()},K=R=>{const j=R.target;j.scrollTop+j.clientHeight>=j.scrollHeight-24&&x.value<B.value.length&&(x.value=Math.min(x.value+o.pageSize,B.value.length))};return e.onMounted(()=>{document.addEventListener("mousedown",ne),queueMicrotask(()=>{var R;i.value=((R=s.value)==null?void 0:R.querySelector("input"))??null}),u.value&&C()}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",ne),T&&clearTimeout(T)}),e.watch(u,R=>{d.value||(E.value=R)}),e.watch(()=>h.value,()=>{x.value=o.pageSize}),(R,j)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:s,class:"!w-full !block !box-border"},[o.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"!text-sm !font-medium !mb-1 !block"},[e.createTextVNode(e.toDisplayString(o.label)+" ",1),o.required?(e.openBlock(),e.createElementBlock("span",Uw,"*")):e.createCommentVNode("",!0)],8,Ww)):e.createCommentVNode("",!0),e.createElementVNode("div",Hw,[w.value&&!d.value?(e.openBlock(),e.createElementBlock("div",qw,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(w.value),{size:18}))])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{id:c.value,"onUpdate:modelValue":j[0]||(j[0]=se=>E.value=se),readonly:_.value,disabled:o.disabled,placeholder:o.placeholder,class:e.normalizeClass(["w-full h-10 m-0 py-0 rounded-lg border bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 pr-10 outline-none box-border truncate",[w.value&&!d.value?"pl-10":"pl-4",_.value?"cursor-pointer select-none":""]]),onClick:D,onFocus:D,onInput:P,onKeydown:G},null,42,Gw),[[e.vModelText,E.value]]),e.createElementVNode("div",Xw,[o.clearable&&u.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center p-1 m-0 bg-transparent border-0 text-muted-foreground hover:text-foreground transition cursor-pointer outline-none",onMousedown:j[1]||(j[1]=e.withModifiers(()=>{},["prevent"])),onClick:$,title:"Clear"},[e.createVNode(e.unref(ue.X),{class:"h-4 w-4"})],32)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"flex items-center justify-center p-1 m-0 bg-transparent border-0 text-muted-foreground hover:text-foreground transition-transform cursor-pointer outline-none",onMousedown:j[2]||(j[2]=e.withModifiers(()=>{},["prevent"])),onClick:A,title:"Open"},[e.createVNode(e.unref(ue.ChevronDown),{class:"h-4 w-4"})],32))]),d.value?(e.openBlock(),e.createElementBlock("div",Kw,[e.createElementVNode("div",{class:"p-2 overflow-auto",style:e.normalizeStyle({maxHeight:o.maxHeight}),onScroll:K},[g.value?(e.openBlock(),e.createElementBlock("div",Yw,[e.createVNode(e.unref(ue.Loader2),{class:"h-4 w-4 animate-spin"}),j[3]||(j[3]=e.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):m.value&&B.value.length===0?(e.openBlock(),e.createElementBlock("div",Jw," Icon tidak ditemukan ")):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["grid gap-2",y.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,se=>(e.openBlock(),e.createElementBlock("button",{key:se,type:"button",class:e.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===se?"ring-1 ring-primary":""]),onClick:ee=>X(se),title:se},[e.createElementVNode("div",Zw,[e.createElementVNode("div",e1,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)[se]),{size:o.iconSize,class:"shrink-0"},null,8,["size"]))]),e.createElementVNode("span",t1,e.toDisplayString(se),1)])],10,Qw))),128))],2)),m.value&&B.value.length>0?(e.openBlock(),e.createElementBlock("div",n1," Showing "+e.toDisplayString(k.value.length)+" / "+e.toDisplayString(B.value.length),1)):e.createCommentVNode("",!0)],36)])):e.createCommentVNode("",!0)])],512))}}),o1={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},r1={class:"flex items-center justify-between border-b dark:border-neutral-700/50 px-6 py-4"},a1={class:"relative overflow-auto p-0"},Ws=e.defineComponent({name:"DCodeImageCropperDialog",inheritAttrs:!1,__name:"DCodeImageCropperDialog",props:{modelValue:{type:Boolean},file:{},title:{default:"Resize & Crop Gambar"},description:{default:""},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!1}},emits:["update:modelValue","done","cancel"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:w=>r("update:modelValue",w)}),s=e.ref(null),i=e.ref(null);let l=null,c=!1,d=0,u=null;function h(){if(l){try{l.close()}catch{}l=null,u&&(u.disconnect(),u=null),s.value&&(s.value.innerHTML=""),i.value=null}}async function f(w,E,_,B,k){const y=await new Promise((N,A)=>{const T=URL.createObjectURL(w),P=new Image;P.onload=()=>{URL.revokeObjectURL(T),N(P)},P.onerror=X=>{URL.revokeObjectURL(T),A(X)},P.src=T}),V=document.createElement("canvas");V.width=E,V.height=_;const D=V.getContext("2d");return D?(D.drawImage(y,0,0,E,_),await new Promise(N=>{V.toBlob(A=>N(A||w),B,k)})):w}function m(){if(!l||!i.value)return;const w=l.getPlugin("Dashboard"),E=l.getFile(i.value);!w||!E||requestAnimationFrame(()=>{try{w.openFileEditor(E)}catch{try{w.openFileEditor(i.value)}catch{}}})}async function g(w){if(l){l.cancelAll(),i.value=null;try{const E=l.addFile({name:w.name,type:w.type,data:w,source:"Local",isRemote:!1});i.value=String(E)}catch{}}}function b(){if(!s.value)return;l&&h(),l=new yu({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const w=document.documentElement.classList.contains("dark");l.use(di,{target:s.value,inline:!0,height:480,theme:w?"dark":"light",proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),u=new MutationObserver(()=>{if(!l)return;const E=document.documentElement.classList.contains("dark"),_=l.getPlugin("Dashboard");_&&_.setOptions({theme:E?"dark":"light"})}),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(xu,{target:di,quality:o.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:o.aspectRatio==null?Number.NaN:o.aspectRatio}}),l.on("file-editor:cancel",()=>{a.value=!1}),l.on("file-added",E=>{i.value=(E==null?void 0:E.id)??null,o.autoOpenEditor&&setTimeout(()=>m(),80)}),l.on("file-editor:complete",async E=>{const _=++d;try{const B=E.data,k=B.type||E.type||"image/jpeg";let y=B;if(o.outputWidth&&o.outputHeight&&(y=await f(B,o.outputWidth,o.outputHeight,k,o.quality)),c||_!==d)return;const V=E.name||"edited-image.jpg",D=new File([y],V,{type:k});await x(D,"UPPY_EDITOR_COMPLETE"),r("done",D),a.value=!1}catch{}})}async function x(w,E="CROP_RESULT"){const _=URL.createObjectURL(w);try{const B=await new Promise((k,y)=>{const V=new Image;V.onload=()=>k(V),V.onerror=y,V.src=_});console.group(E),console.log("file:",w),console.table({name:w.name,type:w.type,sizeBytes:w.size,sizeMB:+(w.size/1024/1024).toFixed(3),width:B.naturalWidth,height:B.naturalHeight,ratio:+(B.naturalWidth/B.naturalHeight).toFixed(4)}),console.log("previewUrl:",_),console.groupEnd()}finally{URL.revokeObjectURL(_)}}e.watch(a,async w=>{c=!w,d++,w?(await e.nextTick(),b(),o.file&&await g(o.file)):h()},{flush:"post"}),e.watch(()=>o.file,async w=>{a.value&&w&&(await e.nextTick(),await g(w))}),e.onBeforeUnmount(()=>{c=!0,d++,h()});const p=w=>{w.key==="Escape"&&a.value&&(a.value=!1)};e.watch(a,w=>{w?globalThis.addEventListener("keydown",p):globalThis.removeEventListener("keydown",p)},{immediate:!0});const C=e.ref(!1);return(w,E)=>a.value?(e.openBlock(),e.createElementBlock("div",o1,[e.createVNode(e.Transition,{appear:"","enter-active-class":"duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:E[0]||(E[0]=_=>a.value=!1)})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{appear:"","enter-active-class":"duration-300 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to-class":"opacity-100 scale-100 translate-y-0 sm:scale-100","leave-active-class":"duration-200 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0 sm:scale-100","leave-to-class":"opacity-0 scale-95 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative flex w-fit max-w-4xl flex-col overflow-hidden rounded-xl border border-border dark:border-neutral-700/50 bg-background dark:bg-neutral-800 shadow-2xl transition-all",onClick:E[4]||(E[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",r1,[E[6]||(E[6]=e.createElementVNode("h3",{class:"text-lg font-semibold leading-none tracking-tight dark:text-neutral-100"}," Crop & Resize ",-1)),e.createElementVNode("button",{class:"d-close-btn rounded-sm dark:text-neutral-400 ring-offset-background transition-opacity focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",style:e.normalizeStyle({opacity:C.value?1:.7}),onClick:E[1]||(E[1]=_=>a.value=!1),onMouseenter:E[2]||(E[2]=_=>C.value=!0),onMouseleave:E[3]||(E[3]=_=>C.value=!1)},[e.createVNode(e.unref(ue.X),{class:"h-4 w-4"}),E[5]||(E[5]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),e.createElementVNode("div",a1,[e.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)}}),s1={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},i1=["src"],l1=["disabled"],c1=["disabled"],d1={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},u1={class:"flex gap-2"},f1={class:"font-medium truncate"},h1={class:"flex gap-2"},m1={class:"font-medium"},p1={class:"flex gap-2"},g1={class:"font-medium truncate"},Us=Pt(e.defineComponent({name:"DCodeImageResult",__name:"DCodeImageResult",props:{file:{},title:{default:"Hasil Gambar"},description:{default:""},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:220},showEdit:{type:Boolean,default:!0},showReplace:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0}},emits:["edit","replace","remove"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(null);e.watch(()=>o.file,f=>{a.value&&URL.revokeObjectURL(a.value),a.value=f?URL.createObjectURL(f):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),d&&d.disconnect()});function s(f){const m=f/1024,g=m/1024;return g>=1?`${g.toFixed(2)} MB`:m>=1?`${m.toFixed(1)} KB`:`${f} B`}const i=e.computed(()=>o.file?{name:o.file.name,size:s(o.file.size),type:o.file.type||"unknown"}:null),l=e.ref(!1),c=e.ref(!1);let d=null;const u=()=>{typeof document<"u"&&(c.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{u(),typeof document<"u"&&(d=new MutationObserver(u),d.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),d.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const h=e.computed(()=>o.disabled||!l.value?{}:{borderColor:c.value?"hsl(var(--primary) / 0.4)":"hsl(var(--primary) / 0.5)",backgroundColor:c.value?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"});return(f,m)=>t.file?(e.openBlock(),e.createBlock(zs,{key:0,class:e.normalizeClass([t.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(Rs,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(Ls,{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createElementBlock("div",s1,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Is,{class:"pt-2"},{default:e.withCtx(()=>{var g,b,x;return[e.createElementVNode("div",{class:"d-result-preview-wrap relative rounded-xl overflow-hidden border-2 border-dashed transition-colors duration-200 bg-muted dark:bg-neutral-900/30 border-border dark:border-neutral-700/50 w-full",style:e.normalizeStyle([{height:`${t.previewHeight}px`},h.value]),onMouseenter:m[2]||(m[2]=p=>l.value=!0),onMouseleave:m[3]||(m[3]=p=>l.value=!1)},[a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,i1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"d-action-buttons",style:e.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:l.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:l.value?"auto":"none"})},[t.showEdit?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:t.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:m[0]||(m[0]=p=>r("edit"))},[e.createVNode(e.unref(ue.Pencil),{style:{width:"16px",height:"16px"}})],12,l1)):e.createCommentVNode("",!0),t.showRemove?(e.openBlock(),e.createElementBlock("button",{key:1,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:t.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:m[1]||(m[1]=p=>r("remove"))},[e.createVNode(e.unref(ue.Trash2),{style:{width:"16px",height:"16px"}})],12,c1)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"d-metadata-overlay",style:e.normalizeStyle({position:"absolute",left:"8px",bottom:"8px",zIndex:10,display:"inline-block",maxWidth:"calc(100% - 16px)",borderRadius:"12px",border:"1px solid rgba(0,0,0,0.1)",padding:"8px 12px",boxShadow:"0 10px 15px -3px rgba(0,0,0,0.1)",backdropFilter:"blur(8px)",transition:"all 0.2s ease-in-out",opacity:l.value?1:0,transform:l.value?"translateY(0) scale(1)":"translateY(4px) scale(0.99)",backgroundColor:c.value?"rgba(38, 38, 38, 0.8)":"rgba(255, 255, 255, 0.8)",color:c.value?"#e5e5e5":"#171717"})},[e.createElementVNode("div",d1,[e.createElementVNode("div",u1,[m[4]||(m[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",f1,e.toDisplayString((g=i.value)==null?void 0:g.name),1)]),e.createElementVNode("div",h1,[m[5]||(m[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",m1,e.toDisplayString((b=i.value)==null?void 0:b.size),1)]),e.createElementVNode("div",p1,[m[6]||(m[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",g1,e.toDisplayString((x=i.value)==null?void 0:x.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-e1d893ab"]]),b1={class:"space-y-3"},oa=e.defineComponent({name:"DCodeImageField",inheritAttrs:!1,__name:"DCodeImageField",props:{modelValue:{default:null},label:{default:"Upload Gambar"},hint:{default:"Drag & drop atau klik area ini"},disabled:{type:Boolean,default:!1},allowedTypes:{default:null},accept:{default:"image/*"},minSizeMb:{default:null},maxSizeMb:{default:1},title:{default:"Hasil Gambar"},description:{default:""},previewWidth:{default:360},previewHeight:{default:220},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!0},minWidth:{default:null},minHeight:{default:null},maxWidth:{default:null},maxHeight:{default:null},endpoint:{},uploadFn:{},editUseOriginal:{type:Boolean,default:!1}},emits:["update:modelValue","error","uploaded"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:$=>r("update:modelValue",$)}),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);function d($){c.value=$,r("error",$)}function u(){c.value=null}const h=e.computed(()=>{const $=(o.allowedTypes??"").trim();return $?$.split(/[,\s;]+/g).map(ne=>ne.trim().toLowerCase()).filter(Boolean).map(ne=>ne.includes("/")||ne.startsWith(".")?ne:`.${ne}`):[]});function f($){const G=$.lastIndexOf(".");return G>=0?$.slice(G).toLowerCase():""}const m=e.computed(()=>{if(h.value.length){const $=h.value.filter(ne=>ne.startsWith("."));return[...h.value.filter(ne=>ne.includes("/")),...$].join(",")}return o.accept||"image/*"}),g=e.computed(()=>h.value.length?h.value.join(", "):o.accept||"image/*");function b($){if(h.value.length){const ne=($.type||"").toLowerCase(),K=f($.name);return h.value.some(R=>R.includes("/")?ne===R:R.startsWith(".")?K===R:K===`.${R}`)}return(o.accept||"image/*").toLowerCase().includes("image/")?($.type||"").toLowerCase().startsWith("image/"):!0}function x($){return $*1024*1024}async function p($){var G;return(G=$.type)!=null&&G.startsWith("image/")?await new Promise(ne=>{const K=URL.createObjectURL($),R=new Image;R.onload=()=>{URL.revokeObjectURL(K),ne({w:R.naturalWidth,h:R.naturalHeight})},R.onerror=()=>{URL.revokeObjectURL(K),ne(null)},R.src=K}):null}async function C($){if(!(o.minWidth!=null||o.minHeight!=null||o.maxWidth!=null||o.maxHeight!=null))return null;const ne=await p($);return ne?o.minWidth!=null&&ne.w<o.minWidth?`Lebar gambar minimal ${o.minWidth}px`:o.minHeight!=null&&ne.h<o.minHeight?`Tinggi gambar minimal ${o.minHeight}px`:o.maxWidth!=null&&ne.w>o.maxWidth?`Lebar gambar maksimal ${o.maxWidth}px`:o.maxHeight!=null&&ne.h>o.maxHeight?`Tinggi gambar maksimal ${o.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function w($){return $?b($)?o.minSizeMb!=null&&$.size<x(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&$.size>x(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:await C($):`only Allowed: ${g.value}`:"File tidak valid"}function E($){o.disabled||(i.value=$,s.value=!0)}async function _($){if(o.disabled)return;u();const G=await w($);if(G){d(G);return}l.value=$,E($)}const{DCodeApi:B}=mt(),k=js(),y=e.ref(!1);e.ref(null);function V($,G){return!$||!G?null:$.replace(/\/+$/,"")+"/"+G.replace(/^\/+/,"")}function D($){var R;const G=($==null?void 0:$.data)??$,ne=(R=G==null?void 0:G.data)==null?void 0:R[0];if(!ne)return null;const K=V(ne.server,ne.url);return{...ne,fullUrl:K?encodeURI(K):null}}async function N($){var G;if(o.uploadFn){try{y.value=!0;const ne=await o.uploadFn($);a.value=$,r("uploaded",ne)}catch(ne){console.error("Upload Error",ne),k.error("Upload Failed",(ne==null?void 0:ne.message)||"Unknown error"),d((ne==null?void 0:ne.message)||"Upload Failed")}finally{y.value=!1}return}if(!((G=o.endpoint)!=null&&G.apiUrl)){a.value=$;return}if(typeof B!="function"){d("useApi() must expose DCodeApi()");return}try{y.value=!0;const ne=new FormData;ne.append("doc",$);const K=(o.endpoint.apiMethod||"POST").toUpperCase(),R=o.endpoint.apiUrl,j=await B("","",ne,{_url:R,_method:K,withCredentials:!0,transformRequest:[(ee,Y)=>(Y&&(delete Y["Content-Type"],delete Y["content-type"]),ee)]}),se=(j==null?void 0:j.data)??j;D(se),a.value=$,r("uploaded",se)}catch(ne){console.error("Upload Error",ne),k.error("Upload Failed",(ne==null?void 0:ne.message)||"Unknown error"),d((ne==null?void 0:ne.message)||"Upload Failed")}finally{y.value=!1}}async function A($){var G;u(),o.uploadFn||(G=o.endpoint)!=null&&G.apiUrl?await N($):a.value=$,s.value=!1,i.value=null}function T(){s.value=!1,i.value=null}async function P(){if(!a.value)return;u();const $=o.editUseOriginal?l.value??a.value:a.value,G=await w($);if(G){d(G);return}E($)}function X(){u(),a.value=null,i.value=null,s.value=!1,l.value=null}return e.watch(()=>o.modelValue,$=>{$&&!l.value&&(l.value=$),$||(l.value=null)},{immediate:!0}),($,G)=>(e.openBlock(),e.createElementBlock("div",b1,[a.value?(e.openBlock(),e.createBlock(Us,{key:1,file:a.value,title:t.label,description:t.description,"preview-width":t.previewWidth,disabled:t.disabled,"show-edit":!0,"show-remove":!0,"show-replace":!1,onEdit:P,onRemove:X,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(e.openBlock(),e.createBlock(na,{key:0,label:t.label,hint:t.hint,accept:m.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled,onPicked:_,error:c.value,onError:G[0]||(G[0]=ne=>d(ne))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),e.createVNode(Ws,{modelValue:s.value,"onUpdate:modelValue":G[1]||(G[1]=ne=>s.value=ne),file:i.value,title:t.title,description:t.description,"auto-open-editor":t.autoOpenEditor,"aspect-ratio":t.aspectRatio,"output-width":t.outputWidth,"output-height":t.outputHeight,quality:t.quality,onDone:A,onCancel:T},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),y1=["aria-busy"],x1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},k1=["for"],w1={key:0,class:"ml-1 text-destructive"},C1=["id","disabled"],E1={class:"min-w-0 flex-1 text-left"},B1={key:0,class:"flex flex-wrap gap-1.5"},_1={class:"max-w-[220px] truncate"},S1=["onClick"],A1={key:0,class:"inline-flex items-center rounded-md border px-1.5 py-0.5 text-xs font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 border-transparent"},V1={key:1,class:"text-muted-foreground truncate"},D1={class:"flex items-center gap-2 shrink-0"},N1={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},M1=["placeholder","onKeydown"],v1={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},P1=["disabled","onClick"],T1={class:"truncate"},O1={key:0,class:"text-primary-600 dark:text-primary-400"},F1={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},z1={key:0},I1={key:1},R1={key:1,class:"text-xs text-destructive"},Hs=e.defineComponent({name:"DCodeMultiSelect",inheritAttrs:!1,__name:"DCodeMultiSelect",props:{modelValue:{},items:{default:()=>[]},endpoint:{default:void 0},fetchItems:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},refreshOnOpen:{type:Boolean,default:!1},label:{default:""},placeholder:{default:"Pilih data…"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:"Cari…"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},maxChips:{default:5},maxSelected:{default:5},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},returnObject:{type:Boolean,default:!1},virtual:{type:Boolean,default:!0},itemHeight:{default:40},maxRows:{default:5},overscan:{default:6},error:{default:null},required:{type:Boolean,default:!1}},emits:["update:modelValue","clear","max"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>(a.label||o.label)??void 0),i=e.computed(()=>a.visible??!0),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`app-multiselect-${o.id||s.value||"field"}-${l}`),d=e.computed(()=>{if(a.required)return!0;const ae=o.required,fe=o["aria-required"];return ae===""||ae===!0||ae==="true"||(fe==="true"||fe===!0)}),u=e.computed(()=>!!a.error);function h(ae){return ae?typeof a.itemTitle=="function"?a.itemTitle(ae)??"":String((ae==null?void 0:ae[a.itemTitle])??""):""}function f(ae){return ae?typeof a.itemValue=="function"?a.itemValue(ae):ae==null?void 0:ae[a.itemValue]:null}function m(ae,fe){return f(ae)??fe}const g=e.computed(()=>Array.isArray(a.modelValue)?a.modelValue:[]),b=e.computed(()=>{var ae;return!!((ae=a.endpoint)!=null&&ae.apiUrl)||!!a.fetchItems}),x=e.ref([]),p=e.ref(!1),C=e.ref(!1),w=e.computed(()=>{var fe;const ae=(fe=a.endpoint)==null?void 0:fe.apiOptions;if(ae)return typeof ae=="function"?ae():ae}),E=e.computed(()=>{var Te,lt;const ae=((Te=a.endpoint)==null?void 0:Te.apiUrl)??"",fe=(((lt=a.endpoint)==null?void 0:lt.apiMethod)??"GET").toUpperCase(),be=JSON.stringify(w.value??null);return`${fe} ${ae} :: ${be}`}),_=e.computed(()=>b.value?x.value:a.items||[]);async function B(){var ae;if(b.value&&!(!((ae=a.endpoint)!=null&&ae.apiUrl)&&!a.fetchItems)&&!p.value){p.value=!0;try{let fe;if(a.fetchItems){const be=await a.fetchItems(),Te=(be==null?void 0:be.data)??be;fe=(Te==null?void 0:Te.data)??Te}else{const{DCodeApi:be}=mt();if(typeof be!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const Te={page:1,perPage:100,...w.value||{}},lt=await be("","",Te,{_url:a.endpoint.apiUrl,_method:(a.endpoint.apiMethod||"GET").toUpperCase()}),Ut=(lt==null?void 0:lt.data)??lt;fe=(Ut==null?void 0:Ut.data)??Ut}x.value=Array.isArray(fe)?fe:[],C.value=!0}catch(fe){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",fe),x.value=[]}finally{p.value=!1}}}e.watch(()=>E.value,()=>{x.value=[],C.value=!1}),e.onMounted(()=>{a.autoFetchOnMount&&b.value&&B()});const k=e.computed(()=>{const ae=g.value;if(a.returnObject)return ae;const fe=new Map;for(const be of _.value)fe.set(f(be),be);return ae.map(be=>fe.get(be)??{[a.itemValue]:be,[a.itemTitle]:String(be)})}),y=e.computed(()=>a.maxChips===null?k.value:k.value.slice(0,a.maxChips));function V(ae){const fe=g.value;if(a.returnObject){const be=f(ae);return fe.some(Te=>f(Te)===be)}return fe.includes(f(ae))}const D=e.computed(()=>{if(a.maxSelected===null||a.maxSelected===void 0)return null;const ae=Number(a.maxSelected);return Number.isFinite(ae)&&ae>0?ae:null}),N=e.computed(()=>{const ae=D.value;return ae===null?!1:g.value.length>=ae});function A(ae){return!V(ae)&&N.value}const T=e.computed(()=>{const ae=g.value,fe=new Set;if(a.returnObject)for(const be of ae)fe.add(f(be));else for(const be of ae)fe.add(be);return fe}),P=e.computed(()=>{const ae=T.value;return(_.value||[]).filter(fe=>!ae.has(f(fe)))}),X=e.computed(()=>_.value.length===0?!1:P.value.length===0),$=e.ref(null),G=e.ref(null),ne=e.ref(null),K=e.ref(!1),R=e.ref(""),j=e.ref(0),se=e.ref(0),{floatingStyles:ee}=Fa($,G,{whileElementsMounted:Ma,placement:"bottom-start",middleware:[va(8),Ta(),Pa({padding:8}),Oa({apply({rects:ae,elements:fe}){Object.assign(fe.floating.style,{width:`${ae.reference.width}px`,"--floating-width":`${ae.reference.width}px`})}})]}),Y=e.computed(()=>ee.value),le=e.computed(()=>{const ae=Number(a.maxRows);return Number.isFinite(ae)&&ae>0?ae:5});async function ge(){a.disabled||(K.value=!0,se.value=0,requestAnimationFrame(()=>{ne.value&&(ne.value.scrollTop=0),j.value=0}),b.value&&a.autoFetchOnOpen&&(a.refreshOnOpen||!C.value)&&!p.value&&await B())}function Me(){K.value=!1}function ve(){K.value?Me():ge()}function Ee(ae){var be,Te;if(!K.value)return;const fe=ae.target;(be=$.value)!=null&&be.contains(fe)||(Te=G.value)!=null&&Te.contains(fe)||Me()}e.onMounted(()=>document.addEventListener("mousedown",Ee)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",Ee));function Z(ae){if(a.disabled)return;if(A(ae)){r("max");return}const fe=[...g.value];if(a.returnObject){const be=f(ae);if(fe.some(lt=>f(lt)===be))return;r("update:modelValue",[...fe,ae])}else{const be=f(ae);if(fe.includes(be))return;r("update:modelValue",[...fe,be])}R.value="",se.value=0,requestAnimationFrame(()=>{ne.value&&(ne.value.scrollTop=0),j.value=0})}function O(ae){if(a.disabled)return;const fe=[...g.value];if(a.returnObject){const be=f(ae);r("update:modelValue",fe.filter(Te=>f(Te)!==be))}else{const be=f(ae);r("update:modelValue",fe.filter(Te=>Te!==be))}}function Q(){a.disabled||(r("update:modelValue",[]),r("clear"),Me())}const ie=e.computed(()=>{const ae=R.value.trim().toLowerCase(),fe=P.value;return ae?fe.filter(be=>h(be).toLowerCase().includes(ae)):fe}),Ae=e.computed(()=>ie.value.length);e.watch(K,ae=>{ae||(R.value="")});const ze=e.computed(()=>{if(X.value)return a.itemHeight;const ae=Ae.value;return(ae<=0?1:Math.min(ae,le.value))*a.itemHeight}),Ye=e.computed(()=>a.virtual?Ae.value*a.itemHeight:0),Qe=e.computed(()=>a.virtual?Math.ceil(ze.value/a.itemHeight)+a.overscan:Ae.value),at=e.computed(()=>{if(!a.virtual)return 0;const ae=Math.floor(j.value/a.itemHeight)-Math.floor(a.overscan/2);return Math.max(0,ae)}),je=e.computed(()=>a.virtual?Math.min(Ae.value,at.value+Qe.value):Ae.value),bt=e.computed(()=>a.virtual?at.value*a.itemHeight:0),Ct=e.computed(()=>{const ae=ie.value;return a.virtual?ae.slice(at.value,je.value):ae});function yt(ae){const fe=ae.target;j.value=fe.scrollTop}function Vt(ae){return ae===se.value}function H(ae){const fe=ne.value;if(!fe||!a.virtual)return;const be=ae*a.itemHeight,Te=be+a.itemHeight,lt=fe.scrollTop,Ut=fe.scrollTop+fe.clientHeight;be<lt?fe.scrollTop=be:Te>Ut&&(fe.scrollTop=Te-fe.clientHeight)}function he(ae){const fe=Math.max(0,Ae.value-1);se.value=Math.min(fe,Math.max(0,se.value+ae)),H(se.value)}function ye(){const ae=ie.value[se.value];ae&&Z(ae)}const He=e.computed(()=>a.clearable&&!a.disabled&&k.value.length>0),Le=e.computed(()=>u.value?"border-destructive ring-1 ring-destructive":K.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(ae,fe)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",x1)):e.createCommentVNode("",!0),fe[3]||(fe[3]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),d.value?(e.openBlock(),e.createElementBlock("span",w1,"*")):e.createCommentVNode("",!0)],8,k1)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"referenceEl",ref:$,class:"relative"},[e.createElementVNode("button",{id:c.value,type:"button",class:e.normalizeClass(["w-full justify-between h-auto min-h-10 px-3 py-2 transition border rounded-lg flex items-center",["bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 text-foreground dark:text-gray-300",Le.value]]),disabled:a.disabled,onClick:ve},[e.createElementVNode("div",E1,[k.value.length?(e.openBlock(),e.createElementBlock("div",B1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(be,Te)=>(e.openBlock(),e.createElementBlock("div",{key:`chip-${m(be,Te)}`,class:"inline-flex items-center rounded-md border px-1.5 py-0.5 text-xs font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 border-transparent gap-1"},[e.createElementVNode("span",_1,e.toDisplayString(h(be)),1),a.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:e.withModifiers(lt=>O(be),["stop"]),"aria-label":"Remove"}," ✕ ",8,S1))]))),128)),a.maxChips!==null&&k.value.length>a.maxChips?(e.openBlock(),e.createElementBlock("div",A1," +"+e.toDisplayString(k.value.length-(a.maxChips??0)),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",V1,e.toDisplayString(a.placeholder),1))]),e.createElementVNode("div",D1,[He.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:e.withModifiers(Q,["stop"]),"aria-label":"Clear"}," ✕ ")):e.createCommentVNode("",!0),e.createVNode(e.unref(ue.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,C1),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[K.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:G,class:"-mt-1 z-[9999] w-[var(--floating-width)] rounded-lg border shadow-lg overflow-hidden bg-white dark:bg-neutral-800 border-gray-200 dark:border-neutral-700/50",style:e.normalizeStyle(Y.value)},[a.searchable&&!X.value?(e.openBlock(),e.createElementBlock("div",N1,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":fe[0]||(fe[0]=be=>R.value=be),placeholder:a.searchPlaceholder,class:"w-full h-10 px-3 py-2 text-sm bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700/50 rounded-md focus:outline-none focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600",onKeydown:[fe[1]||(fe[1]=e.withKeys(e.withModifiers(be=>he(1),["prevent"]),["down"])),fe[2]||(fe[2]=e.withKeys(e.withModifiers(be=>he(-1),["prevent"]),["up"])),e.withKeys(e.withModifiers(ye,["prevent"]),["enter"]),e.withKeys(e.withModifiers(Me,["prevent"]),["esc"])]},null,40,M1),[[e.vModelText,R.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"listEl",ref:ne,class:"relative overflow-auto",style:e.normalizeStyle({height:ze.value+"px"}),onScroll:yt},[X.value?(e.openBlock(),e.createElementBlock("div",v1," All items have been selected ")):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.virtual?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({height:Ye.value+"px"})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.virtual?"absolute left-0 top-0 w-full":""),style:e.normalizeStyle(a.virtual?{transform:`translateY(${bt.value}px)`}:void 0)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ct.value,(be,Te)=>(e.openBlock(),e.createElementBlock("button",{key:String(m(be,at.value+Te)),type:"button",class:e.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[A(be)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",Vt(at.value+Te)?"bg-neutral-50 dark:bg-neutral-800/60":"",V(be)?"font-semibold":"font-normal"]]),style:e.normalizeStyle({height:a.itemHeight+"px"}),disabled:a.disabled||A(be),onClick:lt=>Z(be)},[e.createElementVNode("span",T1,e.toDisplayString(h(be)),1),V(be)?(e.openBlock(),e.createElementBlock("span",O1,"✓")):e.createCommentVNode("",!0)],14,P1))),128))],6),Ae.value===0?(e.openBlock(),e.createElementBlock("div",F1,[p.value?(e.openBlock(),e.createElementBlock("span",z1,"Loading data…")):(e.openBlock(),e.createElementBlock("span",I1,"Tidak ada data"))])):e.createCommentVNode("",!0)],64))],36)],4)):e.createCommentVNode("",!0)]))],512),u.value?(e.openBlock(),e.createElementBlock("p",R1,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,y1)),[[e.vShow,i.value]])}}),L1={class:"space-y-4"},$1={key:0,class:"flex flex-col gap-0.5"},j1=["for"],W1=["for"],U1={class:"text-[11px] text-gray-500 dark:text-gray-400"},H1={class:"flex items-center gap-2 flex-nowrap"},q1=["id","value","disabled","onKeydown","onInput","onPaste"],ra=e.defineComponent({name:"DCodeOtpInput",inheritAttrs:!1,__name:"DCodeOtpInput",props:{modelValue:{default:""},totalInput:{default:6},default:{default:""},label:{default:""},endpoint:{},submitFn:{}},emits:["updateOtp","update:modelValue","complete","loading","success","error"],setup(t,{emit:n}){const o=e.useAttrs(),r=Math.random().toString(36).slice(2,7),a=e.computed(()=>`app-otp-${(o.id||s.label||"otp-field").replaceAll(/\s+/g,"-").toLowerCase()}-${r}`),s=t,i=n,l=e.ref([]),c=e.ref([]),d=e.ref(!1),{DCodeApi:u}=mt(),h=js(),f=e.computed(()=>{const B=Number(s.totalInput);return B&&B>0?B:6}),m=()=>{c.value=Array.from({length:f.value},(B,k)=>{var y;return((y=s.default)==null?void 0:y[k])??""}),i("updateOtp",c.value.join(""))};m(),e.watch(()=>[s.totalInput,s.default],()=>m());const g=B=>{B<0||B>=f.value||e.nextTick(()=>{var k;return(k=l.value[B])==null?void 0:k.focus()})},b=B=>B.match(/[a-zA-Z0-9]/)?B.match(/[a-zA-Z0-9]/)[0]:"";async function x(B){var k;if(i("complete",B),s.submitFn){try{d.value=!0,i("loading",!0);const y=await s.submitFn(B);i("success",y)}catch(y){console.error("OTP Submit Error",y),h.error("Submit Failed",(y==null?void 0:y.message)||"Unknown error"),i("error",(y==null?void 0:y.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}return}if((k=s.endpoint)!=null&&k.apiUrl){if(typeof u!="function"){i("error","useApi() must expose DCodeApi()");return}try{d.value=!0,i("loading",!0);const y=(s.endpoint.apiMethod||"POST").toUpperCase(),V=s.endpoint.apiUrl,D=await u("","",{otp:B},{_url:V,_method:y,withCredentials:!0}),N=(D==null?void 0:D.data)??D;i("success",N)}catch(y){console.error("OTP Submit Error",y),h.error("Submit Failed",(y==null?void 0:y.message)||"Unknown error"),i("error",(y==null?void 0:y.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}}}const p=(B,k)=>{c.value[B]=b(k);const y=c.value.join("");i("updateOtp",y),i("update:modelValue",y),y.length===f.value&&x(y)},C=(B,k)=>{const y=B.key,V=/^\d$/.test(y),D=/^[a-zA-Z]$/.test(y);if(y==="Backspace"){if(B.preventDefault(),c.value[k]){p(k,"");return}k>0&&(p(k-1,""),g(k-1));return}if(y==="ArrowLeft"){B.preventDefault(),g(k-1);return}if(y==="ArrowRight"){B.preventDefault(),g(k+1);return}if(V||D){B.preventDefault(),p(k,y),k<f.value-1&&g(k+1);return}y.length===1&&B.preventDefault()},w=(B,k)=>{const y=B.target,V=y.value??"",D=b(V);y.value=D,p(k,D),D&&k<f.value-1&&g(k+1)},E=(B,k)=>{var A;B.preventDefault();const V=(((A=B.clipboardData)==null?void 0:A.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!V)return;let D=k;for(const T of V){if(D>=f.value)break;c.value[D]=T,D++}const N=c.value.join("");i("updateOtp",N),i("update:modelValue",N),N.length===f.value&&x(N),g(Math.min(D,f.value-1))},_=B=>k=>{l.value[B]=(k==null?void 0:k.$el)??k};return(B,k)=>(e.openBlock(),e.createElementBlock("div",L1,[s.label||f.value?(e.openBlock(),e.createElementBlock("div",$1,[s.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium text-foreground"},e.toDisplayString(s.label),9,j1)):(e.openBlock(),e.createElementBlock("label",{key:1,for:a.value,class:"text-sm font-medium text-foreground"}," Masukkan kode keamanan ",8,W1)),e.createElementVNode("p",U1," Ketik "+e.toDisplayString(f.value)+" digit kode verifikasi Anda ",1)])):e.createCommentVNode("",!0),e.createElementVNode("div",H1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,y=>(e.openBlock(),e.createElementBlock("input",{key:y,id:y===1?a.value:void 0,ref_for:!0,ref:_(y-1),value:c.value[y-1]||"",type:"text",inputmode:"text",maxlength:"1",autocomplete:"one-time-code","aria-label":"`OTP digit ${i}`",placeholder:"*",disabled:d.value,class:e.normalizeClass(["w-12 h-12 flex-none text-center text-xl font-bold rounded-xl border transition-all duration-200 box-border p-0","focus:outline-none focus:scale-105 disabled:opacity-50 disabled:cursor-not-allowed",c.value[y-1]?"border-blue-500 bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300":"border-gray-300 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 text-gray-400 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600"]),onKeydown:V=>C(V,y-1),onInput:V=>w(V,y-1),onPaste:V=>E(V,y-1)},null,42,q1))),128))])]))}}),G1={class:"w-full"},X1={key:0,class:"flex items-center justify-between mb-2"},K1={key:0,class:"text-sm font-medium text-gray-700"},Y1={key:1,class:"text-sm text-gray-600"},J1={name:"DCodeProgress"},Ud=e.defineComponent({...J1,name:"DCodeProgress",inheritAttrs:!1,props:{modelValue:{default:0},max:{default:100},label:{default:""},showValue:{type:Boolean,default:!1},color:{default:"blue"},size:{default:"md"},striped:{type:Boolean,default:!1},animated:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=e.computed(()=>Math.min(o.modelValue/o.max*100,100)),a=e.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[o.size],"bg-gray-200"].join(" ")),s=e.computed(()=>{const l={blue:"bg-blue-500",green:"bg-green-500",red:"bg-red-500",yellow:"bg-yellow-500",purple:"bg-purple-500",gray:"bg-gray-500"},c=["h-full transition-all duration-300 ease-out",l[o.color]||l.blue];return o.striped&&c.push("bg-gradient-to-r from-transparent via-white/20 to-transparent"),o.animated&&c.push("animate-pulse"),c.join(" ")}),i=e.computed(()=>`${Math.round(r.value)}%`);return(l,c)=>(e.openBlock(),e.createElementBlock("div",G1,[t.label||t.showValue?(e.openBlock(),e.createElementBlock("div",X1,[t.label?(e.openBlock(),e.createElementBlock("span",K1,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),t.showValue?(e.openBlock(),e.createElementBlock("span",Y1,e.toDisplayString(i.value),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.value)},[e.createElementVNode("div",{class:e.normalizeClass(s.value),style:e.normalizeStyle({width:`${r.value}%`})},null,6)],2)]))}}),Q1={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},Hd=Pt(e.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(t){return(n,o)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[t.isApiLoading?(e.openBlock(),e.createElementBlock("div",Q1,[e.createElementVNode("div",{class:"h-full bg-primary-600 shadow-[0_0_15px_rgba(37,99,235,0.8)] transition-all duration-300 ease-out",style:e.normalizeStyle({width:`${t.apiProgress}%`})},null,4)])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-85c68054"]]),Z1={class:"grid gap-3"},eC={key:0,class:"ml-1 text-destructive"},tC={class:"flex flex-col"},nC={key:0,class:"flex items-center gap-2 text-sm text-gray-500 mb-2"},oC={class:"relative flex-shrink-0 mt-0.5"},rC=["id","name","value","checked","disabled","required","onChange"],aC=["onClick"],sC=["for"],iC={key:0,class:"ml-1 text-red-500"},lC={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},qs=e.defineComponent({name:"DCodeRadio",inheritAttrs:!1,__name:"DCodeRadio",props:{modelValue:{default:void 0},label:{default:""},itemTitle:{default:"name"},itemValue:{default:"id"},options:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=mt(),r=n,a=t,s=e.ref([]),i=e.ref(!1),l=e.ref(null),c=async()=>{var E,_;const w=((E=a.endpoint)==null?void 0:E.apiUrl)||a.apiUrl;if(w){i.value=!0,l.value=null;try{const B={page:1,perPage:100},k=((_=a.endpoint)==null?void 0:_.apiMethod)||a.apiMethod,y=await o(w,k,B);let V=y;a.dataPath?V=a.dataPath.split(".").reduce((N,A)=>N&&N[A]!=="undefined"?N[A]:void 0,y):typeof y=="object"&&!Array.isArray(y)&&y.data&&(V=y.data),Array.isArray(V)?s.value=V:(console.warn("DCodeRadio: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),l.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(B){console.error("DCodeRadio fetch error:",B),l.value="Gagal memuat data dari endpoint."}finally{i.value=!1}}};e.onMounted(()=>{var w;((w=a.endpoint)!=null&&w.apiUrl||a.apiUrl)&&c()});const d=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(s.value.length>0)return s.value;const w=a.itemValue||a.model||"id",E=a.itemTitle||(a.label===""?"name":a.label);return E&&a.label!==""?[{[w]:w,[E]:E}]:[]}),u=w=>{if(typeof w!="object")return w;const E=a.itemValue||a.model||"id";return w[E]},h=w=>{if(typeof w!="object")return String(w);const E=a.itemTitle||"name";return w[E]},f=e.computed(()=>a.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),m=e.computed(()=>!!a.error||!!l.value),g=e.computed(()=>a.error||l.value),b=w=>w==null?a.modelValue===w:String(a.modelValue)===String(w),x=e.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[a.size]),p=(w,E)=>{E.target.checked&&(r("update:modelValue",w),r("change",w))},C=w=>{!a.disabled&&!b(w)&&(r("update:modelValue",w),r("change",w))};return(w,E)=>(e.openBlock(),e.createElementBlock("div",Z1,[t.label?(e.openBlock(),e.createBlock(Zo,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",eC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",tC,[i.value?(e.openBlock(),e.createElementBlock("div",nC,[e.createVNode(e.unref(ue.Loader2),{class:"w-4 h-4 animate-spin"}),E[0]||(E[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex",t.layout?"flex-row flex-wrap gap-4":"flex-col gap-3"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(_,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:e.normalizeClass(["flex items-start",x.value.container,t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("div",oC,[e.createElementVNode("input",{id:t.id?`${t.id}-${B}`:`${f.value}-${B}`,name:f.value,type:"radio",value:u(_),checked:b(u(_)),disabled:t.disabled,required:t.required&&B===0,onChange:k=>p(u(_),k),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,rC)]),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:k=>C(u(_))},[e.createElementVNode("label",{for:t.id?`${t.id}-${B}`:`${f.value}-${B}`,class:e.normalizeClass([x.value.label,"font-medium cursor-pointer select-none text-foreground dark:text-gray-300",t.disabled?"cursor-not-allowed opacity-50":""])},[e.createTextVNode(e.toDisplayString(h(_))+" ",1),t.required&&d.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",iC,"*")):e.createCommentVNode("",!0)],10,sC)],8,aC)],2))),128))],2),m.value&&g.value?(e.openBlock(),e.createElementBlock("div",lC,[e.createVNode(e.unref(ue.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(g.value),1)])):e.createCommentVNode("",!0)])]))}}),cC={class:"grid gap-3"},dC={key:0,class:"ml-1 text-destructive"},uC={class:"flex flex-col"},fC={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},hC=["onClick"],mC=["id","name","value","checked","disabled","required","onChange"],pC={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},gC=["for"],bC={key:0,class:"ml-1 text-red-500"},yC={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},Gs=e.defineComponent({name:"DCodeRadioCustom",inheritAttrs:!1,__name:"DCodeRadioCustom",props:{modelValue:{default:void 0},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=mt(),r=n,a=t,s=e.ref(a.modelValue??void 0);e.watch(()=>a.modelValue,V=>{s.value=V},{immediate:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var D,N;const V=((D=a.endpoint)==null?void 0:D.apiUrl)||a.apiUrl;if(V){l.value=!0,c.value=null;try{const A={page:1,perPage:100},T=((N=a.endpoint)==null?void 0:N.apiMethod)||a.apiMethod,P=await o(V,T,A);let X=P;a.dataPath?X=a.dataPath.split(".").reduce((G,ne)=>G&&G[ne]!=="undefined"?G[ne]:void 0,P):typeof P=="object"&&!Array.isArray(P)&&P.data&&(X=P.data),Array.isArray(X)?i.value=X:(console.warn("DCodeRadioCustom: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(A){console.error("DCodeRadioCustom fetch error:",A),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=e.ref(!1);let h=null;const f=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var V;((V=a.endpoint)!=null&&V.apiUrl||a.apiUrl)&&d(),f(),typeof document<"u"&&(h=new MutationObserver(f),h.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),h.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{h&&h.disconnect()});const m=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(i.value.length>0)return i.value;const V=a.itemValue||a.model||"id",D=a.itemTitle||(a.label===""?"name":a.label);return D&&a.label!==""?[{[V]:V,[D]:D}]:[]}),g=V=>{if(typeof V!="object")return V;const D=a.itemValue||a.model||"id";return V[D]},b=V=>{if(typeof V!="object")return String(V);const D=a.itemTitle||"name";return V[D]},x=Math.random().toString(36).slice(2,7),p=e.computed(()=>a.id?`radio-custom-${a.id}`:`radio-custom-${a.model}-${x}`),C=e.computed(()=>!!a.error||!!c.value),w=e.computed(()=>a.error||c.value),E=V=>{const D=s.value;return V==null?D===V:String(D)===String(V)},_=e.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[a.size]),B=e.computed(()=>a.icon&&qt[a.icon]||null),k=(V,D)=>{D.target.checked&&(s.value=V,r("update:modelValue",V),r("change",V))},y=V=>{a.disabled||E(V)||(s.value=V,r("update:modelValue",V),r("change",V))};return(V,D)=>(e.openBlock(),e.createElementBlock("div",cC,[t.label?(e.openBlock(),e.createBlock(Zo,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",dC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",uC,[l.value?(e.openBlock(),e.createElementBlock("div",fC,[e.createVNode(e.unref(ue.Loader2),{class:"w-4 h-4 animate-spin"}),D[0]||(D[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["grid",t.layout?"grid-cols-2 sm:grid-cols-3":"grid-cols-1","gap-3"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(N,A)=>(e.openBlock(),e.createElementBlock("div",{key:A,class:e.normalizeClass(["relative flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 transition-all duration-200",E(g(N))?u.value?"border-primary-500 bg-primary-500/10 shadow-none":"border-primary-500 bg-primary-50 shadow-md shadow-primary-100":u.value?"border-neutral-700 bg-neutral-800 hover:border-neutral-600":"border-gray-200 bg-white hover:border-gray-300 hover:shadow-sm",t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:T=>!t.disabled&&y(g(N))},[e.createElementVNode("input",{id:t.id?`${t.id}-${A}`:`${p.value}-${A}`,name:p.value,type:"radio",value:g(N),checked:E(g(N)),disabled:t.disabled,required:t.required&&A===0,onChange:T=>k(g(N),T),class:"sr-only",tabindex:"-1"},null,40,mC),e.createElementVNode("div",{class:e.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",E(g(N))?u.value?"bg-primary-500/25 text-primary-400":"bg-primary-100 text-primary-600":u.value?"bg-neutral-700 text-neutral-500":"bg-gray-100 text-gray-400"])},[B.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(B.value),{key:0,class:"w-6 h-6"})):(e.openBlock(),e.createElementBlock("svg",pC,[...D[1]||(D[1]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2),e.createElementVNode("label",{for:t.id?`${t.id}-${A}`:`${p.value}-${A}`,class:e.normalizeClass([_.value.label,"font-medium text-center leading-tight select-none transition-colors duration-200",E(g(N))?u.value?"text-primary-400":"text-primary-700":u.value?"text-neutral-300":"text-gray-700",t.disabled?"cursor-not-allowed":"cursor-pointer"])},[e.createTextVNode(e.toDisplayString(b(N))+" ",1),t.required&&m.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",bC,"*")):e.createCommentVNode("",!0)],10,gC)],10,hC))),128))],2),C.value&&w.value?(e.openBlock(),e.createElementBlock("div",yC,[e.createVNode(e.unref(ue.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(w.value),1)])):e.createCommentVNode("",!0)])]))}}),xC={key:0,class:"ml-1 text-destructive"},kC={class:"relative w-full"},wC={key:0,class:"mb-2 flex items-center justify-between"},CC={class:"text-sm text-muted-foreground"},EC={class:"text-sm font-medium text-foreground"},BC={class:"text-sm text-muted-foreground"},_C={class:"relative"},SC=["id","value","min","max","step","disabled","placeholder"],AC={key:1,class:"relative mt-2"},VC={class:"text-xs text-muted-foreground mt-1"},DC={key:1,class:"flex items-center gap-1 text-sm text-destructive"},NC={name:"DCodeSlider"},aa=e.defineComponent({...NC,name:"DCodeSlider",inheritAttrs:!1,props:{modelValue:{default:0},min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},label:{default:""},placeholder:{default:""},required:{type:Boolean,default:!1},error:{default:null},showValue:{type:Boolean,default:!0},valuePrefix:{default:""},valueSuffix:{default:""},marks:{default:()=>[]},color:{default:"blue"},size:{default:"md"}},emits:["update:modelValue","change","input"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.ref(),i=e.ref(!1),l=e.computed(()=>!!a.error),c=e.computed(()=>`slider-${Math.random().toString(36).substr(2,9)}`),d=e.computed(()=>(a.label||o.label)??void 0),u=e.computed(()=>!0),h=e.computed(()=>{const _={sm:"h-2",md:"h-2.5",lg:"h-3"},B={blue:"accent-blue-500",green:"accent-green-500",red:"accent-red-500",yellow:"accent-yellow-500",purple:"accent-purple-500",gray:"accent-gray-500"};return["w-full appearance-none bg-transparent rounded-lg outline-none transition-all cursor-pointer relative z-10","disabled:opacity-50 disabled:cursor-not-allowed",_[a.size],B[a.color]||B.blue,l.value?"accent-red-500":"",o.class].filter(Boolean).join(" ")}),f=e.computed(()=>["appearance-none bg-white border-2 border-current rounded-full cursor-pointer transition-all","hover:scale-110 focus:scale-110","shadow-md hover:shadow-lg focus:shadow-lg","focus:outline-none focus:ring-2 focus:ring-offset-2",{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[a.size],a.color==="blue"?"focus:ring-blue-500":a.color==="green"?"focus:ring-green-500":a.color==="red"?"focus:ring-red-500":a.color==="yellow"?"focus:ring-yellow-500":a.color==="purple"?"focus:ring-purple-500":"focus:ring-gray-500"].join(" ")),m=e.computed(()=>`${a.valuePrefix}${a.modelValue}${a.valueSuffix}`),g=e.computed(()=>{const _=a.max-a.min;return(a.modelValue-a.min)/_*100}),b=_=>{const B=_.target,k=parseFloat(B.value);r("update:modelValue",k),r("input",k)},x=_=>{const B=_.target,k=parseFloat(B.value);r("change",k)},p=()=>{i.value=!0},C=()=>{i.value=!1},w=_=>{const B=a.max-a.min;return(_-a.min)/B*100},E=e.computed(()=>{const _={sm:16,md:20,lg:24};return`
66
+ `.trim();let a=document.getElementById(n);a||(a=document.createElement("style"),a.id=n,document.head.appendChild(a)),a.textContent=r}function Ik(t,n=Wd){e.watch(t,o=>zk(o,n),{immediate:!0})}const Rk={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Lk=["for"],$k={key:0,class:"ml-1 text-destructive"},jk=["disabled","onClick"],Wk={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},Uk=["id","value","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],Hk={class:"h-full p-2 flex flex-col gap-3 w-32"},qk=["onClick"],Gk={class:"flex items-center justify-end gap-2 w-full p-2"},Xk=["disabled","onClick"],Kk={key:1,class:"text-xs text-destructive"},oa=e.defineComponent({name:"DCodeDatePicker",inheritAttrs:!1,__name:"DCodeDatePicker",props:{modelValue:{},range:{type:Boolean,default:!1},autoRangeDays:{default:null},disablePast:{type:Boolean,default:!1},maxDaysAhead:{default:null},placeholder:{default:"Pilih tanggal"},label:{},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},displayFormat:{default:"dd/MM/yyyy"},modelType:{default:"yyyy-MM-dd"},locale:{default:"en"},placement:{default:"bottom-start"},prependInner:{default:void 0},error:{default:null},selectLabel:{default:"Select"},cancelLabel:{default:"Cancel"},tone:{default:"primary"},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=t,a=n,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`dcode-datepicker-${o.id||r.label||"date-picker"}-${s}`),l=e.computed(()=>{const P=o.required,v=o["aria-required"];return P===""||P===!0||P==="true"||v==="true"||v===!0}),c=e.computed(()=>!!r.error),d=e.computed({get:()=>r.modelValue,set:P=>{a("update:modelValue",P),a("change",P)}}),u=e.computed(()=>r.locale==="en"?Td:Fk),f=e.computed(()=>r.range?2:!1),h=e.computed(()=>{if(!r.range)return!1;const P={partialRange:!1};return r.autoRangeDays&&r.autoRangeDays>0&&(P.maxRange=r.autoRangeDays,P.autoRange=r.autoRangeDays),P}),m=P=>{const v=new Date(P);return v.setHours(0,0,0,0),v},g=P=>{const v=new Date(P);return v.setHours(23,59,59,999),v},k=(P,v)=>{const Q=new Date(P);return Q.setDate(Q.getDate()+v),Q},y=e.computed(()=>{if(r.disablePast)return m(new Date)}),p=e.computed(()=>{if(r.maxDaysAhead&&r.maxDaysAhead>0)return g(k(new Date,r.maxDaysAhead))}),E=e.ref(null),_=e.ref(null),B=P=>{_.value={month:P.month,year:P.year}},S=e.ref(!1);let w=null;e.onMounted(()=>{const P=document.documentElement,v=()=>S.value=P.classList.contains("dark");v(),w=new MutationObserver(v),w.observe(P,{attributes:!0,attributeFilter:["class"]})}),e.onBeforeUnmount(()=>{w==null||w.disconnect(),w=null}),Ik(e.toRef(r,"tone"));const x=P=>{const v=new Date(P),Q=v.getDay(),$=v.getDate()-Q+(Q===0?-6:1);return v.setDate($),m(v)},b=P=>{const v=x(P);return v.setDate(v.getDate()+6),g(v)},V=P=>{const v=new Date(P);return v.setDate(1),m(v)},A=P=>{const v=new Date(P);return v.setMonth(v.getMonth()+1),v.setDate(0),g(v)},D=e.computed(()=>{if(!r.range)return[];const P=new Date,v=m(P),Q=x(P),$=b(P),q=V(P),Y=A(P),X=(T,W)=>{let ne=T;r.disablePast&&ne<v&&(ne=v);let Z=W;if(r.autoRangeDays&&r.autoRangeDays>0){const K=g(k(ne,r.autoRangeDays-1));Z>K&&(Z=K)}return Z<ne&&(Z=g(new Date(ne))),[ne,Z]};return[{label:r.locale==="id"?"Minggu Ini":"This Week",range:X(Q,$)},{label:r.locale==="id"?"Bulan Ini":"This Month",range:X(q,Y)}]}),N=async P=>{var W,ne;const v=r.modelType||"yyyy-MM-dd";if(P.length===0){d.value=null;return}if(P.length<2)return;const Q=$d(P[0],v),$=$d(P[1],v);d.value=[Q,$],await e.nextTick();const q=P[0],Y=q.getMonth(),X=q.getFullYear();_.value&&_.value.month===Y&&_.value.year===X||(W=E.value)==null||W.setMonthYear({month:Y,year:X}),(ne=E.value)==null||ne.openMenu()};return(P,v)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class])},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Rk)):e.createCommentVNode("",!0),v[2]||(v[2]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",$k,"*")):e.createCommentVNode("",!0)],8,Lk)):e.createCommentVNode("",!0),e.createVNode(e.unref(bu.VueDatePicker),{ref_key:"dpRef",ref:E,modelValue:d.value,"onUpdate:modelValue":v[1]||(v[1]=Q=>d.value=Q),dark:S.value,range:h.value,"multi-calendars":f.value,disabled:t.disabled,clearable:!1,"text-input":"","enable-time-picker":!1,"time-config":{enableTimePicker:!1},"auto-apply":!1,"action-row":{showPreview:!0,showNow:!1},locale:u.value,"model-type":t.modelType,formats:{input:t.displayFormat},"min-date":y.value,"max-date":p.value,"preset-ranges":D.value,floating:{placement:t.placement,offset:8,arrow:!1,flip:!1,shift:!0},teleport:!0,"menu-class-name":"dcode-datepicker-menu","calendar-class-name":"dcode-datepicker-calendar",onUpdateMonthYear:B},e.createSlots({"dp-input":e.withCtx(({value:Q,onInput:$,onEnter:q,onTab:Y,onBlur:X,onFocus:T,onKeypress:W,onPaste:ne,toggleMenu:Z})=>[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 overflow-hidden shadow-none transition-all duration-200 focus-within:ring-1 focus-within:ring-neutral-400 dark:focus-within:ring-neutral-600 focus-within:border-neutral-400 dark:focus-within:border-neutral-600",[c.value?"border-destructive":"",t.disabled?"opacity-50 cursor-not-allowed":""]])},[e.createElementVNode("button",{type:"button",tabindex:"-1",disabled:t.disabled,class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none",onClick:K=>Z()},[e.createVNode(e.unref(ce.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,jk),v[4]||(v[4]=e.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),t.prependInner?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",Wk,e.toDisplayString(t.prependInner),1),v[3]||(v[3]=e.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:i.value,value:Q,placeholder:t.placeholder,disabled:t.disabled,autocomplete:"off",readonly:"",class:e.normalizeClass(["flex-1 min-w-0 px-3 h-full bg-transparent text-sm text-foreground dark:text-gray-300 placeholder:text-muted-foreground outline-none",t.disabled?"cursor-not-allowed":"cursor-pointer"]),onClick:K=>Z(),onFocus:K=>T(),onBlur:K=>X(),onInput:K=>$(K),onKeydown:[e.withKeys(K=>q(K),["enter"]),e.withKeys(K=>Y(K),["tab"])],onKeypress:K=>W(K),onPaste:K=>ne()},null,42,Uk)],2)]),"action-buttons":e.withCtx(({selectDate:Q,selectionDisabled:$})=>[e.createElementVNode("div",Gk,[e.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center rounded-md text-sm font-medium border border-input bg-background hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400",onClick:v[0]||(v[0]=q=>{var Y;return(Y=E.value)==null?void 0:Y.closeMenu()})},e.toDisplayString(t.cancelLabel),1),e.createElementVNode("button",{type:"button",disabled:$,class:"inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400 disabled:pointer-events-none disabled:opacity-50",onClick:q=>Q()},e.toDisplayString(t.selectLabel),9,Xk)])]),_:2},[t.range?{name:"left-sidebar",fn:e.withCtx(()=>[e.createElementVNode("div",Hk,[D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(D.value,Q=>(e.openBlock(),e.createElementBlock("button",{key:Q.label,type:"button",class:"w-full inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400",onClick:$=>N(Q.range)},e.toDisplayString(Q.label),9,qk))),128)):e.createCommentVNode("",!0)])]),key:"0"}:void 0]),1032,["modelValue","dark","range","multi-calendars","disabled","locale","model-type","formats","min-date","max-date","preset-ranges","floating"]),c.value?(e.openBlock(),e.createElementBlock("p",Kk,e.toDisplayString(r.error),1)):e.createCommentVNode("",!0)],64))],2))}}),Yk=e.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:n}){const o=t,r=n,a=Se.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(Se.DialogRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),Jk=e.defineComponent({inheritAttrs:!1,__name:"DialogContent",props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:n}){const o=t,r=n,a=lt.reactiveOmit(o,"class"),s=Se.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Se.DialogPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Se.DialogOverlay),{class:"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),e.createVNode(e.unref(Se.DialogContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(Ie)("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",o.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),e.createVNode(e.unref(Se.DialogClose),{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.X),{class:"w-4 h-4"}),l[0]||(l[0]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),Qk=e.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.DialogDescription),e.mergeProps(e.unref(r),{class:e.unref(Ie)("text-sm text-muted-foreground",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),Zk=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.DialogTitle),e.mergeProps(e.unref(r),{class:e.unref(Ie)("text-lg font-medium leading-none tracking-tight",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),ew={key:0,class:"px-6 py-4 flex items-center justify-between border-b border-neutral-200/60 dark:border-neutral-700/50 bg-white/80 dark:bg-neutral-900/30 backdrop-blur-md sticky top-0 z-20"},tw={class:"flex items-center gap-3"},nw={class:"flex flex-col"},ow={key:0,class:"flex items-center gap-2"},rw={key:1,class:"px-6 py-4 border-t border-neutral-200/60 dark:border-neutral-700/50 bg-neutral-50/50 dark:bg-neutral-900/30 sticky bottom-0 z-20"},aw={class:"flex justify-end gap-3 flex-wrap"},Fn=Ot(e.defineComponent({name:"DCodeDialog",inheritAttrs:!1,__name:"DCodeDialog",props:{modelValue:{type:Boolean,default:!1},title:{default:""},icon:{default:""},maxWidth:{default:500},persistent:{type:Boolean,default:!0},contentClass:{default:"p-5"},contentStyle:{default:()=>({})},iconClass:{default:""}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.computed(()=>{const{style:d,...u}=a;return u}),i=e.computed(()=>({maxWidth:typeof o.maxWidth=="number"?`${o.maxWidth}px`:o.maxWidth,width:"100%"})),l=e.computed(()=>o.icon?Gt[o.icon]??null:null),c=d=>{r("update:modelValue",d)};return(d,u)=>(e.openBlock(),e.createBlock(e.unref(Yk),{open:t.modelValue,"onUpdate:open":c},{default:e.withCtx(()=>[e.createVNode(e.unref(Jk),e.mergeProps(s.value,{style:i.value,class:"p-0 overflow-hidden rounded-xl flex flex-col max-h-[90vh] bg-white dark:bg-neutral-800 border-0",onInteractOutside:u[0]||(u[0]=f=>t.persistent?f.preventDefault():null),onEscapeKeyDown:u[1]||(u[1]=f=>t.persistent?f.preventDefault():null)}),{default:e.withCtx(()=>[t.title||d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",ew,[e.createElementVNode("div",tw,[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["p-2 rounded-lg",t.iconClass||"bg-primary/10 text-primary"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),{class:"h-5 w-5"}))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",nw,[e.createVNode(e.unref(Zk),{class:"text-lg font-bold text-neutral-900 dark:text-neutral-50 leading-tight"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),e.createVNode(e.unref(Qk),{class:"hidden"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title||"Dialog Content"),1)]),_:1})])]),d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",ow,[e.renderSlot(d.$slots,"header-append",{},void 0,!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex-1 overflow-y-auto custom-scrollbar",t.contentClass]),style:e.normalizeStyle(t.contentStyle)},[e.renderSlot(d.$slots,"default",{},void 0,!0)],6),d.$slots.actions?(e.openBlock(),e.createElementBlock("div",rw,[e.createElementVNode("div",aw,[e.renderSlot(d.$slots,"actions",{},void 0,!0)])])):e.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-52781e0f"]]),ko=e.defineComponent({name:"DCodeLabel",inheritAttrs:!1,__name:"DCodeLabel",props:{label:{},text:{},textSize:{},textType:{},icon:{},iconClass:{}},setup(t){const n=e.useAttrs(),o=t,r=e.computed(()=>o.icon&&Gt[o.icon]||null),a=e.computed(()=>o.textSize?`text-${o.textSize}`:"text-xs"),s={xs:"w-3 h-3",sm:"w-3.5 h-3.5",base:"w-4 h-4",lg:"w-5 h-5",xl:"w-5 h-5","2xl":"w-6 h-6","3xl":"w-7 h-7","4xl":"w-8 h-8","5xl":"w-10 h-10","6xl":"w-12 h-12"},i=e.computed(()=>s[o.textSize??"xs"]??"w-3 h-3"),l=e.computed(()=>o.textType==="BOLD"?"font-bold":o.textType==="ITALIC"?"italic font-normal":"font-normal"),c=e.computed(()=>{const u=`${a.value} ${l.value} text-slate-600 ml-1 inline-flex items-center gap-1`,f=n.class??"";return[u,f].filter(Boolean).join(" ")}),d=e.computed(()=>{const{class:u,...f}=n;return f});return(u,f)=>(e.openBlock(),e.createElementBlock("span",e.mergeProps({class:c.value},d.value),[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:e.normalizeClass(["shrink-0",i.value,t.iconClass])},null,8,["class"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label||t.text),1)],16))}}),sw={class:"flex flex-col gap-3 w-full"},iw={key:0,class:"col-span-full flex flex-col gap-2 p-3 bg-white dark:bg-neutral-800 border border-dashed border-slate-200 dark:border-neutral-700/50 rounded-lg opacity-70 pointer-events-none animate-pulse"},lw={class:"flex flex-col items-center justify-center gap-2 py-6 rounded-lg border border-dashed border-slate-300 dark:border-neutral-700/50 bg-slate-50 dark:bg-neutral-900/30 text-slate-400"},cw={key:1,class:"col-span-full flex flex-col items-center justify-center text-center gap-2 px-3 py-8 bg-slate-50 dark:bg-neutral-900/10 border border-slate-200 dark:border-neutral-700/50 rounded-lg opacity-70"},dw={class:"text-sm font-medium text-slate-500"},uw={class:"flex items-center justify-between gap-2"},fw=["onClick"],hw={key:0,class:"flex items-center gap-3 px-3 py-2 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-md"},mw={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},pw=["onClick"],gw=["for","onDrop"],bw={class:"text-xs text-slate-500 dark:text-slate-400"},yw={key:2,class:"text-xs text-slate-400"},xw=["id","disabled","accept","onChange"],kw={class:"flex flex-col items-center justify-center min-h-[300px]"},ww=["src","alt"],Cw=["src"],Ew={key:2,class:"flex flex-col items-center gap-4 py-12 text-slate-400"},Bw={class:"text-sm font-medium"},_w=["href"],Rs=e.defineComponent({__name:"DCodeDynamicUploadList",props:{modelValue:{type:Array,default:()=>[]},label:{type:String,default:""},labelID:{type:String,default:"Documents"},labelEN:{type:String,default:"Documents"},endpoint:{type:Object,default:()=>null},endpointReference:{type:Object,default:()=>null},itemTitle:{type:String,default:"name"},itemValue:{type:String,default:"id"},disabled:Boolean,required:Boolean,typeFile:{type:String,default:void 0},sizeFile:{type:Number,default:void 0},items:{type:Array,default:void 0},baseUrl:{type:String,default:void 0}},emits:["update:modelValue","uploaded","success"],setup(t,{emit:n}){const o=t,r=n,{t:a,locale:s}=$t.useI18n(),i=e.computed(()=>{const w=o.endpoint;if(!(w!=null&&w.apiUrl))return null;let x=w.apiUrl;if(!x.startsWith("http")&&o.baseUrl){const b=o.baseUrl.replace(/\/$/,""),V=x.startsWith("/")?x:`/${x}`;x=`${b}${V}`}return x}),l=e.computed(()=>{const w=c.value.length;return w<=1?"grid-cols-1":w===2?"grid-cols-1 md:grid-cols-2":w===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":w===4?"grid-cols-1 md:grid-cols-2 lg:grid-cols-3":"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}),c=e.ref([]),d=e.ref([]),u=e.ref(new Set),f=e.ref(!0),h=e.ref(!1),m=e.ref(""),g=e.ref(""),k=e.ref(""),y=async()=>{var w;if(f.value=!0,o.items!==void 0){c.value=o.items,f.value=!1;return}if(!((w=o.endpointReference)!=null&&w.apiUrl)){f.value=!1;return}try{const{apiUrl:x}=ft(),b=await x(o.endpointReference.apiUrl,o.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(o.items!==void 0){f.value=!1;return}let V=(b==null?void 0:b.data)||b;Array.isArray(V)||(V=[V]),c.value=V}catch(x){console.error("Failed to fetch dynamic document list",x)}finally{f.value=!1}};e.onMounted(()=>{Array.isArray(o.modelValue)&&o.modelValue.length>0&&(d.value=JSON.parse(JSON.stringify(o.modelValue))),y()}),e.onBeforeUnmount(()=>{d.value.forEach(w=>{w._localPreviewUrl&&URL.revokeObjectURL(w._localPreviewUrl)})}),e.watch(()=>o.modelValue,w=>{if(Array.isArray(w)&&JSON.stringify(w)!==JSON.stringify(d.value)){const x=JSON.parse(JSON.stringify(w));x.forEach(b=>{const V=d.value.find(A=>A.typeDocument===b.typeDocument||A.idDocumentType===b.idDocumentType);V!=null&&V._localPreviewUrl&&(b._localPreviewUrl=V._localPreviewUrl)}),d.value=x}},{deep:!0}),e.watch(()=>{var w;return(w=o.endpointReference)==null?void 0:w.apiUrl},(w,x)=>{w!==x&&y()}),e.watch(()=>{var w;return(w=o.endpointReference)==null?void 0:w.apiMethod},(w,x)=>{w!==x&&y()}),e.watch(()=>o.items,w=>{c.value=w??[],f.value=!1},{deep:!0,immediate:!0});const p=w=>{const x=w[o.itemValue]||w.id||w.typeDocument;return d.value.find(b=>b.typeDocument===x||b.idDocumentType===x||b[o.itemValue]===x)||null},E=async(w,x,b)=>{var P,v,Q,$;const V=b.target,A=(P=V.files)==null?void 0:P[0];if(!A)return;const D=w[o.itemValue]||w.id||w.typeDocument,N=URL.createObjectURL(A);if(!i.value){const q=[...d.value],Y=q.findIndex(T=>T.typeDocument===D||T.idDocumentType===D);(v=q[Y])!=null&&v._localPreviewUrl&&URL.revokeObjectURL(q[Y]._localPreviewUrl);const X={id:null,idDocument:null,idDocumentType:D,filename:A.name,document:D,documentUrl:A.name,typeDocument:D,_localPreviewUrl:N,_fileType:A.type};Y>-1?q[Y]={...q[Y],...X}:q.push(X),d.value=q,r("update:modelValue",q);return}u.value.add(x);try{const{apiUrl:q}=ft(),Y=new FormData;Y.append("doc",A),Y.append("typeDocument",String(D));const X=await q(i.value,((Q=o.endpoint)==null?void 0:Q.apiMethod)||"POST",Y),T=Array.isArray(X==null?void 0:X.data)?X.data[0]:(X==null?void 0:X.data)||X,W=(T==null?void 0:T.url)||(T==null?void 0:T.document)||A.name,ne=(T==null?void 0:T.id)||null,Z=(T==null?void 0:T.filename)||(T==null?void 0:T.name)||A.name,K=[...d.value],ae=K.findIndex(xe=>xe.typeDocument===D||xe.idDocumentType===D);($=K[ae])!=null&&$._localPreviewUrl&&URL.revokeObjectURL(K[ae]._localPreviewUrl);const ue={...T,id:ne||(T==null?void 0:T.idDocument)||(T==null?void 0:T.id_document)||null,idDocument:(T==null?void 0:T.idDocument)||ne||(T==null?void 0:T.id_document)||null,idDocumentType:D,filename:Z,document:D,documentUrl:W,typeDocument:D,_localPreviewUrl:N,_fileType:A.type};ae>-1?K[ae]={...K[ae],...ue}:K.push(ue),d.value=K,r("update:modelValue",K),r("uploaded",T),r("success",T)}catch(q){console.error("Upload failed",q)}finally{u.value.delete(x),V.value=""}},_=w=>{const x=w[o.itemValue]||w.id||w.typeDocument,b=d.value.find(A=>A.typeDocument===x||A.idDocumentType===x);b!=null&&b._localPreviewUrl&&URL.revokeObjectURL(b._localPreviewUrl);const V=d.value.filter(A=>A.typeDocument!==x&&A.idDocumentType!==x);d.value=V,r("update:modelValue",V)},B=w=>{const x=p(w);if(!x)return;let b=x._localPreviewUrl;if(!b)if(x.server&&x.url){const D=x.server.replace(/\/+$/,""),N=x.url.replace(/^\/+/,"");b=`${D}/${N}`}else b=x.document||x.url;if(!b)return;const V=x.mime||x._fileType||"",A=V==="application/pdf"||b.toLowerCase().endsWith(".pdf");A&&!b.includes("#")&&(b+="#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"),m.value=b,g.value=w[o.itemTitle]||w.name||x.filename||"Preview Document",k.value=V||(A?"application/pdf":"image/jpeg"),h.value=!0},S=(w,x,b)=>{var D,N;b.preventDefault();const V=(N=(D=b.dataTransfer)==null?void 0:D.files)==null?void 0:N[0];if(!V)return;E(w,x,{target:{files:[V],value:""}})};return(w,x)=>(e.openBlock(),e.createElementBlock("div",sw,[t.label||t.labelID||t.labelEN?(e.openBlock(),e.createBlock(ko,{key:0,text:t.label||(e.unref(s).toLowerCase().startsWith("en")?t.labelEN:t.labelID),class:"font-semibold text-sm text-slate-700 dark:text-slate-300",required:t.required},null,8,["text","required"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["w-full grid gap-4",l.value])},[c.value.length===0&&f.value?(e.openBlock(),e.createElementBlock("div",iw,[e.createVNode(ko,{text:e.unref(a)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-neutral-300"},null,8,["text"]),e.createElementVNode("div",lw,[e.createVNode(e.unref(ce.Loader2),{class:"w-6 h-6 animate-spin"})])])):c.value.length===0&&!f.value?(e.openBlock(),e.createElementBlock("div",cw,[e.createVNode(e.unref(ce.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),e.createElementVNode("span",dw,e.toDisplayString(e.unref(a)("dynamicUploadList.noDocsRequired")),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(b,V)=>{var A;return e.openBlock(),e.createElementBlock("div",{key:V,class:"flex flex-col gap-2 p-3 bg-white dark:bg-neutral-800 border border-slate-200 dark:border-neutral-700/50 rounded-lg shadow-sm"},[e.createElementVNode("div",uw,[e.createVNode(ko,{text:b[t.itemTitle]||b.name||b.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-neutral-300 truncate flex-1"},null,8,["text"]),p(b)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"p-1 hover:bg-slate-100 dark:hover:bg-zinc-700 rounded transition-colors text-slate-400 hover:text-primary-500",onClick:D=>B(b)},[e.createVNode(e.unref(ce.Eye),{class:"w-4 h-4"})],8,fw)):e.createCommentVNode("",!0)]),p(b)?(e.openBlock(),e.createElementBlock("div",hw,[e.createVNode(e.unref(ce.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),e.createElementVNode("span",mw,e.toDisplayString(((A=p(b))==null?void 0:A.filename)||e.unref(a)("dynamicUploadList.fileUploaded")),1),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"text-red-400 hover:text-red-600 transition-colors",onClick:D=>_(b)},[e.createVNode(e.unref(ce.X),{class:"w-4 h-4"})],8,pw))])):(e.openBlock(),e.createElementBlock("label",{key:1,for:`dyn-upload-input-${V}`,class:e.normalizeClass(["flex flex-col items-center justify-center gap-2 py-8 rounded-lg border-2 border-dashed transition-colors cursor-pointer",[t.disabled?"border-slate-200 bg-slate-50 cursor-not-allowed opacity-60":"border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-800 hover:border-primary-400 hover:bg-primary-50 dark:hover:bg-primary-900/10",u.value.has(V)?"pointer-events-none opacity-70":""]]),onDragover:x[0]||(x[0]=e.withModifiers(()=>{},["prevent"])),onDrop:D=>!t.disabled&&!u.value.has(V)&&S(b,V,D)},[u.value.has(V)?(e.openBlock(),e.createBlock(e.unref(ce.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(e.openBlock(),e.createBlock(e.unref(ce.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),e.createElementVNode("span",bw,e.toDisplayString(u.value.has(V)?e.unref(a)("dynamicUploadList.uploading"):e.unref(a)("dynamicUploadList.clickOrDrag")),1),t.typeFile?(e.openBlock(),e.createElementBlock("span",yw,e.toDisplayString(t.typeFile),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:`dyn-upload-input-${V}`,type:"file",class:"sr-only",disabled:t.disabled||u.value.has(V),accept:t.typeFile,onChange:D=>E(b,V,D)},null,40,xw)],42,gw))])}),128))],2),e.createVNode(Fn,{modelValue:h.value,"onUpdate:modelValue":x[2]||(x[2]=b=>h.value=b),title:g.value,"max-width":k.value==="application/pdf"?"720":"500",class:e.normalizeClass(k.value==="application/pdf"?"max-w-[40vw]":""),"content-class":k.value==="application/pdf"?"p-0 overflow-hidden":"px-6 py-1 overflow-y-auto"},{actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"px-4 py-2 border border-slate-200 dark:border-zinc-700 rounded-md text-sm font-medium hover:bg-slate-50 dark:hover:bg-zinc-800 transition-colors",onClick:x[1]||(x[1]=b=>h.value=!1)},e.toDisplayString(e.unref(a)("common.close")||"Close"),1)]),default:e.withCtx(()=>[e.createElementVNode("div",kw,[k.value.startsWith("image/")?(e.openBlock(),e.createElementBlock("img",{key:0,src:m.value,alt:g.value,class:"w-full h-auto max-h-[72vh] object-contain rounded-lg shadow-md"},null,8,ww)):k.value==="application/pdf"?(e.openBlock(),e.createElementBlock("iframe",{key:1,src:`${m.value}${m.value.includes("#")?"":"#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"}`,class:"w-full h-[70vh] rounded-lg border border-slate-200",title:"Document Preview"},null,8,Cw)):(e.openBlock(),e.createElementBlock("div",Ew,[e.createVNode(e.unref(ce.FileText),{class:"w-16 h-16 stroke-1"}),e.createElementVNode("span",Bw,e.toDisplayString(e.unref(a)("dynamicUploadList.noSupportPreview")||"Preview not supported for this file type"),1),e.createElementVNode("a",{href:m.value,target:"_blank",class:"px-4 py-2 bg-primary-500 text-white rounded-md text-sm font-semibold hover:bg-primary-600 transition-colors"},e.toDisplayString(e.unref(a)("dynamicUploadList.viewOriginal")||"View Original"),9,_w)]))])]),_:1},8,["modelValue","title","max-width","class","content-class"])]))}}),Ud=e.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(t){const n=t,o=e.computed(()=>Gt[n.icon]??Gt.X);return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Jt),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{size:Number(t.iconSize)},null,8,["size"]))]),_:1}))}}),Sw=e.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Ie)(e.unref(Aw)({variant:t.variant}),n.class)),role:"alert"},[e.renderSlot(o.$slots,"default")],2))}}),Vw=e.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Ie)("text-sm [&_p]:leading-relaxed",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Aw=wr("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Ls=e.defineComponent({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Ie)(e.unref(Dw)({variant:t.variant}),n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Dw=wr("inline-flex gap-1 items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),$s=e.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Ie)("rounded-xl border bg-card text-card-foreground shadow",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),js=e.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Ie)("p-6 pt-0",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Ws=e.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Ie)("flex flex-col gap-y-1.5 p-6",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Us=e.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("h3",{class:e.normalizeClass(e.unref(Ie)("font-medium leading-none tracking-tight",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Nw={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},Mw={class:"flex flex-wrap items-center justify-center gap-2"},vw=["accept","multiple"],ra=Ot(e.defineComponent({name:"DCodeDropzone",__name:"DCodeDropzone",props:{label:{default:"Upload File"},hint:{default:"Drag & drop file di sini atau klik area ini"},accept:{default:"*/*"},maxSizeMb:{default:2},mode:{default:"single"},disabled:{type:Boolean,default:!1},showSelected:{type:Boolean,default:!0},error:{default:null}},emits:["picked","picked:multiple","error"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(null),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);e.computed(()=>o.accept||"file/*");const d=e.computed(()=>o.error??i.value);function u(){var x;o.disabled||(x=a.value)==null||x.click()}function f(x){const b=x/1024,V=b/1024;return V>=1?`${V.toFixed(2)} MB`:b>=1?`${b.toFixed(1)} KB`:`${x} B`}function h(x){var V;if(!x)return"File tidak valid";if((V=o.accept)!=null&&V.includes("image/")&&!x.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const b=(o.maxSizeMb??2)*1024*1024;return x.size>b?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null}function m(x){l.value=x.name,c.value=x.size}function g(x){if(i.value=null,!x.length)return;if(o.mode==="single"){const V=x[0],A=h(V);if(A){i.value=A,r("error",A);return}o.showSelected&&m(V),r("picked",V);return}const b=[];for(const V of x){const A=h(V);if(A){i.value=A,r("error",A);return}b.push(V)}b.length&&(o.showSelected&&m(b[0]),r("picked:multiple",b))}function k(x){const b=x.target,V=Array.from(b.files??[]);g(V),b.value=""}function y(){o.disabled||(s.value=!0)}function p(){o.disabled||(s.value=!0)}function E(){s.value=!1}function _(x){var A,D;if(o.disabled)return;s.value=!1;const b=Array.from(((A=x.dataTransfer)==null?void 0:A.files)??[]),V=(D=o.accept)!=null&&D.includes("image/")?b.filter(N=>N.type.startsWith("image/")):b;g(V)}const B=e.computed(()=>(o.accept||"file/*").split(",").map(x=>x.trim()).filter(Boolean).map(x=>x==="image/*"?"IMAGE":x.replace(/^image\//,"").replace(/^\./,"")).join(", "));e.computed(()=>`${o.maxSizeMb??0}MB`);const S=e.ref(!1),w=e.computed(()=>{if(o.disabled||!S.value)return{};const x=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark");return{borderColor:x?"hsl(var(--primary) / 0.5)":"hsl(var(--primary) / 0.6)",backgroundColor:x?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"}});return(x,b)=>(e.openBlock(),e.createBlock(e.unref($s),{class:e.normalizeClass([t.disabled?"opacity-60":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(e.unref(Ws),{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(Us),{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1})]),_:1}),e.createVNode(e.unref(js),{class:"pt-2"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["d-dropzone-area flex justify-center items-center rounded-xl border-2 border-dashed transition cursor-pointer select-none",[s.value?"is-dragging border-primary bg-primary/10 dark:bg-primary/20 -translate-y-[1px]":"border-border dark:border-neutral-700 bg-muted/30 dark:bg-neutral-800/50",t.disabled?"is-disabled":""]]),style:e.normalizeStyle([{minHeight:"190px"},w.value]),onClick:u,onDragenter:e.withModifiers(y,["prevent"]),onDragover:e.withModifiers(p,["prevent"]),onDragleave:e.withModifiers(E,["prevent"]),onDrop:e.withModifiers(_,["prevent"]),onMouseenter:b[0]||(b[0]=V=>S.value=!0),onMouseleave:b[1]||(b[1]=V=>S.value=!1)},[e.createElementVNode("div",Nw,[b[2]||(b[2]=e.createElementVNode("div",{class:"text-sm font-medium dark:text-neutral-200"},"Drag & drop file di sini",-1)),b[3]||(b[3]=e.createElementVNode("div",{class:"text-xs text-muted-foreground dark:text-neutral-400"},"atau klik area ini untuk memilih file",-1)),e.createElementVNode("div",Mw,[e.createVNode(e.unref(Ls),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Allowed: "+e.toDisplayString(B.value),1)]),_:1}),e.createVNode(e.unref(Ls),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Max: "+e.toDisplayString(o.maxSizeMb)+"MB ",1)]),_:1})]),t.showSelected&&l.value?(e.openBlock(),e.createBlock(e.unref(Ls),{key:0,variant:"secondary",class:"mt-2 dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value)+" • "+e.toDisplayString(c.value?f(c.value):""),1)]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("input",{ref_key:"fileInputEl",ref:a,type:"file",class:"hidden",accept:t.accept,multiple:t.mode==="multiple",onChange:k},null,40,vw)],38),d.value?(e.openBlock(),e.createBlock(e.unref(Sw),{key:0,variant:"destructive",class:"mt-3"},{default:e.withCtx(()=>[e.createVNode(e.unref(Vw),{class:"text-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"]))}}),[["__scopeId","data-v-d8943808"]]),Pw={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Tw=["src"],Ow={key:1,class:"h-full w-full flex flex-col items-center justify-center text-muted-foreground dark:text-neutral-400 gap-2 p-4 text-center"},Fw={class:"space-y-0.5"},zw={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},Iw={class:"text-xs opacity-70"},Rw=["disabled"],Lw={key:1},$w=["disabled"],jw={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},Ww={class:"flex gap-2"},Uw={class:"font-medium truncate"},Hw={class:"flex gap-2"},qw={class:"font-medium"},Gw={class:"flex gap-2"},Xw={class:"font-medium truncate"},Hs=Ot(e.defineComponent({name:"DCodeFileResult",__name:"DCodeFileResult",props:{file:{},title:{default:"File Terpilih"},description:{default:""},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:220},showEdit:{type:Boolean,default:!0},showReplace:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0},forceFileIcon:{type:Boolean,default:!1}},emits:["edit","replace","remove"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(null),s=e.computed(()=>o.forceFileIcon||!o.file?!1:(o.file.type||"").startsWith("image/"));e.watch(()=>o.file,m=>{a.value&&URL.revokeObjectURL(a.value),a.value=m?URL.createObjectURL(m):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),u&&u.disconnect()});function i(m){const g=m/1024,k=g/1024;return k>=1?`${k.toFixed(2)} MB`:g>=1?`${g.toFixed(1)} KB`:`${m} B`}const l=e.computed(()=>o.file?{name:o.file.name,size:i(o.file.size),type:o.file.type||"unknown"}:null),c=e.ref(!1),d=e.ref(!1);let u=null;const f=()=>{typeof document<"u"&&(d.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{f(),typeof document<"u"&&(u=new MutationObserver(f),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),u.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const h=e.computed(()=>o.disabled||!c.value?{}:{borderColor:d.value?"hsl(var(--primary) / 0.4)":"hsl(var(--primary) / 0.5)",backgroundColor:d.value?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"});return(m,g)=>t.file?(e.openBlock(),e.createBlock($s,{key:0,class:e.normalizeClass([t.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(Ws,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(Us,{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createElementBlock("div",Pw,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(js,{class:"pt-2"},{default:e.withCtx(()=>{var k,y,p,E,_;return[e.createElementVNode("div",{class:"d-result-preview-wrap relative rounded-xl overflow-hidden border-2 border-dashed transition-colors duration-200 bg-muted dark:bg-neutral-900/30 border-border dark:border-neutral-700/50 w-full",style:e.normalizeStyle([{height:`${t.previewHeight}px`},h.value]),onMouseenter:g[2]||(g[2]=B=>c.value=!0),onMouseleave:g[3]||(g[3]=B=>c.value=!1)},[s.value&&a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Tw)):(e.openBlock(),e.createElementBlock("div",Ow,[e.createVNode(e.unref(ce.FileText),{class:"w-10 h-10"}),e.createElementVNode("div",Fw,[e.createElementVNode("p",zw,e.toDisplayString((k=l.value)==null?void 0:k.name),1),e.createElementVNode("p",Iw,e.toDisplayString((y=l.value)==null?void 0:y.size),1)])])),e.createElementVNode("div",{class:"d-action-buttons",style:e.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:c.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:c.value?"auto":"none"})},[t.showEdit&&s.value?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:t.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:g[0]||(g[0]=B=>r("edit"))},[e.createVNode(e.unref(ce.Pencil),{style:{width:"16px",height:"16px"}})],12,Rw)):(e.openBlock(),e.createElementBlock("div",Lw)),t.showRemove?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:t.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:g[1]||(g[1]=B=>r("remove"))},[e.createVNode(e.unref(ce.Trash2),{style:{width:"16px",height:"16px"}})],12,$w)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"d-metadata-overlay",style:e.normalizeStyle({position:"absolute",left:"8px",bottom:"8px",zIndex:10,display:"inline-block",maxWidth:"calc(100% - 16px)",borderRadius:"12px",border:"1px solid rgba(0,0,0,0.1)",padding:"8px 12px",boxShadow:"0 10px 15px -3px rgba(0,0,0,0.1)",backdropFilter:"blur(8px)",transition:"all 0.2s ease-in-out",opacity:c.value?1:0,transform:c.value?"translateY(0) scale(1)":"translateY(4px) scale(0.99)",backgroundColor:d.value?"rgba(38, 38, 38, 0.8)":"rgba(255, 255, 255, 0.8)",color:d.value?"#e5e5e5":"#171717"})},[e.createElementVNode("div",jw,[e.createElementVNode("div",Ww,[g[4]||(g[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",Uw,e.toDisplayString((p=l.value)==null?void 0:p.name),1)]),e.createElementVNode("div",Hw,[g[5]||(g[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",qw,e.toDisplayString((E=l.value)==null?void 0:E.size),1)]),e.createElementVNode("div",Gw,[g[6]||(g[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",Xw,e.toDisplayString((_=l.value)==null?void 0:_.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-bb5c9599"]]);function qs(){const t=s=>{var c;const i={type:s.type||"info",title:s.title,message:s.message,duration:s.duration??3e3};typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:toast",{detail:i,bubbles:!0,composed:!0})),(i.type==="error"?console.error:i.type==="warning"?console.warn:console.log)(`[Toast][${(c=i.type)==null?void 0:c.toUpperCase()}]`,i.title||"",i.message)};return{show:t,success:(s,i)=>t({type:"success",message:s,title:i}),error:(s,i)=>t({type:"error",message:s,title:i}),warning:(s,i)=>t({type:"warning",message:s,title:i}),info:(s,i)=>t({type:"info",message:s,title:i})}}const Kw={class:"space-y-3"},Yw={key:1,class:"flex items-center justify-center p-6 border rounded-lg bg-muted/30 dark:bg-neutral-800/20 dark:border-neutral-800"},Hd=e.defineComponent({name:"DCodeFileField",inheritAttrs:!1,__name:"DCodeFileField",props:{modelValue:{default:null},label:{default:"Upload File"},hint:{},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:void 0},allowedTypes:{default:null},accept:{default:"*/*"},minSizeMb:{default:null},maxSizeMb:{default:1},endpoint:{},uploadFn:{}},emits:["update:modelValue","error","uploaded"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:w=>r("update:modelValue",w)}),s=e.ref(null),i=e.ref(null);function l(w){i.value=w,r("error",w)}function c(){i.value=null}const d=e.computed(()=>{const w=(o.allowedTypes??"").trim();return w?w.split(/[,\s;]+/g).map(b=>b.trim().toLowerCase()).filter(Boolean).map(b=>b.includes("/")||b.startsWith(".")?b:`.${b}`):[]});function u(w){const x=w.lastIndexOf(".");return x>=0?w.slice(x).toLowerCase():""}const f=e.computed(()=>{if(d.value.length){const w=d.value.filter(b=>b.startsWith("."));return[...d.value.filter(b=>b.includes("/")),...w].join(",")}return o.accept}),h=e.computed(()=>d.value.length?d.value.join(", "):o.accept||"Semua File");function m(w){if(d.value.length){const x=(w.type||"").toLowerCase(),b=u(w.name);return d.value.some(V=>V.includes("/")?x===V:V.startsWith(".")?b===V:b===`.${V}`)}if(o.accept){if(o.accept==="*/*")return!0;const x=o.accept.split(",").map(A=>A.trim().toLowerCase()),b=(w.type||"").toLowerCase(),V=u(w.name);return x.some(A=>{if(A.endsWith("/*")){const D=A.slice(0,-2);return b.startsWith(D)}return A.startsWith(".")?V===A:b===A})}return!0}function g(w){return w*1024*1024}async function k(w){return w?m(w)?o.minSizeMb!=null&&w.size<g(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&w.size>g(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${h.value}`:"File tidak valid"}const{DCodeApi:y}=ft(),p=qs(),E=e.ref(!1);async function _(w){var x;if(o.uploadFn){try{E.value=!0;const b=await o.uploadFn(w);a.value=w,r("uploaded",b)}catch(b){console.error("Upload Error",b),p.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{E.value=!1}return}if(!((x=o.endpoint)!=null&&x.apiUrl)){a.value=w;return}if(typeof y!="function"){l("useApi() must expose DCodeApi()");return}try{E.value=!0;const b=new FormData;b.append("doc",w);const V=(o.endpoint.apiMethod||"POST").toUpperCase(),A=o.endpoint.apiUrl,D=await y("","",b,{_url:A,_method:V,withCredentials:!0,transformRequest:[(P,v)=>(v&&(delete v["Content-Type"],delete v["content-type"]),P)]}),N=(D==null?void 0:D.data)??D;a.value=w,r("uploaded",N)}catch(b){console.error("Upload Error",b),p.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{E.value=!1}}async function B(w){var b;if(o.disabled)return;c();const x=await k(w);if(x){l(x);return}s.value=w,o.uploadFn||(b=o.endpoint)!=null&&b.apiUrl?await _(w):a.value=w}function S(){c(),a.value=null,s.value=null}return e.watch(()=>o.modelValue,w=>{w&&!s.value&&(s.value=w),w||(s.value=null)},{immediate:!0}),(w,x)=>(e.openBlock(),e.createElementBlock("div",Kw,[a.value?E.value?(e.openBlock(),e.createElementBlock("div",Yw,[...x[1]||(x[1]=[e.createElementVNode("span",{class:"text-sm text-muted-foreground dark:text-neutral-400 animate-pulse"},"Uploading...",-1)])])):(e.openBlock(),e.createBlock(Hs,{key:2,file:a.value,title:t.label,description:t.hint,disabled:t.disabled,"show-edit":!1,"show-replace":!1,"show-remove":!0,"force-file-icon":!0,"preview-height":t.previewHeight,"preview-width":t.previewWidth,onRemove:S},null,8,["file","title","description","disabled","preview-height","preview-width"])):(e.openBlock(),e.createBlock(ra,{key:0,label:t.label,hint:t.hint,accept:f.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled||E.value,onPicked:B,error:i.value,onError:x[0]||(x[0]=b=>l(b))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),Jw=["for"],Qw={key:0,class:"!ml-1 !text-destructive"},Zw={class:"relative w-full block box-border"},e1={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},t1=["id","readonly","disabled","placeholder"],n1={class:"absolute inset-y-0 right-4 flex items-center z-10"},o1={key:1,class:"absolute z-50 mt-1 w-full rounded-xl border bg-white dark:bg-neutral-800 border-neutral-200/60 dark:border-neutral-700/50 shadow-lg box-border"},r1={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},a1={key:1,class:"text-sm text-muted-foreground text-center"},s1=["onClick","title"],i1={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},l1={class:"flex items-center justify-center flex-1"},c1={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},d1={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},qd=e.defineComponent({name:"DCodeIconDropdown",__name:"DCodeIconDropdown",props:{modelValue:{},label:{},placeholder:{default:"Pilih icon…"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},columns:{default:4},maxHeight:{default:"335px"},iconSize:{default:20},pageSize:{default:120}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=t,r=n,a=Gt,s=e.ref(null),i=e.ref(null),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-icon-dropdown-${o.label||"icon-dropdown"}-${l}`),d=e.ref(!1),u=e.computed(()=>(o.modelValue??"").trim()||""),f=e.ref(""),h=e.ref(!1),m=e.ref(!1),g=e.ref(!1),k=e.shallowRef([]),y=e.ref(o.pageSize),p=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),E=async()=>{if(m.value||g.value)return;g.value=!0,await new Promise(W=>setTimeout(W,0));const T=Object.keys(a).filter(W=>!p.has(W)).filter(W=>/^[A-Z]/.test(W)).filter(W=>typeof a[W]=="function"||typeof a[W]=="object"&&a[W]).sort((W,ne)=>W.localeCompare(ne));k.value=T,m.value=!0,g.value=!1},_=e.computed(()=>!m.value||!u.value||!k.value.includes(u.value)?null:a[u.value]),B=e.ref(u.value),S=e.computed(()=>!!u.value&&!d.value),w=e.computed(()=>{if(!m.value)return[];const T=(f.value??"").trim().toLowerCase();return T?k.value.filter(W=>W.toLowerCase().includes(T)):k.value}),x=e.computed(()=>w.value.slice(0,y.value)),b=e.computed(()=>{const T=o.columns;return T<=2?"grid-cols-2":T===3?"grid-cols-3":T===4?"grid-cols-4":T===5?"grid-cols-5":T>=8?"grid-cols-8":"grid-cols-6"});e.computed(()=>o.clearable?"!pr-10":"!pr-3"),e.computed(()=>_.value&&!d.value?"!pl-12":"!pl-3");const V=async()=>{var T;await e.nextTick(),(T=i.value)==null||T.focus()},A=async T=>{if(o.disabled)return;const W=T!==!1;if(h.value){h.value=!1;return}d.value=!0,await E(),W&&(f.value="",B.value=""),y.value=o.pageSize,await V()},D=()=>{d.value=!1,f.value="",B.value=u.value,y.value=o.pageSize},N=async()=>{o.disabled||(d.value?D():await A())};let P=null;const v=async T=>{if(o.disabled)return;r("update:modelValue",null),d.value||await A(!1),P&&clearTimeout(P);const W=B.value;P=setTimeout(()=>{f.value=W},300)},Q=T=>{o.disabled||(r("update:modelValue",T),D(),queueMicrotask(()=>{var W;return(W=i.value)==null?void 0:W.blur()}))},$=()=>{o.disabled||(r("update:modelValue",null),r("clear"),h.value=!0,D(),queueMicrotask(()=>{var T;return(T=i.value)==null?void 0:T.focus()}))},q=T=>{if(T.key==="Escape"){T.preventDefault(),D();return}if(T.key==="Enter"&&d.value){const W=w.value[0];W&&(T.preventDefault(),Q(W))}},Y=T=>{if(!d.value)return;const W=T.target;s.value&&!s.value.contains(W)&&D()},X=T=>{const W=T.target;W.scrollTop+W.clientHeight>=W.scrollHeight-24&&y.value<w.value.length&&(y.value=Math.min(y.value+o.pageSize,w.value.length))};return e.onMounted(()=>{document.addEventListener("mousedown",Y),queueMicrotask(()=>{var T;i.value=((T=s.value)==null?void 0:T.querySelector("input"))??null}),u.value&&E()}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Y),P&&clearTimeout(P)}),e.watch(u,T=>{d.value||(B.value=T)}),e.watch(()=>f.value,()=>{y.value=o.pageSize}),(T,W)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:s,class:"!w-full !block !box-border"},[o.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"!text-sm !font-medium !mb-1 !block"},[e.createTextVNode(e.toDisplayString(o.label)+" ",1),o.required?(e.openBlock(),e.createElementBlock("span",Qw,"*")):e.createCommentVNode("",!0)],8,Jw)):e.createCommentVNode("",!0),e.createElementVNode("div",Zw,[_.value&&!d.value?(e.openBlock(),e.createElementBlock("div",e1,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(_.value),{size:18}))])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{id:c.value,"onUpdate:modelValue":W[0]||(W[0]=ne=>B.value=ne),readonly:S.value,disabled:o.disabled,placeholder:o.placeholder,class:e.normalizeClass(["w-full h-10 m-0 py-0 rounded-lg border bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 pr-10 outline-none box-border truncate",[_.value&&!d.value?"pl-10":"pl-4",S.value?"cursor-pointer select-none":""]]),onClick:A,onFocus:A,onInput:v,onKeydown:q},null,42,t1),[[e.vModelText,B.value]]),e.createElementVNode("div",n1,[o.clearable&&u.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center p-1 m-0 bg-transparent border-0 text-muted-foreground hover:text-foreground transition cursor-pointer outline-none",onMousedown:W[1]||(W[1]=e.withModifiers(()=>{},["prevent"])),onClick:$,title:"Clear"},[e.createVNode(e.unref(ce.X),{class:"h-4 w-4"})],32)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"flex items-center justify-center p-1 m-0 bg-transparent border-0 text-muted-foreground hover:text-foreground transition-transform cursor-pointer outline-none",onMousedown:W[2]||(W[2]=e.withModifiers(()=>{},["prevent"])),onClick:N,title:"Open"},[e.createVNode(e.unref(ce.ChevronDown),{class:"h-4 w-4"})],32))]),d.value?(e.openBlock(),e.createElementBlock("div",o1,[e.createElementVNode("div",{class:"p-2 overflow-auto",style:e.normalizeStyle({maxHeight:o.maxHeight}),onScroll:X},[g.value?(e.openBlock(),e.createElementBlock("div",r1,[e.createVNode(e.unref(ce.Loader2),{class:"h-4 w-4 animate-spin"}),W[3]||(W[3]=e.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):m.value&&w.value.length===0?(e.openBlock(),e.createElementBlock("div",a1," Icon tidak ditemukan ")):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["grid gap-2",b.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,ne=>(e.openBlock(),e.createElementBlock("button",{key:ne,type:"button",class:e.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===ne?"ring-1 ring-primary":""]),onClick:Z=>Q(ne),title:ne},[e.createElementVNode("div",i1,[e.createElementVNode("div",l1,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)[ne]),{size:o.iconSize,class:"shrink-0"},null,8,["size"]))]),e.createElementVNode("span",c1,e.toDisplayString(ne),1)])],10,s1))),128))],2)),m.value&&w.value.length>0?(e.openBlock(),e.createElementBlock("div",d1," Showing "+e.toDisplayString(x.value.length)+" / "+e.toDisplayString(w.value.length),1)):e.createCommentVNode("",!0)],36)])):e.createCommentVNode("",!0)])],512))}}),u1={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},f1={class:"flex items-center justify-between border-b dark:border-neutral-700/50 px-6 py-4"},h1={class:"relative overflow-auto p-0"},Gs=e.defineComponent({name:"DCodeImageCropperDialog",inheritAttrs:!1,__name:"DCodeImageCropperDialog",props:{modelValue:{type:Boolean},file:{},title:{default:"Resize & Crop Gambar"},description:{default:""},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!1}},emits:["update:modelValue","done","cancel"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:_=>r("update:modelValue",_)}),s=e.ref(null),i=e.ref(null);let l=null,c=!1,d=0,u=null;function f(){if(l){try{l.close()}catch{}l=null,u&&(u.disconnect(),u=null),s.value&&(s.value.innerHTML=""),i.value=null}}async function h(_,B,S,w,x){const b=await new Promise((D,N)=>{const P=URL.createObjectURL(_),v=new Image;v.onload=()=>{URL.revokeObjectURL(P),D(v)},v.onerror=Q=>{URL.revokeObjectURL(P),N(Q)},v.src=P}),V=document.createElement("canvas");V.width=B,V.height=S;const A=V.getContext("2d");return A?(A.drawImage(b,0,0,B,S),await new Promise(D=>{V.toBlob(N=>D(N||_),w,x)})):_}function m(){if(!l||!i.value)return;const _=l.getPlugin("Dashboard"),B=l.getFile(i.value);!_||!B||requestAnimationFrame(()=>{try{_.openFileEditor(B)}catch{try{_.openFileEditor(i.value)}catch{}}})}async function g(_){if(l){l.cancelAll(),i.value=null;try{const B=l.addFile({name:_.name,type:_.type,data:_,source:"Local",isRemote:!1});i.value=String(B)}catch{}}}function k(){if(!s.value)return;l&&f(),l=new yu({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const _=document.documentElement.classList.contains("dark");l.use(hi,{target:s.value,inline:!0,height:480,theme:_?"dark":"light",proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),u=new MutationObserver(()=>{if(!l)return;const B=document.documentElement.classList.contains("dark"),S=l.getPlugin("Dashboard");S&&S.setOptions({theme:B?"dark":"light"})}),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(xu,{target:hi,quality:o.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:o.aspectRatio==null?Number.NaN:o.aspectRatio}}),l.on("file-editor:cancel",()=>{a.value=!1}),l.on("file-added",B=>{i.value=(B==null?void 0:B.id)??null,o.autoOpenEditor&&setTimeout(()=>m(),80)}),l.on("file-editor:complete",async B=>{const S=++d;try{const w=B.data,x=w.type||B.type||"image/jpeg";let b=w;if(o.outputWidth&&o.outputHeight&&(b=await h(w,o.outputWidth,o.outputHeight,x,o.quality)),c||S!==d)return;const V=B.name||"edited-image.jpg",A=new File([b],V,{type:x});await y(A,"UPPY_EDITOR_COMPLETE"),r("done",A),a.value=!1}catch{}})}async function y(_,B="CROP_RESULT"){const S=URL.createObjectURL(_);try{const w=await new Promise((x,b)=>{const V=new Image;V.onload=()=>x(V),V.onerror=b,V.src=S});console.group(B),console.log("file:",_),console.table({name:_.name,type:_.type,sizeBytes:_.size,sizeMB:+(_.size/1024/1024).toFixed(3),width:w.naturalWidth,height:w.naturalHeight,ratio:+(w.naturalWidth/w.naturalHeight).toFixed(4)}),console.log("previewUrl:",S),console.groupEnd()}finally{URL.revokeObjectURL(S)}}e.watch(a,async _=>{c=!_,d++,_?(await e.nextTick(),k(),o.file&&await g(o.file)):f()},{flush:"post"}),e.watch(()=>o.file,async _=>{a.value&&_&&(await e.nextTick(),await g(_))}),e.onBeforeUnmount(()=>{c=!0,d++,f()});const p=_=>{_.key==="Escape"&&a.value&&(a.value=!1)};e.watch(a,_=>{_?globalThis.addEventListener("keydown",p):globalThis.removeEventListener("keydown",p)},{immediate:!0});const E=e.ref(!1);return(_,B)=>a.value?(e.openBlock(),e.createElementBlock("div",u1,[e.createVNode(e.Transition,{appear:"","enter-active-class":"duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:B[0]||(B[0]=S=>a.value=!1)})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{appear:"","enter-active-class":"duration-300 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to-class":"opacity-100 scale-100 translate-y-0 sm:scale-100","leave-active-class":"duration-200 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0 sm:scale-100","leave-to-class":"opacity-0 scale-95 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative flex w-fit max-w-4xl flex-col overflow-hidden rounded-xl border border-border dark:border-neutral-700/50 bg-background dark:bg-neutral-800 shadow-2xl transition-all",onClick:B[4]||(B[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",f1,[B[6]||(B[6]=e.createElementVNode("h3",{class:"text-lg font-semibold leading-none tracking-tight dark:text-neutral-100"}," Crop & Resize ",-1)),e.createElementVNode("button",{class:"d-close-btn rounded-sm dark:text-neutral-400 ring-offset-background transition-opacity focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",style:e.normalizeStyle({opacity:E.value?1:.7}),onClick:B[1]||(B[1]=S=>a.value=!1),onMouseenter:B[2]||(B[2]=S=>E.value=!0),onMouseleave:B[3]||(B[3]=S=>E.value=!1)},[e.createVNode(e.unref(ce.X),{class:"h-4 w-4"}),B[5]||(B[5]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),e.createElementVNode("div",h1,[e.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)}}),m1={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},p1=["src"],g1=["disabled"],b1=["disabled"],y1={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},x1={class:"flex gap-2"},k1={class:"font-medium truncate"},w1={class:"flex gap-2"},C1={class:"font-medium"},E1={class:"flex gap-2"},B1={class:"font-medium truncate"},Xs=Ot(e.defineComponent({name:"DCodeImageResult",__name:"DCodeImageResult",props:{file:{},title:{default:"Hasil Gambar"},description:{default:""},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:220},showEdit:{type:Boolean,default:!0},showReplace:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0}},emits:["edit","replace","remove"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(null);e.watch(()=>o.file,h=>{a.value&&URL.revokeObjectURL(a.value),a.value=h?URL.createObjectURL(h):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),d&&d.disconnect()});function s(h){const m=h/1024,g=m/1024;return g>=1?`${g.toFixed(2)} MB`:m>=1?`${m.toFixed(1)} KB`:`${h} B`}const i=e.computed(()=>o.file?{name:o.file.name,size:s(o.file.size),type:o.file.type||"unknown"}:null),l=e.ref(!1),c=e.ref(!1);let d=null;const u=()=>{typeof document<"u"&&(c.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{u(),typeof document<"u"&&(d=new MutationObserver(u),d.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),d.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const f=e.computed(()=>o.disabled||!l.value?{}:{borderColor:c.value?"hsl(var(--primary) / 0.4)":"hsl(var(--primary) / 0.5)",backgroundColor:c.value?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"});return(h,m)=>t.file?(e.openBlock(),e.createBlock($s,{key:0,class:e.normalizeClass([t.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(Ws,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(Us,{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createElementBlock("div",m1,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(js,{class:"pt-2"},{default:e.withCtx(()=>{var g,k,y;return[e.createElementVNode("div",{class:"d-result-preview-wrap relative rounded-xl overflow-hidden border-2 border-dashed transition-colors duration-200 bg-muted dark:bg-neutral-900/30 border-border dark:border-neutral-700/50 w-full",style:e.normalizeStyle([{height:`${t.previewHeight}px`},f.value]),onMouseenter:m[2]||(m[2]=p=>l.value=!0),onMouseleave:m[3]||(m[3]=p=>l.value=!1)},[a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,p1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"d-action-buttons",style:e.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:l.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:l.value?"auto":"none"})},[t.showEdit?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:t.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:m[0]||(m[0]=p=>r("edit"))},[e.createVNode(e.unref(ce.Pencil),{style:{width:"16px",height:"16px"}})],12,g1)):e.createCommentVNode("",!0),t.showRemove?(e.openBlock(),e.createElementBlock("button",{key:1,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:t.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:m[1]||(m[1]=p=>r("remove"))},[e.createVNode(e.unref(ce.Trash2),{style:{width:"16px",height:"16px"}})],12,b1)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"d-metadata-overlay",style:e.normalizeStyle({position:"absolute",left:"8px",bottom:"8px",zIndex:10,display:"inline-block",maxWidth:"calc(100% - 16px)",borderRadius:"12px",border:"1px solid rgba(0,0,0,0.1)",padding:"8px 12px",boxShadow:"0 10px 15px -3px rgba(0,0,0,0.1)",backdropFilter:"blur(8px)",transition:"all 0.2s ease-in-out",opacity:l.value?1:0,transform:l.value?"translateY(0) scale(1)":"translateY(4px) scale(0.99)",backgroundColor:c.value?"rgba(38, 38, 38, 0.8)":"rgba(255, 255, 255, 0.8)",color:c.value?"#e5e5e5":"#171717"})},[e.createElementVNode("div",y1,[e.createElementVNode("div",x1,[m[4]||(m[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",k1,e.toDisplayString((g=i.value)==null?void 0:g.name),1)]),e.createElementVNode("div",w1,[m[5]||(m[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",C1,e.toDisplayString((k=i.value)==null?void 0:k.size),1)]),e.createElementVNode("div",E1,[m[6]||(m[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",B1,e.toDisplayString((y=i.value)==null?void 0:y.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-e1d893ab"]]),_1={class:"space-y-3"},aa=e.defineComponent({name:"DCodeImageField",inheritAttrs:!1,__name:"DCodeImageField",props:{modelValue:{default:null},label:{default:"Upload Gambar"},hint:{default:"Drag & drop atau klik area ini"},disabled:{type:Boolean,default:!1},allowedTypes:{default:null},accept:{default:"image/*"},minSizeMb:{default:null},maxSizeMb:{default:1},title:{default:"Hasil Gambar"},description:{default:""},previewWidth:{default:360},previewHeight:{default:220},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!0},minWidth:{default:null},minHeight:{default:null},maxWidth:{default:null},maxHeight:{default:null},endpoint:{},uploadFn:{},editUseOriginal:{type:Boolean,default:!1}},emits:["update:modelValue","error","uploaded"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:$=>r("update:modelValue",$)}),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);function d($){c.value=$,r("error",$)}function u(){c.value=null}const f=e.computed(()=>{const $=(o.allowedTypes??"").trim();return $?$.split(/[,\s;]+/g).map(Y=>Y.trim().toLowerCase()).filter(Boolean).map(Y=>Y.includes("/")||Y.startsWith(".")?Y:`.${Y}`):[]});function h($){const q=$.lastIndexOf(".");return q>=0?$.slice(q).toLowerCase():""}const m=e.computed(()=>{if(f.value.length){const $=f.value.filter(Y=>Y.startsWith("."));return[...f.value.filter(Y=>Y.includes("/")),...$].join(",")}return o.accept||"image/*"}),g=e.computed(()=>f.value.length?f.value.join(", "):o.accept||"image/*");function k($){if(f.value.length){const Y=($.type||"").toLowerCase(),X=h($.name);return f.value.some(T=>T.includes("/")?Y===T:T.startsWith(".")?X===T:X===`.${T}`)}return(o.accept||"image/*").toLowerCase().includes("image/")?($.type||"").toLowerCase().startsWith("image/"):!0}function y($){return $*1024*1024}async function p($){var q;return(q=$.type)!=null&&q.startsWith("image/")?await new Promise(Y=>{const X=URL.createObjectURL($),T=new Image;T.onload=()=>{URL.revokeObjectURL(X),Y({w:T.naturalWidth,h:T.naturalHeight})},T.onerror=()=>{URL.revokeObjectURL(X),Y(null)},T.src=X}):null}async function E($){if(!(o.minWidth!=null||o.minHeight!=null||o.maxWidth!=null||o.maxHeight!=null))return null;const Y=await p($);return Y?o.minWidth!=null&&Y.w<o.minWidth?`Lebar gambar minimal ${o.minWidth}px`:o.minHeight!=null&&Y.h<o.minHeight?`Tinggi gambar minimal ${o.minHeight}px`:o.maxWidth!=null&&Y.w>o.maxWidth?`Lebar gambar maksimal ${o.maxWidth}px`:o.maxHeight!=null&&Y.h>o.maxHeight?`Tinggi gambar maksimal ${o.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function _($){return $?k($)?o.minSizeMb!=null&&$.size<y(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&$.size>y(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:await E($):`only Allowed: ${g.value}`:"File tidak valid"}function B($){o.disabled||(i.value=$,s.value=!0)}async function S($){if(o.disabled)return;u();const q=await _($);if(q){d(q);return}l.value=$,B($)}const{DCodeApi:w}=ft(),x=qs(),b=e.ref(!1);e.ref(null);function V($,q){return!$||!q?null:$.replace(/\/+$/,"")+"/"+q.replace(/^\/+/,"")}function A($){var T;const q=($==null?void 0:$.data)??$,Y=(T=q==null?void 0:q.data)==null?void 0:T[0];if(!Y)return null;const X=V(Y.server,Y.url);return{...Y,fullUrl:X?encodeURI(X):null}}async function D($){var q;if(o.uploadFn){try{b.value=!0;const Y=await o.uploadFn($);a.value=$,r("uploaded",Y)}catch(Y){console.error("Upload Error",Y),x.error("Upload Failed",(Y==null?void 0:Y.message)||"Unknown error"),d((Y==null?void 0:Y.message)||"Upload Failed")}finally{b.value=!1}return}if(!((q=o.endpoint)!=null&&q.apiUrl)){a.value=$;return}if(typeof w!="function"){d("useApi() must expose DCodeApi()");return}try{b.value=!0;const Y=new FormData;Y.append("doc",$);const X=(o.endpoint.apiMethod||"POST").toUpperCase(),T=o.endpoint.apiUrl,W=await w("","",Y,{_url:T,_method:X,withCredentials:!0,transformRequest:[(Z,K)=>(K&&(delete K["Content-Type"],delete K["content-type"]),Z)]}),ne=(W==null?void 0:W.data)??W;A(ne),a.value=$,r("uploaded",ne)}catch(Y){console.error("Upload Error",Y),x.error("Upload Failed",(Y==null?void 0:Y.message)||"Unknown error"),d((Y==null?void 0:Y.message)||"Upload Failed")}finally{b.value=!1}}async function N($){var q;u(),o.uploadFn||(q=o.endpoint)!=null&&q.apiUrl?await D($):a.value=$,s.value=!1,i.value=null}function P(){s.value=!1,i.value=null}async function v(){if(!a.value)return;u();const $=o.editUseOriginal?l.value??a.value:a.value,q=await _($);if(q){d(q);return}B($)}function Q(){u(),a.value=null,i.value=null,s.value=!1,l.value=null}return e.watch(()=>o.modelValue,$=>{$&&!l.value&&(l.value=$),$||(l.value=null)},{immediate:!0}),($,q)=>(e.openBlock(),e.createElementBlock("div",_1,[a.value?(e.openBlock(),e.createBlock(Xs,{key:1,file:a.value,title:t.label,description:t.description,"preview-width":t.previewWidth,disabled:t.disabled,"show-edit":!0,"show-remove":!0,"show-replace":!1,onEdit:v,onRemove:Q,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(e.openBlock(),e.createBlock(ra,{key:0,label:t.label,hint:t.hint,accept:m.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled,onPicked:S,error:c.value,onError:q[0]||(q[0]=Y=>d(Y))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),e.createVNode(Gs,{modelValue:s.value,"onUpdate:modelValue":q[1]||(q[1]=Y=>s.value=Y),file:i.value,title:t.title,description:t.description,"auto-open-editor":t.autoOpenEditor,"aspect-ratio":t.aspectRatio,"output-width":t.outputWidth,"output-height":t.outputHeight,quality:t.quality,onDone:N,onCancel:P},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),S1=["aria-busy"],V1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},A1=["for"],D1={key:0,class:"ml-1 text-destructive"},N1=["id","disabled"],M1={class:"min-w-0 flex-1 text-left"},v1={key:0,class:"flex flex-wrap gap-1.5"},P1={class:"max-w-[220px] truncate"},T1=["onClick"],O1={key:0,class:"inline-flex items-center rounded-md border px-1.5 py-0.5 text-xs font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 border-transparent"},F1={key:1,class:"text-muted-foreground truncate"},z1={class:"flex items-center gap-2 shrink-0"},I1={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},R1=["placeholder","onKeydown"],L1={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},$1=["disabled","onClick"],j1={class:"truncate"},W1={key:0,class:"text-primary-600 dark:text-primary-400"},U1={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},H1={key:0},q1={key:1},G1={key:1,class:"text-xs text-destructive"},Ks=e.defineComponent({name:"DCodeMultiSelect",inheritAttrs:!1,__name:"DCodeMultiSelect",props:{modelValue:{},items:{default:()=>[]},endpoint:{default:void 0},fetchItems:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},refreshOnOpen:{type:Boolean,default:!1},label:{default:""},placeholder:{default:"Pilih data…"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:"Cari…"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},maxChips:{default:5},maxSelected:{default:5},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},returnObject:{type:Boolean,default:!1},virtual:{type:Boolean,default:!0},itemHeight:{default:40},maxRows:{default:5},overscan:{default:6},error:{default:null},required:{type:Boolean,default:!1}},emits:["update:modelValue","clear","max"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>(a.label||o.label)??void 0),i=e.computed(()=>a.visible??!0),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`app-multiselect-${o.id||s.value||"field"}-${l}`),d=e.computed(()=>{if(a.required)return!0;const re=o.required,de=o["aria-required"];return re===""||re===!0||re==="true"||(de==="true"||de===!0)}),u=e.computed(()=>!!a.error);function f(re){return re?typeof a.itemTitle=="function"?a.itemTitle(re)??"":String((re==null?void 0:re[a.itemTitle])??""):""}function h(re){return re?typeof a.itemValue=="function"?a.itemValue(re):re==null?void 0:re[a.itemValue]:null}function m(re,de){return h(re)??de}const g=e.computed(()=>Array.isArray(a.modelValue)?a.modelValue:[]),k=e.computed(()=>{var re;return!!((re=a.endpoint)!=null&&re.apiUrl)||!!a.fetchItems}),y=e.ref([]),p=e.ref(!1),E=e.ref(!1),_=e.computed(()=>{var de;const re=(de=a.endpoint)==null?void 0:de.apiOptions;if(re)return typeof re=="function"?re():re}),B=e.computed(()=>{var Ae,nt;const re=((Ae=a.endpoint)==null?void 0:Ae.apiUrl)??"",de=(((nt=a.endpoint)==null?void 0:nt.apiMethod)??"GET").toUpperCase(),me=JSON.stringify(_.value??null);return`${de} ${re} :: ${me}`}),S=e.computed(()=>k.value?y.value:a.items||[]);async function w(){var re;if(k.value&&!(!((re=a.endpoint)!=null&&re.apiUrl)&&!a.fetchItems)&&!p.value){p.value=!0;try{let de;if(a.fetchItems){const me=await a.fetchItems(),Ae=(me==null?void 0:me.data)??me;de=(Ae==null?void 0:Ae.data)??Ae}else{const{DCodeApi:me}=ft();if(typeof me!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const Ae={page:1,perPage:100,..._.value||{}},nt=await me("","",Ae,{_url:a.endpoint.apiUrl,_method:(a.endpoint.apiMethod||"GET").toUpperCase()}),Bt=(nt==null?void 0:nt.data)??nt;de=(Bt==null?void 0:Bt.data)??Bt}y.value=Array.isArray(de)?de:[],E.value=!0}catch(de){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",de),y.value=[]}finally{p.value=!1}}}e.watch(()=>B.value,()=>{y.value=[],E.value=!1}),e.onMounted(()=>{a.autoFetchOnMount&&k.value&&w()});const x=e.computed(()=>{const re=g.value;if(a.returnObject)return re;const de=new Map;for(const me of S.value)de.set(h(me),me);return re.map(me=>de.get(me)??{[a.itemValue]:me,[a.itemTitle]:String(me)})}),b=e.computed(()=>a.maxChips===null?x.value:x.value.slice(0,a.maxChips));function V(re){const de=g.value;if(a.returnObject){const me=h(re);return de.some(Ae=>h(Ae)===me)}return de.includes(h(re))}const A=e.computed(()=>{if(a.maxSelected===null||a.maxSelected===void 0)return null;const re=Number(a.maxSelected);return Number.isFinite(re)&&re>0?re:null}),D=e.computed(()=>{const re=A.value;return re===null?!1:g.value.length>=re});function N(re){return!V(re)&&D.value}const P=e.computed(()=>{const re=g.value,de=new Set;if(a.returnObject)for(const me of re)de.add(h(me));else for(const me of re)de.add(me);return de}),v=e.computed(()=>{const re=P.value;return(S.value||[]).filter(de=>!re.has(h(de)))}),Q=e.computed(()=>S.value.length===0?!1:v.value.length===0),$=e.ref(null),q=e.ref(null),Y=e.ref(null),X=e.ref(!1),T=e.ref(""),W=e.ref(0),ne=e.ref(0),{floatingStyles:Z}=La($,q,{whileElementsMounted:Oa,placement:"bottom-start",middleware:[Fa(8),Ia(),za({padding:8}),Ra({apply({rects:re,elements:de}){Object.assign(de.floating.style,{width:`${re.reference.width}px`,"--floating-width":`${re.reference.width}px`})}})]}),K=e.computed(()=>Z.value),ae=e.computed(()=>{const re=Number(a.maxRows);return Number.isFinite(re)&&re>0?re:5});async function ue(){a.disabled||(X.value=!0,ne.value=0,requestAnimationFrame(()=>{Y.value&&(Y.value.scrollTop=0),W.value=0}),k.value&&a.autoFetchOnOpen&&(a.refreshOnOpen||!E.value)&&!p.value&&await w())}function xe(){X.value=!1}function De(){X.value?xe():ue()}function we(re){var me,Ae;if(!X.value)return;const de=re.target;(me=$.value)!=null&&me.contains(de)||(Ae=q.value)!=null&&Ae.contains(de)||xe()}e.onMounted(()=>document.addEventListener("mousedown",we)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",we));function ee(re){if(a.disabled)return;if(N(re)){r("max");return}const de=[...g.value];if(a.returnObject){const me=h(re);if(de.some(nt=>h(nt)===me))return;r("update:modelValue",[...de,re])}else{const me=h(re);if(de.includes(me))return;r("update:modelValue",[...de,me])}T.value="",ne.value=0,requestAnimationFrame(()=>{Y.value&&(Y.value.scrollTop=0),W.value=0})}function z(re){if(a.disabled)return;const de=[...g.value];if(a.returnObject){const me=h(re);r("update:modelValue",de.filter(Ae=>h(Ae)!==me))}else{const me=h(re);r("update:modelValue",de.filter(Ae=>Ae!==me))}}function J(){a.disabled||(r("update:modelValue",[]),r("clear"),xe())}const se=e.computed(()=>{const re=T.value.trim().toLowerCase(),de=v.value;return re?de.filter(me=>f(me).toLowerCase().includes(re)):de}),Ee=e.computed(()=>se.value.length);e.watch(X,re=>{re||(T.value="")});const ve=e.computed(()=>{if(Q.value)return a.itemHeight;const re=Ee.value;return(re<=0?1:Math.min(re,ae.value))*a.itemHeight}),qe=e.computed(()=>a.virtual?Ee.value*a.itemHeight:0),Ge=e.computed(()=>a.virtual?Math.ceil(ve.value/a.itemHeight)+a.overscan:Ee.value),tt=e.computed(()=>{if(!a.virtual)return 0;const re=Math.floor(W.value/a.itemHeight)-Math.floor(a.overscan/2);return Math.max(0,re)}),ze=e.computed(()=>a.virtual?Math.min(Ee.value,tt.value+Ge.value):Ee.value),ut=e.computed(()=>a.virtual?tt.value*a.itemHeight:0),bt=e.computed(()=>{const re=se.value;return a.virtual?re.slice(tt.value,ze.value):re});function It(re){const de=re.target;W.value=de.scrollTop}function Mt(re){return re===ne.value}function G(re){const de=Y.value;if(!de||!a.virtual)return;const me=re*a.itemHeight,Ae=me+a.itemHeight,nt=de.scrollTop,Bt=de.scrollTop+de.clientHeight;me<nt?de.scrollTop=me:Ae>Bt&&(de.scrollTop=Ae-de.clientHeight)}function fe(re){const de=Math.max(0,Ee.value-1);ne.value=Math.min(de,Math.max(0,ne.value+re)),G(ne.value)}function _e(){const re=se.value[ne.value];re&&ee(re)}const $e=e.computed(()=>a.clearable&&!a.disabled&&x.value.length>0),Ve=e.computed(()=>u.value?"border-destructive ring-1 ring-destructive":X.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(re,de)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",V1)):e.createCommentVNode("",!0),de[3]||(de[3]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),d.value?(e.openBlock(),e.createElementBlock("span",D1,"*")):e.createCommentVNode("",!0)],8,A1)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"referenceEl",ref:$,class:"relative"},[e.createElementVNode("button",{id:c.value,type:"button",class:e.normalizeClass(["w-full justify-between h-auto min-h-10 px-3 py-2 transition border rounded-lg flex items-center",["bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 text-foreground dark:text-gray-300",Ve.value]]),disabled:a.disabled,onClick:De},[e.createElementVNode("div",M1,[x.value.length?(e.openBlock(),e.createElementBlock("div",v1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(me,Ae)=>(e.openBlock(),e.createElementBlock("div",{key:`chip-${m(me,Ae)}`,class:"inline-flex items-center rounded-md border px-1.5 py-0.5 text-xs font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 border-transparent gap-1"},[e.createElementVNode("span",P1,e.toDisplayString(f(me)),1),a.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:e.withModifiers(nt=>z(me),["stop"]),"aria-label":"Remove"}," ✕ ",8,T1))]))),128)),a.maxChips!==null&&x.value.length>a.maxChips?(e.openBlock(),e.createElementBlock("div",O1," +"+e.toDisplayString(x.value.length-(a.maxChips??0)),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",F1,e.toDisplayString(a.placeholder),1))]),e.createElementVNode("div",z1,[$e.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:e.withModifiers(J,["stop"]),"aria-label":"Clear"}," ✕ ")):e.createCommentVNode("",!0),e.createVNode(e.unref(ce.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,N1),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:q,class:"-mt-1 z-[9999] w-[var(--floating-width)] rounded-lg border shadow-lg overflow-hidden bg-white dark:bg-neutral-800 border-gray-200 dark:border-neutral-700/50",style:e.normalizeStyle(K.value)},[a.searchable&&!Q.value?(e.openBlock(),e.createElementBlock("div",I1,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":de[0]||(de[0]=me=>T.value=me),placeholder:a.searchPlaceholder,class:"w-full h-10 px-3 py-2 text-sm bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700/50 rounded-md focus:outline-none focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600",onKeydown:[de[1]||(de[1]=e.withKeys(e.withModifiers(me=>fe(1),["prevent"]),["down"])),de[2]||(de[2]=e.withKeys(e.withModifiers(me=>fe(-1),["prevent"]),["up"])),e.withKeys(e.withModifiers(_e,["prevent"]),["enter"]),e.withKeys(e.withModifiers(xe,["prevent"]),["esc"])]},null,40,R1),[[e.vModelText,T.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"listEl",ref:Y,class:"relative overflow-auto",style:e.normalizeStyle({height:ve.value+"px"}),onScroll:It},[Q.value?(e.openBlock(),e.createElementBlock("div",L1," All items have been selected ")):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.virtual?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({height:qe.value+"px"})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.virtual?"absolute left-0 top-0 w-full":""),style:e.normalizeStyle(a.virtual?{transform:`translateY(${ut.value}px)`}:void 0)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bt.value,(me,Ae)=>(e.openBlock(),e.createElementBlock("button",{key:String(m(me,tt.value+Ae)),type:"button",class:e.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[N(me)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",Mt(tt.value+Ae)?"bg-neutral-50 dark:bg-neutral-800/60":"",V(me)?"font-semibold":"font-normal"]]),style:e.normalizeStyle({height:a.itemHeight+"px"}),disabled:a.disabled||N(me),onClick:nt=>ee(me)},[e.createElementVNode("span",j1,e.toDisplayString(f(me)),1),V(me)?(e.openBlock(),e.createElementBlock("span",W1,"✓")):e.createCommentVNode("",!0)],14,$1))),128))],6),Ee.value===0?(e.openBlock(),e.createElementBlock("div",U1,[p.value?(e.openBlock(),e.createElementBlock("span",H1,"Loading data…")):(e.openBlock(),e.createElementBlock("span",q1,"Tidak ada data"))])):e.createCommentVNode("",!0)],64))],36)],4)):e.createCommentVNode("",!0)]))],512),u.value?(e.openBlock(),e.createElementBlock("p",G1,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,S1)),[[e.vShow,i.value]])}}),X1={class:"space-y-4"},K1={key:0,class:"flex flex-col gap-0.5"},Y1=["for"],J1=["for"],Q1={class:"text-[11px] text-gray-500 dark:text-gray-400"},Z1={class:"flex items-center gap-2 flex-nowrap"},eC=["id","value","disabled","onKeydown","onInput","onPaste"],sa=e.defineComponent({name:"DCodeOtpInput",inheritAttrs:!1,__name:"DCodeOtpInput",props:{modelValue:{default:""},totalInput:{default:6},default:{default:""},label:{default:""},endpoint:{},submitFn:{}},emits:["updateOtp","update:modelValue","complete","loading","success","error"],setup(t,{emit:n}){const o=e.useAttrs(),r=Math.random().toString(36).slice(2,7),a=e.computed(()=>`app-otp-${(o.id||s.label||"otp-field").replaceAll(/\s+/g,"-").toLowerCase()}-${r}`),s=t,i=n,l=e.ref([]),c=e.ref([]),d=e.ref(!1),{DCodeApi:u}=ft(),f=qs(),h=e.computed(()=>{const w=Number(s.totalInput);return w&&w>0?w:6}),m=()=>{c.value=Array.from({length:h.value},(w,x)=>{var b;return((b=s.default)==null?void 0:b[x])??""}),i("updateOtp",c.value.join(""))};m(),e.watch(()=>[s.totalInput,s.default],()=>m());const g=w=>{w<0||w>=h.value||e.nextTick(()=>{var x;return(x=l.value[w])==null?void 0:x.focus()})},k=w=>w.match(/[a-zA-Z0-9]/)?w.match(/[a-zA-Z0-9]/)[0]:"";async function y(w){var x;if(i("complete",w),s.submitFn){try{d.value=!0,i("loading",!0);const b=await s.submitFn(w);i("success",b)}catch(b){console.error("OTP Submit Error",b),f.error("Submit Failed",(b==null?void 0:b.message)||"Unknown error"),i("error",(b==null?void 0:b.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}return}if((x=s.endpoint)!=null&&x.apiUrl){if(typeof u!="function"){i("error","useApi() must expose DCodeApi()");return}try{d.value=!0,i("loading",!0);const b=(s.endpoint.apiMethod||"POST").toUpperCase(),V=s.endpoint.apiUrl,A=await u("","",{otp:w},{_url:V,_method:b,withCredentials:!0}),D=(A==null?void 0:A.data)??A;i("success",D)}catch(b){console.error("OTP Submit Error",b),f.error("Submit Failed",(b==null?void 0:b.message)||"Unknown error"),i("error",(b==null?void 0:b.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}}}const p=(w,x)=>{c.value[w]=k(x);const b=c.value.join("");i("updateOtp",b),i("update:modelValue",b),b.length===h.value&&y(b)},E=(w,x)=>{const b=w.key,V=/^\d$/.test(b),A=/^[a-zA-Z]$/.test(b);if(b==="Backspace"){if(w.preventDefault(),c.value[x]){p(x,"");return}x>0&&(p(x-1,""),g(x-1));return}if(b==="ArrowLeft"){w.preventDefault(),g(x-1);return}if(b==="ArrowRight"){w.preventDefault(),g(x+1);return}if(V||A){w.preventDefault(),p(x,b),x<h.value-1&&g(x+1);return}b.length===1&&w.preventDefault()},_=(w,x)=>{const b=w.target,V=b.value??"",A=k(V);b.value=A,p(x,A),A&&x<h.value-1&&g(x+1)},B=(w,x)=>{var N;w.preventDefault();const V=(((N=w.clipboardData)==null?void 0:N.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!V)return;let A=x;for(const P of V){if(A>=h.value)break;c.value[A]=P,A++}const D=c.value.join("");i("updateOtp",D),i("update:modelValue",D),D.length===h.value&&y(D),g(Math.min(A,h.value-1))},S=w=>x=>{l.value[w]=(x==null?void 0:x.$el)??x};return(w,x)=>(e.openBlock(),e.createElementBlock("div",X1,[s.label||h.value?(e.openBlock(),e.createElementBlock("div",K1,[s.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium text-foreground"},e.toDisplayString(s.label),9,Y1)):(e.openBlock(),e.createElementBlock("label",{key:1,for:a.value,class:"text-sm font-medium text-foreground"}," Masukkan kode keamanan ",8,J1)),e.createElementVNode("p",Q1," Ketik "+e.toDisplayString(h.value)+" digit kode verifikasi Anda ",1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Z1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,b=>(e.openBlock(),e.createElementBlock("input",{key:b,id:b===1?a.value:void 0,ref_for:!0,ref:S(b-1),value:c.value[b-1]||"",type:"text",inputmode:"text",maxlength:"1",autocomplete:"one-time-code","aria-label":"`OTP digit ${i}`",placeholder:"*",disabled:d.value,class:e.normalizeClass(["w-12 h-12 flex-none text-center text-xl font-bold rounded-xl border transition-all duration-200 box-border p-0","focus:outline-none focus:scale-105 disabled:opacity-50 disabled:cursor-not-allowed",c.value[b-1]?"border-blue-500 bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300":"border-gray-300 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 text-gray-400 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600"]),onKeydown:V=>E(V,b-1),onInput:V=>_(V,b-1),onPaste:V=>B(V,b-1)},null,42,eC))),128))])]))}}),tC={class:"w-full"},nC={key:0,class:"flex items-center justify-between mb-2"},oC={key:0,class:"text-sm font-medium text-gray-700"},rC={key:1,class:"text-sm text-gray-600"},aC={name:"DCodeProgress"},Gd=e.defineComponent({...aC,name:"DCodeProgress",inheritAttrs:!1,props:{modelValue:{default:0},max:{default:100},label:{default:""},showValue:{type:Boolean,default:!1},color:{default:"blue"},size:{default:"md"},striped:{type:Boolean,default:!1},animated:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=e.computed(()=>Math.min(o.modelValue/o.max*100,100)),a=e.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[o.size],"bg-gray-200"].join(" ")),s=e.computed(()=>{const l={blue:"bg-blue-500",green:"bg-green-500",red:"bg-red-500",yellow:"bg-yellow-500",purple:"bg-purple-500",gray:"bg-gray-500"},c=["h-full transition-all duration-300 ease-out",l[o.color]||l.blue];return o.striped&&c.push("bg-gradient-to-r from-transparent via-white/20 to-transparent"),o.animated&&c.push("animate-pulse"),c.join(" ")}),i=e.computed(()=>`${Math.round(r.value)}%`);return(l,c)=>(e.openBlock(),e.createElementBlock("div",tC,[t.label||t.showValue?(e.openBlock(),e.createElementBlock("div",nC,[t.label?(e.openBlock(),e.createElementBlock("span",oC,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),t.showValue?(e.openBlock(),e.createElementBlock("span",rC,e.toDisplayString(i.value),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.value)},[e.createElementVNode("div",{class:e.normalizeClass(s.value),style:e.normalizeStyle({width:`${r.value}%`})},null,6)],2)]))}}),sC={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},Xd=Ot(e.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(t){return(n,o)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[t.isApiLoading?(e.openBlock(),e.createElementBlock("div",sC,[e.createElementVNode("div",{class:"h-full bg-primary-600 shadow-[0_0_15px_rgba(37,99,235,0.8)] transition-all duration-300 ease-out",style:e.normalizeStyle({width:`${t.apiProgress}%`})},null,4)])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-85c68054"]]),iC={class:"grid gap-3"},lC={key:0,class:"ml-1 text-destructive"},cC={class:"flex flex-col"},dC={key:0,class:"flex items-center gap-2 text-sm text-gray-500 mb-2"},uC={class:"relative flex-shrink-0 mt-0.5"},fC=["id","name","value","checked","disabled","required","onChange"],hC=["onClick"],mC=["for"],pC={key:0,class:"ml-1 text-red-500"},gC={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},Ys=e.defineComponent({name:"DCodeRadio",inheritAttrs:!1,__name:"DCodeRadio",props:{modelValue:{default:void 0},label:{default:""},itemTitle:{default:"name"},itemValue:{default:"id"},options:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=ft(),r=n,a=t,s=e.ref([]),i=e.ref(!1),l=e.ref(null),c=async()=>{var B,S;const _=((B=a.endpoint)==null?void 0:B.apiUrl)||a.apiUrl;if(_){i.value=!0,l.value=null;try{const w={page:1,perPage:100},x=((S=a.endpoint)==null?void 0:S.apiMethod)||a.apiMethod,b=await o(_,x,w);let V=b;a.dataPath?V=a.dataPath.split(".").reduce((D,N)=>D&&D[N]!=="undefined"?D[N]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(V=b.data),Array.isArray(V)?s.value=V:(console.warn("DCodeRadio: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),l.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(w){console.error("DCodeRadio fetch error:",w),l.value="Gagal memuat data dari endpoint."}finally{i.value=!1}}};e.onMounted(()=>{var _;((_=a.endpoint)!=null&&_.apiUrl||a.apiUrl)&&c()});const d=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(s.value.length>0)return s.value;const _=a.itemValue||a.model||"id",B=a.itemTitle||(a.label===""?"name":a.label);return B&&a.label!==""?[{[_]:_,[B]:B}]:[]}),u=_=>{if(typeof _!="object")return _;const B=a.itemValue||a.model||"id";return _[B]},f=_=>{if(typeof _!="object")return String(_);const B=a.itemTitle||"name";return _[B]},h=e.computed(()=>a.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),m=e.computed(()=>!!a.error||!!l.value),g=e.computed(()=>a.error||l.value),k=_=>_==null?a.modelValue===_:String(a.modelValue)===String(_),y=e.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[a.size]),p=(_,B)=>{B.target.checked&&(r("update:modelValue",_),r("change",_))},E=_=>{!a.disabled&&!k(_)&&(r("update:modelValue",_),r("change",_))};return(_,B)=>(e.openBlock(),e.createElementBlock("div",iC,[t.label?(e.openBlock(),e.createBlock(nr,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",lC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",cC,[i.value?(e.openBlock(),e.createElementBlock("div",dC,[e.createVNode(e.unref(ce.Loader2),{class:"w-4 h-4 animate-spin"}),B[0]||(B[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex",t.layout?"flex-row flex-wrap gap-4":"flex-col gap-3"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(S,w)=>(e.openBlock(),e.createElementBlock("div",{key:w,class:e.normalizeClass(["flex items-start",y.value.container,t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("div",uC,[e.createElementVNode("input",{id:t.id?`${t.id}-${w}`:`${h.value}-${w}`,name:h.value,type:"radio",value:u(S),checked:k(u(S)),disabled:t.disabled,required:t.required&&w===0,onChange:x=>p(u(S),x),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,fC)]),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:x=>E(u(S))},[e.createElementVNode("label",{for:t.id?`${t.id}-${w}`:`${h.value}-${w}`,class:e.normalizeClass([y.value.label,"font-medium cursor-pointer select-none text-foreground dark:text-gray-300",t.disabled?"cursor-not-allowed opacity-50":""])},[e.createTextVNode(e.toDisplayString(f(S))+" ",1),t.required&&d.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",pC,"*")):e.createCommentVNode("",!0)],10,mC)],8,hC)],2))),128))],2),m.value&&g.value?(e.openBlock(),e.createElementBlock("div",gC,[e.createVNode(e.unref(ce.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(g.value),1)])):e.createCommentVNode("",!0)])]))}}),bC={class:"grid gap-3"},yC={key:0,class:"ml-1 text-destructive"},xC={class:"flex flex-col"},kC={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},wC=["onClick"],CC=["id","name","value","checked","disabled","required","onChange"],EC={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},BC=["for"],_C={key:0,class:"ml-1 text-red-500"},SC={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},Js=e.defineComponent({name:"DCodeRadioCustom",inheritAttrs:!1,__name:"DCodeRadioCustom",props:{modelValue:{default:void 0},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=ft(),r=n,a=t,s=e.ref(a.modelValue??void 0);e.watch(()=>a.modelValue,V=>{s.value=V},{immediate:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var A,D;const V=((A=a.endpoint)==null?void 0:A.apiUrl)||a.apiUrl;if(V){l.value=!0,c.value=null;try{const N={page:1,perPage:100},P=((D=a.endpoint)==null?void 0:D.apiMethod)||a.apiMethod,v=await o(V,P,N);let Q=v;a.dataPath?Q=a.dataPath.split(".").reduce((q,Y)=>q&&q[Y]!=="undefined"?q[Y]:void 0,v):typeof v=="object"&&!Array.isArray(v)&&v.data&&(Q=v.data),Array.isArray(Q)?i.value=Q:(console.warn("DCodeRadioCustom: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(N){console.error("DCodeRadioCustom fetch error:",N),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=e.ref(!1);let f=null;const h=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var V;((V=a.endpoint)!=null&&V.apiUrl||a.apiUrl)&&d(),h(),typeof document<"u"&&(f=new MutationObserver(h),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const m=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(i.value.length>0)return i.value;const V=a.itemValue||a.model||"id",A=a.itemTitle||(a.label===""?"name":a.label);return A&&a.label!==""?[{[V]:V,[A]:A}]:[]}),g=V=>{if(typeof V!="object")return V;const A=a.itemValue||a.model||"id";return V[A]},k=V=>{if(typeof V!="object")return String(V);const A=a.itemTitle||"name";return V[A]},y=Math.random().toString(36).slice(2,7),p=e.computed(()=>a.id?`radio-custom-${a.id}`:`radio-custom-${a.model}-${y}`),E=e.computed(()=>!!a.error||!!c.value),_=e.computed(()=>a.error||c.value),B=V=>{const A=s.value;return V==null?A===V:String(A)===String(V)},S=e.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[a.size]),w=e.computed(()=>a.icon&&Gt[a.icon]||null),x=(V,A)=>{A.target.checked&&(s.value=V,r("update:modelValue",V),r("change",V))},b=V=>{a.disabled||B(V)||(s.value=V,r("update:modelValue",V),r("change",V))};return(V,A)=>(e.openBlock(),e.createElementBlock("div",bC,[t.label?(e.openBlock(),e.createBlock(nr,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",yC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",xC,[l.value?(e.openBlock(),e.createElementBlock("div",kC,[e.createVNode(e.unref(ce.Loader2),{class:"w-4 h-4 animate-spin"}),A[0]||(A[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["grid",t.layout?"grid-cols-2 sm:grid-cols-3":"grid-cols-1","gap-3"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(D,N)=>(e.openBlock(),e.createElementBlock("div",{key:N,class:e.normalizeClass(["relative flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 transition-all duration-200",B(g(D))?u.value?"border-primary-500 bg-primary-500/10 shadow-none":"border-primary-500 bg-primary-50 shadow-md shadow-primary-100":u.value?"border-neutral-700 bg-neutral-800 hover:border-neutral-600":"border-gray-200 bg-white hover:border-gray-300 hover:shadow-sm",t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:P=>!t.disabled&&b(g(D))},[e.createElementVNode("input",{id:t.id?`${t.id}-${N}`:`${p.value}-${N}`,name:p.value,type:"radio",value:g(D),checked:B(g(D)),disabled:t.disabled,required:t.required&&N===0,onChange:P=>x(g(D),P),class:"sr-only",tabindex:"-1"},null,40,CC),e.createElementVNode("div",{class:e.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",B(g(D))?u.value?"bg-primary-500/25 text-primary-400":"bg-primary-100 text-primary-600":u.value?"bg-neutral-700 text-neutral-500":"bg-gray-100 text-gray-400"])},[w.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(w.value),{key:0,class:"w-6 h-6"})):(e.openBlock(),e.createElementBlock("svg",EC,[...A[1]||(A[1]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2),e.createElementVNode("label",{for:t.id?`${t.id}-${N}`:`${p.value}-${N}`,class:e.normalizeClass([S.value.label,"font-medium text-center leading-tight select-none transition-colors duration-200",B(g(D))?u.value?"text-primary-400":"text-primary-700":u.value?"text-neutral-300":"text-gray-700",t.disabled?"cursor-not-allowed":"cursor-pointer"])},[e.createTextVNode(e.toDisplayString(k(D))+" ",1),t.required&&m.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",_C,"*")):e.createCommentVNode("",!0)],10,BC)],10,wC))),128))],2),E.value&&_.value?(e.openBlock(),e.createElementBlock("div",SC,[e.createVNode(e.unref(ce.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(_.value),1)])):e.createCommentVNode("",!0)])]))}}),VC={key:0,class:"ml-1 text-destructive"},AC={class:"relative w-full"},DC={key:0,class:"mb-2 flex items-center justify-between"},NC={class:"text-sm text-muted-foreground"},MC={class:"text-sm font-medium text-foreground"},vC={class:"text-sm text-muted-foreground"},PC={class:"relative"},TC=["id","value","min","max","step","disabled","placeholder"],OC={key:1,class:"relative mt-2"},FC={class:"text-xs text-muted-foreground mt-1"},zC={key:1,class:"flex items-center gap-1 text-sm text-destructive"},IC={name:"DCodeSlider"},ia=e.defineComponent({...IC,name:"DCodeSlider",inheritAttrs:!1,props:{modelValue:{default:0},min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},label:{default:""},placeholder:{default:""},required:{type:Boolean,default:!1},error:{default:null},showValue:{type:Boolean,default:!0},valuePrefix:{default:""},valueSuffix:{default:""},marks:{default:()=>[]},color:{default:"blue"},size:{default:"md"}},emits:["update:modelValue","change","input"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.ref(),i=e.ref(!1),l=e.computed(()=>!!a.error),c=e.computed(()=>`slider-${Math.random().toString(36).substr(2,9)}`),d=e.computed(()=>(a.label||o.label)??void 0),u=e.computed(()=>!0),f=e.computed(()=>{const S={sm:"h-2",md:"h-2.5",lg:"h-3"},w={blue:"accent-blue-500",green:"accent-green-500",red:"accent-red-500",yellow:"accent-yellow-500",purple:"accent-purple-500",gray:"accent-gray-500"};return["w-full appearance-none bg-transparent rounded-lg outline-none transition-all cursor-pointer relative z-10","disabled:opacity-50 disabled:cursor-not-allowed",S[a.size],w[a.color]||w.blue,l.value?"accent-red-500":"",o.class].filter(Boolean).join(" ")}),h=e.computed(()=>["appearance-none bg-white border-2 border-current rounded-full cursor-pointer transition-all","hover:scale-110 focus:scale-110","shadow-md hover:shadow-lg focus:shadow-lg","focus:outline-none focus:ring-2 focus:ring-offset-2",{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[a.size],a.color==="blue"?"focus:ring-blue-500":a.color==="green"?"focus:ring-green-500":a.color==="red"?"focus:ring-red-500":a.color==="yellow"?"focus:ring-yellow-500":a.color==="purple"?"focus:ring-purple-500":"focus:ring-gray-500"].join(" ")),m=e.computed(()=>`${a.valuePrefix}${a.modelValue}${a.valueSuffix}`),g=e.computed(()=>{const S=a.max-a.min;return(a.modelValue-a.min)/S*100}),k=S=>{const w=S.target,x=parseFloat(w.value);r("update:modelValue",x),r("input",x)},y=S=>{const w=S.target,x=parseFloat(w.value);r("change",x)},p=()=>{i.value=!0},E=()=>{i.value=!1},_=S=>{const w=a.max-a.min;return(S-a.min)/w*100},B=e.computed(()=>{const S={sm:16,md:20,lg:24};return`
67
67
  input[type="range"]::-webkit-slider-thumb {
68
- ${f.value}
69
- width: ${_[a.size]}px;
70
- height: ${_[a.size]}px;
68
+ ${h.value}
69
+ width: ${S[a.size]}px;
70
+ height: ${S[a.size]}px;
71
71
  }
72
72
 
73
73
  input[type="range"]::-moz-range-thumb {
74
- ${f.value}
75
- width: ${_[a.size]}px;
76
- height: ${_[a.size]}px;
74
+ ${h.value}
75
+ width: ${S[a.size]}px;
76
+ height: ${S[a.size]}px;
77
77
  border-width: 2px;
78
78
  }
79
79
 
@@ -92,6 +92,6 @@
92
92
  input[type="range"]:focus::-moz-range-thumb {
93
93
  transform: scale(1.1);
94
94
  }
95
- `});return(_,B)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-2 w-full",e.unref(o).class]),"aria-busy":!1},[d.value?(e.openBlock(),e.createBlock(e.unref(Zo),{key:0,for:c.value,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",xC,"*")):e.createCommentVNode("",!0)]),_:1},8,["for"])):e.createCommentVNode("",!0),e.createElementVNode("div",kC,[t.showValue?(e.openBlock(),e.createElementBlock("div",wC,[e.createElementVNode("span",CC,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.min)+e.toDisplayString(a.valueSuffix),1),e.createElementVNode("span",EC,e.toDisplayString(m.value),1),e.createElementVNode("span",BC,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.max)+e.toDisplayString(a.valueSuffix),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",_C,[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-1/2 -translate-y-1/2 w-full h-full bg-gray-200 rounded-lg pointer-events-none",[t.size==="sm"?"h-2":t.size==="md"?"h-2.5":"h-3"]])},[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-0 left-0 h-full rounded-lg transition-all",[t.color==="blue"?"bg-blue-500":t.color==="green"?"bg-green-500":t.color==="red"?"bg-red-500":t.color==="yellow"?"bg-yellow-500":t.color==="purple"?"bg-purple-500":"bg-gray-500"]]),style:e.normalizeStyle({width:`${g.value}%`})},null,6)],2),e.createElementVNode("input",{id:c.value,ref_key:"sliderRef",ref:s,type:"range",value:t.modelValue,min:t.min,max:t.max,step:t.step,disabled:t.disabled,placeholder:t.placeholder,class:e.normalizeClass(h.value),onInput:b,onChange:x,onMousedown:p,onMouseup:C,onTouchstart:p,onTouchend:C},null,42,SC)]),t.marks.length>0?(e.openBlock(),e.createElementBlock("div",AC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.marks,k=>(e.openBlock(),e.createElementBlock("div",{key:k.value,class:"absolute flex flex-col items-center",style:e.normalizeStyle({left:`${w(k.value)}%`,transform:"translateX(-50%)"})},[B[0]||(B[0]=e.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),e.createElementVNode("span",VC,e.toDisplayString(k.label),1)],4))),128))])):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",DC,[B[1]||(B[1]=e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),e.createTextVNode(" "+e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("style"),{key:2},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(E.value),1)]),_:1})):e.createCommentVNode("",!0)],2)),[[e.vShow,u.value]])}}),MC={class:"grid gap-3"},vC={key:0,class:"ml-1 text-destructive"},PC={class:"inline-flex items-center gap-3"},TC=["id","name","aria-checked","aria-label","disabled"],OC={key:0,class:"absolute inset-0 flex items-center justify-center"},FC={class:"relative z-10 flex items-center gap-2"},zC=["id","name","aria-checked","aria-label","disabled"],IC={key:0,class:"absolute inset-0 flex items-center justify-center"},RC={name:"DCodeSwitch"},sa=e.defineComponent({...RC,props:{modelValue:{type:Boolean,default:!1},label:{default:""},title:{default:"Title"},disabled:{type:Boolean,default:!1},size:{default:"medium"},color:{default:"primary"},loading:{type:Boolean,default:!1},labelPosition:{default:"right"},id:{},name:{},required:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!1},tooltipActiveText:{default:"Aktif"},tooltipInactiveText:{default:"Tidak Aktif"}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:h=>{!o.disabled&&!o.loading&&(r("update:modelValue",h),r("change",h))}}),s=e.computed(()=>{switch(o.size){case"small":return"w-9 h-5";case"large":return"w-14 h-7";default:return"w-11 h-6"}}),i=e.computed(()=>{switch(o.size){case"small":return"w-4 h-4";case"large":return"w-6 h-6";default:return"w-5 h-5"}}),l=e.computed(()=>{switch(o.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=e.computed(()=>{if(o.disabled)return"bg-gray-300";if(!a.value)return"bg-gray-200";switch(o.color){case"success":return"bg-green-500";case"warning":return"bg-yellow-500";case"danger":return"bg-red-500";default:return"bg-blue-500"}}),d=()=>{a.value=!a.value},u=e.computed(()=>a.value?o.tooltipActiveText:o.tooltipInactiveText);return(h,f)=>(e.openBlock(),e.createElementBlock("div",MC,[t.title?(e.openBlock(),e.createBlock(Zo,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",vC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",PC,[e.createVNode(e.unref(fl),null,{default:e.withCtx(()=>[t.showTooltip?(e.openBlock(),e.createBlock(e.unref(dl),{key:0,"delay-duration":200},{default:e.withCtx(()=>[e.createVNode(e.unref(hl),{"as-child":""},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",id:t.id,name:t.name,"aria-checked":a.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:e.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[e.createElementVNode("span",{class:e.normalizeClass([i.value,a.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[t.loading?(e.openBlock(),e.createElementBlock("span",OC,[...f[0]||(f[0]=[e.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:e.withCtx(()=>[a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(ue.Check),{key:0,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(ue.X),{key:1,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):e.createCommentVNode("",!0)]),_:1})],2)],10,TC)]),_:1}),e.createVNode(e.unref(ul),{side:"top","side-offset":8,class:e.normalizeClass(["animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0",[a.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:e.withCtx(()=>[e.createElementVNode("span",FC,[e.createElementVNode("span",{class:e.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",a.value?"bg-green-200":"bg-gray-300"])},null,2),e.createTextVNode(" "+e.toDisplayString(u.value),1)])]),_:1},8,["class"])]),_:1})):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",id:t.id,name:t.name,"aria-checked":a.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:e.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[e.createElementVNode("span",{class:e.normalizeClass([i.value,a.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[t.loading?(e.openBlock(),e.createElementBlock("span",IC,[...f[1]||(f[1]=[e.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:e.withCtx(()=>[a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(ue.Check),{key:0,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(ue.X),{key:1,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):e.createCommentVNode("",!0)]),_:1})],2)],10,zC))]),_:1})])]))}}),LC=["aria-busy"],$C={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},jC=["for"],WC={key:0,class:"ml-1 text-destructive"},UC={class:"relative w-full group"},HC=["id","value"],qC={key:0,class:"absolute top-1 right-2"},GC={key:1,class:"absolute top-full right-0 z-10 text-[11px] text-gray-500 dark:text-gray-400 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100"},XC={key:1,class:"text-xs text-destructive"},ko=e.defineComponent({name:"DCodeTextarea",inheritAttrs:!1,__name:"DCodeTextarea",props:{modelValue:{},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1},error:{default:null}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>o.label),i=e.computed(()=>a.visible??!0),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`app-textarea-${o.id||s.value||"field"}-${l}`),d=e.computed(()=>{const Z=o.required,O=o["aria-required"];return Z===""||Z===!0||Z==="true"||(O==="true"||O===!0)}),u=e.computed(()=>{const{label:Z,class:O,id:Q,required:ie,"aria-required":Ae,...ze}=o;return ze}),h=e.computed(()=>{const Z=o.maxlength;let O=Number.NaN;return typeof Z=="number"?O=Z:typeof Z=="string"&&(O=Number.parseInt(Z,10)),Number.isFinite(O)&&O>0?O:-1}),f=Z=>h.value>0?Z.slice(0,h.value):Z,m=e.computed(()=>{const Z=a.modelValue;return Z==null||String(Z).length===0}),g=e.computed(()=>a.clearable?a.hideClearWhenEmpty?!m.value:!0:!1),b=e.ref(String(a.modelValue??""));e.watch(()=>a.modelValue,Z=>{const O=String(Z??"");O!==b.value&&(b.value=O)});const x=e.ref(!1),p=e.ref(!1),C=Z=>Z.split(/(\s+)/).map(O=>{if(O.trim()==="")return O;const Q=O.toLowerCase();return Q.charAt(0).toUpperCase()+Q.slice(1)}).join(""),w=Z=>{const O=Z.toLowerCase(),Q=O.search(new RegExp("\\p{L}","u"));return Q<0?O:O.slice(0,Q)+O.charAt(Q).toUpperCase()+O.slice(Q+1)},E=Z=>{switch(a.textCase){case"uppercase":return Z.toUpperCase();case"lowercase":return Z.toLowerCase();case"titlecase":return C(Z);case"sentencecase":return w(Z);case"none":default:return Z}},_=e.computed(()=>{switch(a.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),B=Z=>{if(!Z)return null;const O=Array.isArray(Z)?Z.join(""):Z;return O?new Set(O):null},k=e.computed(()=>B(a.allowChars)),y=(Z,O)=>(Z.lastIndex=0,Z.test(O)),V=Z=>{if(Z===`
96
- `)return a.valueType!=="number";if(a.valueType==="free")return!0;const O=Z===" ",Q=/\d/.test(Z),ie=new RegExp("\\p{L}","u").test(Z),Ae=new RegExp("\\p{N}","u").test(Z);return a.valueType==="number"?Q:a.valueType==="letter"?ie||a.allowSpaces&&O:a.valueType==="letternumber"?ie||Ae||a.allowSpaces&&O:!0},D=Z=>{let O="";for(const Q of Z){const ie=!!k.value&&k.value.has(Q);a.pattern&&!ie&&!y(a.pattern,Q)||!ie&&!V(Q)||(O+=Q)}return O},N=Z=>{const O=D(Z),Q=a.applyTextCaseToValue?E(O):O;return f(Q)};let A=null;const T=Z=>{if(Z==="")return null;if(a.valueType==="number"&&a.returnNumber){const O=Z.replaceAll(`
97
- `,""),Q=Number(O);return Number.isFinite(Q)?Q:null}return Z},P=Z=>{b.value=Z,r("update:modelValue",T(Z))},X=(Z,O)=>{const Q=f(O);p.value=!0,Z.value=Q,P(Q),queueMicrotask(()=>p.value=!1)},$=(Z,O)=>{const Q=Z.selectionStart??Z.value.length,ie=Z.selectionEnd??Z.value.length;if(h.value>0){const Ae=Z.value.length-(ie-Q),ze=h.value-Ae;if(ze<=0)return;O=O.slice(0,ze)}Z.setRangeText(O,Q,ie,"end"),X(Z,N(Z.value))},G=Z=>{var ie;if(!A||x.value||p.value||!((ie=Z.inputType)!=null&&ie.startsWith("insert")))return;const O=Z.data;if(O==null)return;const Q=N(O);Q!==O&&(Z.preventDefault(),Q.length>0&&$(A,Q))},ne=Z=>{var ie;if(!A||x.value||p.value)return;const O=((ie=Z.clipboardData)==null?void 0:ie.getData("text"))??"",Q=N(O);Q!==O&&(Z.preventDefault(),Q.length>0&&$(A,Q))},K=async Z=>{if(!A||x.value||p.value)return;const O=Z.target,Q=O.value??"",ie=N(Q);if(ie===Q){const Ae=O.selectionStart??ie.length,ze=O.selectionEnd??ie.length;X(O,ie),await e.nextTick();try{O.setSelectionRange(Ae,ze)}catch{}P(ie)}else{const Ae=O.selectionStart??ie.length,ze=O.selectionEnd??ie.length;X(O,ie),await e.nextTick();try{O.setSelectionRange(Ae,ze)}catch{}}},R=()=>x.value=!0,j=()=>{if(x.value=!1,!A)return;const Z=A.value??"",O=N(Z);O===Z?P(O):X(A,O)};e.onMounted(()=>{if(A=document.getElementById(c.value),!A)return;A.addEventListener("beforeinput",G),A.addEventListener("paste",ne),A.addEventListener("input",K),A.addEventListener("compositionstart",R),A.addEventListener("compositionend",j);const Z=A.value??"",O=N(Z);O===Z?P(O):X(A,O)}),e.onBeforeUnmount(()=>{A&&(A.removeEventListener("beforeinput",G),A.removeEventListener("paste",ne),A.removeEventListener("input",K),A.removeEventListener("compositionstart",R),A.removeEventListener("compositionend",j),A=null)});const se=()=>{b.value="",A&&(A.value=""),r("update:modelValue",null),r("clear")},ee=e.computed(()=>b.value.length),Y=e.computed(()=>a.showCharCount?h.value>0:!1),le=e.computed(()=>Y.value&&ee.value>0),ge=e.computed(()=>`${ee.value} / ${h.value}`),Me=e.computed(()=>!!a.error),ve=e.computed(()=>{const Z=o.rows,O=typeof Z=="number"?Z:Number.parseInt(String(Z??""),10);return Number.isFinite(O)&&O>0?O:3}),Ee=e.computed(()=>({height:`${ve.value*24+16}px`}));return(Z,O)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",$C)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:e.normalizeStyle(Ee.value)},null,4)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),d.value?(e.openBlock(),e.createElementBlock("span",WC,"*")):e.createCommentVNode("",!0)],8,jC)):e.createCommentVNode("",!0),e.createElementVNode("div",UC,[e.createElementVNode("textarea",e.mergeProps({id:c.value,value:b.value},u.value,{style:`text-transform: ${_.value}; padding-right: ${g.value?"2.5rem":"0.75rem"} !important; padding-left: 0.75rem !important;`,class:["flex min-h-[120px] w-full rounded-lg border py-2 bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",Me.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,HC),g.value?(e.openBlock(),e.createElementBlock("div",qC,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:se}," ✕ ")])):e.createCommentVNode("",!0),le.value&&!Me.value?(e.openBlock(),e.createElementBlock("p",GC,e.toDisplayString(ge.value),1)):e.createCommentVNode("",!0)]),Me.value?(e.openBlock(),e.createElementBlock("p",XC,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,LC)),[[e.vShow,i.value]])}}),qd=e.defineComponent({__name:"Avatar",props:{class:{type:[Boolean,null,String,Object,Array]},size:{default:"sm"},shape:{default:"circle"}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Ne.AvatarRoot),{class:e.normalizeClass(e.unref(We)(e.unref(KC)({size:t.size,shape:t.shape}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["class"]))}}),Gd=e.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Ne.AvatarFallback),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Xd=e.defineComponent({__name:"AvatarImage",props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Ne.AvatarImage),e.mergeProps(n,{class:"h-full w-full object-cover"}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),KC=xr("inline-flex items-center justify-center font-normal text-foreground select-none shrink-0 bg-secondary overflow-hidden",{variants:{size:{sm:"h-10 w-10 text-xs",base:"h-16 w-16 text-2xl",lg:"h-32 w-32 text-5xl"},shape:{circle:"rounded-full",square:"rounded-md"}}}),ia=e.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=ft.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Ne.Separator),e.mergeProps(e.unref(o),{class:e.unref(We)("shrink-0 bg-border",n.orientation==="horizontal"?"h-px w-full":"w-px h-full",n.class)}),null,16,["class"]))}}),YC={class:"bg-card text-card-foreground"},JC={class:"pb-6 px-3"},QC={key:0,class:"flex justify-center p-8"},ZC={key:1,class:"p-8 text-center text-red-500"},eE={key:2,class:"relative"},tE={class:"space-y-6"},nE={class:"rounded-xl border bg-card text-card-foreground shadow"},oE={class:"p-4"},rE={class:"flex items-center justify-between gap-3"},aE={class:"font-medium"},sE={class:"text-xs text-muted-foreground"},iE={class:"mt-1 text-sm text-muted-foreground"},lE={class:"text-foreground"},cE={class:"text-foreground"},dE={class:"mt-1 text-xs text-muted-foreground"},uE={key:0,class:"mt-3 flex items-center gap-2 text-sm"},fE={class:"flex items-center justify-between gap-3"},hE={class:"font-medium"},mE={class:"text-xs text-muted-foreground"},pE={class:"mt-2 text-sm text-muted-foreground"},gE={class:"flex flex-wrap items-center justify-between gap-3"},bE={class:"flex items-center gap-3"},yE={class:"leading-tight"},xE={class:"text-sm font-medium"},kE={class:"text-xs text-muted-foreground"},wE={class:"flex items-center gap-2"},CE={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},EE={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},BE=["src"],_E={class:"flex-1"},SE={class:"flex items-center justify-between gap-3"},AE={class:"font-medium"},VE={class:"text-xs text-muted-foreground"},DE={class:"mt-1 text-sm text-muted-foreground"},NE={class:"text-left sm:text-center"},ME={class:"text-xs text-muted-foreground"},vE={class:"text-left sm:text-center"},PE={class:"text-xs text-muted-foreground"},TE={class:"text-left sm:text-center"},OE={class:"text-xs text-muted-foreground"},FE={class:"flex items-center justify-between gap-3"},zE={class:"font-medium"},IE={class:"text-xs text-muted-foreground"},RE={class:"mt-2 text-sm text-muted-foreground"},LE={class:"mt-3 flex items-center gap-3"},$E={class:"text-sm font-medium"},jE={class:"flex items-start justify-between gap-3"},WE={class:"font-medium"},UE={class:"mt-3 grid gap-2 text-sm"},HE={class:"flex items-center justify-between gap-3"},qE={class:"flex items-center gap-2 text-muted-foreground"},GE={class:"font-medium"},XE={class:"flex items-center justify-between gap-3"},KE={class:"flex items-center gap-2 text-muted-foreground"},YE={class:"font-medium"},JE={class:"flex items-center justify-between gap-3"},QE={class:"flex items-center gap-2 text-muted-foreground"},ZE={class:"font-medium"},eB={class:"flex items-center justify-between"},tB={class:"flex items-center gap-2"},nB={class:"flex items-start justify-between gap-3"},oB={class:"flex items-center gap-2"},rB={class:"font-medium"},aB={class:"mt-2 text-sm text-muted-foreground"},sB={key:0,class:"mt-1 text-sm text-muted-foreground"},iB={class:"flex flex-wrap items-center justify-between gap-3"},lB={class:"flex items-center gap-2"},cB={class:"text-xs text-muted-foreground"},Kd=e.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiMethod:{}},setup(t){const o=ft.useBreakpoints(ft.breakpointsTailwind).smaller("md");e.ref(!1);const r=t,a=e.ref(!1),s=e.ref(null),i=e.ref([]),l=e.computed(()=>i.value.length>0?i.value:r.items&&r.items.length>0?r.items:[]),c=async()=>{if(r.apiUrl){a.value=!0,s.value=null;try{const h=await fetch(r.apiUrl,{method:r.apiMethod||"GET",headers:{"Content-Type":"application/json"}});if(!h.ok)throw new Error(`Error: ${h.status} ${h.statusText}`);const f=await h.json();Array.isArray(f)?i.value=f:f.data&&Array.isArray(f.data)?i.value=f.data:f.items&&Array.isArray(f.items)?i.value=f.items:i.value=[]}catch(h){console.error("Failed to fetch timeline items:",h),s.value=h.message||"Failed to fetch data"}finally{a.value=!1}}};e.onMounted(()=>{r.apiUrl&&c()}),e.watch(()=>r.apiUrl,()=>{r.apiUrl?c():i.value=[]});const d=h=>{switch(h){case"flight":return{Icon:ue.PlaneIcon,Circle:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:ue.ClockIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:ue.ShoppingCartIcon,Circle:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:ue.PencilIcon,Circle:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:ue.ServerIcon,Circle:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:ue.MapPinIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};default:return{Icon:ue.Circle,Circle:"bg-primary/10 text-primary border-primary/30"}}},u=h=>h.split(" ").filter(Boolean).slice(0,2).map(f=>{var m;return(m=f[0])==null?void 0:m.toUpperCase()}).join("");return(h,f)=>{const m=e.resolveComponent("ShoppingCart"),g=e.resolveComponent("DCodeBadge"),b=e.resolveComponent("RefreshCcw"),x=e.resolveComponent("MapPin");return e.openBlock(),e.createElementBlock("div",YC,[f[8]||(f[8]=e.createElementVNode("div",{class:"flex flex-col space-y-1.5 py-6 px-3"},[e.createElementVNode("h3",{class:"leading-none tracking-tight text-lg font-medium"},"Timeline With Icons")],-1)),e.createElementVNode("div",JC,[a.value?(e.openBlock(),e.createElementBlock("div",QC,[...f[0]||(f[0]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):s.value?(e.openBlock(),e.createElementBlock("div",ZC,e.toDisplayString(s.value),1)):(e.openBlock(),e.createElementBlock("div",eE,[f[7]||(f[7]=e.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),e.createElementVNode("div",tE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(p,C)=>(e.openBlock(),e.createElementBlock("div",{key:C,class:"relative pl-14"},[e.createElementVNode("div",{class:e.normalizeClass(["absolute left-0 top-2 flex h-8 w-8 items-center justify-center rounded-full border",d(p.type).Circle])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d(p.type).Icon),{class:"h-4 w-4"}))],2),e.createElementVNode("div",nE,[e.createElementVNode("div",oE,[p.type==="flight"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",rE,[e.createElementVNode("p",aE,e.toDisplayString(p.title),1),e.createElementVNode("p",sE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",iE,[e.createElementVNode("span",lE,e.toDisplayString(p.from),1),e.createVNode(e.unref(ue.ArrowRight),{class:"mx-2 inline h-4 w-4"}),e.createElementVNode("span",cE,e.toDisplayString(p.to),1)]),e.createElementVNode("p",dE,e.toDisplayString(p.time),1),p.fileName?(e.openBlock(),e.createElementBlock("div",uE,[e.createVNode(e.unref(ue.FileText),{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("span",null,e.toDisplayString(p.fileName),1)])):e.createCommentVNode("",!0)],64)):p.type==="interview"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",fE,[e.createElementVNode("p",hE,e.toDisplayString(p.title),1),e.createElementVNode("p",mE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",pE,e.toDisplayString(p.desc),1),e.createVNode(e.unref(ia),{class:"my-4"}),e.createElementVNode("div",gE,[e.createElementVNode("div",bE,[e.createVNode(e.unref(qd),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(Xd),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(Gd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("div",yE,[e.createElementVNode("p",xE,e.toDisplayString(p.personName),1),e.createElementVNode("p",kE,e.toDisplayString(p.personRole),1)])]),e.createElementVNode("div",wE,[e.createVNode(e.unref(Yt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ue.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Yt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ue.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="product"?(e.openBlock(),e.createElementBlock("div",CE,[e.createElementVNode("div",EE,[p.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:0,src:p.imgUrl,class:"h-full w-full rounded-lg object-cover",alt:"product"},null,8,BE)):(e.openBlock(),e.createBlock(m,{key:1,class:"h-5 w-5 text-muted-foreground"}))]),e.createElementVNode("div",_E,[e.createElementVNode("div",SE,[e.createElementVNode("p",AE,e.toDisplayString(p.title),1),e.createElementVNode("p",VE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",DE,e.toDisplayString(p.desc),1),e.createElementVNode("div",{class:e.normalizeClass(["mt-4 grid gap-3",e.unref(o)?"grid-cols-1":"grid-cols-3"])},[e.createElementVNode("div",NE,[f[1]||(f[1]=e.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),e.createElementVNode("p",ME,e.toDisplayString(p.customer),1)]),e.createElementVNode("div",vE,[f[2]||(f[2]=e.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),e.createElementVNode("p",PE,e.toDisplayString(p.price),1)]),e.createElementVNode("div",TE,[f[3]||(f[3]=e.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),e.createElementVNode("p",OE,e.toDisplayString(p.qty),1)])],2)])])):p.type==="design"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",FE,[e.createElementVNode("p",zE,e.toDisplayString(p.title),1),e.createElementVNode("p",IE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",RE,e.toDisplayString(p.desc),1),e.createElementVNode("div",LE,[e.createVNode(e.unref(qd),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(Xd),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(Gd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("p",$E,e.toDisplayString(p.personName),1)])],64)):p.type==="server"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",jE,[e.createElementVNode("p",WE,e.toDisplayString(p.title),1),e.createVNode(g,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText??""),1)]),_:2},1024)]),e.createElementVNode("div",UE,[e.createElementVNode("div",HE,[e.createElementVNode("div",qE,[e.createVNode(e.unref(ue.Globe),{class:"h-4 w-4"}),f[4]||(f[4]=e.createElementVNode("span",null,"IP Address",-1))]),e.createElementVNode("span",GE,e.toDisplayString(p.ip),1)]),e.createElementVNode("div",XE,[e.createElementVNode("div",KE,[e.createVNode(e.unref(ue.Cpu),{class:"h-4 w-4"}),f[5]||(f[5]=e.createElementVNode("span",null,"CPU",-1))]),e.createElementVNode("span",YE,e.toDisplayString(p.cpu),1)]),e.createElementVNode("div",JE,[e.createElementVNode("div",QE,[e.createVNode(e.unref(ue.CpuIcon),{class:"h-4 w-4"}),f[6]||(f[6]=e.createElementVNode("span",null,"Memory",-1))]),e.createElementVNode("span",ZE,e.toDisplayString(p.memory),1)])]),e.createVNode(e.unref(ia),{class:"my-4"}),e.createElementVNode("div",eB,[e.createElementVNode("div",tB,[e.createVNode(e.unref(Yt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ue.Share2),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Yt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(b,{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="location"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("div",nB,[e.createElementVNode("div",oB,[e.createVNode(x,{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("p",rB,e.toDisplayString(p.title),1)]),e.createVNode(g,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText),1)]),_:2},1024)]),e.createElementVNode("p",aB,e.toDisplayString(p.desc1),1),p.desc2?(e.openBlock(),e.createElementBlock("p",sB,e.toDisplayString(p.desc2),1)):e.createCommentVNode("",!0),e.createVNode(e.unref(ia),{class:"my-4"}),e.createElementVNode("div",iB,[e.createElementVNode("div",lB,[e.createVNode(e.unref(Yt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ue.Link),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Yt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ue.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Yt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ue.User),{class:"h-4 w-4"})]),_:1})]),e.createElementVNode("p",cB,"Due date: "+e.toDisplayString(p.due),1)])],64)):e.createCommentVNode("",!0)])])]))),128))])]))])])}}}),dB={class:"dcode-upload-file"},uB={class:"border-2 border-dashed border-gray-300 dark:border-gray-700 rounded-lg p-6 flex flex-col items-center justify-center text-center hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors cursor-pointer"},fB={key:0,class:"text-xs text-gray-500 mt-1"},hB=["accept"],mB={key:1,class:"text-xs text-red-600 mt-1"},Yd=e.defineComponent({name:"DCodeUploadFile",__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=n,r=a=>{var i;const s=(i=a.target.files)==null?void 0:i[0];s&&o("update:modelValue",s)};return(a,s)=>(e.openBlock(),e.createElementBlock("div",dB,[t.label?(e.openBlock(),e.createBlock(xo,{key:0,label:t.label},null,8,["label"])):e.createCommentVNode("",!0),e.createElementVNode("div",uB,[e.createVNode(e.unref(ue.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=e.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[e.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),e.createTextVNode(" or drag and drop ")],-1)),t.accept?(e.openBlock(),e.createElementBlock("p",fB,e.toDisplayString(t.accept),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"file",class:"hidden",onChange:r,accept:t.accept},null,40,hB)]),t.errorMessage?(e.openBlock(),e.createElementBlock("p",mB,e.toDisplayString(t.errorMessage),1)):e.createCommentVNode("",!0)]))}}),pB=["onClick"],gB={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},bB={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},yB={key:1},xB={key:0,class:"text-white"},kB={key:1},wB={key:2},CB=["disabled","onClick"],EB={key:1,class:"mr-2 text-sm font-bold opacity-70"},BB={class:"whitespace-normal text-sm text-center leading-tight"},_B={class:"flex flex-col flex-1 min-w-0"},SB={class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground flex items-center gap-2"},AB={class:"text-sm text-muted-foreground"},VB={class:"px-1"},DB=["disabled"],NB=["type"],MB=["disabled"],Xs=Pt(e.defineComponent({name:"DCodeWizard",__name:"DCodeWizard",props:{tabs:{},modelValue:{},defaultTab:{default:0},allowTabClick:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},cache:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!0},apiOptions:{type:[Object,Function],default:void 0},isVertical:{type:Boolean,default:!1},isWizard:{type:Boolean,default:!1},typeWizard:{default:"icon"},showNavigation:{type:Boolean,default:!0},submitText:{default:"Simpan"},loading:{type:Boolean,default:!1},isSubmit:{type:Boolean,default:!1}},emits:["update:modelValue","change","loaded","error"],setup(t,{emit:n}){const o=t,r=n,a=mt(),s=a==null?void 0:a.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const i=e.ref(o.defaultTab),l=e.computed({get(){var k;if(typeof o.modelValue=="string"){const y=(k=o.tabs)==null?void 0:k.findIndex(V=>V.key===o.modelValue);if(y!==void 0&&y>=0)return y}return(typeof o.modelValue=="number"?o.modelValue:void 0)??i.value},set(k){var y;if(i.value=k,typeof o.modelValue=="string"){const V=(y=o.tabs)==null?void 0:y[k];V?r("update:modelValue",V.key):r("update:modelValue",k)}else r("update:modelValue",k)}}),c=e.computed(()=>{var k;return((k=o.tabs)==null?void 0:k.length)??0}),d=e.computed(()=>{var k;return(k=o.tabs)==null?void 0:k[l.value]});function u(k){return c.value<=0?0:Math.min(Math.max(k,0),c.value-1)}function h(k){return k?typeof k=="string"?qt[k]||null:k:null}const f=e.reactive({});function m(k){return f[k.key]||(f[k.key]={loaded:!1,loading:!1,data:null,error:null}),f[k.key]}function g(){if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions}function b(k){const y=k.endpoint||{};return{apiModule:k.apiModule||y.apiModule,apiAction:k.apiAction||y.apiAction,apiUrl:y.apiUrl,apiMethod:y.apiMethod||"GET",apiParams:k.apiParams}}function x(k){if(o.isWizard||!o.allowTabClick||o.disabled)return!1;const y=o.tabs[k];return!(!y||y.disabled)}async function p(k){if(typeof k.tab.fetchData=="function"){const P=await k.tab.fetchData(),X=(P==null?void 0:P.data)??P;return(X==null?void 0:X.data)??X}const y=b(k.tab);if(!(y.apiModule&&y.apiAction||y.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const D=g();let N;if(y.apiUrl)N=await s("","",D,{_url:y.apiUrl,_method:y.apiMethod,_data:y.apiParams??void 0});else{const P={...D,...y.apiParams};N=await s(y.apiModule,y.apiAction,P)}const A=(N==null?void 0:N.data)??N;return(A==null?void 0:A.data)??A}async function C(k,{force:y=!1}={}){const V=u(k),D=o.tabs[V];if(!D)return;const N=m(D);if(!(o.cache&&N.loaded&&!y)&&!N.loading){N.loading=!0,N.error=null;try{const A=await p({tabIndex:V,tab:D});N.data=A,N.loaded=!0,r("loaded",{tabIndex:V,tab:D,data:A})}catch(A){const T=typeof(A==null?void 0:A.message)=="string"&&A.message||typeof A=="string"&&A||"Failed to load tab data.";N.error=T,r("error",{tabIndex:V,tab:D,message:T})}finally{N.loading=!1}}}function w(k){const y=u(k);x(y)&&y!==l.value&&(l.value=y)}function E(k=l.value){return C(k,{force:!0})}function _(){const k=u(l.value-1);k!==l.value&&(l.value=k)}function B(){const k=u(l.value+1);k!==l.value&&(l.value=k)}return e.watch(()=>o.tabs,k=>{for(const y of k??[])m(y)},{immediate:!0}),e.watch(()=>l.value,async k=>{var V;const y=(V=o.tabs)==null?void 0:V[k];y&&r("change",{tabIndex:k,tab:y}),await C(k)},{immediate:!0}),e.watch(()=>o.autoFetchOnMount,async k=>{k&&await C(l.value)},{immediate:!0}),(k,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full rounded-lg border bg-card text-card-foreground shadow-sm",{"flex flex-row":t.isVertical}])},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col space-y-1.5 p-6",{"w-64 border-r pr-0":t.isVertical,"pb-2":t.isWizard&&!t.isVertical}])},[e.createElementVNode("div",{class:e.normalizeClass({"mt-4":!t.isVertical||t.isWizard})},[t.isWizard?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["w-full relative flex overflow-visible rounded-lg",t.isVertical?"flex-col gap-2":""])},[t.isVertical?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.tabs,(V,D)=>(e.openBlock(),e.createElementBlock("div",{key:V.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[e.createElementVNode("div",{class:e.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-card",[D<l.value?"wizard-num-done":"",D===l.value?"wizard-num-active":D>l.value?"wizard-num-pending":""]])},[t.typeWizard==="icon"&&V.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(h(V.icon)),{key:0,class:"w-4 h-4"})):t.typeWizard==="number"||!V.icon&&t.typeWizard!=="none"?(e.openBlock(),e.createElementBlock("span",yB,[D<l.value?(e.openBlock(),e.createElementBlock("span",xB,"✓")):(e.openBlock(),e.createElementBlock("span",kB,e.toDisplayString(D+1),1))])):(e.openBlock(),e.createElementBlock("span",wB))],2),e.createElementVNode("span",{class:e.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",D===l.value?"wizard-text-active":"wizard-text-pending"])},e.toDisplayString(V.title),3)]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.tabs,(V,D)=>(e.openBlock(),e.createElementBlock("div",{key:V.key,onClick:N=>w(D),style:e.normalizeStyle({zIndex:t.tabs.length-D}),class:"relative flex-1 group"},[e.createElementVNode("div",{class:e.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[D>0?"pl-8":"",D===l.value?"wizard-step-active":D<l.value?"wizard-step-done":"wizard-step-pending"]])},[t.typeWizard==="icon"&&V.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(h(V.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",gB,e.toDisplayString(D+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",bB,e.toDisplayString(V.title),1)],2),D<t.tabs.length-1?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["absolute top-0 -right-[15.5px] w-[16px] h-full transition-colors block z-10",[D===l.value?"wizard-svg-active":D<l.value?"wizard-svg-done":"wizard-svg-pending"]]),preserveAspectRatio:"none",viewBox:"0 0 16 48"},[...y[0]||(y[0]=[e.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):e.createCommentVNode("",!0)],12,pB))),128))],2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex w-full",t.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tabs,(V,D)=>(e.openBlock(),e.createElementBlock("button",{key:V.key,type:"button",disabled:!x(D),onClick:N=>w(D),class:e.normalizeClass(["relative min-h-[3rem] h-auto py-2 flex items-center justify-center gap-2 px-4 transition-all rounded-none focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 wizard-btn-common",e.unref(We)("border-b border-r",!t.isVertical&&D===t.tabs.length-1&&"border-r-0",D===l.value?"wizard-btn-active":"wizard-btn-pending",!x(D)&&"opacity-60 cursor-not-allowed",t.isVertical?"w-full justify-start border-r-0":"flex-1")])},[t.typeWizard==="icon"&&V.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(h(V.icon)),{key:0,class:"h-4 w-4 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",EB,e.toDisplayString(D+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",BB,e.toDisplayString(V.title),1)],10,CB))),128))],2))],2)],2),t.isVertical?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(ia),{key:0})),e.createElementVNode("div",_B,[e.createElementVNode("div",{class:e.normalizeClass(["p-6 flex-1 min-w-0",{"pl-6":t.isVertical}])},[e.createVNode(e.Transition,{name:"wizard-fade",mode:"out-in"},{default:e.withCtx(()=>{var V,D,N,A;return[(e.openBlock(),e.createElementBlock("div",{key:((V=d.value)==null?void 0:V.key)||l.value,class:"w-full"},[d.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(D=f[d.value.key])!=null&&D.loading?e.renderSlot(k.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[e.createElementVNode("div",SB,[e.createVNode(e.unref(ue.Loader2),{class:"w-4 h-4 animate-spin"}),y[1]||(y[1]=e.createTextVNode(" Loading... ",-1))])],!0):e.renderSlot(k.$slots,`tab-${d.value.key}`,{key:1,tab:d.value,tabIndex:l.value,data:(N=f[d.value.key])==null?void 0:N.data,loaded:(A=f[d.value.key])==null?void 0:A.loaded,reload:E},()=>[e.createElementVNode("div",AB,[y[2]||(y[2]=e.createTextVNode(" Slot ",-1)),e.createElementVNode("code",VB,"tab-"+e.toDisplayString(d.value.key),1),y[3]||(y[3]=e.createTextVNode(" belum dibuat. ",-1))])],!0)],64)):e.createCommentVNode("",!0)]))]}),_:3})],2),t.isWizard||t.showNavigation?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex items-center justify-between p-6 pt-0",{"pl-6":t.isVertical}])},[e.createElementVNode("button",{type:"button",onClick:_,disabled:l.value<=0,class:"relative inline-flex items-center justify-center gap-2 px-5 py-2.5 text-sm font-medium transition-all duration-300 rounded-lg bg-[#ffffff] border border-[#e2e8f0] text-[#334155] shadow-sm hover:bg-[#f8fafc] hover:text-[#0f172a] hover:-translate-y-0.5 hover:shadow disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#ffffff] disabled:hover:text-[#334155] disabled:hover:translate-y-0 disabled:active:scale-100 dark:bg-[#18181b] dark:border-[#27272a] dark:text-[#d4d4d8] dark:hover:bg-[#27272a] dark:hover:border-[#3f3f46] dark:disabled:hover:bg-[#18181b] dark:disabled:hover:text-[#d4d4d8] focus:outline-none focus:ring-2 focus:ring-[#e2e8f0] focus:ring-offset-2 active:scale-95"}," Sebelumnya ",8,DB),l.value<c.value-1?(e.openBlock(),e.createElementBlock("button",{key:0,type:t.isSubmit?"submit":"button",onClick:B,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#ffffff] transition-all duration-300 rounded-lg shadow-md bg-[#2563eb] hover:bg-[#1d4ed8] hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#2563eb] disabled:hover:translate-y-0 disabled:active:scale-100 focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"}," Selanjutnya ",8,NB)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"submit",disabled:t.loading,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#ffffff] transition-all duration-300 rounded-lg shadow-md bg-[#2563eb] hover:bg-[#1d4ed8] hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#2563eb] disabled:hover:translate-y-0 disabled:active:scale-100 dark:bg-[#3b82f6] dark:hover:bg-[#2563eb] focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"},[t.loading?(e.openBlock(),e.createBlock(e.unref(ue.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.submitText),1)],8,MB))],2)):e.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-9e7a4e21"]]),vB={class:"permission-menu w-full space-y-4"},PB={class:"bg-neutral-50/50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 text-neutral-900 dark:text-neutral-100 p-4"},TB={class:"flex items-center justify-between"},OB={class:"flex items-center gap-3 flex-1"},FB=["onClick"],zB={key:1,class:"w-7"},IB={key:2,class:"flex-shrink-0"},RB={class:"text-lg font-semibold flex-1"},LB={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},$B={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},jB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},WB=["checked","disabled","onChange"],UB={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},HB={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},qB={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},GB={class:"bg-neutral-50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 text-neutral-900 dark:text-neutral-100 p-3"},XB={class:"flex items-center justify-between"},KB={class:"flex items-center gap-3 flex-1"},YB={key:0,class:"flex-shrink-0"},JB={class:"text-base font-semibold flex-1"},QB={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},ZB={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},e_=["checked","onChange"],t_={class:"text-xs font-medium"},n_={key:0,class:"p-3"},o_={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},r_=["checked","disabled","onChange"],a_={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},Ks=Pt(e.defineComponent({__name:"DCodePermissionMenu",props:{menuList:{default:()=>[]},enableParentControl:{type:Boolean,default:!1},showIcons:{type:Boolean,default:!0},modelValue:{default:()=>[]},treeData:{default:()=>[]}},emits:["permission-change","menu-check","update:modelValue"],setup(t,{expose:n,emit:o}){const{t:r}=Rt.useI18n(),a=t,s=o,i=e.computed(()=>a.menuList&&a.menuList.length>0?a.menuList:a.treeData||[]),l=e.ref(new Map),c=e.ref(new Set),d=(D=!0)=>{(A=>{A.forEach(T=>{T.permission.forEach(P=>{const X=`${T.id}-${P.id}-parent`,$=P.code==="VIEW"||P.name.toUpperCase()==="VIEW";l.value.has(X)||l.value.set(X,$||(D?T.checked??!1:!1))}),T.detail&&T.detail.length>0&&T.detail.forEach(P=>{P.permission.forEach(X=>{const $=`${P.id}-${X.id}-child`,G=X.code==="VIEW"||X.name.toUpperCase()==="VIEW";l.value.has($)||l.value.set($,G||(D?P.checked??!1:!1))})})})})(i.value)},u=()=>{console.log("[DCodePermissionMenu] initializeFromModelValue called. modelValue:",a.modelValue),l.value.clear(),d(!1),a.modelValue&&a.modelValue.length>0&&a.modelValue.forEach(D=>{const N=D.menuId,A=D.actionsIds;i.value.forEach(T=>{T.id===N&&A.forEach(P=>{const X=`${N}-${P}-parent`;l.value.set(X,!0)}),T.detail&&T.detail.length>0&&T.detail.forEach(P=>{P.id===N&&A.forEach(X=>{const $=`${N}-${X}-child`;l.value.set($,!0)})})})})};u(),e.watch(()=>a.modelValue,()=>{u()},{deep:!0}),e.watch(()=>i.value.length,(D,N)=>{N===0&&D>0&&u()});const h=D=>D.detail&&D.detail.length>0,f=D=>{c.value.has(D)?c.value.delete(D):c.value.add(D)},m=D=>c.value.has(D),g=(D,N,A=!1)=>{const T=`${D}-${N}-${A?"child":"parent"}`;return l.value.get(T)??!1},b=()=>{const D=B();s("update:modelValue",D.permissions)},x=(D,N,A,T=!1)=>{const P=A.target.checked,X=`${D}-${N}-${T?"child":"parent"}`;l.value.set(X,P),s("permission-change",D,N,P,!T),b()},p=D=>D.permission.filter(C),C=D=>D.code==="VIEW"||D.name.toUpperCase()==="VIEW",w=(D,N,A)=>{const T=A.target.checked;N.permission.forEach(P=>{if(C(P)){const $=`${N.id}-${P.id}-child`;l.value.set($,!0);return}const X=`${N.id}-${P.id}-child`;l.value.set(X,T)}),l.value=new Map(l.value),s("menu-check",N.id,T),b()},E=(D,N=!1)=>{const A=N?D.permission:p(D);return!A||A.length===0?!1:A.every(T=>{const P=`${D.id}-${T.id}-${N?"child":"parent"}`;return l.value.get(P)??!1})},_=()=>{const D={};return i.value.forEach(N=>{var A;D[N.id]={name:N.name,parentPermissions:N.permission.map(T=>({id:T.id,name:T.name,checked:g(N.id,T.id,!1)})),children:((A=N.detail)==null?void 0:A.map(T=>({id:T.id,name:T.name,permissions:T.permission.map(P=>({id:P.id,name:P.name,checked:g(T.id,P.id,!0)}))})))||[]}}),D},B=()=>{const D=[],N=(A,T=!1)=>{const P=[];A.permission.forEach(X=>{const $=`${A.id}-${X.id}-${T?"child":"parent"}`;(l.value.get($)??!1)&&P.push(X.id)}),P.length>0&&D.push({menuId:A.id,actionsIds:P})};return i.value.forEach(A=>{N(A,!1),A.detail&&A.detail.length>0&&A.detail.forEach(T=>{N(T,!0)})}),{permissions:D}};return n({getCurrentStates:_,getPermissionsForDatabase:B,getAllPermissionsWithStatus:()=>{const D=[],N=(A,T=!1)=>{const P=A.permission.map($=>{const G=`${A.id}-${$.id}-${T?"child":"parent"}`,ne=l.value.get(G)??!1;return{id:$.id,name:$.name,checked:ne}}),X=P.filter($=>$.checked).map($=>$.id);D.push({menuId:A.id,menuName:A.name,actionsIds:X,actions:P})};return i.value.forEach(A=>{N(A,!1),A.detail&&A.detail.length>0&&A.detail.forEach(T=>{N(T,!0)})}),{permissions:D}},permissionStates:l,expandAll:()=>{i.value.forEach(D=>{h(D)&&c.value.add(D.id)})},collapseAll:()=>{c.value.clear()}}),(D,N)=>(e.openBlock(),e.createElementBlock("div",vB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,A=>(e.openBlock(),e.createElementBlock("div",{key:A.id,class:e.normalizeClass(["dcode-card overflow-hidden",{"border-l-4 border-l-blue-500":h(A)}])},[e.createElementVNode("div",PB,[e.createElementVNode("div",TB,[e.createElementVNode("div",OB,[h(A)?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:T=>f(A.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[m(A.id)?(e.openBlock(),e.createBlock(e.unref(ue.ChevronDown),{key:0,class:"w-5 h-5"})):(e.openBlock(),e.createBlock(e.unref(ue.ChevronRight),{key:1,class:"w-5 h-5"}))],8,FB)):(e.openBlock(),e.createElementBlock("div",zB)),t.showIcons&&A.icon?(e.openBlock(),e.createElementBlock("span",IB,[e.createElementVNode("i",{class:e.normalizeClass([A.icon,"text-2xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h3",RB,e.toDisplayString(A.name),1)])])]),A.permission&&A.permission.length>0&&!h(A)?(e.openBlock(),e.createElementBlock("div",LB,[e.createElementVNode("h4",$B,e.toDisplayString(e.unref(r)("common.permissions"))+": ",1),e.createElementVNode("div",jB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p(A),T=>(e.openBlock(),e.createElementBlock("label",{key:T.id,class:"flex items-center gap-2 px-3 py-2 bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700/50 rounded-lg cursor-pointer hover:border-blue-400 dark:hover:border-primary-500 hover:bg-blue-50 dark:hover:bg-neutral-900/50 transition-all group"},[e.createElementVNode("input",{type:"checkbox",checked:C(T)||g(A.id,T.id,!1),disabled:C(T),onChange:P=>x(A.id,T.id,P,!1),class:e.normalizeClass(["w-4 h-4 text-blue-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-blue-500 dark:focus:ring-blue-600",C(T)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,WB),e.createElementVNode("span",UB,e.toDisplayString(T.name),1)]))),128))])])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-[5000px]","leave-active-class":"transition-all duration-300 ease-in","leave-from-class":"opacity-100 max-h-[5000px]","leave-to-class":"opacity-0 max-h-0"},{default:e.withCtx(()=>[h(A)&&m(A.id)?(e.openBlock(),e.createElementBlock("div",HB,[e.createElementVNode("h4",qB,[N[0]||(N[0]=e.createElementVNode("span",{class:"w-1 h-4 bg-blue-500 rounded"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("common.subMenus")),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.detail,T=>(e.openBlock(),e.createElementBlock("div",{key:T.id,class:"bg-white dark:bg-neutral-800 rounded-lg border border-gray-200 dark:border-neutral-700/50 overflow-hidden shadow-sm hover:shadow transition-shadow"},[e.createElementVNode("div",GB,[e.createElementVNode("div",XB,[e.createElementVNode("div",KB,[t.showIcons&&T.icon?(e.openBlock(),e.createElementBlock("span",YB,[e.createElementVNode("i",{class:e.normalizeClass([T.icon,"text-xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h5",JB,e.toDisplayString(T.name),1),T.path?(e.openBlock(),e.createElementBlock("span",QB,e.toDisplayString(T.path),1)):e.createCommentVNode("",!0),e.createElementVNode("label",ZB,[e.createElementVNode("input",{type:"checkbox",checked:E(T,!0),onChange:P=>w(A,T,P),class:"w-3.5 h-3.5 text-pink-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-pink-500 dark:focus:ring-pink-600 cursor-pointer"},null,40,e_),e.createElementVNode("span",t_,e.toDisplayString(e.unref(r)("common.selectAll")),1)])])])]),T.permission&&T.permission.length>0?(e.openBlock(),e.createElementBlock("div",n_,[e.createElementVNode("div",o_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.permission,P=>(e.openBlock(),e.createElementBlock("label",{key:P.id,class:"flex items-center gap-2 px-2.5 py-1.5 bg-gray-50 dark:bg-zinc-900/50 border border-gray-200 dark:border-neutral-700 rounded-md cursor-pointer hover:border-pink-400 dark:hover:border-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/20 transition-all group"},[e.createElementVNode("input",{type:"checkbox",checked:C(P)||g(T.id,P.id,!0),disabled:C(P),onChange:X=>x(T.id,P.id,X,!0),class:e.normalizeClass(["w-3.5 h-3.5 text-pink-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-pink-500 dark:focus:ring-pink-600",C(P)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,r_),e.createElementVNode("span",a_,e.toDisplayString(P.name),1)]))),128))])])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-40ddf81d"]]),s_={class:"space-y-4"},i_={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},l_={key:0,class:"text-danger-500"},c_={key:1,class:"flex items-center justify-center p-8 bg-white dark:bg-gray-800 rounded-lg shadow"},d_={class:"text-neutral-600 dark:text-neutral-400"},u_={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},f_={class:"text-neutral-500 dark:text-neutral-400"},h_={key:3,class:"space-y-3"},m_={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},p_={class:"flex items-center gap-3"},g_={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},b_={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},y_={class:"flex items-center gap-2 text-sm font-medium"},x_={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},k_={class:"p-4"},w_={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},C_={class:"ml-2 flex-1 min-w-0"},E_=["for"],B_={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},__={key:4,class:"mt-1 text-xs text-danger-600"},Ys=e.defineComponent({__name:"DCodeTreePermissions",props:{modelValue:{},label:{},required:{type:Boolean},disabled:{type:Boolean},error:{},treeData:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,{t:a}=Rt.useI18n(),s=e.ref(!0),i=e.ref([]),l=e.ref({}),c=e.ref([]),d=e.ref({}),u=p=>{if(console.log(p),!p)return[];if(Array.isArray(p)&&p.length>0&&p[0].module&&Array.isArray(p[0].permissions))return p.map(C=>({menuId:C.menuId,module:C.module,label:C.label||C.module,permissions:C.permissions}));if(Array.isArray(p)&&p.length>0&&p[0].key){const C={};return p.forEach(w=>{const E=w.key,_=E&&E.includes(".")?E.split(".")[0]:"other";C[_]||(C[_]={menuId:0,module:_,label:_,permissions:[]}),C[_].permissions.push({id:w.id,key:w.key,label:w.label,description:w.description})}),Object.values(C)}if(Array.isArray(p)&&p.length>0&&p[0].id&&p[0].name&&Array.isArray(p[0].permission)){const C=[],w=(E,_="")=>{const B=_?`${_}.${E.name}`:E.name,k=B.toLowerCase().replace(/\s+/g,"_"),y=[];if(E.detail&&Array.isArray(E.detail)&&E.detail.forEach(V=>{y.push(V.id)}),E.permission&&E.permission.length>0){const V=E.permission.map(D=>({id:D.id,key:`${k}.${D.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${D.name} ${E.name}`,description:`Permission to ${D.name.toLowerCase()} ${E.name.toLowerCase()}`}));C.push({menuId:E.id,module:k,label:E.name,permissions:V,subMenuIds:y.length>0?y:void 0})}E.detail&&Array.isArray(E.detail)&&E.detail.forEach(V=>{w(V,B)})};return p.forEach(E=>w(E)),C}return p.data?u(p.data):[]},h=async()=>{s.value=!0;try{let p;o.treeData&&o.treeData.length>0?p=o.treeData:p=[];const C=u(p);i.value=C;const w={},E=[],_={};C.forEach(k=>{k.permissions.forEach(y=>{const V=typeof y.id=="string"?parseInt(y.id):y.id;_[V]=k.menuId})});const B=new Set;o.modelValue&&Array.isArray(o.modelValue)&&o.modelValue.forEach(k=>{E.push(k.menuId),k.actionsIds&&Array.isArray(k.actionsIds)&&k.actionsIds.forEach(y=>B.add(y))}),C.forEach(k=>k.permissions.forEach(y=>{const V=typeof y.id=="string"?parseInt(y.id):y.id;w[V]=B.has(V)})),l.value=w,c.value=E,d.value=_}catch{i.value=[]}finally{s.value=!1}},f=p=>p.permissions.filter(C=>{const w=typeof C.id=="string"?parseInt(C.id):C.id;return l.value[w]}).length,m=p=>p.permissions.every(C=>{const w=typeof C.id=="string"?parseInt(C.id):C.id;return l.value[w]}),g=p=>{const C=f(p);return C>0&&C<p.permissions.length},b=e.ref(!1),x=(p,C)=>{b.value=!0,p.permissions.map(_=>typeof _.id=="string"?parseInt(_.id):_.id),p.permissions.forEach(_=>{const B=typeof _.id=="string"?parseInt(_.id):_.id;l.value[B]=C});let w=o.modelValue?[...o.modelValue]:[],E=[p.menuId];p.subMenuIds&&p.subMenuIds.length>0&&(E=[...E,...p.subMenuIds],p.subMenuIds.forEach(_=>{const B=i.value.find(k=>k.menuId===_);B&&B.permissions.forEach(k=>{const y=typeof k.id=="string"?parseInt(k.id):k.id;l.value[y]=C})})),C?E.forEach(_=>{const B=i.value.find(k=>k.menuId===_);if(B){const k=B.permissions.map(V=>typeof V.id=="string"?parseInt(V.id):V.id),y=w.findIndex(V=>V.menuId===_);y!==-1?w[y]={menuId:_,actionsIds:k}:w.push({menuId:_,actionsIds:k})}}):w=w.filter(_=>!E.includes(_.menuId)),c.value=w.map(_=>_.menuId),console.log("Full Result:",JSON.stringify(w,null,2)),r("update:modelValue",w),setTimeout(()=>{b.value=!1},100)};return e.watch(()=>o.modelValue,p=>{if(!p)return;const C=new Set,w=[];p.forEach(E=>{w.push(E.menuId),E.actionsIds&&Array.isArray(E.actionsIds)&&E.actionsIds.forEach(_=>C.add(_))}),Object.keys(l.value).forEach(E=>{const _=parseInt(E);l.value[_]=C.has(_)}),c.value=w}),e.watch(()=>o.treeData,p=>{p&&p.length>0&&h()},{deep:!0}),e.watch(l,(p,C)=>{if(b.value)return;if(Object.keys(p).map(E=>parseInt(E)).filter(E=>p[E]!==(C==null?void 0:C[E])).length>0){let E=o.modelValue?[...o.modelValue]:[];const _={};Object.keys(p).forEach(B=>{const k=parseInt(B);if(p[k]){const y=d.value[k];console.log(`Permission ${k} belongs to Menu ${y}`),y!==void 0&&(_[y]||(_[y]=[]),_[y].push(k))}}),Object.keys(_).forEach(B=>{const k=parseInt(B),y=_[k],V=E.findIndex(D=>D.menuId===k);V!==-1?E[V]={menuId:k,actionsIds:y}:E.push({menuId:k,actionsIds:y})}),E=E.filter(B=>_[B.menuId]&&_[B.menuId].length>0),c.value=E.map(B=>B.menuId),console.log("Result:",JSON.stringify(E,null,2)),r("update:modelValue",E)}},{deep:!0}),e.onMounted(h),(p,C)=>(e.openBlock(),e.createElementBlock("div",s_,[t.label?(e.openBlock(),e.createElementBlock("label",i_,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",l_,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",c_,[e.createVNode(e.unref(ue.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),e.createElementVNode("span",d_,e.toDisplayString(e.unref(a)("common.loadingPermissions")),1)])):i.value.length===0?(e.openBlock(),e.createElementBlock("div",u_,[e.createElementVNode("p",f_,e.toDisplayString(e.unref(a)("common.noPermissions")),1)])):(e.openBlock(),e.createElementBlock("div",h_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,w=>(e.openBlock(),e.createElementBlock("div",{key:w.module,class:"bg-white dark:bg-neutral-800 rounded-lg border border-neutral-200/60 dark:border-neutral-700/50 shadow-sm hover:shadow-md transition-shadow"},[e.createElementVNode("div",m_,[e.createElementVNode("div",p_,[e.createVNode(Cn,{modelValue:m(w),indeterminate:g(w),"onUpdate:modelValue":E=>x(w,!!E),disabled:t.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),e.createElementVNode("div",null,[e.createElementVNode("div",g_,e.toDisplayString(w.label||w.module),1),e.createElementVNode("div",b_,e.toDisplayString(f(w))+" "+e.toDisplayString(e.unref(a)("common.from"))+" "+e.toDisplayString(w.permissions.length)+" "+e.toDisplayString(e.unref(a)("common.selected")),1)])]),e.createElementVNode("div",y_,[e.createElementVNode("div",x_,e.toDisplayString(f(w))+"/"+e.toDisplayString(w.permissions.length),1)])]),e.createElementVNode("div",k_,[e.createElementVNode("div",w_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.permissions,E=>(e.openBlock(),e.createElementBlock("div",{key:E.id,class:"flex items-start p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"},[e.createVNode(Cn,{modelValue:l.value[typeof E.id=="string"?parseInt(E.id):E.id],"onUpdate:modelValue":_=>l.value[typeof E.id=="string"?parseInt(E.id):E.id]=_,disabled:t.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),e.createElementVNode("div",C_,[e.createElementVNode("label",{for:`perm-${E.id}`,class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer block"},e.toDisplayString(E.label||E.key),9,E_),E.description?(e.openBlock(),e.createElementBlock("p",B_,e.toDisplayString(E.description),1)):e.createCommentVNode("",!0)])]))),128))])])]))),128))])),t.error?(e.openBlock(),e.createElementBlock("p",__,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),S_=(t,n="short",o="id-ID")=>{const r=typeof t=="string"?new Date(t):t,a=c=>String(c).padStart(2,"0"),s=c=>`${a(c.getHours())}:${a(c.getMinutes())}:${a(c.getSeconds())}`,l={id:"id-ID",en:"en-GB"}[o]||o;return n==="time"?s(r):n==="datetime"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(r):n==="long"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(r):new Intl.DateTimeFormat(l,{day:"2-digit",month:"short",year:"numeric"}).format(r)},A_=t=>new Promise((n,o)=>{const r=document.createElement("textarea");r.value=t,r.style.top="0",r.style.left="0",r.style.position="fixed",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy")?n():o(new Error("Copy command was unsuccessful"))}catch(a){o(a)}finally{document.body.removeChild(r)}}),V_=async t=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(t):A_(t),D_={key:0,class:"fixed inset-0 z-[100] flex justify-end"},N_={key:0,class:"relative w-full max-w-sm h-full bg-white dark:bg-slate-900 shadow-2xl flex flex-col border-l border-gray-200 dark:border-gray-800"},M_={class:"px-6 py-4 border-b border-gray-100 dark:border-gray-800 flex items-center justify-between"},v_={class:"text-lg font-semibold text-gray-900 dark:text-gray-100"},P_={key:0,class:"text-sm text-gray-500 dark:text-gray-400 mt-1"},T_={class:"flex-1 overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-gray-200 dark:scrollbar-thumb-gray-800"},O_={class:"px-6 py-4 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-slate-900/50"},F_=e.defineComponent({__name:"DataFilterSheet",props:{title:{default:"Filter Data"},description:{default:"Masukan parameter pencarian untuk memfilter data."}},setup(t,{expose:n}){const o=e.ref(!1),r=()=>{o.value=!0,document.body.style.overflow="hidden"},a=()=>{o.value=!1,document.body.style.overflow=""};return n({open:r,close:a}),(s,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{onClick:r},[e.renderSlot(s.$slots,"trigger",{},()=>[e.createVNode(st,{variant:"outline",class:"gap-2",icon:"Search",text:"Pencarian"})])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[o.value?(e.openBlock(),e.createElementBlock("div",D_,[e.createVNode(e.Transition,{appear:"","enter-active-class":"transition-opacity duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/40 backdrop-blur-sm",onClick:a})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{appear:"","enter-active-class":"transition-transform duration-300 ease-out","enter-from-class":"translate-x-full","enter-to-class":"translate-x-0","leave-active-class":"transition-transform duration-200 ease-in","leave-from-class":"translate-x-0","leave-to-class":"translate-x-full"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",N_,[e.createElementVNode("div",M_,[e.createElementVNode("div",null,[e.createElementVNode("h3",v_,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("p",P_,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),e.createVNode(st,{variant:"ghost",size:"icon",onClick:a,icon:"X",class:"text-gray-400 hover:text-gray-600"})]),e.createElementVNode("div",T_,[e.renderSlot(s.$slots,"default")]),e.createElementVNode("div",O_,[e.renderSlot(s.$slots,"footer")])])):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]))]))}}),z_={key:0},I_=["value","name"],Jd=e.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const{locale:o}=Rt.useI18n(),r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,u=>{s.value=u});const i={DCodeTextField:so,DCodeAutoComplete:mr,DCodeDatePicker:ta,DCodeTextarea:ko,DCodeTextArea:ko,DCodeCheckbox:Cn,DCodeSwitch:sa,DCodeOtpInput:ra,DCodeImageField:oa,DCodeSlider:aa},l=e.computed(()=>{const u=r.field.component;return i[u]||null}),c=e.computed(()=>{const u=r.field.props,h={};return(u.labelID||u.labelEN)&&(h.label=o.value==="id"?u.labelID:u.labelEN),(u.placeholderID||u.placeholderEN)&&(h.placeholder=o.value==="id"?u.placeholderID:u.placeholderEN),u.required!==void 0&&(h.required=u.required),u.disabled!==void 0&&(h.disabled=u.disabled),u.readonly!==void 0&&(h.readonly=u.readonly),u.valueType&&(h.type=u.valueType),u.minLength!==void 0&&(h.minlength=u.minLength),u.maxLength!==void 0&&(h.maxlength=u.maxLength),u.min!==void 0&&(h.min=u.min),u.max!==void 0&&(h.max=u.max),u.options&&(h.options=u.options),u.endpoint&&(h.endpoint=u.endpoint),u.itemTitle&&(h.itemTitle=u.itemTitle),u.itemValue&&(h.itemValue=u.itemValue),u.returnObject!==void 0&&(h.returnObject=u.returnObject),u.clearable!==void 0&&(h.clearable=u.clearable),Object.keys(u).forEach(f=>{!["labelID","labelEN","placeholderID","placeholderEN"].includes(f)&&!h.hasOwnProperty(f)&&(h[f]=u[f])}),h}),d=u=>{s.value=u,a("update:modelValue",u)};return(u,h)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",z_,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,I_)])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[h[0]||(h[0]=f=>s.value=f),d]}),null,16,["modelValue"]))}}),R_=e.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=ft.useVModel(o,"modelValue",r,{passive:!0,defaultValue:o.defaultValue});return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>e.isRef(a)?a.value=l:null),class:e.normalizeClass(e.unref(We)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",o.class))},null,2)),[[e.vModelText,e.unref(a)]])}}),L_=e.defineComponent({__name:"Pagination",props:{page:{},defaultPage:{},itemsPerPage:{},total:{},siblingCount:{},disabled:{type:Boolean},showEdges:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:page"],setup(t,{emit:n}){const o=t,r=n,a=ft.reactiveOmit(o,"class"),s=Ne.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Ne.PaginationRoot),e.mergeProps({"data-slot":"pagination"},e.unref(s),{class:o.class}),{default:e.withCtx(c=>[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(c)))]),_:3},16,["class"]))}}),$_=e.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=ft.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Ne.PaginationList),e.mergeProps({"data-slot":"pagination-content"},e.unref(o),{class:e.unref(We)("flex flex-row items-center gap-1",n.class)}),{default:e.withCtx(s=>[e.renderSlot(r.$slots,"default",e.normalizeProps(e.guardReactiveProps(s)))]),_:3},16,["class"]))}}),j_=e.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=ft.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Ne.PaginationEllipsis),e.mergeProps({"data-slot":"pagination-ellipsis"},e.unref(o),{class:e.unref(We)("flex size-9 items-center justify-center",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createVNode(e.unref(ue.MoreHorizontal),{class:"size-4"}),a[0]||(a[0]=e.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),W_=e.defineComponent({__name:"PaginationFirst",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=ft.reactiveOmit(n,"class","size"),r=Ne.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Ne.PaginationFirst),e.mergeProps({"data-slot":"pagination-first",class:e.unref(We)(e.unref(ao)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ue.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),U_=e.defineComponent({__name:"PaginationItem",props:{value:{},asChild:{type:Boolean},as:{},size:{default:"icon"},class:{type:[Boolean,null,String,Object,Array]},isActive:{type:Boolean}},setup(t){const n=t,o=ft.reactiveOmit(n,"class","size","isActive");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Ne.PaginationListItem),e.mergeProps({"data-slot":"pagination-item"},e.unref(o),{class:e.unref(We)(e.unref(ao)({variant:"ghost",size:t.size}),t.isActive?"bg-[#0056a1] dark:bg-[#003d75] text-white hover:bg-[#0056a1]/90 dark:hover:bg-[#003d75]/90 hover:text-white":"",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),H_=e.defineComponent({__name:"PaginationLast",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=ft.reactiveOmit(n,"class","size"),r=Ne.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Ne.PaginationLast),e.mergeProps({"data-slot":"pagination-last",class:e.unref(We)(e.unref(ao)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Last",-1)),e.createVNode(e.unref(ue.ChevronRightIcon))])]),_:3},16,["class"]))}}),q_=e.defineComponent({__name:"PaginationNext",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=ft.reactiveOmit(n,"class","size"),r=Ne.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Ne.PaginationNext),e.mergeProps({"data-slot":"pagination-next",class:e.unref(We)(e.unref(ao)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Next",-1)),e.createVNode(e.unref(ue.ChevronRightIcon))])]),_:3},16,["class"]))}}),G_=e.defineComponent({__name:"PaginationPrevious",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=ft.reactiveOmit(n,"class","size"),r=Ne.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Ne.PaginationPrev),e.mergeProps({"data-slot":"pagination-previous",class:e.unref(We)(e.unref(ao)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ue.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),X_=e.defineComponent({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},by:{type:[String,Function]},dir:{},multiple:{type:Boolean},autocomplete:{},disabled:{type:Boolean},name:{},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(t,{emit:n}){const o=t,r=n,a=Ne.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(Ne.SelectRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),K_=e.defineComponent({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean},position:{default:"popper"},bodyLock:{type:Boolean},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(t,{emit:n}){const o=t,r=n,a=ft.reactiveOmit(o,"class"),s=Ne.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Ne.SelectPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Ne.SelectContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(We)("relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t.position==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",o.class)}),{default:e.withCtx(()=>[e.createVNode(e.unref(Z_)),e.createVNode(e.unref(Ne.SelectViewport),{class:e.normalizeClass(e.unref(We)("p-1",t.position==="popper"&&"h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]"))},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},8,["class"]),e.createVNode(e.unref(Q_))]),_:3},16,["class"])]),_:3}))}}),Y_={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},J_=e.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=ft.reactiveOmit(n,"class"),r=Ne.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Ne.SelectItem),e.mergeProps(e.unref(r),{class:e.unref(We)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n.class)}),{default:e.withCtx(()=>[e.createElementVNode("span",Y_,[e.createVNode(e.unref(Ne.SelectItemIndicator),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ue.Check),{class:"h-4 w-4"})]),_:1})]),e.createVNode(e.unref(Ne.SelectItemText),null,{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),Q_=e.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=ft.reactiveOmit(n,"class"),r=Ne.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Ne.SelectScrollDownButton),e.mergeProps(e.unref(r),{class:e.unref(We)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ue.ChevronDown))])]),_:3},16,["class"]))}}),Z_=e.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=ft.reactiveOmit(n,"class"),r=Ne.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Ne.SelectScrollUpButton),e.mergeProps(e.unref(r),{class:e.unref(We)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ue.ChevronUp))])]),_:3},16,["class"]))}}),e2=e.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=ft.reactiveOmit(n,"class"),r=Ne.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Ne.SelectTrigger),e.mergeProps(e.unref(r),{class:e.unref(We)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:truncate text-start",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default"),e.createVNode(e.unref(Ne.SelectIcon),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(ue.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),t2=e.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Ne.SelectValue),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),tr={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},wo={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},At={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},n2={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},o2={dangerouslyHTMLString:!1,multiple:!0,position:tr.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},r2={rtl:!1,newestOnTop:!1,toastClassName:""},Qd={...o2,...r2};At.DEFAULT;var Ge=(t=>(t[t.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",t[t.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",t.CSS_NAMESPACE="Toastify",t))(Ge||{}),Js=(t=>(t.ENTRANCE_ANIMATION_END="d",t))(Js||{});const a2={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},s2={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},i2={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},l2={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},Zd="Toastify--animate Toastify__none-enter";function eu(t,n=!1){var o;let r=a2;if(!t||typeof t=="string")switch(t){case"flip":r=l2;break;case"zoom":r=i2;break;case"slide":r=s2;break}else r=t;if(n)r.enter=Zd;else if(r.enter===Zd){const a=(o=r.exit.split("__")[1])==null?void 0:o.split("-")[0];r.enter=`Toastify--animate Toastify__${a}-enter`}return r}function c2(t){return t.containerId||String(t.position)}const la="will-unmount";function d2(t=tr.TOP_RIGHT){return!!document.querySelector(`.${Ge.CSS_NAMESPACE}__toast-container--${t}`)}function u2(t=tr.TOP_RIGHT){return`${Ge.CSS_NAMESPACE}__toast-container--${t}`}function f2(t,n,o=!1){const r=[`${Ge.CSS_NAMESPACE}__toast-container`,`${Ge.CSS_NAMESPACE}__toast-container--${t}`,o?`${Ge.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return Eo(n)?n({position:t,rtl:o,defaultClassName:r}):`${r} ${n||""}`}function h2(t){var n;const{position:o,containerClassName:r,rtl:a=!1,style:s={}}=t,i=Ge.CSS_NAMESPACE,l=u2(o),c=document.querySelector(`.${i}`),d=document.querySelector(`.${l}`),u=!!d&&!((n=d.className)!=null&&n.includes(la)),h=c||document.createElement("div"),f=document.createElement("div");f.className=f2(o,r,a),f.dataset.testid=`${Ge.CSS_NAMESPACE}__toast-container--${o}`,f.id=c2(t);for(const m in s)if(Object.prototype.hasOwnProperty.call(s,m)){const g=s[m];f.style[m]=g}return c||(h.className=Ge.CSS_NAMESPACE,document.body.appendChild(h)),u||h.appendChild(f),f}function Qs(t){var n,o,r;const a=typeof t=="string"?t:((n=t.currentTarget)==null?void 0:n.id)||((o=t.target)==null?void 0:o.id),s=document.getElementById(a);s&&s.removeEventListener("animationend",Qs,!1);try{nr[a].unmount(),(r=document.getElementById(a))==null||r.remove(),delete nr[a],delete wt[a]}catch{}}const nr=e.reactive({});function m2(t,n){const o=document.getElementById(String(n));o&&(nr[o.id]=t)}function Zs(t,n=!0){const o=String(t);if(!nr[o])return;const r=document.getElementById(o);r&&r.classList.add(la),n?(g2(t),r&&r.addEventListener("animationend",Qs,!1)):Qs(o),Wt.items=Wt.items.filter(a=>a.containerId!==t)}function p2(t){for(const n in nr)Zs(n,t);Wt.items=[]}function tu(t,n){const o=document.getElementById(t.toastId);if(o){let r=t;r={...r,...eu(r.transition)};const a=r.appendPosition?`${r.exit}--${r.position}`:r.exit;o.className+=` ${a}`,n&&n(o)}}function g2(t){for(const n in wt)if(n===t)for(const o of wt[n]||[])tu(o)}function b2(t){const n=Co().find(o=>o.toastId===t);return n==null?void 0:n.containerId}function ei(t){return document.getElementById(t)}function y2(t){const n=ei(t.containerId);return n&&n.classList.contains(la)}function nu(t){var n;const o=e.isVNode(t.content)?e.toRaw(t.content.props):null;return o??e.toRaw((n=t.data)!=null?n:{})}function x2(t){return t?Wt.items.filter(n=>n.containerId===t).length>0:Wt.items.length>0}function k2(){if(Wt.items.length>0){const t=Wt.items.shift();ca(t==null?void 0:t.toastContent,t==null?void 0:t.toastProps)}}const wt=e.reactive({}),Wt=e.reactive({items:[]});function Co(){const t=e.toRaw(wt);return Object.values(t).reduce((n,o)=>[...n,...o],[])}function w2(t){return Co().find(n=>n.toastId===t)}function ca(t,n={}){if(y2(n)){const o=ei(n.containerId);o&&o.addEventListener("animationend",ti.bind(null,t,n),!1)}else ti(t,n)}function ti(t,n={}){const o=ei(n.containerId);o&&o.removeEventListener("animationend",ti.bind(null,t,n),!1);const r=wt[n.containerId]||[],a=r.length>0;if(!a&&!d2(n.position)){const s=h2(n),i=e.createApp(H2,n);n.useHandler&&n.useHandler(i),i.mount(s),m2(i,s.id)}a&&!n.updateId&&(n.position=r[0].position),e.nextTick(()=>{n.updateId?Ot.update(n):Ot.add(t,n)})}const Ot={add(t,n){const{containerId:o=""}=n;o&&(wt[o]=wt[o]||[],wt[o].find(r=>r.toastId===n.toastId)||setTimeout(()=>{var r,a;n.newestOnTop?(r=wt[o])==null||r.unshift(n):(a=wt[o])==null||a.push(n),n.onOpen&&n.onOpen(nu(n))},n.delay||0))},remove(t){if(t){const n=b2(t);if(n){const o=wt[n];let r=o.find(a=>a.toastId===t);wt[n]=o.filter(a=>a.toastId!==t),!wt[n].length&&!x2(n)&&Zs(n,!1),k2(),e.nextTick(()=>{r!=null&&r.onClose&&(r.onClose(nu(r)),r=void 0)})}}},update(t={}){const{containerId:n=""}=t;if(n&&t.updateId){wt[n]=wt[n]||[];const o=wt[n].find(s=>s.toastId===t.toastId),r=(o==null?void 0:o.position)!==t.position||(o==null?void 0:o.transition)!==t.transition,a={...t,disabledEnterTransition:!r,updateId:void 0};Ot.dismissForce(t==null?void 0:t.toastId),setTimeout(()=>{Xe(a.content,a)},t.delay||0)}},clear(t,n=!0){t?Zs(t,n):p2(n)},dismissCallback(t){var n;const o=(n=t.currentTarget)==null?void 0:n.id,r=document.getElementById(o);r&&(r.removeEventListener("animationend",Ot.dismissCallback,!1),setTimeout(()=>{Ot.remove(o)}))},dismiss(t){if(t){const n=Co();for(const o of n)if(o.toastId===t){tu(o,r=>{r.addEventListener("animationend",Ot.dismissCallback,!1)});break}}},dismissForce(t){if(t){const n=Co();for(const o of n)if(o.toastId===t){const r=document.getElementById(t);r&&(r.remove(),r.removeEventListener("animationend",Ot.dismissCallback,!1),Ot.remove(t));break}}}},C2=e.reactive({useHandler:void 0}),ou=e.reactive({}),da=e.reactive({});function ru(){return Math.random().toString(36).substring(2,9)}function E2(t){return typeof t=="number"&&!isNaN(t)}function ni(t){return typeof t=="string"}function Eo(t){return typeof t=="function"}function ua(...t){return e.mergeProps(...t)}function fa(t){return typeof t=="object"&&(!!(t!=null&&t.render)||!!(t!=null&&t.setup)||typeof(t==null?void 0:t.type)=="object")}function B2(t={}){ou[`${Ge.CSS_NAMESPACE}-default-options`]=t}function au(){return ou[`${Ge.CSS_NAMESPACE}-default-options`]||Qd}function _2(){const t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||t?"dark":"light"}var ha=(t=>(t[t.Enter=0]="Enter",t[t.Exit=1]="Exit",t))(ha||{});const su={containerId:{type:[String,Number],required:!1,default:""},clearOnUrlChange:{type:Boolean,required:!1,default:!0},disabledEnterTransition:{type:Boolean,required:!1,default:!1},dangerouslyHTMLString:{type:Boolean,required:!1,default:!1},multiple:{type:Boolean,required:!1,default:!0},limit:{type:Number,required:!1,default:void 0},position:{type:String,required:!1,default:tr.TOP_LEFT},bodyClassName:{type:String,required:!1,default:""},autoClose:{type:[Number,Boolean],required:!1,default:!1},closeButton:{type:[Boolean,Function,Object],required:!1,default:void 0},transition:{type:[String,Object],required:!1,default:"bounce"},hideProgressBar:{type:Boolean,required:!1,default:!1},pauseOnHover:{type:Boolean,required:!1,default:!0},pauseOnFocusLoss:{type:Boolean,required:!1,default:!0},closeOnClick:{type:Boolean,required:!1,default:!0},progress:{type:Number,required:!1,default:void 0},progressClassName:{type:String,required:!1,default:""},toastStyle:{type:Object,required:!1,default(){return{}}},progressStyle:{type:Object,required:!1,default(){return{}}},role:{type:String,required:!1,default:"alert"},theme:{type:String,required:!1,default:wo.AUTO},content:{type:[String,Object,Function],required:!1,default:""},toastId:{type:[String,Number],required:!1,default:""},data:{type:[Object,String],required:!1,default(){return{}}},type:{type:String,required:!1,default:At.DEFAULT},icon:{type:[Boolean,String,Number,Object,Function],required:!1,default:void 0},delay:{type:Number,required:!1,default:void 0},onOpen:{type:Function,required:!1,default:void 0},onClose:{type:Function,required:!1,default:void 0},onClick:{type:Function,required:!1,default:void 0},isLoading:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},toastClassName:{type:String,required:!1,default:""},updateId:{type:[String,Number],required:!1,default:""},contentProps:{type:Object,required:!1,default:null},expandCustomProps:{type:Boolean,required:!1,default:!1}},S2={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:At.DEFAULT},theme:{type:String,required:!1,default:wo.AUTO},hide:{type:Boolean,required:!1,default:void 0},className:{type:[String,Function],required:!1,default:""},controlledProgress:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:void 0},isIn:{type:Boolean,required:!1,default:void 0},progress:{type:Number,required:!1,default:void 0},closeToast:{type:Function,required:!1,default:void 0}},A2=e.defineComponent({name:"ProgressBar",props:S2,setup(t,{attrs:n}){const o=e.ref(),r=e.computed(()=>t.hide?"true":"false"),a=e.computed(()=>({...n.style||{},animationDuration:`${t.autoClose===!0?5e3:t.autoClose}ms`,animationPlayState:t.isRunning?"running":"paused",opacity:t.hide||t.autoClose===!1?0:1,transform:t.controlledProgress?`scaleX(${t.progress})`:"none"})),s=e.computed(()=>[`${Ge.CSS_NAMESPACE}__progress-bar`,t.controlledProgress?`${Ge.CSS_NAMESPACE}__progress-bar--controlled`:`${Ge.CSS_NAMESPACE}__progress-bar--animated`,`${Ge.CSS_NAMESPACE}__progress-bar-theme--${t.theme}`,`${Ge.CSS_NAMESPACE}__progress-bar--${t.type}`,t.rtl?`${Ge.CSS_NAMESPACE}__progress-bar--rtl`:null].filter(Boolean).join(" ")),i=e.computed(()=>`${s.value} ${(n==null?void 0:n.class)||""}`),l=()=>{o.value&&(o.value.onanimationend=null,o.value.ontransitionend=null)},c=()=>{t.isIn&&t.closeToast&&t.autoClose!==!1&&(t.closeToast(),l())},d=e.computed(()=>t.controlledProgress?null:c),u=e.computed(()=>t.controlledProgress?c:null);return e.watchEffect(()=>{o.value&&(l(),o.value.onanimationend=d.value,o.value.ontransitionend=u.value)}),()=>e.createVNode("div",{ref:o,role:"progressbar","aria-hidden":r.value,"aria-label":"notification timer",class:i.value,style:a.value},null)}}),V2=e.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:wo.AUTO},type:{type:String,required:!1,default:wo.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(t){return()=>e.createVNode("button",{class:`${Ge.CSS_NAMESPACE}__close-button ${Ge.CSS_NAMESPACE}__close-button--${t.theme}`,type:"button",onClick:n=>{n.stopPropagation(),t.closeToast&&t.closeToast(n)},"aria-label":t.ariaLabel},[e.createVNode("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},[e.createVNode("path",{"fill-rule":"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"},null)])])}}),ma=({theme:t,type:n,path:o,...r})=>e.createVNode("svg",e.mergeProps({viewBox:"0 0 24 24",width:"100%",height:"100%",style:{fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`}},r),[e.createVNode("path",{d:o},null)]);function D2(t){return e.createVNode(ma,e.mergeProps(t,{path:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}),null)}function N2(t){return e.createVNode(ma,e.mergeProps(t,{path:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}),null)}function M2(t){return e.createVNode(ma,e.mergeProps(t,{path:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}),null)}function v2(t){return e.createVNode(ma,e.mergeProps(t,{path:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}),null)}function P2(){return e.createVNode("div",{class:`${Ge.CSS_NAMESPACE}__spinner`},null)}const pa={info:N2,warning:D2,success:M2,error:v2,spinner:P2},T2=t=>t in pa;function O2({theme:t,type:n,isLoading:o,icon:r}){let a;const s=!!o||n==="loading",i={theme:t,type:n};if(s&&(r===void 0||typeof r=="boolean"))return pa.spinner();if(r!==!1){if(fa(r))a=e.toRaw(r);else if(Eo(r)){const l=r;i.type=s?"loading":n,a=l(i),a=!a&&s?pa.spinner():a}else e.isVNode(r)?a=e.cloneVNode(r,i):ni(r)||E2(r)?a=r:T2(n)&&(a=pa[n](i));return a}}const F2=()=>{};function z2(t,n,o=Ge.COLLAPSE_DURATION){const{scrollHeight:r,style:a}=t,s=o;requestAnimationFrame(()=>{a.minHeight="initial",a.height=r+"px",a.transition=`all ${s}ms`,requestAnimationFrame(()=>{a.height="0",a.padding="0",a.margin="0",setTimeout(n,s)})})}function I2(t){const n=e.ref(!1),o=e.ref(!1),r=e.ref(!1),a=e.ref(ha.Enter),s=e.reactive({...t,appendPosition:t.appendPosition||!1,collapse:typeof t.collapse>"u"?!0:t.collapse,collapseDuration:t.collapseDuration||Ge.COLLAPSE_DURATION}),i=s.done||F2,l=e.computed(()=>s.appendPosition?`${s.enter}--${s.position}`:s.enter),c=e.computed(()=>s.appendPosition?`${s.exit}--${s.position}`:s.exit),d=e.computed(()=>t.pauseOnHover?{onMouseenter:x,onMouseleave:b}:{});function u(){const C=l.value.split(" ");f().addEventListener(Js.ENTRANCE_ANIMATION_END,b,{once:!0});const w=_=>{const B=f();_.target===B&&(B.dispatchEvent(new Event(Js.ENTRANCE_ANIMATION_END)),B.removeEventListener("animationend",w),B.removeEventListener("animationcancel",w),a.value===ha.Enter&&_.type!=="animationcancel"&&B.classList.remove(...C))},E=()=>{const _=f();_.classList.add(...C),_.addEventListener("animationend",w),_.addEventListener("animationcancel",w)};t.pauseOnFocusLoss&&m(),E()}function h(){if(!f())return;const C=()=>{const E=f();E.removeEventListener("animationend",C),s.collapse?z2(E,i,s.collapseDuration):i()},w=()=>{const E=f();a.value=ha.Exit,E&&(E.className+=` ${c.value}`,E.addEventListener("animationend",C))};o.value||(r.value?C():setTimeout(w))}function f(){return t.toastRef.value}function m(){document.hasFocus()||x(),window.addEventListener("focus",b),window.addEventListener("blur",x)}function g(){window.removeEventListener("focus",b),window.removeEventListener("blur",x)}function b(){(!t.loading.value||t.isLoading===void 0)&&(n.value=!0)}function x(){n.value=!1}function p(C){C&&(C.stopPropagation(),C.preventDefault()),o.value=!1}return e.watchEffect(h),e.watchEffect(()=>{const C=Co();o.value=C.findIndex(w=>w.toastId===s.toastId)>-1}),e.watchEffect(()=>{t.isLoading!==void 0&&(t.loading.value?x():b())}),e.onMounted(u),e.onUnmounted(()=>{t.pauseOnFocusLoss&&g()}),{isIn:o,isRunning:n,hideToast:p,eventHandlers:d}}function R2(t){if(!t||typeof t!="object"||Array.isArray(t)||t.__v_isVNode)return!1;const n=t;return["title","content"].some(o=>o in n)}const L2=e.defineComponent({name:"ToastItem",inheritAttrs:!1,props:su,setup(t){const n=e.ref(),o=e.computed(()=>!!t.isLoading),r=e.computed(()=>t.progress!==void 0&&t.progress!==null),a=e.computed(()=>O2(t)),s=e.computed(()=>[`${Ge.CSS_NAMESPACE}__toast`,`${Ge.CSS_NAMESPACE}__toast-theme--${t.theme}`,`${Ge.CSS_NAMESPACE}__toast--${t.type}`,t.rtl?`${Ge.CSS_NAMESPACE}__toast--rtl`:void 0,t.toastClassName||""].filter(Boolean).join(" ")),{isRunning:i,isIn:l,hideToast:c,eventHandlers:d}=I2({toastRef:n,loading:o,done:()=>{Ot.remove(t.toastId)},...eu(t.transition,t.disabledEnterTransition),...t});function u(){const h=t.content;if(R2(h)){const f=[];return h.title!==void 0&&f.push(e.createVNode("div",{"data-testid":"toast-text-title",class:`${Ge.CSS_NAMESPACE}__toast-text-title`},[h.title])),h.content!==void 0&&f.push(e.createVNode("div",{"data-testid":"toast-text-content",class:`${Ge.CSS_NAMESPACE}__toast-text-content`},[h.content])),e.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${Ge.CSS_NAMESPACE}__toast-text`},[f])}return fa(h)?e.h(e.toRaw(h),{toastProps:e.toRaw(t),closeToast:c,data:t.data,...t.expandCustomProps?t.contentProps:{contentProps:t.contentProps||{}}}):Eo(h)?h({toastProps:e.toRaw(t),closeToast:c,data:t.data}):t.dangerouslyHTMLString?e.h("div",{innerHTML:h}):h}return()=>e.createVNode("div",e.mergeProps({id:t.toastId,class:s.value,style:t.toastStyle||{},ref:n,"data-testid":`toast-item-${t.toastId}`,onClick:h=>{t.closeOnClick&&c(),t.onClick&&t.onClick(h)}},d.value),[e.createVNode("div",{role:t.role,"data-testid":"toast-body",class:`${Ge.CSS_NAMESPACE}__toast-body ${t.bodyClassName||""}`},[a.value!=null&&e.createVNode("div",{"data-testid":`toast-icon-${t.type}`,class:[`${Ge.CSS_NAMESPACE}__toast-icon`,t.isLoading?"":`${Ge.CSS_NAMESPACE}--animate-icon ${Ge.CSS_NAMESPACE}__zoom-enter`].join(" ")},[fa(a.value)?e.h(e.toRaw(a.value),{theme:t.theme,type:t.type}):Eo(a.value)?a.value({theme:t.theme,type:t.type}):a.value]),e.createVNode("div",{"data-testid":"toast-content"},[u()])]),(t.closeButton===void 0||t.closeButton===!0)&&e.createVNode(V2,{theme:t.theme,closeToast:h=>{h.stopPropagation(),h.preventDefault(),c()}},null),fa(t.closeButton)?e.h(e.toRaw(t.closeButton),{closeToast:c,type:t.type,theme:t.theme}):Eo(t.closeButton)?t.closeButton({closeToast:c,type:t.type,theme:t.theme}):null,e.createVNode(A2,{className:t.progressClassName,style:t.progressStyle,rtl:t.rtl,theme:t.theme,isIn:l.value,type:t.type,hide:t.hideProgressBar,isRunning:i.value,autoClose:t.autoClose,controlledProgress:r.value,progress:t.progress,closeToast:t.isLoading?void 0:c},null)])}}),ga="vue3-toastify:url-change";let ba=0,or;function $2(){if(!(typeof window>"u")&&da.lastUrl!==window.location.href){da.lastUrl=window.location.href;const t=o=>typeof o.clearOnUrlChange=="boolean"?o.clearOnUrlChange:au().clearOnUrlChange!==!1,n=Object.values(wt).reduce((o,r)=>(Array.isArray(r)&&o.push(...r),o),[]);for(const o of n)o.toastId&&t(o)&&Ot.dismiss(o.toastId);Wt.items=Wt.items.filter(o=>!t(o.toastProps))}}function j2(){const{history:t}=window,n=t.pushState,o=t.replaceState;return t.pushState=function(...r){const a=n.apply(this,r);return window.dispatchEvent(new Event(ga)),a},t.replaceState=function(...r){const a=o.apply(this,r);return window.dispatchEvent(new Event(ga)),a},()=>{t.pushState=n,t.replaceState=o}}function W2(){if(typeof window>"u"||or)return;const t=j2(),n=()=>$2();window.addEventListener(ga,n),window.addEventListener("popstate",n),window.addEventListener("hashchange",n),or=()=>{t(),window.removeEventListener(ga,n),window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n),or=void 0}}function U2(){or&&(or(),da.lastUrl="")}const H2=e.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:su,setup(t){const n=e.computed(()=>t.containerId),o=e.computed(()=>wt[n.value]||[]),r=e.computed(()=>o.value.filter(a=>a.position===t.position));return e.onMounted(()=>{typeof window<"u"&&(ba+=1,W2())}),e.onUnmounted(()=>{typeof window<"u"&&ba>0&&(ba-=1,ba===0&&U2())}),()=>e.createVNode(e.Fragment,null,[r.value.map(a=>{const{toastId:s=""}=a;return e.createVNode(L2,e.mergeProps({key:s},a),null)})])}});let oi=!1;const iu={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function lu(){const t=[];return Co().forEach(n=>{const o=document.getElementById(n.containerId);o&&!o.classList.contains(la)&&t.push(n)}),t}function q2(t){const n=lu().length,o=t??0;return o>0&&n+Wt.items.length>=o}function G2(t){q2(t.limit)&&!t.updateId&&Wt.items.push({toastId:t.toastId,containerId:t.containerId,toastContent:t.content,toastProps:t})}function Fn(t,n,o={}){if(oi)return;o=ua(au(),{type:n},e.toRaw(o)),(!o.toastId||typeof o.toastId!="string"&&typeof o.toastId!="number")&&(o.toastId=ru()),o={...o,...o.type==="loading"?iu:{},content:t,containerId:o.containerId||String(o.position)};const r=Number(o==null?void 0:o.progress);return!isNaN(r)&&r<0&&(o.progress=0),r>1&&(o.progress=1),o.theme==="auto"&&(o.theme=_2()),G2(o),da.lastUrl=window.location.href,o.multiple?Wt.items.length?o.updateId&&ca(t,o):ca(t,o):(oi=!0,Xe.clearAll(void 0,!1),setTimeout(()=>{ca(t,o)},0),setTimeout(()=>{oi=!1},390)),o.toastId}const Xe=(t,n)=>Fn(t,At.DEFAULT,n);Xe.info=(t,n)=>Fn(t,At.DEFAULT,{...n,type:At.INFO}),Xe.error=(t,n)=>Fn(t,At.DEFAULT,{...n,type:At.ERROR}),Xe.warning=(t,n)=>Fn(t,At.DEFAULT,{...n,type:At.WARNING}),Xe.warn=Xe.warning,Xe.success=(t,n)=>Fn(t,At.DEFAULT,{...n,type:At.SUCCESS}),Xe.loading=(t,n)=>Fn(t,At.DEFAULT,ua(n,iu)),Xe.dark=(t,n)=>Fn(t,At.DEFAULT,ua(n,{theme:wo.DARK})),Xe.remove=t=>{t?Ot.dismiss(t):Ot.clear()},Xe.clearAll=(t,n)=>{e.nextTick(()=>{Ot.clear(t,n)})},Xe.isActive=t=>{let n=!1;return n=lu().findIndex(o=>o.toastId===t)>-1,n},Xe.update=(t,n={})=>{setTimeout(()=>{const o=w2(t);if(o){const r=e.toRaw(o),{content:a}=r,s={...r,...n,toastId:n.toastId||t,updateId:ru()},i=s.render||a;delete s.render,Fn(i,s.type,s)}},0)},Xe.done=t=>{Xe.update(t,{isLoading:!1,progress:1})},Xe.promise=X2;function X2(t,{pending:n,error:o,success:r},a){var s,i,l;let c;const d={...a||{},autoClose:!1};n&&(c=ni(n)?Xe.loading(n,d):Xe.loading(n.render,{...d,...n}));const u={autoClose:(s=a==null?void 0:a.autoClose)!=null?s:!0,closeOnClick:(i=a==null?void 0:a.closeOnClick)!=null?i:!0,closeButton:(l=a==null?void 0:a.autoClose)!=null?l:null,isLoading:void 0,draggable:null,delay:100},h=(m,g,b)=>{if(g==null){Xe.remove(c);return}const x={type:m,...u,...a,data:b},p=ni(g)?{render:g}:g;return c?Xe.update(c,{...x,...p,isLoading:!1}):Xe(p.render,{...x,...p,isLoading:!1}),b},f=Eo(t)?t():t;return f.then(m=>{h("success",r,m)}).catch(m=>{h("error",o,m)}),f}Xe.POSITION=tr,Xe.THEME=wo,Xe.TYPE=At,Xe.TRANSITIONS=n2;const K2={install(t,n={}){C2.useHandler=n.useHandler||(()=>{}),Y2(n)}};typeof window<"u"&&(window.Vue3Toastify=K2);function Y2(t={}){const n=ua(Qd,t);B2(n)}const J2={v:"4.8.0",meta:{g:"LottieFiles AE ",a:"",k:"",d:"",tc:""},fr:25,ip:0,op:273,w:500,h:500,nm:"not_found",ddd:0,assets:JSON.parse('[{"id":"image_0","w":175,"h":173,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAACtCAYAAADGWi9+AAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAYj0lEQVR4nO2dXVMb2ZnH/+cg1BIIkABjPF7bxFvZnamaqYHUrh1XqjbMxc7YV4Mucj3kEwzfIOwnCLnei+BP0PgmME5twWQry8DWFrh2qpKt3aRgXB4DtngRWKIlcc5eSGLUp7ul7qPWS7fO78rdWK1G+vP0c57zvAAKhUKhUCgUCoVCoVAoFAqFQqEIMqTTN9Au9Ofb0+B8CgzTICRJCZ8GAHAkOfBxnZeeEYJdAGAMewD2ALIHXO0hFttNfzJz2up7V9gTSvHqq5tTQN8sCKYp4dOc4+ctfLt9DuwCfAOUbqQ/fbDbwvdS1BAa8epfbc2Bk1kCPgfgXgdv5YwDG+BkBbH+FWWZW0egxauvbs4CdJ4QzAEY6fT92MGBZ0rIrSFw4tXXd5IwjHkCsgCPFjYej6E/EkF/fx80LQpKKQBgIB5zfI1hFHDFGAAgn78EAOTyBkrFEoqlkpe3P+McK+gjS8q18IfAiLfsx9JFt1ZW06IYiGvQotGyaPsjvt8TYwyXRgH5/CVyeeNa3I0gBF8zxhbTTx5t+H5TPUTXi7dGtF80+r+JwQEkBuMtE6sbLt7lcHGRRz5/6cYy73OChfRnD1facW9ho2vFq6/vJHFZWGok2ng8hpGhQSQSA9duQLdQFfLFuxxYxfWwQ1liObpSvPraNwsEZBEO7gGlFInBAYyNjnTMwnqBMYaLixwyx2d1rXF5cccW0k8e7bXv7oJLV4lXf749TRlfdto0oJQilRxCKjncdVbWLRfvcjg5Pa/nH59x8MX0458utfO+gkjXiFdf3VokBL+y+1kYRCuSy1/izdsTGEbB9ucVV2JeWWFnOi5efXVzihK64mRtU8khjI0mQyNakWz2op47ccY5WUg/ebDc5tsKBB0Vr766PU8IX4KNbxuPxzAxnoKmRTtwZ+2FMYbM8SlOTs9tf845niIWXVCbHGY6Jl59bXuJgH8pnqeUYmx0BKnkcCduq6MYRgEHRxlbV4IALxhnc8qN+IG2i7e8Q1ZYJsDn4s80LYr3Jm8EIoLQSt68PXaywmecklm1Q1emreLV13eS1Chs2Pm3qeQQboyPtvN2upqLdzkcHGbs4sPKD67QNvE6LcwopZgYT2F4ONGuW3Gkut1bzn/ovPUvFkv4/uCNrRvBOfllrwu4LeLVn29PE8Y3ICzMKKW4c/tm2xZlhlGAYRRQLJWQyxtgjDmGqmrpj0QQ6Y9cJ/XE4zHEahJ7WgljDEdvTpA9v7D8rNcF3HLx6qubU4TQXQjC1bQo7ty+2VIBFIslXLzLIZ83cPEu5/v1q8k/g4MDdTPT/ODgMKMELNBS8Tr5uK0UblWw2fN3rqyqX1S3rFPJoZY9SU5Os3jz9sRyvlcF3DLxtlu4ufwlstl3ttbJCwR4wYEpNJHc3h+JYGx0pCV+fDZ7gYOjjOU8p2Sm16IQrRPv2taKGA5rhXBz+Utkjs885tJiw0sRZbliAwDoLAimCTANF4nwrdrWdhBwz4XRWiJeuw0Iv4VrGAUcvT1pKNpycB8rANvwM+XwhyJPPmcXs66lFZbYzgcmwAumRWd7ZSfOd/FWtnx/W3uOUor7U7d9EW6jrdQK+xxkBfxqqR07UuXc4+IcJXyhXhm931vedgLmwLP044dzvrxBl+OreO0iC36Gw3L5SxweZurlxO5zThY7uXjRn29P44ov1EuiHxsdwdho0pf323/52rIw5Rz/kn7ycNGXN+hifBXvs7WtXdHyTE6M+fK4zByfInN85vTjjotWpFH5Ujwew+TEWNObIYwx7H/32vIH3QsLON/Ea5eP68eWL2MMr16/cfJtuz5xW1/dnKWELtm5E5RSvHfrRtMxYsMoYP/la/H0Ptei02H2f30Rb2UHbaf2nKZFce/OraauWy/LKmglM/VKm/x4OtnFgDnIb9KPHyw0deEuxhfxiu4CpRT37txq6pFoGAW8fHVon5jS5dbWiXplTn74wS9fHVqeUGF2H5pe/utr31hW2M0WRtYR7j6nZDaIwgWA9KcPdpkWneUcT8WfZY7PcHBo3XzwwuTEmCWiQxlfbuqiXUxTlldf30kSo7CHmkdhPB7Dnds3pa/pJNywxTArbsSvxfPNrhNs3YeQbh83Z3kvC5YSnonxlPTlnITLOZ5+/vhhqBYf6cc/XeKc/FI8f3J6jmxWfos7lRxGXFgAEsKX9PUdf2JzXYS0eMsxXXMYqJmkFMYYDo6sydec42n6ycN52fvsZtJPHizbCfjgKNNUFtzYqGVNOILLQugWbk1YXrpoOqK0qQXHq9fWpOswC7eKo4AP7aMsbhiIxzA8ZI5eEIKFsFlfKfE6WV3Z7d/M8alllUyAF2EXbhU7ATs9idzSC9ZX0vJara5stW81K0xgn2nRWakLBpSygM1RCMMoIHMs5+b390dCb309i1df30lW2oxeI2t1GWM4tIaHzjglc2FanLkl/eThPCH4uvbcyek5ci7TPUXsrW8xNEk73hVnGPMQEm9krW7m+NS6Jw++GNaguhtYNDoHwPQoOrSvIm6IvfXli83cXzfhWbyVjuTXJAblWosaRsGS1lhO5wvmBoRfpD+ZOeUE87XniqUSTk6zUtdLJYfEU/f059vTcnfXXXhSXaWiwFRBYPNocsWRtRbrDJyFakEhS/qzhysceFZ7LnN8hmLR0xgBAOUcE0v48oqH4nP2aDLpfO2RbAfyXP7SugcPvhiUJJu2UP5DNrkPdVJC65IaMVtfcc0SVDyJV/ylR4YGpd7ULrrQ6+6CSPrJoz3OYfpMsucXUtY3kRgQT43oX20FXsCuxVv5ZU0+gs2H0hBbq8vJoucL9QKx6BJ8sL7VsnwTLPjW173l5WS29lB2oZbNvhNP7YcxacQP0p/MnNpZX5nIQ2IwbjoOg+vgWn2VyZLXiB+GG4rFkrVgUFnd+thY3zOJxB1b1yHgUQdX4i3XY5mjDGLmkhtskk3OlNWtT/qTmVMOslx77rR+5bQtlFLrd3bFA219XVrevtnaI02LSkUZsudml0H8UhQO8CuT61AslaSSdsSnJaWYbeq+Oow78RKYHi8Dcc3zGxWLNh+48KUo7Ek/ebRHgBe152TaWonxXs7x8+burLO4Ei8l3CReLeo9Z1d0GcpZYyqu6xYGczlPLm94voZdlXKQ/V5X4hX/QmX83bzwYZdbMClcw7np8zKMglTUwer3IrzitfvLlPF3rYs1tuH5Ij1M5Sm1X3tOJtsspvULZ/iU9E11mMaWl5t/ORmra7e4UHN2vcM5NmqP3XbGrCUSMRueIC/aGouXmR8r/RHvVlcUr5izqnAL2ag9ujSKnq9gSdLhCGxyemPxEmL65fr7+zy/iZizW+6Pq/BMH0x5zjLhspgYcajT1bLbaSheS6RBojrYujIme54vooCYpM8Y87xoC9MYXM+/iWy5j5mrPc8XUQAohxhrjy8lrK/o+v3Q+T1YuFiwNe8TWR5vsVjPlvk0DUHTtX2RLpgx5wcNxSv6RH6MbOrF4kq/YNws3nZOPOo2wuMA9QocFr+3V2m5eHv5w1W0lpaLV1xQiAsOhUKWlotXXNlWBvQpFE3TevFaV7bSkyUVilrUgi1oCDuevYwb8Zrqp3o5NNMN+LHjGRYaipcQc2jmSqZnVkh2dLoRf3Y8g0lb3Iaw7Oh0A2JhgB9ZfkHd8WwoXsawV3ssk0Nq/YDprOeLKKpV3CaanaAJBHfH043l3Wv2TSxplCS4pScdhVIfMvwsxmff7v8FARfiNacvyhT+WabTQIlXCqEwQKYQ1jIijDRvnDqFC/Ga0xdLEo3exARoAPfsHoGK+oglO5qlHq0xor/LOAmkvwu4EK9Ya1YslaQSoK2POHMjE0V99PWdpLhYk8nwsz452V4Tt9VR3EYbTH6RTAK0pVEJCXarobZTKMzWHtobhMZYG7/w8FpeAOAwx3plIg6DQotNAnwepsk0LUdoSWppWeqCYtH61AxyFbdLy8s3ao9ku7VYAuohmkzTSioTmExz7xIJ71067WbdNXdnncWdeCndqD2UsbyA1VpQEo7ZCC1H+CO3bRbtAtHoMKGUPmi4Em+latWU4yAzG1ecTMOBj4PcK6tdiOOnZIQL2HxnxPxEDRqut4c5zL0WLi7ynt9M06LW3baQTKZpFXYTmGzGUzXEtrdZNLohfWNdgJe2/qZGb7Kugzj6ihB8oWK+zlBqHpUbj8ekogxiS1RC8HVQt4WruBdvrN8k3mKpJOU6DA8nbDKhzF+Qooy+ujkrxnZlrC5gfVIyoetkEHEt3nJ7efNgOxnXAbB+ARXrOyt1sRBDCF2uPe6PRCQXapeWlltiy9Qg4i0lUnAdLt7lpHJDU8lhi+9LCVVd0mvQ175ZgODr3rw5JnUtcQITIfg6DI29vYm37DpcRx0YY7i48O46UEotvi8HPq58YT2Pvro5RWCekhSPx6S2gxljFn+XsXDMAvEk3spcMJP1lR0pOjycsMk2I4sqdAZQSpchFKpOjKekrmUzcPtMXL8EFe+VFH3EMplGZuEG2H4hI5Tx5V7eNtZXtxbFRdrY6Ih0rdqJMPaKgywHPcpQxbN4058+2BWbQ4sfkFs0LWrrPuCy0JP+r766OUsIflV7rvwZyf0tZ7M20zJDNIFJqoaNMbZYe5zPX0rNRwCAsdGk1X0g+KLX/F/9+fY0IdTyOJ+ckFukAVaXjnM8DcNCrYqUeCuZSKY0yTdvT6RvYnJizBL7JSC/1le356UvGiD09Z0kYXwFgp87OTEm7S5kjk+t4THB5Qs60tXDnMBkGQ2jgKzETFygXET43q0blvOE8N+GXcD6+k6SGoUNCGGx4aEEhocTUtdkjFldOYLfiZ3Vg460eNOfPVwRfd/M8Zl0T4CBeMz2ERlmAVeFK/ZAjsdjmJSM6QJlq2v1dfEj6Qt2KU31bRB932KphMyx/EJ2eDhhWcAB4RSw/nx7mhiFXVG4mhbFbZunkFsMo+C0gP5AX9tWbkOV9JNHG+KW8cnpeVMtocZGkxgesj4uywLeWpa+cBehr27OEsY3ILgKmhbFnds3mxp6cnCUcfwZAf8yTHH05jvmcLYAIde33gfohsmbY7YJKITgi2dfbW0EOQ6sr24tEkLXISzO/BBu5vjUYjj6hOtRzkNjfYkfF9HXvlkgIL+uPZdKDuHG+GhT181mL5z+EM44wXz6s4eB2SnSVzenKKXLdpPW4/EYbt+60ZRwDaOA/ZevTedGhgZw/94kdr79q+k85+xHYQiZ+dKrLP34p0t2GxeyO29VhocTeM/+Sx0hHLq+trUShFxgfe2bBULorp1wh4cSTVtcxhi+f/3Gcn7mo/u4e3vcpnKbhKJ20LdGe4yxeYjuw2EGRYkmJbUkBgdw5/ZN23gnAT4nhO7qq1uL3ehK6KubsytrW3uVp5JlJTo5MdZUVKHKwWHGEtP98P27GBkqp0/ev3fT9DMKMt/0m3YBvrgNVfTV7XlC+G9rz/nhywFl65I5Pq23FX3GOZYQiy51eu9eX92cpZRachSqaFq0qQ2IWjLHp5adtPHRIfzsHz+4Ps7lDfz+D+ZC4bnHD3397juB77+Avrq1LJZpDw8lfLEwQDmx+tDG0tRwxkGWwa+W2unX6es7SVwW5yrFkvec/t/Y6Ih0roKI3ZqgP9KHf/75NPoj5uaGv/u3/0KxdHV9zCmZCfqmhf+Nc2PRBWIUpmvjl9V8Uj8EPBCP4d7dWzg5zTqlY44Q8C9B6JfP1rZeMPBlcL7SCiHr6ztJFAqzYJgjRuGLeqYgHo9hYjzlWydzwyjgyGZL/mcPPrAIFwBGhgfw9rjmqXV11XVullda8ujQVzenCKG7EPy8G+MppJLDvr1PsVhC5vjMkmztwD7n2ADIBvqwK2N19NXNKVA6DYZpSmGpL7OjPxLBzZtjvkwOrWIYBbx8dWjZRZv5sLxAs+OP//knk3g5Z58EuVsO0CLxApUdpHIg3pJsIrtn74RHEV9DgBcgOGUcp+JkyfJ/IMnqDAg3Qq0lHo8hlRyS7rHghJNw79+bxEfv33V8nRKvR+wWcEBrBAyUF3Vn2Qucnp7X84lbRrWTTSo51JJBJ07CvfPeOH7y0f26rxV9XgD/NPf44b/7fpNtpOUrTicB+7mIs8MwCsieXyCXN1o6wagq2EQi7ruVrcVJuJMTKTyc+XHd19pFGwjwgmnR2U5HZpqhLeGSTgm4CmMMufwl8vlLXBpF++4xLtG0KLRoFJrWjwHJBiBeyWYvcPT2xHLPI0MDjgu0Wv6yf4Bv//yd5XzQBdy2WJ+TgP2KA3uFMXbdZ7iemDUtCkop+iMRX4aXeMUujguULe5PPrrfULgA8Ps/vHDs7BlkAbc1UO0k4P5IORm9lwfiiTDGcHCYsd1id+PjVnGyurUEVcBt32VxikIA/ofSgophFPD96ze2i85GUYVacnkDG//xrbhQsyWIAu7IFqH+fHuaMr4sJmIDlSqCibGOPKK7ASc3AagfxxUplq7wx+0/4ezcbLnHRkccrx80AXdsf1tf30nCKCwT4HPxZ9WOOr1khQ2jgIOjjG1kpD/Sh589+OA60aYRTsKtpqnWSTUNlIA7npxhlwtcJR6PYWx0xNfdqW6jUcJRaiSBR//w964WZgDw+ugEO//9V4uroGlR3Ltz6/rYrYDLORuX00D3za/ouHiBaz94BQ4JLcND5dq2sLkSVdHWC9v1R/owOZHC305N1rW83716i5ffvzHnL1RwiujUEzBAvgf4MYAPTWeBF4yTpfSTB8uON9MmukK8QNWNKC4S8C+d/k9YRJzNXiBzfOZ5F3AgrmEgHsVYquxOFUtXyJ6/sxVslUahyPoCdqYb3IuuEW+Veou5KsNDiZZtwbaKci+FbCNLewZO/hWE/wJ10irdkkoOYWw02TCGHlQBd514q1RiwkuwCalV0bQoUiNDSCQG2r7J4ZZc/hLZ7LuGSUOc4yli0YUf/MzCAik3dnH8/Z2QWSvUi3KMDA2gWLqy3ejopIC7VrxANcHb3ZeYGBxAYjDeFUKu5lVcXOQbugac4ynAFu3yjcuulDFPQebrPYlqIYTg7t9MenoqOeVNjI8OYebD+9c1cLm8ge2d/7VEMTol4K4WbxWvligejyExGIemRdsSqSgWS5Vmg4brbvH1RGvHD6v+vimATxGKSXDMA9DE/0spdaz7E/GaqeYUhuuEgAMh3ipuS21E4vEYYlo/IpEINC2KWCVfQYZc/hKMMRhG4TpjzUOSj68lSvV2K90IWDbFslsEHCjx1qI/357GFV8gBHOQ8AuBck5FxEXkoipWWQjB14yR5VaEl2QF3ExuMNAdAg6seGvRv9qaA8NcM0L2G0LwNeN8pVX1c7V4FXCzwq3SaQGHQry1VCzyXKXGbBptEjMBXjCQDRC+gWh0o92LF7cC9ku4VTop4NCJV6QsZkwDfIpSzIIj6Xbl7sA+IdhjnOwCbA+c73bLtmkjAd+cGMXh0bFvwq3SKQGHXrz18DS4MBbbDUKySj0B29GscKt0QsA9Ld6w4lbAfgm3SrsFrMQbUhoJ2G/hVmmngJV4Q0xFwN9A2MholXCrtEvASrwhZ2Vt6xzAdZMMsQlfq2iHgLszm0XhC5UF6bVw+yN9eDDzd215b6fqDw58TI2CL93tlXjDDKUmgYwMD7iuyPCDVgtYiTfMcD5VexiJtD+Jv5UCVuINM5ybmgdmz5sbsyBLqwSsxBtmYjGTeHN5A3/+v1cduZVGApa5phJviEl/MnNazhv+gf/5yyt89+ptR+6nnoBlBhwq8YYetghh0M3Ot3/tOgHLDDhU4g056SeP9jgnC+L5Tgv4wcyPrZEPxhe9XEeJtwdIP3mwzDn5pXi+kwIeiGv48H1zMQwBPvcyV0+Jt0foRgE3O+BQibeH6EYBT06khDNk1u1rlXh7jG4T8K0Jc4iXALNuX6vE24N0k4DHRy2dQF2XbSnx9ijdJGBZlHh7mKALWIm3xwmygJV4FR0V8NvjrHjKvtufDUq8CgCdE/DrI3NBBQc23L5WiVdxTScEfHAkTq7nG25fq8SrMNFOAX/36q215y/nK25fr8SrsNAOARdLV/j2z/umcxx45qWvmxKvwpZWCrhaWWwZbkjJopfrKPEqHKkn4L/sH0hd06kknoP8Jv3pg12Hl9mi+jYoGuI0M3pyIoWP3r9rzQxzwGlGnGwvByVehSucBAyUO/DcvT1ul6eAYukKrw9PHGfEAdjnWnRapgmJEq/CNfUEXGV8dOj637l8wXaCUJVmu+co8So80WhaqVtqR3fJXkOJVyGFvrq1KDMnrjyfgy360ZBbiVchTXU6EwifqySROwl5n4OsgGLZa0ShHkq8Ct+oFE9OmU4GpKO8QqFQKBQKhUKhUCgUCoVCoVAoFAqFa/4fCbut2hEefs8AAAAASUVORK5CYII=","e":1},{"id":"image_1","w":85,"h":85,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFUAAABVCAYAAAA49ahaAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAEE0lEQVR4nO2d/XXaMBTF72OB0AnqThA6Qd0JygalEzQj0A3aCUo3gAnqbEAmKNmATHD7hyTqEuMvycgW73cOJzYY83zzJMuS3pNgJJDMAWT2tQAwb/jKEcDe/RWRYjjruiGxfpjkEkBuX/eBTvsEI/QWQCEix0DnHS8klyS3JI+8DluSK5JNXj8tSGYk11cUsoojyQ3JLLYeXlgxNxGFvMT0xCU5p/HMsbPhFKoFmjozZjHvypHkQ2zdKqHxzm1kgXwoGLBK8G5S0bQvtwDuvK2JywuABxHZ+J5o5vNlmqLzG9MXFDDX8JPkd98T9fZUkhsAn30NGCk7AKu+Dw+9RE1cUMcTgLyPsJ1FJblHuMfKsdNL2E51qvXQWxEUMNdasGN7trWoN1Lkq7iHad20ppWo9i5/i4I6PlinakVjnWrbob89DEqJL23asbWi2rrkgDTaoSF4gblx7esOair+G6igZe5gNKnloqg0PfOfAhqUCvck13UHVBZ/LfaNvABYiMih6sNLnvoAFbSOOwAX+wheeartAvszoEEp8bFqFLfKU9eDm5IO66o3//NU9dJevPLWc09dXc2UdFidv3HuqUfoDaoPb8o9WSdPte1SFbQfq/LO7NIHSidW5Z1T8dei78079zAwA7ToB2LpNlzxz+PYkRS521BRw5G7DQEAkoxmSlq8F5H9zPbsK2HIAFP8s6hmpMUCUFFDcxJ1EdmQlJgDRtTxT3ydDhngOetPecVbQEUdBC3+A6CiDsAMZihaCYjWqQOgooblGTCiph8Uez0OgBG1dgab0okjoJ4amj2gnhqaA6Cd1KExndR25ymqKYngZlg7UbUK8OfRbThRO4W0KJWcNHSiFnHsSIrCbcwAwE6u2sWyJgGeyxEr5cdUrQL6synvlOdSafBEf96VgypOnmqrAPXW7uzOo1R0ero/9dPTreK/rmjQ1Hmsik7RkB8/2oX8qLe2ptJLAQ2j9OH9pWjqyuEU2xJYD2nRxPlRF57eFO9fAPgQ2qKJ8wwT7Huxc79p4G8FEzGs/KMxX1WtqPamNc4Eg3H41iZNc6u8VDZV21dfiybOTkSWzYd1SPZFcovbzVTRKelXF1HnMH2Gt5TsC+iRRa1TWrobFLZVdp9zOk37sf+tHLcxUOg8tPP4Xd+slHOYbsJU27C9M1ICPSeoichRRHKk2Uewg4eggOesPxFZAfiCdB4QvonIchQrWZBckNwPlYX7Chw41shHxl95og/fOfZ8/zQrUUwhPX1BclqBeSRza/jYKDjWot4WGnHHsIbKllMX8xyaVSseeN0b2oGmns+uea1RFvmyF1le5CvksM0j/i3yFWU2Y7SV08rQ3DAymIhutxRdBhvrWcEzzBiaW5LuALMknU4JTZW/U1qiUwiP8oYAAAAASUVORK5CYII=","e":1},{"id":"image_2","w":186,"h":242,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAADyCAYAAAD6Bd/wAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAPn0lEQVR4nO3dXVobR74G8LeqW60vGgkZFA/J2OZ54rkNZwXxDiY7GGYHnrOBISs4mbMCZwPnOCsYZwf2re05Mk6GsYUQSE2jr+6ucyGaMCBA6KtK1Pu7sUBSV7n00vp3qVoNEBERERGRScSiGqrVjp7ETrytlNoWSjw7a/3bRbVP2u1B4QMEPiioD0jw6unWxqtFNT7XoL+t1bellDtKiGdCqW/m2RYtrZ8g8NKJnZdbW2vH82pkLkF//7GxoyCeXw53PptBLuci4zpwHYms50LKhb2pkEa9foQkUegPYvT6ETq9AaIoufiQAMD/OImzu7W19mHW7c80Ze8/NnagsAvgcfo7v5hFseAhn80w1PRvoihB2OmjHfbQ70cX7/px1oGfSfLe1urbwnFepHtw15Xwi1mU/TzDTWPpdAcIwh6CsHf+OwX1vZu4P8yipJk6he/2DnYFxF8BQEqBkp9jwGliUZSgfniCTm8AAFBCvFFxvPOHrerrabY7cRprtaNyLOKX6cxJMe+h+mCFAaeZCDt91A9PkCRq+AuBP3/9aP3FpNubKJUXSxUpBdbXivCL2Un7QDRSkijUD08Qdvrpr378+vH6ziTbunPQz6YMfwaw6roSD9d9ZD13kraJxtJsneKo1Ul/nCjsdwr6xZB7nosvq6ssVWghgrCH+uFJ+uOdwy7HfWCtdlQWjvMCDDlp4BezqD5YSX/807u9g927PH/soMcifimU+sZ1JUNOWlwMu4D46/uPje/Gfe5YQX+3d7ALgW+lFHi47jPkpI1fzP428aHwY6129GSc590a9Le1+nY6T76+VuSBJ2lXfbACb5jD1VjEL8Z5zq1BP6vLUcx7nEIkY1QrxeENgW/HKWFuDPr7j42ddK78woEAkXZZz8VaKT/8QeG/b3v8zXv04QItlPwc63IyTqVUgOtKAPj9P/YOn9/02GuD/v5jYwfAY9eVqJQKs+0h0Yyk2VRQ/3nT464NuoJ4DoB1ORnNL2bP9+pnO+eRRgb9ba2+nS65Lfv5uXSQaFYuTDdee1A6MuhSyp10A6zNyXSrxVx684+12lF51GOuK12+A4BiwZtDt4hmy3VlOq+O2IlH7tWvBP3sk6bHwHDunGgZrP5Wvjwbdf+VoMdOvA0MT2QmWhZexklvPht1/5WgK6W2ASCX40f9tDzyufMd8+NRdfqVoKdfLpRxnct3ERktrdMjRNuX77t2Ht11xl7BS2QERwxnCIUjnly+72qaz0525ipFWjZpua2UenL5vmt325w/p/uE9QlZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysYeWJotxchCLvo9SPE6QVVyWg5z0Uu62KlmINj4GmYRgW9FXRw0AwxiGLdXaE7Oj2/6G0bJT+PjUrRqK9MMSLocaLw66fjC4NFy6wVdBCEXTxc91Ey5NuYtQc9ThQ+/rOJbj/S3RWaoSRR2K+3AcCIsGs/GGXI77f9ehutoHP7A+dMa9APmicMuQU+NQLtx13agh4nCs3Wqa7maYGSROGgGWrtg7agt4IOEk4dWiMIu1qnirUFPQh7upomDZJEaZ1V0xZ0TiXap9sbaGtb+6wL2WMQJdraZtBpYXTOvDDotDCFnL7rYmkLOr9/3T6OxquoaGvZ/+0iqGSJQk7f5Tw1Bj2rq2nSIOM6yGX1La3SGnSTlnHSfG1Uilrb13owulld1dk8LUgh72lfwag16IW8hy/WfZ1doDmTUuCrh1eub7v4fujuQKVUwPqa3rc1mo+M6+DxZsWIU+u0n3gBABuVFeSyGXw2YDknzUbJz+OLdd+IkAOGBB0YHpwW8h5Owi6ax6dcp76EpBTwizmU/RwKeX1TiaMYE3QAcKRAyc+fH7hw4dfykFJqnT68jbk9A4zbK9Dy0n4wSrQIDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZAUjv2Q0PrtuvM5Lai9aLptBIe8t/PvEZzXWjiNRyHnGfqOuUb3q9iI0W6doBR3dXdGm5OexUSnO/UJmp50+mq1TBGFvptvNuA5Kfg6VctGYiwAABgX9cyNAs3WquxvatYIOWkEH62tFbFRW5tLGPMd6EMVoHIVoBV1sVleN+epv7TV6nCjs7R8x5Jc0jkLs19sz3WacKNR+OVzIWA+iGHv7R8a8O2sP+udGwCtbXKMVdGYa9l8/HS/8kjn79bYRr6/WoNtej4+jFXRmUkcfNE+0Be6XT8eIE6Wl7ZS2oMeJwkHzRFfzS+VzI5jq+XGitJaGSaLQPA61tQ9oDPpJ2EWi+a98WQyieKp3vlbQ0T7Wuo/BtAV91tNa990049Vq6y8Pk0Rpfc0Z9CURTlFfm3LNVp0fAGqfdaHxTFp6mHQl7kGUaGubQb/nBgOTgq6vLwz6PZfNZnR34dy8lzXcRFvQpUHrIJbBpCExab1JxtW3X9XWctGQNRDLYpo1I6asN9H5mmsLul/M6mp6KU0zXiaMtZRC6x+ctqCX/LzWmm2ZZFxnqrCW/Lz2UrFSKmhtX+vB6Bfrvs7ml8a04+RIMbclv+PIuA4q5aK29gHNQfeLWZT8vM4uGK9SKsyk9KiUClrGWkqBrx6WtR8Ua59e3KyuMuzXKPn5mb7rLXqspRR4vFkx4vQ6/T3A8AXIuBKNI70r3Ewhz0qNedS1ixrrnOfid9WSESEHDAk6AGxUVlBezeOgGSKwdGWjlAJlP49KuTDXA/V5jnXOc1Ep6ymTbmJM0IHhQctmdRXAKk47fQyiGH2DPsKeFy/jIOtlFrr3uzzW3X6EOJ58LUouO+y/qTNpRgX9IlM+5LBBIe/d+/HWfjBKtAgMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBWO/ZHQQxRgM4nv/jbpexkHGdZA5+1eHacc6vdqcyV9UalTQ40SheRyiFXSNurT3omRcByU/h0q5OPdLocxyrC9eVMAvZlEpFYwLvTFBbwUdfGoEVl4AIDWIYjSOQjRbp9isluZ22cRm6xQHzZO5jHUQ9hCEPRTy3tnVNcz4vnQjavT9ehv79bbVIb8oSRR+/XSMz41g5tver7fxeQE7lNNOH//3yyG6vWiu7YxLe9A/NwK0go7ubhgp3fPOyn69vdCxThKFvf2mEWHXGvQg7KHZOtXZBeM1jkKcdvpTbycIe1p2KEmi8K96a+HtXqY16PN4a76P9uvtqbehc6y7/Wim70yT0Bb0VtCxcmZlEoMoRhD2Jn6+CWPdCrpa29cW9GleOBtNM14mjPUgimdSgk1KW9BDjf/pZTRNSEwIOqD3NdcWdE4l3s2kpUds0DgPosmvYzot7dOLNF+93kB3F87pPE5g0O+5TMaMTyYBzH1Zw00Y9CUhJwyJKR/BA0DW07fiRFvQTVv0Y7riFOOV0xiwi3LZjLa2tQV9XguW7qtpxqu0mp9hTyYjpdC6c9MW9JKfn/jt2DZSCqwUcxM/34Sx9os5O2t0RwpUSgVdzS+VjcrKVCHRPdZSCnyx7mtrH9B8MLpRWWGtfov0RIZpbVRWtNXqm9WS1r05YMCsy1cPy8YcLJkm57n4XbU0s+09+rKy8LHerK4acTymPeiOFHj0ZQUlX/8Bk0kqpQK2fv9gpnvCdKwXETwpBb56WDbmdTViV+pIgc3qKsp+DgczWn+9rAp5DxtrxbmVdM5ZAE87/bmMtTw7HljEea93YUTQU4W8h8d573ylW38Qo9ePjFqvMWsZ10HGlfAyDgp5b2Ef8Fwc6yDsIY6Ticc657mQUiCXzRhRpoxiVNBTw7PhzXjLu+8yrmPF7Jf2Gp1oERh0sgKDTlZg0MkKDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZIVRQW8BQK8fLbgrRNNJbriIwdWgK7y+7UlEJur34+GNBK8u33c16ALHANAfxPPtFdGMDeLrM3sl6ArqNcDShZZLkihEUQIAeLq18ery/Vf36Ge7/R736LREOr0BAEAJ8WbU/VeCnv419PvR+V8Ikek63WHQhVKvRt0/enpR4WcACC2+3ictl/OsiqsHosA1QRdCvASAdtibU7eIZqf3W/XR/vrR+stRjxkZdJnIFwDLF1oOraCb3vzf6x4zMuhbW2vHAH4EgGbrdOYdI5qVJFEIziqPJEl+uO5x1y4BUIl6AQBB2ONenYx1HHSGNxR+/sNW9fV1j7s26E+3Nl6lB6Xcq5OJoijBUWsYdKXU7k2PvXFRV/rkIOydT98QmaJxFA5vKPw86kOii24M+tmT/wYA9eYJ17+QMcJO/3xKMVHJ89sef+syXSdxdgG0oyj57S+ISKMoSlA/PAEAKKjvb6rNU2KcDb+rHTwTUvwdAKoPVuAXs1N1lGhSSaLwz3ob/X4EJcSbp48ebI/zvLFOvHi6tfFKQX0PAPXDE9brpE3jKER/uOCw7cbyu3GfN9YePfV+r/ECwJ+kFNisriLruXfrJdEU6ocnF+fM/2OckiV1p6ADwPsPjVcQ+FZKgfW1IssYmrskUWgchechh8Cfv360/uIu27jzOaOOcr4D8FOSKNQPTy5+/Eo0c2lNPk3Ih0+bUFrGAEAx76H6YAVSTrw5oivCTh/1w/Np7bZK1B9vmy+/zlTJ/Mfe4XMF9V8AwFKGZuVyqaKEeKPieOcuNfllU++C39bq28JxXgilvgGAfDaDtVIe+Vxm2k2TZZJE4TjooBV0L344+TcncXbPFhpObGa1xru9g10B8RcAq8Aw8P5Klnt4ulUUJWiH3X8LuBLiDeLk+aSlymUzLaprtaNyLOMfcFa7A8OSppj3UCx4yGczrOMJwPBkiW4vQjvspfPiqT0I7E5ywHmTuaSuVjsqRzJ6LiB2ADy+eJ/nucg4Ep7nABju+el+i+IEgyhGkij0+zF6g2jUuqmfIPDiujOEpjX33evbWn1bSrmjhHiW1vFEGH4j3CsIvHRi5+W0NfhtFl5HvKsdPJNSbidIygLiCRSeLLoPtHhKDM/OF0K8dmLn9dbW2ge9PSIiIiIiIp3+H/yNcCHjpRNmAAAAAElFTkSuQmCC","e":1},{"id":"image_3","w":216,"h":260,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAAEECAYAAABKq/oNAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAeX0lEQVR4nO2dX3Ybx5XGv6puNEAIAkGR4vAokQnO2H41ZwXiDuysIM4GJjnZQJIV2LOCaHZg74DeAfwqKQFgOxoOBRIgBDXxp7tqHtAFNWmA+NdV1Q3c3zl+oAii22R/qFu37ncvQBAEQRAEQRAEQZiC2b4BItu8ql+ecodXpZSnDKwKieq010kmzzl4RwhRc+HWTk72OkZv1BIkMGIh6vV2JUBwCo6ziZAYXqz6fpKxH5mU50KIl5+fHNaSu9N0QQIjfsXr+rsz5rAqJE4hcQqGUwC7017LOYOXc+DlHHDGUMi7v3pNEAoEgUAQCgxHIYaj8P5LmgzsWy74y01b2UhgW0y93q6GTngahXenkrEqk/KLWa8v5F24DofrcBTy7lhUfPlHSAgJvz9CfxDA748ghFTf6krIb1zhfrspQiOBbQEqvOOcn0rI03nhnevwyarkec7kax0osXW6fQShUP/cBcMfP/3k4KWWixqEBLZhqPBOSlllkp0tGt4pEU0L8UzR84d3hSbxgyOdr7K8mpHAMkq93q4GCKpR0mFueBcXUiHvwnXHoV4a6XT76Lzvqy+7UsgvPzt5em7xllaGBJZy7oV31Sjp8GB457ocBc/VHt7pZDgK0Wr7HxMiDH/IYshIAksR0ZnSaSy8qwI4nvbatIV3OhBC4vrmFj1/OP6HDIqMBGaBVcK7uIjSHN7p4PrmFt3eYPxFxkRGAtPM6/q7s3vh3cykQzy8c92PmTxinABptf3xFxkSGQksIe6UDM0J7wBMzpHiKfFVzpS2iVbbn4SLQoj/zEIFCP1Fl+ReeFeVjJ1SeGeOy6sP8PsjAOg6wjlOewqfBPYAy4R3KumgwjuVDieSRQiJi1ZPZRe///T44Cvb9/QQJDD8qiL8FMAp5oR3d6odKLwzynAU4u3l+/EXDL/79JOD7+ze0Wy26qlYtiL8zh7J+5gSJ+wTO4xufnp8ULV8OzPZWIGtWhEer3Yg0osQEr/8X3dcKJzirGLmBXa/IhwLhnfrVoQT9oml7lO7imXmyUpzRThhj5/+9ybVq1gq46BpFeEhwl0GBonIOxR9NFB4t92UH+XHezGJrwC8tH0/97G6gi1r+MtSRThhhiAU+OWiCwBwhHNycrLXsHtHdzH2UR+J6SyWdHgRIgQkwCKdMzlenTalIpzQj3o2hqMQoROeIWWrmFaB1evtiuDia8HwdSjDL1R0Ny2829SKcEI/paKH65vbVIaJWp7mer1dDXn41xDh7wGARcIq5F0UPJfCOyJRYh/KZxZvYyqJ7sGUsAD8Xv1bIe+iVPRQLOQoHU5oo/GvcUli2vZhia1gr5vv/hoi/DOAx8B42S6X8rR3IoxQyLvoDwIECKoAGpZvZ8LaAqvX29XAEd+p7F8h7+LJ7g4JizCKl3PQHwQAxxmAc8u3M2Etgb2uvzsLefg9kyhzzvBkdwelopfUvRHEwqj9fFTNkxpWFtibn1pfQ+LvwPjT43D/ESUtCGuoiEkyVrV6I/dYSWBxcZWKHg72isneFUEsiRLYQ4UKNlh6ySFxEWmEczaJoF7VL1MTJi4lsNf1d2ckLiKtuO74ceYOz57A6vV2lXH2PUDiItJJwRvveKSUVbt38pGFBRay8CWAspdz8GR3R98dEcSKqBWMSXZm904+spDA/tG8+hMYXnDOcLj/iCoyiFQyOXtl06ds2mCuwOr1dkVC/g0AKo8LlIonUkusuOG4Xm9XbN6LYq5aQh5+C6BcyLsol/IGbokgVkeJLECQikTHgwKr19tVRIW7lccFE/dDEGuhBMZ5OjKJDwosqowf20zIp0VkALWFkUhHJnGmwKIY9ncArV5EdpgsBBLpXsFCJ/wKQJmayBBZQqXqH+o4ZpLZIeLYfk2JDSJTuA6fHCNFOQSrPLQH+xIAijs5Q7dCEMmgEh2hE1oPE6cK7HX93RmASQdcgsgSE+uKlOkUWOQKpdWLyCRpMl9OFZi6MbL9E1kkTebLqQJTN0bhIZFFVNY7DebL6StYrIENQWQRtTiofIK1+7B5cSL7jIIQg2GIwTDAYBggFOMuswXPRd5zsFPIIeea32q4LkcQCjCHVY1fPH4fNi9OZAchJPqRiAbDAKNA4HY8jHwq8e+Vih72K0XkPXOPW8Eb90m0bb4kgRG/wu+PEAQhRoGA3x9hMAzGM7hWpOcP0fOH2K8UsV8x44T3PNUEx675kgS2xdwP70aBwGAYaLveVcfHKAhxdPBY2zUUkwQds1uTSALbAuLhXRAI9IfBg+GdTrq9AXKuo30lix0x7dbr7crJyV5H6wVnQALbMOKrUTzUSxNXHR+loqd9T6bmhkXmy3OtF5vBrP/DJoDj4Sikw+aUMoqEcxvtkXSHd0lzef0Bz492tV5DCSwyX55rvdgMpgtMogGG4yAUJDDLpCm8S5Lb/gijINSawo+ZL63tw6YKTDJ5zsBeDIchigWqRzRFfCVKa3iXJD1/iL2yvhaAhbwLvAcg7XWZmiowxlgDEuhnKOTIEvHwLp7J2zZu+yOtAkuD+XL6ChbKBuMMwQZ/eppCnSOp8G7dM6VNItT8e1DmSyEk6vV21cbky6kC++zk6fmbZgtBSAJblG0L77KCGswXmS8bpq8/M08qGfuRSflFfxBQ0W8MlXRQ4d28kiHCLkpgkfnyO9PXn6kcJmUDwBfDUbi1AlMr0WAYUningYKB2sTJ3DBL5svZKxhkjYF9uQ1hYjy8ix/UEnrJe/qPgGKexnQJjDFWgwSGo9Dk/Whl2YpwQh+cM5SK+juWxaKvY+0Xm8JMgTmhUwt5mFmBJV0RTiTLXnnH2JQe1xl7w17X3519dvL03MhF1bVnfePkZK/xptmCEBJBKFLbPsB0RTixPjmXaz3/uo+Xc6yZLx/eZUr8AIYXQZAOgakUOIV32YVzhmeHZaMz5rycA78/stJO+2GBMTQAvLCdqu/2+pGXiBIPWYZzhudHu0adzcBH86UNgT24LDGwGgBrB86jIETzbQcXrR6JK+PsFHI4flYxLi7ArvnyQYEJIWqAnUziYBig+bZD+6mMUyp6+O3RLp4f7VppfgP82nxp8toPfpy4cGshzGcShZD4+eKGsn4ZIudyuK6DYiGHnMuR91wrq9UsCvlxExzT5ssHfwMnJ3udN83WDYBdk+bLf112SVwpZqeQQ8Fz4UZCKniu0aTFKkzCxHFb+HNj1537CokaGF6YMl/6/RFlB1NC3nPvrEZ5z7EW5q1LrF991eh1573AtPmy073Vfg3iLpwz5D13Et6pUG+TsGW+nCsw0+bLnj80cp1tZefeHikL4V0STKIvw+bLuQIToahxzo2YL30KDRPjbmiX7fAuCThnE/Plq/rl6ecnhzUT150rsM9PDmvKfCmE3IpPuyyhwjvVC34Tw7ukUN4w7vAqgHQIDPhovtxmb1gaUOFdznUmmTz6wFscG+bLhdRC5kuz3A/v1NfEetgwXy62ghkyXzpb9mkcD+/UmRKFd/qwYb5c7GNR4Bwcf9Fd0ZGPQp5NPGSOJxrioR5hDhvmy4UE5sJthAjRH+hP1ZeKHrq9gfbr6CJ+jkThXfpQ7bRNmS8X+ssr8yUA7ebL/UoxEwKj8C6buA432q9+8Y9WQ+bLnOtgr7yDdooqOuIrEYV32UaZLyXMTL5cXGAMNRgyX+5XihPnsknSXhFOrI9p8+XCTw8Da0hII9YV5Xz9+eJGm8iyWBFOrE+sZCpdAhNC1BhnxtzNSmRXHX+tcJHCOyJObHuza6Jf/cICs2G+5Jzh6ZNHqJQLuOr46PnDmSn8bagIJ5IhZr6sQnO/+oUFFpkvrUy+zLnOZHC23x9BCInBMJgIicI7YhlMmi+X28FHky9tjpZVq1Kp6Fm5PpF9YiVTVd3XWirfLpk8B0Bzw4hMowQmmf6axKUExhhrADT5ksg2kxVMyi90X2spgYlw3MaNVjAiyyjzJQC8ql9qXcWWEphygSrzJUFkFbWKReZLbSxd8yQZ+xHYrLFGxPahhv9F5kttLC0wJqW1br8EkRSuG7Vxk+xM53WWX8EgG4C9fvUEkQSxfvVVnddZvixejA/maAUjsowp8+XSAnPhNgAYMV8ShE5UouN1/d2ZrmssLbCoOPIGoDCRWI5REMLvj+78ZzMbrcLEyHyp5xor/VTUr344ClMx+ZJIH8rPFwRiMnh+lpjynou9cgHlUsHoPZowX64msMh8aapfPZFe4nOx43Oyl32Pi1YPVx0fzw7LxkyusX716VrBTJoviXQhhMRNr4+eP0x8Cs4oEGi+7eDooGRkNVOpep3my5XiOzX5kvZg28VVx8c/f7nGu+sPWkdMXbR66Pb62t5fcd98qeMaKwlMtbuiFWw7EEKi+baDq45vLClxef0Bo0D/86XS9ZH5MnHWyVA0AUrXbzpqnK/pBkRCSFx1fO3Xmfgax+bLxFldYHJstaYwcbP512XX2iD6bm+gfRWLTb7Usg9bWWBkvtx8ur2+9XG+ugcyxsyXVR3vv3I+lDFWMzn5clsRQk7OkdSZUpycy1Es5LRk3UyEaPPo+UPslXe0vb9u8+XKAhOhaHDOKdGRIPFzJL8/QhCEc8+UbjEOpS6vP2CvvIP9SjGxe1n2PEsHupMqnDO4DkcQCi2TL1cWmJp8KYSkyZdLMoqEcxtVO6iD2nVQSYGeP8Szw8dr935My6xsE/s/1x0LjDv8FAlPvlzryJwmX87nfsmQ7j3NYBig+baD42eVtURmIkW+CCY+uAueqyZfVpN+77VUEZkvSWC4WzK0aHinCyEk3l6+x/Oj3ZUf0DSEhwCMlE3pNF+ut4JBNhjYVu3D4uHdKAgxGIbW0tgPMRgGaHdvE9uT2aJgQGCxfvXVpN97vbuPJl9u6lnYMhXhaeSq42OvvLPSKpZzOdIwQOqRgQazsSa6x/V6u3JystdJ6r3XEpjqV5/1ao4kKsLTyk2vv1Kaexya2R2EqI4gTKAmXwYIEh3Mt5bAon71NwB2dU++TAJ1pqTCOxXqbTKrniOVih7eXX/QcEeL82/RPAIT6Jp8uX6Am1LzpUo0DIZhJsO7pFj1A0QNa7f1AbRX3jHqNdRlvlxfYCkxXyqfUrc3SGXSIYvsV4r45eLG+HXLpTyePnlk9Jq6zJfJCEzata70/CEuWu+3coXSSbGQMz4ve6+8Y1xcwB3z5Ysk33ftmE6G4z6JtgR20XqPt5ddEpcmnj55hHIpr/06paKH42cVK+ICxnswlW1N0ny59gr22cnT8zfNlhXbykXrPbo9u5mutJPEQa0afpjU71pNIy14LvKeE432tT/W18s5iU++TOoUrwnguD8IjFV09PwhiWsBktoXHx08RqmYx7vr3lJHGPlIRCppkuYZ2UpgSU6+TEoNNQDHplYxISQuWu+NXCvrJBnelYoeSsUnk4Y38exsPhrjWyzk7gyezxI6zJeJ/AYkZI2BfWlqH3bT69OeawF2ooc9acZC27wRvjrMl4kcXDHGjE5codBwPpwzHB2UbN9GplDbmyTNl4kITISiAZgTGJ1zzefoYH1P2DaiwsSk+tUnIjDlAlXmS534G17atC5q5drEEM4EE+uKw6pJvF9ytU0SPwDUK9EmO4Ucnh/tGu/xvknEJl9Wk3i/5HbADA0AL0ym6olxxflO1PSG5gSsj+epJjjJmC8TU4IyX+pO1efc9BQUm0adI43PlsYHtdQLJVliky8TSdUnt9QYMl/mXAecs41O08dFFD+oJfQTM1/uJmG+TExgJs2XpaK3Ean6+yVDrutQmJcCkjRfJiawuPlyOArjnwSJUy4VMieweJnQTiFH4V2KUQJLwnyZbDYiMl8GodAqsGIhZ9UM+BD3w7sslgxtO2ofJiHX3ocl+5c3aL78zWEZ//zl2tpeLB7euZGIKLzbDGLmy+q675W8wAyZLzlneH60i58vbrSLLEsV4cT6JGm+TFRgMpQNxs31Scx7Lp4f7eKi1UukfCrn8kmigcK77UWZL4WQqNfb1ZOTvcbK75XgfVkxXyqRtbu3aHdvF17NVKKBwjtiGsobFjrhKdYwXyb+8az61Zus6OCcYb9SxH6leMerpHCi/RKFd8SiKIFJKU8BfLfq+ySuACZlAxb71W+qV4kwS1Lmy8TrjiRkDaDRskS2Scp8mbjATJsvCUIHSZkvExeYEzokMGIjSMJ8mbjAVEpTCElhIpFpJvOb1zBf6vF+RObLYEMmlBDbyaTcb4122noENjZfZn6sEbHdKPNl6gTGwCiTSGSeJMyXWgQmhKBEB5F57psvV3kPLQJz4ZLAiI1Apesj8+XSaBFYZLO+AUhkRLaZhInjfvXL/3yC93IXQ+ZLIvvE52KryaRqwIRyNOwUctgtFYy7wGMlU9WVfj65W7mLZPKcgVmffEmkh/hc7Pjg+Yd/RmAUDNHzh3h3/QH7lSL2yjvGhLau+VKbwBhjDUjcqWontgchJHr+YDIjO6n2DlcdH91eH88Oy0a8epPoa0XzpbYmg2ryJR02bxejIMRF6z3e/HSFi1YP7e5t4r1TRoHAzxc3RmYUcM4mq+Wr+uXSiQ5tAvvs5Ok5QGdh20S310fzbcdIxy8hpLHRwWoV4w6vLvuzWtvkSsZ+BKiiYxvo9vq4aPWMNiEaBQJXHV/7dSbWFbl8lymtAovMl5Sq33B6/hAXrZ6Va7e7txgFep+vSdHvCuZLvSsYmS83njSM8+35Q63vPzkLw/IlU3onKYhxV1Rawczh90fo9vq46vi46vhod2+1zlS76vjW5wToFlis9cXxsj+rNc/pwm2ECElgGoifI8UPamfBOUOp6GG/Uky06c9Nr5/Ye62KiWyi63AEocDr+rszlcBb6Oc03hNOTvYab5qtifkyttQSCyKERP+eiFZJewsh0e0N0O0NJh241sXvj6yvXgCMZRKDUCxtvtR/UifxAxheBAEJbB7xMiE/qnbQ8fBcdXwMhgGODh6vVRGRxtkAuvByzjjUXtIbpl9gUb96mnz5kVEQYjAM76xKpge79/whLq97ODp4bPS6WWVV86X2J56BNSTkVu7DkgrvdNHtDZD3XOyVd2zfylrsGKh1jZVMpUtgQoga4/pHy9rmoYrwNHPV8a1UqSeJiUazse3N7jL96rULTE2+3JQVbJWK8DQjhMRNr7/SKpaWedmmOjkX8i76gwABgioW7FevXWDR5MsmgGPdky+TJB7eBYFItCI8bfT84UoCMxGazaNcyhubNXDPfHm+0M9ou5s4Eg2w9Aosq+FdUqz6wZFzHeQ919oKzjnD4ZOSsevFSqaqi/6MEYEp82UarCvKpzROg4eZDu+SRAi50j5sr1ywUoeoBjCa3DvG+tUvnOgwIrA0mC+FkEvPENsm+sNgJed5uVTATW9gNHxW4jI9HHGygi3Rr97ILlWE4zZutlawwTBA8207FXVzaWWdhMVvDsvGEh7lUh7//tsnViaPrmK+NPJb+fzkcFJVb/oBHwwD/Hxxs1V7qlVYJ1HAOcNvNa4oO4Uc9itFnPx2b+3qk3VZ1nxp7GNATb40OZhPCGlkSHrWSSIbmHMdPD/anVTwr/YePBo4794ZPJ8mCp671ORLYwKzMfny8tqswzarJHWOxDnD0yePUCkXcNXx0fOHU3//PBrpW4hEpAbPZwE3CoWZZGcLvV7nzcSRkDUG9qWpio5REBrpDZF1OGfYLRUSfc+c60xqHEf3jjwKnpvpqpFYv/rqIq83dxRv2HzZ6dr3KWWB/UpR6wOfi1Yn9V+WxQUsb740JjAXbgMw1wCn59PqNY9S0ct8oa8NVKJjkcmXxgQWFUfeAGZ6dFDW8GHynktWlRVRYSLnfG6q3my1poSR8zCdPSg2gb3yDo6fVTIfrtliUtEBWZ33WrMCG5svqU+iJcqlPI6fVfD0ySPbt5JpljFfGj0ON2W+LFg45U8bec+9M5kk69m7NLGM+dLok2jKfKlKWrbhDCzn8sk5UvygltDHMuZLo3+Jz06enr9ptoyk6ouFnPZ+eaZRK5EbCYlWJXssar608VHXBHCsuwlOuVTIrMDuh3c5l6euZGjb8XLOOJcwx3xpXmCR+VJ3mFgqelbNgIugSoZUeJelkqFtZ9HJl8YFZtJ8eXRQQvNtR/t1FmHn3h6Jwrtss6j50rjAGGM1U+bL8WFqyajjNh7epbUinFifRc2XxgUmQtHgnBurSSxHhaxJiyzLFeHE+nDOJv3qX9UvT5Xn8T7GBfb5yWFN9atftQ/EspRLBeQ9F5fXH1aytscTDXSmRChcdyww7vBTAOkQGGDHfJn3XDw/2p2M95nmVbpv+FNfE8Q0YubL6qzXWHl6mJQ1GDZfKpRtQuH3R5QGJ1ZiEfOlnRUMssHAUtHtl/ZNxKrESqaqs15jp/dxZL7c9H71xGYTa6J7XK+3K9NeY0Vgps2XBKELJbIAwdTzMCsCM22+JAhdzDNf2huPEZkv07API4hVmWe+tCewyHw5HJLAiOwyyYLPMF9aExgDawC0ghGbgeQsPUkOYGy+BGgPRmSbeTWJ1gT22cnTc4BWMCLbzCuZsz0DtAlQup7YXGwLjMJEYqOxKjAJSal6ItPMWxysCowxRgIjMs3EmS/xw7TvWxWYCEUDIIER2UXIh1sDWhWYcoEq8yVBZA1VKCGZPJ/2fdtJjsnSSqsYkUVUbxnGxoUT97EvMDZu2kipeiKLqOfWCZ3zad+3LjAJ2QAoVU9kj9gUn+as9tnWBUbmSyKr+LcTgc0chm5dYC5cGmlEZBK1gkkh0yuwk5O9DiLzJSU6iKwQ60rWVHW107AuMAAfJ19SmEhkhE63DwBgYN8+9Lp0CIzMl0SG6PlDtRh0ueAvH3ptugRGISKRcoSQk9VLQn4TbXFmkgqByXCcqieBEWmn2xuo1etnV7gPhodASgSmNom0ByPSTH8QoPN+vHqB4b/mrV5ASgQWQeZLIrUIIdFq++rL7z/95GBmaj5OmgRGmUQitVy0eurZbDrC+XrRn0uNwMh8SaSVVttXz2VXCPHVIqGhIjUCI/MlkUZabR89fwgAkEJ+OWvQ3ixSM/zKCZ1ayEMSGJEKhJC4vP7wMSfA8IeHKjZmkZoVTFUjCyFpH0ZYZTgKcdHqKXF1wfC7Tz85eLnKe6VGYAAm5stJnwOCMEy3N8BFqxffc71YNGM4jXQJjMyXhCX6gwBvL9/j+uZ2XMQr8YMjnONl91z3Sc0eDAAYWE1C/p5CRMIU6vA49qHeZWB/+Y/q/twqjUVIlcCEEDXG0zFalthchJDw+yN0e4P7z9r/OML50zJp+HmkSmAu3FqIcSZRCDm37zdBLEIQCgxHIYbDEH5/NO0D/H8c4fx1lu1/HVL3BL/+6arGpPzicP8RDSgnlqY/CDAchR9FFX1Y30cy9iOXeMkFf5nkinWfVK1gAMCkPAfwhX87IoERM5mIaBiiPwwQBOLh4x2JH8BQA0PNCZ3vdIoqTuoEJoR4yTn/Y6xjD7HFCCExHIXoD4I7q9IsJGM/MikbErLGGKs5oVPTEfotSupCRAB402w1ABwf7BVRKnq2b4cwxH0RzQrvIm4gUZNMnjPGGjKUjVUqLXSTuhUMGPc5kJDfdHsDEtgGEg/vlJAWCO8aDKwmhKi5cGumQrx1SeUKVq+3KyEPmwDKRwelj4OmiUxxP7wLQjGviKAJoKbCOxGKxroHvbZJpcAA4HXz3V8Z2F+8nINnh49t3w4xh4mIAoH+MFgovFNJh7SGd0mQWoHFV7Enuzsol/K2b4nA3TOleDp8JlF4JyEbEDjPUniXBKkVGAD8o3n1Jwn5DecMzw4fw3XSVTq5yajwLr5H2rbwLglSLTDg48FzIe/i6KBk+3Y2komIlgzvGFhDCFHb1PAuCVIvsHq9XQ15+COAcrmUx5PdHdu3lFkme6R71Q6ziM6UarHwrmHzTCmLpF5gAPDmp9bXkPg7ANDZ2Hzi4Z0S0dzwTqIRnSlReJcgmRAYALxptr4F8EeARBbnfni3aMkQhXdmyIzAAOBNs/USwO+B7RPZiuFdQ0LWKLyzR6YEBtwV2abuyRatCI+Ih3cNEYoahXfpIXMCA+6Gi4W8i4O9YiZT+KtWhKvwbtvOlLJIJgUGTBIf/w2gzDlD5XEhtYfR8fAuixXhxOpkVmAA8Kp+ecoc5yWT8gsA8HIOnuzuWK1d3MSKcGJ1Mi0wRVTx8TcAZWAcNpaKntYkyDZVhBOrsxECA8a1iwEP/sTA/gzgMQBwzlAs5FDcyaHguSv1+Fi3IpzCu+1mYwSmiAntawDH8e95OQdezoHr8Jlh5BLZu62pCCdWZ+MEFudV/fKUc/61ZOxM7dNWYssrwonV2WiBxanX25UAwSk4zhhYBRKnU18YCYlKhgiCIAiCIAiCIAgiW/w/zQ1m2VyA5iUAAAAASUVORK5CYII=","e":1},{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":2,"nm":"magnify","refId":"image_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":42,"s":[75]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":90,"s":[8]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":121,"s":[32]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":134,"s":[32]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":164,"s":[53]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":183,"s":[53]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":219,"s":[53]},{"t":272,"s":[0]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[333.752,339.42,0],"to":[-26,-25,0],"ti":[-4.333,25,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":42,"s":[177.752,189.42,0],"to":[4.333,-25,0],"ti":[-25.667,-23.333,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":90,"s":[359.752,189.42,0],"to":[25.667,23.333,0],"ti":[4.667,-23.333,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"t":121,"s":[331.752,329.42,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":134,"s":[331.752,329.42,0],"to":[-28.333,4.667,0],"ti":[28.333,-4.667,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"t":164,"s":[161.752,357.42,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":183,"s":[161.752,357.42,0],"to":[0,-24.333,0],"ti":[-28.667,3,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":219,"s":[161.752,211.42,0],"to":[28.667,-3,0],"ti":[-28.667,-21.333,0]},{"t":272,"s":[333.752,339.42,0]}],"ix":2},"a":{"a":0,"k":[87.194,86.29,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"glass 2","parent":1,"refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":20,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[68.687,68.686,0],"ix":2},"a":{"a":0,"k":[42.065,42.066,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":2,"nm":"glass","parent":1,"td":1,"refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[68.687,68.686,0],"ix":2},"a":{"a":0,"k":[42.065,42.066,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":0,"nm":"paper","tt":1,"refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,250,0],"ix":2},"a":{"a":0,"k":[250,250,0],"ix":1},"s":{"a":0,"k":[125,125,100],"ix":6}},"ao":0,"w":500,"h":500,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":0,"nm":"paper","refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,250,0],"ix":2},"a":{"a":0,"k":[250,250,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"w":500,"h":500,"ip":0,"op":750,"st":0,"bm":0}]},{"id":"comp_1","layers":[{"ddd":0,"ind":1,"ty":2,"nm":"paper_1","refId":"image_2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[263.625,231.897,0],"ix":2},"a":{"a":0,"k":[92.771,120.853,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"paper_2","refId":"image_3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[214.478,258.49,0],"ix":2},"a":{"a":0,"k":[107.933,130,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0}]}]'),layers:[{ddd:0,ind:1,ty:0,nm:"not_found 2",refId:"comp_0",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[250,250,0],ix:2},a:{a:0,k:[250,250,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,w:500,h:500,ip:0,op:273,st:0,bm:0}],markers:[]},Q2={key:0,class:"inline-block"},ri=Pt(e.defineComponent({name:"DCodeBadge",inheritAttrs:!1,__name:"DCodeBadge",props:{text:{default:""},variant:{default:"default"},size:{default:"sm"},icon:{},dot:{type:Boolean,default:!1},pill:{type:Boolean,default:!1},color:{},skeleton:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},class:{}},setup(t){const n=t,o=e.computed(()=>n.icon?qt[n.icon]:null),r=e.computed(()=>n.visible??!0),a=e.computed(()=>{const h={xs:"px-1.5 py-0.5 text-[10px] gap-1",sm:"px-2.5 py-0.5 text-xs gap-1.5",md:"px-3 py-1 text-sm gap-2",lg:"px-4 py-1.5 text-base gap-2.5"};return h[n.size]||h.sm}),s=e.computed(()=>{const h={xs:"w-1 h-1",sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"};return h[n.size]||h.sm}),i=e.computed(()=>{const h={xs:"w-2.5 h-2.5",sm:"w-3 h-3",md:"w-4 h-4",lg:"w-5 h-5"};return h[n.size]||h.sm}),l=e.computed(()=>{const h={default:"bg-primary text-primary-foreground border-transparent shadow hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground border-transparent hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground border-transparent shadow hover:bg-destructive/80",success:"bg-success-500 text-white border-transparent shadow-sm hover:bg-success-600",warning:"bg-warning-500 text-white border-transparent shadow-sm hover:bg-warning-600",info:"bg-blue-500 text-white border-transparent shadow-sm hover:bg-blue-600",outline:"bg-transparent border-border text-foreground",tonal:"bg-primary/10 text-primary border-transparent hover:bg-primary/20",ghost:"bg-transparent text-muted-foreground border-transparent hover:bg-accent hover:text-accent-foreground",purple:"bg-purple-600 text-white border-transparent shadow-sm hover:bg-purple-700",pink:"bg-pink-600 text-white border-transparent shadow-sm hover:bg-pink-700",dark:"bg-gray-900 text-white border-transparent shadow-sm hover:bg-gray-950",light:"bg-gray-100 text-gray-900 border-gray-200 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-100 dark:border-gray-700"};return h[n.variant]||h.default}),c=e.computed(()=>({default:"bg-primary-foreground",secondary:"bg-secondary-foreground",destructive:"bg-destructive-foreground",success:"bg-white",warning:"bg-white",info:"bg-white",outline:"bg-primary",tonal:"bg-primary",ghost:"bg-muted-foreground"})[n.variant]||"bg-current"),d=e.computed(()=>{const h={xs:"h-4 w-10",sm:"h-5 w-14",md:"h-6 w-18",lg:"h-7 w-24"};return We(h[n.size]||h.sm,"rounded animate-pulse bg-muted")}),u=e.computed(()=>We("inline-flex items-center font-semibold border transition-all duration-300 select-none focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",n.pill?"rounded-full":"rounded-md",a.value,l.value,n.class));return(h,f)=>r.value?(e.openBlock(),e.createElementBlock("div",Q2,[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(d.value)},null,2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(u.value)},[t.dot?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["rounded-full animate-pulse",s.value,c.value])},null,2)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{key:1,class:e.normalizeClass(["flex-shrink-0",i.value]),"stroke-width":"2.5"},null,8,["class"])):e.createCommentVNode("",!0),e.renderSlot(h.$slots,"default",{},()=>[e.createElementVNode("span",null,e.toDisplayString(t.text),1)],!0)],2))])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-42cc5d83"]]);var ya={exports:{}},Z2=ya.exports,cu;function eS(){return cu||(cu=1,(function(t,n){(function(o,r){t.exports=r()})(Z2,function(){Array.isArray||(Array.isArray=function(s){return Object.prototype.toString.call(s)==="[object Array]"});function o(s){for(var i=[],l=0,c=s.length;l<c;l++)i.indexOf(s[l])===-1&&i.push(s[l]);return i}var r={},a={"==":function(s,i){return s==i},"===":function(s,i){return s===i},"!=":function(s,i){return s!=i},"!==":function(s,i){return s!==i},">":function(s,i){return s>i},">=":function(s,i){return s>=i},"<":function(s,i,l){return l===void 0?s<i:s<i&&i<l},"<=":function(s,i,l){return l===void 0?s<=i:s<=i&&i<=l},"!!":function(s){return r.truthy(s)},"!":function(s){return!r.truthy(s)},"%":function(s,i){return s%i},log:function(s){return console.log(s),s},in:function(s,i){return!i||typeof i.indexOf>"u"?!1:i.indexOf(s)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(s,i,l){if(l<0){var c=String(s).substr(i);return c.substr(0,c.length+l)}return String(s).substr(i,l)},"+":function(){return Array.prototype.reduce.call(arguments,function(s,i){return parseFloat(s,10)+parseFloat(i,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(s,i){return parseFloat(s,10)*parseFloat(i,10)})},"-":function(s,i){return i===void 0?-s:s-i},"/":function(s,i){return s/i},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(s,i){return s.concat(i)},[])},var:function(s,i){var l=i===void 0?null:i,c=this;if(typeof s>"u"||s===""||s===null)return c;for(var d=String(s).split("."),u=0;u<d.length;u++)if(c==null||(c=c[d[u]],c===void 0))return l;return c},missing:function(){for(var s=[],i=Array.isArray(arguments[0])?arguments[0]:arguments,l=0;l<i.length;l++){var c=i[l],d=r.apply({var:c},this);(d===null||d==="")&&s.push(c)}return s},missing_some:function(s,i){var l=r.apply({missing:i},this);return i.length-l.length>=s?[]:l}};return r.is_logic=function(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length===1},r.truthy=function(s){return Array.isArray(s)&&s.length===0?!1:!!s},r.get_operator=function(s){return Object.keys(s)[0]},r.get_values=function(s){return s[r.get_operator(s)]},r.apply=function(s,i){if(Array.isArray(s))return s.map(function(x){return r.apply(x,i)});if(!r.is_logic(s))return s;var l=r.get_operator(s),c=s[l],d,u,h,f,m;if(Array.isArray(c)||(c=[c]),l==="if"||l=="?:"){for(d=0;d<c.length-1;d+=2)if(r.truthy(r.apply(c[d],i)))return r.apply(c[d+1],i);return c.length===d+1?r.apply(c[d],i):null}else if(l==="and"){for(d=0;d<c.length;d+=1)if(u=r.apply(c[d],i),!r.truthy(u))return u;return u}else if(l==="or"){for(d=0;d<c.length;d+=1)if(u=r.apply(c[d],i),r.truthy(u))return u;return u}else{if(l==="filter")return f=r.apply(c[0],i),h=c[1],Array.isArray(f)?f.filter(function(x){return r.truthy(r.apply(h,x))}):[];if(l==="map")return f=r.apply(c[0],i),h=c[1],Array.isArray(f)?f.map(function(x){return r.apply(h,x)}):[];if(l==="reduce")return f=r.apply(c[0],i),h=c[1],m=typeof c[2]<"u"?r.apply(c[2],i):null,Array.isArray(f)?f.reduce(function(x,p){return r.apply(h,{current:p,accumulator:x})},m):m;if(l==="all"){if(f=r.apply(c[0],i),h=c[1],!Array.isArray(f)||!f.length)return!1;for(d=0;d<f.length;d+=1)if(!r.truthy(r.apply(h,f[d])))return!1;return!0}else if(l==="none"){if(f=r.apply(c[0],i),h=c[1],!Array.isArray(f)||!f.length)return!0;for(d=0;d<f.length;d+=1)if(r.truthy(r.apply(h,f[d])))return!1;return!0}else if(l==="some"){if(f=r.apply(c[0],i),h=c[1],!Array.isArray(f)||!f.length)return!1;for(d=0;d<f.length;d+=1)if(r.truthy(r.apply(h,f[d])))return!0;return!1}}if(c=c.map(function(x){return r.apply(x,i)}),a.hasOwnProperty(l)&&typeof a[l]=="function")return a[l].apply(i,c);if(l.indexOf(".")>0){var g=String(l).split("."),b=a;for(d=0;d<g.length;d++){if(!b.hasOwnProperty(g[d]))throw new Error("Unrecognized operation "+l+" (failed at "+g.slice(0,d+1).join(".")+")");b=b[g[d]]}return b.apply(i,c)}throw new Error("Unrecognized operation "+l)},r.uses_data=function(s){var i=[];if(r.is_logic(s)){var l=r.get_operator(s),c=s[l];Array.isArray(c)||(c=[c]),l==="var"?i.push(c[0]):c.forEach(function(d){i.push.apply(i,r.uses_data(d))})}return o(i)},r.add_operation=function(s,i){a[s]=i},r.rm_operation=function(s){delete a[s]},r.rule_like=function(s,i){if(i===s||i==="@")return!0;if(i==="number")return typeof s=="number";if(i==="string")return typeof s=="string";if(i==="array")return Array.isArray(s)&&!r.is_logic(s);if(r.is_logic(i)){if(r.is_logic(s)){var l=r.get_operator(i),c=r.get_operator(s);if(l==="@"||l===c)return r.rule_like(r.get_values(s,!1),r.get_values(i,!1))}return!1}if(Array.isArray(i))if(Array.isArray(s)){if(i.length!==s.length)return!1;for(var d=0;d<i.length;d+=1)if(!r.rule_like(s[d],i[d]))return!1;return!0}else return!1;return!1},r})})(ya)),ya.exports}var tS=eS();const sn=ol(tS),nS={class:"dcode-card animate-slide-up"},oS={class:"px-4 py-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30 dark:border-primary-900/50 rounded-t-xl relative z-30"},rS={class:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4"},aS={key:0,class:"flex flex-col sm:flex-row items-start sm:items-center gap-2 flex-1 xl:max-w-[15vw] md:max-w-[20vw] max-w-[30vw]"},sS={class:"relative w-full sm:w-64"},iS={key:0,class:"relative"},lS={class:"flex flex-col h-full"},cS={key:0,class:"flex-1 overflow-y-auto py-4"},dS={class:"grid grid-cols-1 gap-4 px-1"},uS={key:0,class:"sticky bottom-0 left-0 right-0 bg-transparent border-t border-neutral-200 dark:border-neutral-700 pt-4 flex gap-2"},fS={class:"flex justify-end gap-2 w-full"},hS={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},mS={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},pS={class:"dcode-table w-full"},gS={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},bS=["onClick"],yS={key:0,class:"flex items-center justify-center w-full"},xS={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},kS={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},wS={key:0,class:"px-3 py-0.5"},CS={key:1},ES=["colspan"],BS={class:"flex flex-col items-center gap-2"},_S={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},SS={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},AS={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},VS={key:0,class:"flex items-center justify-center"},DS={key:0,class:"px-3 py-0.5 !text-center"},NS={key:0,class:"flex items-center justify-center gap-1.5"},MS={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},vS=["colspan"],PS={key:0,class:"px-4 py-3 bg-zinc-50/50 dark:bg-zinc-800/30 border-t border-neutral-200 dark:border-neutral-700 flex flex-col sm:flex-row items-center justify-between gap-4 w-full"},TS={class:"flex items-center gap-4"},OS={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},FS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},zS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},IS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},RS={class:"flex-shrink-0"},LS={class:"space-y-4"},$S={class:"text-gray-600 dark:text-gray-400"},jS={class:"grid grid-cols-1 gap-4 py-4 px-1"},WS={class:"flex items-end gap-2"},Bo=e.defineComponent({name:"DataTable",__name:"DataTable",props:{columns:{default:()=>[]},data:{default:()=>[]},perPage:{default:10},loading:{type:Boolean,default:!1},hasActions:{type:Boolean,default:!1},nested:{type:Boolean,default:!1},apiModule:{},apiAction:{default:"list"},apiMethod:{},apiUrl:{},permissionBase:{},apiParams:{default:()=>({})},configKey:{},tableConfig:{},dynamicColumns:{type:Boolean,default:!1},searchApiEndpoint:{},enableQuickSearch:{type:Boolean,default:!0},showPagination:{type:Boolean,default:!0},ignorePermissions:{type:Boolean,default:!1},userPermissions:{default:null},permissionChecker:{type:Function,default:void 0},permissions:{default:void 0},checkPermission:{type:Function,default:void 0},menuPermissions:{default:()=>[]},dummyMode:{type:Boolean,default:!1}},emits:["update:search","update:sort","update:page","create","export","action","update:selection","navigate"],setup(t,{expose:n,emit:o}){var rr,ar,li,mu,pu,gu;sn.add_operation("length",S=>S==null?0:typeof S=="string"||Array.isArray(S)?S.length:typeof S=="number"?String(S).length:typeof S=="object"?Object.keys(S).length:0),sn.add_operation("==",(S,z)=>S!==null&&typeof S=="object"&&"_isLogicValue"in S?S.id==z||S.code==z:z!==null&&typeof z=="object"&&"_isLogicValue"in z?z.id==S||z.code==S:S==z),sn.add_operation("!=",(S,z)=>S!==null&&typeof S=="object"&&"_isLogicValue"in S?!(S.id==z||S.code==z):z!==null&&typeof z=="object"&&"_isLogicValue"in z?!(z.id==S||z.code==S):S!=z);const r=t,a=o,s=e.getCurrentInstance(),{apiUrl:i}=mt(),{locale:l}=Rt.useI18n();let c={query:{},params:{},path:""};try{const S=zn.useRoute();S?c=S:(li=(ar=(rr=s==null?void 0:s.appContext)==null?void 0:rr.config)==null?void 0:ar.globalProperties)!=null&&li.$route&&(c=s.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let d={back:()=>console.warn("Router back() not available"),push:S=>{console.warn("Router push() logic called from fallback:",S),typeof S=="string"&&S.startsWith("/")&&(window.location.href=S)}};try{const S=zn.useRouter();S?d=S:(gu=(pu=(mu=s==null?void 0:s.appContext)==null?void 0:mu.config)==null?void 0:pu.globalProperties)!=null&&gu.$router&&(d=s.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const u=e.ref(""),h=e.ref(1),f=e.ref(r.perPage),m=e.ref({key:"",direction:"asc"}),g=e.ref([]),b=e.ref(!1),x=e.ref(0),p=e.ref({}),C=e.ref([]),w=e.ref(null),E=e.ref(!0),_=e.ref([]),B=e.ref([]),k=e.ref([]),y=e.ref(!1),V=e.ref(!1),D=e.ref({}),N=e.ref(null),A=e.ref(null),T=e.ref(null),P=e.ref([]),X=e.computed(()=>{if(H.value.length===0)return!1;const S=H.value.map(z=>{const re=Z.value.find(W=>W.type==="CHECKBOX"),F=(re==null?void 0:re.keyCheckbox)||"id";return z[F]}).filter(z=>z!=null);return S.length===0?!1:S.every(z=>P.value.includes(z))}),$=e.computed(()=>{if(H.value.length===0)return!1;const S=Z.value.find(W=>W.type==="CHECKBOX"),z=(S==null?void 0:S.keyCheckbox)||"id",re=H.value.map(W=>W[z]).filter(W=>W!=null),F=re.filter(W=>P.value.includes(W)).length;return F>0&&F<re.length}),G=S=>{const z=Z.value.find(W=>W.type==="CHECKBOX"),re=(z==null?void 0:z.keyCheckbox)||"id",F=S[re];return F!==void 0&&P.value.includes(F)},ne=S=>{const z=Z.value.find(W=>W.type==="CHECKBOX"),re=(z==null?void 0:z.keyCheckbox)||"id",F=H.value.map(W=>W[re]).filter(W=>W!=null);if(S){const W=new Set([...P.value,...F]);P.value=Array.from(W)}else P.value=P.value.filter(W=>!F.includes(W))},K=(S,z)=>{const re=Z.value.find(oe=>oe.type==="CHECKBOX"),F=(re==null?void 0:re.keyCheckbox)||"id",W=S[F];W!=null&&(z?P.value.includes(W)||P.value.push(W):P.value=P.value.filter(oe=>oe!==W))};e.watch(P,S=>{var re;a("update:selection",S);const z=X.value||S.length>1;(re=B.value)!=null&&re.length&&B.value.forEach(F=>{var W;(W=F.fieldActionGlobal)!=null&&W.length&&F.fieldActionGlobal.forEach(oe=>{var Fe,et;const Ve=F.endpoint||((Fe=F.propsActionGlobal)==null?void 0:Fe.endpointPropAction)||F.propsActionGlobal,Ie=(et=Ve==null?void 0:Ve.keyParam)==null?void 0:et[0];(Ie&&oe.model===Ie||!Ie&&/^(id|ids|idAuditTrail)/i.test(oe.model))&&z&&oe.model&&(D.value[oe.model]=S)})})},{deep:!0});const R=S=>Array.from({length:S}).map((z,re)=>{const F={id:re+1,no:re+1};return Z.value.forEach(W=>{W.key!=="no"&&W.key!=="action"&&W.type!=="ACTION"&&W.type!=="action"&&(W.type==="CHECKBOX"?F[W.keyCheckbox||"id"]=re+1:W.type==="BADGE"||W.type==="badge"||W.condition?F[W.key]=W.condition&&W.condition.length>0?W.condition[0].value:"Active":F[W.key]=`Data ${W.label} ${re+1}`)}),F}),j=S=>S&&typeof S=="string"&&S.trim()?S:void 0,se=e.computed(()=>{var S,z,re,F;return j((z=(S=w.value)==null?void 0:S.endpoint)==null?void 0:z.apiModule)||j((F=(re=w.value)==null?void 0:re.endpointGlobal)==null?void 0:F.apiModule)||r.apiModule}),ee=e.computed(()=>{var S,z,re,F;return j((z=(S=w.value)==null?void 0:S.endpoint)==null?void 0:z.apiAction)||j((F=(re=w.value)==null?void 0:re.endpointGlobal)==null?void 0:F.apiAction)||r.apiAction}),Y=e.computed(()=>{var S,z,re,F;return j((z=(S=w.value)==null?void 0:S.endpoint)==null?void 0:z.apiMethod)||j((F=(re=w.value)==null?void 0:re.endpointGlobal)==null?void 0:F.apiMethod)||r.apiMethod||"POST"}),le=e.computed(()=>{var S,z,re,F;return j((z=(S=w.value)==null?void 0:S.endpoint)==null?void 0:z.apiUrl)||j((F=(re=w.value)==null?void 0:re.endpointGlobal)==null?void 0:F.apiUrl)||r.apiUrl}),ge=e.computed(()=>r.permissionBase||""),Me=e.computed(()=>!k.value||k.value.length===0?[]:[...k.value].sort((S,z)=>(S.seq||0)-(z.seq||0))),ve=S=>{var oe,Ve,Ie;const z=(S==null?void 0:S.column)||((oe=S==null?void 0:S.props)==null?void 0:oe.column)||((Ve=S==null?void 0:S.propsFieldGlobal)==null?void 0:Ve.column)||((Ie=S==null?void 0:S.propsFieldCustom)==null?void 0:Ie.column);if(!z)return"col-span-1";const re=z.toLowerCase(),W={full:"col-span-1 md:col-span-2",half:"col-span-1",third:"col-span-1","two-thirds":"col-span-1 md:col-span-2",two_thirds:"col-span-1 md:col-span-2"}[re]||"col-span-1";return console.log(`[DEBUG] getColumnClass for ${S==null?void 0:S.model}: type=${z}, returned=${W}`),W},Ee=()=>{let S=null;if(r.tableConfig&&(S=r.tableConfig),S){w.value=S,S.headers&&(C.value=S.headers.map(F=>{var Ve,Ie,Oe,Fe,et,qe,tt,zt,dn,ka;if(F.key==="action"||((Ve=F.custom)==null?void 0:Ve.type)==="ACTION"||((Ie=F.custom)==null?void 0:Ie.type)==="action"){const It=((Oe=F.custom)==null?void 0:Oe.actionCustom)||((Fe=F.custom)==null?void 0:Fe.action);return It&&(_.value=It.map(Ht=>{const ht=Ht.propsActionCustom||Ht.props||{},wa=Ht.propCustomMessage||{};return{permission:Ht.permission,label:l.value==="id"?ht.labelID:ht.labelEN,tooltip:l.value==="id"?ht.tooltipID||ht.labelID:ht.tooltipEN||ht.labelEN,icon:ht.icon,variant:ht.variant||"ghost",bgColor:ht.bgColor,action:ht.actionType||ht.key,route:ht.route,path:ht.path,endpoint:ht.endpointPropAction,requiredCondition:Ht.requiredCondition||!1,propCustomCondition:Ht.propCustomCondition||[],fieldMapping:Ht.fieldMapping||ht.fieldMapping||null,openDialog:Ht.openDialog||!1,fieldActionCustom:(Ht.fieldActionCustom||[]).map(Ca=>{const ci=Ca.propsFieldCustom||Ca.propsFieldGlobal||Ca.props||{};return{...Ca,props:{...ci,endpoint:ci.endpointComponent||ci.endpoint}}}),condition:Ht.visibleRule||Ht.propCustomCondition||ht.visibleRule||ht.propCustomCondition||null,requireConfirm:Ht.requireConfirm||ht.requireConfirm||!1,confirmTitle:l.value==="id"?wa.titleID||ht.confirmTitleID||"Konfirmasi":wa.titleEN||ht.confirmTitleEN||"Confirm",confirmMessage:l.value==="id"?wa.messageID||ht.confirmMessageID||"Apakah Anda yakin?":wa.messageEN||ht.confirmMessageEN||"Are you sure?"}})),null}let W;const oe=((et=F.custom)==null?void 0:et.conditionBadge)||((qe=F.custom)==null?void 0:qe.condition);return(((tt=F.custom)==null?void 0:tt.type)==="BADGE"||((zt=F.custom)==null?void 0:zt.type)==="badge")&&oe&&(W=oe.map(It=>({value:It.value,label:l.value==="id"?It.labelID:It.labelEN,labelID:It.labelID,labelEN:It.labelEN,color:It.color||It.bgColor,variant:It.variant,logic:It.logic||It.conditionRule||null}))),{key:F.key,label:l.value==="id"?F.labelID:F.labelEN,width:F.width,align:F.align,sortable:!0,type:(dn=F.custom)==null?void 0:dn.type,condition:W,keyCheckbox:(ka=F.custom)==null?void 0:ka.keyCheckbox}}).filter(F=>F!==null));const z=S.filters||S.filter;z&&Array.isArray(z)&&(k.value=z.map(F=>({...F,props:F.propsFilters||F.props||{}})),k.value.forEach(F=>{p.value[F.model]=""}));const re=S.actionTableGlobal||S.actionGlobal||S.action;console.log("[DEBUG] loadConfig rawActions:",re),re&&Array.isArray(re)?(B.value=re.map(F=>{const W=F.propsActionGlobal||F.props||{};return{key:W.key,permission:F.permission,label:l.value==="id"?W.labelID||"Action":W.labelEN||"Action",tooltip:l.value==="id"?W.tooltipID||W.labelID:W.tooltipEN||W.labelEN,icon:W.icon,variant:W.variant||"default",bgColor:W.bgColor,textColor:W.textColor,route:W.route,path:W.path,endpoint:W.endpointPropAction||F.endpoint,fieldMapping:F.fieldMapping||W.fieldMapping||null,visibleRule:F.visibleRule||W.visibleRule||F.propCustomCondition||W.propCustomCondition||null,openDialog:F.openDialog||!1,fieldActionGlobal:(F.fieldActionGlobal||F.field||[]).map(oe=>{const Ve=oe.propsFieldGlobal||oe.props||{};return{...oe,props:{...Ve,endpoint:Ve.endpointComponent||Ve.endpoint}}})}}),console.log("[DEBUG] loadConfig headerActions set:",B.value)):console.log("[DEBUG] loadConfig no rawActions found"),S.pagination!==void 0&&(E.value=S.pagination)}};e.watch(()=>r.tableConfig,()=>{Ee()},{deep:!0,immediate:!0});const Z=e.computed(()=>r.dynamicColumns||r.configKey||r.tableConfig?C.value:r.columns||[]),O=e.computed(()=>r.hasActions||_.value.length>0),Q=e.computed(()=>r.dummyMode?!1:se.value||le.value?b.value:r.loading),ie=e.computed(()=>!!se.value||!!le.value),Ae=e.computed(()=>[]),ze=S=>{if(console.log("[DEBUG] hasAction called:",{actionCode:S,permissionChecker:!!r.permissionChecker,effectivePath:ge.value}),r.menuPermissions&&r.menuPermissions.length>0){const z=c.path,re=r.menuPermissions.find(F=>z.startsWith(F.path));if(re&&re.actions){const F=re.actions.find(W=>W.code===S.toUpperCase());return F?F.checked:!1}return!1}if(r.permissionChecker){const z=r.permissionChecker(ge.value,S);return console.log("[DEBUG] permissionChecker result:",z),z}return Ae.value.some(z=>z.code===S)},Ye=(S,z)=>{if(S.condition)try{return sn.apply(S.condition,z)}catch(Ve){return console.warn("Row action jsonLogic error:",Ve),!1}if(!S.visibilityCondition)return!0;const{field:re,operator:F,value:W}=S.visibilityCondition,oe=Le(z,re);switch(F){case"equals":return oe===W;case"notEquals":return oe!==W;case"in":return Array.isArray(W)&&W.includes(oe);case"notIn":return Array.isArray(W)&&!W.includes(oe);case"greaterThan":return oe>W;case"lessThan":return oe<W;case"contains":return String(oe).includes(String(W));default:return!0}},Qe=e.computed(()=>{if(console.log("[DEBUG] visibleHeaderActions:",{headerActions:B.value,ignorePermissions:r.ignorePermissions}),B.value.length===0)return B.value;const S=B.value.filter(z=>{if(z.visibleRule)try{const F=H.value[0]||{};if(!sn.apply(z.visibleRule,F))return!1}catch(F){console.warn("Header action visibility logic error:",F)}if(r.ignorePermissions)return!0;if(!z.permission)return console.log("[DEBUG] Action no permission, showing:",z.label),!0;if(r.checkPermission){const F=r.checkPermission(z.permission);return console.log("[DEBUG] Parent checkPermission result:",F),F}if(r.permissions){const F=r.permissions.includes(z.permission);return console.log("[DEBUG] Parent permissions check result:",F),F}const re=ze(z.permission);return console.log("[DEBUG] Internal permission check:",{label:z.label,permission:z.permission,hasPerm:re}),re});return console.log("[DEBUG] Filtered header actions:",S.length),S}),at=e.computed(()=>_.value.length===0?_.value:_.value.filter(S=>r.ignorePermissions||!S.permission?!0:r.checkPermission?r.checkPermission(S.permission):r.permissions?r.permissions.includes(S.permission):ze(S.permission))),je=S=>at.value.filter(z=>Ye(z,S)),bt=(S,z)=>{var W,oe;if(S.requiredCondition&&((W=S.propCustomCondition)==null?void 0:W.length)>0){const Ve=Le(z,"status"),Ie=S.propCustomCondition.find(Oe=>Oe.value===Ve);if(Ie)return Ie.bgColor||S.bgColor||"primary"}if(!S.dynamicColor||!S.colorCondition)return S.bgColor||"primary";const re=Le(z,S.colorCondition.field),F=(oe=S.colorCondition.conditions)==null?void 0:oe.find(Ve=>Ve.value===re);return(F==null?void 0:F.bgColor)||S.bgColor||"primary"},Ct=S=>{const z=(S||"left").toLowerCase();return z==="center"?"justify-center":z==="right"?"justify-end":"justify-start"},yt={ToggleLeft:ue.ToggleLeft,SquarePen:ue.SquarePen,Trash2:ue.Trash2,Eye:ue.Eye,CheckCircle:ue.CheckCircle,Plus:ue.Plus,Download:ue.Download,RefreshCw:ue.RefreshCw,Search:ue.Search,SlidersHorizontal:ue.SlidersHorizontal},Vt=S=>S?qt[S]?qt[S]:yt[S]||null:null,H=e.computed(()=>r.dummyMode?Z.value.length>0?R(10):[]:ie.value?g.value.map((S,z)=>({...S,no:(h.value-1)*f.value+z+1})):be.value),he=e.computed(()=>r.dummyMode?10:ie.value?x.value:ae.value.length),ye=e.computed(()=>he.value===0?0:(h.value-1)*f.value+1),He=e.computed(()=>{const S=h.value*f.value;return S>he.value?he.value:S}),Le=(S,z)=>{if(!(!S||!z))return z in S?S[z]:z.split(".").reduce((re,F)=>re&&re[F],S)},ae=e.computed(()=>{if(ie.value)return[];if(!u.value)return r.data;const S=u.value.toLowerCase();return r.data.filter(z=>Z.value.some(re=>{const F=Le(z,re.key);return F==null?!1:String(F).toLowerCase().includes(S)}))}),fe=e.computed(()=>ie.value?[]:m.value.key?[...ae.value].sort((z,re)=>{const F=Le(z,m.value.key),W=Le(re,m.value.key);if(F===W)return 0;let oe=0;return typeof F=="number"&&typeof W=="number"?oe=F-W:oe=String(F).localeCompare(String(W)),m.value.direction==="asc"?oe:-oe}):ae.value),be=e.computed(()=>{if(ie.value)return[];const S=(h.value-1)*f.value,z=S+f.value;return fe.value.slice(S,z).map((re,F)=>({...re,no:S+F+1}))}),Te=e.computed(()=>ie.value?Object.values(p.value).some(S=>!!S):!!u.value),lt=[10,25,50,100],Ut=()=>{ie.value&&(p.value={...p.value,keyword:u.value},h.value=1,L())};let M;const I=()=>{r.enableQuickSearch&&(clearTimeout(M),M=setTimeout(()=>{Ut()},500))};let U;const v=()=>{clearTimeout(U),U=setTimeout(()=>{ie.value&&L()},1e3)};e.watch(u,()=>{r.enableQuickSearch&&ie.value&&I()});const L=async()=>{if(!r.dummyMode&&ie.value&&!(!se.value&&!le.value))try{b.value=!0;const S={page:h.value,perPage:f.value,...p.value,...r.apiParams};u.value&&(S.keyword=u.value),Object.keys(S).forEach(re=>{(S[re]===""||S[re]===null||S[re]===void 0)&&delete S[re]});let z;se.value?z=await i(se.value,ee.value,S):le.value&&(z=await i(le.value,Y.value,S)),J(z)}catch(S){console.error("DataTable fetch error",S),b.value=!1}},J=S=>{console.log("DataTable handleResponseData:",S),S&&(r.dynamicColumns&&S.columns&&Array.isArray(S.columns)&&(C.value=S.columns.map(z=>({key:z.key||z.field||z.name,label:z.label||z.header||z.name,width:z.width,align:z.align||"LEFT",sortable:z.sortable!==!1,type:z.type,condition:z.condition,format:z.format}))),S.data&&Array.isArray(S.data)?(g.value=S.data,S.totalData?x.value=S.totalData:S.maxPage?x.value=S.maxPage*f.value:x.value=S.data.length*(S.maxPage||1)):Array.isArray(S)?(g.value=S,x.value=S.length):S.users?(g.value=S.users,x.value=S.users.length):S.items&&Array.isArray(S.items)?(g.value=S.items,x.value=S.total||S.totalItems||S.items.length):S.list&&Array.isArray(S.list)?(g.value=S.list,x.value=S.total||S.list.length):S.rows&&Array.isArray(S.rows)?(g.value=S.rows,x.value=S.count||S.total||S.rows.length):S.result&&Array.isArray(S.result)?(g.value=S.result,x.value=S.total||S.count||S.result.length):(console.warn("DataTable: Unknown response format",S),g.value=[],x.value=0)),b.value=!1};e.onUnmounted(()=>{clearTimeout(M),clearTimeout(U)});const te=()=>{Object.keys(p.value).forEach(S=>{p.value[S]=""}),u.value="",h.value=1,L()},q=()=>{h.value=1,L()},ce=(S,z)=>{const re=Le(S,z.key);let F={variant:"secondary",class:"",label:re};if(z.condition){const W=z.condition.find(oe=>{if(oe.logic||typeof oe.value=="object"&&oe.value!==null)try{const Ie=oe.logic||oe.value;return sn.apply(Ie,S)}catch(Ie){return console.warn("Badge logic error:",Ie),!1}const Ve=(Ie,Oe)=>Ie==null||Oe===void 0||Oe===null?!1:typeof Ie=="string"&&typeof Oe=="string"?Ie.toLowerCase().trim()===Oe.toLowerCase().trim():Ie==Oe;if(Ve(oe.value,re)||typeof re=="object"&&re!==null&&(Ve(oe.value,re.code)||Ve(oe.value,re.id)))return!0;if(z.key.includes(".")){const Oe=z.key.split(".").slice(0,-1).join("."),Fe=Le(S,Oe);if(Fe&&typeof Fe=="object"&&(Ve(oe.value,Fe.code)||Ve(oe.value,Fe.id)))return!0}return!1});if(W){W.variant&&(F.variant=W.variant);const Ve=(l.value||"en")==="id"?W.labelID:W.labelEN;if(F.label=Ve||W.label||(typeof re=="object"?re.name||re.code:re),W.color||W.bgColor){const Ie=(W.color||W.bgColor||"").toLowerCase(),Oe=F.variant==="outline",Fe={success:"bg-green-500 hover:bg-green-600 border-transparent text-white shadow",warning:"bg-yellow-500 hover:bg-yellow-600 border-transparent text-white shadow",info:"bg-blue-500 hover:bg-blue-600 border-transparent text-white shadow",primary:"bg-primary-600 hover:bg-primary-700 border-transparent text-white shadow",secondary:"bg-neutral-500 hover:bg-neutral-600 border-transparent text-white shadow",danger:"bg-red-500 hover:bg-red-600 border-transparent text-white shadow",destructive:"bg-red-500 hover:bg-red-600 border-transparent text-white shadow"},et={success:"text-green-600 border-green-600 hover:bg-green-50",warning:"text-yellow-600 border-yellow-600 hover:bg-yellow-50",info:"text-blue-600 border-blue-600 hover:bg-blue-50",danger:"text-red-600 border-red-600 hover:bg-red-50",destructive:"text-red-600 border-red-600 hover:bg-red-50",primary:"text-primary-600 border-primary-600 hover:bg-primary-50",secondary:"text-neutral-600 border-neutral-600 hover:bg-zinc-50"},qe={danger:"destructive",destructive:"destructive",secondary:"secondary",primary:"default",success:"success",warning:"warning",info:"info"};Oe?et[Ie]&&(F.class=et[Ie]):qe[Ie]?F.variant=qe[Ie]:Fe[Ie]&&(F.class=Fe[Ie])}}else F.label=typeof re=="object"?(re==null?void 0:re.name)||(re==null?void 0:re.code)||"-":re}else F.label=typeof re=="object"?(re==null?void 0:re.name)||(re==null?void 0:re.code)||"-":re;return F},ke=S=>{m.value.key===S?m.value.direction=m.value.direction==="asc"?"desc":"asc":(m.value.key=S,m.value.direction="asc"),a("update:sort",m.value)},pe=S=>{S!==h.value&&(h.value=S,ie.value&&L(),a("update:page",S))},de=S=>{f.value=S,h.value=1,ie.value&&L()},we=S=>{const z=Math.random()*15+75;if(S.width){const re=parseInt(String(S.width));return re<100?`${Math.floor(re*(Math.random()*.2+.7))}px`:`${z}%`}return`${z}%`},Se=()=>{u.value="",p.value={},h.value=1,L()},Pe=S=>{var z;if(console.log("[DEBUG] handleHeaderAction called:",S),S.route){if(S.path){const re=S.route.startsWith("/")?S.route:"/"+S.route;sessionStorage.setItem(`layout_${re}`,S.path)}d==null||d.push(S.route)}else if(S.openDialog){A.value=S,T.value=null,D.value={};const re=S.fieldActionGlobal||S.field||[];re.length&&re.forEach(F=>{var Ve;const W=S.endpoint||((Ve=S.propsActionGlobal)==null?void 0:Ve.endpointPropAction)||S.propsActionGlobal,oe=W!=null&&W.keyParam&&W.keyParam.length>0?W.keyParam[0]:null;oe&&F.model===oe||!oe&&/^(id|ids|idAuditTrail)/i.test(F.model)?D.value[F.model]=P.value:D.value[F.model]||(D.value[F.model]="")}),V.value=!0}else a("action",{action:((z=S.propsActionCustom)==null?void 0:z.key)||S.key||"create",row:null,selection:P.value})},me=async(S,z)=>{var re,F,W,oe;if(S.requireConfirm){N.value={button:S,row:z},y.value=!0;return}if(S.openDialog){A.value=S,T.value=z,D.value={};const Ve=Z.value.find(Fe=>Fe.type==="CHECKBOX"),Ie=(Ve==null?void 0:Ve.keyCheckbox)||"id";S.fieldActionCustom&&S.fieldActionCustom.forEach(Fe=>{/^(id|ids|idAuditTrail)/i.test(Fe.model)?D.value[Fe.model]=[z[Ie]]:S.action==="showToken"&&Fe.model==="token"?D.value[Fe.model]=z.token!==void 0?z.token:"":z[Fe.model]!==void 0?D.value[Fe.model]=z[Fe.model]:D.value[Fe.model]=""});const Oe=S.endpoint||((re=S.propsActionGlobal)==null?void 0:re.endpointPropAction)||((F=S.propsActionCustom)==null?void 0:F.endpointPropAction)||((W=S.props)==null?void 0:W.endpointPropAction);if(((oe=Oe==null?void 0:Oe.apiMethod)==null?void 0:oe.toUpperCase())==="GET"&&Oe.apiUrl){b.value=!0;const{apiUrl:Fe}=mt(),et={};Oe.keyParam&&Array.isArray(Oe.keyParam)&&Oe.keyParam.forEach((qe,tt)=>{const zt=Oe.model&&tt===0?Oe.model:qe;z[qe]!==void 0&&(et[zt]=z[qe])}),Object.keys(et).length===0&&z.id&&(et.id=z.id),Fe(Oe.apiUrl,"GET",et).then(qe=>{let tt=qe;if(qe&&qe.data!==void 0?tt=qe.data:qe&&qe.result!==void 0&&(tt=qe.result),tt!=null){if(typeof tt=="string")D.value.hasOwnProperty("token")&&(D.value.token=tt);else if(typeof tt=="object"&&(tt.item&&(tt=tt.item),Array.isArray(tt)&&(tt=tt[0]||{}),Object.keys(tt).forEach(zt=>{D.value[zt]=tt[zt]}),!D.value.token)){const zt=Object.keys(tt).find(dn=>dn.toLowerCase().includes("token"));if(zt)D.value.token=tt[zt];else{const dn=Object.values(tt).filter(ka=>typeof ka=="string");dn.length===1&&(D.value.token=dn[0])}}}V.value=!0}).catch(qe=>{console.error("Fetch Data Failed",qe)}).finally(()=>{b.value=!1});return}V.value=!0;return}Ke(S,z)},Ke=(S,z)=>{if(S.route){if(S.path){const W=S.route.startsWith("/")?S.route:"/"+S.route;sessionStorage.setItem(`layout_${W}`,S.path)}let re=S.route;re.includes(":")?re=re.replaceAll(/:([a-zA-Z0-9_]+)/g,(W,oe)=>z[oe]||z.id||oe):z.id&&(re=`${re.replace(/\/$/,"")}/${z.id}`);const F={};S.path&&(F.code=S.path),d==null||d.push({path:re,query:F})}else if(S.endpoint&&S.endpoint.apiUrl){b.value=!0;const{apiUrl:re}=mt(),F=S.endpoint.apiUrl,W=S.endpoint.apiMethod||"POST",oe={},Ve=S.fieldMapping;if(Ve&&typeof Ve=="object"){const{locale:Ie}=Rt.useI18n(),Oe=Ie.value||"en",Fe=[];if(Object.entries(Ve).forEach(([et,qe])=>{if(typeof qe=="string"){const tt=Le(z,et);tt!==void 0?oe[qe]=tt:(console.warn(`[MAPPING-DEBUG] No matching source found for '${et}'`),Fe.push(et))}}),Fe.length>0){const et=Oe==="id"?"Masalah Sinkronisasi Data":"Data Synchronization Issue",qe=Oe==="id"?`Terdapat ketidaksesuaian skema pada field: ${Fe.join(", ")}. Harap hubungi tim pengembang.`:`Schema mismatch detected in fields: ${Fe.join(", ")}. Please contact the development team.`;Xe.warning(`${et}: ${qe}`,{autoClose:5e3,position:"top-right"})}}Object.keys(oe).length===0&&z.id&&(oe.id=z.id),re(F,W,oe).then(()=>{L(),a("action",{action:S.action||"success",row:z})}).catch(Ie=>{console.error("Action Failed",Ie)}).finally(()=>{b.value=!1})}else a("action",{action:S.action,row:z})},Ze=()=>{N.value&&(Ke(N.value.button,N.value.row),Ft())},De=()=>{var S,z,re;if(A.value){const F=A.value,W=F.endpoint||((S=F.propsActionGlobal)==null?void 0:S.endpointPropAction)||F.propsActionGlobal;let oe=(W==null?void 0:W.model)||(W!=null&&W.keyParam&&W.keyParam.length>0?W.keyParam[0]:null);if(!oe){const Fe=(F.fieldActionGlobal||F.fieldActionCustom||F.field||[]).find(et=>/^(id|ids|idAuditTrail)/i.test(et.model));oe=Fe?Fe.model:"ids"}let Ve=null,Ie=!1;if(T.value){const Oe=Z.value.find(qe=>qe.type==="CHECKBOX"),Fe=(Oe==null?void 0:Oe.keyCheckbox)||"id",et=T.value[Fe];if(W!=null&&W.apiUrl){Ve={...D.value};const qe=F.fieldMapping;qe&&typeof qe=="object"&&Object.entries(qe).forEach(([tt,zt])=>{if(typeof zt=="string"){const dn=Le(T.value,tt);dn!==void 0&&(Ve[zt]=dn)}}),Ve[oe]||(Ve[oe]=[et]),Ie=!0}}else W!=null&&W.apiUrl&&(Ve={...D.value},Ve[oe]||(Ve[oe]=P.value||[]),Ie=!0);if(Ie&&Ve&&(W!=null&&W.apiUrl)){if(((z=W==null?void 0:W.apiMethod)==null?void 0:z.toUpperCase())==="GET"){V.value=!1,T.value||(P.value=[]);return}const{apiUrl:Oe}=mt(),Fe=W.apiUrl,et=W.apiMethod||"POST";Oe(Fe,et,Ve).then(()=>{V.value=!1,T.value||(P.value=[]),L(),a("action",{action:"success",row:null})}).catch(qe=>{console.error("Action Failed",qe)})}else if(T.value){const Oe=Z.value.find(tt=>tt.type==="CHECKBOX"),Fe=(Oe==null?void 0:Oe.keyCheckbox)||"id",et=T.value[Fe],qe={...D.value};qe[oe]||(qe[oe]=[et]),a("action",{action:A.value.action,row:qe}),V.value=!1}else{const Oe={...D.value};Oe[oe]||(Oe[oe]=P.value);const Fe={action:((re=A.value.propsActionGlobal)==null?void 0:re.key)||A.value.key,row:Oe,selection:P.value};a("action",Fe),V.value=!1}}},ut=S=>{const z=D.value[S];z&&V_(String(z)).then(()=>{Xe.success("Berhasil disalin!",{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(re=>{console.error("Failed to copy",re)})},Ft=()=>{y.value=!1,N.value=null},ln=e.computed(()=>N.value?N.value.button.confirmTitle||"Confirm":""),cn=e.computed(()=>N.value?N.value.button.confirmMessage||"Confirm":"");n({fetchData:L,filters:p,resetFilters:te,handleRefresh:Se});const ct=e.ref(""),to=S=>{if(!S)return"";const z=S.endpoint||S.endpointGlobal||{};return JSON.stringify({url:z.apiUrl||S.apiUrl,module:z.apiModule||S.apiModule,action:z.apiAction||S.apiAction,method:z.apiMethod||S.apiMethod,params:S.apiParams,socket:z.socket||S.socketEndpoint,socketParams:S.socketParams})};return e.watch(()=>r.tableConfig,()=>{if(r.tableConfig){Ee();const S=to(r.tableConfig);S!==ct.value&&(!ct.value&&ie.value?(ct.value=S,L()):(ct.value=S,ie.value&&v()))}},{deep:!0,immediate:!0}),e.watch(()=>r.apiModule,()=>{ie.value&&L()}),e.watch(()=>r.apiParams,()=>{ie.value&&L()},{deep:!0}),e.watch(()=>B.value,S=>{console.log("[DEBUG] headerActions changed:",S.length,"items");const z=Qe.value;console.log("[DEBUG] visibleHeaderActions evaluated:",z.length,"items")},{deep:!0}),e.onMounted(()=>{Ee(),ie.value&&(r.tableConfig||(b.value=!0,L()))}),(S,z)=>{var re;return e.openBlock(),e.createElementBlock("div",nS,[e.createElementVNode("div",oS,[e.createElementVNode("div",rS,[t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",aS,[e.createElementVNode("div",sS,[e.createVNode(e.unref(ue.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),e.createVNode(e.unref(R_),{modelValue:u.value,"onUpdate:modelValue":z[0]||(z[0]=F=>u.value=F),placeholder:"Search...",style:{"padding-left":"2.25rem !important"},class:"h-9 bg-white/95 dark:bg-zinc-800/95 border-white/30 dark:border-neutral-700/50 text-neutral-900 dark:text-neutral-100 placeholder:text-neutral-500 dark:placeholder:text-neutral-400",onKeyup:e.withKeys(Ut,["enter"])},null,8,["modelValue"])]),k.value.length>0?(e.openBlock(),e.createElementBlock("div",iS,[e.createVNode(F_,null,{trigger:e.withCtx(()=>[e.createVNode(st,{variant:"secondary",icon:"SlidersHorizontal",tooltip:"Advance Search",class:"gap-2 h-9 w-full sm:w-auto justify-center bg-white/95 dark:bg-zinc-800/95 text-neutral-700 dark:text-neutral-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 border border-white/30 dark:border-neutral-700/50 shadow-sm backdrop-blur-sm text-xs font-medium"})]),footer:e.withCtx(()=>[e.createElementVNode("div",fS,[e.renderSlot(S.$slots,"filter-footer",{fetch:L,reset:te})])]),default:e.withCtx(()=>[z[8]||(z[8]=e.createElementVNode("hr",{class:"border-neutral-200 dark:border-neutral-700"},null,-1)),e.createElementVNode("div",lS,[e.renderSlot(S.$slots,"filter-form",{filters:p.value},()=>[k.value.length>0?(e.openBlock(),e.createElementBlock("div",cS,[e.createElementVNode("div",dS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Me.value,(F,W)=>(e.openBlock(),e.createElementBlock("div",{key:W,class:e.normalizeClass(ve(F))},[e.createVNode(Jd,{field:F,modelValue:p.value[F.model],"onUpdate:modelValue":oe=>p.value[F.model]=oe},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):e.createCommentVNode("",!0)]),k.value.length>0?(e.openBlock(),e.createElementBlock("div",uS,[e.createVNode(st,{variant:"outline",text:"Reset",tooltip:"Reset",rounded:"md",icon:"RefreshCw",onClick:te,disabled:Q.value},null,8,["disabled"]),e.createVNode(st,{onClick:q,disabled:Q.value,rounded:"md",text:"Search",tooltip:"Search",icon:"Search"},null,8,["disabled"])])):e.createCommentVNode("",!0)])]),_:3})])):e.createCommentVNode("",!0)])),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-2 flex-wrap",{"w-full justify-between":t.nested}])},[t.nested?(e.openBlock(),e.createElementBlock("span",hS)):e.createCommentVNode("",!0),t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(st,{key:1,variant:"secondary",icon:"RefreshCw",text:"Refresh",tooltip:"Refresh",class:"gap-2 h-9 bg-white/95 dark:bg-zinc-800/95 text-neutral-700 dark:text-neutral-300 hover:bg-white dark:hover:bg-zinc-800 border border-white/30 dark:border-neutral-700/50 shadow-sm backdrop-blur-sm text-xs font-medium",onClick:Se,disabled:Q.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(ue.RefreshCw),{class:e.normalizeClass(["w-3.5 h-3.5",{"animate-spin":Q.value}])},null,8,["class"])]),_:1},8,["disabled"])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.value,(F,W)=>(e.openBlock(),e.createBlock(st,{key:W,icon:F.icon,text:F.label,tooltip:F.tooltip,variant:F.variant,"bg-color":F.bgColor,"text-color":F.textColor,class:"gap-2 h-9 shadow-lg shadow-primary-500/20 border-none text-xs font-medium",onClick:oe=>Pe(F)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),e.renderSlot(S.$slots,"header-actions")],2)])]),e.createElementVNode("div",mS,[e.createElementVNode("table",pS,[e.createElementVNode("thead",gS,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,F=>(e.openBlock(),e.createElementBlock("th",{key:F.key,class:e.normalizeClass([F.align?`text-${F.align.toLowerCase()}`:"",F.sortable?"cursor-pointer select-none":"","px-3 py-2 text-xs font-black text-white dark:text-neutral-100 uppercase tracking-wider transition-colors duration-150"]),style:e.normalizeStyle(F.width?{width:F.width}:{}),onClick:W=>F.sortable&&ke(F.key)},[F.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",yS,[e.createVNode(Cn,{"model-value":X.value,indeterminate:$.value,"onUpdate:modelValue":z[1]||(z[1]=W=>ne(!!W)),onClick:z[2]||(z[2]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate"])])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-2 w-full",Ct(F.align)])},[e.createElementVNode("span",null,e.toDisplayString(F.label),1)],2))],14,bS))),128)),O.value?(e.openBlock(),e.createElementBlock("th",xS,[...z[9]||(z[9]=[e.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",kS,[Q.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(f.value,F=>(e.openBlock(),e.createElementBlock("tr",{key:`skeleton-${F}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,W=>{var oe,Ve;return e.openBlock(),e.createElementBlock("td",{key:W.key,class:e.normalizeClass([W.align?`text-${W.align.toLowerCase()}`:"text-left","px-3 py-0.5"])},[e.createElementVNode("div",{class:e.normalizeClass(["bg-gradient-to-r from-neutral-200 via-neutral-300 to-neutral-200 dark:from-neutral-700 dark:via-neutral-600 dark:to-neutral-700 animate-shimmer",[["badge","BADGE"].includes(W.type??"")||W.condition?"h-5 rounded-full w-20":"h-4 rounded-md",((oe=W.align)==null?void 0:oe.toLowerCase())==="center"?"mx-auto":"",((Ve=W.align)==null?void 0:Ve.toLowerCase())==="right"?"ml-auto":""]]),style:e.normalizeStyle({width:["badge","BADGE"].includes(W.type??"")||W.condition?void 0:we(W),backgroundSize:"200% 100%"})},null,6)],2)}),128)),t.hasActions?(e.openBlock(),e.createElementBlock("td",wS,[...z[10]||(z[10]=[e.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse"}),e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-75"}),e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-150"})],-1)])])):e.createCommentVNode("",!0)]))),128)):H.value.length===0?(e.openBlock(),e.createElementBlock("tr",CS,[e.createElementVNode("td",{colspan:Z.value.length+(O.value?1:0),class:"text-center py-16"},[e.createElementVNode("div",BS,[e.createVNode(e.unref(ku.Vue3Lottie),{animationData:e.unref(J2),height:200,width:200},null,8,["animationData"]),e.createElementVNode("div",null,[e.createElementVNode("p",_S,e.toDisplayString(Te.value?"No search results":"No data"),1),e.createElementVNode("p",SS,e.toDisplayString(Te.value?"Try changing keywords":"No data added"),1)])])],8,ES)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(H.value,(F,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:W},[e.createElementVNode("tr",AS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,oe=>(e.openBlock(),e.createElementBlock("td",{key:oe.key,class:e.normalizeClass([oe.align?`text-${oe.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[e.renderSlot(S.$slots,`cell-${oe.key}`,{row:F,value:Le(F,oe.key)},()=>[oe.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",VS,[e.createVNode(Cn,{"model-value":G(F),"onUpdate:modelValue":Ve=>K(F,!!Ve),onClick:z[3]||(z[3]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):oe.type==="badge"||oe.type==="BADGE"||oe.condition?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[oe.align?`justify-${oe.align.toLowerCase()}`:"justify-start"]])},[e.createVNode(ri,{variant:ce(F,oe).variant,class:e.normalizeClass([ce(F,oe).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ce(F,oe).label),1)]),_:2},1032,["variant","class"])],2)):oe.key==="no"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString((h.value-1)*f.value+W+1),1)],64)):oe.type==="date"||oe.type==="DATE"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(Le(F,oe.key)?e.unref(S_)(Le(F,oe.key),"long"):"-"),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(oe.format?oe.format(Le(F,oe.key)):Le(F,oe.key)),1)],64))])],2))),128)),O.value?(e.openBlock(),e.createElementBlock("td",DS,[e.renderSlot(S.$slots,"actions",{row:F,buttons:je(F),getButtonColor:bt,getIconComponent:Vt},()=>[je(F).length>0?(e.openBlock(),e.createElementBlock("div",NS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je(F),(oe,Ve)=>(e.openBlock(),e.createElementBlock("div",{key:Ve,class:"group relative"},[e.createVNode(st,{tooltip:oe.tooltip||oe.label,icon:oe.icon,size:"icon",rounded:oe.rounded||"sm",borderStyle:oe.borderStyle||"none",variant:oe.variant||"ghost","bg-color":bt(oe,F),onClick:Ie=>me(oe,F)},null,8,["tooltip","icon","rounded","borderStyle","variant","bg-color","onClick"])]))),128))])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),S.$slots["expanded-row"]?(e.openBlock(),e.createElementBlock("tr",MS,[e.createElementVNode("td",{colspan:Z.value.length+(O.value?1:0),class:"px-0 py-0"},[e.renderSlot(S.$slots,"expanded-row",{row:F,index:W})],8,vS)])):e.createCommentVNode("",!0)],64))),128))])])]),!Q.value&&H.value.length>0&&t.showPagination&&E.value?(e.openBlock(),e.createElementBlock("div",PS,[e.createElementVNode("div",TS,[e.createVNode(e.unref(X_),{"model-value":String(f.value),"onUpdate:modelValue":z[4]||(z[4]=F=>de(Number(F)))},{default:e.withCtx(()=>[e.createVNode(e.unref(e2),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:e.withCtx(()=>[e.createVNode(e.unref(t2),{placeholder:String(f.value)},null,8,["placeholder"])]),_:1}),e.createVNode(e.unref(K_),null,{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(lt,F=>e.createVNode(e.unref(J_),{key:F,value:String(F)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(F),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),z[15]||(z[15]=e.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),e.createElementVNode("span",OS,[z[11]||(z[11]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",FS,e.toDisplayString(ye.value),1),z[12]||(z[12]=e.createTextVNode(" to ",-1)),e.createElementVNode("span",zS,e.toDisplayString(He.value),1),z[13]||(z[13]=e.createTextVNode(" of ",-1)),e.createElementVNode("span",IS,e.toDisplayString(he.value),1),z[14]||(z[14]=e.createTextVNode(" items ",-1))])]),e.createElementVNode("div",RS,[e.createVNode(e.unref(L_),{total:he.value,"items-per-page":f.value,"sibling-count":1,"show-edges":"",page:h.value,"onUpdate:page":pe,class:"scale-90 origin-right"},{default:e.withCtx(()=>[e.createVNode(e.unref($_),{class:"flex items-center gap-1"},{default:e.withCtx(({items:F})=>[e.createVNode(e.unref(W_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:opacity-50 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(ue.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(G_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(ue.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F,(W,oe)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[W.type==="page"?(e.openBlock(),e.createBlock(e.unref(U_),{key:oe,value:W.value,"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(Yt),{class:"w-8 h-8 p-0 text-sm",variant:W.value===h.value?"default":"outline",disabled:W.value===h.value,onClick:Ve=>pe(W.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(W.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(e.openBlock(),e.createBlock(e.unref(j_),{key:W.type,index:oe},null,8,["index"]))],64))),256)),e.createVNode(e.unref(q_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(ue.ChevronRight),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(H_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(ue.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):e.createCommentVNode("",!0),e.createVNode(yo,{modelValue:y.value,"onUpdate:modelValue":z[5]||(z[5]=F=>y.value=F),title:ln.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:e.withCtx(()=>[e.createVNode(st,{variant:"outline",onClick:Ft,text:"Cancel"}),e.createVNode(st,{variant:"default",onClick:Ze,text:"Yes"})]),default:e.withCtx(()=>[e.createElementVNode("div",LS,[e.createElementVNode("p",$S,e.toDisplayString(cn.value),1)])]),_:1},8,["modelValue","title"]),e.createVNode(yo,{modelValue:V.value,"onUpdate:modelValue":z[7]||(z[7]=F=>V.value=F),title:((re=A.value)==null?void 0:re.label)||"Action",icon:"AlertCircle","max-width":450},{actions:e.withCtx(()=>[e.createVNode(st,{variant:"outline",onClick:z[6]||(z[6]=F=>V.value=!1),text:"Cancel"}),e.createVNode(st,{variant:"default",onClick:De,text:"Save"})]),default:e.withCtx(()=>{var F,W;return[e.createElementVNode("div",jS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((F=A.value)==null?void 0:F.fieldActionCustom)||((W=A.value)==null?void 0:W.fieldActionGlobal)||[],(oe,Ve)=>{var Ie,Oe,Fe;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Ve},[oe.isHidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(ve(oe))},[e.createElementVNode("div",WS,[e.createVNode(Jd,{class:"flex-1 w-full",field:oe,modelValue:D.value[oe.model],"onUpdate:modelValue":et=>D.value[oe.model]=et},null,8,["field","modelValue","onUpdate:modelValue"]),oe.isCopyable||(Ie=oe.props)!=null&&Ie.isCopyable||((Oe=A.value)==null?void 0:Oe.action)==="showToken"||((Fe=A.value)==null?void 0:Fe.action)==="copyToken"?(e.openBlock(),e.createBlock(st,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:"Salin",onClick:et=>ut(oe.model)},null,8,["onClick"])):e.createCommentVNode("",!0)])],2))],64)}),128))])]}),_:1},8,["modelValue","title"])])}}});function du(){return{setPageTitle:o=>{typeof document<"u"&&(document.title=o||document.title),typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:page-title",{detail:{title:o},bubbles:!0,composed:!0}))},setBreadcrumb:o=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:breadcrumb",{detail:{items:o},bubbles:!0,composed:!0}))}}}const US={key:0},HS=["value","name"],qS={key:2,class:"text-xs text-neutral-400 italic"},ai=e.defineComponent({__name:"DynamicFormField",props:{field:{},modelValue:{default:null},formData:{default:()=>({})},required:{type:Boolean,default:!1},options:{default:()=>[]},error:{default:null},dynamicLabels:{default:null},dynamicLength:{default:null},baseUrl:{default:void 0}},emits:["update:modelValue"],setup(t,{emit:n}){let o=e.ref("en");try{o=Rt.useI18n().locale}catch{}const r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,f=>{s.value=f});const i={DCodeTextField:so,DCodeAutoComplete:mr,DCodeDatePicker:ta,DCodeTextarea:ko,DCodeTextArea:ko,DCodeCheckbox:Cn,DCodeSwitch:sa,DCodeOtpInput:ra,DCodeImageField:oa,DCodeSlider:aa,DCodeRadio:qs,DCodeRadioCustom:Gs,DCodeDynamicUploadList:Os,DCodeMultiSelect:Hs,DCodeCurrencyField:Ts,DCodePermissionMenu:Ks,DCodeTreePermissions:Ys,DCodeCardCheckboxList:Ps,DCodeBeforeAfter:Ua,DCodeListLabels:Ha},l=e.computed(()=>{const f=r.field.component;return i[f]||null}),c=(f,m)=>{const g={label:"",placeholder:""},b=(m==null?void 0:m.labelID)||f.labelID,x=(m==null?void 0:m.labelEN)||f.labelEN;(b||x)&&(g.label=o.value==="id"?b:x);const p=(m==null?void 0:m.placeholderID)||f.placeholderID,C=(m==null?void 0:m.placeholderEN)||f.placeholderEN;return(p||C)&&(g.placeholder=o.value==="id"?p:C),g},d=(f,m)=>{var x;if(!((x=f.endpoint)!=null&&x.apiUrl))return{};const g={};let b=!0;return Array.isArray(f.endpoint.keyParam)&&f.endpoint.keyParam.length>0&&f.endpoint.keyParam.forEach(p=>{const C=m?m[p]:null;C!=null&&C!==""?g[p]=C:b=!1}),b?{endpoint:{apiUrl:f.endpoint.apiUrl,apiMethod:f.endpoint.apiMethod||"GET"},...Object.keys(g).length?{apiParams:g}:{}}:{}},u=e.computed(()=>{var x,p,C;const f=r.field.props||r.field.propsFieldGlobal||{},m={},g=c(f,r.dynamicLabels);return g.label&&(m.label=g.label),g.placeholder&&(m.placeholder=g.placeholder),m.required=r.required!==void 0?r.required:f.required??!1,["disabled","readonly","clearable","returnObject","itemTitle","itemValue","maxValue","minValue","sizeFile","typeFile","treeData","menuList","enableParentControl","showIcons","dataBefore","dataAfter"].forEach(w=>{f[w]!==void 0&&f[w]!==null&&(m[w]=f[w])}),m.minLength=((x=r.dynamicLength)==null?void 0:x.minLength)??f.minLength,m.maxLength=((p=r.dynamicLength)==null?void 0:p.maxLength)??f.maxLength,f.valueType&&(m.type=f.valueType),r.error&&(m.error=r.error),Object.assign(m,d(f,r.formData)),(C=f.endpointReference)!=null&&C.apiUrl&&(m.endpointReference=f.endpointReference),r.options&&r.options.length>0&&(m.items=r.options,m.options=r.options,r.field.component!=="DCodeDynamicUploadList"&&(delete m.endpoint,delete m.apiParams,delete m.apiUrl)),r.baseUrl&&(m.baseUrl=r.baseUrl),m}),h=f=>{s.value=f,a("update:modelValue",f)};return(f,m)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",US,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,HS)])):l.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:1},u.value,{modelValue:s.value,"onUpdate:modelValue":[m[0]||(m[0]=g=>s.value=g),h]}),null,16,["modelValue"])):(e.openBlock(),e.createElementBlock("div",qS," Unknown field: "+e.toDisplayString(t.field.component),1))}}),GS={class:"w-full space-y-6"},XS={key:0,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},KS={class:"flex items-center justify-between mb-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30"},YS={key:0,class:"px-4 py-3"},JS={class:"text-sm font-semibold text-white"},QS={class:"px-4 py-3 flex items-center gap-2"},ZS={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},eA={key:0,class:"px-4 py-2 bg-primary-700 dark:bg-primary-900 flex items-center justify-end gap-2"},tA={key:2,class:"w-full"},nA={class:"space-y-6 mt-4"},oA={key:0,class:"flex items-center justify-between border-b border-neutral-100 dark:border-neutral-800 pb-2 mb-4"},rA={key:0,class:"text-sm font-medium text-neutral-800 dark:text-neutral-200"},aA={key:1,class:"text-xs text-neutral-500"},sA={key:0,class:"flex items-center gap-2"},iA={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},lA={key:2,class:"p-4 border border-dashed border-neutral-300 rounded-lg text-xs text-neutral-400"},cA={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},dA={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},uA=e.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},baseUrl:{default:void 0}},emits:["submit","cancel","action","update:model","success","error"],setup(t,{emit:n}){sn.add_operation("length",M=>M==null?0:typeof M=="string"||Array.isArray(M)?M.length:typeof M=="number"?String(M).length:typeof M=="object"?Object.keys(M).length:0),sn.add_operation("==",(M,I)=>{const U=v=>v&&typeof v=="object"&&v._isLogicValue;return M==null&&I==null?!0:M==null||I===null||I===void 0?!1:U(M)&&U(I)?String(M.id)===String(I.id)||String(M.code)===String(I.code):U(M)?String(M.code)===String(I)||String(M.id)===String(I):U(I)?String(I.code)===String(M)||String(I.id)===String(M):String(M)===String(I)}),sn.add_operation("!=",(M,I)=>{const U=v=>v&&typeof v=="object"&&v._isLogicValue;return M==null&&I==null?!1:M==null||I===null||I===void 0?!0:U(M)&&U(I)?!(String(M.id)===String(I.id)||String(M.code)===String(I.code)):U(M)?!(String(M.code)===String(I)||String(M.id)===String(I)):U(I)?!(String(I.code)===String(M)||String(I.id)===String(M)):String(M)!==String(I)});const o=t,r=n,{t:a,locale:s}=Rt.useI18n(),i=e.computed(()=>s.value),{apiUrl:l}=mt(),c=zn.useRouter(),d=e.ref(!1),u=e.ref(null),h=e.computed(()=>o.schema||u.value),f=e.reactive({}),m=e.reactive({}),g=e.reactive({}),b=e.reactive({}),x=e.reactive({}),p=e.reactive({visible:!1,title:"",message:"",action:null}),C=M=>{var I,U,v;return((I=M.propsForm)==null?void 0:I.key)||((U=M.propsTable)==null?void 0:U.key)||((v=M.propsWizard)==null?void 0:v.key)||M.id||"unknown-section"},w=M=>{var U;return(((U=M.propsWizard)==null?void 0:U.propsSteps)||[]).filter(v=>le(v)).map((v,L)=>{var q;let J=[];if(Array.isArray(v.sectionsWizard))J=v.sectionsWizard;else if(v.sectionsWizard&&typeof v.sectionsWizard=="object"){const ce=v.sectionsWizard;J=[{type:ce.type||(ce.fields?"FORM":ce.isDataTable?"TABLE":"UNKNOWN"),...ce}]}const te=Y(v);return{key:v.key||`step-${L}`,title:te.title,description:te.description,icon:v.icon||void 0,sections:J,actions:((q=v.propsComponent)==null?void 0:q.actionComponent)||v.actionComponent||[]}})},E=M=>M?[...M].sort((I,U)=>(I.seq||0)-(U.seq||0)):[],_=(M,I)=>{var L;const U=I?N(I):A.value;return T((L=M.logic)==null?void 0:L.labelingRule,U,`LABEL-${M.model}`)||null},B=(M,I)=>{var L;const U=I?N(I):A.value;return T((L=M.logic)==null?void 0:L.lengthRule,U,`LENGTH-${M.model}`)||null},k=(M,I,U)=>{const v=M.props||M.propsFieldGlobal;if(!v)return null;const L=I==null?"":String(I);if(L==="")return null;const J=B(M,U),te=(J==null?void 0:J.minLength)??v.minLength,q=(J==null?void 0:J.maxLength)??v.maxLength;if(te&&L.length<te)return i.value==="id"?`Minimal ${te} karakter`:`Minimum ${te} characters`;if(q&&L.length>q)return i.value==="id"?`Maksimal ${q} karakter`:`Maximum ${q} characters`;if(v.regex)try{if(!new RegExp(v.regex).test(L))return v.regexMessage||(i.value==="id"?"Format tidak valid":"Invalid format")}catch{console.warn(`[DynamicForm] Invalid validation regex for field ${M.model}:`,v.regex)}return null},y=(M,I)=>{var v,L;f[M]=I;let U=null;(L=(v=h.value)==null?void 0:v.sections)==null||L.forEach(J=>{var ce,ke;const q=(((ce=J.propsForm)==null?void 0:ce.fields)||J.fields||[]).find(pe=>pe.model===M);q&&(U=q),((ke=J.type)==null?void 0:ke.toUpperCase())==="WIZARD"&&w(J).forEach(de=>{de.sections.forEach(we=>{var me;const Pe=(we.fields||((me=we.propsForm)==null?void 0:me.fields)||[]).find(Ke=>Ke.model===M);Pe&&(U=Pe)})})}),U&&(x[M]=k(U,I)),r("update:model",Z())},V=e.computed(()=>{var I;const M=new Map;return(I=h.value)!=null&&I.sections&&h.value.sections.forEach(U=>{var te,q;const v=U.propsForm||U.propsTable||U.props||{},L=C(U);(v.fields||U.fields||[]).forEach(ce=>{if(ce.model){const ke=L?`${L}.${ce.model}`:ce.model;M.set(ce.model,{field:ce,path:ke})}}),((te=U.type)==null?void 0:te.toUpperCase())==="WIZARD"&&((q=U.propsWizard)!=null&&q.propsSteps)&&U.propsWizard.propsSteps.forEach(ce=>{const ke=ce.key||ce.id;(Array.isArray(ce.sectionsWizard)?ce.sectionsWizard:[ce.sectionsWizard].filter(Boolean)).forEach(de=>{de.fields&&de.fields.forEach(we=>{if(we.model){const Se=ke?`${ke}.${we.model}`:we.model;M.set(we.model,{field:we,path:Se})}})})})}),M}),D=(M,I)=>{if(I==null||typeof I=="object"&&I._isLogicValue)return I;const U=V.value.get(M);if(!U)return I;const v=U.field,L=X[v.key];if(!L||!Array.isArray(L))return I;const te=(v.props||{}).itemValue||"id",q=L.find(ce=>String(ce[te])===String(I)||String(ce.id)===String(I)||String(ce.code)===String(I));return q&&q.code?{id:I,code:q.code,_isLogicValue:!0}:I},N=M=>{const I=(v,L)=>{if(v==null||typeof v=="boolean")return v;if(typeof v=="number"||typeof v=="string")return L?D(L,v):v;if(typeof v=="object"&&!Array.isArray(v)){if(v._isLogicValue)return v;const J=(v==null?void 0:v.code)??(v==null?void 0:v.id)??(v==null?void 0:v.value)??(v==null?void 0:v.key)??v;return L&&(typeof J=="string"||typeof J=="number")?D(L,J):J}return v};return new Proxy(M,{get(v,L){if(typeof L!="string")return v[L];if(v[L]!==void 0)return I(v[L],L);const J=V.value.get(L);if(J){const te=ve(v,J.path);if(te!==void 0)return I(te,L)}return I(v[L],L)},has(v,L){return typeof L!="string"?L in v:L in v?!0:V.value.has(L)}})},A=e.computed(()=>N(f)),T=(M,I,U)=>M?Array.isArray(M)?M.find(L=>L.condition?P(L.condition,I,U):!0)||null:M:null,P=(M,I,U="LOGIC")=>{if(M==null||typeof M=="object"&&Object.keys(M).length===0)return!0;if(typeof M=="boolean")return M;if(typeof M=="object")try{const v=sn.apply(M,I);return(U.includes("FILTER")||U.includes("SEC")||U.includes("LENGTH"))&&console.log(`[DynamicForm][${U}] Rule:`,JSON.stringify(M),"DataVar:",Object.keys(I).filter(L=>JSON.stringify(M).includes(`"${L}"`)).map(L=>`${L}=${JSON.stringify(I[L])}`),"Result:",v),v}catch(v){return console.error(`[${U}] JsonLogic error:`,v,"Rule:",M),!1}try{return!!new Function("formData",`return ${M};`)(I)}catch(v){return console.error(`[${U}] String logic error:`,v,"Rule:",M),!1}},X=e.reactive({}),$=async M=>{const I=M.props||{},U=I.endpointReference||I.endpoint;if(!(!(U!=null&&U.apiUrl)||X[M.key])){if(Array.isArray(U.keyParam)&&U.keyParam.length>0&&U.keyParam.some(L=>{const J=f[L];return J==null||J===""})){console.log(`[DynamicForm] Skipping prefetch for ${M.key} - unmet dependencies: ${U.keyParam}`);return}try{console.log(`[DynamicForm] Prefetching for ${M.key} from ${U.apiUrl}`);const{apiUrl:v}=mt(),L=await v(U.apiUrl,U.apiMethod||"GET",{page:1,perPage:100});let J=(L==null?void 0:L.data)||L;Array.isArray(J)||(J=J?[J]:[]),X[M.key]=J,console.log(`[DynamicForm] Prefetched ${J.length} items for ${M.key}`)}catch(v){console.error(`[DynamicForm] Failed prefetching for ${M.key}`,v),X[M.key]=[]}}},G=(M,I)=>{var ke;const U=M.props||{},v=X[M.key]||U.items||U.options||[],L=`FILTER-DEBUG-${M.model}`;if(!((ke=M.logic)!=null&&ke.optionsFilterRule))return v;const J=I?N(I):A.value,te=T(M.logic.optionsFilterRule,J,L);if(!te||!te.values)return v;if(!te)return console.log(`[${L}] No active rule matches current state. Returning all items.`),v;console.log(`[${L}] Active Rule found. Values allowed:`,te.values);const q=U.itemValue||U.model||"id",ce=v.filter(pe=>typeof pe!="object"?te.values.includes(String(pe))||te.values.includes(pe):[q,"code","id","value"].some(Se=>{const Pe=pe[Se];return Pe==null?!1:te.values.some(me=>String(me)===String(Pe))}));return console.log(`[${L}] Filtering completed. ${v.length} -> ${ce.length} items.`),ce.length===0&&v.length>0&&console.warn(`[${L}] Warning: Filter resulting in 0 items. First item sample:`,JSON.stringify(v[0])),ce},ne=M=>{if(!M||typeof M!="object")return[];if("var"in M)return[M.var];let I=[];return Object.values(M).forEach(U=>{Array.isArray(U)?U.forEach(v=>{I=I.concat(ne(v))}):typeof U=="object"&&(I=I.concat(ne(U)))}),I};e.watch(()=>h.value,M=>{if(!(M!=null&&M.sections))return;const I=new Set,U=v=>{if(!v)return;["visibleRule","requiredRule","disabledRule","optionsFilterRule","lengthRule","labelingRule","calculateRule"].forEach(J=>{const te=v[J];te&&(Array.isArray(te)?te.forEach(q=>{q.condition&&ne(q.condition).forEach(ce=>I.add(ce))}):ne(te).forEach(q=>I.add(q)))})};M.sections.forEach(v=>{var J,te,q,ce,ke,pe,de,we;const L=v.propsForm||v.propsTable||v.propsWizard||v.props||{};if(U(v.logic||L.logic||((J=v.props)==null?void 0:J.logic)),v.type==="WIZARD"&&(((te=v.propsWizard)==null?void 0:te.propsSteps)||[]).forEach(Pe=>U(Pe.logic)),((q=v.type)==null?void 0:q.toUpperCase())==="FORM"&&((ce=v.propsForm)!=null&&ce.fields)&&v.propsForm.fields.forEach(Se=>{var Pe;U(Se.logic),(Pe=Se.logic)!=null&&Pe.optionsFilterRule&&$(Se)}),((ke=v.type)==null?void 0:ke.toUpperCase())==="TABLE"&&((pe=v.propsTable)!=null&&pe.modelDatatable)){const Se=v.propsTable.modelDatatable;(!f[Se]||!Array.isArray(f[Se]))&&(f[Se]=[])}else if(((de=v.type)==null?void 0:de.toUpperCase())==="WIZARD"){const Se=C(v);g[Se]===void 0&&(g[Se]=0),(((we=v.propsWizard)==null?void 0:we.propsSteps)||[]).forEach(me=>{(Array.isArray(me.sectionsWizard)?me.sectionsWizard:[me.sectionsWizard].filter(Boolean)).forEach(Ze=>{Ze.fields&&Ze.fields.forEach(De=>{var ut;U(De.logic),(ut=De.logic)!=null&&ut.optionsFilterRule&&$(De)})})})}}),M.sections.forEach(v=>{var J,te;(((J=v.propsForm)==null?void 0:J.fields)||v.fields||[]).forEach(q=>{I.has(q.model)&&$(q)}),v.type==="WIZARD"&&(((te=v.propsWizard)==null?void 0:te.propsSteps)||[]).forEach(ce=>{(Array.isArray(ce.sectionsWizard)?ce.sectionsWizard:[ce.sectionsWizard].filter(Boolean)).forEach(pe=>{pe.fields&&pe.fields.forEach(de=>{I.has(de.model)&&$(de)})})})})},{immediate:!0});const K=new Map,R=new Map;e.watch(()=>({...f}),(M,I)=>{if(!I)return;const U=h.value;if(!(U!=null&&U.sections))return;const v=[];U.sections.forEach(J=>{var q,ce;const te=((q=J.propsForm)==null?void 0:q.fields)||J.fields||[];v.push(...te),J.type==="WIZARD"&&(((ce=J.propsWizard)==null?void 0:ce.propsSteps)||[]).forEach(pe=>{(Array.isArray(pe.sectionsWizard)?pe.sectionsWizard:[pe.sectionsWizard].filter(Boolean)).forEach(we=>{we.fields&&v.push(...we.fields)})})});const L=A.value;v.forEach(J=>{const te=J.model;if(!te)return;const q=j(J);K.get(te)===!0&&q===!1&&f[te]!==null&&(console.log(`[DynamicForm] Resetting ${te} because it became hidden`),y(te,null)),K.set(te,q);const ke=J.logic;if(ke){const we=["lengthRule","optionsFilterRule"],Se={};let Pe=!1;we.forEach(me=>{const Ke=ke[me];if(Array.isArray(Ke)){let Ze=-1;for(let ut=0;ut<Ke.length;ut++)if(Ke[ut].condition&&P(Ke[ut].condition,L)){Ze=ut;break}Se[me]=Ze;const De=R.get(te);De&&De[me]!==void 0&&De[me]!==Ze&&(Pe=!0)}}),Pe&&f[te]!==null&&(console.log(`[DynamicForm] Resetting ${te} because logic mode changed`),y(te,null)),R.set(te,Se)}const de=(J.props||J.propsFieldGlobal||{}).endpoint||{};Array.isArray(de.keyParam)&&de.keyParam.some(Se=>M[Se]!==I[Se])&&f[te]!==null&&(console.log(`[DynamicForm] Resetting ${te} because dependency ${de.keyParam} changed`),y(te,null))})},{deep:!0,immediate:!0}),e.watch(()=>o.model,M=>{M&&Object.keys(M).length>0&&(console.log("[DynamicForm] Syncing model to formData",M),Object.assign(f,M),e.nextTick(()=>{Object.keys(M).forEach(I=>{})}))},{immediate:!0,deep:!0});const j=(M,I)=>{var J;const U=I?N(I):A.value,v=(J=M.logic)==null?void 0:J.visibleRule;if(v==null||v==="")return!0;const L=T(v,U,`VISIBLE-${M.model}`);return L==null?!1:typeof L=="object"?!!P(L,U,`VISIBLE-${M.model}`):!!L},se=(M,I)=>{var te,q;const U=((te=M.props)==null?void 0:te.required)||!1,v=I?N(I):A.value,L=(q=M.logic)==null?void 0:q.requiredRule;if(L==null||L==="")return U;const J=T(L,v,`REQUIRED-${M.model}`);return J==null?U:typeof J=="object"?"required"in J?!!J.required:!!P(J,v,`REQUIRED-${M.model}`):!!J},ee=(M,I)=>{var te,q;const U=((te=M.props)==null?void 0:te.disabled)||!1,v=I?N(I):A.value,L=(q=M.logic)==null?void 0:q.disabledRule;if(L==null||L==="")return U;const J=T(L,v,`DISABLED-${M.model}`);return J==null?U:typeof J=="object"?"disabled"in J?!!J.disabled:!!P(J,v,`DISABLED-${M.model}`):!!J},Y=(M,I)=>{var we;if(!M)return{title:"",description:""};const U=M.propsForm||M.propsTable||M.propsWizard||M.props||{},v=M.logic||U.logic||((we=M.props)==null?void 0:we.logic)||{},L=U.titleID||M.titleID||M.labelID,J=U.titleEN||M.titleEN||M.labelEN,te=U.descriptionID||M.descriptionID,q=U.descriptionEN||M.descriptionEN;let ce=i.value==="id"?L:J,ke=i.value==="id"?te:q;const pe=A.value,de=T(v.labelingRule,pe,`LABEL-SEC-${C(M)}`);return de&&(ce=i.value==="id"?de.labelID||de.titleID||de.title:de.labelEN||de.titleEN||de.title,ke=i.value==="id"?de.descriptionID:de.descriptionEN),{title:ce,description:ke}},le=(M,I)=>{var q,ce,ke;if(!M)return!0;const U=M.propsForm||M.propsTable||M.propsWizard||M.props||{},v=M.logic||U.logic||((q=M.props)==null?void 0:q.logic)||{},L=v.visibleRule||v.rule,J=A.value;if(L!=null&&L!==""&&(typeof L!="object"||Object.keys(L).length>0)){const pe=T(L,J,`VISIBLE-SEC-${C(M)}`);return pe==null?!1:typeof pe=="object"?!!P(pe,J,`VISIBLE-SEC-${C(M)}`):!!pe}if(((ce=M.type)==null?void 0:ce.toUpperCase())==="TABLE"&&((ke=U.headers)!=null&&ke.length))return!0;const te=U.fields||M.fields||[];return!(te.length>0&&!te.some(de=>j(de,I)))},ge=()=>{var U;if(!((U=h.value)!=null&&U.sections))return;const M=3;let I=0;for(;I<M;){let v=!1;if(h.value.sections.forEach(L=>{var te;(((te=L.propsForm)==null?void 0:te.fields)||L.fields||[]).forEach(q=>{var ke;const ce=(ke=q.logic)==null?void 0:ke.calculateRule;if(ce&&typeof ce=="object"){const pe=Object.keys(ce);if(pe.length>0){const de=pe[0],we=ce[de],Se=P(we,A.value,`CALC-${de}`);Se!==void 0&&f[de]!==Se&&(f[de]=Se,v=!0)}}})}),!v)break;I++}},Me=e.computed(()=>{var I,U,v;if(!((I=h.value)!=null&&I.sections))return!1;if(Object.keys(m).length>0)return!0;const M=L=>{for(const J of L)if(j(J)){if(se(J)){const te=f[J.model];if(Array.isArray(te)?te.length===0:te==null||te==="")return!0}if(x[J.model])return!0}return!1};for(const L of h.value.sections){const J=((U=L.propsForm)==null?void 0:U.fields)||L.fields||[];if(M(J))return!0;if(((v=L.type)==null?void 0:v.toUpperCase())==="WIZARD"){const te=w(L);for(const q of te)if(M(q.sections.flatMap(ce=>ce.fields||[])))return!0}}return!1});e.watch(()=>({...f}),()=>{var U;if(!((U=h.value)!=null&&U.sections))return;ge();let M=!1;const I=(v,L)=>{v.forEach(J=>{const te=J.model;if(!j(J)){const q=L?`${L}.${te}`:te,ce=ve(f,q)??f[te];ce!=null&&(Ee(f,q,Array.isArray(ce)?[]:null),M=!0),m[te]&&delete m[te]}})};h.value.sections.forEach(v=>{var q,ce;const L=le(v),J=C(v),te=((q=v.propsForm)==null?void 0:q.fields)||v.fields||[];L?I(te,J):te.forEach(ke=>{const pe=J?`${J}.${ke.model}`:ke.model,de=ve(f,pe)??f[ke.model];de!=null&&(Ee(f,pe,Array.isArray(de)?[]:null),M=!0)}),((ce=v.type)==null?void 0:ce.toUpperCase())==="WIZARD"&&w(v).forEach(pe=>{const de=pe.key||pe.id;pe.sections.forEach(we=>{var Pe;const Se=we.fields||((Pe=we.propsForm)==null?void 0:Pe.fields)||[];L?Se&&I(Se,de):Se.forEach(me=>{const Ke=de?`${de}.${me.model}`:me.model,Ze=ve(f,Ke)??f[me.model];Ze!=null&&(Ee(f,Ke,Array.isArray(Ze)?[]:null),M=!0)})})})}),M&&r("update:model",Z())},{deep:!0});const ve=(M,I)=>{if(!I)return;const U=I.split(".");let v=M;for(const L of U){if(v==null)return;v=v[L]}return v},Ee=(M,I,U)=>{if(!I)return;const v=I.split(".");let L=M;for(let J=0;J<v.length-1;J++)L[v[J]]||(L[v[J]]={}),L=L[v[J]];L[v[v.length-1]]=U},Z=()=>{var U;if(!((U=h.value)!=null&&U.sections))return{...f};const M={},I=new Set;return h.value.sections.forEach(v=>{var te,q,ce,ke,pe,de;if(!le(v))return;const L=((te=v.propsForm)==null?void 0:te.key)||((q=v.propsTable)==null?void 0:q.key)||((ce=v.propsWizard)==null?void 0:ce.key)||v.key;if((((ke=v.propsForm)==null?void 0:ke.fields)||v.fields||[]).forEach(we=>{if(j(we)&&we.model){const Se=L?`${L}.${we.model}`:we.model,Pe=ve(f,Se)??f[we.model];M[we.model]=Pe,I.add(we.model)}}),((pe=v.type)==null?void 0:pe.toUpperCase())==="WIZARD"&&w(v).forEach(Se=>{const Pe=Se.key||Se.id;Se.sections.forEach(me=>{var Ze;(me.fields||((Ze=me.propsForm)==null?void 0:Ze.fields)||[]).forEach(De=>{if(j(De)&&De.model){const ut=Pe?`${Pe}.${De.model}`:De.model,Ft=ve(f,ut)??f[De.model];M[De.model]=Ft,I.add(De.model)}})})}),(de=v.propsTable)!=null&&de.modelDatatable){const we=v.propsTable.modelDatatable,Se=L?`${L}.${we}`:we,Pe=ve(f,Se)??f[we];Pe!==void 0&&(M[we]=Pe,I.add(we))}}),["id","_id"].forEach(v=>{f[v]!==void 0&&!I.has(v)&&(M[v]=f[v])}),M},O=(M,I)=>{if(!M||!I)return;const U=M.data!==void 0?M.data:M,v=Array.isArray(U)?U[0]:U;!v||typeof v!="object"||Object.entries(I).forEach(([L,J])=>{var q,ce;const te=v[J]??v[L];if(te!==void 0){let ke=L;(ce=(q=h.value)==null?void 0:q.sections)==null||ce.forEach(pe=>{var Se,Pe,me;const de=((Se=pe.propsForm)==null?void 0:Se.key)||((Pe=pe.propsTable)==null?void 0:Pe.key)||pe.key;(((me=pe.propsForm)==null?void 0:me.fields)||pe.fields||[]).some(Ke=>Ke.model===L)&&de&&(ke=`${de}.${L}`)}),Ee(f,ke,te)}})},Q=()=>{var I;const M=[];return(I=h.value)!=null&&I.sections&&h.value.sections.forEach(U=>{var v,L,J,te,q,ce;if(((v=U.type)==null?void 0:v.toUpperCase())==="TABLE"){const ke=((L=U.propsTable)==null?void 0:L.modelDatatable)||((J=U.propsTable)==null?void 0:J.key);if(!ke)return;const pe=(((te=U.propsTable)==null?void 0:te.headers)||[]).map(de=>de.key||de.value).filter(Boolean);M.push({key:ke,subFields:pe})}else{const ke=((q=U.propsForm)==null?void 0:q.fields)||U.fields||[];((ce=U.type)==null?void 0:ce.toUpperCase())==="WIZARD"&&w(U).forEach(de=>{de.sections.forEach(we=>{var Pe;(we.fields||((Pe=we.propsForm)==null?void 0:Pe.fields)||[]).forEach(me=>{var Ke,Ze;me.model&&((Ke=me.component)!=null&&Ke.includes("Upload")||((Ze=me.props)==null?void 0:Ze.valueType)==="array")&&M.push({key:me.model,subFields:["id","idDocument","idDocumentType","typeDocument","filename","document","custName","name","code","value"]})})})}),ke.forEach(pe=>{var Pe,me,Ke,Ze,De,ut;const de=((Pe=pe.type)==null?void 0:Pe.toLowerCase())||"",we=((me=pe.model)==null?void 0:me.toLowerCase())||"";(((Ke=pe.props)==null?void 0:Ke.multiple)===!0||((Ze=pe.props)==null?void 0:Ze.multiple)==="true"||((ut=(De=pe.props)==null?void 0:De.valueType)==null?void 0:ut.toLowerCase())==="array"||de.includes("upload")||de.includes("file")||de.includes("document")||we.includes("documents")||we.includes("list"))&&pe.model&&M.push({key:pe.model,subFields:["id","idDocument","idDocumentType","typeDocument","filename","document","custName","name","code","value"]})})}}),M},ie=(M,I)=>{const U={},v=[];if(Object.keys(I).forEach(L=>{const J=I[L];if(typeof J=="string"){const te=L,q=J;M[te]!==void 0&&(U[q]=M[te])}else if(Array.isArray(J)&&J.length>0&&typeof J[0]=="object"){const te=L,q=J[0],ce=Object.keys(q);let ke=null;if(Array.isArray(M[te])&&(ke=M[te]),!ke){const de=Q().find(we=>ce.some(Se=>we.subFields.includes(Se)));de&&M[de.key]!==void 0&&(console.log(`%c[MAPPING] Smart-discovered metadata source '${de.key}' for target '${te}'`,"color: #10b981; font-weight: bold;"),ke=M[de.key])}if(!ke){const pe=Object.keys(M).find(de=>{const we=M[de];if(!Array.isArray(we)||we.length===0)return!1;const Se=we[0];return typeof Se!="object"||Se===null?!1:ce.some(Pe=>Se[Pe]!==void 0)});pe&&(console.log(`%c[MAPPING] Value-discovered source '${pe}' for target '${te}'`,"color: #10b981; font-weight: bold;"),ke=M[pe])}ke&&Array.isArray(ke)?(console.log(`%c[MAPPING] Mapping array '${te}'`,"color: #3b82f6; font-weight: bold;"),U[te]=ke.map(pe=>{const de={};return Object.entries(q).forEach(([we,Se])=>{const Pe=Se,me=we,Ke=pe[me]!==void 0?pe[me]:pe[Pe]??null;de[Pe]=Ke}),de})):(v.push(te),U[te]=[])}}),v.length>0){const L=v.join(", "),J=i.value==="id"?`Kesalahan Pemetaan: Data sumber tidak ditemukan untuk field (${L}). Harap periksa skema atau hubungi tim teknis.`:`Mapping Error: Source data not found for fields (${L}). Please check the schema or contact technical team.`;Xe.error(J,{autoClose:5e3,position:Xe.POSITION.TOP_RIGHT}),console.warn(`[MAPPING-ERROR] ${J}`)}return U},Ae=M=>{var I,U,v,L;if(M.requireConfirm){const J=i.value==="id";p.title=J?((I=M.propCustomMessage)==null?void 0:I.titleID)||"Konfirmasi Tindakan":((U=M.propCustomMessage)==null?void 0:U.titleEN)||"Confirm Action",p.message=J?((v=M.propCustomMessage)==null?void 0:v.messageID)||"Apakah Anda yakin ingin melanjutkan tindakan ini?":((L=M.propCustomMessage)==null?void 0:L.messageEN)||"Are you sure you want to proceed with this action?",p.action=M,p.visible=!0;return}Ye(M)},ze=()=>{const M=p.action;p.visible=!1,M&&Ye(M)},Ye=async M=>{const I=M.propsActionGlobal||M.props||{},U=I.type==="SUBMIT"||M.type==="SUBMIT",v=I.type==="ACTION"||M.type==="ACTION",L=ie(Z(),I.fieldMapping||M.fieldMapping||{});console.log("%c[SUBMIT-ACTION-PAYLOAD]","color: #8b5cf6; font-weight: bold;",L),r("action",M,L);const J=I.endpointPropAction||M.endpointPropAction||I.endpoint||M.endpoint,te=!!(J!=null&&J.apiUrl);if(U||v)if(te){const q=Xe.loading(i.value==="id"?"Sedang memproses...":"Processing...",{position:"top-center"});try{const ce=await l(J.apiUrl,J.apiMethod||"POST",L);Xe.update(q,{render:i.value==="id"?"Berhasil disimpan":"Saved successfully",type:"success",isLoading:!1,autoClose:3e3}),(I.fieldMapping||M.fieldMapping)&&O(ce,I.fieldMapping||M.fieldMapping),r("success",ce)}catch(ce){console.error("[DynamicForm][ActionError]",ce),Xe.update(q,{render:`${i.value==="id"?"Gagal:":"Failed:"} ${ce.message||ce}`,type:"error",isLoading:!1,autoClose:5e3}),r("error",ce)}}else U&&r("submit",L);I.keyRedirect&&I.route&&c&&c.push(I.route)},Qe=()=>{var I;if(!((I=h.value)!=null&&I.sections))return!0;let M=!0;return h.value.sections.forEach(U=>{var L,J;if(!le(U))return;(((L=U.propsForm)==null?void 0:L.fields)||U.fields||[]).forEach(te=>{if(j(te)){const q=k(te,f[te.model]);q&&(m[te.model]=q,M=!1)}}),((J=U.type)==null?void 0:J.toUpperCase())==="WIZARD"&&w(U).forEach(te=>{te.sections.forEach(q=>{(q.fields||[]).forEach(ke=>{if(j(ke)){const pe=k(ke,f[ke.model]);pe&&(m[ke.model]=pe,M=!1)}})})})}),M},at=async()=>{if(!Qe()){console.warn("[DynamicForm] Submit blocked by validation errors",m);return}d.value=!0;try{const M=Z();r("submit",M)}finally{d.value=!1}},je=()=>{r("cancel")},bt=M=>M.permission?o.isEditMode?M.permission!=="CREATE":M.permission!=="UPDATE":!0,Ct=M=>{const I=M.modelDatatable;if(!I)return[];const U=f[I];return Array.isArray(U)?U:[]},yt=e.ref(!1),Vt=e.ref(""),H=e.ref("Plus"),he=e.ref([]),ye=e.reactive({}),He=e.reactive({}),Le=e.ref(""),ae=e.ref(null),fe=e.ref(null),be=(M,I)=>{ye[M]=I;const U=he.value.find(v=>v.model===M);if(U){const v=He,L=k(U,I);L?v[M]=L:delete v[M]}},Te=(M,I)=>{var v,L,J;Le.value=M.modelDatatable||"",fe.value=I,ae.value=null,Vt.value=i.value==="id"?I.labelID||((v=I.propsActionGlobal)==null?void 0:v.labelID)||"Tambah Data":I.labelEN||((L=I.propsActionGlobal)==null?void 0:L.labelEN)||"Add Data",H.value=I.icon||((J=I.propsActionGlobal)==null?void 0:J.icon)||"Plus";const U=(I.fieldActionGlobal||[]).map(te=>({...te,props:te.propsFieldGlobal||te.props||{}}));he.value=U,yt.value=!0,Object.keys(ye).forEach(te=>delete ye[te]),Object.keys(He).forEach(te=>delete He[te]),U.forEach(te=>{ye[te.model]=null}),yt.value=!0},lt=(M,I)=>{var pe;const{action:U,row:v}=I;if(/delete|trash|remove/i.test(U)){const de=M.modelDatatable;if(de&&Array.isArray(f[de])){const we=f[de].indexOf(v);if(we!==-1)f[de].splice(we,1);else{const Se=JSON.stringify(v),Pe=f[de].findIndex(me=>JSON.stringify(me)===Se);Pe!==-1&&f[de].splice(Pe,1)}}return}const J=M.modelDatatable||"";Le.value=J,Vt.value=i.value==="id"?"Ubah Data":"Edit Data",H.value="SquarePen";const te=f[J],q=Array.isArray(te)?te.indexOf(v):-1;ae.value=q!==-1?q:null;const ke=(((pe=(M.actionTableGlobal||[])[0])==null?void 0:pe.fieldActionGlobal)||[]).map(de=>({...de,props:de.propsFieldGlobal||de.props||{}}));he.value=ke,yt.value=!0,Object.keys(ye).forEach(de=>delete ye[de]),Object.keys(He).forEach(de=>delete He[de]),ke.forEach(de=>{ye[de.model]=v[de.model]??null}),yt.value=!0},Ut=()=>{let M=!0;if(he.value.forEach(v=>{const L=k(v,ye[v.model]);L&&(He[v.model]=L,M=!1)}),!M)return;const I=Le.value;if(!I)return;Array.isArray(f[I])||(f[I]=[]);const U={...ye};ae.value!==null?f[I].splice(ae.value,1,U):f[I].push(U),yt.value=!1};return(M,I)=>{var U,v,L,J,te;return e.openBlock(),e.createElementBlock("div",GS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((U=h.value)==null?void 0:U.sections,(q,ce)=>{var ke,pe,de,we,Se,Pe;return e.openBlock(),e.createElementBlock(e.Fragment,{key:ce},[((ke=q.type)==null?void 0:ke.toUpperCase())==="FORM"&&q.propsForm&&le(q)?(e.openBlock(),e.createElementBlock("div",XS,[e.createElementVNode("div",KS,[Y(q).title?(e.openBlock(),e.createElementBlock("div",YS,[e.createElementVNode("h3",JS,e.toDisplayString(Y(q).title),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",QS,[(pe=q.propsForm.actionSection)!=null&&pe.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(q.propsForm.actionSection,(me,Ke)=>{var Ze,De,ut,Ft,ln,cn,ct;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Ke},[bt(me)?(e.openBlock(),e.createBlock(st,{key:0,icon:me.icon||((Ze=me.propsActionGlobal)==null?void 0:Ze.icon),text:i.value==="id"?me.labelID||((De=me.propsActionGlobal)==null?void 0:De.labelID):me.labelEN||((ut=me.propsActionGlobal)==null?void 0:ut.labelEN),"bg-color":((ln=me.bgColor||((Ft=me.propsActionGlobal)==null?void 0:Ft.bgColor))==null?void 0:ln.toLowerCase())||"primary",variant:((ct=me.variant||((cn=me.propsActionGlobal)==null?void 0:cn.variant))==null?void 0:ct.toLowerCase())||"outline",size:"sm",onClick:to=>Ae(me)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128)):e.createCommentVNode("",!0),ce===0?(e.openBlock(),e.createBlock(st,{key:1,size:"sm",icon:"List",text:e.unref(a)("common.back"),variant:"outline",onClick:je},null,8,["text"])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["p-4 grid gap-4",q.propsForm.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E(q.propsForm.fields),me=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:me.key},[j(me)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([me.column==="FULL"&&q.propsForm.layoutColumns>1?"md:col-span-2":"col-span-1"])},[e.createVNode(ai,{field:me,"model-value":f[me.model],"form-data":f,required:se(me),disabled:ee(me),options:G(me),error:m[me.model],"dynamic-labels":_(me),"dynamic-length":B(me),"base-url":t.baseUrl,"onUpdate:modelValue":Ke=>y(me.model,Ke)},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)])):((de=q.type)==null?void 0:de.toUpperCase())==="TABLE"&&q.propsTable&&le(q)?(e.openBlock(),e.createElementBlock("div",ZS,[(we=q.propsTable.actionTableGlobal)!=null&&we.length?(e.openBlock(),e.createElementBlock("div",eA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.propsTable.actionTableGlobal,(me,Ke)=>{var Ze,De;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Ke},[me.propsActionGlobal?(e.openBlock(),e.createBlock(st,{key:0,icon:me.propsActionGlobal.icon,"bg-color":((Ze=me.propsActionGlobal.bgColor)==null?void 0:Ze.toLowerCase())||"primary",variant:((De=me.propsActionGlobal.variant)==null?void 0:De.toLowerCase())||"default",size:"sm",onClick:ut=>Te(q.propsTable,me)},null,8,["icon","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128))])):e.createCommentVNode("",!0),e.createVNode(Bo,{"table-config":q.propsTable,data:Ct(q.propsTable),nested:!0,"show-pagination":q.propsTable.pagination??!0,onAction:me=>lt(q.propsTable,me)},null,8,["table-config","data","show-pagination","onAction"])])):((Se=q.type)==null?void 0:Se.toUpperCase())==="WIZARD"&&q.propsWizard&&le(q)?(e.openBlock(),e.createElementBlock("div",tA,[e.createVNode(Xs,{tabs:w(q),modelValue:g[C(q)],"onUpdate:modelValue":me=>g[C(q)]=me,"is-vertical":q.propsWizard.isVertical,"is-wizard":q.propsWizard.isWizard,"type-wizard":((Pe=q.propsWizard.typeWizard)==null?void 0:Pe.toLowerCase())||"icon",loading:d.value},e.createSlots({_:2},[e.renderList(w(q),me=>({name:`tab-${me.key}`,fn:e.withCtx(()=>{var Ke,Ze;return[e.createElementVNode("div",nA,[me.title||(Ke=me.actions)!=null&&Ke.length?(e.openBlock(),e.createElementBlock("div",oA,[e.createElementVNode("div",null,[me.title?(e.openBlock(),e.createElementBlock("h4",rA,e.toDisplayString(me.title),1)):e.createCommentVNode("",!0),me.description?(e.openBlock(),e.createElementBlock("p",aA,e.toDisplayString(me.description),1)):e.createCommentVNode("",!0)]),(Ze=me.actions)!=null&&Ze.length?(e.openBlock(),e.createElementBlock("div",sA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.actions,(De,ut)=>{var Ft,ln,cn,ct,to,rr,ar;return e.openBlock(),e.createElementBlock(e.Fragment,{key:ut},[bt(De)?(e.openBlock(),e.createBlock(st,{key:0,icon:De.icon||((Ft=De.propsActionGlobal)==null?void 0:Ft.icon),text:i.value==="id"?De.labelID||((ln=De.propsActionGlobal)==null?void 0:ln.labelID):De.labelEN||((cn=De.propsActionGlobal)==null?void 0:cn.labelEN),"bg-color":((to=De.bgColor||((ct=De.propsActionGlobal)==null?void 0:ct.bgColor))==null?void 0:to.toLowerCase())||"primary",variant:((ar=De.variant||((rr=De.propsActionGlobal)==null?void 0:rr.variant))==null?void 0:ar.toLowerCase())||"tonal",size:"sm",onClick:li=>Ae(De)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.sections,(De,ut)=>{var Ft,ln,cn;return e.openBlock(),e.createElementBlock(e.Fragment,{key:ut},[le(De)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[((Ft=De.type)==null?void 0:Ft.toUpperCase())==="FORM"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid gap-4",De.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E(De.fields),ct=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ct.key},[j(ct)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([ct.column==="FULL"&&De.layoutColumns>1?"md:col-span-2":"col-span-1"])},[e.createVNode(ai,{field:ct,"model-value":f[ct.model],"form-data":f,required:se(ct),disabled:ee(ct),options:G(ct),error:m[ct.model],"dynamic-labels":_(ct),"dynamic-length":B(ct),"base-url":t.baseUrl,"onUpdate:modelValue":to=>y(ct.model,to)},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)):((ln=De.type)==null?void 0:ln.toUpperCase())==="TABLE"||De.isDataTable?(e.openBlock(),e.createElementBlock("div",iA,[e.createVNode(Bo,{"table-config":De.propsDataTableWizard||De.propsTable,data:Ct(De.propsDataTableWizard||De.propsTable),nested:!0,"show-pagination":((cn=De.propsDataTableWizard||De.propsTable)==null?void 0:cn.pagination)??!0,onAction:ct=>lt(De.propsDataTableWizard||De.propsTable,ct)},null,8,["table-config","data","show-pagination","onAction"])])):(e.openBlock(),e.createElementBlock("div",lA," Unknown section type: "+e.toDisplayString(De.type),1))],64)):e.createCommentVNode("",!0)],64)}),128))])]})}))]),1032,["tabs","modelValue","onUpdate:modelValue","is-vertical","is-wizard","type-wizard","loading"])])):e.createCommentVNode("",!0)],64)}),128)),b!=null&&b.global?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(((L=(v=h.value)==null?void 0:v.ui)==null?void 0:L.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 border-t border-neutral-100 dark:border-neutral-800")},[(te=(J=h.value)==null?void 0:J.actionGlobal)!=null&&te.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(h.value.actionGlobal,(q,ce)=>{var ke,pe,de;return e.openBlock(),e.createElementBlock(e.Fragment,{key:ce},[q.propsActionGlobal&&bt(q)?(e.openBlock(),e.createBlock(st,{key:0,icon:q.propsActionGlobal.icon,text:i.value==="id"?q.propsActionGlobal.labelID:q.propsActionGlobal.labelEN,"bg-color":((ke=q.propsActionGlobal.bgColor)==null?void 0:ke.toLowerCase())||"primary",variant:((pe=q.propsActionGlobal.variant)==null?void 0:pe.toLowerCase())||"default",loading:d.value,disabled:Me.value&&(q.permission==="CREATE"||q.permission==="UPDATE"||((de=q.propsActionGlobal)==null?void 0:de.key)==="submit"),onClick:we=>Ae(q)},null,8,["icon","text","bg-color","variant","loading","disabled","onClick"])):e.createCommentVNode("",!0)],64)}),128)):(e.openBlock(),e.createBlock(st,{key:1,text:"Submit","bg-color":"primary",loading:d.value,disabled:Me.value,onClick:at},null,8,["loading","disabled"]))],2)),e.createVNode(yo,{modelValue:p.visible,"onUpdate:modelValue":I[1]||(I[1]=q=>p.visible=q),title:p.title,icon:"AlertTriangle","max-width":450},{actions:e.withCtx(()=>[e.createVNode(st,{variant:"outline",text:e.unref(a)("common.cancel"),onClick:I[0]||(I[0]=q=>p.visible=!1)},null,8,["text"]),e.createVNode(st,{text:e.unref(a)("common.confirm"),onClick:ze},null,8,["text"])]),default:e.withCtx(()=>[e.createElementVNode("div",cA,e.toDisplayString(p.message),1)]),_:1},8,["modelValue","title"]),e.createVNode(yo,{modelValue:yt.value,"onUpdate:modelValue":I[3]||(I[3]=q=>yt.value=q),title:Vt.value,icon:H.value,"max-width":700},{actions:e.withCtx(()=>[e.createVNode(st,{variant:"outline",text:"Cancel",onClick:I[2]||(I[2]=q=>yt.value=!1)}),e.createVNode(st,{text:"Save",onClick:Ut})]),default:e.withCtx(()=>[he.value.length?(e.openBlock(),e.createElementBlock("div",dA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,q=>(e.openBlock(),e.createElementBlock("div",{key:q.key,class:e.normalizeClass(q.column==="FULL"?"md:col-span-2":"col-span-1")},[j(q,ye)?(e.openBlock(),e.createBlock(ai,{key:0,field:q,"model-value":ye[q.model],"form-data":ye,required:se(q,ye),disabled:ee(q,ye),options:G(q,ye),error:He[q.model],"dynamic-labels":_(q,ye),"dynamic-length":B(q,ye),"base-url":t.baseUrl,"onUpdate:modelValue":ce=>be(q.model,ce)},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])):e.createCommentVNode("",!0)],2))),128))])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title","icon"])])}}}),fA={class:"w-full space-y-6 animate-pulse"},hA={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},mA=e.defineComponent({__name:"AutoLayoutSkeleton",setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",fA,[o[2]||(o[2]=e.createElementVNode("div",{class:"h-6 w-48 bg-neutral-200 dark:bg-neutral-700 rounded-md"},null,-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(2,r=>e.createElementVNode("div",{key:r,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 overflow-hidden"},[o[1]||(o[1]=e.createElementVNode("div",{class:"px-4 py-3 bg-neutral-200 dark:bg-neutral-700"},[e.createElementVNode("div",{class:"h-4 w-32 bg-neutral-300 dark:bg-neutral-600 rounded"})],-1)),e.createElementVNode("div",hA,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,a=>e.createElementVNode("div",{key:a,class:e.normalizeClass(a>4?"md:col-span-2":"col-span-1")},[...o[0]||(o[0]=[e.createElementVNode("div",{class:"h-3 w-24 bg-neutral-200 dark:bg-neutral-700 rounded mb-2"},null,-1),e.createElementVNode("div",{class:"h-10 w-full bg-neutral-200 dark:bg-neutral-700 rounded-lg"},null,-1)])],2)),64))])])),64)),o[3]||(o[3]=e.createElementVNode("div",{class:"flex items-center gap-2"},[e.createElementVNode("div",{class:"h-9 w-24 bg-neutral-300 dark:bg-neutral-600 rounded-lg"}),e.createElementVNode("div",{class:"h-9 w-20 bg-neutral-200 dark:bg-neutral-700 rounded-lg"})],-1))]))}}),pA={class:"w-full"},gA={class:"relative mx-auto min-h-[37.5rem]"},bA={key:"content",class:"w-full"},yA={class:"mb-6"},xA={class:"text-neutral-500 dark:text-neutral-400"},kA={key:"skeleton",class:"w-full"},wA={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},si=Pt(e.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},isEditMode:{type:Boolean},model:{}},emits:["submit-success","cancel","action-success","update:model"],setup(t,{emit:n}){var N,A,T,P,X,$,G,ne;const o=t,r=n,a=(A=(N=e.getCurrentInstance())==null?void 0:N.appContext)==null?void 0:A.app;a&&!a._context.provides[Symbol.for("vue-router-route-location")]&&a.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let s={query:{},params:{},path:""};try{const K=zn.useRoute();if(K&&Object.keys(K).length>0)s=K;else{const R=e.getCurrentInstance();(X=(P=(T=R==null?void 0:R.appContext)==null?void 0:T.config)==null?void 0:P.globalProperties)!=null&&X.$route&&(s=R.appContext.config.globalProperties.$route)}}catch{console.warn("useRoute not available, using fallback")}let i={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:K=>{typeof window<"u"&&(typeof K=="string"?window.location.href=K:K&&K.path&&(window.location.href=K.path))},__isFallback:!0};try{const K=zn.useRouter();if(K)i=K;else{const R=e.getCurrentInstance();(ne=(G=($=R==null?void 0:R.appContext)==null?void 0:$.config)==null?void 0:G.globalProperties)!=null&&ne.$router&&(i=R.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=mt();let d;try{d=Rt.useI18n().locale}catch{d=e.ref("en")}const{setPageTitle:u}=du(),h=e.computed(()=>o.isEditMode!==void 0?o.isEditMode:s.params&&"id"in s.params?!0:s.path?/\/edit\/[^\/]+$/.test(s.path):!1);e.watchEffect(()=>{console.log("isEditModeisEditMode",h.value)});const f=e.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const K=s.path.match(/\/edit\/([^\/]+)$/);return K?K[1]:null}),m=e.ref({}),g=e.ref(null),b=e.ref(!0),x=e.ref(!1),p="https://dcodedynamic.skyworx.co.id/api/auto-layout/form/form-dynamic?code=",C="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",w=e.ref(o.layoutCode),E=e.computed(()=>{var j;if(!g.value)return"";const K=((j=d==null?void 0:d.value)==null?void 0:j.toLowerCase())||"en";return(K==="en"||K.startsWith("en-")?g.value.titleEN:g.value.titleID)||g.value.title||o.layoutCode});e.watch(E,K=>{K&&u(K)},{immediate:!0});const _=(K,R="")=>{const j={};return!K||typeof K!="object"||Object.keys(K).forEach(se=>{const ee=K[se],Y=R?`${R}.${se}`:se;ee&&typeof ee=="object"&&!Array.isArray(ee)&&!(ee instanceof Date)&&Object.assign(j,_(ee,Y)),j[Y]=ee}),j},B=async()=>{var K,R,j,se,ee,Y;b.value=!0;try{let le=o.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&(le=s.query.code||o.layoutCode);const ge="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",Me=ge?{Authorization:`Bearer ${ge}`}:{},ve=`${p}${le}`;let Ee=await l(ve,"GET",null,Me);if(!Ee.status||!Ee.data||Array.isArray(Ee.data)&&Ee.data.length===0)try{const Z=`${C}${le}`,O=await l(Z,"GET",null,Me);if(O.status){const Q=Array.isArray(O.data)?O.data[0]:O.data;Q&&Q.code&&(le=Q.code,w.value=le,Ee=await l(`${p}${le}`,"GET",null,Me))}}catch(Z){console.warn("Failed to resolve layout code via datatable",Z)}if(Ee.status){g.value=Array.isArray(Ee.data)?Ee.data[0]:Ee.data;const Z={};if((K=g.value)!=null&&K.sections&&g.value.sections.forEach(O=>{((O.propsForm||O.props||{}).fields||O.fields||[]).forEach(Ae=>{var Ye;const ze=Ae.model||((Ye=Ae.props)==null?void 0:Ye.model)||Ae.key;ze&&(Z[ze]=null)})}),m.value=Z,b.value=!1,h.value&&f.value){x.value=!0;try{const O=(se=(j=(R=g.value.sections)==null?void 0:R[0])==null?void 0:j.propsForm)==null?void 0:se.endpointForm,Q=g.value.endpointForm,ie=O||Q;if(ie!=null&&ie.apiUrl){const Ae=ie.apiUrl,ze=ie.apiMethod||"GET",Ye=ie.keyParam||[],Qe={};Ye.length>0?Ye.forEach(je=>{Qe[je]=f.value}):Qe.id=f.value;const at=await c(Ae,ze,Qe);if(at.status){let je=Array.isArray(at.data)?at.data[0]:at.data;at.payload&&(je={...je,...at.payload});const bt=_(je);m.value={...m.value,...je,...bt}}}else if((ee=g.value.endpointGlobal)!=null&&ee.apiUrl){const Ae=g.value.endpointGlobal.apiUrl,ze=g.value.endpointGlobal.apiMethod||"GET",Ye={id:f.value},Qe=await c(Ae,ze,Ye);if(Qe.status){const at=Array.isArray(Qe.data)?Qe.data[0]:Qe.data,je=_(at);m.value={...m.value,...at,...je}}}else{const Ae=((Y=g.value.endpoint)==null?void 0:Y.detailUrl)||`/api/${w.value}/detail/${f.value}`,ze=await l(Ae,"GET");if(ze.status){let Ye=Array.isArray(ze.data)?ze.data[0]:ze.data;if(ze.payload){const je={...ze.payload};if(Object.keys(je).forEach(bt=>{Ye[bt]!==void 0&&Ye[bt]!==null&&(je[bt]=Ye[bt])}),!("id"in je)&&Ye.id){const bt=Object.keys(je).find(Ct=>Ct.startsWith("id")&&Ct.length>2&&!je[Ct]);bt&&(je[bt]=Ye.id)}Ye=je}const Qe={...Ye};Object.keys(m.value).forEach(je=>{if(Qe[je]===void 0||Qe[je]===null){if(je.toLowerCase().startsWith("id")&&je.length>2){const Ct=je.substring(2).toLowerCase(),yt=Array.isArray(ze.data)?ze.data[0]:ze.data,Vt=Object.keys(yt).find(H=>H.toLowerCase()===Ct);Vt&&yt[Vt]&&typeof yt[Vt]=="object"&&"id"in yt[Vt]&&(Qe[je]=yt[Vt].id)}if(je==="idSupervisor"){const Ct=Array.isArray(ze.data)?ze.data[0]:ze.data;Ct.supervisorId&&(Qe[je]=Ct.supervisorId)}}});const at=_(Qe);m.value={...m.value,...Qe,...at}}}}catch(O){console.error("Failed to fetch record data:",O)}finally{x.value=!1}}}}catch(le){console.error("Failed to load form layout:",le),b.value=!1}},k=K=>{m.value=K,r("update:model",K)},y=async K=>{var R,j,se;try{const ee=(se=(j=(R=g.value.sections)==null?void 0:R[0])==null?void 0:j.propsForm)==null?void 0:se.endpointForm,Y=g.value.endpointGlobal||g.value.endpoint,le=(ee==null?void 0:ee.submitUrl)||(Y==null?void 0:Y.submitUrl)||`/api/generic/${o.layoutCode}`,ge=(ee==null?void 0:ee.submitMethod)||(Y==null?void 0:Y.submitMethod)||(h.value?"PUT":"POST"),Me=Object.values(K).some(Ee=>Ee instanceof File||Ee instanceof Blob);let ve;Me?(ve=new FormData,Object.keys(K).forEach(Ee=>{const Z=K[Ee];Z!=null&&(Array.isArray(Z)?Z.forEach(O=>ve.append(`${Ee}[]`,O)):ve.append(Ee,Z))})):(ve={...K},h.value&&f.value&&!ve.id&&(ve.id=f.value)),await l(le,ge,ve),r("submit-success",ve),i.back()}catch(ee){console.error("Submit failed:",ee)}},V=async(K,R,j)=>{if(K==="cancel"){D();return}const se=R.endpointPropAction||R.propsActionGlobal&&R.propsActionGlobal.endpointPropAction;if(se)try{b.value=!0;const ee=j?{...j}:{...m.value};h.value&&R.model&&f.value&&(ee[R.model]=f.value);const Y=se.apiUrl,le=se.apiMethod||"POST";(await c(Y,le,ee)).status&&(r("action-success",K,R,ee),i.back())}catch(ee){console.error("Action failed:",ee)}finally{b.value=!1}},D=()=>{r("cancel"),i.back()};return e.onMounted(()=>{B()}),e.watch(()=>o.model,K=>{K&&Object.keys(K).length>0&&(m.value={...m.value,...K})},{immediate:!0,deep:!0}),e.onUnmounted(()=>{u("")}),(K,R)=>(e.openBlock(),e.createElementBlock("div",pA,[e.createElementVNode("div",gA,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[!b.value&&g.value?(e.openBlock(),e.createElementBlock("div",bA,[e.createElementVNode("div",yA,[e.createElementVNode("p",xA,e.toDisplayString(g.value.description),1)]),e.createVNode(uA,{schema:g.value,model:m.value,"is-edit-mode":h.value,loading:x.value,"onUpdate:model":R[0]||(R[0]=j=>k(j)),onSubmit:y,onCancel:D,onAction:V,class:"w-full"},null,8,["schema","model","is-edit-mode","loading"])])):b.value?(e.openBlock(),e.createElementBlock("div",kA,[e.createVNode(mA)])):(e.openBlock(),e.createElementBlock("div",wA," Failed to load form configuration for "+e.toDisplayString(o.layoutCode),1))]),_:1})])]))}}),[["__scopeId","data-v-9d6797b1"]]),CA={class:"h-full flex flex-col"},EA={key:1,class:"flex-1 flex items-center justify-center"},BA={key:2,class:"flex-1 flex items-center justify-center text-red-500"},ii=e.defineComponent({name:"AutoLayoutDatatable",__name:"AutoLayoutDatatable",props:{layoutCode:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function}},emits:["action","navigate"],setup(t,{emit:n}){var _,B,k,y,V,D;const o=t,r=n,a=e.getCurrentInstance(),{apiUrl:s}=mt();let i={query:{},params:{},path:""};try{const N=zn.useRoute();N?i=N:(k=(B=(_=a==null?void 0:a.appContext)==null?void 0:_.config)==null?void 0:B.globalProperties)!=null&&k.$route&&(i=a.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let l={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:N=>{typeof window<"u"&&(typeof N=="string"?window.location.href=N:N&&N.path&&(window.location.href=N.path))}};try{const N=zn.useRouter();N?l=N:(D=(V=(y=a==null?void 0:a.appContext)==null?void 0:y.config)==null?void 0:V.globalProperties)!=null&&D.$router&&(l=a.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const c=e.inject("hasActionAccess",()=>!1),d=e.inject("userPermissions",null),u=e.ref(null),h=e.ref(!0),f=e.ref(null),m="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",g=e.computed(()=>`${m}${o.layoutCode}`),{setPageTitle:b}=du();let x;try{x=Rt.useI18n().locale}catch{x=e.ref("en")}const p=()=>{if(u.value){const A=(x.value==="id"?u.value.titleID:u.value.titleEN)||u.value.title||"Datatable";b(A)}};e.watch(x,()=>{p()});const C=async()=>{h.value=!0;try{const N="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",A=N?{Authorization:`Bearer ${N}`}:{},T=await s(g.value,"GET",null,A);T.status&&(u.value=Array.isArray(T.data)?T.data[0]:T.data,console.log("[DEBUG] AutoLayoutDatatable config loaded:",u.value),p())}catch(N){console.error("Gagal Menampilkan Datatable:",N)}finally{h.value=!1}},w=N=>{N.action==="add"&&console.log("[AutoLayoutDatatable] Add action triggered"),console.log("Aksi:",N.action,N)},E=N=>{console.log("[DEBUG] AutoLayoutDatatable handleNavigate:",N);let A=N.route;const T=N.path;if(!A&&T){const X=((i==null?void 0:i.path)||"").split("/");X.length>=2&&(A=`/${X[1]}/create`)}if(A||T){const P={...N.query||{},code:T||void 0};Object.keys(P).forEach(X=>P[X]===void 0&&delete P[X]),console.log("[DEBUG] Emitting navigate to parent:",{route:A,query:P}),r("navigate",{route:A||"/form",query:P}),l&&!l.__isFallback&&l.push({path:A||"/form",query:P})}else console.warn("[DEBUG] No route or path provided for navigation")};return e.onMounted(()=>{C()}),(N,A)=>(e.openBlock(),e.createElementBlock("div",CA,[!h.value&&u.value?(e.openBlock(),e.createBlock(Bo,{key:0,ref_key:"dtRef",ref:f,"api-url":g.value,"api-method":"GET","table-config":u.value,"permission-base":o.permissionBase||"","dummy-mode":["datatable-create","datatable-edit"].includes(o.layoutCode),"user-permissions":o.userPermissions||e.unref(d),"permission-checker":e.unref(c),checkPermission:o.checkPermission,onAction:w,onNavigate:E},{"header-actions":e.withCtx(()=>[...A[0]||(A[0]=[])]),_:1},8,["api-url","table-config","permission-base","dummy-mode","user-permissions","permission-checker","checkPermission"])):h.value?(e.openBlock(),e.createElementBlock("div",EA,[...A[1]||(A[1]=[e.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",BA," Failed to load configuration for "+e.toDisplayString(o.layoutCode),1))]))}}),uu=e.defineCustomElement(si),fu=e.defineCustomElement(ii);typeof customElements<"u"&&(customElements.get("micro-dynamic-form")||customElements.define("micro-dynamic-form",uu),customElements.get("micro-dynamic-datatable")||customElements.define("micro-dynamic-datatable",fu));const _A=[mr,Ti,st,ml,Ua,Ha,Bd,Cn,Ps,Ts,ta,yo,$d,na,jd,$s,Os,Wd,Ws,oa,Us,xo,Hs,ra,Ud,Hd,qs,Gs,aa,sa,so,ko,Kd,Yd,Xs,Ks,Ys,ri,Bo,si,ii],hu={install(t,n={}){n&&Object.keys(n).length>0&&ui(n),_A.forEach(o=>{o.name&&t.component(o.name,o)})}};xe.AutoLayoutDatatable=ii,xe.AutoLayoutForm=si,xe.DCodeAutoComplete=mr,xe.DCodeBadge=ri,xe.DCodeBeforeAfter=Ua,xe.DCodeButton=st,xe.DCodeCard=ml,xe.DCodeCardCheckboxList=Ps,xe.DCodeChart=Bd,xe.DCodeCheckbox=Cn,xe.DCodeCurrencyField=Ts,xe.DCodeDatePicker=ta,xe.DCodeDialog=yo,xe.DCodeDialogCloseBtn=$d,xe.DCodeDropzone=na,xe.DCodeDynamicUploadList=Os,xe.DCodeFileField=jd,xe.DCodeFileResult=$s,xe.DCodeIconDropdown=Wd,xe.DCodeImageCropperDialog=Ws,xe.DCodeImageField=oa,xe.DCodeImageResult=Us,xe.DCodeInfiniteAutoComplete=Ti,xe.DCodeLabel=xo,xe.DCodeListLabels=Ha,xe.DCodeMultiSelect=Hs,xe.DCodeOtpInput=ra,xe.DCodePermissionMenu=Ks,xe.DCodeProgress=Ud,xe.DCodeProgressBar=Hd,xe.DCodeRadio=qs,xe.DCodeRadioCustom=Gs,xe.DCodeSlider=aa,xe.DCodeSwitch=sa,xe.DCodeTextField=so,xe.DCodeTextarea=ko,xe.DCodeTimelineWithIcons=Kd,xe.DCodeTreePermissions=Ys,xe.DCodeUploadFile=Yd,xe.DCodeWizard=Xs,xe.DataTable=Bo,xe.DataTableComponent=Bo,xe.DynamicUI=hu,xe.MicroDynamicDatatable=fu,xe.MicroDynamicForm=uu,xe.cn=We,xe.default=hu,xe.setApiConfig=ui,Object.defineProperties(xe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
95
+ `});return(S,w)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-2 w-full",e.unref(o).class]),"aria-busy":!1},[d.value?(e.openBlock(),e.createBlock(e.unref(nr),{key:0,for:c.value,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",VC,"*")):e.createCommentVNode("",!0)]),_:1},8,["for"])):e.createCommentVNode("",!0),e.createElementVNode("div",AC,[t.showValue?(e.openBlock(),e.createElementBlock("div",DC,[e.createElementVNode("span",NC,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.min)+e.toDisplayString(a.valueSuffix),1),e.createElementVNode("span",MC,e.toDisplayString(m.value),1),e.createElementVNode("span",vC,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.max)+e.toDisplayString(a.valueSuffix),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",PC,[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-1/2 -translate-y-1/2 w-full h-full bg-gray-200 rounded-lg pointer-events-none",[t.size==="sm"?"h-2":t.size==="md"?"h-2.5":"h-3"]])},[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-0 left-0 h-full rounded-lg transition-all",[t.color==="blue"?"bg-blue-500":t.color==="green"?"bg-green-500":t.color==="red"?"bg-red-500":t.color==="yellow"?"bg-yellow-500":t.color==="purple"?"bg-purple-500":"bg-gray-500"]]),style:e.normalizeStyle({width:`${g.value}%`})},null,6)],2),e.createElementVNode("input",{id:c.value,ref_key:"sliderRef",ref:s,type:"range",value:t.modelValue,min:t.min,max:t.max,step:t.step,disabled:t.disabled,placeholder:t.placeholder,class:e.normalizeClass(f.value),onInput:k,onChange:y,onMousedown:p,onMouseup:E,onTouchstart:p,onTouchend:E},null,42,TC)]),t.marks.length>0?(e.openBlock(),e.createElementBlock("div",OC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.marks,x=>(e.openBlock(),e.createElementBlock("div",{key:x.value,class:"absolute flex flex-col items-center",style:e.normalizeStyle({left:`${_(x.value)}%`,transform:"translateX(-50%)"})},[w[0]||(w[0]=e.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),e.createElementVNode("span",FC,e.toDisplayString(x.label),1)],4))),128))])):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",zC,[w[1]||(w[1]=e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),e.createTextVNode(" "+e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("style"),{key:2},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(B.value),1)]),_:1})):e.createCommentVNode("",!0)],2)),[[e.vShow,u.value]])}}),RC={class:"grid gap-3"},LC={key:0,class:"ml-1 text-destructive"},$C={class:"inline-flex items-center gap-3"},jC=["id","name","aria-checked","aria-label","disabled"],WC={key:0,class:"absolute inset-0 flex items-center justify-center"},UC={class:"relative z-10 flex items-center gap-2"},HC=["id","name","aria-checked","aria-label","disabled"],qC={key:0,class:"absolute inset-0 flex items-center justify-center"},GC={name:"DCodeSwitch"},la=e.defineComponent({...GC,props:{modelValue:{type:Boolean,default:!1},label:{default:""},title:{default:"Title"},disabled:{type:Boolean,default:!1},size:{default:"medium"},color:{default:"primary"},loading:{type:Boolean,default:!1},labelPosition:{default:"right"},id:{},name:{},required:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!1},tooltipActiveText:{default:"Aktif"},tooltipInactiveText:{default:"Tidak Aktif"}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:f=>{!o.disabled&&!o.loading&&(r("update:modelValue",f),r("change",f))}}),s=e.computed(()=>{switch(o.size){case"small":return"w-9 h-5";case"large":return"w-14 h-7";default:return"w-11 h-6"}}),i=e.computed(()=>{switch(o.size){case"small":return"w-4 h-4";case"large":return"w-6 h-6";default:return"w-5 h-5"}}),l=e.computed(()=>{switch(o.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=e.computed(()=>{if(o.disabled)return"bg-gray-300";if(!a.value)return"bg-gray-200";switch(o.color){case"success":return"bg-green-500";case"warning":return"bg-yellow-500";case"danger":return"bg-red-500";default:return"bg-blue-500"}}),d=()=>{a.value=!a.value},u=e.computed(()=>a.value?o.tooltipActiveText:o.tooltipInactiveText);return(f,h)=>(e.openBlock(),e.createElementBlock("div",RC,[t.title?(e.openBlock(),e.createBlock(nr,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",LC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",$C,[e.createVNode(e.unref(pl),null,{default:e.withCtx(()=>[t.showTooltip?(e.openBlock(),e.createBlock(e.unref(hl),{key:0,"delay-duration":200},{default:e.withCtx(()=>[e.createVNode(e.unref(gl),{"as-child":""},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",id:t.id,name:t.name,"aria-checked":a.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:e.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[e.createElementVNode("span",{class:e.normalizeClass([i.value,a.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[t.loading?(e.openBlock(),e.createElementBlock("span",WC,[...h[0]||(h[0]=[e.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:e.withCtx(()=>[a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(ce.Check),{key:0,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(ce.X),{key:1,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):e.createCommentVNode("",!0)]),_:1})],2)],10,jC)]),_:1}),e.createVNode(e.unref(ml),{side:"top","side-offset":8,class:e.normalizeClass(["animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0",[a.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:e.withCtx(()=>[e.createElementVNode("span",UC,[e.createElementVNode("span",{class:e.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",a.value?"bg-green-200":"bg-gray-300"])},null,2),e.createTextVNode(" "+e.toDisplayString(u.value),1)])]),_:1},8,["class"])]),_:1})):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",id:t.id,name:t.name,"aria-checked":a.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:e.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[e.createElementVNode("span",{class:e.normalizeClass([i.value,a.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[t.loading?(e.openBlock(),e.createElementBlock("span",qC,[...h[1]||(h[1]=[e.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:e.withCtx(()=>[a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(ce.Check),{key:0,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(ce.X),{key:1,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):e.createCommentVNode("",!0)]),_:1})],2)],10,HC))]),_:1})])]))}}),XC=["aria-busy"],KC={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},YC=["for"],JC={key:0,class:"ml-1 text-destructive"},QC={class:"relative w-full group"},ZC=["id","value"],eE={key:0,class:"absolute top-1 right-2"},tE={key:1,class:"absolute top-full right-0 z-10 text-[11px] text-gray-500 dark:text-gray-400 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100"},nE={key:1,class:"text-xs text-destructive"},wo=e.defineComponent({name:"DCodeTextarea",inheritAttrs:!1,__name:"DCodeTextarea",props:{modelValue:{},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1},error:{default:null}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>o.label),i=e.computed(()=>a.visible??!0),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`app-textarea-${o.id||s.value||"field"}-${l}`),d=e.computed(()=>{const ee=o.required,z=o["aria-required"];return ee===""||ee===!0||ee==="true"||(z==="true"||z===!0)}),u=e.computed(()=>{const{label:ee,class:z,id:J,required:se,"aria-required":Ee,...ve}=o;return ve}),f=e.computed(()=>{const ee=o.maxlength;let z=Number.NaN;return typeof ee=="number"?z=ee:typeof ee=="string"&&(z=Number.parseInt(ee,10)),Number.isFinite(z)&&z>0?z:-1}),h=ee=>f.value>0?ee.slice(0,f.value):ee,m=e.computed(()=>{const ee=a.modelValue;return ee==null||String(ee).length===0}),g=e.computed(()=>a.clearable?a.hideClearWhenEmpty?!m.value:!0:!1),k=e.ref(String(a.modelValue??""));e.watch(()=>a.modelValue,ee=>{const z=String(ee??"");z!==k.value&&(k.value=z)});const y=e.ref(!1),p=e.ref(!1),E=ee=>ee.split(/(\s+)/).map(z=>{if(z.trim()==="")return z;const J=z.toLowerCase();return J.charAt(0).toUpperCase()+J.slice(1)}).join(""),_=ee=>{const z=ee.toLowerCase(),J=z.search(new RegExp("\\p{L}","u"));return J<0?z:z.slice(0,J)+z.charAt(J).toUpperCase()+z.slice(J+1)},B=ee=>{switch(a.textCase){case"uppercase":return ee.toUpperCase();case"lowercase":return ee.toLowerCase();case"titlecase":return E(ee);case"sentencecase":return _(ee);case"none":default:return ee}},S=e.computed(()=>{switch(a.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),w=ee=>{if(!ee)return null;const z=Array.isArray(ee)?ee.join(""):ee;return z?new Set(z):null},x=e.computed(()=>w(a.allowChars)),b=(ee,z)=>(ee.lastIndex=0,ee.test(z)),V=ee=>{if(ee===`
96
+ `)return a.valueType!=="number";if(a.valueType==="free")return!0;const z=ee===" ",J=/\d/.test(ee),se=new RegExp("\\p{L}","u").test(ee),Ee=new RegExp("\\p{N}","u").test(ee);return a.valueType==="number"?J:a.valueType==="letter"?se||a.allowSpaces&&z:a.valueType==="letternumber"?se||Ee||a.allowSpaces&&z:!0},A=ee=>{let z="";for(const J of ee){const se=!!x.value&&x.value.has(J);a.pattern&&!se&&!b(a.pattern,J)||!se&&!V(J)||(z+=J)}return z},D=ee=>{const z=A(ee),J=a.applyTextCaseToValue?B(z):z;return h(J)};let N=null;const P=ee=>{if(ee==="")return null;if(a.valueType==="number"&&a.returnNumber){const z=ee.replaceAll(`
97
+ `,""),J=Number(z);return Number.isFinite(J)?J:null}return ee},v=ee=>{k.value=ee,r("update:modelValue",P(ee))},Q=(ee,z)=>{const J=h(z);p.value=!0,ee.value=J,v(J),queueMicrotask(()=>p.value=!1)},$=(ee,z)=>{const J=ee.selectionStart??ee.value.length,se=ee.selectionEnd??ee.value.length;if(f.value>0){const Ee=ee.value.length-(se-J),ve=f.value-Ee;if(ve<=0)return;z=z.slice(0,ve)}ee.setRangeText(z,J,se,"end"),Q(ee,D(ee.value))},q=ee=>{var se;if(!N||y.value||p.value||!((se=ee.inputType)!=null&&se.startsWith("insert")))return;const z=ee.data;if(z==null)return;const J=D(z);J!==z&&(ee.preventDefault(),J.length>0&&$(N,J))},Y=ee=>{var se;if(!N||y.value||p.value)return;const z=((se=ee.clipboardData)==null?void 0:se.getData("text"))??"",J=D(z);J!==z&&(ee.preventDefault(),J.length>0&&$(N,J))},X=async ee=>{if(!N||y.value||p.value)return;const z=ee.target,J=z.value??"",se=D(J);if(se===J){const Ee=z.selectionStart??se.length,ve=z.selectionEnd??se.length;Q(z,se),await e.nextTick();try{z.setSelectionRange(Ee,ve)}catch{}v(se)}else{const Ee=z.selectionStart??se.length,ve=z.selectionEnd??se.length;Q(z,se),await e.nextTick();try{z.setSelectionRange(Ee,ve)}catch{}}},T=()=>y.value=!0,W=()=>{if(y.value=!1,!N)return;const ee=N.value??"",z=D(ee);z===ee?v(z):Q(N,z)};e.onMounted(()=>{if(N=document.getElementById(c.value),!N)return;N.addEventListener("beforeinput",q),N.addEventListener("paste",Y),N.addEventListener("input",X),N.addEventListener("compositionstart",T),N.addEventListener("compositionend",W);const ee=N.value??"",z=D(ee);z===ee?v(z):Q(N,z)}),e.onBeforeUnmount(()=>{N&&(N.removeEventListener("beforeinput",q),N.removeEventListener("paste",Y),N.removeEventListener("input",X),N.removeEventListener("compositionstart",T),N.removeEventListener("compositionend",W),N=null)});const ne=()=>{k.value="",N&&(N.value=""),r("update:modelValue",null),r("clear")},Z=e.computed(()=>k.value.length),K=e.computed(()=>a.showCharCount?f.value>0:!1),ae=e.computed(()=>K.value&&Z.value>0),ue=e.computed(()=>`${Z.value} / ${f.value}`),xe=e.computed(()=>!!a.error),De=e.computed(()=>{const ee=o.rows,z=typeof ee=="number"?ee:Number.parseInt(String(ee??""),10);return Number.isFinite(z)&&z>0?z:3}),we=e.computed(()=>({height:`${De.value*24+16}px`}));return(ee,z)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",KC)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:e.normalizeStyle(we.value)},null,4)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),d.value?(e.openBlock(),e.createElementBlock("span",JC,"*")):e.createCommentVNode("",!0)],8,YC)):e.createCommentVNode("",!0),e.createElementVNode("div",QC,[e.createElementVNode("textarea",e.mergeProps({id:c.value,value:k.value},u.value,{style:`text-transform: ${S.value}; padding-right: ${g.value?"2.5rem":"0.75rem"} !important; padding-left: 0.75rem !important;`,class:["flex min-h-[120px] w-full rounded-lg border py-2 bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",xe.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,ZC),g.value?(e.openBlock(),e.createElementBlock("div",eE,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:ne}," ✕ ")])):e.createCommentVNode("",!0),ae.value&&!xe.value?(e.openBlock(),e.createElementBlock("p",tE,e.toDisplayString(ue.value),1)):e.createCommentVNode("",!0)]),xe.value?(e.openBlock(),e.createElementBlock("p",nE,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,XC)),[[e.vShow,i.value]])}}),Kd=e.defineComponent({__name:"Avatar",props:{class:{type:[Boolean,null,String,Object,Array]},size:{default:"sm"},shape:{default:"circle"}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Se.AvatarRoot),{class:e.normalizeClass(e.unref(Ie)(e.unref(oE)({size:t.size,shape:t.shape}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["class"]))}}),Yd=e.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Se.AvatarFallback),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Jd=e.defineComponent({__name:"AvatarImage",props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Se.AvatarImage),e.mergeProps(n,{class:"h-full w-full object-cover"}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),oE=wr("inline-flex items-center justify-center font-normal text-foreground select-none shrink-0 bg-secondary overflow-hidden",{variants:{size:{sm:"h-10 w-10 text-xs",base:"h-16 w-16 text-2xl",lg:"h-32 w-32 text-5xl"},shape:{circle:"rounded-full",square:"rounded-md"}}}),ca=e.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Se.Separator),e.mergeProps(e.unref(o),{class:e.unref(Ie)("shrink-0 bg-border",n.orientation==="horizontal"?"h-px w-full":"w-px h-full",n.class)}),null,16,["class"]))}}),rE={class:"bg-card text-card-foreground"},aE={class:"pb-6 px-3"},sE={key:0,class:"flex justify-center p-8"},iE={key:1,class:"p-8 text-center text-red-500"},lE={key:2,class:"relative"},cE={class:"space-y-6"},dE={class:"rounded-xl border bg-card text-card-foreground shadow"},uE={class:"p-4"},fE={class:"flex items-center justify-between gap-3"},hE={class:"font-medium"},mE={class:"text-xs text-muted-foreground"},pE={class:"mt-1 text-sm text-muted-foreground"},gE={class:"text-foreground"},bE={class:"text-foreground"},yE={class:"mt-1 text-xs text-muted-foreground"},xE={key:0,class:"mt-3 flex items-center gap-2 text-sm"},kE={class:"flex items-center justify-between gap-3"},wE={class:"font-medium"},CE={class:"text-xs text-muted-foreground"},EE={class:"mt-2 text-sm text-muted-foreground"},BE={class:"flex flex-wrap items-center justify-between gap-3"},_E={class:"flex items-center gap-3"},SE={class:"leading-tight"},VE={class:"text-sm font-medium"},AE={class:"text-xs text-muted-foreground"},DE={class:"flex items-center gap-2"},NE={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},ME={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},vE=["src"],PE={class:"flex-1"},TE={class:"flex items-center justify-between gap-3"},OE={class:"font-medium"},FE={class:"text-xs text-muted-foreground"},zE={class:"mt-1 text-sm text-muted-foreground"},IE={class:"text-left sm:text-center"},RE={class:"text-xs text-muted-foreground"},LE={class:"text-left sm:text-center"},$E={class:"text-xs text-muted-foreground"},jE={class:"text-left sm:text-center"},WE={class:"text-xs text-muted-foreground"},UE={class:"flex items-center justify-between gap-3"},HE={class:"font-medium"},qE={class:"text-xs text-muted-foreground"},GE={class:"mt-2 text-sm text-muted-foreground"},XE={class:"mt-3 flex items-center gap-3"},KE={class:"text-sm font-medium"},YE={class:"flex items-start justify-between gap-3"},JE={class:"font-medium"},QE={class:"mt-3 grid gap-2 text-sm"},ZE={class:"flex items-center justify-between gap-3"},eB={class:"flex items-center gap-2 text-muted-foreground"},tB={class:"font-medium"},nB={class:"flex items-center justify-between gap-3"},oB={class:"flex items-center gap-2 text-muted-foreground"},rB={class:"font-medium"},aB={class:"flex items-center justify-between gap-3"},sB={class:"flex items-center gap-2 text-muted-foreground"},iB={class:"font-medium"},lB={class:"flex items-center justify-between"},cB={class:"flex items-center gap-2"},dB={class:"flex items-start justify-between gap-3"},uB={class:"flex items-center gap-2"},fB={class:"font-medium"},hB={class:"mt-2 text-sm text-muted-foreground"},mB={key:0,class:"mt-1 text-sm text-muted-foreground"},pB={class:"flex flex-wrap items-center justify-between gap-3"},gB={class:"flex items-center gap-2"},bB={class:"text-xs text-muted-foreground"},Qd=e.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiMethod:{}},setup(t){const o=lt.useBreakpoints(lt.breakpointsTailwind).smaller("md");e.ref(!1);const r=t,a=e.ref(!1),s=e.ref(null),i=e.ref([]),l=e.computed(()=>i.value.length>0?i.value:r.items&&r.items.length>0?r.items:[]),c=async()=>{if(r.apiUrl){a.value=!0,s.value=null;try{const f=await fetch(r.apiUrl,{method:r.apiMethod||"GET",headers:{"Content-Type":"application/json"}});if(!f.ok)throw new Error(`Error: ${f.status} ${f.statusText}`);const h=await f.json();Array.isArray(h)?i.value=h:h.data&&Array.isArray(h.data)?i.value=h.data:h.items&&Array.isArray(h.items)?i.value=h.items:i.value=[]}catch(f){console.error("Failed to fetch timeline items:",f),s.value=f.message||"Failed to fetch data"}finally{a.value=!1}}};e.onMounted(()=>{r.apiUrl&&c()}),e.watch(()=>r.apiUrl,()=>{r.apiUrl?c():i.value=[]});const d=f=>{switch(f){case"flight":return{Icon:ce.PlaneIcon,Circle:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:ce.ClockIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:ce.ShoppingCartIcon,Circle:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:ce.PencilIcon,Circle:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:ce.ServerIcon,Circle:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:ce.MapPinIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};default:return{Icon:ce.Circle,Circle:"bg-primary/10 text-primary border-primary/30"}}},u=f=>f.split(" ").filter(Boolean).slice(0,2).map(h=>{var m;return(m=h[0])==null?void 0:m.toUpperCase()}).join("");return(f,h)=>{const m=e.resolveComponent("ShoppingCart"),g=e.resolveComponent("DCodeBadge"),k=e.resolveComponent("RefreshCcw"),y=e.resolveComponent("MapPin");return e.openBlock(),e.createElementBlock("div",rE,[h[8]||(h[8]=e.createElementVNode("div",{class:"flex flex-col space-y-1.5 py-6 px-3"},[e.createElementVNode("h3",{class:"leading-none tracking-tight text-lg font-medium"},"Timeline With Icons")],-1)),e.createElementVNode("div",aE,[a.value?(e.openBlock(),e.createElementBlock("div",sE,[...h[0]||(h[0]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):s.value?(e.openBlock(),e.createElementBlock("div",iE,e.toDisplayString(s.value),1)):(e.openBlock(),e.createElementBlock("div",lE,[h[7]||(h[7]=e.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),e.createElementVNode("div",cE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(p,E)=>(e.openBlock(),e.createElementBlock("div",{key:E,class:"relative pl-14"},[e.createElementVNode("div",{class:e.normalizeClass(["absolute left-0 top-2 flex h-8 w-8 items-center justify-center rounded-full border",d(p.type).Circle])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d(p.type).Icon),{class:"h-4 w-4"}))],2),e.createElementVNode("div",dE,[e.createElementVNode("div",uE,[p.type==="flight"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",fE,[e.createElementVNode("p",hE,e.toDisplayString(p.title),1),e.createElementVNode("p",mE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",pE,[e.createElementVNode("span",gE,e.toDisplayString(p.from),1),e.createVNode(e.unref(ce.ArrowRight),{class:"mx-2 inline h-4 w-4"}),e.createElementVNode("span",bE,e.toDisplayString(p.to),1)]),e.createElementVNode("p",yE,e.toDisplayString(p.time),1),p.fileName?(e.openBlock(),e.createElementBlock("div",xE,[e.createVNode(e.unref(ce.FileText),{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("span",null,e.toDisplayString(p.fileName),1)])):e.createCommentVNode("",!0)],64)):p.type==="interview"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",kE,[e.createElementVNode("p",wE,e.toDisplayString(p.title),1),e.createElementVNode("p",CE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",EE,e.toDisplayString(p.desc),1),e.createVNode(e.unref(ca),{class:"my-4"}),e.createElementVNode("div",BE,[e.createElementVNode("div",_E,[e.createVNode(e.unref(Kd),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(Jd),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(Yd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("div",SE,[e.createElementVNode("p",VE,e.toDisplayString(p.personName),1),e.createElementVNode("p",AE,e.toDisplayString(p.personRole),1)])]),e.createElementVNode("div",DE,[e.createVNode(e.unref(Jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="product"?(e.openBlock(),e.createElementBlock("div",NE,[e.createElementVNode("div",ME,[p.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:0,src:p.imgUrl,class:"h-full w-full rounded-lg object-cover",alt:"product"},null,8,vE)):(e.openBlock(),e.createBlock(m,{key:1,class:"h-5 w-5 text-muted-foreground"}))]),e.createElementVNode("div",PE,[e.createElementVNode("div",TE,[e.createElementVNode("p",OE,e.toDisplayString(p.title),1),e.createElementVNode("p",FE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",zE,e.toDisplayString(p.desc),1),e.createElementVNode("div",{class:e.normalizeClass(["mt-4 grid gap-3",e.unref(o)?"grid-cols-1":"grid-cols-3"])},[e.createElementVNode("div",IE,[h[1]||(h[1]=e.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),e.createElementVNode("p",RE,e.toDisplayString(p.customer),1)]),e.createElementVNode("div",LE,[h[2]||(h[2]=e.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),e.createElementVNode("p",$E,e.toDisplayString(p.price),1)]),e.createElementVNode("div",jE,[h[3]||(h[3]=e.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),e.createElementVNode("p",WE,e.toDisplayString(p.qty),1)])],2)])])):p.type==="design"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",UE,[e.createElementVNode("p",HE,e.toDisplayString(p.title),1),e.createElementVNode("p",qE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",GE,e.toDisplayString(p.desc),1),e.createElementVNode("div",XE,[e.createVNode(e.unref(Kd),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(Jd),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(Yd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("p",KE,e.toDisplayString(p.personName),1)])],64)):p.type==="server"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",YE,[e.createElementVNode("p",JE,e.toDisplayString(p.title),1),e.createVNode(g,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText??""),1)]),_:2},1024)]),e.createElementVNode("div",QE,[e.createElementVNode("div",ZE,[e.createElementVNode("div",eB,[e.createVNode(e.unref(ce.Globe),{class:"h-4 w-4"}),h[4]||(h[4]=e.createElementVNode("span",null,"IP Address",-1))]),e.createElementVNode("span",tB,e.toDisplayString(p.ip),1)]),e.createElementVNode("div",nB,[e.createElementVNode("div",oB,[e.createVNode(e.unref(ce.Cpu),{class:"h-4 w-4"}),h[5]||(h[5]=e.createElementVNode("span",null,"CPU",-1))]),e.createElementVNode("span",rB,e.toDisplayString(p.cpu),1)]),e.createElementVNode("div",aB,[e.createElementVNode("div",sB,[e.createVNode(e.unref(ce.CpuIcon),{class:"h-4 w-4"}),h[6]||(h[6]=e.createElementVNode("span",null,"Memory",-1))]),e.createElementVNode("span",iB,e.toDisplayString(p.memory),1)])]),e.createVNode(e.unref(ca),{class:"my-4"}),e.createElementVNode("div",lB,[e.createElementVNode("div",cB,[e.createVNode(e.unref(Jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.Share2),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(k,{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="location"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("div",dB,[e.createElementVNode("div",uB,[e.createVNode(y,{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("p",fB,e.toDisplayString(p.title),1)]),e.createVNode(g,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText),1)]),_:2},1024)]),e.createElementVNode("p",hB,e.toDisplayString(p.desc1),1),p.desc2?(e.openBlock(),e.createElementBlock("p",mB,e.toDisplayString(p.desc2),1)):e.createCommentVNode("",!0),e.createVNode(e.unref(ca),{class:"my-4"}),e.createElementVNode("div",pB,[e.createElementVNode("div",gB,[e.createVNode(e.unref(Jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.Link),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.User),{class:"h-4 w-4"})]),_:1})]),e.createElementVNode("p",bB,"Due date: "+e.toDisplayString(p.due),1)])],64)):e.createCommentVNode("",!0)])])]))),128))])]))])])}}}),yB={class:"dcode-upload-file"},xB={class:"border-2 border-dashed border-gray-300 dark:border-gray-700 rounded-lg p-6 flex flex-col items-center justify-center text-center hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors cursor-pointer"},kB={key:0,class:"text-xs text-gray-500 mt-1"},wB=["accept"],CB={key:1,class:"text-xs text-red-600 mt-1"},Zd=e.defineComponent({name:"DCodeUploadFile",__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=n,r=a=>{var i;const s=(i=a.target.files)==null?void 0:i[0];s&&o("update:modelValue",s)};return(a,s)=>(e.openBlock(),e.createElementBlock("div",yB,[t.label?(e.openBlock(),e.createBlock(ko,{key:0,label:t.label},null,8,["label"])):e.createCommentVNode("",!0),e.createElementVNode("div",xB,[e.createVNode(e.unref(ce.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=e.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[e.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),e.createTextVNode(" or drag and drop ")],-1)),t.accept?(e.openBlock(),e.createElementBlock("p",kB,e.toDisplayString(t.accept),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"file",class:"hidden",onChange:r,accept:t.accept},null,40,wB)]),t.errorMessage?(e.openBlock(),e.createElementBlock("p",CB,e.toDisplayString(t.errorMessage),1)):e.createCommentVNode("",!0)]))}}),EB=["onClick"],BB={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},_B={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},SB={key:1},VB={key:0,class:"text-white"},AB={key:1},DB={key:2},NB=["disabled","onClick"],MB={key:1,class:"mr-2 text-sm font-bold opacity-70"},vB={class:"whitespace-normal text-sm text-center leading-tight"},PB={class:"flex flex-col flex-1 min-w-0"},TB={class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground flex items-center gap-2"},OB={class:"text-sm text-muted-foreground"},FB={class:"px-1"},zB=["disabled"],IB=["type"],RB=["disabled"],Qs=Ot(e.defineComponent({name:"DCodeWizard",__name:"DCodeWizard",props:{tabs:{},modelValue:{},defaultTab:{default:0},allowTabClick:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},cache:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!0},apiOptions:{type:[Object,Function],default:void 0},isVertical:{type:Boolean,default:!1},isWizard:{type:Boolean,default:!1},typeWizard:{default:"icon"},showNavigation:{type:Boolean,default:!0},submitText:{default:"Simpan"},loading:{type:Boolean,default:!1},isSubmit:{type:Boolean,default:!1}},emits:["update:modelValue","change","loaded","error"],setup(t,{emit:n}){const o=t,r=n,a=ft(),s=a==null?void 0:a.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const i=e.ref(o.defaultTab),l=e.computed({get(){var x;if(typeof o.modelValue=="string"){const b=(x=o.tabs)==null?void 0:x.findIndex(V=>V.key===o.modelValue);if(b!==void 0&&b>=0)return b}return(typeof o.modelValue=="number"?o.modelValue:void 0)??i.value},set(x){var b;if(i.value=x,typeof o.modelValue=="string"){const V=(b=o.tabs)==null?void 0:b[x];V?r("update:modelValue",V.key):r("update:modelValue",x)}else r("update:modelValue",x)}}),c=e.computed(()=>{var x;return((x=o.tabs)==null?void 0:x.length)??0}),d=e.computed(()=>{var x;return(x=o.tabs)==null?void 0:x[l.value]});function u(x){return c.value<=0?0:Math.min(Math.max(x,0),c.value-1)}function f(x){return x?typeof x=="string"?Gt[x]||null:x:null}const h=e.reactive({});function m(x){return h[x.key]||(h[x.key]={loaded:!1,loading:!1,data:null,error:null}),h[x.key]}function g(){if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions}function k(x){const b=x.endpoint||{};return{apiModule:x.apiModule||b.apiModule,apiAction:x.apiAction||b.apiAction,apiUrl:b.apiUrl,apiMethod:b.apiMethod||"GET",apiParams:x.apiParams}}function y(x){if(o.isWizard||!o.allowTabClick||o.disabled)return!1;const b=o.tabs[x];return!(!b||b.disabled)}async function p(x){if(typeof x.tab.fetchData=="function"){const v=await x.tab.fetchData(),Q=(v==null?void 0:v.data)??v;return(Q==null?void 0:Q.data)??Q}const b=k(x.tab);if(!(b.apiModule&&b.apiAction||b.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const A=g();let D;if(b.apiUrl)D=await s("","",A,{_url:b.apiUrl,_method:b.apiMethod,_data:b.apiParams??void 0});else{const v={...A,...b.apiParams};D=await s(b.apiModule,b.apiAction,v)}const N=(D==null?void 0:D.data)??D;return(N==null?void 0:N.data)??N}async function E(x,{force:b=!1}={}){const V=u(x),A=o.tabs[V];if(!A)return;const D=m(A);if(!(o.cache&&D.loaded&&!b)&&!D.loading){D.loading=!0,D.error=null;try{const N=await p({tabIndex:V,tab:A});D.data=N,D.loaded=!0,r("loaded",{tabIndex:V,tab:A,data:N})}catch(N){const P=typeof(N==null?void 0:N.message)=="string"&&N.message||typeof N=="string"&&N||"Failed to load tab data.";D.error=P,r("error",{tabIndex:V,tab:A,message:P})}finally{D.loading=!1}}}function _(x){const b=u(x);y(b)&&b!==l.value&&(l.value=b)}function B(x=l.value){return E(x,{force:!0})}function S(){const x=u(l.value-1);x!==l.value&&(l.value=x)}function w(){const x=u(l.value+1);x!==l.value&&(l.value=x)}return e.watch(()=>o.tabs,x=>{for(const b of x??[])m(b)},{immediate:!0}),e.watch(()=>l.value,async x=>{var V;const b=(V=o.tabs)==null?void 0:V[x];b&&r("change",{tabIndex:x,tab:b}),await E(x)},{immediate:!0}),e.watch(()=>o.autoFetchOnMount,async x=>{x&&await E(l.value)},{immediate:!0}),(x,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full rounded-lg border bg-card text-card-foreground shadow-sm",{"flex flex-row":t.isVertical}])},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col space-y-1.5 p-6",{"w-64 border-r pr-0":t.isVertical,"pb-2":t.isWizard&&!t.isVertical}])},[e.createElementVNode("div",{class:e.normalizeClass({"mt-4":!t.isVertical||t.isWizard})},[t.isWizard?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["w-full relative flex overflow-visible rounded-lg",t.isVertical?"flex-col gap-2":""])},[t.isVertical?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.tabs,(V,A)=>(e.openBlock(),e.createElementBlock("div",{key:V.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[e.createElementVNode("div",{class:e.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-card",[A<l.value?"wizard-num-done":"",A===l.value?"wizard-num-active":A>l.value?"wizard-num-pending":""]])},[t.typeWizard==="icon"&&V.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(V.icon)),{key:0,class:"w-4 h-4"})):t.typeWizard==="number"||!V.icon&&t.typeWizard!=="none"?(e.openBlock(),e.createElementBlock("span",SB,[A<l.value?(e.openBlock(),e.createElementBlock("span",VB,"✓")):(e.openBlock(),e.createElementBlock("span",AB,e.toDisplayString(A+1),1))])):(e.openBlock(),e.createElementBlock("span",DB))],2),e.createElementVNode("span",{class:e.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",A===l.value?"wizard-text-active":"wizard-text-pending"])},e.toDisplayString(V.title),3)]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.tabs,(V,A)=>(e.openBlock(),e.createElementBlock("div",{key:V.key,onClick:D=>_(A),style:e.normalizeStyle({zIndex:t.tabs.length-A}),class:"relative flex-1 group"},[e.createElementVNode("div",{class:e.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[A>0?"pl-8":"",A===l.value?"wizard-step-active":A<l.value?"wizard-step-done":"wizard-step-pending"]])},[t.typeWizard==="icon"&&V.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(V.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",BB,e.toDisplayString(A+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",_B,e.toDisplayString(V.title),1)],2),A<t.tabs.length-1?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["absolute top-0 -right-[15.5px] w-[16px] h-full transition-colors block z-10",[A===l.value?"wizard-svg-active":A<l.value?"wizard-svg-done":"wizard-svg-pending"]]),preserveAspectRatio:"none",viewBox:"0 0 16 48"},[...b[0]||(b[0]=[e.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):e.createCommentVNode("",!0)],12,EB))),128))],2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex w-full",t.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tabs,(V,A)=>(e.openBlock(),e.createElementBlock("button",{key:V.key,type:"button",disabled:!y(A),onClick:D=>_(A),class:e.normalizeClass(["relative min-h-[3rem] h-auto py-2 flex items-center justify-center gap-2 px-4 transition-all rounded-none focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 wizard-btn-common",e.unref(Ie)("border-b border-r",!t.isVertical&&A===t.tabs.length-1&&"border-r-0",A===l.value?"wizard-btn-active":"wizard-btn-pending",!y(A)&&"opacity-60 cursor-not-allowed",t.isVertical?"w-full justify-start border-r-0":"flex-1")])},[t.typeWizard==="icon"&&V.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(V.icon)),{key:0,class:"h-4 w-4 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",MB,e.toDisplayString(A+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",vB,e.toDisplayString(V.title),1)],10,NB))),128))],2))],2)],2),t.isVertical?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(ca),{key:0})),e.createElementVNode("div",PB,[e.createElementVNode("div",{class:e.normalizeClass(["p-6 flex-1 min-w-0",{"pl-6":t.isVertical}])},[e.createVNode(e.Transition,{name:"wizard-fade",mode:"out-in"},{default:e.withCtx(()=>{var V,A,D,N;return[(e.openBlock(),e.createElementBlock("div",{key:((V=d.value)==null?void 0:V.key)||l.value,class:"w-full"},[d.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(A=h[d.value.key])!=null&&A.loading?e.renderSlot(x.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[e.createElementVNode("div",TB,[e.createVNode(e.unref(ce.Loader2),{class:"w-4 h-4 animate-spin"}),b[1]||(b[1]=e.createTextVNode(" Loading... ",-1))])],!0):e.renderSlot(x.$slots,`tab-${d.value.key}`,{key:1,tab:d.value,tabIndex:l.value,data:(D=h[d.value.key])==null?void 0:D.data,loaded:(N=h[d.value.key])==null?void 0:N.loaded,reload:B},()=>[e.createElementVNode("div",OB,[b[2]||(b[2]=e.createTextVNode(" Slot ",-1)),e.createElementVNode("code",FB,"tab-"+e.toDisplayString(d.value.key),1),b[3]||(b[3]=e.createTextVNode(" belum dibuat. ",-1))])],!0)],64)):e.createCommentVNode("",!0)]))]}),_:3})],2),t.isWizard||t.showNavigation?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex items-center justify-between p-6 pt-0",{"pl-6":t.isVertical}])},[e.createElementVNode("button",{type:"button",onClick:S,disabled:l.value<=0,class:"relative inline-flex items-center justify-center gap-2 px-5 py-2.5 text-sm font-medium transition-all duration-300 rounded-lg bg-[#ffffff] border border-[#e2e8f0] text-[#334155] shadow-sm hover:bg-[#f8fafc] hover:text-[#0f172a] hover:-translate-y-0.5 hover:shadow disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#ffffff] disabled:hover:text-[#334155] disabled:hover:translate-y-0 disabled:active:scale-100 dark:bg-[#18181b] dark:border-[#27272a] dark:text-[#d4d4d8] dark:hover:bg-[#27272a] dark:hover:border-[#3f3f46] dark:disabled:hover:bg-[#18181b] dark:disabled:hover:text-[#d4d4d8] focus:outline-none focus:ring-2 focus:ring-[#e2e8f0] focus:ring-offset-2 active:scale-95"}," Sebelumnya ",8,zB),l.value<c.value-1?(e.openBlock(),e.createElementBlock("button",{key:0,type:t.isSubmit?"submit":"button",onClick:w,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#ffffff] transition-all duration-300 rounded-lg shadow-md bg-[#2563eb] hover:bg-[#1d4ed8] hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#2563eb] disabled:hover:translate-y-0 disabled:active:scale-100 focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"}," Selanjutnya ",8,IB)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"submit",disabled:t.loading,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#ffffff] transition-all duration-300 rounded-lg shadow-md bg-[#2563eb] hover:bg-[#1d4ed8] hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#2563eb] disabled:hover:translate-y-0 disabled:active:scale-100 dark:bg-[#3b82f6] dark:hover:bg-[#2563eb] focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"},[t.loading?(e.openBlock(),e.createBlock(e.unref(ce.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.submitText),1)],8,RB))],2)):e.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-9e7a4e21"]]),LB={class:"permission-menu w-full space-y-4"},$B={class:"bg-neutral-50/50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 text-neutral-900 dark:text-neutral-100 p-4"},jB={class:"flex items-center justify-between"},WB={class:"flex items-center gap-3 flex-1"},UB=["onClick"],HB={key:1,class:"w-7"},qB={key:2,class:"flex-shrink-0"},GB={class:"text-lg font-semibold flex-1"},XB={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},KB={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},YB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},JB=["checked","disabled","onChange"],QB={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},ZB={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},e_={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},t_={class:"bg-neutral-50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 text-neutral-900 dark:text-neutral-100 p-3"},n_={class:"flex items-center justify-between"},o_={class:"flex items-center gap-3 flex-1"},r_={key:0,class:"flex-shrink-0"},a_={class:"text-base font-semibold flex-1"},s_={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},i_={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},l_=["checked","onChange"],c_={class:"text-xs font-medium"},d_={key:0,class:"p-3"},u_={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},f_=["checked","disabled","onChange"],h_={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},Zs=Ot(e.defineComponent({__name:"DCodePermissionMenu",props:{menuList:{default:()=>[]},enableParentControl:{type:Boolean,default:!1},showIcons:{type:Boolean,default:!0},modelValue:{default:()=>[]},treeData:{default:()=>[]}},emits:["permission-change","menu-check","update:modelValue"],setup(t,{expose:n,emit:o}){const{t:r}=$t.useI18n(),a=t,s=o,i=e.computed(()=>a.menuList&&a.menuList.length>0?a.menuList:a.treeData||[]),l=e.ref(new Map),c=e.ref(new Set),d=(A=!0)=>{(N=>{N.forEach(P=>{P.permission.forEach(v=>{const Q=`${P.id}-${v.id}-parent`,$=v.code==="VIEW"||v.name.toUpperCase()==="VIEW";l.value.has(Q)||l.value.set(Q,$||(A?P.checked??!1:!1))}),P.detail&&P.detail.length>0&&P.detail.forEach(v=>{v.permission.forEach(Q=>{const $=`${v.id}-${Q.id}-child`,q=Q.code==="VIEW"||Q.name.toUpperCase()==="VIEW";l.value.has($)||l.value.set($,q||(A?v.checked??!1:!1))})})})})(i.value)},u=()=>{console.log("[DCodePermissionMenu] initializeFromModelValue called. modelValue:",a.modelValue),l.value.clear(),d(!1),a.modelValue&&a.modelValue.length>0&&a.modelValue.forEach(A=>{const D=A.menuId,N=A.actionsIds;i.value.forEach(P=>{P.id===D&&N.forEach(v=>{const Q=`${D}-${v}-parent`;l.value.set(Q,!0)}),P.detail&&P.detail.length>0&&P.detail.forEach(v=>{v.id===D&&N.forEach(Q=>{const $=`${D}-${Q}-child`;l.value.set($,!0)})})})})};u(),e.watch(()=>a.modelValue,()=>{u()},{deep:!0}),e.watch(()=>i.value.length,(A,D)=>{D===0&&A>0&&u()});const f=A=>A.detail&&A.detail.length>0,h=A=>{c.value.has(A)?c.value.delete(A):c.value.add(A)},m=A=>c.value.has(A),g=(A,D,N=!1)=>{const P=`${A}-${D}-${N?"child":"parent"}`;return l.value.get(P)??!1},k=()=>{const A=w();s("update:modelValue",A.permissions)},y=(A,D,N,P=!1)=>{const v=N.target.checked,Q=`${A}-${D}-${P?"child":"parent"}`;l.value.set(Q,v),s("permission-change",A,D,v,!P),k()},p=A=>A.permission.filter(E),E=A=>A.code==="VIEW"||A.name.toUpperCase()==="VIEW",_=(A,D,N)=>{const P=N.target.checked;D.permission.forEach(v=>{if(E(v)){const $=`${D.id}-${v.id}-child`;l.value.set($,!0);return}const Q=`${D.id}-${v.id}-child`;l.value.set(Q,P)}),l.value=new Map(l.value),s("menu-check",D.id,P),k()},B=(A,D=!1)=>{const N=D?A.permission:p(A);return!N||N.length===0?!1:N.every(P=>{const v=`${A.id}-${P.id}-${D?"child":"parent"}`;return l.value.get(v)??!1})},S=()=>{const A={};return i.value.forEach(D=>{var N;A[D.id]={name:D.name,parentPermissions:D.permission.map(P=>({id:P.id,name:P.name,checked:g(D.id,P.id,!1)})),children:((N=D.detail)==null?void 0:N.map(P=>({id:P.id,name:P.name,permissions:P.permission.map(v=>({id:v.id,name:v.name,checked:g(P.id,v.id,!0)}))})))||[]}}),A},w=()=>{const A=[],D=(N,P=!1)=>{const v=[];N.permission.forEach(Q=>{const $=`${N.id}-${Q.id}-${P?"child":"parent"}`;(l.value.get($)??!1)&&v.push(Q.id)}),v.length>0&&A.push({menuId:N.id,actionsIds:v})};return i.value.forEach(N=>{D(N,!1),N.detail&&N.detail.length>0&&N.detail.forEach(P=>{D(P,!0)})}),{permissions:A}};return n({getCurrentStates:S,getPermissionsForDatabase:w,getAllPermissionsWithStatus:()=>{const A=[],D=(N,P=!1)=>{const v=N.permission.map($=>{const q=`${N.id}-${$.id}-${P?"child":"parent"}`,Y=l.value.get(q)??!1;return{id:$.id,name:$.name,checked:Y}}),Q=v.filter($=>$.checked).map($=>$.id);A.push({menuId:N.id,menuName:N.name,actionsIds:Q,actions:v})};return i.value.forEach(N=>{D(N,!1),N.detail&&N.detail.length>0&&N.detail.forEach(P=>{D(P,!0)})}),{permissions:A}},permissionStates:l,expandAll:()=>{i.value.forEach(A=>{f(A)&&c.value.add(A.id)})},collapseAll:()=>{c.value.clear()}}),(A,D)=>(e.openBlock(),e.createElementBlock("div",LB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,N=>(e.openBlock(),e.createElementBlock("div",{key:N.id,class:e.normalizeClass(["dcode-card overflow-hidden",{"border-l-4 border-l-blue-500":f(N)}])},[e.createElementVNode("div",$B,[e.createElementVNode("div",jB,[e.createElementVNode("div",WB,[f(N)?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:P=>h(N.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[m(N.id)?(e.openBlock(),e.createBlock(e.unref(ce.ChevronDown),{key:0,class:"w-5 h-5"})):(e.openBlock(),e.createBlock(e.unref(ce.ChevronRight),{key:1,class:"w-5 h-5"}))],8,UB)):(e.openBlock(),e.createElementBlock("div",HB)),t.showIcons&&N.icon?(e.openBlock(),e.createElementBlock("span",qB,[e.createElementVNode("i",{class:e.normalizeClass([N.icon,"text-2xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h3",GB,e.toDisplayString(N.name),1)])])]),N.permission&&N.permission.length>0&&!f(N)?(e.openBlock(),e.createElementBlock("div",XB,[e.createElementVNode("h4",KB,e.toDisplayString(e.unref(r)("common.permissions"))+": ",1),e.createElementVNode("div",YB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p(N),P=>(e.openBlock(),e.createElementBlock("label",{key:P.id,class:"flex items-center gap-2 px-3 py-2 bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700/50 rounded-lg cursor-pointer hover:border-blue-400 dark:hover:border-primary-500 hover:bg-blue-50 dark:hover:bg-neutral-900/50 transition-all group"},[e.createElementVNode("input",{type:"checkbox",checked:E(P)||g(N.id,P.id,!1),disabled:E(P),onChange:v=>y(N.id,P.id,v,!1),class:e.normalizeClass(["w-4 h-4 text-blue-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-blue-500 dark:focus:ring-blue-600",E(P)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,JB),e.createElementVNode("span",QB,e.toDisplayString(P.name),1)]))),128))])])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-[5000px]","leave-active-class":"transition-all duration-300 ease-in","leave-from-class":"opacity-100 max-h-[5000px]","leave-to-class":"opacity-0 max-h-0"},{default:e.withCtx(()=>[f(N)&&m(N.id)?(e.openBlock(),e.createElementBlock("div",ZB,[e.createElementVNode("h4",e_,[D[0]||(D[0]=e.createElementVNode("span",{class:"w-1 h-4 bg-blue-500 rounded"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("common.subMenus")),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.detail,P=>(e.openBlock(),e.createElementBlock("div",{key:P.id,class:"bg-white dark:bg-neutral-800 rounded-lg border border-gray-200 dark:border-neutral-700/50 overflow-hidden shadow-sm hover:shadow transition-shadow"},[e.createElementVNode("div",t_,[e.createElementVNode("div",n_,[e.createElementVNode("div",o_,[t.showIcons&&P.icon?(e.openBlock(),e.createElementBlock("span",r_,[e.createElementVNode("i",{class:e.normalizeClass([P.icon,"text-xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h5",a_,e.toDisplayString(P.name),1),P.path?(e.openBlock(),e.createElementBlock("span",s_,e.toDisplayString(P.path),1)):e.createCommentVNode("",!0),e.createElementVNode("label",i_,[e.createElementVNode("input",{type:"checkbox",checked:B(P,!0),onChange:v=>_(N,P,v),class:"w-3.5 h-3.5 text-pink-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-pink-500 dark:focus:ring-pink-600 cursor-pointer"},null,40,l_),e.createElementVNode("span",c_,e.toDisplayString(e.unref(r)("common.selectAll")),1)])])])]),P.permission&&P.permission.length>0?(e.openBlock(),e.createElementBlock("div",d_,[e.createElementVNode("div",u_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.permission,v=>(e.openBlock(),e.createElementBlock("label",{key:v.id,class:"flex items-center gap-2 px-2.5 py-1.5 bg-gray-50 dark:bg-zinc-900/50 border border-gray-200 dark:border-neutral-700 rounded-md cursor-pointer hover:border-pink-400 dark:hover:border-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/20 transition-all group"},[e.createElementVNode("input",{type:"checkbox",checked:E(v)||g(P.id,v.id,!0),disabled:E(v),onChange:Q=>y(P.id,v.id,Q,!0),class:e.normalizeClass(["w-3.5 h-3.5 text-pink-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-pink-500 dark:focus:ring-pink-600",E(v)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,f_),e.createElementVNode("span",h_,e.toDisplayString(v.name),1)]))),128))])])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-40ddf81d"]]),m_={class:"space-y-4"},p_={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},g_={key:0,class:"text-danger-500"},b_={key:1,class:"flex items-center justify-center p-8 bg-white dark:bg-gray-800 rounded-lg shadow"},y_={class:"text-neutral-600 dark:text-neutral-400"},x_={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},k_={class:"text-neutral-500 dark:text-neutral-400"},w_={key:3,class:"space-y-3"},C_={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},E_={class:"flex items-center gap-3"},B_={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},__={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},S_={class:"flex items-center gap-2 text-sm font-medium"},V_={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},A_={class:"p-4"},D_={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},N_={class:"ml-2 flex-1 min-w-0"},M_=["for"],v_={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},P_={key:4,class:"mt-1 text-xs text-danger-600"},ei=e.defineComponent({__name:"DCodeTreePermissions",props:{modelValue:{},label:{},required:{type:Boolean},disabled:{type:Boolean},error:{},treeData:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,{t:a}=$t.useI18n(),s=e.ref(!0),i=e.ref([]),l=e.ref({}),c=e.ref([]),d=e.ref({}),u=p=>{if(console.log(p),!p)return[];if(Array.isArray(p)&&p.length>0&&p[0].module&&Array.isArray(p[0].permissions))return p.map(E=>({menuId:E.menuId,module:E.module,label:E.label||E.module,permissions:E.permissions}));if(Array.isArray(p)&&p.length>0&&p[0].key){const E={};return p.forEach(_=>{const B=_.key,S=B&&B.includes(".")?B.split(".")[0]:"other";E[S]||(E[S]={menuId:0,module:S,label:S,permissions:[]}),E[S].permissions.push({id:_.id,key:_.key,label:_.label,description:_.description})}),Object.values(E)}if(Array.isArray(p)&&p.length>0&&p[0].id&&p[0].name&&Array.isArray(p[0].permission)){const E=[],_=(B,S="")=>{const w=S?`${S}.${B.name}`:B.name,x=w.toLowerCase().replace(/\s+/g,"_"),b=[];if(B.detail&&Array.isArray(B.detail)&&B.detail.forEach(V=>{b.push(V.id)}),B.permission&&B.permission.length>0){const V=B.permission.map(A=>({id:A.id,key:`${x}.${A.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${A.name} ${B.name}`,description:`Permission to ${A.name.toLowerCase()} ${B.name.toLowerCase()}`}));E.push({menuId:B.id,module:x,label:B.name,permissions:V,subMenuIds:b.length>0?b:void 0})}B.detail&&Array.isArray(B.detail)&&B.detail.forEach(V=>{_(V,w)})};return p.forEach(B=>_(B)),E}return p.data?u(p.data):[]},f=async()=>{s.value=!0;try{let p;o.treeData&&o.treeData.length>0?p=o.treeData:p=[];const E=u(p);i.value=E;const _={},B=[],S={};E.forEach(x=>{x.permissions.forEach(b=>{const V=typeof b.id=="string"?parseInt(b.id):b.id;S[V]=x.menuId})});const w=new Set;o.modelValue&&Array.isArray(o.modelValue)&&o.modelValue.forEach(x=>{B.push(x.menuId),x.actionsIds&&Array.isArray(x.actionsIds)&&x.actionsIds.forEach(b=>w.add(b))}),E.forEach(x=>x.permissions.forEach(b=>{const V=typeof b.id=="string"?parseInt(b.id):b.id;_[V]=w.has(V)})),l.value=_,c.value=B,d.value=S}catch{i.value=[]}finally{s.value=!1}},h=p=>p.permissions.filter(E=>{const _=typeof E.id=="string"?parseInt(E.id):E.id;return l.value[_]}).length,m=p=>p.permissions.every(E=>{const _=typeof E.id=="string"?parseInt(E.id):E.id;return l.value[_]}),g=p=>{const E=h(p);return E>0&&E<p.permissions.length},k=e.ref(!1),y=(p,E)=>{k.value=!0,p.permissions.map(S=>typeof S.id=="string"?parseInt(S.id):S.id),p.permissions.forEach(S=>{const w=typeof S.id=="string"?parseInt(S.id):S.id;l.value[w]=E});let _=o.modelValue?[...o.modelValue]:[],B=[p.menuId];p.subMenuIds&&p.subMenuIds.length>0&&(B=[...B,...p.subMenuIds],p.subMenuIds.forEach(S=>{const w=i.value.find(x=>x.menuId===S);w&&w.permissions.forEach(x=>{const b=typeof x.id=="string"?parseInt(x.id):x.id;l.value[b]=E})})),E?B.forEach(S=>{const w=i.value.find(x=>x.menuId===S);if(w){const x=w.permissions.map(V=>typeof V.id=="string"?parseInt(V.id):V.id),b=_.findIndex(V=>V.menuId===S);b!==-1?_[b]={menuId:S,actionsIds:x}:_.push({menuId:S,actionsIds:x})}}):_=_.filter(S=>!B.includes(S.menuId)),c.value=_.map(S=>S.menuId),console.log("Full Result:",JSON.stringify(_,null,2)),r("update:modelValue",_),setTimeout(()=>{k.value=!1},100)};return e.watch(()=>o.modelValue,p=>{if(!p)return;const E=new Set,_=[];p.forEach(B=>{_.push(B.menuId),B.actionsIds&&Array.isArray(B.actionsIds)&&B.actionsIds.forEach(S=>E.add(S))}),Object.keys(l.value).forEach(B=>{const S=parseInt(B);l.value[S]=E.has(S)}),c.value=_}),e.watch(()=>o.treeData,p=>{p&&p.length>0&&f()},{deep:!0}),e.watch(l,(p,E)=>{if(k.value)return;if(Object.keys(p).map(B=>parseInt(B)).filter(B=>p[B]!==(E==null?void 0:E[B])).length>0){let B=o.modelValue?[...o.modelValue]:[];const S={};Object.keys(p).forEach(w=>{const x=parseInt(w);if(p[x]){const b=d.value[x];console.log(`Permission ${x} belongs to Menu ${b}`),b!==void 0&&(S[b]||(S[b]=[]),S[b].push(x))}}),Object.keys(S).forEach(w=>{const x=parseInt(w),b=S[x],V=B.findIndex(A=>A.menuId===x);V!==-1?B[V]={menuId:x,actionsIds:b}:B.push({menuId:x,actionsIds:b})}),B=B.filter(w=>S[w.menuId]&&S[w.menuId].length>0),c.value=B.map(w=>w.menuId),console.log("Result:",JSON.stringify(B,null,2)),r("update:modelValue",B)}},{deep:!0}),e.onMounted(f),(p,E)=>(e.openBlock(),e.createElementBlock("div",m_,[t.label?(e.openBlock(),e.createElementBlock("label",p_,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",g_,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",b_,[e.createVNode(e.unref(ce.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),e.createElementVNode("span",y_,e.toDisplayString(e.unref(a)("common.loadingPermissions")),1)])):i.value.length===0?(e.openBlock(),e.createElementBlock("div",x_,[e.createElementVNode("p",k_,e.toDisplayString(e.unref(a)("common.noPermissions")),1)])):(e.openBlock(),e.createElementBlock("div",w_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,_=>(e.openBlock(),e.createElementBlock("div",{key:_.module,class:"bg-white dark:bg-neutral-800 rounded-lg border border-neutral-200/60 dark:border-neutral-700/50 shadow-sm hover:shadow-md transition-shadow"},[e.createElementVNode("div",C_,[e.createElementVNode("div",E_,[e.createVNode(Cn,{modelValue:m(_),indeterminate:g(_),"onUpdate:modelValue":B=>y(_,!!B),disabled:t.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),e.createElementVNode("div",null,[e.createElementVNode("div",B_,e.toDisplayString(_.label||_.module),1),e.createElementVNode("div",__,e.toDisplayString(h(_))+" "+e.toDisplayString(e.unref(a)("common.from"))+" "+e.toDisplayString(_.permissions.length)+" "+e.toDisplayString(e.unref(a)("common.selected")),1)])]),e.createElementVNode("div",S_,[e.createElementVNode("div",V_,e.toDisplayString(h(_))+"/"+e.toDisplayString(_.permissions.length),1)])]),e.createElementVNode("div",A_,[e.createElementVNode("div",D_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.permissions,B=>(e.openBlock(),e.createElementBlock("div",{key:B.id,class:"flex items-start p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"},[e.createVNode(Cn,{modelValue:l.value[typeof B.id=="string"?parseInt(B.id):B.id],"onUpdate:modelValue":S=>l.value[typeof B.id=="string"?parseInt(B.id):B.id]=S,disabled:t.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),e.createElementVNode("div",N_,[e.createElementVNode("label",{for:`perm-${B.id}`,class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer block"},e.toDisplayString(B.label||B.key),9,M_),B.description?(e.openBlock(),e.createElementBlock("p",v_,e.toDisplayString(B.description),1)):e.createCommentVNode("",!0)])]))),128))])])]))),128))])),t.error?(e.openBlock(),e.createElementBlock("p",P_,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),T_=(t,n="short",o="id-ID")=>{const r=typeof t=="string"?new Date(t):t,a=c=>String(c).padStart(2,"0"),s=c=>`${a(c.getHours())}:${a(c.getMinutes())}:${a(c.getSeconds())}`,l={id:"id-ID",en:"en-GB"}[o]||o;return n==="time"?s(r):n==="datetime"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(r):n==="long"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(r):new Intl.DateTimeFormat(l,{day:"2-digit",month:"short",year:"numeric"}).format(r)},O_=t=>new Promise((n,o)=>{const r=document.createElement("textarea");r.value=t,r.style.top="0",r.style.left="0",r.style.position="fixed",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy")?n():o(new Error("Copy command was unsuccessful"))}catch(a){o(a)}finally{document.body.removeChild(r)}}),F_=async t=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(t):O_(t),z_={key:0,class:"fixed inset-0 z-[100] flex justify-end"},I_={key:0,class:"relative w-full max-w-sm h-full bg-white dark:bg-slate-900 shadow-2xl flex flex-col border-l border-gray-200 dark:border-gray-800"},R_={class:"px-6 py-4 border-b border-gray-100 dark:border-gray-800 flex items-center justify-between"},L_={class:"text-lg font-semibold text-gray-900 dark:text-gray-100"},$_={key:0,class:"text-sm text-gray-500 dark:text-gray-400 mt-1"},j_={class:"flex-1 overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-gray-200 dark:scrollbar-thumb-gray-800"},W_={class:"px-6 py-4 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-slate-900/50"},U_=e.defineComponent({__name:"DataFilterSheet",props:{title:{default:"Filter Data"},description:{default:"Masukan parameter pencarian untuk memfilter data."}},setup(t,{expose:n}){const o=e.ref(!1),r=()=>{o.value=!0,document.body.style.overflow="hidden"},a=()=>{o.value=!1,document.body.style.overflow=""};return n({open:r,close:a}),(s,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{onClick:r},[e.renderSlot(s.$slots,"trigger",{},()=>[e.createVNode(et,{variant:"outline",class:"gap-2",icon:"Search",text:"Pencarian"})])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[o.value?(e.openBlock(),e.createElementBlock("div",z_,[e.createVNode(e.Transition,{appear:"","enter-active-class":"transition-opacity duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/40 backdrop-blur-sm",onClick:a})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{appear:"","enter-active-class":"transition-transform duration-300 ease-out","enter-from-class":"translate-x-full","enter-to-class":"translate-x-0","leave-active-class":"transition-transform duration-200 ease-in","leave-from-class":"translate-x-0","leave-to-class":"translate-x-full"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",I_,[e.createElementVNode("div",R_,[e.createElementVNode("div",null,[e.createElementVNode("h3",L_,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("p",$_,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),e.createVNode(et,{variant:"ghost",size:"icon",onClick:a,icon:"X",class:"text-gray-400 hover:text-gray-600"})]),e.createElementVNode("div",j_,[e.renderSlot(s.$slots,"default")]),e.createElementVNode("div",W_,[e.renderSlot(s.$slots,"footer")])])):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]))]))}}),H_={key:0},q_=["value","name"],eu=e.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const{locale:o}=$t.useI18n(),r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,u=>{s.value=u});const i={DCodeTextField:lo,DCodeAutoComplete:gr,DCodeDatePicker:oa,DCodeTextarea:wo,DCodeTextArea:wo,DCodeCheckbox:Cn,DCodeSwitch:la,DCodeOtpInput:sa,DCodeImageField:aa,DCodeSlider:ia},l=e.computed(()=>{const u=r.field.component;return i[u]||null}),c=e.computed(()=>{const u=r.field.props,f={};return(u.labelID||u.labelEN)&&(f.label=o.value==="id"?u.labelID:u.labelEN),(u.placeholderID||u.placeholderEN)&&(f.placeholder=o.value==="id"?u.placeholderID:u.placeholderEN),u.required!==void 0&&(f.required=u.required),u.disabled!==void 0&&(f.disabled=u.disabled),u.readonly!==void 0&&(f.readonly=u.readonly),u.valueType&&(f.type=u.valueType),u.minLength!==void 0&&(f.minlength=u.minLength),u.maxLength!==void 0&&(f.maxlength=u.maxLength),u.min!==void 0&&(f.min=u.min),u.max!==void 0&&(f.max=u.max),u.options&&(f.options=u.options),u.endpoint&&(f.endpoint=u.endpoint),u.itemTitle&&(f.itemTitle=u.itemTitle),u.itemValue&&(f.itemValue=u.itemValue),u.returnObject!==void 0&&(f.returnObject=u.returnObject),u.clearable!==void 0&&(f.clearable=u.clearable),Object.keys(u).forEach(h=>{!["labelID","labelEN","placeholderID","placeholderEN"].includes(h)&&!f.hasOwnProperty(h)&&(f[h]=u[h])}),f}),d=u=>{s.value=u,a("update:modelValue",u)};return(u,f)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",H_,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,q_)])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"]))}}),G_=e.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=lt.useVModel(o,"modelValue",r,{passive:!0,defaultValue:o.defaultValue});return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>e.isRef(a)?a.value=l:null),class:e.normalizeClass(e.unref(Ie)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",o.class))},null,2)),[[e.vModelText,e.unref(a)]])}}),X_=e.defineComponent({__name:"Pagination",props:{page:{},defaultPage:{},itemsPerPage:{},total:{},siblingCount:{},disabled:{type:Boolean},showEdges:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:page"],setup(t,{emit:n}){const o=t,r=n,a=lt.reactiveOmit(o,"class"),s=Se.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Se.PaginationRoot),e.mergeProps({"data-slot":"pagination"},e.unref(s),{class:o.class}),{default:e.withCtx(c=>[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(c)))]),_:3},16,["class"]))}}),K_=e.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Se.PaginationList),e.mergeProps({"data-slot":"pagination-content"},e.unref(o),{class:e.unref(Ie)("flex flex-row items-center gap-1",n.class)}),{default:e.withCtx(s=>[e.renderSlot(r.$slots,"default",e.normalizeProps(e.guardReactiveProps(s)))]),_:3},16,["class"]))}}),Y_=e.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Se.PaginationEllipsis),e.mergeProps({"data-slot":"pagination-ellipsis"},e.unref(o),{class:e.unref(Ie)("flex size-9 items-center justify-center",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createVNode(e.unref(ce.MoreHorizontal),{class:"size-4"}),a[0]||(a[0]=e.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),J_=e.defineComponent({__name:"PaginationFirst",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class","size"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.PaginationFirst),e.mergeProps({"data-slot":"pagination-first",class:e.unref(Ie)(e.unref(io)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ce.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),Q_=e.defineComponent({__name:"PaginationItem",props:{value:{},asChild:{type:Boolean},as:{},size:{default:"icon"},class:{type:[Boolean,null,String,Object,Array]},isActive:{type:Boolean}},setup(t){const n=t,o=lt.reactiveOmit(n,"class","size","isActive");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Se.PaginationListItem),e.mergeProps({"data-slot":"pagination-item"},e.unref(o),{class:e.unref(Ie)(e.unref(io)({variant:"ghost",size:t.size}),t.isActive?"bg-[#0056a1] dark:bg-[#003d75] text-white hover:bg-[#0056a1]/90 dark:hover:bg-[#003d75]/90 hover:text-white":"",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Z_=e.defineComponent({__name:"PaginationLast",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class","size"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.PaginationLast),e.mergeProps({"data-slot":"pagination-last",class:e.unref(Ie)(e.unref(io)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Last",-1)),e.createVNode(e.unref(ce.ChevronRightIcon))])]),_:3},16,["class"]))}}),e2=e.defineComponent({__name:"PaginationNext",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class","size"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.PaginationNext),e.mergeProps({"data-slot":"pagination-next",class:e.unref(Ie)(e.unref(io)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Next",-1)),e.createVNode(e.unref(ce.ChevronRightIcon))])]),_:3},16,["class"]))}}),t2=e.defineComponent({__name:"PaginationPrevious",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class","size"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.PaginationPrev),e.mergeProps({"data-slot":"pagination-previous",class:e.unref(Ie)(e.unref(io)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ce.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),n2=e.defineComponent({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},by:{type:[String,Function]},dir:{},multiple:{type:Boolean},autocomplete:{},disabled:{type:Boolean},name:{},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(t,{emit:n}){const o=t,r=n,a=Se.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(Se.SelectRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),o2=e.defineComponent({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean},position:{default:"popper"},bodyLock:{type:Boolean},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(t,{emit:n}){const o=t,r=n,a=lt.reactiveOmit(o,"class"),s=Se.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Se.SelectPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Se.SelectContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(Ie)("relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t.position==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",o.class)}),{default:e.withCtx(()=>[e.createVNode(e.unref(i2)),e.createVNode(e.unref(Se.SelectViewport),{class:e.normalizeClass(e.unref(Ie)("p-1",t.position==="popper"&&"h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]"))},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},8,["class"]),e.createVNode(e.unref(s2))]),_:3},16,["class"])]),_:3}))}}),r2={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},a2=e.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.SelectItem),e.mergeProps(e.unref(r),{class:e.unref(Ie)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n.class)}),{default:e.withCtx(()=>[e.createElementVNode("span",r2,[e.createVNode(e.unref(Se.SelectItemIndicator),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ce.Check),{class:"h-4 w-4"})]),_:1})]),e.createVNode(e.unref(Se.SelectItemText),null,{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),s2=e.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.SelectScrollDownButton),e.mergeProps(e.unref(r),{class:e.unref(Ie)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ce.ChevronDown))])]),_:3},16,["class"]))}}),i2=e.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.SelectScrollUpButton),e.mergeProps(e.unref(r),{class:e.unref(Ie)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ce.ChevronUp))])]),_:3},16,["class"]))}}),l2=e.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.SelectTrigger),e.mergeProps(e.unref(r),{class:e.unref(Ie)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:truncate text-start",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default"),e.createVNode(e.unref(Se.SelectIcon),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),c2=e.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Se.SelectValue),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),rr={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Co={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},St={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},d2={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},u2={dangerouslyHTMLString:!1,multiple:!0,position:rr.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},f2={rtl:!1,newestOnTop:!1,toastClassName:""},tu={...u2,...f2};St.DEFAULT;var We=(t=>(t[t.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",t[t.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",t.CSS_NAMESPACE="Toastify",t))(We||{}),ti=(t=>(t.ENTRANCE_ANIMATION_END="d",t))(ti||{});const h2={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},m2={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},p2={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},g2={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},nu="Toastify--animate Toastify__none-enter";function ou(t,n=!1){var o;let r=h2;if(!t||typeof t=="string")switch(t){case"flip":r=g2;break;case"zoom":r=p2;break;case"slide":r=m2;break}else r=t;if(n)r.enter=nu;else if(r.enter===nu){const a=(o=r.exit.split("__")[1])==null?void 0:o.split("-")[0];r.enter=`Toastify--animate Toastify__${a}-enter`}return r}function b2(t){return t.containerId||String(t.position)}const da="will-unmount";function y2(t=rr.TOP_RIGHT){return!!document.querySelector(`.${We.CSS_NAMESPACE}__toast-container--${t}`)}function x2(t=rr.TOP_RIGHT){return`${We.CSS_NAMESPACE}__toast-container--${t}`}function k2(t,n,o=!1){const r=[`${We.CSS_NAMESPACE}__toast-container`,`${We.CSS_NAMESPACE}__toast-container--${t}`,o?`${We.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return Bo(n)?n({position:t,rtl:o,defaultClassName:r}):`${r} ${n||""}`}function w2(t){var n;const{position:o,containerClassName:r,rtl:a=!1,style:s={}}=t,i=We.CSS_NAMESPACE,l=x2(o),c=document.querySelector(`.${i}`),d=document.querySelector(`.${l}`),u=!!d&&!((n=d.className)!=null&&n.includes(da)),f=c||document.createElement("div"),h=document.createElement("div");h.className=k2(o,r,a),h.dataset.testid=`${We.CSS_NAMESPACE}__toast-container--${o}`,h.id=b2(t);for(const m in s)if(Object.prototype.hasOwnProperty.call(s,m)){const g=s[m];h.style[m]=g}return c||(f.className=We.CSS_NAMESPACE,document.body.appendChild(f)),u||f.appendChild(h),h}function ni(t){var n,o,r;const a=typeof t=="string"?t:((n=t.currentTarget)==null?void 0:n.id)||((o=t.target)==null?void 0:o.id),s=document.getElementById(a);s&&s.removeEventListener("animationend",ni,!1);try{ar[a].unmount(),(r=document.getElementById(a))==null||r.remove(),delete ar[a],delete yt[a]}catch{}}const ar=e.reactive({});function C2(t,n){const o=document.getElementById(String(n));o&&(ar[o.id]=t)}function oi(t,n=!0){const o=String(t);if(!ar[o])return;const r=document.getElementById(o);r&&r.classList.add(da),n?(B2(t),r&&r.addEventListener("animationend",ni,!1)):ni(o),Ht.items=Ht.items.filter(a=>a.containerId!==t)}function E2(t){for(const n in ar)oi(n,t);Ht.items=[]}function ru(t,n){const o=document.getElementById(t.toastId);if(o){let r=t;r={...r,...ou(r.transition)};const a=r.appendPosition?`${r.exit}--${r.position}`:r.exit;o.className+=` ${a}`,n&&n(o)}}function B2(t){for(const n in yt)if(n===t)for(const o of yt[n]||[])ru(o)}function _2(t){const n=Eo().find(o=>o.toastId===t);return n==null?void 0:n.containerId}function ri(t){return document.getElementById(t)}function S2(t){const n=ri(t.containerId);return n&&n.classList.contains(da)}function au(t){var n;const o=e.isVNode(t.content)?e.toRaw(t.content.props):null;return o??e.toRaw((n=t.data)!=null?n:{})}function V2(t){return t?Ht.items.filter(n=>n.containerId===t).length>0:Ht.items.length>0}function A2(){if(Ht.items.length>0){const t=Ht.items.shift();ua(t==null?void 0:t.toastContent,t==null?void 0:t.toastProps)}}const yt=e.reactive({}),Ht=e.reactive({items:[]});function Eo(){const t=e.toRaw(yt);return Object.values(t).reduce((n,o)=>[...n,...o],[])}function D2(t){return Eo().find(n=>n.toastId===t)}function ua(t,n={}){if(S2(n)){const o=ri(n.containerId);o&&o.addEventListener("animationend",ai.bind(null,t,n),!1)}else ai(t,n)}function ai(t,n={}){const o=ri(n.containerId);o&&o.removeEventListener("animationend",ai.bind(null,t,n),!1);const r=yt[n.containerId]||[],a=r.length>0;if(!a&&!y2(n.position)){const s=w2(n),i=e.createApp(Z2,n);n.useHandler&&n.useHandler(i),i.mount(s),C2(i,s.id)}a&&!n.updateId&&(n.position=r[0].position),e.nextTick(()=>{n.updateId?zt.update(n):zt.add(t,n)})}const zt={add(t,n){const{containerId:o=""}=n;o&&(yt[o]=yt[o]||[],yt[o].find(r=>r.toastId===n.toastId)||setTimeout(()=>{var r,a;n.newestOnTop?(r=yt[o])==null||r.unshift(n):(a=yt[o])==null||a.push(n),n.onOpen&&n.onOpen(au(n))},n.delay||0))},remove(t){if(t){const n=_2(t);if(n){const o=yt[n];let r=o.find(a=>a.toastId===t);yt[n]=o.filter(a=>a.toastId!==t),!yt[n].length&&!V2(n)&&oi(n,!1),A2(),e.nextTick(()=>{r!=null&&r.onClose&&(r.onClose(au(r)),r=void 0)})}}},update(t={}){const{containerId:n=""}=t;if(n&&t.updateId){yt[n]=yt[n]||[];const o=yt[n].find(s=>s.toastId===t.toastId),r=(o==null?void 0:o.position)!==t.position||(o==null?void 0:o.transition)!==t.transition,a={...t,disabledEnterTransition:!r,updateId:void 0};zt.dismissForce(t==null?void 0:t.toastId),setTimeout(()=>{Ue(a.content,a)},t.delay||0)}},clear(t,n=!0){t?oi(t,n):E2(n)},dismissCallback(t){var n;const o=(n=t.currentTarget)==null?void 0:n.id,r=document.getElementById(o);r&&(r.removeEventListener("animationend",zt.dismissCallback,!1),setTimeout(()=>{zt.remove(o)}))},dismiss(t){if(t){const n=Eo();for(const o of n)if(o.toastId===t){ru(o,r=>{r.addEventListener("animationend",zt.dismissCallback,!1)});break}}},dismissForce(t){if(t){const n=Eo();for(const o of n)if(o.toastId===t){const r=document.getElementById(t);r&&(r.remove(),r.removeEventListener("animationend",zt.dismissCallback,!1),zt.remove(t));break}}}},N2=e.reactive({useHandler:void 0}),su=e.reactive({}),fa=e.reactive({});function iu(){return Math.random().toString(36).substring(2,9)}function M2(t){return typeof t=="number"&&!isNaN(t)}function si(t){return typeof t=="string"}function Bo(t){return typeof t=="function"}function ha(...t){return e.mergeProps(...t)}function ma(t){return typeof t=="object"&&(!!(t!=null&&t.render)||!!(t!=null&&t.setup)||typeof(t==null?void 0:t.type)=="object")}function v2(t={}){su[`${We.CSS_NAMESPACE}-default-options`]=t}function lu(){return su[`${We.CSS_NAMESPACE}-default-options`]||tu}function P2(){const t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||t?"dark":"light"}var pa=(t=>(t[t.Enter=0]="Enter",t[t.Exit=1]="Exit",t))(pa||{});const cu={containerId:{type:[String,Number],required:!1,default:""},clearOnUrlChange:{type:Boolean,required:!1,default:!0},disabledEnterTransition:{type:Boolean,required:!1,default:!1},dangerouslyHTMLString:{type:Boolean,required:!1,default:!1},multiple:{type:Boolean,required:!1,default:!0},limit:{type:Number,required:!1,default:void 0},position:{type:String,required:!1,default:rr.TOP_LEFT},bodyClassName:{type:String,required:!1,default:""},autoClose:{type:[Number,Boolean],required:!1,default:!1},closeButton:{type:[Boolean,Function,Object],required:!1,default:void 0},transition:{type:[String,Object],required:!1,default:"bounce"},hideProgressBar:{type:Boolean,required:!1,default:!1},pauseOnHover:{type:Boolean,required:!1,default:!0},pauseOnFocusLoss:{type:Boolean,required:!1,default:!0},closeOnClick:{type:Boolean,required:!1,default:!0},progress:{type:Number,required:!1,default:void 0},progressClassName:{type:String,required:!1,default:""},toastStyle:{type:Object,required:!1,default(){return{}}},progressStyle:{type:Object,required:!1,default(){return{}}},role:{type:String,required:!1,default:"alert"},theme:{type:String,required:!1,default:Co.AUTO},content:{type:[String,Object,Function],required:!1,default:""},toastId:{type:[String,Number],required:!1,default:""},data:{type:[Object,String],required:!1,default(){return{}}},type:{type:String,required:!1,default:St.DEFAULT},icon:{type:[Boolean,String,Number,Object,Function],required:!1,default:void 0},delay:{type:Number,required:!1,default:void 0},onOpen:{type:Function,required:!1,default:void 0},onClose:{type:Function,required:!1,default:void 0},onClick:{type:Function,required:!1,default:void 0},isLoading:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},toastClassName:{type:String,required:!1,default:""},updateId:{type:[String,Number],required:!1,default:""},contentProps:{type:Object,required:!1,default:null},expandCustomProps:{type:Boolean,required:!1,default:!1}},T2={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:St.DEFAULT},theme:{type:String,required:!1,default:Co.AUTO},hide:{type:Boolean,required:!1,default:void 0},className:{type:[String,Function],required:!1,default:""},controlledProgress:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:void 0},isIn:{type:Boolean,required:!1,default:void 0},progress:{type:Number,required:!1,default:void 0},closeToast:{type:Function,required:!1,default:void 0}},O2=e.defineComponent({name:"ProgressBar",props:T2,setup(t,{attrs:n}){const o=e.ref(),r=e.computed(()=>t.hide?"true":"false"),a=e.computed(()=>({...n.style||{},animationDuration:`${t.autoClose===!0?5e3:t.autoClose}ms`,animationPlayState:t.isRunning?"running":"paused",opacity:t.hide||t.autoClose===!1?0:1,transform:t.controlledProgress?`scaleX(${t.progress})`:"none"})),s=e.computed(()=>[`${We.CSS_NAMESPACE}__progress-bar`,t.controlledProgress?`${We.CSS_NAMESPACE}__progress-bar--controlled`:`${We.CSS_NAMESPACE}__progress-bar--animated`,`${We.CSS_NAMESPACE}__progress-bar-theme--${t.theme}`,`${We.CSS_NAMESPACE}__progress-bar--${t.type}`,t.rtl?`${We.CSS_NAMESPACE}__progress-bar--rtl`:null].filter(Boolean).join(" ")),i=e.computed(()=>`${s.value} ${(n==null?void 0:n.class)||""}`),l=()=>{o.value&&(o.value.onanimationend=null,o.value.ontransitionend=null)},c=()=>{t.isIn&&t.closeToast&&t.autoClose!==!1&&(t.closeToast(),l())},d=e.computed(()=>t.controlledProgress?null:c),u=e.computed(()=>t.controlledProgress?c:null);return e.watchEffect(()=>{o.value&&(l(),o.value.onanimationend=d.value,o.value.ontransitionend=u.value)}),()=>e.createVNode("div",{ref:o,role:"progressbar","aria-hidden":r.value,"aria-label":"notification timer",class:i.value,style:a.value},null)}}),F2=e.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:Co.AUTO},type:{type:String,required:!1,default:Co.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(t){return()=>e.createVNode("button",{class:`${We.CSS_NAMESPACE}__close-button ${We.CSS_NAMESPACE}__close-button--${t.theme}`,type:"button",onClick:n=>{n.stopPropagation(),t.closeToast&&t.closeToast(n)},"aria-label":t.ariaLabel},[e.createVNode("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},[e.createVNode("path",{"fill-rule":"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"},null)])])}}),ga=({theme:t,type:n,path:o,...r})=>e.createVNode("svg",e.mergeProps({viewBox:"0 0 24 24",width:"100%",height:"100%",style:{fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`}},r),[e.createVNode("path",{d:o},null)]);function z2(t){return e.createVNode(ga,e.mergeProps(t,{path:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}),null)}function I2(t){return e.createVNode(ga,e.mergeProps(t,{path:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}),null)}function R2(t){return e.createVNode(ga,e.mergeProps(t,{path:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}),null)}function L2(t){return e.createVNode(ga,e.mergeProps(t,{path:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}),null)}function $2(){return e.createVNode("div",{class:`${We.CSS_NAMESPACE}__spinner`},null)}const ba={info:I2,warning:z2,success:R2,error:L2,spinner:$2},j2=t=>t in ba;function W2({theme:t,type:n,isLoading:o,icon:r}){let a;const s=!!o||n==="loading",i={theme:t,type:n};if(s&&(r===void 0||typeof r=="boolean"))return ba.spinner();if(r!==!1){if(ma(r))a=e.toRaw(r);else if(Bo(r)){const l=r;i.type=s?"loading":n,a=l(i),a=!a&&s?ba.spinner():a}else e.isVNode(r)?a=e.cloneVNode(r,i):si(r)||M2(r)?a=r:j2(n)&&(a=ba[n](i));return a}}const U2=()=>{};function H2(t,n,o=We.COLLAPSE_DURATION){const{scrollHeight:r,style:a}=t,s=o;requestAnimationFrame(()=>{a.minHeight="initial",a.height=r+"px",a.transition=`all ${s}ms`,requestAnimationFrame(()=>{a.height="0",a.padding="0",a.margin="0",setTimeout(n,s)})})}function q2(t){const n=e.ref(!1),o=e.ref(!1),r=e.ref(!1),a=e.ref(pa.Enter),s=e.reactive({...t,appendPosition:t.appendPosition||!1,collapse:typeof t.collapse>"u"?!0:t.collapse,collapseDuration:t.collapseDuration||We.COLLAPSE_DURATION}),i=s.done||U2,l=e.computed(()=>s.appendPosition?`${s.enter}--${s.position}`:s.enter),c=e.computed(()=>s.appendPosition?`${s.exit}--${s.position}`:s.exit),d=e.computed(()=>t.pauseOnHover?{onMouseenter:y,onMouseleave:k}:{});function u(){const E=l.value.split(" ");h().addEventListener(ti.ENTRANCE_ANIMATION_END,k,{once:!0});const _=S=>{const w=h();S.target===w&&(w.dispatchEvent(new Event(ti.ENTRANCE_ANIMATION_END)),w.removeEventListener("animationend",_),w.removeEventListener("animationcancel",_),a.value===pa.Enter&&S.type!=="animationcancel"&&w.classList.remove(...E))},B=()=>{const S=h();S.classList.add(...E),S.addEventListener("animationend",_),S.addEventListener("animationcancel",_)};t.pauseOnFocusLoss&&m(),B()}function f(){if(!h())return;const E=()=>{const B=h();B.removeEventListener("animationend",E),s.collapse?H2(B,i,s.collapseDuration):i()},_=()=>{const B=h();a.value=pa.Exit,B&&(B.className+=` ${c.value}`,B.addEventListener("animationend",E))};o.value||(r.value?E():setTimeout(_))}function h(){return t.toastRef.value}function m(){document.hasFocus()||y(),window.addEventListener("focus",k),window.addEventListener("blur",y)}function g(){window.removeEventListener("focus",k),window.removeEventListener("blur",y)}function k(){(!t.loading.value||t.isLoading===void 0)&&(n.value=!0)}function y(){n.value=!1}function p(E){E&&(E.stopPropagation(),E.preventDefault()),o.value=!1}return e.watchEffect(f),e.watchEffect(()=>{const E=Eo();o.value=E.findIndex(_=>_.toastId===s.toastId)>-1}),e.watchEffect(()=>{t.isLoading!==void 0&&(t.loading.value?y():k())}),e.onMounted(u),e.onUnmounted(()=>{t.pauseOnFocusLoss&&g()}),{isIn:o,isRunning:n,hideToast:p,eventHandlers:d}}function G2(t){if(!t||typeof t!="object"||Array.isArray(t)||t.__v_isVNode)return!1;const n=t;return["title","content"].some(o=>o in n)}const X2=e.defineComponent({name:"ToastItem",inheritAttrs:!1,props:cu,setup(t){const n=e.ref(),o=e.computed(()=>!!t.isLoading),r=e.computed(()=>t.progress!==void 0&&t.progress!==null),a=e.computed(()=>W2(t)),s=e.computed(()=>[`${We.CSS_NAMESPACE}__toast`,`${We.CSS_NAMESPACE}__toast-theme--${t.theme}`,`${We.CSS_NAMESPACE}__toast--${t.type}`,t.rtl?`${We.CSS_NAMESPACE}__toast--rtl`:void 0,t.toastClassName||""].filter(Boolean).join(" ")),{isRunning:i,isIn:l,hideToast:c,eventHandlers:d}=q2({toastRef:n,loading:o,done:()=>{zt.remove(t.toastId)},...ou(t.transition,t.disabledEnterTransition),...t});function u(){const f=t.content;if(G2(f)){const h=[];return f.title!==void 0&&h.push(e.createVNode("div",{"data-testid":"toast-text-title",class:`${We.CSS_NAMESPACE}__toast-text-title`},[f.title])),f.content!==void 0&&h.push(e.createVNode("div",{"data-testid":"toast-text-content",class:`${We.CSS_NAMESPACE}__toast-text-content`},[f.content])),e.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${We.CSS_NAMESPACE}__toast-text`},[h])}return ma(f)?e.h(e.toRaw(f),{toastProps:e.toRaw(t),closeToast:c,data:t.data,...t.expandCustomProps?t.contentProps:{contentProps:t.contentProps||{}}}):Bo(f)?f({toastProps:e.toRaw(t),closeToast:c,data:t.data}):t.dangerouslyHTMLString?e.h("div",{innerHTML:f}):f}return()=>e.createVNode("div",e.mergeProps({id:t.toastId,class:s.value,style:t.toastStyle||{},ref:n,"data-testid":`toast-item-${t.toastId}`,onClick:f=>{t.closeOnClick&&c(),t.onClick&&t.onClick(f)}},d.value),[e.createVNode("div",{role:t.role,"data-testid":"toast-body",class:`${We.CSS_NAMESPACE}__toast-body ${t.bodyClassName||""}`},[a.value!=null&&e.createVNode("div",{"data-testid":`toast-icon-${t.type}`,class:[`${We.CSS_NAMESPACE}__toast-icon`,t.isLoading?"":`${We.CSS_NAMESPACE}--animate-icon ${We.CSS_NAMESPACE}__zoom-enter`].join(" ")},[ma(a.value)?e.h(e.toRaw(a.value),{theme:t.theme,type:t.type}):Bo(a.value)?a.value({theme:t.theme,type:t.type}):a.value]),e.createVNode("div",{"data-testid":"toast-content"},[u()])]),(t.closeButton===void 0||t.closeButton===!0)&&e.createVNode(F2,{theme:t.theme,closeToast:f=>{f.stopPropagation(),f.preventDefault(),c()}},null),ma(t.closeButton)?e.h(e.toRaw(t.closeButton),{closeToast:c,type:t.type,theme:t.theme}):Bo(t.closeButton)?t.closeButton({closeToast:c,type:t.type,theme:t.theme}):null,e.createVNode(O2,{className:t.progressClassName,style:t.progressStyle,rtl:t.rtl,theme:t.theme,isIn:l.value,type:t.type,hide:t.hideProgressBar,isRunning:i.value,autoClose:t.autoClose,controlledProgress:r.value,progress:t.progress,closeToast:t.isLoading?void 0:c},null)])}}),ya="vue3-toastify:url-change";let xa=0,sr;function K2(){if(!(typeof window>"u")&&fa.lastUrl!==window.location.href){fa.lastUrl=window.location.href;const t=o=>typeof o.clearOnUrlChange=="boolean"?o.clearOnUrlChange:lu().clearOnUrlChange!==!1,n=Object.values(yt).reduce((o,r)=>(Array.isArray(r)&&o.push(...r),o),[]);for(const o of n)o.toastId&&t(o)&&zt.dismiss(o.toastId);Ht.items=Ht.items.filter(o=>!t(o.toastProps))}}function Y2(){const{history:t}=window,n=t.pushState,o=t.replaceState;return t.pushState=function(...r){const a=n.apply(this,r);return window.dispatchEvent(new Event(ya)),a},t.replaceState=function(...r){const a=o.apply(this,r);return window.dispatchEvent(new Event(ya)),a},()=>{t.pushState=n,t.replaceState=o}}function J2(){if(typeof window>"u"||sr)return;const t=Y2(),n=()=>K2();window.addEventListener(ya,n),window.addEventListener("popstate",n),window.addEventListener("hashchange",n),sr=()=>{t(),window.removeEventListener(ya,n),window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n),sr=void 0}}function Q2(){sr&&(sr(),fa.lastUrl="")}const Z2=e.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:cu,setup(t){const n=e.computed(()=>t.containerId),o=e.computed(()=>yt[n.value]||[]),r=e.computed(()=>o.value.filter(a=>a.position===t.position));return e.onMounted(()=>{typeof window<"u"&&(xa+=1,J2())}),e.onUnmounted(()=>{typeof window<"u"&&xa>0&&(xa-=1,xa===0&&Q2())}),()=>e.createVNode(e.Fragment,null,[r.value.map(a=>{const{toastId:s=""}=a;return e.createVNode(X2,e.mergeProps({key:s},a),null)})])}});let ii=!1;const du={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function uu(){const t=[];return Eo().forEach(n=>{const o=document.getElementById(n.containerId);o&&!o.classList.contains(da)&&t.push(n)}),t}function eS(t){const n=uu().length,o=t??0;return o>0&&n+Ht.items.length>=o}function tS(t){eS(t.limit)&&!t.updateId&&Ht.items.push({toastId:t.toastId,containerId:t.containerId,toastContent:t.content,toastProps:t})}function zn(t,n,o={}){if(ii)return;o=ha(lu(),{type:n},e.toRaw(o)),(!o.toastId||typeof o.toastId!="string"&&typeof o.toastId!="number")&&(o.toastId=iu()),o={...o,...o.type==="loading"?du:{},content:t,containerId:o.containerId||String(o.position)};const r=Number(o==null?void 0:o.progress);return!isNaN(r)&&r<0&&(o.progress=0),r>1&&(o.progress=1),o.theme==="auto"&&(o.theme=P2()),tS(o),fa.lastUrl=window.location.href,o.multiple?Ht.items.length?o.updateId&&ua(t,o):ua(t,o):(ii=!0,Ue.clearAll(void 0,!1),setTimeout(()=>{ua(t,o)},0),setTimeout(()=>{ii=!1},390)),o.toastId}const Ue=(t,n)=>zn(t,St.DEFAULT,n);Ue.info=(t,n)=>zn(t,St.DEFAULT,{...n,type:St.INFO}),Ue.error=(t,n)=>zn(t,St.DEFAULT,{...n,type:St.ERROR}),Ue.warning=(t,n)=>zn(t,St.DEFAULT,{...n,type:St.WARNING}),Ue.warn=Ue.warning,Ue.success=(t,n)=>zn(t,St.DEFAULT,{...n,type:St.SUCCESS}),Ue.loading=(t,n)=>zn(t,St.DEFAULT,ha(n,du)),Ue.dark=(t,n)=>zn(t,St.DEFAULT,ha(n,{theme:Co.DARK})),Ue.remove=t=>{t?zt.dismiss(t):zt.clear()},Ue.clearAll=(t,n)=>{e.nextTick(()=>{zt.clear(t,n)})},Ue.isActive=t=>{let n=!1;return n=uu().findIndex(o=>o.toastId===t)>-1,n},Ue.update=(t,n={})=>{setTimeout(()=>{const o=D2(t);if(o){const r=e.toRaw(o),{content:a}=r,s={...r,...n,toastId:n.toastId||t,updateId:iu()},i=s.render||a;delete s.render,zn(i,s.type,s)}},0)},Ue.done=t=>{Ue.update(t,{isLoading:!1,progress:1})},Ue.promise=nS;function nS(t,{pending:n,error:o,success:r},a){var s,i,l;let c;const d={...a||{},autoClose:!1};n&&(c=si(n)?Ue.loading(n,d):Ue.loading(n.render,{...d,...n}));const u={autoClose:(s=a==null?void 0:a.autoClose)!=null?s:!0,closeOnClick:(i=a==null?void 0:a.closeOnClick)!=null?i:!0,closeButton:(l=a==null?void 0:a.autoClose)!=null?l:null,isLoading:void 0,draggable:null,delay:100},f=(m,g,k)=>{if(g==null){Ue.remove(c);return}const y={type:m,...u,...a,data:k},p=si(g)?{render:g}:g;return c?Ue.update(c,{...y,...p,isLoading:!1}):Ue(p.render,{...y,...p,isLoading:!1}),k},h=Bo(t)?t():t;return h.then(m=>{f("success",r,m)}).catch(m=>{f("error",o,m)}),h}Ue.POSITION=rr,Ue.THEME=Co,Ue.TYPE=St,Ue.TRANSITIONS=d2;const oS={install(t,n={}){N2.useHandler=n.useHandler||(()=>{}),rS(n)}};typeof window<"u"&&(window.Vue3Toastify=oS);function rS(t={}){const n=ha(tu,t);v2(n)}const aS={v:"4.8.0",meta:{g:"LottieFiles AE ",a:"",k:"",d:"",tc:""},fr:25,ip:0,op:273,w:500,h:500,nm:"not_found",ddd:0,assets:JSON.parse('[{"id":"image_0","w":175,"h":173,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAACtCAYAAADGWi9+AAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAYj0lEQVR4nO2dXVMb2ZnH/+cg1BIIkABjPF7bxFvZnamaqYHUrh1XqjbMxc7YV4Mucj3kEwzfIOwnCLnei+BP0PgmME5twWQry8DWFrh2qpKt3aRgXB4DtngRWKIlcc5eSGLUp7ul7qPWS7fO78rdWK1G+vP0c57zvAAKhUKhUCgUCoVCoVAoFAqFQqEIMqTTN9Au9Ofb0+B8CgzTICRJCZ8GAHAkOfBxnZeeEYJdAGAMewD2ALIHXO0hFttNfzJz2up7V9gTSvHqq5tTQN8sCKYp4dOc4+ctfLt9DuwCfAOUbqQ/fbDbwvdS1BAa8epfbc2Bk1kCPgfgXgdv5YwDG+BkBbH+FWWZW0egxauvbs4CdJ4QzAEY6fT92MGBZ0rIrSFw4tXXd5IwjHkCsgCPFjYej6E/EkF/fx80LQpKKQBgIB5zfI1hFHDFGAAgn78EAOTyBkrFEoqlkpe3P+McK+gjS8q18IfAiLfsx9JFt1ZW06IYiGvQotGyaPsjvt8TYwyXRgH5/CVyeeNa3I0gBF8zxhbTTx5t+H5TPUTXi7dGtF80+r+JwQEkBuMtE6sbLt7lcHGRRz5/6cYy73OChfRnD1facW9ho2vFq6/vJHFZWGok2ng8hpGhQSQSA9duQLdQFfLFuxxYxfWwQ1liObpSvPraNwsEZBEO7gGlFInBAYyNjnTMwnqBMYaLixwyx2d1rXF5cccW0k8e7bXv7oJLV4lXf749TRlfdto0oJQilRxCKjncdVbWLRfvcjg5Pa/nH59x8MX0458utfO+gkjXiFdf3VokBL+y+1kYRCuSy1/izdsTGEbB9ucVV2JeWWFnOi5efXVzihK64mRtU8khjI0mQyNakWz2op47ccY5WUg/ebDc5tsKBB0Vr766PU8IX4KNbxuPxzAxnoKmRTtwZ+2FMYbM8SlOTs9tf845niIWXVCbHGY6Jl59bXuJgH8pnqeUYmx0BKnkcCduq6MYRgEHRxlbV4IALxhnc8qN+IG2i7e8Q1ZYJsDn4s80LYr3Jm8EIoLQSt68PXaywmecklm1Q1emreLV13eS1Chs2Pm3qeQQboyPtvN2upqLdzkcHGbs4sPKD67QNvE6LcwopZgYT2F4ONGuW3Gkut1bzn/ovPUvFkv4/uCNrRvBOfllrwu4LeLVn29PE8Y3ICzMKKW4c/tm2xZlhlGAYRRQLJWQyxtgjDmGqmrpj0QQ6Y9cJ/XE4zHEahJ7WgljDEdvTpA9v7D8rNcF3HLx6qubU4TQXQjC1bQo7ty+2VIBFIslXLzLIZ83cPEu5/v1q8k/g4MDdTPT/ODgMKMELNBS8Tr5uK0UblWw2fN3rqyqX1S3rFPJoZY9SU5Os3jz9sRyvlcF3DLxtlu4ufwlstl3ttbJCwR4wYEpNJHc3h+JYGx0pCV+fDZ7gYOjjOU8p2Sm16IQrRPv2taKGA5rhXBz+Utkjs885tJiw0sRZbliAwDoLAimCTANF4nwrdrWdhBwz4XRWiJeuw0Iv4VrGAUcvT1pKNpycB8rANvwM+XwhyJPPmcXs66lFZbYzgcmwAumRWd7ZSfOd/FWtnx/W3uOUor7U7d9EW6jrdQK+xxkBfxqqR07UuXc4+IcJXyhXhm931vedgLmwLP044dzvrxBl+OreO0iC36Gw3L5SxweZurlxO5zThY7uXjRn29P44ov1EuiHxsdwdho0pf323/52rIw5Rz/kn7ycNGXN+hifBXvs7WtXdHyTE6M+fK4zByfInN85vTjjotWpFH5Ujwew+TEWNObIYwx7H/32vIH3QsLON/Ea5eP68eWL2MMr16/cfJtuz5xW1/dnKWELtm5E5RSvHfrRtMxYsMoYP/la/H0Ptei02H2f30Rb2UHbaf2nKZFce/OraauWy/LKmglM/VKm/x4OtnFgDnIb9KPHyw0deEuxhfxiu4CpRT37txq6pFoGAW8fHVon5jS5dbWiXplTn74wS9fHVqeUGF2H5pe/utr31hW2M0WRtYR7j6nZDaIwgWA9KcPdpkWneUcT8WfZY7PcHBo3XzwwuTEmCWiQxlfbuqiXUxTlldf30kSo7CHmkdhPB7Dnds3pa/pJNywxTArbsSvxfPNrhNs3YeQbh83Z3kvC5YSnonxlPTlnITLOZ5+/vhhqBYf6cc/XeKc/FI8f3J6jmxWfos7lRxGXFgAEsKX9PUdf2JzXYS0eMsxXXMYqJmkFMYYDo6sydec42n6ycN52fvsZtJPHizbCfjgKNNUFtzYqGVNOILLQugWbk1YXrpoOqK0qQXHq9fWpOswC7eKo4AP7aMsbhiIxzA8ZI5eEIKFsFlfKfE6WV3Z7d/M8alllUyAF2EXbhU7ATs9idzSC9ZX0vJara5stW81K0xgn2nRWakLBpSygM1RCMMoIHMs5+b390dCb309i1df30lW2oxeI2t1GWM4tIaHzjglc2FanLkl/eThPCH4uvbcyek5ci7TPUXsrW8xNEk73hVnGPMQEm9krW7m+NS6Jw++GNaguhtYNDoHwPQoOrSvIm6IvfXli83cXzfhWbyVjuTXJAblWosaRsGS1lhO5wvmBoRfpD+ZOeUE87XniqUSTk6zUtdLJYfEU/f059vTcnfXXXhSXaWiwFRBYPNocsWRtRbrDJyFakEhS/qzhysceFZ7LnN8hmLR0xgBAOUcE0v48oqH4nP2aDLpfO2RbAfyXP7SugcPvhiUJJu2UP5DNrkPdVJC65IaMVtfcc0SVDyJV/ylR4YGpd7ULrrQ6+6CSPrJoz3OYfpMsucXUtY3kRgQT43oX20FXsCuxVv5ZU0+gs2H0hBbq8vJoucL9QKx6BJ8sL7VsnwTLPjW173l5WS29lB2oZbNvhNP7YcxacQP0p/MnNpZX5nIQ2IwbjoOg+vgWn2VyZLXiB+GG4rFkrVgUFnd+thY3zOJxB1b1yHgUQdX4i3XY5mjDGLmkhtskk3OlNWtT/qTmVMOslx77rR+5bQtlFLrd3bFA219XVrevtnaI02LSkUZsudml0H8UhQO8CuT61AslaSSdsSnJaWYbeq+Oow78RKYHi8Dcc3zGxWLNh+48KUo7Ek/ebRHgBe152TaWonxXs7x8+burLO4Ei8l3CReLeo9Z1d0GcpZYyqu6xYGczlPLm94voZdlXKQ/V5X4hX/QmX83bzwYZdbMClcw7np8zKMglTUwer3IrzitfvLlPF3rYs1tuH5Ij1M5Sm1X3tOJtsspvULZ/iU9E11mMaWl5t/ORmra7e4UHN2vcM5NmqP3XbGrCUSMRueIC/aGouXmR8r/RHvVlcUr5izqnAL2ag9ujSKnq9gSdLhCGxyemPxEmL65fr7+zy/iZizW+6Pq/BMH0x5zjLhspgYcajT1bLbaSheS6RBojrYujIme54vooCYpM8Y87xoC9MYXM+/iWy5j5mrPc8XUQAohxhrjy8lrK/o+v3Q+T1YuFiwNe8TWR5vsVjPlvk0DUHTtX2RLpgx5wcNxSv6RH6MbOrF4kq/YNws3nZOPOo2wuMA9QocFr+3V2m5eHv5w1W0lpaLV1xQiAsOhUKWlotXXNlWBvQpFE3TevFaV7bSkyUVilrUgi1oCDuevYwb8Zrqp3o5NNMN+LHjGRYaipcQc2jmSqZnVkh2dLoRf3Y8g0lb3Iaw7Oh0A2JhgB9ZfkHd8WwoXsawV3ssk0Nq/YDprOeLKKpV3CaanaAJBHfH043l3Wv2TSxplCS4pScdhVIfMvwsxmff7v8FARfiNacvyhT+WabTQIlXCqEwQKYQ1jIijDRvnDqFC/Ga0xdLEo3exARoAPfsHoGK+oglO5qlHq0xor/LOAmkvwu4EK9Ya1YslaQSoK2POHMjE0V99PWdpLhYk8nwsz452V4Tt9VR3EYbTH6RTAK0pVEJCXarobZTKMzWHtobhMZYG7/w8FpeAOAwx3plIg6DQotNAnwepsk0LUdoSWppWeqCYtH61AxyFbdLy8s3ao9ku7VYAuohmkzTSioTmExz7xIJ71067WbdNXdnncWdeCndqD2UsbyA1VpQEo7ZCC1H+CO3bRbtAtHoMKGUPmi4Em+latWU4yAzG1ecTMOBj4PcK6tdiOOnZIQL2HxnxPxEDRqut4c5zL0WLi7ynt9M06LW3baQTKZpFXYTmGzGUzXEtrdZNLohfWNdgJe2/qZGb7Kugzj6ihB8oWK+zlBqHpUbj8ekogxiS1RC8HVQt4WruBdvrN8k3mKpJOU6DA8nbDKhzF+Qooy+ujkrxnZlrC5gfVIyoetkEHEt3nJ7efNgOxnXAbB+ARXrOyt1sRBDCF2uPe6PRCQXapeWlltiy9Qg4i0lUnAdLt7lpHJDU8lhi+9LCVVd0mvQ175ZgODr3rw5JnUtcQITIfg6DI29vYm37DpcRx0YY7i48O46UEotvi8HPq58YT2Pvro5RWCekhSPx6S2gxljFn+XsXDMAvEk3spcMJP1lR0pOjycsMk2I4sqdAZQSpchFKpOjKekrmUzcPtMXL8EFe+VFH3EMplGZuEG2H4hI5Tx5V7eNtZXtxbFRdrY6Ih0rdqJMPaKgywHPcpQxbN4058+2BWbQ4sfkFs0LWrrPuCy0JP+r766OUsIflV7rvwZyf0tZ7M20zJDNIFJqoaNMbZYe5zPX0rNRwCAsdGk1X0g+KLX/F/9+fY0IdTyOJ+ckFukAVaXjnM8DcNCrYqUeCuZSKY0yTdvT6RvYnJizBL7JSC/1le356UvGiD09Z0kYXwFgp87OTEm7S5kjk+t4THB5Qs60tXDnMBkGQ2jgKzETFygXET43q0blvOE8N+GXcD6+k6SGoUNCGGx4aEEhocTUtdkjFldOYLfiZ3Vg460eNOfPVwRfd/M8Zl0T4CBeMz2ERlmAVeFK/ZAjsdjmJSM6QJlq2v1dfEj6Qt2KU31bRB932KphMyx/EJ2eDhhWcAB4RSw/nx7mhiFXVG4mhbFbZunkFsMo+C0gP5AX9tWbkOV9JNHG+KW8cnpeVMtocZGkxgesj4uywLeWpa+cBehr27OEsY3ILgKmhbFnds3mxp6cnCUcfwZAf8yTHH05jvmcLYAIde33gfohsmbY7YJKITgi2dfbW0EOQ6sr24tEkLXISzO/BBu5vjUYjj6hOtRzkNjfYkfF9HXvlkgIL+uPZdKDuHG+GhT181mL5z+EM44wXz6s4eB2SnSVzenKKXLdpPW4/EYbt+60ZRwDaOA/ZevTedGhgZw/94kdr79q+k85+xHYQiZ+dKrLP34p0t2GxeyO29VhocTeM/+Sx0hHLq+trUShFxgfe2bBULorp1wh4cSTVtcxhi+f/3Gcn7mo/u4e3vcpnKbhKJ20LdGe4yxeYjuw2EGRYkmJbUkBgdw5/ZN23gnAT4nhO7qq1uL3ehK6KubsytrW3uVp5JlJTo5MdZUVKHKwWHGEtP98P27GBkqp0/ev3fT9DMKMt/0m3YBvrgNVfTV7XlC+G9rz/nhywFl65I5Pq23FX3GOZYQiy51eu9eX92cpZRachSqaFq0qQ2IWjLHp5adtPHRIfzsHz+4Ps7lDfz+D+ZC4bnHD3397juB77+Avrq1LJZpDw8lfLEwQDmx+tDG0tRwxkGWwa+W2unX6es7SVwW5yrFkvec/t/Y6Ih0roKI3ZqgP9KHf/75NPoj5uaGv/u3/0KxdHV9zCmZCfqmhf+Nc2PRBWIUpmvjl9V8Uj8EPBCP4d7dWzg5zTqlY44Q8C9B6JfP1rZeMPBlcL7SCiHr6ztJFAqzYJgjRuGLeqYgHo9hYjzlWydzwyjgyGZL/mcPPrAIFwBGhgfw9rjmqXV11XVullda8ujQVzenCKG7EPy8G+MppJLDvr1PsVhC5vjMkmztwD7n2ADIBvqwK2N19NXNKVA6DYZpSmGpL7OjPxLBzZtjvkwOrWIYBbx8dWjZRZv5sLxAs+OP//knk3g5Z58EuVsO0CLxApUdpHIg3pJsIrtn74RHEV9DgBcgOGUcp+JkyfJ/IMnqDAg3Qq0lHo8hlRyS7rHghJNw79+bxEfv33V8nRKvR+wWcEBrBAyUF3Vn2Qucnp7X84lbRrWTTSo51JJBJ07CvfPeOH7y0f26rxV9XgD/NPf44b/7fpNtpOUrTicB+7mIs8MwCsieXyCXN1o6wagq2EQi7ruVrcVJuJMTKTyc+XHd19pFGwjwgmnR2U5HZpqhLeGSTgm4CmMMufwl8vlLXBpF++4xLtG0KLRoFJrWjwHJBiBeyWYvcPT2xHLPI0MDjgu0Wv6yf4Bv//yd5XzQBdy2WJ+TgP2KA3uFMXbdZ7iemDUtCkop+iMRX4aXeMUujguULe5PPrrfULgA8Ps/vHDs7BlkAbc1UO0k4P5IORm9lwfiiTDGcHCYsd1id+PjVnGyurUEVcBt32VxikIA/ofSgophFPD96ze2i85GUYVacnkDG//xrbhQsyWIAu7IFqH+fHuaMr4sJmIDlSqCibGOPKK7ASc3AagfxxUplq7wx+0/4ezcbLnHRkccrx80AXdsf1tf30nCKCwT4HPxZ9WOOr1khQ2jgIOjjG1kpD/Sh589+OA60aYRTsKtpqnWSTUNlIA7npxhlwtcJR6PYWx0xNfdqW6jUcJRaiSBR//w964WZgDw+ugEO//9V4uroGlR3Ltz6/rYrYDLORuX00D3za/ouHiBaz94BQ4JLcND5dq2sLkSVdHWC9v1R/owOZHC305N1rW83716i5ffvzHnL1RwiujUEzBAvgf4MYAPTWeBF4yTpfSTB8uON9MmukK8QNWNKC4S8C+d/k9YRJzNXiBzfOZ5F3AgrmEgHsVYquxOFUtXyJ6/sxVslUahyPoCdqYb3IuuEW+Veou5KsNDiZZtwbaKci+FbCNLewZO/hWE/wJ10irdkkoOYWw02TCGHlQBd514q1RiwkuwCalV0bQoUiNDSCQG2r7J4ZZc/hLZ7LuGSUOc4yli0YUf/MzCAik3dnH8/Z2QWSvUi3KMDA2gWLqy3ejopIC7VrxANcHb3ZeYGBxAYjDeFUKu5lVcXOQbugac4ynAFu3yjcuulDFPQebrPYlqIYTg7t9MenoqOeVNjI8OYebD+9c1cLm8ge2d/7VEMTol4K4WbxWvligejyExGIemRdsSqSgWS5Vmg4brbvH1RGvHD6v+vimATxGKSXDMA9DE/0spdaz7E/GaqeYUhuuEgAMh3ipuS21E4vEYYlo/IpEINC2KWCVfQYZc/hKMMRhG4TpjzUOSj68lSvV2K90IWDbFslsEHCjx1qI/357GFV8gBHOQ8AuBck5FxEXkoipWWQjB14yR5VaEl2QF3ExuMNAdAg6seGvRv9qaA8NcM0L2G0LwNeN8pVX1c7V4FXCzwq3SaQGHQry1VCzyXKXGbBptEjMBXjCQDRC+gWh0o92LF7cC9ku4VTop4NCJV6QsZkwDfIpSzIIj6Xbl7sA+IdhjnOwCbA+c73bLtmkjAd+cGMXh0bFvwq3SKQGHXrz18DS4MBbbDUKySj0B29GscKt0QsA9Ld6w4lbAfgm3SrsFrMQbUhoJ2G/hVmmngJV4Q0xFwN9A2MholXCrtEvASrwhZ2Vt6xzAdZMMsQlfq2iHgLszm0XhC5UF6bVw+yN9eDDzd215b6fqDw58TI2CL93tlXjDDKUmgYwMD7iuyPCDVgtYiTfMcD5VexiJtD+Jv5UCVuINM5ybmgdmz5sbsyBLqwSsxBtmYjGTeHN5A3/+v1cduZVGApa5phJviEl/MnNazhv+gf/5yyt89+ptR+6nnoBlBhwq8YYetghh0M3Ot3/tOgHLDDhU4g056SeP9jgnC+L5Tgv4wcyPrZEPxhe9XEeJtwdIP3mwzDn5pXi+kwIeiGv48H1zMQwBPvcyV0+Jt0foRgE3O+BQibeH6EYBT06khDNk1u1rlXh7jG4T8K0Jc4iXALNuX6vE24N0k4DHRy2dQF2XbSnx9ijdJGBZlHh7mKALWIm3xwmygJV4FR0V8NvjrHjKvtufDUq8CgCdE/DrI3NBBQc23L5WiVdxTScEfHAkTq7nG25fq8SrMNFOAX/36q215y/nK25fr8SrsNAOARdLV/j2z/umcxx45qWvmxKvwpZWCrhaWWwZbkjJopfrKPEqHKkn4L/sH0hd06kknoP8Jv3pg12Hl9mi+jYoGuI0M3pyIoWP3r9rzQxzwGlGnGwvByVehSucBAyUO/DcvT1ul6eAYukKrw9PHGfEAdjnWnRapgmJEq/CNfUEXGV8dOj637l8wXaCUJVmu+co8So80WhaqVtqR3fJXkOJVyGFvrq1KDMnrjyfgy360ZBbiVchTXU6EwifqySROwl5n4OsgGLZa0ShHkq8Ct+oFE9OmU4GpKO8QqFQKBQKhUKhUCgUCoVCoVAoFAqFa/4fCbut2hEefs8AAAAASUVORK5CYII=","e":1},{"id":"image_1","w":85,"h":85,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFUAAABVCAYAAAA49ahaAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAEE0lEQVR4nO2d/XXaMBTF72OB0AnqThA6Qd0JygalEzQj0A3aCUo3gAnqbEAmKNmATHD7hyTqEuMvycgW73cOJzYY83zzJMuS3pNgJJDMAWT2tQAwb/jKEcDe/RWRYjjruiGxfpjkEkBuX/eBTvsEI/QWQCEix0DnHS8klyS3JI+8DluSK5JNXj8tSGYk11cUsoojyQ3JLLYeXlgxNxGFvMT0xCU5p/HMsbPhFKoFmjozZjHvypHkQ2zdKqHxzm1kgXwoGLBK8G5S0bQvtwDuvK2JywuABxHZ+J5o5vNlmqLzG9MXFDDX8JPkd98T9fZUkhsAn30NGCk7AKu+Dw+9RE1cUMcTgLyPsJ1FJblHuMfKsdNL2E51qvXQWxEUMNdasGN7trWoN1Lkq7iHad20ppWo9i5/i4I6PlinakVjnWrbob89DEqJL23asbWi2rrkgDTaoSF4gblx7esOair+G6igZe5gNKnloqg0PfOfAhqUCvck13UHVBZ/LfaNvABYiMih6sNLnvoAFbSOOwAX+wheeartAvszoEEp8bFqFLfKU9eDm5IO66o3//NU9dJevPLWc09dXc2UdFidv3HuqUfoDaoPb8o9WSdPte1SFbQfq/LO7NIHSidW5Z1T8dei78079zAwA7ToB2LpNlzxz+PYkRS521BRw5G7DQEAkoxmSlq8F5H9zPbsK2HIAFP8s6hmpMUCUFFDcxJ1EdmQlJgDRtTxT3ydDhngOetPecVbQEUdBC3+A6CiDsAMZihaCYjWqQOgooblGTCiph8Uez0OgBG1dgab0okjoJ4amj2gnhqaA6Cd1KExndR25ymqKYngZlg7UbUK8OfRbThRO4W0KJWcNHSiFnHsSIrCbcwAwE6u2sWyJgGeyxEr5cdUrQL6synvlOdSafBEf96VgypOnmqrAPXW7uzOo1R0ero/9dPTreK/rmjQ1Hmsik7RkB8/2oX8qLe2ptJLAQ2j9OH9pWjqyuEU2xJYD2nRxPlRF57eFO9fAPgQ2qKJ8wwT7Huxc79p4G8FEzGs/KMxX1WtqPamNc4Eg3H41iZNc6u8VDZV21dfiybOTkSWzYd1SPZFcovbzVTRKelXF1HnMH2Gt5TsC+iRRa1TWrobFLZVdp9zOk37sf+tHLcxUOg8tPP4Xd+slHOYbsJU27C9M1ICPSeoichRRHKk2Uewg4eggOesPxFZAfiCdB4QvonIchQrWZBckNwPlYX7Chw41shHxl95og/fOfZ8/zQrUUwhPX1BclqBeSRza/jYKDjWot4WGnHHsIbKllMX8xyaVSseeN0b2oGmns+uea1RFvmyF1le5CvksM0j/i3yFWU2Y7SV08rQ3DAymIhutxRdBhvrWcEzzBiaW5LuALMknU4JTZW/U1qiUwiP8oYAAAAASUVORK5CYII=","e":1},{"id":"image_2","w":186,"h":242,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAADyCAYAAAD6Bd/wAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAPn0lEQVR4nO3dXVobR74G8LeqW60vGgkZFA/J2OZ54rkNZwXxDiY7GGYHnrOBISs4mbMCZwPnOCsYZwf2re05Mk6GsYUQSE2jr+6ucyGaMCBA6KtK1Pu7sUBSV7n00vp3qVoNEBERERGRScSiGqrVjp7ETrytlNoWSjw7a/3bRbVP2u1B4QMEPiioD0jw6unWxqtFNT7XoL+t1bellDtKiGdCqW/m2RYtrZ8g8NKJnZdbW2vH82pkLkF//7GxoyCeXw53PptBLuci4zpwHYms50LKhb2pkEa9foQkUegPYvT6ETq9AaIoufiQAMD/OImzu7W19mHW7c80Ze8/NnagsAvgcfo7v5hFseAhn80w1PRvoihB2OmjHfbQ70cX7/px1oGfSfLe1urbwnFepHtw15Xwi1mU/TzDTWPpdAcIwh6CsHf+OwX1vZu4P8yipJk6he/2DnYFxF8BQEqBkp9jwGliUZSgfniCTm8AAFBCvFFxvPOHrerrabY7cRprtaNyLOKX6cxJMe+h+mCFAaeZCDt91A9PkCRq+AuBP3/9aP3FpNubKJUXSxUpBdbXivCL2Un7QDRSkijUD08Qdvrpr378+vH6ziTbunPQz6YMfwaw6roSD9d9ZD13kraJxtJsneKo1Ul/nCjsdwr6xZB7nosvq6ssVWghgrCH+uFJ+uOdwy7HfWCtdlQWjvMCDDlp4BezqD5YSX/807u9g927PH/soMcifimU+sZ1JUNOWlwMu4D46/uPje/Gfe5YQX+3d7ALgW+lFHi47jPkpI1fzP428aHwY6129GSc590a9Le1+nY6T76+VuSBJ2lXfbACb5jD1VjEL8Z5zq1BP6vLUcx7nEIkY1QrxeENgW/HKWFuDPr7j42ddK78woEAkXZZz8VaKT/8QeG/b3v8zXv04QItlPwc63IyTqVUgOtKAPj9P/YOn9/02GuD/v5jYwfAY9eVqJQKs+0h0Yyk2VRQ/3nT464NuoJ4DoB1ORnNL2bP9+pnO+eRRgb9ba2+nS65Lfv5uXSQaFYuTDdee1A6MuhSyp10A6zNyXSrxVx684+12lF51GOuK12+A4BiwZtDt4hmy3VlOq+O2IlH7tWvBP3sk6bHwHDunGgZrP5Wvjwbdf+VoMdOvA0MT2QmWhZexklvPht1/5WgK6W2ASCX40f9tDzyufMd8+NRdfqVoKdfLpRxnct3ERktrdMjRNuX77t2Ht11xl7BS2QERwxnCIUjnly+72qaz0525ipFWjZpua2UenL5vmt325w/p/uE9QlZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysYeWJotxchCLvo9SPE6QVVyWg5z0Uu62KlmINj4GmYRgW9FXRw0AwxiGLdXaE7Oj2/6G0bJT+PjUrRqK9MMSLocaLw66fjC4NFy6wVdBCEXTxc91Ey5NuYtQc9ThQ+/rOJbj/S3RWaoSRR2K+3AcCIsGs/GGXI77f9ehutoHP7A+dMa9APmicMuQU+NQLtx13agh4nCs3Wqa7maYGSROGgGWrtg7agt4IOEk4dWiMIu1qnirUFPQh7upomDZJEaZ1V0xZ0TiXap9sbaGtb+6wL2WMQJdraZtBpYXTOvDDotDCFnL7rYmkLOr9/3T6OxquoaGvZ/+0iqGSJQk7f5Tw1Bj2rq2nSIOM6yGX1La3SGnSTlnHSfG1Uilrb13owulld1dk8LUgh72lfwag16IW8hy/WfZ1doDmTUuCrh1eub7v4fujuQKVUwPqa3rc1mo+M6+DxZsWIU+u0n3gBABuVFeSyGXw2YDknzUbJz+OLdd+IkAOGBB0YHpwW8h5Owi6ax6dcp76EpBTwizmU/RwKeX1TiaMYE3QAcKRAyc+fH7hw4dfykFJqnT68jbk9A4zbK9Dy0n4wSrQIDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZAUjv2Q0PrtuvM5Lai9aLptBIe8t/PvEZzXWjiNRyHnGfqOuUb3q9iI0W6doBR3dXdGm5OexUSnO/UJmp50+mq1TBGFvptvNuA5Kfg6VctGYiwAABgX9cyNAs3WquxvatYIOWkEH62tFbFRW5tLGPMd6EMVoHIVoBV1sVleN+epv7TV6nCjs7R8x5Jc0jkLs19sz3WacKNR+OVzIWA+iGHv7R8a8O2sP+udGwCtbXKMVdGYa9l8/HS/8kjn79bYRr6/WoNtej4+jFXRmUkcfNE+0Be6XT8eIE6Wl7ZS2oMeJwkHzRFfzS+VzI5jq+XGitJaGSaLQPA61tQ9oDPpJ2EWi+a98WQyieKp3vlbQ0T7Wuo/BtAV91tNa990049Vq6y8Pk0Rpfc0Z9CURTlFfm3LNVp0fAGqfdaHxTFp6mHQl7kGUaGubQb/nBgOTgq6vLwz6PZfNZnR34dy8lzXcRFvQpUHrIJbBpCExab1JxtW3X9XWctGQNRDLYpo1I6asN9H5mmsLul/M6mp6KU0zXiaMtZRC6x+ctqCX/LzWmm2ZZFxnqrCW/Lz2UrFSKmhtX+vB6Bfrvs7ml8a04+RIMbclv+PIuA4q5aK29gHNQfeLWZT8vM4uGK9SKsyk9KiUClrGWkqBrx6WtR8Ua59e3KyuMuzXKPn5mb7rLXqspRR4vFkx4vQ6/T3A8AXIuBKNI70r3Ewhz0qNedS1ixrrnOfid9WSESEHDAk6AGxUVlBezeOgGSKwdGWjlAJlP49KuTDXA/V5jnXOc1Ep6ymTbmJM0IHhQctmdRXAKk47fQyiGH2DPsKeFy/jIOtlFrr3uzzW3X6EOJ58LUouO+y/qTNpRgX9IlM+5LBBIe/d+/HWfjBKtAgMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBWO/ZHQQxRgM4nv/jbpexkHGdZA5+1eHacc6vdqcyV9UalTQ40SheRyiFXSNurT3omRcByU/h0q5OPdLocxyrC9eVMAvZlEpFYwLvTFBbwUdfGoEVl4AIDWIYjSOQjRbp9isluZ22cRm6xQHzZO5jHUQ9hCEPRTy3tnVNcz4vnQjavT9ehv79bbVIb8oSRR+/XSMz41g5tver7fxeQE7lNNOH//3yyG6vWiu7YxLe9A/NwK0go7ubhgp3fPOyn69vdCxThKFvf2mEWHXGvQg7KHZOtXZBeM1jkKcdvpTbycIe1p2KEmi8K96a+HtXqY16PN4a76P9uvtqbehc6y7/Wim70yT0Bb0VtCxcmZlEoMoRhD2Jn6+CWPdCrpa29cW9GleOBtNM14mjPUgimdSgk1KW9BDjf/pZTRNSEwIOqD3NdcWdE4l3s2kpUds0DgPosmvYzot7dOLNF+93kB3F87pPE5g0O+5TMaMTyYBzH1Zw00Y9CUhJwyJKR/BA0DW07fiRFvQTVv0Y7riFOOV0xiwi3LZjLa2tQV9XguW7qtpxqu0mp9hTyYjpdC6c9MW9JKfn/jt2DZSCqwUcxM/34Sx9os5O2t0RwpUSgVdzS+VjcrKVCHRPdZSCnyx7mtrH9B8MLpRWWGtfov0RIZpbVRWtNXqm9WS1r05YMCsy1cPy8YcLJkm57n4XbU0s+09+rKy8LHerK4acTymPeiOFHj0ZQUlX/8Bk0kqpQK2fv9gpnvCdKwXETwpBb56WDbmdTViV+pIgc3qKsp+DgczWn+9rAp5DxtrxbmVdM5ZAE87/bmMtTw7HljEea93YUTQU4W8h8d573ylW38Qo9ePjFqvMWsZ10HGlfAyDgp5b2Ef8Fwc6yDsIY6Ticc657mQUiCXzRhRpoxiVNBTw7PhzXjLu+8yrmPF7Jf2Gp1oERh0sgKDTlZg0MkKDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZIVRQW8BQK8fLbgrRNNJbriIwdWgK7y+7UlEJur34+GNBK8u33c16ALHANAfxPPtFdGMDeLrM3sl6ArqNcDShZZLkihEUQIAeLq18ery/Vf36Ge7/R736LREOr0BAEAJ8WbU/VeCnv419PvR+V8Ikek63WHQhVKvRt0/enpR4WcACC2+3ictl/OsiqsHosA1QRdCvASAdtibU7eIZqf3W/XR/vrR+stRjxkZdJnIFwDLF1oOraCb3vzf6x4zMuhbW2vHAH4EgGbrdOYdI5qVJFEIziqPJEl+uO5x1y4BUIl6AQBB2ONenYx1HHSGNxR+/sNW9fV1j7s26E+3Nl6lB6Xcq5OJoijBUWsYdKXU7k2PvXFRV/rkIOydT98QmaJxFA5vKPw86kOii24M+tmT/wYA9eYJ17+QMcJO/3xKMVHJ89sef+syXSdxdgG0oyj57S+ISKMoSlA/PAEAKKjvb6rNU2KcDb+rHTwTUvwdAKoPVuAXs1N1lGhSSaLwz3ob/X4EJcSbp48ebI/zvLFOvHi6tfFKQX0PAPXDE9brpE3jKER/uOCw7cbyu3GfN9YePfV+r/ECwJ+kFNisriLruXfrJdEU6ocnF+fM/2OckiV1p6ADwPsPjVcQ+FZKgfW1IssYmrskUWgchechh8Cfv360/uIu27jzOaOOcr4D8FOSKNQPTy5+/Eo0c2lNPk3Ih0+bUFrGAEAx76H6YAVSTrw5oivCTh/1w/Np7bZK1B9vmy+/zlTJ/Mfe4XMF9V8AwFKGZuVyqaKEeKPieOcuNfllU++C39bq28JxXgilvgGAfDaDtVIe+Vxm2k2TZZJE4TjooBV0L344+TcncXbPFhpObGa1xru9g10B8RcAq8Aw8P5Klnt4ulUUJWiH3X8LuBLiDeLk+aSlymUzLaprtaNyLOMfcFa7A8OSppj3UCx4yGczrOMJwPBkiW4vQjvspfPiqT0I7E5ywHmTuaSuVjsqRzJ6LiB2ADy+eJ/nucg4Ep7nABju+el+i+IEgyhGkij0+zF6g2jUuqmfIPDiujOEpjX33evbWn1bSrmjhHiW1vFEGH4j3CsIvHRi5+W0NfhtFl5HvKsdPJNSbidIygLiCRSeLLoPtHhKDM/OF0K8dmLn9dbW2ge9PSIiIiIiIp3+H/yNcCHjpRNmAAAAAElFTkSuQmCC","e":1},{"id":"image_3","w":216,"h":260,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAAEECAYAAABKq/oNAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAeX0lEQVR4nO2dX3Ybx5XGv6puNEAIAkGR4vAokQnO2H41ZwXiDuysIM4GJjnZQJIV2LOCaHZg74DeAfwqKQFgOxoOBRIgBDXxp7tqHtAFNWmA+NdV1Q3c3zl+oAii22R/qFu37ncvQBAEQRAEQRAEQZiC2b4BItu8ql+ecodXpZSnDKwKieq010kmzzl4RwhRc+HWTk72OkZv1BIkMGIh6vV2JUBwCo6ziZAYXqz6fpKxH5mU50KIl5+fHNaSu9N0QQIjfsXr+rsz5rAqJE4hcQqGUwC7017LOYOXc+DlHHDGUMi7v3pNEAoEgUAQCgxHIYaj8P5LmgzsWy74y01b2UhgW0y93q6GTngahXenkrEqk/KLWa8v5F24DofrcBTy7lhUfPlHSAgJvz9CfxDA748ghFTf6krIb1zhfrspQiOBbQEqvOOcn0rI03nhnevwyarkec7kax0osXW6fQShUP/cBcMfP/3k4KWWixqEBLZhqPBOSlllkp0tGt4pEU0L8UzR84d3hSbxgyOdr7K8mpHAMkq93q4GCKpR0mFueBcXUiHvwnXHoV4a6XT76Lzvqy+7UsgvPzt5em7xllaGBJZy7oV31Sjp8GB457ocBc/VHt7pZDgK0Wr7HxMiDH/IYshIAksR0ZnSaSy8qwI4nvbatIV3OhBC4vrmFj1/OP6HDIqMBGaBVcK7uIjSHN7p4PrmFt3eYPxFxkRGAtPM6/q7s3vh3cykQzy8c92PmTxinABptf3xFxkSGQksIe6UDM0J7wBMzpHiKfFVzpS2iVbbn4SLQoj/zEIFCP1Fl+ReeFeVjJ1SeGeOy6sP8PsjAOg6wjlOewqfBPYAy4R3KumgwjuVDieSRQiJi1ZPZRe///T44Cvb9/QQJDD8qiL8FMAp5oR3d6odKLwzynAU4u3l+/EXDL/79JOD7+ze0Wy26qlYtiL8zh7J+5gSJ+wTO4xufnp8ULV8OzPZWIGtWhEer3Yg0osQEr/8X3dcKJzirGLmBXa/IhwLhnfrVoQT9oml7lO7imXmyUpzRThhj5/+9ybVq1gq46BpFeEhwl0GBonIOxR9NFB4t92UH+XHezGJrwC8tH0/97G6gi1r+MtSRThhhiAU+OWiCwBwhHNycrLXsHtHdzH2UR+J6SyWdHgRIgQkwCKdMzlenTalIpzQj3o2hqMQoROeIWWrmFaB1evtiuDia8HwdSjDL1R0Ny2829SKcEI/paKH65vbVIaJWp7mer1dDXn41xDh7wGARcIq5F0UPJfCOyJRYh/KZxZvYyqJ7sGUsAD8Xv1bIe+iVPRQLOQoHU5oo/GvcUli2vZhia1gr5vv/hoi/DOAx8B42S6X8rR3IoxQyLvoDwIECKoAGpZvZ8LaAqvX29XAEd+p7F8h7+LJ7g4JizCKl3PQHwQAxxmAc8u3M2Etgb2uvzsLefg9kyhzzvBkdwelopfUvRHEwqj9fFTNkxpWFtibn1pfQ+LvwPjT43D/ESUtCGuoiEkyVrV6I/dYSWBxcZWKHg72isneFUEsiRLYQ4UKNlh6ySFxEWmEczaJoF7VL1MTJi4lsNf1d2ckLiKtuO74ceYOz57A6vV2lXH2PUDiItJJwRvveKSUVbt38pGFBRay8CWAspdz8GR3R98dEcSKqBWMSXZm904+spDA/tG8+hMYXnDOcLj/iCoyiFQyOXtl06ds2mCuwOr1dkVC/g0AKo8LlIonUkusuOG4Xm9XbN6LYq5aQh5+C6BcyLsol/IGbokgVkeJLECQikTHgwKr19tVRIW7lccFE/dDEGuhBMZ5OjKJDwosqowf20zIp0VkALWFkUhHJnGmwKIY9ncArV5EdpgsBBLpXsFCJ/wKQJmayBBZQqXqH+o4ZpLZIeLYfk2JDSJTuA6fHCNFOQSrPLQH+xIAijs5Q7dCEMmgEh2hE1oPE6cK7HX93RmASQdcgsgSE+uKlOkUWOQKpdWLyCRpMl9OFZi6MbL9E1kkTebLqQJTN0bhIZFFVNY7DebL6StYrIENQWQRtTiofIK1+7B5cSL7jIIQg2GIwTDAYBggFOMuswXPRd5zsFPIIeea32q4LkcQCjCHVY1fPH4fNi9OZAchJPqRiAbDAKNA4HY8jHwq8e+Vih72K0XkPXOPW8Eb90m0bb4kgRG/wu+PEAQhRoGA3x9hMAzGM7hWpOcP0fOH2K8UsV8x44T3PNUEx675kgS2xdwP70aBwGAYaLveVcfHKAhxdPBY2zUUkwQds1uTSALbAuLhXRAI9IfBg+GdTrq9AXKuo30lix0x7dbr7crJyV5H6wVnQALbMOKrUTzUSxNXHR+loqd9T6bmhkXmy3OtF5vBrP/DJoDj4Sikw+aUMoqEcxvtkXSHd0lzef0Bz492tV5DCSwyX55rvdgMpgtMogGG4yAUJDDLpCm8S5Lb/gijINSawo+ZL63tw6YKTDJ5zsBeDIchigWqRzRFfCVKa3iXJD1/iL2yvhaAhbwLvAcg7XWZmiowxlgDEuhnKOTIEvHwLp7J2zZu+yOtAkuD+XL6ChbKBuMMwQZ/eppCnSOp8G7dM6VNItT8e1DmSyEk6vV21cbky6kC++zk6fmbZgtBSAJblG0L77KCGswXmS8bpq8/M08qGfuRSflFfxBQ0W8MlXRQ4d28kiHCLkpgkfnyO9PXn6kcJmUDwBfDUbi1AlMr0WAYUningYKB2sTJ3DBL5svZKxhkjYF9uQ1hYjy8ix/UEnrJe/qPgGKexnQJjDFWgwSGo9Dk/Whl2YpwQh+cM5SK+juWxaKvY+0Xm8JMgTmhUwt5mFmBJV0RTiTLXnnH2JQe1xl7w17X3519dvL03MhF1bVnfePkZK/xptmCEBJBKFLbPsB0RTixPjmXaz3/uo+Xc6yZLx/eZUr8AIYXQZAOgakUOIV32YVzhmeHZaMz5rycA78/stJO+2GBMTQAvLCdqu/2+pGXiBIPWYZzhudHu0adzcBH86UNgT24LDGwGgBrB86jIETzbQcXrR6JK+PsFHI4flYxLi7ArvnyQYEJIWqAnUziYBig+bZD+6mMUyp6+O3RLp4f7VppfgP82nxp8toPfpy4cGshzGcShZD4+eKGsn4ZIudyuK6DYiGHnMuR91wrq9UsCvlxExzT5ssHfwMnJ3udN83WDYBdk+bLf112SVwpZqeQQ8Fz4UZCKniu0aTFKkzCxHFb+HNj1537CokaGF6YMl/6/RFlB1NC3nPvrEZ5z7EW5q1LrF991eh1573AtPmy073Vfg3iLpwz5D13Et6pUG+TsGW+nCsw0+bLnj80cp1tZefeHikL4V0STKIvw+bLuQIToahxzo2YL30KDRPjbmiX7fAuCThnE/Plq/rl6ecnhzUT150rsM9PDmvKfCmE3IpPuyyhwjvVC34Tw7ukUN4w7vAqgHQIDPhovtxmb1gaUOFdznUmmTz6wFscG+bLhdRC5kuz3A/v1NfEetgwXy62ghkyXzpb9mkcD+/UmRKFd/qwYb5c7GNR4Bwcf9Fd0ZGPQp5NPGSOJxrioR5hDhvmy4UE5sJthAjRH+hP1ZeKHrq9gfbr6CJ+jkThXfpQ7bRNmS8X+ssr8yUA7ebL/UoxEwKj8C6buA432q9+8Y9WQ+bLnOtgr7yDdooqOuIrEYV32UaZLyXMTL5cXGAMNRgyX+5XihPnsknSXhFOrI9p8+XCTw8Da0hII9YV5Xz9+eJGm8iyWBFOrE+sZCpdAhNC1BhnxtzNSmRXHX+tcJHCOyJObHuza6Jf/cICs2G+5Jzh6ZNHqJQLuOr46PnDmSn8bagIJ5IhZr6sQnO/+oUFFpkvrUy+zLnOZHC23x9BCInBMJgIicI7YhlMmi+X28FHky9tjpZVq1Kp6Fm5PpF9YiVTVd3XWirfLpk8B0Bzw4hMowQmmf6axKUExhhrADT5ksg2kxVMyi90X2spgYlw3MaNVjAiyyjzJQC8ql9qXcWWEphygSrzJUFkFbWKReZLbSxd8yQZ+xHYrLFGxPahhv9F5kttLC0wJqW1br8EkRSuG7Vxk+xM53WWX8EgG4C9fvUEkQSxfvVVnddZvixejA/maAUjsowp8+XSAnPhNgAYMV8ShE5UouN1/d2ZrmssLbCoOPIGoDCRWI5REMLvj+78ZzMbrcLEyHyp5xor/VTUr344ClMx+ZJIH8rPFwRiMnh+lpjynou9cgHlUsHoPZowX64msMh8aapfPZFe4nOx43Oyl32Pi1YPVx0fzw7LxkyusX716VrBTJoviXQhhMRNr4+eP0x8Cs4oEGi+7eDooGRkNVOpep3my5XiOzX5kvZg28VVx8c/f7nGu+sPWkdMXbR66Pb62t5fcd98qeMaKwlMtbuiFWw7EEKi+baDq45vLClxef0Bo0D/86XS9ZH5MnHWyVA0AUrXbzpqnK/pBkRCSFx1fO3Xmfgax+bLxFldYHJstaYwcbP512XX2iD6bm+gfRWLTb7Usg9bWWBkvtx8ur2+9XG+ugcyxsyXVR3vv3I+lDFWMzn5clsRQk7OkdSZUpycy1Es5LRk3UyEaPPo+UPslXe0vb9u8+XKAhOhaHDOKdGRIPFzJL8/QhCEc8+UbjEOpS6vP2CvvIP9SjGxe1n2PEsHupMqnDO4DkcQCi2TL1cWmJp8KYSkyZdLMoqEcxtVO6iD2nVQSYGeP8Szw8dr935My6xsE/s/1x0LjDv8FAlPvlzryJwmX87nfsmQ7j3NYBig+baD42eVtURmIkW+CCY+uAueqyZfVpN+77VUEZkvSWC4WzK0aHinCyEk3l6+x/Oj3ZUf0DSEhwCMlE3pNF+ut4JBNhjYVu3D4uHdKAgxGIbW0tgPMRgGaHdvE9uT2aJgQGCxfvXVpN97vbuPJl9u6lnYMhXhaeSq42OvvLPSKpZzOdIwQOqRgQazsSa6x/V6u3JystdJ6r3XEpjqV5/1ao4kKsLTyk2vv1Kaexya2R2EqI4gTKAmXwYIEh3Mt5bAon71NwB2dU++TAJ1pqTCOxXqbTKrniOVih7eXX/QcEeL82/RPAIT6Jp8uX6Am1LzpUo0DIZhJsO7pFj1A0QNa7f1AbRX3jHqNdRlvlxfYCkxXyqfUrc3SGXSIYvsV4r45eLG+HXLpTyePnlk9Jq6zJfJCEzata70/CEuWu+3coXSSbGQMz4ve6+8Y1xcwB3z5Ysk33ftmE6G4z6JtgR20XqPt5ddEpcmnj55hHIpr/06paKH42cVK+ICxnswlW1N0ny59gr22cnT8zfNlhXbykXrPbo9u5mutJPEQa0afpjU71pNIy14LvKeE432tT/W18s5iU++TOoUrwnguD8IjFV09PwhiWsBktoXHx08RqmYx7vr3lJHGPlIRCppkuYZ2UpgSU6+TEoNNQDHplYxISQuWu+NXCvrJBnelYoeSsUnk4Y38exsPhrjWyzk7gyezxI6zJeJ/AYkZI2BfWlqH3bT69OeawF2ooc9acZC27wRvjrMl4kcXDHGjE5codBwPpwzHB2UbN9GplDbmyTNl4kITISiAZgTGJ1zzefoYH1P2DaiwsSk+tUnIjDlAlXmS534G17atC5q5drEEM4EE+uKw6pJvF9ytU0SPwDUK9EmO4Ucnh/tGu/xvknEJl9Wk3i/5HbADA0AL0ym6olxxflO1PSG5gSsj+epJjjJmC8TU4IyX+pO1efc9BQUm0adI43PlsYHtdQLJVliky8TSdUnt9QYMl/mXAecs41O08dFFD+oJfQTM1/uJmG+TExgJs2XpaK3Ean6+yVDrutQmJcCkjRfJiawuPlyOArjnwSJUy4VMieweJnQTiFH4V2KUQJLwnyZbDYiMl8GodAqsGIhZ9UM+BD3w7sslgxtO2ofJiHX3ocl+5c3aL78zWEZ//zl2tpeLB7euZGIKLzbDGLmy+q675W8wAyZLzlneH60i58vbrSLLEsV4cT6JGm+TFRgMpQNxs31Scx7Lp4f7eKi1UukfCrn8kmigcK77UWZL4WQqNfb1ZOTvcbK75XgfVkxXyqRtbu3aHdvF17NVKKBwjtiGsobFjrhKdYwXyb+8az61Zus6OCcYb9SxH6leMerpHCi/RKFd8SiKIFJKU8BfLfq+ySuACZlAxb71W+qV4kwS1Lmy8TrjiRkDaDRskS2Scp8mbjATJsvCUIHSZkvExeYEzokMGIjSMJ8mbjAVEpTCElhIpFpJvOb1zBf6vF+RObLYEMmlBDbyaTcb4122noENjZfZn6sEbHdKPNl6gTGwCiTSGSeJMyXWgQmhKBEB5F57psvV3kPLQJz4ZLAiI1Apesj8+XSaBFYZLO+AUhkRLaZhInjfvXL/3yC93IXQ+ZLIvvE52KryaRqwIRyNOwUctgtFYy7wGMlU9WVfj65W7mLZPKcgVmffEmkh/hc7Pjg+Yd/RmAUDNHzh3h3/QH7lSL2yjvGhLau+VKbwBhjDUjcqWontgchJHr+YDIjO6n2DlcdH91eH88Oy0a8epPoa0XzpbYmg2ryJR02bxejIMRF6z3e/HSFi1YP7e5t4r1TRoHAzxc3RmYUcM4mq+Wr+uXSiQ5tAvvs5Ok5QGdh20S310fzbcdIxy8hpLHRwWoV4w6vLvuzWtvkSsZ+BKiiYxvo9vq4aPWMNiEaBQJXHV/7dSbWFbl8lymtAovMl5Sq33B6/hAXrZ6Va7e7txgFep+vSdHvCuZLvSsYmS83njSM8+35Q63vPzkLw/IlU3onKYhxV1Rawczh90fo9vq46vi46vhod2+1zlS76vjW5wToFlis9cXxsj+rNc/pwm2ECElgGoifI8UPamfBOUOp6GG/Uky06c9Nr5/Ye62KiWyi63AEocDr+rszlcBb6Oc03hNOTvYab5qtifkyttQSCyKERP+eiFZJewsh0e0N0O0NJh241sXvj6yvXgCMZRKDUCxtvtR/UifxAxheBAEJbB7xMiE/qnbQ8fBcdXwMhgGODh6vVRGRxtkAuvByzjjUXtIbpl9gUb96mnz5kVEQYjAM76xKpge79/whLq97ODp4bPS6WWVV86X2J56BNSTkVu7DkgrvdNHtDZD3XOyVd2zfylrsGKh1jZVMpUtgQoga4/pHy9rmoYrwNHPV8a1UqSeJiUazse3N7jL96rULTE2+3JQVbJWK8DQjhMRNr7/SKpaWedmmOjkX8i76gwABgioW7FevXWDR5MsmgGPdky+TJB7eBYFItCI8bfT84UoCMxGazaNcyhubNXDPfHm+0M9ou5s4Eg2w9Aosq+FdUqz6wZFzHeQ919oKzjnD4ZOSsevFSqaqi/6MEYEp82UarCvKpzROg4eZDu+SRAi50j5sr1ywUoeoBjCa3DvG+tUvnOgwIrA0mC+FkEvPENsm+sNgJed5uVTATW9gNHxW4jI9HHGygi3Rr97ILlWE4zZutlawwTBA8207FXVzaWWdhMVvDsvGEh7lUh7//tsnViaPrmK+NPJb+fzkcFJVb/oBHwwD/Hxxs1V7qlVYJ1HAOcNvNa4oO4Uc9itFnPx2b+3qk3VZ1nxp7GNATb40OZhPCGlkSHrWSSIbmHMdPD/anVTwr/YePBo4794ZPJ8mCp671ORLYwKzMfny8tqswzarJHWOxDnD0yePUCkXcNXx0fOHU3//PBrpW4hEpAbPZwE3CoWZZGcLvV7nzcSRkDUG9qWpio5REBrpDZF1OGfYLRUSfc+c60xqHEf3jjwKnpvpqpFYv/rqIq83dxRv2HzZ6dr3KWWB/UpR6wOfi1Yn9V+WxQUsb740JjAXbgMw1wCn59PqNY9S0ct8oa8NVKJjkcmXxgQWFUfeAGZ6dFDW8GHynktWlRVRYSLnfG6q3my1poSR8zCdPSg2gb3yDo6fVTIfrtliUtEBWZ33WrMCG5svqU+iJcqlPI6fVfD0ySPbt5JpljFfGj0ON2W+LFg45U8bec+9M5kk69m7NLGM+dLok2jKfKlKWrbhDCzn8sk5UvygltDHMuZLo3+Jz06enr9ptoyk6ouFnPZ+eaZRK5EbCYlWJXssar608VHXBHCsuwlOuVTIrMDuh3c5l6euZGjb8XLOOJcwx3xpXmCR+VJ3mFgqelbNgIugSoZUeJelkqFtZ9HJl8YFZtJ8eXRQQvNtR/t1FmHn3h6Jwrtss6j50rjAGGM1U+bL8WFqyajjNh7epbUinFifRc2XxgUmQtHgnBurSSxHhaxJiyzLFeHE+nDOJv3qX9UvT5Xn8T7GBfb5yWFN9atftQ/EspRLBeQ9F5fXH1aytscTDXSmRChcdyww7vBTAOkQGGDHfJn3XDw/2p2M95nmVbpv+FNfE8Q0YubL6qzXWHl6mJQ1GDZfKpRtQuH3R5QGJ1ZiEfOlnRUMssHAUtHtl/ZNxKrESqaqs15jp/dxZL7c9H71xGYTa6J7XK+3K9NeY0Vgps2XBKELJbIAwdTzMCsCM22+JAhdzDNf2huPEZkv07API4hVmWe+tCewyHw5HJLAiOwyyYLPMF9aExgDawC0ghGbgeQsPUkOYGy+BGgPRmSbeTWJ1gT22cnTc4BWMCLbzCuZsz0DtAlQup7YXGwLjMJEYqOxKjAJSal6ItPMWxysCowxRgIjMs3EmS/xw7TvWxWYCEUDIIER2UXIh1sDWhWYcoEq8yVBZA1VKCGZPJ/2fdtJjsnSSqsYkUVUbxnGxoUT97EvMDZu2kipeiKLqOfWCZ3zad+3LjAJ2QAoVU9kj9gUn+as9tnWBUbmSyKr+LcTgc0chm5dYC5cGmlEZBK1gkkh0yuwk5O9DiLzJSU6iKwQ60rWVHW107AuMAAfJ19SmEhkhE63DwBgYN8+9Lp0CIzMl0SG6PlDtRh0ueAvH3ptugRGISKRcoSQk9VLQn4TbXFmkgqByXCcqieBEWmn2xuo1etnV7gPhodASgSmNom0ByPSTH8QoPN+vHqB4b/mrV5ASgQWQeZLIrUIIdFq++rL7z/95GBmaj5OmgRGmUQitVy0eurZbDrC+XrRn0uNwMh8SaSVVttXz2VXCPHVIqGhIjUCI/MlkUZabR89fwgAkEJ+OWvQ3ixSM/zKCZ1ayEMSGJEKhJC4vP7wMSfA8IeHKjZmkZoVTFUjCyFpH0ZYZTgKcdHqKXF1wfC7Tz85eLnKe6VGYAAm5stJnwOCMEy3N8BFqxffc71YNGM4jXQJjMyXhCX6gwBvL9/j+uZ2XMQr8YMjnONl91z3Sc0eDAAYWE1C/p5CRMIU6vA49qHeZWB/+Y/q/twqjUVIlcCEEDXG0zFalthchJDw+yN0e4P7z9r/OML50zJp+HmkSmAu3FqIcSZRCDm37zdBLEIQCgxHIYbDEH5/NO0D/H8c4fx1lu1/HVL3BL/+6arGpPzicP8RDSgnlqY/CDAchR9FFX1Y30cy9iOXeMkFf5nkinWfVK1gAMCkPAfwhX87IoERM5mIaBiiPwwQBOLh4x2JH8BQA0PNCZ3vdIoqTuoEJoR4yTn/Y6xjD7HFCCExHIXoD4I7q9IsJGM/MikbErLGGKs5oVPTEfotSupCRAB402w1ABwf7BVRKnq2b4cwxH0RzQrvIm4gUZNMnjPGGjKUjVUqLXSTuhUMGPc5kJDfdHsDEtgGEg/vlJAWCO8aDKwmhKi5cGumQrx1SeUKVq+3KyEPmwDKRwelj4OmiUxxP7wLQjGviKAJoKbCOxGKxroHvbZJpcAA4HXz3V8Z2F+8nINnh49t3w4xh4mIAoH+MFgovFNJh7SGd0mQWoHFV7Enuzsol/K2b4nA3TOleDp8JlF4JyEbEDjPUniXBKkVGAD8o3n1Jwn5DecMzw4fw3XSVTq5yajwLr5H2rbwLglSLTDg48FzIe/i6KBk+3Y2komIlgzvGFhDCFHb1PAuCVIvsHq9XQ15+COAcrmUx5PdHdu3lFkme6R71Q6ziM6UarHwrmHzTCmLpF5gAPDmp9bXkPg7ANDZ2Hzi4Z0S0dzwTqIRnSlReJcgmRAYALxptr4F8EeARBbnfni3aMkQhXdmyIzAAOBNs/USwO+B7RPZiuFdQ0LWKLyzR6YEBtwV2abuyRatCI+Ih3cNEYoahXfpIXMCA+6Gi4W8i4O9YiZT+KtWhKvwbtvOlLJIJgUGTBIf/w2gzDlD5XEhtYfR8fAuixXhxOpkVmAA8Kp+ecoc5yWT8gsA8HIOnuzuWK1d3MSKcGJ1Mi0wRVTx8TcAZWAcNpaKntYkyDZVhBOrsxECA8a1iwEP/sTA/gzgMQBwzlAs5FDcyaHguSv1+Fi3IpzCu+1mYwSmiAntawDH8e95OQdezoHr8Jlh5BLZu62pCCdWZ+MEFudV/fKUc/61ZOxM7dNWYssrwonV2WiBxanX25UAwSk4zhhYBRKnU18YCYlKhgiCIAiCIAiCIAgiW/w/zQ1m2VyA5iUAAAAASUVORK5CYII=","e":1},{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":2,"nm":"magnify","refId":"image_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":42,"s":[75]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":90,"s":[8]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":121,"s":[32]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":134,"s":[32]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":164,"s":[53]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":183,"s":[53]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":219,"s":[53]},{"t":272,"s":[0]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[333.752,339.42,0],"to":[-26,-25,0],"ti":[-4.333,25,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":42,"s":[177.752,189.42,0],"to":[4.333,-25,0],"ti":[-25.667,-23.333,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":90,"s":[359.752,189.42,0],"to":[25.667,23.333,0],"ti":[4.667,-23.333,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"t":121,"s":[331.752,329.42,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":134,"s":[331.752,329.42,0],"to":[-28.333,4.667,0],"ti":[28.333,-4.667,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"t":164,"s":[161.752,357.42,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":183,"s":[161.752,357.42,0],"to":[0,-24.333,0],"ti":[-28.667,3,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":219,"s":[161.752,211.42,0],"to":[28.667,-3,0],"ti":[-28.667,-21.333,0]},{"t":272,"s":[333.752,339.42,0]}],"ix":2},"a":{"a":0,"k":[87.194,86.29,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"glass 2","parent":1,"refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":20,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[68.687,68.686,0],"ix":2},"a":{"a":0,"k":[42.065,42.066,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":2,"nm":"glass","parent":1,"td":1,"refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[68.687,68.686,0],"ix":2},"a":{"a":0,"k":[42.065,42.066,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":0,"nm":"paper","tt":1,"refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,250,0],"ix":2},"a":{"a":0,"k":[250,250,0],"ix":1},"s":{"a":0,"k":[125,125,100],"ix":6}},"ao":0,"w":500,"h":500,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":0,"nm":"paper","refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,250,0],"ix":2},"a":{"a":0,"k":[250,250,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"w":500,"h":500,"ip":0,"op":750,"st":0,"bm":0}]},{"id":"comp_1","layers":[{"ddd":0,"ind":1,"ty":2,"nm":"paper_1","refId":"image_2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[263.625,231.897,0],"ix":2},"a":{"a":0,"k":[92.771,120.853,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"paper_2","refId":"image_3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[214.478,258.49,0],"ix":2},"a":{"a":0,"k":[107.933,130,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0}]}]'),layers:[{ddd:0,ind:1,ty:0,nm:"not_found 2",refId:"comp_0",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[250,250,0],ix:2},a:{a:0,k:[250,250,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,w:500,h:500,ip:0,op:273,st:0,bm:0}],markers:[]},sS={key:0,class:"inline-block"},li=Ot(e.defineComponent({name:"DCodeBadge",inheritAttrs:!1,__name:"DCodeBadge",props:{text:{default:""},variant:{default:"default"},size:{default:"sm"},icon:{},dot:{type:Boolean,default:!1},pill:{type:Boolean,default:!1},color:{},skeleton:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},class:{}},setup(t){const n=t,o=e.computed(()=>n.icon?Gt[n.icon]:null),r=e.computed(()=>n.visible??!0),a=e.computed(()=>{const f={xs:"px-1.5 py-0.5 text-[10px] gap-1",sm:"px-2.5 py-0.5 text-xs gap-1.5",md:"px-3 py-1 text-sm gap-2",lg:"px-4 py-1.5 text-base gap-2.5"};return f[n.size]||f.sm}),s=e.computed(()=>{const f={xs:"w-1 h-1",sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"};return f[n.size]||f.sm}),i=e.computed(()=>{const f={xs:"w-2.5 h-2.5",sm:"w-3 h-3",md:"w-4 h-4",lg:"w-5 h-5"};return f[n.size]||f.sm}),l=e.computed(()=>{const f={default:"bg-primary text-primary-foreground border-transparent shadow hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground border-transparent hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground border-transparent shadow hover:bg-destructive/80",success:"bg-success-500 text-white border-transparent shadow-sm hover:bg-success-600",warning:"bg-warning-500 text-white border-transparent shadow-sm hover:bg-warning-600",info:"bg-blue-500 text-white border-transparent shadow-sm hover:bg-blue-600",outline:"bg-transparent border-border text-foreground",tonal:"bg-primary/10 text-primary border-transparent hover:bg-primary/20",ghost:"bg-transparent text-muted-foreground border-transparent hover:bg-accent hover:text-accent-foreground",purple:"bg-purple-600 text-white border-transparent shadow-sm hover:bg-purple-700",pink:"bg-pink-600 text-white border-transparent shadow-sm hover:bg-pink-700",dark:"bg-gray-900 text-white border-transparent shadow-sm hover:bg-gray-950",light:"bg-gray-100 text-gray-900 border-gray-200 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-100 dark:border-gray-700"};return f[n.variant]||f.default}),c=e.computed(()=>({default:"bg-primary-foreground",secondary:"bg-secondary-foreground",destructive:"bg-destructive-foreground",success:"bg-white",warning:"bg-white",info:"bg-white",outline:"bg-primary",tonal:"bg-primary",ghost:"bg-muted-foreground"})[n.variant]||"bg-current"),d=e.computed(()=>{const f={xs:"h-4 w-10",sm:"h-5 w-14",md:"h-6 w-18",lg:"h-7 w-24"};return Ie(f[n.size]||f.sm,"rounded animate-pulse bg-muted")}),u=e.computed(()=>Ie("inline-flex items-center font-semibold border transition-all duration-300 select-none focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",n.pill?"rounded-full":"rounded-md",a.value,l.value,n.class));return(f,h)=>r.value?(e.openBlock(),e.createElementBlock("div",sS,[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(d.value)},null,2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(u.value)},[t.dot?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["rounded-full animate-pulse",s.value,c.value])},null,2)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{key:1,class:e.normalizeClass(["flex-shrink-0",i.value]),"stroke-width":"2.5"},null,8,["class"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},()=>[e.createElementVNode("span",null,e.toDisplayString(t.text),1)],!0)],2))])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-42cc5d83"]]);var ka={exports:{}},iS=ka.exports,fu;function lS(){return fu||(fu=1,(function(t,n){(function(o,r){t.exports=r()})(iS,function(){Array.isArray||(Array.isArray=function(s){return Object.prototype.toString.call(s)==="[object Array]"});function o(s){for(var i=[],l=0,c=s.length;l<c;l++)i.indexOf(s[l])===-1&&i.push(s[l]);return i}var r={},a={"==":function(s,i){return s==i},"===":function(s,i){return s===i},"!=":function(s,i){return s!=i},"!==":function(s,i){return s!==i},">":function(s,i){return s>i},">=":function(s,i){return s>=i},"<":function(s,i,l){return l===void 0?s<i:s<i&&i<l},"<=":function(s,i,l){return l===void 0?s<=i:s<=i&&i<=l},"!!":function(s){return r.truthy(s)},"!":function(s){return!r.truthy(s)},"%":function(s,i){return s%i},log:function(s){return console.log(s),s},in:function(s,i){return!i||typeof i.indexOf>"u"?!1:i.indexOf(s)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(s,i,l){if(l<0){var c=String(s).substr(i);return c.substr(0,c.length+l)}return String(s).substr(i,l)},"+":function(){return Array.prototype.reduce.call(arguments,function(s,i){return parseFloat(s,10)+parseFloat(i,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(s,i){return parseFloat(s,10)*parseFloat(i,10)})},"-":function(s,i){return i===void 0?-s:s-i},"/":function(s,i){return s/i},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(s,i){return s.concat(i)},[])},var:function(s,i){var l=i===void 0?null:i,c=this;if(typeof s>"u"||s===""||s===null)return c;for(var d=String(s).split("."),u=0;u<d.length;u++)if(c==null||(c=c[d[u]],c===void 0))return l;return c},missing:function(){for(var s=[],i=Array.isArray(arguments[0])?arguments[0]:arguments,l=0;l<i.length;l++){var c=i[l],d=r.apply({var:c},this);(d===null||d==="")&&s.push(c)}return s},missing_some:function(s,i){var l=r.apply({missing:i},this);return i.length-l.length>=s?[]:l}};return r.is_logic=function(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length===1},r.truthy=function(s){return Array.isArray(s)&&s.length===0?!1:!!s},r.get_operator=function(s){return Object.keys(s)[0]},r.get_values=function(s){return s[r.get_operator(s)]},r.apply=function(s,i){if(Array.isArray(s))return s.map(function(y){return r.apply(y,i)});if(!r.is_logic(s))return s;var l=r.get_operator(s),c=s[l],d,u,f,h,m;if(Array.isArray(c)||(c=[c]),l==="if"||l=="?:"){for(d=0;d<c.length-1;d+=2)if(r.truthy(r.apply(c[d],i)))return r.apply(c[d+1],i);return c.length===d+1?r.apply(c[d],i):null}else if(l==="and"){for(d=0;d<c.length;d+=1)if(u=r.apply(c[d],i),!r.truthy(u))return u;return u}else if(l==="or"){for(d=0;d<c.length;d+=1)if(u=r.apply(c[d],i),r.truthy(u))return u;return u}else{if(l==="filter")return h=r.apply(c[0],i),f=c[1],Array.isArray(h)?h.filter(function(y){return r.truthy(r.apply(f,y))}):[];if(l==="map")return h=r.apply(c[0],i),f=c[1],Array.isArray(h)?h.map(function(y){return r.apply(f,y)}):[];if(l==="reduce")return h=r.apply(c[0],i),f=c[1],m=typeof c[2]<"u"?r.apply(c[2],i):null,Array.isArray(h)?h.reduce(function(y,p){return r.apply(f,{current:p,accumulator:y})},m):m;if(l==="all"){if(h=r.apply(c[0],i),f=c[1],!Array.isArray(h)||!h.length)return!1;for(d=0;d<h.length;d+=1)if(!r.truthy(r.apply(f,h[d])))return!1;return!0}else if(l==="none"){if(h=r.apply(c[0],i),f=c[1],!Array.isArray(h)||!h.length)return!0;for(d=0;d<h.length;d+=1)if(r.truthy(r.apply(f,h[d])))return!1;return!0}else if(l==="some"){if(h=r.apply(c[0],i),f=c[1],!Array.isArray(h)||!h.length)return!1;for(d=0;d<h.length;d+=1)if(r.truthy(r.apply(f,h[d])))return!0;return!1}}if(c=c.map(function(y){return r.apply(y,i)}),a.hasOwnProperty(l)&&typeof a[l]=="function")return a[l].apply(i,c);if(l.indexOf(".")>0){var g=String(l).split("."),k=a;for(d=0;d<g.length;d++){if(!k.hasOwnProperty(g[d]))throw new Error("Unrecognized operation "+l+" (failed at "+g.slice(0,d+1).join(".")+")");k=k[g[d]]}return k.apply(i,c)}throw new Error("Unrecognized operation "+l)},r.uses_data=function(s){var i=[];if(r.is_logic(s)){var l=r.get_operator(s),c=s[l];Array.isArray(c)||(c=[c]),l==="var"?i.push(c[0]):c.forEach(function(d){i.push.apply(i,r.uses_data(d))})}return o(i)},r.add_operation=function(s,i){a[s]=i},r.rm_operation=function(s){delete a[s]},r.rule_like=function(s,i){if(i===s||i==="@")return!0;if(i==="number")return typeof s=="number";if(i==="string")return typeof s=="string";if(i==="array")return Array.isArray(s)&&!r.is_logic(s);if(r.is_logic(i)){if(r.is_logic(s)){var l=r.get_operator(i),c=r.get_operator(s);if(l==="@"||l===c)return r.rule_like(r.get_values(s,!1),r.get_values(i,!1))}return!1}if(Array.isArray(i))if(Array.isArray(s)){if(i.length!==s.length)return!1;for(var d=0;d<i.length;d+=1)if(!r.rule_like(s[d],i[d]))return!1;return!0}else return!1;return!1},r})})(ka)),ka.exports}var cS=lS();const cn=sl(cS),dS={class:"dcode-card animate-slide-up"},uS={class:"px-4 py-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30 dark:border-primary-900/50 rounded-t-xl relative z-30"},fS={class:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4"},hS={key:0,class:"flex flex-col sm:flex-row items-start sm:items-center gap-2 flex-1 xl:max-w-[15vw] md:max-w-[20vw] max-w-[30vw]"},mS={class:"relative w-full sm:w-64"},pS={key:0,class:"relative"},gS={class:"flex flex-col h-full"},bS={key:0,class:"flex-1 overflow-y-auto py-4"},yS={class:"grid grid-cols-1 gap-4 px-1"},xS={key:0,class:"sticky bottom-0 left-0 right-0 bg-transparent border-t border-neutral-200 dark:border-neutral-700 pt-4 flex gap-2"},kS={class:"flex justify-end gap-2 w-full"},wS={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},CS={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},ES={class:"dcode-table w-full"},BS={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},_S=["onClick"],SS={key:0,class:"flex items-center justify-center w-full"},VS={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},AS={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},DS={key:0,class:"px-3 py-0.5"},NS={key:1},MS=["colspan"],vS={class:"flex flex-col items-center gap-2"},PS={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},TS={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},OS={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},FS={key:0,class:"flex items-center justify-center"},zS={key:0,class:"px-3 py-0.5 !text-center"},IS={key:0,class:"flex items-center justify-center gap-1.5"},RS={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},LS=["colspan"],$S={key:0,class:"px-4 py-3 bg-zinc-50/50 dark:bg-zinc-800/30 border-t border-neutral-200 dark:border-neutral-700 flex flex-col sm:flex-row items-center justify-between gap-4 w-full"},jS={class:"flex items-center gap-4"},WS={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},US={class:"text-neutral-900 dark:text-neutral-100 font-medium"},HS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},qS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},GS={class:"flex-shrink-0"},XS={class:"space-y-4"},KS={class:"text-gray-600 dark:text-gray-400"},YS={class:"grid grid-cols-1 gap-4 py-4 px-1"},JS={class:"flex items-end gap-2"},_o=e.defineComponent({name:"DataTable",__name:"DataTable",props:{columns:{default:()=>[]},data:{default:()=>[]},perPage:{default:10},loading:{type:Boolean,default:!1},hasActions:{type:Boolean,default:!1},nested:{type:Boolean,default:!1},apiModule:{},apiAction:{default:"list"},apiMethod:{},apiUrl:{},permissionBase:{},apiParams:{default:()=>({})},configKey:{},tableConfig:{},dynamicColumns:{type:Boolean,default:!1},searchApiEndpoint:{},enableQuickSearch:{type:Boolean,default:!0},showPagination:{type:Boolean,default:!0},ignorePermissions:{type:Boolean,default:!1},userPermissions:{default:null},permissionChecker:{type:Function,default:void 0},permissions:{default:void 0},checkPermission:{type:Function,default:void 0},menuPermissions:{default:()=>[]},dummyMode:{type:Boolean,default:!1}},emits:["update:search","update:sort","update:page","create","export","action","update:selection","navigate"],setup(t,{expose:n,emit:o}){var Zt,Pe,Vt,At,xt,vt;cn.add_operation("length",C=>C==null?0:typeof C=="string"||Array.isArray(C)?C.length:typeof C=="number"?String(C).length:typeof C=="object"?Object.keys(C).length:0),cn.add_operation("==",(C,I)=>C!==null&&typeof C=="object"&&"_isLogicValue"in C?C.id==I||C.code==I:I!==null&&typeof I=="object"&&"_isLogicValue"in I?I.id==C||I.code==C:C==I),cn.add_operation("!=",(C,I)=>C!==null&&typeof C=="object"&&"_isLogicValue"in C?!(C.id==I||C.code==I):I!==null&&typeof I=="object"&&"_isLogicValue"in I?!(I.id==C||I.code==C):C!=I);const r=t,a=o,s=e.getCurrentInstance(),{apiUrl:i}=ft(),{locale:l}=$t.useI18n();let c={query:{},params:{},path:""};try{const C=In.useRoute();C?c=C:(Vt=(Pe=(Zt=s==null?void 0:s.appContext)==null?void 0:Zt.config)==null?void 0:Pe.globalProperties)!=null&&Vt.$route&&(c=s.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let d={back:()=>console.warn("Router back() not available"),push:C=>{console.warn("Router push() logic called from fallback:",C),typeof C=="string"&&C.startsWith("/")&&(window.location.href=C)}};try{const C=In.useRouter();C?d=C:(vt=(xt=(At=s==null?void 0:s.appContext)==null?void 0:At.config)==null?void 0:xt.globalProperties)!=null&&vt.$router&&(d=s.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const u=e.ref(""),f=e.ref(1),h=e.ref(r.perPage),m=e.ref({key:"",direction:"asc"}),g=e.ref([]),k=e.ref(!1),y=e.ref(0),p=e.ref({}),E=e.ref([]),_=e.ref(null),B=e.ref(!0),S=e.ref([]),w=e.ref([]),x=e.ref([]),b=e.ref(!1),V=e.ref(!1),A=e.ref({}),D=e.ref(null),N=e.ref(null),P=e.ref(null),v=e.ref([]),Q=e.computed(()=>{if(G.value.length===0)return!1;const C=G.value.map(I=>{const te=ee.value.find(j=>j.type==="CHECKBOX"),R=(te==null?void 0:te.keyCheckbox)||"id";return I[R]}).filter(I=>I!=null);return C.length===0?!1:C.every(I=>v.value.includes(I))}),$=e.computed(()=>{if(G.value.length===0)return!1;const C=ee.value.find(j=>j.type==="CHECKBOX"),I=(C==null?void 0:C.keyCheckbox)||"id",te=G.value.map(j=>j[I]).filter(j=>j!=null),R=te.filter(j=>v.value.includes(j)).length;return R>0&&R<te.length}),q=C=>{const I=ee.value.find(j=>j.type==="CHECKBOX"),te=(I==null?void 0:I.keyCheckbox)||"id",R=C[te];return R!==void 0&&v.value.includes(R)},Y=C=>{const I=ee.value.find(j=>j.type==="CHECKBOX"),te=(I==null?void 0:I.keyCheckbox)||"id",R=G.value.map(j=>j[te]).filter(j=>j!=null);if(C){const j=new Set([...v.value,...R]);v.value=Array.from(j)}else v.value=v.value.filter(j=>!R.includes(j))},X=(C,I)=>{const te=ee.value.find(oe=>oe.type==="CHECKBOX"),R=(te==null?void 0:te.keyCheckbox)||"id",j=C[R];j!=null&&(I?v.value.includes(j)||v.value.push(j):v.value=v.value.filter(oe=>oe!==j))};e.watch(v,C=>{var te;a("update:selection",C);const I=Q.value||C.length>1;(te=w.value)!=null&&te.length&&w.value.forEach(R=>{var j;(j=R.fieldActionGlobal)!=null&&j.length&&R.fieldActionGlobal.forEach(oe=>{var Me,Xe;const Be=R.endpoint||((Me=R.propsActionGlobal)==null?void 0:Me.endpointPropAction)||R.propsActionGlobal,Te=(Xe=Be==null?void 0:Be.keyParam)==null?void 0:Xe[0];(Te&&oe.model===Te||!Te&&/^(id|ids|idAuditTrail)/i.test(oe.model))&&I&&oe.model&&(A.value[oe.model]=C)})})},{deep:!0});const T=C=>Array.from({length:C}).map((I,te)=>{const R={id:te+1,no:te+1};return ee.value.forEach(j=>{j.key!=="no"&&j.key!=="action"&&j.type!=="ACTION"&&j.type!=="action"&&(j.type==="CHECKBOX"?R[j.keyCheckbox||"id"]=te+1:j.type==="BADGE"||j.type==="badge"||j.condition?R[j.key]=j.condition&&j.condition.length>0?j.condition[0].value:"Active":R[j.key]=`Data ${j.label} ${te+1}`)}),R}),W=C=>C&&typeof C=="string"&&C.trim()?C:void 0,ne=e.computed(()=>{var C,I,te,R;return W((I=(C=_.value)==null?void 0:C.endpoint)==null?void 0:I.apiModule)||W((R=(te=_.value)==null?void 0:te.endpointGlobal)==null?void 0:R.apiModule)||r.apiModule}),Z=e.computed(()=>{var C,I,te,R;return W((I=(C=_.value)==null?void 0:C.endpoint)==null?void 0:I.apiAction)||W((R=(te=_.value)==null?void 0:te.endpointGlobal)==null?void 0:R.apiAction)||r.apiAction}),K=e.computed(()=>{var C,I,te,R;return W((I=(C=_.value)==null?void 0:C.endpoint)==null?void 0:I.apiMethod)||W((R=(te=_.value)==null?void 0:te.endpointGlobal)==null?void 0:R.apiMethod)||r.apiMethod||"POST"}),ae=e.computed(()=>{var C,I,te,R;return W((I=(C=_.value)==null?void 0:C.endpoint)==null?void 0:I.apiUrl)||W((R=(te=_.value)==null?void 0:te.endpointGlobal)==null?void 0:R.apiUrl)||r.apiUrl}),ue=e.computed(()=>r.permissionBase||""),xe=e.computed(()=>!x.value||x.value.length===0?[]:[...x.value].sort((C,I)=>(C.seq||0)-(I.seq||0))),De=C=>{var oe,Be,Te;const I=(C==null?void 0:C.column)||((oe=C==null?void 0:C.props)==null?void 0:oe.column)||((Be=C==null?void 0:C.propsFieldGlobal)==null?void 0:Be.column)||((Te=C==null?void 0:C.propsFieldCustom)==null?void 0:Te.column);if(!I)return"col-span-1";const te=I.toLowerCase(),j={full:"col-span-1 md:col-span-2",half:"col-span-1",third:"col-span-1","two-thirds":"col-span-1 md:col-span-2",two_thirds:"col-span-1 md:col-span-2"}[te]||"col-span-1";return console.log(`[DEBUG] getColumnClass for ${C==null?void 0:C.model}: type=${I}, returned=${j}`),j},we=()=>{let C=null;if(r.tableConfig&&(C=r.tableConfig),C){_.value=C,C.headers&&(E.value=C.headers.map(R=>{var Be,Te,Ne,Me,Xe,Le,Ke,Rt,dn,Ba;if(R.key==="action"||((Be=R.custom)==null?void 0:Be.type)==="ACTION"||((Te=R.custom)==null?void 0:Te.type)==="action"){const Lt=((Ne=R.custom)==null?void 0:Ne.actionCustom)||((Me=R.custom)==null?void 0:Me.action);return Lt&&(S.value=Lt.map(qt=>{const ct=qt.propsActionCustom||qt.props||{},_a=qt.propCustomMessage||{};return{permission:qt.permission,label:l.value==="id"?ct.labelID:ct.labelEN,tooltip:l.value==="id"?ct.tooltipID||ct.labelID:ct.tooltipEN||ct.labelEN,icon:ct.icon,variant:ct.variant||"ghost",bgColor:ct.bgColor,action:ct.actionType||ct.key,route:ct.route,path:ct.path,endpoint:ct.endpointPropAction,requiredCondition:qt.requiredCondition||!1,propCustomCondition:qt.propCustomCondition||[],fieldMapping:qt.fieldMapping||ct.fieldMapping||null,openDialog:qt.openDialog||!1,fieldActionCustom:(qt.fieldActionCustom||[]).map(Sa=>{const fi=Sa.propsFieldCustom||Sa.propsFieldGlobal||Sa.props||{};return{...Sa,props:{...fi,endpoint:fi.endpointComponent||fi.endpoint}}}),condition:qt.visibleRule||qt.propCustomCondition||ct.visibleRule||ct.propCustomCondition||null,requireConfirm:qt.requireConfirm||ct.requireConfirm||!1,confirmTitle:l.value==="id"?_a.titleID||ct.confirmTitleID||"Konfirmasi":_a.titleEN||ct.confirmTitleEN||"Confirm",confirmMessage:l.value==="id"?_a.messageID||ct.confirmMessageID||"Apakah Anda yakin?":_a.messageEN||ct.confirmMessageEN||"Are you sure?"}})),null}let j;const oe=((Xe=R.custom)==null?void 0:Xe.conditionBadge)||((Le=R.custom)==null?void 0:Le.condition);return(((Ke=R.custom)==null?void 0:Ke.type)==="BADGE"||((Rt=R.custom)==null?void 0:Rt.type)==="badge")&&oe&&(j=oe.map(Lt=>({value:Lt.value,label:l.value==="id"?Lt.labelID:Lt.labelEN,labelID:Lt.labelID,labelEN:Lt.labelEN,color:Lt.color||Lt.bgColor,variant:Lt.variant,logic:Lt.logic||Lt.conditionRule||null}))),{key:R.key,label:l.value==="id"?R.labelID:R.labelEN,width:R.width,align:R.align,sortable:!0,type:(dn=R.custom)==null?void 0:dn.type,condition:j,keyCheckbox:(Ba=R.custom)==null?void 0:Ba.keyCheckbox}}).filter(R=>R!==null));const I=C.filters||C.filter;I&&Array.isArray(I)&&(x.value=I.map(R=>({...R,props:R.propsFilters||R.props||{}})),x.value.forEach(R=>{p.value[R.model]=""}));const te=C.actionTableGlobal||C.actionGlobal||C.action;console.log("[DEBUG] loadConfig rawActions:",te),te&&Array.isArray(te)?(w.value=te.map(R=>{const j=R.propsActionGlobal||R.props||{};return{key:j.key,permission:R.permission,label:l.value==="id"?j.labelID||"Action":j.labelEN||"Action",tooltip:l.value==="id"?j.tooltipID||j.labelID:j.tooltipEN||j.labelEN,icon:j.icon,variant:j.variant||"default",bgColor:j.bgColor,textColor:j.textColor,route:j.route,path:j.path,endpoint:j.endpointPropAction||R.endpoint,fieldMapping:R.fieldMapping||j.fieldMapping||null,visibleRule:R.visibleRule||j.visibleRule||R.propCustomCondition||j.propCustomCondition||null,openDialog:R.openDialog||!1,fieldActionGlobal:(R.fieldActionGlobal||R.field||[]).map(oe=>{const Be=oe.propsFieldGlobal||oe.props||{};return{...oe,props:{...Be,endpoint:Be.endpointComponent||Be.endpoint}}})}}),console.log("[DEBUG] loadConfig headerActions set:",w.value)):console.log("[DEBUG] loadConfig no rawActions found"),C.pagination!==void 0&&(B.value=C.pagination)}};e.watch(()=>r.tableConfig,()=>{we()},{deep:!0,immediate:!0});const ee=e.computed(()=>r.dynamicColumns||r.configKey||r.tableConfig?E.value:r.columns||[]),z=e.computed(()=>r.hasActions||S.value.length>0),J=e.computed(()=>r.dummyMode?!1:ne.value||ae.value?k.value:r.loading),se=e.computed(()=>!!ne.value||!!ae.value),Ee=e.computed(()=>[]),ve=C=>{if(console.log("[DEBUG] hasAction called:",{actionCode:C,permissionChecker:!!r.permissionChecker,effectivePath:ue.value}),r.menuPermissions&&r.menuPermissions.length>0){const I=c.path,te=r.menuPermissions.find(R=>I.startsWith(R.path));if(te&&te.actions){const R=te.actions.find(j=>j.code===C.toUpperCase());return R?R.checked:!1}return!1}if(r.permissionChecker){const I=r.permissionChecker(ue.value,C);return console.log("[DEBUG] permissionChecker result:",I),I}return Ee.value.some(I=>I.code===C)},qe=(C,I)=>{if(C.condition)try{return cn.apply(C.condition,I)}catch(Be){return console.warn("Row action jsonLogic error:",Be),!1}if(!C.visibilityCondition)return!0;const{field:te,operator:R,value:j}=C.visibilityCondition,oe=Ve(I,te);switch(R){case"equals":return oe===j;case"notEquals":return oe!==j;case"in":return Array.isArray(j)&&j.includes(oe);case"notIn":return Array.isArray(j)&&!j.includes(oe);case"greaterThan":return oe>j;case"lessThan":return oe<j;case"contains":return String(oe).includes(String(j));default:return!0}},Ge=e.computed(()=>{if(console.log("[DEBUG] visibleHeaderActions:",{headerActions:w.value,ignorePermissions:r.ignorePermissions}),w.value.length===0)return w.value;const C=w.value.filter(I=>{if(I.visibleRule)try{const R=G.value[0]||{};if(!cn.apply(I.visibleRule,R))return!1}catch(R){console.warn("Header action visibility logic error:",R)}if(r.ignorePermissions)return!0;if(!I.permission)return console.log("[DEBUG] Action no permission, showing:",I.label),!0;if(r.checkPermission){const R=r.checkPermission(I.permission);return console.log("[DEBUG] Parent checkPermission result:",R),R}if(r.permissions){const R=r.permissions.includes(I.permission);return console.log("[DEBUG] Parent permissions check result:",R),R}const te=ve(I.permission);return console.log("[DEBUG] Internal permission check:",{label:I.label,permission:I.permission,hasPerm:te}),te});return console.log("[DEBUG] Filtered header actions:",C.length),C}),tt=e.computed(()=>S.value.length===0?S.value:S.value.filter(C=>r.ignorePermissions||!C.permission?!0:r.checkPermission?r.checkPermission(C.permission):r.permissions?r.permissions.includes(C.permission):ve(C.permission))),ze=C=>tt.value.filter(I=>qe(I,C)),ut=(C,I)=>{var j,oe;if(C.requiredCondition&&((j=C.propCustomCondition)==null?void 0:j.length)>0){const Be=Ve(I,"status"),Te=C.propCustomCondition.find(Ne=>Ne.value===Be);if(Te)return Te.bgColor||C.bgColor||"primary"}if(!C.dynamicColor||!C.colorCondition)return C.bgColor||"primary";const te=Ve(I,C.colorCondition.field),R=(oe=C.colorCondition.conditions)==null?void 0:oe.find(Be=>Be.value===te);return(R==null?void 0:R.bgColor)||C.bgColor||"primary"},bt=C=>{const I=(C||"left").toLowerCase();return I==="center"?"justify-center":I==="right"?"justify-end":"justify-start"},It={ToggleLeft:ce.ToggleLeft,SquarePen:ce.SquarePen,Trash2:ce.Trash2,Eye:ce.Eye,CheckCircle:ce.CheckCircle,Plus:ce.Plus,Download:ce.Download,RefreshCw:ce.RefreshCw,Search:ce.Search,SlidersHorizontal:ce.SlidersHorizontal},Mt=C=>C?Gt[C]?Gt[C]:It[C]||null:null,G=e.computed(()=>r.dummyMode?ee.value.length>0?T(10):[]:se.value?g.value.map((C,I)=>({...C,no:(f.value-1)*h.value+I+1})):me.value),fe=e.computed(()=>r.dummyMode?10:se.value?y.value:re.value.length),_e=e.computed(()=>fe.value===0?0:(f.value-1)*h.value+1),$e=e.computed(()=>{const C=f.value*h.value;return C>fe.value?fe.value:C}),Ve=(C,I)=>{if(!(!C||!I))return I in C?C[I]:I.split(".").reduce((te,R)=>te&&te[R],C)},re=e.computed(()=>{if(se.value)return[];if(!u.value)return r.data;const C=u.value.toLowerCase();return r.data.filter(I=>ee.value.some(te=>{const R=Ve(I,te.key);return R==null?!1:String(R).toLowerCase().includes(C)}))}),de=e.computed(()=>se.value?[]:m.value.key?[...re.value].sort((I,te)=>{const R=Ve(I,m.value.key),j=Ve(te,m.value.key);if(R===j)return 0;let oe=0;return typeof R=="number"&&typeof j=="number"?oe=R-j:oe=String(R).localeCompare(String(j)),m.value.direction==="asc"?oe:-oe}):re.value),me=e.computed(()=>{if(se.value)return[];const C=(f.value-1)*h.value,I=C+h.value;return de.value.slice(C,I).map((te,R)=>({...te,no:C+R+1}))}),Ae=e.computed(()=>se.value?Object.values(p.value).some(C=>!!C):!!u.value),nt=[10,25,50,100],Bt=()=>{se.value&&(p.value={...p.value,keyword:u.value},f.value=1,mt())};let So;const Ca=()=>{r.enableQuickSearch&&(clearTimeout(So),So=setTimeout(()=>{Bt()},500))};let Vo;const no=()=>{clearTimeout(Vo),Vo=setTimeout(()=>{se.value&&mt()},1e3)};e.watch(u,()=>{r.enableQuickSearch&&se.value&&Ca()});const mt=async()=>{if(!r.dummyMode&&se.value&&!(!ne.value&&!ae.value))try{k.value=!0;const C={page:f.value,perPage:h.value,...p.value,...r.apiParams};u.value&&(C.keyword=u.value),Object.keys(C).forEach(te=>{(C[te]===""||C[te]===null||C[te]===void 0)&&delete C[te]});let I;ne.value?I=await i(ne.value,Z.value,C):ae.value&&(I=await i(ae.value,K.value,C)),Ea(I)}catch(C){console.error("DataTable fetch error",C),k.value=!1}},Ea=C=>{console.log("DataTable handleResponseData:",C),C&&(r.dynamicColumns&&C.columns&&Array.isArray(C.columns)&&(E.value=C.columns.map(I=>({key:I.key||I.field||I.name,label:I.label||I.header||I.name,width:I.width,align:I.align||"LEFT",sortable:I.sortable!==!1,type:I.type,condition:I.condition,format:I.format}))),C.data&&Array.isArray(C.data)?(g.value=C.data,C.totalData?y.value=C.totalData:C.maxPage?y.value=C.maxPage*h.value:y.value=C.data.length*(C.maxPage||1)):Array.isArray(C)?(g.value=C,y.value=C.length):C.users?(g.value=C.users,y.value=C.users.length):C.items&&Array.isArray(C.items)?(g.value=C.items,y.value=C.total||C.totalItems||C.items.length):C.list&&Array.isArray(C.list)?(g.value=C.list,y.value=C.total||C.list.length):C.rows&&Array.isArray(C.rows)?(g.value=C.rows,y.value=C.count||C.total||C.rows.length):C.result&&Array.isArray(C.result)?(g.value=C.result,y.value=C.total||C.count||C.result.length):(console.warn("DataTable: Unknown response format",C),g.value=[],y.value=0)),k.value=!1};e.onUnmounted(()=>{clearTimeout(So),clearTimeout(Vo)});const oo=()=>{Object.keys(p.value).forEach(C=>{p.value[C]=""}),u.value="",f.value=1,mt()},ir=()=>{f.value=1,mt()},M=(C,I)=>{const te=Ve(C,I.key);let R={variant:"secondary",class:"",label:te};if(I.condition){const j=I.condition.find(oe=>{if(oe.logic||typeof oe.value=="object"&&oe.value!==null)try{const Te=oe.logic||oe.value;return cn.apply(Te,C)}catch(Te){return console.warn("Badge logic error:",Te),!1}const Be=(Te,Ne)=>Te==null||Ne===void 0||Ne===null?!1:typeof Te=="string"&&typeof Ne=="string"?Te.toLowerCase().trim()===Ne.toLowerCase().trim():Te==Ne;if(Be(oe.value,te)||typeof te=="object"&&te!==null&&(Be(oe.value,te.code)||Be(oe.value,te.id)))return!0;if(I.key.includes(".")){const Ne=I.key.split(".").slice(0,-1).join("."),Me=Ve(C,Ne);if(Me&&typeof Me=="object"&&(Be(oe.value,Me.code)||Be(oe.value,Me.id)))return!0}return!1});if(j){j.variant&&(R.variant=j.variant);const Be=(l.value||"en")==="id"?j.labelID:j.labelEN;if(R.label=Be||j.label||(typeof te=="object"?te.name||te.code:te),j.color||j.bgColor){const Te=(j.color||j.bgColor||"").toLowerCase(),Ne=R.variant==="outline",Me={success:"bg-green-500 hover:bg-green-600 border-transparent text-white shadow",warning:"bg-yellow-500 hover:bg-yellow-600 border-transparent text-white shadow",info:"bg-blue-500 hover:bg-blue-600 border-transparent text-white shadow",primary:"bg-primary-600 hover:bg-primary-700 border-transparent text-white shadow",secondary:"bg-neutral-500 hover:bg-neutral-600 border-transparent text-white shadow",danger:"bg-red-500 hover:bg-red-600 border-transparent text-white shadow",destructive:"bg-red-500 hover:bg-red-600 border-transparent text-white shadow"},Xe={success:"text-green-600 border-green-600 hover:bg-green-50",warning:"text-yellow-600 border-yellow-600 hover:bg-yellow-50",info:"text-blue-600 border-blue-600 hover:bg-blue-50",danger:"text-red-600 border-red-600 hover:bg-red-50",destructive:"text-red-600 border-red-600 hover:bg-red-50",primary:"text-primary-600 border-primary-600 hover:bg-primary-50",secondary:"text-neutral-600 border-neutral-600 hover:bg-zinc-50"},Le={danger:"destructive",destructive:"destructive",secondary:"secondary",primary:"default",success:"success",warning:"warning",info:"info"};Ne?Xe[Te]&&(R.class=Xe[Te]):Le[Te]?R.variant=Le[Te]:Me[Te]&&(R.class=Me[Te])}}else R.label=typeof te=="object"?(te==null?void 0:te.name)||(te==null?void 0:te.code)||"-":te}else R.label=typeof te=="object"?(te==null?void 0:te.name)||(te==null?void 0:te.code)||"-":te;return R},O=C=>{m.value.key===C?m.value.direction=m.value.direction==="asc"?"desc":"asc":(m.value.key=C,m.value.direction="asc"),a("update:sort",m.value)},L=C=>{C!==f.value&&(f.value=C,se.value&&mt(),a("update:page",C))},F=C=>{h.value=C,f.value=1,se.value&&mt()},H=C=>{const I=Math.random()*15+75;if(C.width){const te=parseInt(String(C.width));return te<100?`${Math.floor(te*(Math.random()*.2+.7))}px`:`${I}%`}return`${I}%`},le=()=>{u.value="",p.value={},f.value=1,mt()},he=C=>{var I;if(console.log("[DEBUG] handleHeaderAction called:",C),C.route){if(C.path){const te=C.route.startsWith("/")?C.route:"/"+C.route;sessionStorage.setItem(`layout_${te}`,C.path)}d==null||d.push(C.route)}else if(C.openDialog){N.value=C,P.value=null,A.value={};const te=C.fieldActionGlobal||C.field||[];te.length&&te.forEach(R=>{var Be;const j=C.endpoint||((Be=C.propsActionGlobal)==null?void 0:Be.endpointPropAction)||C.propsActionGlobal,oe=j!=null&&j.keyParam&&j.keyParam.length>0?j.keyParam[0]:null;oe&&R.model===oe||!oe&&/^(id|ids|idAuditTrail)/i.test(R.model)?A.value[R.model]=v.value:A.value[R.model]||(A.value[R.model]="")}),V.value=!0}else a("action",{action:((I=C.propsActionCustom)==null?void 0:I.key)||C.key||"create",row:null,selection:v.value})},U=async(C,I)=>{var te,R,j,oe;if(C.requireConfirm){D.value={button:C,row:I},b.value=!0;return}if(C.openDialog){N.value=C,P.value=I,A.value={};const Be=ee.value.find(Me=>Me.type==="CHECKBOX"),Te=(Be==null?void 0:Be.keyCheckbox)||"id";C.fieldActionCustom&&C.fieldActionCustom.forEach(Me=>{/^(id|ids|idAuditTrail)/i.test(Me.model)?A.value[Me.model]=[I[Te]]:C.action==="showToken"&&Me.model==="token"?A.value[Me.model]=I.token!==void 0?I.token:"":I[Me.model]!==void 0?A.value[Me.model]=I[Me.model]:A.value[Me.model]=""});const Ne=C.endpoint||((te=C.propsActionGlobal)==null?void 0:te.endpointPropAction)||((R=C.propsActionCustom)==null?void 0:R.endpointPropAction)||((j=C.props)==null?void 0:j.endpointPropAction);if(((oe=Ne==null?void 0:Ne.apiMethod)==null?void 0:oe.toUpperCase())==="GET"&&Ne.apiUrl){k.value=!0;const{apiUrl:Me}=ft(),Xe={};Ne.keyParam&&Array.isArray(Ne.keyParam)&&Ne.keyParam.forEach((Le,Ke)=>{const Rt=Ne.model&&Ke===0?Ne.model:Le;I[Le]!==void 0&&(Xe[Rt]=I[Le])}),Object.keys(Xe).length===0&&I.id&&(Xe.id=I.id),Me(Ne.apiUrl,"GET",Xe).then(Le=>{let Ke=Le;if(Le&&Le.data!==void 0?Ke=Le.data:Le&&Le.result!==void 0&&(Ke=Le.result),Ke!=null){if(typeof Ke=="string")A.value.hasOwnProperty("token")&&(A.value.token=Ke);else if(typeof Ke=="object"&&(Ke.item&&(Ke=Ke.item),Array.isArray(Ke)&&(Ke=Ke[0]||{}),Object.keys(Ke).forEach(Rt=>{A.value[Rt]=Ke[Rt]}),!A.value.token)){const Rt=Object.keys(Ke).find(dn=>dn.toLowerCase().includes("token"));if(Rt)A.value.token=Ke[Rt];else{const dn=Object.values(Ke).filter(Ba=>typeof Ba=="string");dn.length===1&&(A.value.token=dn[0])}}}V.value=!0}).catch(Le=>{console.error("Fetch Data Failed",Le)}).finally(()=>{k.value=!1});return}V.value=!0;return}ie(C,I)},ie=(C,I)=>{if(C.route){if(C.path){const j=C.route.startsWith("/")?C.route:"/"+C.route;sessionStorage.setItem(`layout_${j}`,C.path)}let te=C.route;te.includes(":")?te=te.replaceAll(/:([a-zA-Z0-9_]+)/g,(j,oe)=>I[oe]||I.id||oe):I.id&&(te=`${te.replace(/\/$/,"")}/${I.id}`);const R={};C.path&&(R.code=C.path),d==null||d.push({path:te,query:R})}else if(C.endpoint&&C.endpoint.apiUrl){k.value=!0;const{apiUrl:te}=ft(),R=C.endpoint.apiUrl,j=C.endpoint.apiMethod||"POST",oe={},Be=C.fieldMapping;if(Be&&typeof Be=="object"){const{locale:Te}=$t.useI18n(),Ne=Te.value||"en",Me=[];if(Object.entries(Be).forEach(([Xe,Le])=>{if(typeof Le=="string"){const Ke=Ve(I,Xe);Ke!==void 0?oe[Le]=Ke:(console.warn(`[MAPPING-DEBUG] No matching source found for '${Xe}'`),Me.push(Xe))}}),Me.length>0){const Xe=Ne==="id"?"Masalah Sinkronisasi Data":"Data Synchronization Issue",Le=Ne==="id"?`Terdapat ketidaksesuaian skema pada field: ${Me.join(", ")}. Harap hubungi tim pengembang.`:`Schema mismatch detected in fields: ${Me.join(", ")}. Please contact the development team.`;Ue.warning(`${Xe}: ${Le}`,{autoClose:5e3,position:"top-right"})}}Object.keys(oe).length===0&&I.id&&(oe.id=I.id),te(R,j,oe).then(()=>{mt(),a("action",{action:C.action||"success",row:I})}).catch(Te=>{console.error("Action Failed",Te)}).finally(()=>{k.value=!1})}else a("action",{action:C.action,row:I})},Ce=()=>{D.value&&(ie(D.value.button,D.value.row),st())},je=()=>{var C,I,te;if(N.value){const R=N.value,j=R.endpoint||((C=R.propsActionGlobal)==null?void 0:C.endpointPropAction)||R.propsActionGlobal;let oe=(j==null?void 0:j.model)||(j!=null&&j.keyParam&&j.keyParam.length>0?j.keyParam[0]:null);if(!oe){const Me=(R.fieldActionGlobal||R.fieldActionCustom||R.field||[]).find(Xe=>/^(id|ids|idAuditTrail)/i.test(Xe.model));oe=Me?Me.model:"ids"}let Be=null,Te=!1;if(P.value){const Ne=ee.value.find(Le=>Le.type==="CHECKBOX"),Me=(Ne==null?void 0:Ne.keyCheckbox)||"id",Xe=P.value[Me];if(j!=null&&j.apiUrl){Be={...A.value};const Le=R.fieldMapping;Le&&typeof Le=="object"&&Object.entries(Le).forEach(([Ke,Rt])=>{if(typeof Rt=="string"){const dn=Ve(P.value,Ke);dn!==void 0&&(Be[Rt]=dn)}}),Be[oe]||(Be[oe]=[Xe]),Te=!0}}else j!=null&&j.apiUrl&&(Be={...A.value},Be[oe]||(Be[oe]=v.value||[]),Te=!0);if(Te&&Be&&(j!=null&&j.apiUrl)){if(((I=j==null?void 0:j.apiMethod)==null?void 0:I.toUpperCase())==="GET"){V.value=!1,P.value||(v.value=[]);return}const{apiUrl:Ne}=ft(),Me=j.apiUrl,Xe=j.apiMethod||"POST";Ne(Me,Xe,Be).then(()=>{V.value=!1,P.value||(v.value=[]),mt(),a("action",{action:"success",row:null})}).catch(Le=>{console.error("Action Failed",Le)})}else if(P.value){const Ne=ee.value.find(Ke=>Ke.type==="CHECKBOX"),Me=(Ne==null?void 0:Ne.keyCheckbox)||"id",Xe=P.value[Me],Le={...A.value};Le[oe]||(Le[oe]=[Xe]),a("action",{action:N.value.action,row:Le}),V.value=!1}else{const Ne={...A.value};Ne[oe]||(Ne[oe]=v.value);const Me={action:((te=N.value.propsActionGlobal)==null?void 0:te.key)||N.value.key,row:Ne,selection:v.value};a("action",Me),V.value=!1}}},Ze=C=>{const I=A.value[C];I&&F_(String(I)).then(()=>{Ue.success("Berhasil disalin!",{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(te=>{console.error("Failed to copy",te)})},st=()=>{b.value=!1,D.value=null},ot=e.computed(()=>D.value?D.value.button.confirmTitle||"Confirm":""),_t=e.computed(()=>D.value?D.value.button.confirmMessage||"Confirm":"");n({fetchData:mt,filters:p,resetFilters:oo,handleRefresh:le});const be=e.ref(""),rt=C=>{if(!C)return"";const I=C.endpoint||C.endpointGlobal||{};return JSON.stringify({url:I.apiUrl||C.apiUrl,module:I.apiModule||C.apiModule,action:I.apiAction||C.apiAction,method:I.apiMethod||C.apiMethod,params:C.apiParams,socket:I.socket||C.socketEndpoint,socketParams:C.socketParams})};return e.watch(()=>r.tableConfig,()=>{if(r.tableConfig){we();const C=rt(r.tableConfig);C!==be.value&&(!be.value&&se.value?(be.value=C,mt()):(be.value=C,se.value&&no()))}},{deep:!0,immediate:!0}),e.watch(()=>r.apiModule,()=>{se.value&&mt()}),e.watch(()=>r.apiParams,()=>{se.value&&mt()},{deep:!0}),e.watch(()=>w.value,C=>{console.log("[DEBUG] headerActions changed:",C.length,"items");const I=Ge.value;console.log("[DEBUG] visibleHeaderActions evaluated:",I.length,"items")},{deep:!0}),e.onMounted(()=>{we(),se.value&&(r.tableConfig||(k.value=!0,mt()))}),(C,I)=>{var te;return e.openBlock(),e.createElementBlock("div",dS,[e.createElementVNode("div",uS,[e.createElementVNode("div",fS,[t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",hS,[e.createElementVNode("div",mS,[e.createVNode(e.unref(ce.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),e.createVNode(e.unref(G_),{modelValue:u.value,"onUpdate:modelValue":I[0]||(I[0]=R=>u.value=R),placeholder:"Search...",style:{"padding-left":"2.25rem !important"},class:"h-9 bg-white/95 dark:bg-zinc-800/95 border-white/30 dark:border-neutral-700/50 text-neutral-900 dark:text-neutral-100 placeholder:text-neutral-500 dark:placeholder:text-neutral-400",onKeyup:e.withKeys(Bt,["enter"])},null,8,["modelValue"])]),x.value.length>0?(e.openBlock(),e.createElementBlock("div",pS,[e.createVNode(U_,null,{trigger:e.withCtx(()=>[e.createVNode(et,{variant:"secondary",icon:"SlidersHorizontal",tooltip:"Advance Search",class:"gap-2 h-9 w-full sm:w-auto justify-center bg-white/95 dark:bg-zinc-800/95 text-neutral-700 dark:text-neutral-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 border border-white/30 dark:border-neutral-700/50 shadow-sm backdrop-blur-sm text-xs font-medium"})]),footer:e.withCtx(()=>[e.createElementVNode("div",kS,[e.renderSlot(C.$slots,"filter-footer",{fetch:mt,reset:oo})])]),default:e.withCtx(()=>[I[8]||(I[8]=e.createElementVNode("hr",{class:"border-neutral-200 dark:border-neutral-700"},null,-1)),e.createElementVNode("div",gS,[e.renderSlot(C.$slots,"filter-form",{filters:p.value},()=>[x.value.length>0?(e.openBlock(),e.createElementBlock("div",bS,[e.createElementVNode("div",yS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value,(R,j)=>(e.openBlock(),e.createElementBlock("div",{key:j,class:e.normalizeClass(De(R))},[e.createVNode(eu,{field:R,modelValue:p.value[R.model],"onUpdate:modelValue":oe=>p.value[R.model]=oe},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):e.createCommentVNode("",!0)]),x.value.length>0?(e.openBlock(),e.createElementBlock("div",xS,[e.createVNode(et,{variant:"outline",text:"Reset",tooltip:"Reset",rounded:"md",icon:"RefreshCw",onClick:oo,disabled:J.value},null,8,["disabled"]),e.createVNode(et,{onClick:ir,disabled:J.value,rounded:"md",text:"Search",tooltip:"Search",icon:"Search"},null,8,["disabled"])])):e.createCommentVNode("",!0)])]),_:3})])):e.createCommentVNode("",!0)])),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-2 flex-wrap",{"w-full justify-between":t.nested}])},[t.nested?(e.openBlock(),e.createElementBlock("span",wS)):e.createCommentVNode("",!0),t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(et,{key:1,variant:"secondary",icon:"RefreshCw",text:"Refresh",tooltip:"Refresh",class:"gap-2 h-9 bg-white/95 dark:bg-zinc-800/95 text-neutral-700 dark:text-neutral-300 hover:bg-white dark:hover:bg-zinc-800 border border-white/30 dark:border-neutral-700/50 shadow-sm backdrop-blur-sm text-xs font-medium",onClick:le,disabled:J.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(ce.RefreshCw),{class:e.normalizeClass(["w-3.5 h-3.5",{"animate-spin":J.value}])},null,8,["class"])]),_:1},8,["disabled"])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,(R,j)=>(e.openBlock(),e.createBlock(et,{key:j,icon:R.icon,text:R.label,tooltip:R.tooltip,variant:R.variant,"bg-color":R.bgColor,"text-color":R.textColor,class:"gap-2 h-9 shadow-lg shadow-primary-500/20 border-none text-xs font-medium",onClick:oe=>he(R)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),e.renderSlot(C.$slots,"header-actions")],2)])]),e.createElementVNode("div",CS,[e.createElementVNode("table",ES,[e.createElementVNode("thead",BS,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,R=>(e.openBlock(),e.createElementBlock("th",{key:R.key,class:e.normalizeClass([R.align?`text-${R.align.toLowerCase()}`:"",R.sortable?"cursor-pointer select-none":"","px-3 py-2 text-xs font-black text-white dark:text-neutral-100 uppercase tracking-wider transition-colors duration-150"]),style:e.normalizeStyle(R.width?{width:R.width}:{}),onClick:j=>R.sortable&&O(R.key)},[R.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",SS,[e.createVNode(Cn,{"model-value":Q.value,indeterminate:$.value,"onUpdate:modelValue":I[1]||(I[1]=j=>Y(!!j)),onClick:I[2]||(I[2]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate"])])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-2 w-full",bt(R.align)])},[e.createElementVNode("span",null,e.toDisplayString(R.label),1)],2))],14,_S))),128)),z.value?(e.openBlock(),e.createElementBlock("th",VS,[...I[9]||(I[9]=[e.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",AS,[J.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(h.value,R=>(e.openBlock(),e.createElementBlock("tr",{key:`skeleton-${R}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,j=>{var oe,Be;return e.openBlock(),e.createElementBlock("td",{key:j.key,class:e.normalizeClass([j.align?`text-${j.align.toLowerCase()}`:"text-left","px-3 py-0.5"])},[e.createElementVNode("div",{class:e.normalizeClass(["bg-gradient-to-r from-neutral-200 via-neutral-300 to-neutral-200 dark:from-neutral-700 dark:via-neutral-600 dark:to-neutral-700 animate-shimmer",[["badge","BADGE"].includes(j.type??"")||j.condition?"h-5 rounded-full w-20":"h-4 rounded-md",((oe=j.align)==null?void 0:oe.toLowerCase())==="center"?"mx-auto":"",((Be=j.align)==null?void 0:Be.toLowerCase())==="right"?"ml-auto":""]]),style:e.normalizeStyle({width:["badge","BADGE"].includes(j.type??"")||j.condition?void 0:H(j),backgroundSize:"200% 100%"})},null,6)],2)}),128)),t.hasActions?(e.openBlock(),e.createElementBlock("td",DS,[...I[10]||(I[10]=[e.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse"}),e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-75"}),e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-150"})],-1)])])):e.createCommentVNode("",!0)]))),128)):G.value.length===0?(e.openBlock(),e.createElementBlock("tr",NS,[e.createElementVNode("td",{colspan:ee.value.length+(z.value?1:0),class:"text-center py-16"},[e.createElementVNode("div",vS,[e.createVNode(e.unref(ku.Vue3Lottie),{animationData:e.unref(aS),height:200,width:200},null,8,["animationData"]),e.createElementVNode("div",null,[e.createElementVNode("p",PS,e.toDisplayString(Ae.value?"No search results":"No data"),1),e.createElementVNode("p",TS,e.toDisplayString(Ae.value?"Try changing keywords":"No data added"),1)])])],8,MS)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(G.value,(R,j)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:j},[e.createElementVNode("tr",OS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,oe=>(e.openBlock(),e.createElementBlock("td",{key:oe.key,class:e.normalizeClass([oe.align?`text-${oe.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[e.renderSlot(C.$slots,`cell-${oe.key}`,{row:R,value:Ve(R,oe.key)},()=>[oe.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",FS,[e.createVNode(Cn,{"model-value":q(R),"onUpdate:modelValue":Be=>X(R,!!Be),onClick:I[3]||(I[3]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):oe.type==="badge"||oe.type==="BADGE"||oe.condition?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[oe.align?`justify-${oe.align.toLowerCase()}`:"justify-start"]])},[e.createVNode(li,{variant:M(R,oe).variant,class:e.normalizeClass([M(R,oe).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(M(R,oe).label),1)]),_:2},1032,["variant","class"])],2)):oe.key==="no"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString((f.value-1)*h.value+j+1),1)],64)):oe.type==="date"||oe.type==="DATE"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(Ve(R,oe.key)?e.unref(T_)(Ve(R,oe.key),"long"):"-"),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(oe.format?oe.format(Ve(R,oe.key)):Ve(R,oe.key)),1)],64))])],2))),128)),z.value?(e.openBlock(),e.createElementBlock("td",zS,[e.renderSlot(C.$slots,"actions",{row:R,buttons:ze(R),getButtonColor:ut,getIconComponent:Mt},()=>[ze(R).length>0?(e.openBlock(),e.createElementBlock("div",IS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze(R),(oe,Be)=>(e.openBlock(),e.createElementBlock("div",{key:Be,class:"group relative"},[e.createVNode(et,{tooltip:oe.tooltip||oe.label,icon:oe.icon,size:"icon",rounded:oe.rounded||"sm",borderStyle:oe.borderStyle||"none",variant:oe.variant||"ghost","bg-color":ut(oe,R),onClick:Te=>U(oe,R)},null,8,["tooltip","icon","rounded","borderStyle","variant","bg-color","onClick"])]))),128))])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),C.$slots["expanded-row"]?(e.openBlock(),e.createElementBlock("tr",RS,[e.createElementVNode("td",{colspan:ee.value.length+(z.value?1:0),class:"px-0 py-0"},[e.renderSlot(C.$slots,"expanded-row",{row:R,index:j})],8,LS)])):e.createCommentVNode("",!0)],64))),128))])])]),!J.value&&G.value.length>0&&t.showPagination&&B.value?(e.openBlock(),e.createElementBlock("div",$S,[e.createElementVNode("div",jS,[e.createVNode(e.unref(n2),{"model-value":String(h.value),"onUpdate:modelValue":I[4]||(I[4]=R=>F(Number(R)))},{default:e.withCtx(()=>[e.createVNode(e.unref(l2),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:e.withCtx(()=>[e.createVNode(e.unref(c2),{placeholder:String(h.value)},null,8,["placeholder"])]),_:1}),e.createVNode(e.unref(o2),null,{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(nt,R=>e.createVNode(e.unref(a2),{key:R,value:String(R)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(R),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),I[15]||(I[15]=e.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),e.createElementVNode("span",WS,[I[11]||(I[11]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",US,e.toDisplayString(_e.value),1),I[12]||(I[12]=e.createTextVNode(" to ",-1)),e.createElementVNode("span",HS,e.toDisplayString($e.value),1),I[13]||(I[13]=e.createTextVNode(" of ",-1)),e.createElementVNode("span",qS,e.toDisplayString(fe.value),1),I[14]||(I[14]=e.createTextVNode(" items ",-1))])]),e.createElementVNode("div",GS,[e.createVNode(e.unref(X_),{total:fe.value,"items-per-page":h.value,"sibling-count":1,"show-edges":"",page:f.value,"onUpdate:page":L,class:"scale-90 origin-right"},{default:e.withCtx(()=>[e.createVNode(e.unref(K_),{class:"flex items-center gap-1"},{default:e.withCtx(({items:R})=>[e.createVNode(e.unref(J_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:opacity-50 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(t2),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R,(j,oe)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[j.type==="page"?(e.openBlock(),e.createBlock(e.unref(Q_),{key:oe,value:j.value,"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(Jt),{class:"w-8 h-8 p-0 text-sm",variant:j.value===f.value?"default":"outline",disabled:j.value===f.value,onClick:Be=>L(j.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(j.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(e.openBlock(),e.createBlock(e.unref(Y_),{key:j.type,index:oe},null,8,["index"]))],64))),256)),e.createVNode(e.unref(e2),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.ChevronRight),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Z_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):e.createCommentVNode("",!0),e.createVNode(Fn,{modelValue:b.value,"onUpdate:modelValue":I[5]||(I[5]=R=>b.value=R),title:ot.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:e.withCtx(()=>[e.createVNode(et,{variant:"outline",onClick:st,text:"Cancel"}),e.createVNode(et,{variant:"default",onClick:Ce,text:"Yes"})]),default:e.withCtx(()=>[e.createElementVNode("div",XS,[e.createElementVNode("p",KS,e.toDisplayString(_t.value),1)])]),_:1},8,["modelValue","title"]),e.createVNode(Fn,{modelValue:V.value,"onUpdate:modelValue":I[7]||(I[7]=R=>V.value=R),title:((te=N.value)==null?void 0:te.label)||"Action",icon:"AlertCircle","max-width":450},{actions:e.withCtx(()=>[e.createVNode(et,{variant:"outline",onClick:I[6]||(I[6]=R=>V.value=!1),text:"Cancel"}),e.createVNode(et,{variant:"default",onClick:je,text:"Save"})]),default:e.withCtx(()=>{var R,j;return[e.createElementVNode("div",YS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((R=N.value)==null?void 0:R.fieldActionCustom)||((j=N.value)==null?void 0:j.fieldActionGlobal)||[],(oe,Be)=>{var Te,Ne,Me;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Be},[oe.isHidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(De(oe))},[e.createElementVNode("div",JS,[e.createVNode(eu,{class:"flex-1 w-full",field:oe,modelValue:A.value[oe.model],"onUpdate:modelValue":Xe=>A.value[oe.model]=Xe},null,8,["field","modelValue","onUpdate:modelValue"]),oe.isCopyable||(Te=oe.props)!=null&&Te.isCopyable||((Ne=N.value)==null?void 0:Ne.action)==="showToken"||((Me=N.value)==null?void 0:Me.action)==="copyToken"?(e.openBlock(),e.createBlock(et,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:"Salin",onClick:Xe=>Ze(oe.model)},null,8,["onClick"])):e.createCommentVNode("",!0)])],2))],64)}),128))])]}),_:1},8,["modelValue","title"])])}}});function hu(){return{setPageTitle:o=>{typeof document<"u"&&(document.title=o||document.title),typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:page-title",{detail:{title:o},bubbles:!0,composed:!0}))},setBreadcrumb:o=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:breadcrumb",{detail:{items:o},bubbles:!0,composed:!0}))}}}const QS={key:0},ZS=["value","name"],eV={key:1,class:"flex flex-col gap-1"},tV={class:"text-xs font-medium text-neutral-500 dark:text-neutral-400"},nV=["src"],oV={key:1,class:"text-sm text-neutral-400 italic"},rV={key:2,class:"text-sm text-neutral-800 dark:text-neutral-100 font-medium"},aV={key:3,class:"text-xs text-neutral-400 italic"},ci=e.defineComponent({__name:"DynamicFormField",props:{field:{},modelValue:{default:null},formData:{default:()=>({})},required:{type:Boolean,default:!1},options:{default:()=>[]},error:{default:null},dynamicLabels:{default:null},dynamicLength:{default:null},baseUrl:{default:void 0},viewOnly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){let o=e.ref("en");try{o=$t.useI18n().locale}catch{}const r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,y=>{s.value=y});const i={DCodeTextField:lo,DCodeAutoComplete:gr,DCodeDatePicker:oa,DCodeTextarea:wo,DCodeTextArea:wo,DCodeCheckbox:Cn,DCodeSwitch:la,DCodeOtpInput:sa,DCodeImageField:aa,DCodeSlider:ia,DCodeRadio:Ys,DCodeRadioCustom:Js,DCodeDynamicUploadList:Rs,DCodeMultiSelect:Ks,DCodeCurrencyField:Is,DCodePermissionMenu:Zs,DCodeTreePermissions:ei,DCodeCardCheckboxList:zs,DCodeBeforeAfter:Xa,DCodeListLabels:Ka},l=e.computed(()=>{const y=r.field.component;return i[y]||null}),c=e.computed(()=>{var p;const y=((p=r.field.component)==null?void 0:p.toLowerCase())||"";return y.includes("image")||y.includes("upload")}),d=e.computed(()=>{var p;const y=((p=r.field.component)==null?void 0:p.toLowerCase())||"";return y.includes("switch")||y.includes("checkbox")}),u=e.computed(()=>{var _,B;const y=r.field.props||r.field.propsFieldGlobal||{},p=((_=r.dynamicLabels)==null?void 0:_.labelID)||y.labelID,E=((B=r.dynamicLabels)==null?void 0:B.labelEN)||y.labelEN;return o.value==="id"?p||E||r.field.model:E||p||r.field.model}),f=e.computed(()=>{const y=r.modelValue;return y==null||y===""?null:Array.isArray(y)?y.map(p=>typeof p=="object"&&p!==null?p.label||p.name||p.code||p.value||JSON.stringify(p):String(p)).join(", "):typeof y=="object"?y.label||y.name||y.code||y.value||y.id||JSON.stringify(y):String(y)}),h=(y,p)=>{const E={label:"",placeholder:""},_=(p==null?void 0:p.labelID)||y.labelID,B=(p==null?void 0:p.labelEN)||y.labelEN;(_||B)&&(E.label=o.value==="id"?_:B);const S=(p==null?void 0:p.placeholderID)||y.placeholderID,w=(p==null?void 0:p.placeholderEN)||y.placeholderEN;return(S||w)&&(E.placeholder=o.value==="id"?S:w),E},m=(y,p)=>{var B;if(!((B=y.endpoint)!=null&&B.apiUrl))return{};const E={};let _=!0;return Array.isArray(y.endpoint.keyParam)&&y.endpoint.keyParam.length>0&&y.endpoint.keyParam.forEach(S=>{const w=p?p[S]:null;w!=null&&w!==""?E[S]=w:_=!1}),_?{endpoint:{apiUrl:y.endpoint.apiUrl,apiMethod:y.endpoint.apiMethod||"GET"},...Object.keys(E).length?{apiParams:E}:{}}:{}},g=e.computed(()=>{var B,S,w;const y=r.field.props||r.field.propsFieldGlobal||{},p={},E=h(y,r.dynamicLabels);return E.label&&(p.label=E.label),E.placeholder&&(p.placeholder=E.placeholder),p.required=r.required!==void 0?r.required:y.required??!1,["disabled","readonly","clearable","returnObject","itemTitle","itemValue","maxValue","minValue","sizeFile","typeFile","treeData","menuList","enableParentControl","showIcons","dataBefore","dataAfter"].forEach(x=>{y[x]!==void 0&&y[x]!==null&&(p[x]=y[x])}),p.minLength=((B=r.dynamicLength)==null?void 0:B.minLength)??y.minLength,p.maxLength=((S=r.dynamicLength)==null?void 0:S.maxLength)??y.maxLength,y.valueType&&(p.type=y.valueType),r.error&&(p.error=r.error),Object.assign(p,m(y,r.formData)),(w=y.endpointReference)!=null&&w.apiUrl&&(p.endpointReference=y.endpointReference),r.options&&r.options.length>0&&(p.items=r.options,p.options=r.options,r.field.component!=="DCodeDynamicUploadList"&&(delete p.endpoint,delete p.apiParams,delete p.apiUrl)),r.baseUrl&&(p.baseUrl=r.baseUrl),p}),k=y=>{s.value=y,a("update:modelValue",y)};return(y,p)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",QS,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,ZS)])):t.viewOnly?(e.openBlock(),e.createElementBlock("div",eV,[e.createElementVNode("span",tV,e.toDisplayString(u.value),1),c.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[f.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:f.value,class:"h-16 w-16 rounded-md object-cover border border-neutral-200",alt:""},null,8,nV)):(e.openBlock(),e.createElementBlock("span",oV,"-"))],64)):d.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["inline-flex items-center gap-1 text-sm font-medium",f.value?"text-green-600 dark:text-green-400":"text-neutral-400"])},e.toDisplayString(f.value?"✓ Ya":"✗ Tidak"),3)):(e.openBlock(),e.createElementBlock("span",rV,e.toDisplayString(f.value||"-"),1))])):l.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:2},g.value,{modelValue:s.value,"onUpdate:modelValue":[p[0]||(p[0]=E=>s.value=E),k]}),null,16,["modelValue"])):(e.openBlock(),e.createElementBlock("div",aV," Unknown field: "+e.toDisplayString(t.field.component),1))}}),sV={class:"w-full space-y-6"},iV={key:0,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},lV={key:0,class:"flex items-center justify-between mb-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30"},cV={key:0,class:"px-4 py-3"},dV={class:"text-sm font-semibold text-white"},uV={class:"px-4 py-3 flex items-center gap-2"},fV={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},hV={class:"flex items-center justify-center gap-1"},mV=["onClick"],pV=["onClick"],gV=["onClick"],bV={key:2,class:"w-full"},yV={class:"space-y-6 mt-4"},xV={key:0,class:"flex items-center justify-between border-b border-neutral-100 dark:border-neutral-800 pb-2 mb-4"},kV={key:0,class:"text-sm font-medium text-neutral-800 dark:text-neutral-200"},wV={key:1,class:"text-xs text-neutral-500"},CV={key:0,class:"flex items-center gap-2"},EV={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},BV={key:2,class:"p-4 border border-dashed border-neutral-300 rounded-lg text-xs text-neutral-400"},_V={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},SV={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},VV={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},AV=e.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},baseUrl:{default:void 0}},emits:["submit","cancel","action","update:model","success","error"],setup(t,{emit:n}){cn.add_operation("length",M=>M==null?0:typeof M=="string"||Array.isArray(M)?M.length:typeof M=="number"?String(M).length:typeof M=="object"?Object.keys(M).length:0),cn.add_operation("==",(M,O)=>{const L=F=>F&&typeof F=="object"&&F._isLogicValue;return M==null?O==null:O==null?M==null:L(M)&&L(O)?String(M.id)===String(O.id)||String(M.code)===String(O.code):L(M)?String(M.code)===String(O)||String(M.id)===String(O):L(O)?String(O.code)===String(M)||String(O.id)===String(M):typeof M=="boolean"&&typeof O=="string"?String(M)===O:typeof O=="boolean"&&typeof M=="string"?String(O)===M:String(M)===String(O)}),cn.add_operation("!=",(M,O)=>{const L=F=>F&&typeof F=="object"&&F._isLogicValue;return M==null&&O==null?!1:M==null||O===null||O===void 0?!0:L(M)&&L(O)?!(String(M.id)===String(O.id)||String(M.code)===String(O.code)):L(M)?!(String(M.code)===String(O)||String(M.id)===String(O)):L(O)?!(String(O.code)===String(M)||String(O.id)===String(M)):String(M)!==String(O)});const o=t,r=n,{t:a,locale:s}=$t.useI18n(),i=e.computed(()=>s.value),{apiUrl:l}=ft(),c=In.useRouter();let d="";const u=e.ref(!1),f=e.ref(null),h=e.computed(()=>o.schema||f.value),m=e.reactive({}),g=e.reactive({}),k=e.reactive({}),y=e.reactive({});e.reactive({});const p=e.reactive({visible:!1,title:"",message:"",action:null}),E=M=>{var O,L,F;return((O=M.propsForm)==null?void 0:O.key)||((L=M.propsTable)==null?void 0:L.key)||((F=M.propsWizard)==null?void 0:F.key)||M.id||"unknown-section"},_=M=>{var L;return(((L=M.propsWizard)==null?void 0:L.propsSteps)||[]).filter(F=>ne(F)).map((F,H)=>{var U;let le=[];if(Array.isArray(F.sectionsWizard))le=F.sectionsWizard;else if(F.sectionsWizard&&typeof F.sectionsWizard=="object"){const ie=F.sectionsWizard;le=[{type:ie.type||(ie.fields?"FORM":ie.isDataTable?"TABLE":"UNKNOWN"),...ie}]}const he=W(F);return{key:F.key||`step-${H}`,title:he.title,description:he.description,icon:F.icon||void 0,sections:le,actions:((U=F.propsComponent)==null?void 0:U.actionComponent)||F.actionComponent||[]}})},B=M=>M?[...M].sort((O,L)=>(O.seq||0)-(L.seq||0)):[],S=(M,O)=>{var H;const L=O?A(O):D.value;return N((H=M.logic)==null?void 0:H.labelingRule,L,`LABEL-${M.model}`)||null},w=(M,O)=>{var H;const L=O?A(O):D.value;return N((H=M.logic)==null?void 0:H.lengthRule,L,`LENGTH-${M.model}`)||null},x=(M,O,L)=>{const F=M.props||M.propsFieldGlobal;if(!F)return null;const H=O==null?"":String(O);if(H==="")return null;const le=w(M,L),he=(le==null?void 0:le.minLength)??F.minLength,U=(le==null?void 0:le.maxLength)??F.maxLength;if(he&&H.length<he)return i.value==="id"?`Minimal ${he} karakter`:`Minimum ${he} characters`;if(U&&H.length>U)return i.value==="id"?`Maksimal ${U} karakter`:`Maximum ${U} characters`;if(F.regex)try{if(!new RegExp(F.regex).test(H))return F.regexMessage||(i.value==="id"?"Format tidak valid":"Invalid format")}catch{console.warn(`[DynamicForm] Invalid validation regex for field ${M.model}:`,F.regex)}return null},b=e.computed(()=>{var O;const M=new Map;return(O=h.value)!=null&&O.sections&&h.value.sections.forEach(L=>{var he,U;const F=L.propsForm||L.propsTable||L.props||{},H=E(L);(F.fields||L.fields||[]).forEach(ie=>{if(ie.model){const Ce=H?`${H}.${ie.model}`:ie.model;M.set(ie.model,{field:ie,path:Ce})}}),((he=L.type)==null?void 0:he.toUpperCase())==="WIZARD"&&((U=L.propsWizard)!=null&&U.propsSteps)&&L.propsWizard.propsSteps.forEach(ie=>{const Ce=ie.key||ie.id;(Array.isArray(ie.sectionsWizard)?ie.sectionsWizard:[ie.sectionsWizard].filter(Boolean)).forEach(Ze=>{Ze.fields&&Ze.fields.forEach(st=>{if(st.model){const ot=Ce?`${Ce}.${st.model}`:st.model;M.set(st.model,{field:st,path:ot})}})})})}),M}),V=(M,O)=>{if(O==null||typeof O=="object"&&O._isLogicValue)return O;const L=b.value.get(M);if(!L)return O;const F=L.field,H=v[F.key];if(!H||!Array.isArray(H))return O;const he=(F.props||{}).itemValue||"id",U=H.find(ie=>String(ie[he])===String(O)||String(ie.id)===String(O)||String(ie.code)===String(O));return U&&U.code?{id:O,code:U.code,_isLogicValue:!0}:O},A=M=>{const O=(L,F)=>{if(L==null||typeof L=="object"&&L._isLogicValue||typeof L=="boolean")return L;if(typeof L=="number"||typeof L=="string")return F?V(F,L):L;if(typeof L=="object"&&!Array.isArray(L)){const H=(L==null?void 0:L.id)??(L==null?void 0:L.code)??(L==null?void 0:L.value)??(L==null?void 0:L.key)??L;return F&&(typeof H=="string"||typeof H=="number")?V(F,H):H}return L};return new Proxy(M,{get(L,F){if(typeof F!="string")return L[F];const H=b.value.get(F);if(H){const le=ae(L,H.path);if(le!=null)return O(le,F)}return O(L[F],F)},has(L,F){return typeof F!="string"?F in L:b.value.has(F)||F in L},ownKeys(L){return Array.from(new Set([...Object.keys(L),...b.value.keys()]))},getOwnPropertyDescriptor(L,F){return{enumerable:!0,configurable:!0}}})},D=e.computed(()=>A(m)),N=(M,O,L)=>M?Array.isArray(M)?M.find(F=>!F.condition||P(F.condition,O,L))||null:M:null,P=(M,O,L="LOGIC")=>{if(M==null||typeof M=="object"&&Object.keys(M).length===0)return!0;if(typeof M=="boolean")return M;if(typeof M=="object")try{const F=cn.apply(M,O);if(["VISIBLE","SEC","FILTER","LENGTH","CALC"].some(le=>L.includes(le))){const le=JSON.stringify(M),he=Object.keys(O).filter(U=>le.includes(`"${U}"`));console.log(`[DynamicForm][${L}] Rule: ${le} | Data: {${he.map(U=>`${U}: ${JSON.stringify(O[U])}`).join(", ")}} | Result: ${F}`)}return F}catch(F){return console.error(`[${L}] JsonLogic error:`,F),!1}try{return!!new Function("formData",`return ${M};`)(O)}catch{return!1}},v=e.reactive({}),Q=async M=>{const O=M.props||{},L=O.endpointReference||O.endpoint;if(!(!(L!=null&&L.apiUrl)||v[M.key])&&!(Array.isArray(L.keyParam)&&L.keyParam.some(F=>m[F]===null||m[F]===void 0||m[F]==="")))try{const F=await l(L.apiUrl,L.apiMethod||"GET",{page:1,perPage:100});let H=(F==null?void 0:F.data)||F;v[M.key]=Array.isArray(H)?H:H?[H]:[]}catch{v[M.key]=[]}},$=(M,O)=>{var ie;const L=M.props||{},F=v[M.key]||L.items||L.options||[];if(!((ie=M.logic)!=null&&ie.optionsFilterRule))return F;const H=O?A(O):D.value,le=N(M.logic.optionsFilterRule,H,`FILTER-${M.model}`);if(!le||!le.values)return F;const he=(le.values||[]).map(Ce=>String(Ce)),U=L.itemValue||"id";return F.filter(Ce=>Ce==null?!1:typeof Ce!="object"?he.includes(String(Ce)):[U,"code","id","value","key"].some(je=>{const Ze=Ce[je];return Ze!=null&&he.includes(String(Ze))}))},q=M=>{if(!M||typeof M!="object")return[];if("var"in M)return[M.var];let O=[];return Object.values(M).forEach(L=>{Array.isArray(L)?L.forEach(F=>{O=O.concat(q(F))}):typeof L=="object"&&(O=O.concat(q(L)))}),O};e.watch(()=>h.value,M=>{if(!(M!=null&&M.sections))return;const O=new Set,L=F=>{F&&["visibleRule","requiredRule","disabledRule","optionsFilterRule","lengthRule","calculateRule"].forEach(H=>{const le=F[H];Array.isArray(le)?le.forEach(he=>he.condition&&q(he.condition).forEach(U=>O.add(U))):le&&q(le).forEach(he=>O.add(he))})};M.sections.forEach(F=>{var H,le,he,U,ie;L(F.logic||((H=F.propsForm)==null?void 0:H.logic)),F.type==="WIZARD"&&((he=(le=F.propsWizard)==null?void 0:le.propsSteps)==null||he.forEach(Ce=>L(Ce.logic))),(((U=F.propsForm)==null?void 0:U.fields)||F.fields||[]).forEach(Ce=>{var je;L(Ce.logic),(je=Ce.logic)!=null&&je.optionsFilterRule&&Q(Ce)}),F.type==="TABLE"&&((ie=F.propsTable)!=null&&ie.modelDatatable)&&(m[F.propsTable.modelDatatable]=m[F.propsTable.modelDatatable]||[])})},{immediate:!0});const Y=(M,O)=>{var le;const L=O?A(O):D.value,F=(le=M.logic)==null?void 0:le.visibleRule;if(!F)return!0;const H=N(F,L,`VISIBLE-${M.model}`);return!!(typeof H=="object"?P(H,L,`VISIBLE-${M.model}`):H)},X=(M,O)=>{var le,he;const L=O?A(O):D.value,F=(le=M.logic)==null?void 0:le.requiredRule;if(!F)return((he=M.props)==null?void 0:he.required)||!1;const H=N(F,L,`REQUIRED-${M.model}`);return!!(typeof H=="object"?"required"in H?H.required:P(H,L):H)},T=(M,O)=>{var le,he;const L=O?A(O):D.value,F=(le=M.logic)==null?void 0:le.disabledRule;if(!F)return((he=M.props)==null?void 0:he.disabled)||!1;const H=N(F,L,`DISABLED-${M.model}`);return!!(typeof H=="object"?"disabled"in H?H.disabled:P(H,L):H)},W=M=>{var le;const O=M.propsForm||M.propsTable||M.propsWizard||M.props||{};let L=i.value==="id"?O.titleID||M.titleID||M.labelID:O.titleEN||M.titleEN||M.labelEN,F=i.value==="id"?O.descriptionID||M.descriptionID:O.descriptionEN||M.descriptionEN;const H=N((le=M.logic||O.logic)==null?void 0:le.labelingRule,D.value,"LABEL-SEC");return H&&(L=i.value==="id"?H.labelID||H.titleID||H.title:H.labelEN||H.titleEN||H.title,F=i.value==="id"?H.descriptionID:H.descriptionEN),{title:L,description:F}},ne=(M,O)=>{var he,U;if(!M)return!0;const L=M.propsForm||M.propsTable||M.propsWizard||M.props||{},F=(he=M.logic||L.logic)==null?void 0:he.visibleRule,H=O?A(O):D.value;if(F){const ie=N(F,H,"VISIBLE-SEC");return!!(typeof ie=="object"?P(ie,H,"VISIBLE-SEC"):ie)}if(M.type==="TABLE"&&((U=L.headers)!=null&&U.length))return!0;const le=L.fields||M.fields||[];return le.length===0||le.some(ie=>Y(ie,O))},Z=()=>{var M;if((M=h.value)!=null&&M.sections)for(let O=0;O<3;O++){let L=!1;if(h.value.sections.forEach(F=>{var H;(((H=F.propsForm)==null?void 0:H.fields)||F.fields||[]).forEach(le=>{var U;const he=(U=le.logic)==null?void 0:U.calculateRule;if(he&&typeof he=="object"){const ie=Object.keys(he)[0],Ce=P(he[ie],D.value,`CALC-${ie}`);Ce!==void 0&&m[ie]!==Ce&&(m[ie]=Ce,L=!0)}})}),!L)break}},K=e.computed(()=>{var O;if(!((O=h.value)!=null&&O.sections))return!1;if(Object.keys(g).length>0)return!0;const M=L=>L.some(F=>Y(F)&&X(F)&&(Array.isArray(m[F.model])?m[F.model].length===0:m[F.model]==null||m[F.model]===""));return h.value.sections.some(L=>{var F;return M(((F=L.propsForm)==null?void 0:F.fields)||L.fields||[])?!0:L.type==="WIZARD"?_(L).some(H=>M(H.sections.flatMap(le=>le.fields||[]))):!1})}),ae=(M,O)=>O?O.split(".").reduce((L,F)=>L==null?void 0:L[F],M):void 0,ue=(M,O,L)=>{const F=O.split(".");let H=M;for(let le=0;le<F.length-1;le++)H=H[F[le]]=H[F[le]]||{};H[F[F.length-1]]=L},xe=M=>{const O=e.toRaw(M);if(Array.isArray(O))return O.map(L=>xe(L));if(O&&typeof O=="object"){const L={};return Object.keys(O).forEach(F=>L[F]=xe(O[F])),L}return O},De=()=>{var L;if(!((L=h.value)!=null&&L.sections))return{...m};const M={},O=new Set;return h.value.sections.forEach(F=>{var he,U;if(!ne(F))return;const H=E(F),le=(ie,Ce)=>{if(Y(ie)&&ie.model){const je=ae(m,Ce?`${Ce}.${ie.model}`:ie.model)??m[ie.model];M[ie.model]=xe(je),O.add(ie.model)}};if((((he=F.propsForm)==null?void 0:he.fields)||F.fields||[]).forEach(ie=>{var Ce;return le(ie,H||((Ce=F.propsForm)==null?void 0:Ce.key))}),F.type==="WIZARD"&&_(F).forEach(ie=>ie.sections.forEach(Ce=>(Ce.fields||[]).forEach(je=>le(je,ie.key)))),(U=F.propsTable)!=null&&U.modelDatatable){const ie=F.propsTable.modelDatatable;M[ie]=xe(ae(m,H?`${H}.${ie}`:ie)??m[ie]),O.add(ie)}}),["id","_id"].forEach(F=>{m[F]!==void 0&&!O.has(F)&&(M[F]=xe(m[F]))}),M},we=(M,O)=>{const L=(M==null?void 0:M.data)!==void 0?M.data:M,F=Array.isArray(L)?L[0]:L;F&&Object.entries(O).forEach(([H,le])=>{const he=F[le]??F[H];he!==void 0&&ue(m,H,he)})},ee=()=>{var L;const M=[],O=F=>{F==null||F.forEach(H=>{var he;if(H.type==="TABLE"||H.propsTable){const U=H.propsTable||H;U.modelDatatable&&M.push({key:U.modelDatatable,subFields:(U.headers||[]).map(ie=>ie.key)})}(((he=H.propsForm)==null?void 0:he.fields)||H.fields||[]).forEach(U=>{var Ce,je;const ie=["DCodeDynamicUploadList","DCodeUploadList","DCodeDataTable","DCodeDynamicFormList"].includes(U.component);if(U.model&&((Ce=U.props)!=null&&Ce.multiple||((je=U.props)==null?void 0:je.valueType)==="array"||ie)){const Ze=U.component.includes("Upload")?["id","filename","document","typeDocument","idDocumentType"]:["id"];M.push({key:U.model,subFields:Ze})}}),H.type==="WIZARD"&&_(H).forEach(U=>O(U.sections))})};return O((L=h.value)==null?void 0:L.sections),M},z=(M,O)=>{const L={},F=H=>H&&typeof H=="object"?H._isLogicValue?H.id:H.id??H.code??H.value??H:H;return Object.entries(O).forEach(([H,le])=>{if(typeof le=="string"){const he=M[H]??ae(m,H)??m[H];he!==void 0&&(L[le]=F(he))}else if(Array.isArray(le)&&le[0]){const he=le[0],U=Object.keys(he);let ie=M[H]??ae(m,H)??m[H];if(!Array.isArray(ie)||ie.length===0){const Ce=ee().find(je=>U.some(Ze=>je.subFields.includes(Ze)));if(Ce){const je=M[Ce.key]??ae(m,Ce.key)??m[Ce.key];Array.isArray(je)&&je.length>0&&(ie=je)}}Array.isArray(ie)&&(console.log(`[DynamicForm][MAPPING-SOURCE] ${H}:`,xe(ie)),L[H]=ie.map((Ce,je)=>{const Ze={},st=xe(Ce);return Object.entries(he).forEach(([ot,_t])=>{const be=st[ot]??st[_t]??Ce[ot]??Ce[_t]??null;Ze[_t]=F(be)}),Ze}))}}),console.log("[DynamicForm][MAPPING-RESULT]",L),L},J=M=>{var O,L,F,H;M.requireConfirm?(p.title=i.value==="id"?((O=M.propCustomMessage)==null?void 0:O.titleID)||"Konfirmasi":((L=M.propCustomMessage)==null?void 0:L.titleEN)||"Confirm",p.message=i.value==="id"?((F=M.propCustomMessage)==null?void 0:F.messageID)||"Lanjutkan?":((H=M.propCustomMessage)==null?void 0:H.messageEN)||"Continue?",p.action=M,p.visible=!0):Ee(M)},se=()=>{p.visible=!1,p.action&&Ee(p.action)},Ee=async M=>{var H,le;const O=M.propsActionGlobal||M.props||{},L=z(De(),O.fieldMapping||M.fieldMapping||{});r("action",M,L);const F=O.endpointPropAction||M.endpointPropAction||O.endpoint||M.endpoint;if((O.type==="SUBMIT"||O.type==="ACTION")&&(F!=null&&F.apiUrl)){const he=Ue.loading(i.value==="id"?"Memproses...":"Processing...");try{const U=await l(F.apiUrl,F.apiMethod||"POST",L),ie=(U==null?void 0:U.status)===!0||(U==null?void 0:U.success)===!0,Ce=(U==null?void 0:U.message)||(ie?i.value==="id"?"Sukses":"Success":i.value==="id"?"Gagal":"Failed");Ue.update(he,{render:Ce,type:ie?"success":"error",isLoading:!1,autoClose:ie?3e3:5e3}),ie?((O.fieldMapping||M.fieldMapping)&&we(U,O.fieldMapping||M.fieldMapping),r("success",U)):r("error",U)}catch(U){const ie=((le=(H=U.response)==null?void 0:H.data)==null?void 0:le.message)||U.message||(i.value==="id"?"Terjadi kesalahan":"An error occurred");Ue.update(he,{render:`Gagal: ${ie}`,type:"error",isLoading:!1,autoClose:5e3}),r("error",U)}}else O.type==="SUBMIT"&&r("submit",L);O.keyRedirect&&O.route&&c&&c.push(O.route)},ve=()=>{var O,L;let M=!0;return(L=(O=h.value)==null?void 0:O.sections)==null||L.forEach(F=>{var H;ne(F)&&(((H=F.propsForm)==null?void 0:H.fields)||F.fields||[]).forEach(le=>{if(Y(le)){const he=x(le,m[le.model]);he&&(g[le.model]=he,M=!1)}})}),M},qe=async()=>{var M,O;if(ve()){u.value=!0;try{const L=De(),F=(((M=h.value)==null?void 0:M.actions)||[]).find(le=>{var he;return le.type==="SUBMIT"||le.key==="SUBMIT"||((he=le.propsActionGlobal)==null?void 0:he.type)==="SUBMIT"}),H=(F==null?void 0:F.fieldMapping)||((O=F==null?void 0:F.propsActionGlobal)==null?void 0:O.fieldMapping);r("submit",H?z(L,H):L)}finally{u.value=!1}}},Ge=()=>r("cancel"),tt=(M,O,L)=>{var le;const F=L?`${L}.${M}`:M;ue(m,F,O);const H=(le=b.value.get(M))==null?void 0:le.field;if(H){const he=x(H,O);he?g[M]=he:delete g[M]}r("update:model",De())},ze=M=>!M.permission||(o.isEditMode?M.permission!=="CREATE":M.permission!=="UPDATE"),ut=M=>{var L,F;if((L=M.fields)!=null&&L.length)return M.fields;const O=(M.actionTableGlobal||[]).find(H=>H.permission==="CREATE"||(H.key||"").toLowerCase().includes("add"));return(F=O==null?void 0:O.fieldActionGlobal)!=null&&F.length?O.fieldActionGlobal:(M.headers||[]).filter(H=>H.key&&H.key!=="no").map(H=>({key:H.key,model:H.key,component:"DCodeTextField"}))},bt=M=>{var O;return!(M!=null&&M.apiUrl)&&!((O=M==null?void 0:M.endpointTable)!=null&&O.apiUrl)},It=M=>{if(!M)return!1;const O=(M.key||"").toLowerCase(),L=(M.permission||"").toUpperCase();return O==="detail"||O.includes("view")||L==="VIEW"},Mt=M=>Array.isArray(m[M.modelDatatable])?m[M.modelDatatable]:[],G=e.ref(!1),fe=e.ref(""),_e=e.ref("Plus"),$e=e.ref([]),Ve=e.reactive({}),re=e.reactive({}),de=e.ref(""),me=e.ref(null),Ae=e.ref(!1),nt=e.ref(null),Bt=e.ref(!1),So=(M,O)=>{nt.value={propsTable:M,row:O},Bt.value=!0},Ca=()=>{if(!nt.value)return;const{propsTable:M,row:O}=nt.value;Bt.value=!1;const L=m[M.modelDatatable];if(Array.isArray(L)){const F=L.indexOf(O);if(F!==-1)L.splice(F,1);else{const H=JSON.stringify(O,(he,U)=>["no","_index"].includes(he)?void 0:U),le=L.findIndex(he=>JSON.stringify(he,(U,ie)=>["no","_index"].includes(U)?void 0:ie)===H);le!==-1&&L.splice(le,1)}r("update:model",De())}},Vo=(M,O)=>{Ve[M]=O;const L=$e.value.find(F=>F.model===M);if(L){const F=x(L,O);F?re[M]=F:delete re[M]}},no=(M,O,L)=>{de.value=M.modelDatatable||"",Ae.value=It(O),me.value=null,fe.value=i.value==="id"?O.labelID||"Tambah Data":O.labelEN||"Add Data",_e.value=O.icon||"Plus";const F=ut(M);$e.value=F,Object.keys(Ve).forEach(H=>delete Ve[H]),Object.keys(re).forEach(H=>delete re[H]),F.forEach(H=>Ve[H.model]=L?L[H.model]??null:null),G.value=!0},mt=(M,O)=>{const{action:L,row:F}=O;if(/delete|trash/i.test(L)){const ie=m[M.modelDatatable];if(Array.isArray(ie)){const Ce=ie.indexOf(F);if(Ce!==-1)ie.splice(Ce,1);else{const je=JSON.stringify(F,(st,ot)=>["no","_index"].includes(st)?void 0:ot),Ze=ie.findIndex(st=>JSON.stringify(st,(ot,_t)=>["no","_index"].includes(ot)?void 0:_t)===je);Ze!==-1&&ie.splice(Ze,1)}}return}if(/detail|view/i.test(L)){no(M,{key:"detail",permission:"VIEW"},F);return}const H=M.modelDatatable||"";de.value=H,Ae.value=!1,fe.value=i.value==="id"?"Ubah Data":"Edit Data",_e.value="SquarePen";const le=m[H];let he=Array.isArray(le)?le.indexOf(F):-1;if(he===-1&&Array.isArray(le)){const ie=JSON.stringify(F,(Ce,je)=>["no","_index"].includes(Ce)?void 0:je);he=le.findIndex(Ce=>JSON.stringify(Ce,(je,Ze)=>["no","_index"].includes(je)?void 0:Ze)===ie)}me.value=he!==-1?he:null;const U=ut(M);$e.value=U,Object.keys(Ve).forEach(ie=>delete Ve[ie]),U.forEach(ie=>Ve[ie.model]=F[ie.model]??null),G.value=!0},Ea=()=>{let M=!0;if($e.value.forEach(L=>{const F=x(L,Ve[L.model]);F&&(re[L.model]=F,M=!1)}),!M)return;const O=de.value;O&&(m[O]=m[O]||[],me.value!==null?m[O].splice(me.value,1,{...Ve}):m[O].push({...Ve}),G.value=!1,r("update:model",De()))},oo=new Map,ir=new Map;return e.watch(()=>({...m}),M=>{var le;if(!((le=h.value)!=null&&le.sections))return;Z();const O=A(M),L=he=>{he.forEach(U=>{var Ze;const ie=E(U),Ce=ne(U,M);(((Ze=U.propsForm)==null?void 0:Ze.fields)||U.fields||[]).forEach(st=>{const ot=st.model;if(!ot)return;const _t=ie?`${ie}.${ot}`:ot,be=ae(m,_t),rt=Y(st,M)&&Ce;oo.get(ot)===!0&&rt===!1&&be!==null&&be!==void 0&&(console.log(`[DynamicForm][RESET-VISIBLE] ${ot} BEFORE:`,xe(be)),ue(m,_t,Array.isArray(be)?[]:null),console.log(`[DynamicForm][RESET-VISIBLE] ${ot} AFTER:`,xe(ae(m,_t)))),oo.set(ot,rt);const Pe=st.logic;if(Pe&&rt){const Vt={};let At=!1;["lengthRule","optionsFilterRule","visibleRule"].forEach(xt=>{const vt=Pe[xt];if(!vt)return;const C=N(vt,O,`${xt}-${ot}`),I=JSON.stringify(C);Vt[xt]=I;const te=ir.get(ot);te&&te[xt]!==void 0&&te[xt]!==I&&(At=!0)}),At&&be!==null&&be!==void 0&&(console.log(`[DynamicForm][RESET-LOGIC] ${ot} due to rule change | BEFORE:`,xe(be)),ue(m,_t,Array.isArray(be)?[]:null),console.log(`[DynamicForm][RESET-LOGIC] ${ot} AFTER:`,xe(ae(m,_t)))),ir.set(ot,Vt)}}),U.type==="WIZARD"&&_(U).forEach(st=>L(st.sections))})};L(h.value.sections);const F=De(),H=JSON.stringify(F);H!==d&&(d=H,r("update:model",F))},{deep:!0,immediate:!0}),e.watch(()=>o.model,M=>{M&&Object.keys(M).length>0&&JSON.stringify(M)!==d&&Object.assign(m,M)},{immediate:!0,deep:!0}),(M,O)=>{var L,F,H,le,he;return e.openBlock(),e.createElementBlock("div",sV,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((L=h.value)==null?void 0:L.sections,(U,ie)=>{var Ce,je,Ze,st,ot,_t;return e.openBlock(),e.createElementBlock(e.Fragment,{key:ie},[((Ce=U.type)==null?void 0:Ce.toUpperCase())==="FORM"&&U.propsForm&&ne(U)?(e.openBlock(),e.createElementBlock("div",iV,[((je=U.type)==null?void 0:je.toUpperCase())!=="TABLE"?(e.openBlock(),e.createElementBlock("div",lV,[W(U).title?(e.openBlock(),e.createElementBlock("div",cV,[e.createElementVNode("h3",dV,e.toDisplayString(W(U).title),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",uV,[(Ze=U.propsForm.actionSection)!=null&&Ze.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(U.propsForm.actionSection,(be,rt)=>{var Zt,Pe,Vt,At,xt,vt,C;return e.openBlock(),e.createElementBlock(e.Fragment,{key:rt},[ze(be)?(e.openBlock(),e.createBlock(et,{key:0,icon:be.icon||((Zt=be.propsActionGlobal)==null?void 0:Zt.icon),text:i.value==="id"?be.labelID||((Pe=be.propsActionGlobal)==null?void 0:Pe.labelID):be.labelEN||((Vt=be.propsActionGlobal)==null?void 0:Vt.labelEN),"bg-color":((xt=be.bgColor||((At=be.propsActionGlobal)==null?void 0:At.bgColor))==null?void 0:xt.toLowerCase())||"primary",variant:((C=be.variant||((vt=be.propsActionGlobal)==null?void 0:vt.variant))==null?void 0:C.toLowerCase())||"outline",size:"sm",onClick:I=>J(be)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128)):e.createCommentVNode("",!0),ie===0?(e.openBlock(),e.createBlock(et,{key:1,size:"sm",icon:"List",text:e.unref(a)("common.back"),variant:"outline",onClick:Ge},null,8,["text"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["p-4 grid gap-4",U.propsForm.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B(U.propsForm.fields),be=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:be.key},[Y(be)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([be.column==="FULL"&&U.propsForm.layoutColumns>1?"md:col-span-2":"col-span-1"])},[e.createVNode(ci,{field:be,"model-value":ae(m,E(U)?`${E(U)}.${be.model}`:be.model),"form-data":m,required:X(be),disabled:T(be),options:$(be),error:g[be.model],"dynamic-labels":S(be),"dynamic-length":w(be),"base-url":t.baseUrl,"onUpdate:modelValue":rt=>tt(be.model,rt,E(U))},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)])):((st=U.type)==null?void 0:st.toUpperCase())==="TABLE"&&U.propsTable&&ne(U)?(e.openBlock(),e.createElementBlock("div",fV,[e.createVNode(_o,{"table-config":U.propsTable,data:Mt(U.propsTable),nested:!0,"show-pagination":U.propsTable.pagination??!0,"has-actions":bt(U.propsTable),onAction:be=>mt(U.propsTable,be)},e.createSlots({"header-actions":e.withCtx(()=>{var be;return[(be=U.propsTable.actionTableGlobal)!=null&&be.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(U.propsTable.actionTableGlobal,(rt,Zt)=>{var Pe,Vt;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Zt},[rt.propsActionGlobal?(e.openBlock(),e.createBlock(et,{key:0,icon:rt.propsActionGlobal.icon,text:i.value==="id"?rt.propsActionGlobal.labelID||rt.labelID:rt.propsActionGlobal.labelEN||rt.labelEN,"bg-color":((Pe=rt.propsActionGlobal.bgColor)==null?void 0:Pe.toLowerCase())||"primary",variant:((Vt=rt.propsActionGlobal.variant)==null?void 0:Vt.toLowerCase())||"default",size:"sm",class:"h-8 shadow-none",onClick:At=>no(U.propsTable,rt)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128)):bt(U.propsTable)?(e.openBlock(),e.createBlock(et,{key:1,icon:"Plus",text:i.value==="id"?"Tambah Data":"Add Data","bg-color":"primary",variant:"default",size:"sm",class:"h-8 shadow-none",onClick:rt=>no(U.propsTable,{key:"add_data_auto",permission:"CREATE",labelID:"Tambah Data",labelEN:"Add Data",fieldActionGlobal:ut(U.propsTable)})},null,8,["text","onClick"])):e.createCommentVNode("",!0)]}),_:2},[bt(U.propsTable)?{name:"actions",fn:e.withCtx(({row:be})=>[e.createElementVNode("div",hV,[e.createElementVNode("button",{class:"h-8 w-8 rounded flex items-center justify-center text-primary-600 hover:bg-primary-50 dark:hover:bg-primary-900/30",onClick:e.withModifiers(rt=>no(U.propsTable,{key:"detail",permission:"VIEW",labelID:"Detail",labelEN:"Detail",fieldActionGlobal:ut(U.propsTable)},be),["stop"]),title:"Detail"},[...O[6]||(O[6]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"})],-1)])],8,mV),e.createElementVNode("button",{class:"h-8 w-8 rounded flex items-center justify-center text-warning-600 hover:bg-warning-50 dark:hover:bg-warning-900/30",onClick:e.withModifiers(rt=>mt(U.propsTable,{action:"edit",row:be}),["stop"]),title:"Edit"},[...O[7]||(O[7]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),e.createElementVNode("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})],-1)])],8,pV),e.createElementVNode("button",{class:"h-8 w-8 rounded flex items-center justify-center text-danger-500 hover:bg-danger-50 dark:hover:bg-danger-900/30",onClick:e.withModifiers(rt=>So(U.propsTable,be),["stop"]),title:"Hapus"},[...O[8]||(O[8]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"3 6 5 6 21 6"}),e.createElementVNode("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"}),e.createElementVNode("path",{d:"M10 11v6"}),e.createElementVNode("path",{d:"M14 11v6"}),e.createElementVNode("path",{d:"M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"})],-1)])],8,gV)])]),key:"0"}:void 0]),1032,["table-config","data","show-pagination","has-actions","onAction"])])):((ot=U.type)==null?void 0:ot.toUpperCase())==="WIZARD"&&U.propsWizard&&ne(U)?(e.openBlock(),e.createElementBlock("div",bV,[e.createVNode(Qs,{tabs:_(U),modelValue:k[E(U)],"onUpdate:modelValue":be=>k[E(U)]=be,"is-vertical":U.propsWizard.isVertical,"is-wizard":U.propsWizard.isWizard,"type-wizard":((_t=U.propsWizard.typeWizard)==null?void 0:_t.toLowerCase())||"icon",loading:u.value},e.createSlots({_:2},[e.renderList(_(U),be=>({name:`tab-${be.key}`,fn:e.withCtx(()=>{var rt,Zt;return[e.createElementVNode("div",yV,[be.title||(rt=be.actions)!=null&&rt.length?(e.openBlock(),e.createElementBlock("div",xV,[e.createElementVNode("div",null,[be.title?(e.openBlock(),e.createElementBlock("h4",kV,e.toDisplayString(be.title),1)):e.createCommentVNode("",!0),be.description?(e.openBlock(),e.createElementBlock("p",wV,e.toDisplayString(be.description),1)):e.createCommentVNode("",!0)]),(Zt=be.actions)!=null&&Zt.length?(e.openBlock(),e.createElementBlock("div",CV,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.actions,(Pe,Vt)=>{var At,xt,vt,C,I,te,R;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Vt},[ze(Pe)?(e.openBlock(),e.createBlock(et,{key:0,icon:Pe.icon||((At=Pe.propsActionGlobal)==null?void 0:At.icon),text:i.value==="id"?Pe.labelID||((xt=Pe.propsActionGlobal)==null?void 0:xt.labelID):Pe.labelEN||((vt=Pe.propsActionGlobal)==null?void 0:vt.labelEN),"bg-color":((I=Pe.bgColor||((C=Pe.propsActionGlobal)==null?void 0:C.bgColor))==null?void 0:I.toLowerCase())||"primary",variant:((R=Pe.variant||((te=Pe.propsActionGlobal)==null?void 0:te.variant))==null?void 0:R.toLowerCase())||"tonal",size:"sm",onClick:j=>J(Pe)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.sections,(Pe,Vt)=>{var At,xt,vt;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Vt},[ne(Pe)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[((At=Pe.type)==null?void 0:At.toUpperCase())==="FORM"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid gap-4",Pe.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B(Pe.fields),C=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C.key},[Y(C)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([C.column==="FULL"&&Pe.layoutColumns>1?"md:col-span-2":"col-span-1"])},[e.createVNode(ci,{field:C,"model-value":ae(m,E(Pe)?`${E(Pe)}.${C.model}`:C.model),"form-data":m,required:X(C),disabled:T(C),options:$(C),error:g[C.model],"dynamic-labels":S(C),"dynamic-length":w(C),"base-url":t.baseUrl,"onUpdate:modelValue":I=>tt(C.model,I,E(Pe))},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)):((xt=Pe.type)==null?void 0:xt.toUpperCase())==="TABLE"||Pe.isDataTable?(e.openBlock(),e.createElementBlock("div",EV,[e.createVNode(_o,{"table-config":Pe.propsDataTableWizard||Pe.propsTable,data:Mt(Pe.propsDataTableWizard||Pe.propsTable),nested:!0,"show-pagination":((vt=Pe.propsDataTableWizard||Pe.propsTable)==null?void 0:vt.pagination)??!0,onAction:C=>mt(Pe.propsDataTableWizard||Pe.propsTable,C)},null,8,["table-config","data","show-pagination","onAction"])])):(e.openBlock(),e.createElementBlock("div",BV," Unknown section type: "+e.toDisplayString(Pe.type),1))],64)):e.createCommentVNode("",!0)],64)}),128))])]})}))]),1032,["tabs","modelValue","onUpdate:modelValue","is-vertical","is-wizard","type-wizard","loading"])])):e.createCommentVNode("",!0)],64)}),128)),y!=null&&y.global?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(((H=(F=h.value)==null?void 0:F.ui)==null?void 0:H.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 border-t border-neutral-100 dark:border-neutral-800")},[(he=(le=h.value)==null?void 0:le.actionGlobal)!=null&&he.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(h.value.actionGlobal,(U,ie)=>{var Ce,je,Ze;return e.openBlock(),e.createElementBlock(e.Fragment,{key:ie},[U.propsActionGlobal&&ze(U)?(e.openBlock(),e.createBlock(et,{key:0,icon:U.propsActionGlobal.icon,text:i.value==="id"?U.propsActionGlobal.labelID:U.propsActionGlobal.labelEN,"bg-color":((Ce=U.propsActionGlobal.bgColor)==null?void 0:Ce.toLowerCase())||"primary",variant:((je=U.propsActionGlobal.variant)==null?void 0:je.toLowerCase())||"default",loading:u.value,disabled:K.value&&(U.permission==="CREATE"||U.permission==="UPDATE"||((Ze=U.propsActionGlobal)==null?void 0:Ze.key)==="submit"),onClick:st=>J(U)},null,8,["icon","text","bg-color","variant","loading","disabled","onClick"])):e.createCommentVNode("",!0)],64)}),128)):(e.openBlock(),e.createBlock(et,{key:1,text:"Submit","bg-color":"primary",loading:u.value,disabled:K.value,onClick:qe},null,8,["loading","disabled"]))],2)),e.createVNode(Fn,{modelValue:p.visible,"onUpdate:modelValue":O[1]||(O[1]=U=>p.visible=U),title:p.title,icon:"AlertTriangle","max-width":450},{actions:e.withCtx(()=>[e.createVNode(et,{variant:"outline",text:e.unref(a)("common.cancel"),onClick:O[0]||(O[0]=U=>p.visible=!1)},null,8,["text"]),e.createVNode(et,{text:e.unref(a)("common.confirm"),onClick:se},null,8,["text"])]),default:e.withCtx(()=>[e.createElementVNode("div",_V,e.toDisplayString(p.message),1)]),_:1},8,["modelValue","title"]),e.createVNode(Fn,{modelValue:G.value,"onUpdate:modelValue":O[3]||(O[3]=U=>G.value=U),title:fe.value,icon:_e.value,"max-width":700},{actions:e.withCtx(()=>[e.createVNode(et,{variant:"outline",text:Ae.value?i.value==="id"?"Tutup":"Close":i.value==="id"?"Batal":"Cancel",onClick:O[2]||(O[2]=U=>G.value=!1)},null,8,["text"]),Ae.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(et,{key:0,text:"Save",onClick:Ea}))]),default:e.withCtx(()=>[$e.value.length?(e.openBlock(),e.createElementBlock("div",SV,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,U=>(e.openBlock(),e.createElementBlock("div",{key:U.key,class:e.normalizeClass(U.column==="FULL"?"md:col-span-2":"col-span-1")},[Y(U,Ve)?(e.openBlock(),e.createBlock(ci,{key:0,field:U,"model-value":Ve[U.model],"form-data":Ve,required:Ae.value?!1:X(U,Ve),disabled:Ae.value||T(U,Ve),"view-only":Ae.value,options:$(U,Ve),error:Ae.value?void 0:re[U.model],"dynamic-labels":S(U,Ve),"dynamic-length":w(U,Ve),"base-url":t.baseUrl,"onUpdate:modelValue":ie=>Vo(U.model,ie)},null,8,["field","model-value","form-data","required","disabled","view-only","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])):e.createCommentVNode("",!0)],2))),128))])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title","icon"]),e.createVNode(Fn,{modelValue:Bt.value,"onUpdate:modelValue":O[5]||(O[5]=U=>Bt.value=U),title:i.value==="id"?"Konfirmasi Hapus":"Confirm Delete",icon:"Trash2","max-width":440},{actions:e.withCtx(()=>[e.createVNode(et,{variant:"outline",text:i.value==="id"?"Batal":"Cancel",onClick:O[4]||(O[4]=U=>Bt.value=!1)},null,8,["text"]),e.createVNode(et,{variant:"default","bg-color":"danger",icon:"Trash2",text:i.value==="id"?"Hapus":"Delete",onClick:Ca},null,8,["text"])]),default:e.withCtx(()=>[e.createElementVNode("div",VV,e.toDisplayString(i.value==="id"?"Apakah Anda yakin ingin menghapus data ini? Tindakan ini tidak dapat dibatalkan.":"Are you sure you want to delete this row? This action cannot be undone."),1)]),_:1},8,["modelValue","title"])])}}}),DV={class:"w-full space-y-6 animate-pulse"},NV={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},MV=e.defineComponent({__name:"AutoLayoutSkeleton",setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",DV,[o[2]||(o[2]=e.createElementVNode("div",{class:"h-6 w-48 bg-neutral-200 dark:bg-neutral-700 rounded-md"},null,-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(2,r=>e.createElementVNode("div",{key:r,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 overflow-hidden"},[o[1]||(o[1]=e.createElementVNode("div",{class:"px-4 py-3 bg-neutral-200 dark:bg-neutral-700"},[e.createElementVNode("div",{class:"h-4 w-32 bg-neutral-300 dark:bg-neutral-600 rounded"})],-1)),e.createElementVNode("div",NV,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,a=>e.createElementVNode("div",{key:a,class:e.normalizeClass(a>4?"md:col-span-2":"col-span-1")},[...o[0]||(o[0]=[e.createElementVNode("div",{class:"h-3 w-24 bg-neutral-200 dark:bg-neutral-700 rounded mb-2"},null,-1),e.createElementVNode("div",{class:"h-10 w-full bg-neutral-200 dark:bg-neutral-700 rounded-lg"},null,-1)])],2)),64))])])),64)),o[3]||(o[3]=e.createElementVNode("div",{class:"flex items-center gap-2"},[e.createElementVNode("div",{class:"h-9 w-24 bg-neutral-300 dark:bg-neutral-600 rounded-lg"}),e.createElementVNode("div",{class:"h-9 w-20 bg-neutral-200 dark:bg-neutral-700 rounded-lg"})],-1))]))}}),vV={class:"w-full"},PV={class:"relative mx-auto min-h-[37.5rem]"},TV={key:"content",class:"w-full"},OV={class:"mb-6"},FV={class:"text-neutral-500 dark:text-neutral-400"},zV={key:"skeleton",class:"w-full"},IV={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},di=Ot(e.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},isEditMode:{type:Boolean},model:{}},emits:["submit-success","cancel","action-success","update:model"],setup(t,{emit:n}){var D,N,P,v,Q,$,q,Y;const o=t,r=n,a=(N=(D=e.getCurrentInstance())==null?void 0:D.appContext)==null?void 0:N.app;a&&!a._context.provides[Symbol.for("vue-router-route-location")]&&a.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let s={query:{},params:{},path:""};try{const X=In.useRoute();if(X&&Object.keys(X).length>0)s=X;else{const T=e.getCurrentInstance();(Q=(v=(P=T==null?void 0:T.appContext)==null?void 0:P.config)==null?void 0:v.globalProperties)!=null&&Q.$route&&(s=T.appContext.config.globalProperties.$route)}}catch{console.warn("useRoute not available, using fallback")}let i={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:X=>{typeof window<"u"&&(typeof X=="string"?window.location.href=X:X&&X.path&&(window.location.href=X.path))},__isFallback:!0};try{const X=In.useRouter();if(X)i=X;else{const T=e.getCurrentInstance();(Y=(q=($=T==null?void 0:T.appContext)==null?void 0:$.config)==null?void 0:q.globalProperties)!=null&&Y.$router&&(i=T.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=ft();let d;try{d=$t.useI18n().locale}catch{d=e.ref("en")}const{setPageTitle:u}=hu(),f=e.computed(()=>o.isEditMode!==void 0?o.isEditMode:s.params&&"id"in s.params?!0:s.path?/\/edit\/[^\/]+$/.test(s.path):!1);e.watchEffect(()=>{console.log("isEditModeisEditMode",f.value)});const h=e.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const X=s.path.match(/\/edit\/([^\/]+)$/);return X?X[1]:null}),m=e.ref({}),g=e.ref(null),k=e.ref(!0),y=e.ref(!1),p="https://dcodedynamic.skyworx.co.id/api/auto-layout/form/form-dynamic?code=",E="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",_=e.ref(o.layoutCode),B=e.computed(()=>{var W;if(!g.value)return"";const X=((W=d==null?void 0:d.value)==null?void 0:W.toLowerCase())||"en";return(X==="en"||X.startsWith("en-")?g.value.titleEN:g.value.titleID)||g.value.title||o.layoutCode});e.watch(B,X=>{X&&u(X)},{immediate:!0});const S=(X,T="")=>{const W={};return!X||typeof X!="object"||Object.keys(X).forEach(ne=>{const Z=X[ne],K=T?`${T}.${ne}`:ne;Z&&typeof Z=="object"&&!Array.isArray(Z)&&!(Z instanceof Date)&&Object.assign(W,S(Z,K)),W[K]=Z}),W},w=async()=>{var X,T,W,ne,Z,K;k.value=!0;try{let ae=o.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&(ae=s.query.code||o.layoutCode);const ue="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",xe=ue?{Authorization:`Bearer ${ue}`}:{},De=`${p}${ae}`;let we=await l(De,"GET",null,xe);if(!we.status||!we.data||Array.isArray(we.data)&&we.data.length===0)try{const ee=`${E}${ae}`,z=await l(ee,"GET",null,xe);if(z.status){const J=Array.isArray(z.data)?z.data[0]:z.data;J&&J.code&&(ae=J.code,_.value=ae,we=await l(`${p}${ae}`,"GET",null,xe))}}catch(ee){console.warn("Failed to resolve layout code via datatable",ee)}if(we.status){g.value=Array.isArray(we.data)?we.data[0]:we.data;const ee={};if((X=g.value)!=null&&X.sections&&g.value.sections.forEach(z=>{((z.propsForm||z.props||{}).fields||z.fields||[]).forEach(Ee=>{var qe;const ve=Ee.model||((qe=Ee.props)==null?void 0:qe.model)||Ee.key;ve&&(ee[ve]=null)})}),m.value=ee,k.value=!1,f.value&&h.value){y.value=!0;try{const z=(ne=(W=(T=g.value.sections)==null?void 0:T[0])==null?void 0:W.propsForm)==null?void 0:ne.endpointForm,J=g.value.endpointForm,se=z||J;if(se!=null&&se.apiUrl){const Ee=se.apiUrl,ve=se.apiMethod||"GET",qe=se.keyParam||[],Ge={};qe.length>0?qe.forEach(ze=>{Ge[ze]=h.value}):Ge.id=h.value;const tt=await c(Ee,ve,Ge);if(tt.status){let ze=Array.isArray(tt.data)?tt.data[0]:tt.data;tt.payload&&(ze={...ze,...tt.payload});const ut=S(ze);m.value={...m.value,...ze,...ut}}}else if((Z=g.value.endpointGlobal)!=null&&Z.apiUrl){const Ee=g.value.endpointGlobal.apiUrl,ve=g.value.endpointGlobal.apiMethod||"GET",qe={id:h.value},Ge=await c(Ee,ve,qe);if(Ge.status){const tt=Array.isArray(Ge.data)?Ge.data[0]:Ge.data,ze=S(tt);m.value={...m.value,...tt,...ze}}}else{const Ee=((K=g.value.endpoint)==null?void 0:K.detailUrl)||`/api/${_.value}/detail/${h.value}`,ve=await l(Ee,"GET");if(ve.status){let qe=Array.isArray(ve.data)?ve.data[0]:ve.data;if(ve.payload){const ze={...ve.payload};if(Object.keys(ze).forEach(ut=>{qe[ut]!==void 0&&qe[ut]!==null&&(ze[ut]=qe[ut])}),!("id"in ze)&&qe.id){const ut=Object.keys(ze).find(bt=>bt.startsWith("id")&&bt.length>2&&!ze[bt]);ut&&(ze[ut]=qe.id)}qe=ze}const Ge={...qe};Object.keys(m.value).forEach(ze=>{if(Ge[ze]===void 0||Ge[ze]===null){if(ze.toLowerCase().startsWith("id")&&ze.length>2){const bt=ze.substring(2).toLowerCase(),It=Array.isArray(ve.data)?ve.data[0]:ve.data,Mt=Object.keys(It).find(G=>G.toLowerCase()===bt);Mt&&It[Mt]&&typeof It[Mt]=="object"&&"id"in It[Mt]&&(Ge[ze]=It[Mt].id)}if(ze==="idSupervisor"){const bt=Array.isArray(ve.data)?ve.data[0]:ve.data;bt.supervisorId&&(Ge[ze]=bt.supervisorId)}}});const tt=S(Ge);m.value={...m.value,...Ge,...tt}}}}catch(z){console.error("Failed to fetch record data:",z)}finally{y.value=!1}}}}catch(ae){console.error("Failed to load form layout:",ae),k.value=!1}},x=X=>{m.value=X,r("update:model",X)},b=async X=>{var T,W,ne;try{const Z=(ne=(W=(T=g.value.sections)==null?void 0:T[0])==null?void 0:W.propsForm)==null?void 0:ne.endpointForm,K=g.value.endpointGlobal||g.value.endpoint,ae=(Z==null?void 0:Z.submitUrl)||(K==null?void 0:K.submitUrl)||`/api/generic/${o.layoutCode}`,ue=(Z==null?void 0:Z.submitMethod)||(K==null?void 0:K.submitMethod)||(f.value?"PUT":"POST"),xe=Object.values(X).some(we=>we instanceof File||we instanceof Blob);let De;xe?(De=new FormData,Object.keys(X).forEach(we=>{const ee=X[we];ee!=null&&(Array.isArray(ee)?ee.forEach(z=>De.append(`${we}[]`,z)):De.append(we,ee))})):(De={...X},f.value&&h.value&&!De.id&&(De.id=h.value)),await l(ae,ue,De),r("submit-success",De),i.back()}catch(Z){console.error("Submit failed:",Z)}},V=async(X,T,W)=>{if(X==="cancel"){A();return}const ne=T.endpointPropAction||T.propsActionGlobal&&T.propsActionGlobal.endpointPropAction;if(ne)try{k.value=!0;const Z=W?{...W}:{...m.value};f.value&&T.model&&h.value&&(Z[T.model]=h.value);const K=ne.apiUrl,ae=ne.apiMethod||"POST";(await c(K,ae,Z)).status&&(r("action-success",X,T,Z),i.back())}catch(Z){console.error("Action failed:",Z)}finally{k.value=!1}},A=()=>{r("cancel"),i.back()};return e.onMounted(()=>{w()}),e.watch(()=>o.model,X=>{X&&Object.keys(X).length>0&&(m.value={...m.value,...X})},{immediate:!0,deep:!0}),e.onUnmounted(()=>{u("")}),(X,T)=>(e.openBlock(),e.createElementBlock("div",vV,[e.createElementVNode("div",PV,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[!k.value&&g.value?(e.openBlock(),e.createElementBlock("div",TV,[e.createElementVNode("div",OV,[e.createElementVNode("p",FV,e.toDisplayString(g.value.description),1)]),e.createVNode(AV,{schema:g.value,model:m.value,"is-edit-mode":f.value,loading:y.value,"onUpdate:model":T[0]||(T[0]=W=>x(W)),onSubmit:b,onCancel:A,onAction:V,class:"w-full"},null,8,["schema","model","is-edit-mode","loading"])])):k.value?(e.openBlock(),e.createElementBlock("div",zV,[e.createVNode(MV)])):(e.openBlock(),e.createElementBlock("div",IV," Failed to load form configuration for "+e.toDisplayString(o.layoutCode),1))]),_:1})])]))}}),[["__scopeId","data-v-9d6797b1"]]),RV={class:"h-full flex flex-col"},LV={key:1,class:"flex-1 flex items-center justify-center"},$V={key:2,class:"flex-1 flex items-center justify-center text-red-500"},ui=e.defineComponent({name:"AutoLayoutDatatable",__name:"AutoLayoutDatatable",props:{layoutCode:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function}},emits:["action","navigate"],setup(t,{emit:n}){var S,w,x,b,V,A;const o=t,r=n,a=e.getCurrentInstance(),{apiUrl:s}=ft();let i={query:{},params:{},path:""};try{const D=In.useRoute();D?i=D:(x=(w=(S=a==null?void 0:a.appContext)==null?void 0:S.config)==null?void 0:w.globalProperties)!=null&&x.$route&&(i=a.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let l={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:D=>{typeof window<"u"&&(typeof D=="string"?window.location.href=D:D&&D.path&&(window.location.href=D.path))}};try{const D=In.useRouter();D?l=D:(A=(V=(b=a==null?void 0:a.appContext)==null?void 0:b.config)==null?void 0:V.globalProperties)!=null&&A.$router&&(l=a.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const c=e.inject("hasActionAccess",()=>!1),d=e.inject("userPermissions",null),u=e.ref(null),f=e.ref(!0),h=e.ref(null),m="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",g=e.computed(()=>`${m}${o.layoutCode}`),{setPageTitle:k}=hu();let y;try{y=$t.useI18n().locale}catch{y=e.ref("en")}const p=()=>{if(u.value){const N=(y.value==="id"?u.value.titleID:u.value.titleEN)||u.value.title||"Datatable";k(N)}};e.watch(y,()=>{p()});const E=async()=>{f.value=!0;try{const D="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",N=D?{Authorization:`Bearer ${D}`}:{},P=await s(g.value,"GET",null,N);P.status&&(u.value=Array.isArray(P.data)?P.data[0]:P.data,console.log("[DEBUG] AutoLayoutDatatable config loaded:",u.value),p())}catch(D){console.error("Gagal Menampilkan Datatable:",D)}finally{f.value=!1}},_=D=>{D.action==="add"&&console.log("[AutoLayoutDatatable] Add action triggered"),console.log("Aksi:",D.action,D)},B=D=>{console.log("[DEBUG] AutoLayoutDatatable handleNavigate:",D);let N=D.route;const P=D.path;if(!N&&P){const Q=((i==null?void 0:i.path)||"").split("/");Q.length>=2&&(N=`/${Q[1]}/create`)}if(N||P){const v={...D.query||{},code:P||void 0};Object.keys(v).forEach(Q=>v[Q]===void 0&&delete v[Q]),console.log("[DEBUG] Emitting navigate to parent:",{route:N,query:v}),r("navigate",{route:N||"/form",query:v}),l&&!l.__isFallback&&l.push({path:N||"/form",query:v})}else console.warn("[DEBUG] No route or path provided for navigation")};return e.onMounted(()=>{E()}),(D,N)=>(e.openBlock(),e.createElementBlock("div",RV,[!f.value&&u.value?(e.openBlock(),e.createBlock(_o,{key:0,ref_key:"dtRef",ref:h,"api-url":g.value,"api-method":"GET","table-config":u.value,"permission-base":o.permissionBase||"","dummy-mode":["datatable-create","datatable-edit"].includes(o.layoutCode),"user-permissions":o.userPermissions||e.unref(d),"permission-checker":e.unref(c),checkPermission:o.checkPermission,onAction:_,onNavigate:B},{"header-actions":e.withCtx(()=>[...N[0]||(N[0]=[])]),_:1},8,["api-url","table-config","permission-base","dummy-mode","user-permissions","permission-checker","checkPermission"])):f.value?(e.openBlock(),e.createElementBlock("div",LV,[...N[1]||(N[1]=[e.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",$V," Failed to load configuration for "+e.toDisplayString(o.layoutCode),1))]))}}),mu=e.defineCustomElement(di),pu=e.defineCustomElement(ui);typeof customElements<"u"&&(customElements.get("micro-dynamic-form")||customElements.define("micro-dynamic-form",mu),customElements.get("micro-dynamic-datatable")||customElements.define("micro-dynamic-datatable",pu));const jV=[gr,zi,et,bl,Xa,Ka,Vd,Cn,zs,Is,oa,Fn,Ud,ra,Hd,Hs,Rs,qd,Gs,aa,Xs,ko,Ks,sa,Gd,Xd,Ys,Js,ia,la,lo,wo,Qd,Zd,Qs,Zs,ei,li,_o,di,ui],gu={install(t,n={}){n&&Object.keys(n).length>0&&mi(n),jV.forEach(o=>{o.name&&t.component(o.name,o)})}};pe.AutoLayoutDatatable=ui,pe.AutoLayoutForm=di,pe.DCodeAutoComplete=gr,pe.DCodeBadge=li,pe.DCodeBeforeAfter=Xa,pe.DCodeButton=et,pe.DCodeCard=bl,pe.DCodeCardCheckboxList=zs,pe.DCodeChart=Vd,pe.DCodeCheckbox=Cn,pe.DCodeCurrencyField=Is,pe.DCodeDatePicker=oa,pe.DCodeDialog=Fn,pe.DCodeDialogCloseBtn=Ud,pe.DCodeDropzone=ra,pe.DCodeDynamicUploadList=Rs,pe.DCodeFileField=Hd,pe.DCodeFileResult=Hs,pe.DCodeIconDropdown=qd,pe.DCodeImageCropperDialog=Gs,pe.DCodeImageField=aa,pe.DCodeImageResult=Xs,pe.DCodeInfiniteAutoComplete=zi,pe.DCodeLabel=ko,pe.DCodeListLabels=Ka,pe.DCodeMultiSelect=Ks,pe.DCodeOtpInput=sa,pe.DCodePermissionMenu=Zs,pe.DCodeProgress=Gd,pe.DCodeProgressBar=Xd,pe.DCodeRadio=Ys,pe.DCodeRadioCustom=Js,pe.DCodeSlider=ia,pe.DCodeSwitch=la,pe.DCodeTextField=lo,pe.DCodeTextarea=wo,pe.DCodeTimelineWithIcons=Qd,pe.DCodeTreePermissions=ei,pe.DCodeUploadFile=Zd,pe.DCodeWizard=Qs,pe.DataTable=_o,pe.DataTableComponent=_o,pe.DynamicUI=gu,pe.MicroDynamicDatatable=pu,pe.MicroDynamicForm=mu,pe.cn=Ie,pe.default=gu,pe.setApiConfig=mi,Object.defineProperties(pe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));