@gemafajarramadhan/dynamic-ui 1.2.31 → 1.2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dynamic-ui.es.js +4983 -4948
- package/dist/dynamic-ui.umd.js +9 -9
- package/package.json +1 -1
package/dist/dynamic-ui.umd.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
(function(se,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("lucide-vue-next"),require("reka-ui"),require("@vueuse/core"),require("@vuepic/vue-datepicker"),require("@uppy/core"),require("@uppy/dashboard"),require("@uppy/image-editor"),require("vue-i18n"),require("vue-router"),require("vue3-lottie")):typeof define=="function"&&define.amd?define(["exports","vue","lucide-vue-next","reka-ui","@vueuse/core","@vuepic/vue-datepicker","@uppy/core","@uppy/dashboard","@uppy/image-editor","vue-i18n","vue-router","vue3-lottie"],n):(se=typeof globalThis<"u"?globalThis:se||self,n(se.DynamicUI={},se.Vue,se.LucideIcons,se.rekaUi,se.core,se.VueDatePicker,se.Uppy,se.UppyDashboard,se.UppyImageEditor,se.VueI18n,se.VueRouter,se.Vue3Lottie))})(this,(function(se,n,te,ie,ze,Jd,Qd,Os,Zd,Ht,An,eu){"use strict";var MS=Object.defineProperty;var NS=(se,n,te)=>n in se?MS(se,n,{enumerable:!0,configurable:!0,writable:!0,value:te}):se[n]=te;var de=(se,n,te)=>NS(se,typeof n!="symbol"?n+"":n,te);var Ha;function tu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,a.get?a:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const Ct=tu(te);let gt={};function zs(e){gt={...gt,...e}}function nu(){return gt}function ou(){return gt.apiBaseUrl?gt.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function au(){const e={"Content-Type":"application/json",Accept:"application/json"};let t=null;if(gt.getAuthToken?t=gt.getAuthToken():typeof window<"u"&&window.__MICRO_AUTH_TOKEN__?t=window.__MICRO_AUTH_TOKEN__:typeof localStorage<"u"&&(t=localStorage.getItem("token")||sessionStorage.getItem("token")),t&&(e.Authorization=`Bearer ${t}`),gt.getHeaders){const o=gt.getHeaders();return{...e,...o}}return e}function ru(){gt.onUnauthorized&>.onUnauthorized()}async function Fs(e,t,o,a){const r=nu();if(r.apiClient)return r.apiClient(e,t||"GET",o);if(!e||!e.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=(t||"").trim().toUpperCase(),l=s.includes(i)?i:"GET";s.includes(i)||console.warn(`[DynamicUI][useApi] HTTP method '${t}' tidak valid, fallback ke 'GET'.`);const c=ou(),d=e.startsWith("http")?e:`${c}${e}`,u={method:l,headers:{...au(),...a||{}}};o&&!["GET","DELETE"].includes(l)&&(u.body=JSON.stringify(o));let f=d;if(o&&l==="GET"){const p=new URLSearchParams;Object.entries(o).forEach(([y,x])=>{x!=null&&p.append(y,String(x))});const g=p.toString();g&&(f=`${d}${d.includes("?")?"&":"?"}${g}`)}const h=await fetch(f,u);if(h.status===401&&ru(),!h.ok){const p=await h.text();throw new Error(`HTTP ${h.status}: ${p}`)}return(h.headers.get("content-type")||"").includes("application/json")?h.json():{status:!0,data:await h.text()}}function Je(){return{apiUrl:(o,a,r,s)=>Fs(o,a,r,s),DCodeApi:(o,a,r,s)=>{let i=o,l=a,c=r;return s&&s._url?(i=s._url,l=s._method||l||"POST",s._data&&(c={...c||{},...s._data})):o&&a&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(a.toUpperCase())||(i=`${o.endsWith("/")?o.slice(0,-1):o}/${a}`,l="POST")),Fs(i,l,c,s==null?void 0:s.headers)}}}const Vn=Math.min,it=Math.max,Po=Math.round,vo=Math.floor,_t=e=>({x:e,y:e}),su={left:"right",right:"left",bottom:"top",top:"bottom"},iu={start:"end",end:"start"};function Is(e,t,o){return it(e,Vn(t,o))}function Xn(e,t){return typeof e=="function"?e(t):e}function qt(e){return e.split("-")[0]}function Yn(e){return e.split("-")[1]}function Rs(e){return e==="x"?"y":"x"}function Ls(e){return e==="y"?"height":"width"}const lu=new Set(["top","bottom"]);function Tt(e){return lu.has(qt(e))?"y":"x"}function $s(e){return Rs(Tt(e))}function cu(e,t,o){o===void 0&&(o=!1);const a=Yn(e),r=$s(e),s=Ls(r);let i=r==="x"?a===(o?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=To(i)),[i,To(i)]}function du(e){const t=To(e);return[tr(e),t,tr(t)]}function tr(e){return e.replace(/start|end/g,t=>iu[t])}const Ws=["left","right"],js=["right","left"],uu=["top","bottom"],fu=["bottom","top"];function hu(e,t,o){switch(e){case"top":case"bottom":return o?t?js:Ws:t?Ws:js;case"left":case"right":return t?uu:fu;default:return[]}}function mu(e,t,o,a){const r=Yn(e);let s=hu(qt(e),o==="start",a);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(tr)))),s}function To(e){return e.replace(/left|right|bottom|top/g,t=>su[t])}function pu(e){return{top:0,right:0,bottom:0,left:0,...e}}function gu(e){return typeof e!="number"?pu(e):{top:e,right:e,bottom:e,left:e}}function Oo(e){const{x:t,y:o,width:a,height:r}=e;return{width:a,height:r,top:o,left:t,right:t+a,bottom:o+r,x:t,y:o}}function Us(e,t,o){let{reference:a,floating:r}=e;const s=Tt(t),i=$s(t),l=Ls(i),c=qt(t),d=s==="y",u=a.x+a.width/2-r.width/2,f=a.y+a.height/2-r.height/2,h=a[l]/2-r[l]/2;let m;switch(c){case"top":m={x:u,y:a.y-r.height};break;case"bottom":m={x:u,y:a.y+a.height};break;case"right":m={x:a.x+a.width,y:f};break;case"left":m={x:a.x-r.width,y:f};break;default:m={x:a.x,y:a.y}}switch(Yn(t)){case"start":m[i]-=h*(o&&d?-1:1);break;case"end":m[i]+=h*(o&&d?-1:1);break}return m}async function bu(e,t){var o;t===void 0&&(t={});const{x:a,y:r,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Xn(t,e),p=gu(m),y=l[h?f==="floating"?"reference":"floating":f],x=Oo(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})),_=f==="floating"?{x:a,y:r,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),w=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},E=Oo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:C,strategy:c}):_);return{top:(x.top-E.top+p.top)/w.y,bottom:(E.bottom-x.bottom+p.bottom)/w.y,left:(x.left-E.left+p.left)/w.x,right:(E.right-x.right+p.right)/w.x}}const yu=async(e,t,o)=>{const{placement:a="bottom",strategy:r="absolute",middleware:s=[],platform:i}=o,l=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=Us(d,a,c),h=a,m={},p=0;for(let y=0;y<l.length;y++){var g;const{name:x,fn:_}=l[y],{x:C,y:w,data:E,reset:B}=await _({x:u,y:f,initialPlacement:a,placement:h,strategy:r,middlewareData:m,rects:d,platform:{...i,detectOverflow:(g=i.detectOverflow)!=null?g:bu},elements:{reference:e,floating:t}});u=C??u,f=w??f,m={...m,[x]:{...m[x],...E}},B&&p<=50&&(p++,typeof B=="object"&&(B.placement&&(h=B.placement),B.rects&&(d=B.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):B.rects),{x:u,y:f}=Us(d,h,c)),y=-1)}return{x:u,y:f,placement:h,strategy:r,middlewareData:m}},xu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var o,a;const{placement:r,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...y}=Xn(e,t);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const x=qt(r),_=Tt(l),C=qt(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),E=h||(C||!g?[To(l)]:du(l)),B=p!=="none";!h&&B&&E.push(...mu(l,g,p,w));const k=[l,...E],b=await c.detectOverflow(t,y),A=[];let D=((a=s.flip)==null?void 0:a.overflows)||[];if(u&&A.push(b[x]),f){const z=cu(r,i,w);A.push(b[z[0]],b[z[1]])}if(D=[...D,{placement:r,overflows:A}],!A.every(z=>z<=0)){var P,V;const z=(((P=s.flip)==null?void 0:P.index)||0)+1,N=k[z];if(N&&(!(f==="alignment"?_!==Tt(N):!1)||D.every(R=>Tt(R.placement)===_?R.overflows[0]>0:!0)))return{data:{index:z,overflows:D},reset:{placement:N}};let v=(V=D.filter(T=>T.overflows[0]<=0).sort((T,R)=>T.overflows[1]-R.overflows[1])[0])==null?void 0:V.placement;if(!v)switch(m){case"bestFit":{var M;const T=(M=D.filter(R=>{if(B){const H=Tt(R.placement);return H===_||H==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(H=>H>0).reduce((H,O)=>H+O,0)]).sort((R,H)=>R[1]-H[1])[0])==null?void 0:M[0];T&&(v=T);break}case"initialPlacement":v=l;break}if(r!==v)return{reset:{placement:v}}}return{}}}},ku=new Set(["left","top"]);async function wu(e,t){const{placement:o,platform:a,elements:r}=e,s=await(a.isRTL==null?void 0:a.isRTL(r.floating)),i=qt(o),l=Yn(o),c=Tt(o)==="y",d=ku.has(i)?-1:1,u=s&&c?-1:1,f=Xn(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof p=="number"&&(m=l==="end"?p*-1:p),c?{x:m*u,y:h*d}:{x:h*d,y:m*u}}const Cu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var o,a;const{x:r,y:s,placement:i,middlewareData:l}=t,c=await wu(t,e);return i===((o=l.offset)==null?void 0:o.placement)&&(a=l.arrow)!=null&&a.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},_u=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:a,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:x=>{let{x:_,y:C}=x;return{x:_,y:C}}},...d}=Xn(e,t),u={x:o,y:a},f=await s.detectOverflow(t,d),h=Tt(qt(r)),m=Rs(h);let p=u[m],g=u[h];if(i){const x=m==="y"?"top":"left",_=m==="y"?"bottom":"right",C=p+f[x],w=p-f[_];p=Is(C,p,w)}if(l){const x=h==="y"?"top":"left",_=h==="y"?"bottom":"right",C=g+f[x],w=g-f[_];g=Is(C,g,w)}const y=c.fn({...t,[m]:p,[h]:g});return{...y,data:{x:y.x-o,y:y.y-a,enabled:{[m]:i,[h]:l}}}}}},Bu=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var o,a;const{placement:r,rects:s,platform:i,elements:l}=t,{apply:c=()=>{},...d}=Xn(e,t),u=await i.detectOverflow(t,d),f=qt(r),h=Yn(r),m=Tt(r)==="y",{width:p,height:g}=s.floating;let y,x;f==="top"||f==="bottom"?(y=f,x=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(x=f,y=h==="end"?"top":"bottom");const _=g-u.top-u.bottom,C=p-u.left-u.right,w=Vn(g-u[y],_),E=Vn(p-u[x],C),B=!t.middlewareData.shift;let k=w,b=E;if((o=t.middlewareData.shift)!=null&&o.enabled.x&&(b=C),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(k=_),B&&!h){const D=it(u.left,0),P=it(u.right,0),V=it(u.top,0),M=it(u.bottom,0);m?b=p-2*(D!==0||P!==0?D+P:it(u.left,u.right)):k=g-2*(V!==0||M!==0?V+M:it(u.top,u.bottom))}await c({...t,availableWidth:b,availableHeight:k});const A=await i.getDimensions(l.floating);return p!==A.width||g!==A.height?{reset:{rects:!0}}:{}}}};function zo(){return typeof window<"u"}function dn(e){return nr(e)?(e.nodeName||"").toLowerCase():"#document"}function lt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bt(e){var t;return(t=(nr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function nr(e){return zo()?e instanceof Node||e instanceof lt(e).Node:!1}function bt(e){return zo()?e instanceof Element||e instanceof lt(e).Element:!1}function Et(e){return zo()?e instanceof HTMLElement||e instanceof lt(e).HTMLElement:!1}function Hs(e){return!zo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof lt(e).ShadowRoot}const Eu=new Set(["inline","contents"]);function Kn(e){const{overflow:t,overflowX:o,overflowY:a,display:r}=yt(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+o)&&!Eu.has(r)}const Su=new Set(["table","td","th"]);function Au(e){return Su.has(dn(e))}const Vu=[":popover-open",":modal"];function Fo(e){return Vu.some(t=>{try{return e.matches(t)}catch{return!1}})}const Du=["transform","translate","scale","rotate","perspective"],Mu=["transform","translate","scale","rotate","perspective","filter"],Nu=["paint","layout","strict","content"];function or(e){const t=ar(),o=bt(e)?yt(e):e;return Du.some(a=>o[a]?o[a]!=="none":!1)||(o.containerType?o.containerType!=="normal":!1)||!t&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!t&&(o.filter?o.filter!=="none":!1)||Mu.some(a=>(o.willChange||"").includes(a))||Nu.some(a=>(o.contain||"").includes(a))}function Pu(e){let t=Gt(e);for(;Et(t)&&!Dn(t);){if(or(t))return t;if(Fo(t))return null;t=Gt(t)}return null}function ar(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vu=new Set(["html","body","#document"]);function Dn(e){return vu.has(dn(e))}function yt(e){return lt(e).getComputedStyle(e)}function Io(e){return bt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gt(e){if(dn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Hs(e)&&e.host||Bt(e);return Hs(t)?t.host:t}function qs(e){const t=Gt(e);return Dn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Et(t)&&Kn(t)?t:qs(t)}function Jn(e,t,o){var a;t===void 0&&(t=[]),o===void 0&&(o=!0);const r=qs(e),s=r===((a=e.ownerDocument)==null?void 0:a.body),i=lt(r);if(s){const l=rr(i);return t.concat(i,i.visualViewport||[],Kn(r)?r:[],l&&o?Jn(l):[])}return t.concat(r,Jn(r,[],o))}function rr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gs(e){const t=yt(e);let o=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=Et(e),s=r?e.offsetWidth:o,i=r?e.offsetHeight:a,l=Po(o)!==s||Po(a)!==i;return l&&(o=s,a=i),{width:o,height:a,$:l}}function sr(e){return bt(e)?e:e.contextElement}function Mn(e){const t=sr(e);if(!Et(t))return _t(1);const o=t.getBoundingClientRect(),{width:a,height:r,$:s}=Gs(t);let i=(s?Po(o.width):o.width)/a,l=(s?Po(o.height):o.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Tu=_t(0);function Xs(e){const t=lt(e);return!ar()||!t.visualViewport?Tu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ou(e,t,o){return t===void 0&&(t=!1),!o||t&&o!==lt(e)?!1:t}function un(e,t,o,a){t===void 0&&(t=!1),o===void 0&&(o=!1);const r=e.getBoundingClientRect(),s=sr(e);let i=_t(1);t&&(a?bt(a)&&(i=Mn(a)):i=Mn(e));const l=Ou(s,o,a)?Xs(s):_t(0);let c=(r.left+l.x)/i.x,d=(r.top+l.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s){const h=lt(s),m=a&&bt(a)?lt(a):a;let p=h,g=rr(p);for(;g&&a&&m!==p;){const y=Mn(g),x=g.getBoundingClientRect(),_=yt(g),C=x.left+(g.clientLeft+parseFloat(_.paddingLeft))*y.x,w=x.top+(g.clientTop+parseFloat(_.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,f*=y.y,c+=C,d+=w,p=lt(g),g=rr(p)}}return Oo({width:u,height:f,x:c,y:d})}function Ro(e,t){const o=Io(e).scrollLeft;return t?t.left+o:un(Bt(e)).left+o}function Ys(e,t){const o=e.getBoundingClientRect(),a=o.left+t.scrollLeft-Ro(e,o),r=o.top+t.scrollTop;return{x:a,y:r}}function zu(e){let{elements:t,rect:o,offsetParent:a,strategy:r}=e;const s=r==="fixed",i=Bt(a),l=t?Fo(t.floating):!1;if(a===i||l&&s)return o;let c={scrollLeft:0,scrollTop:0},d=_t(1);const u=_t(0),f=Et(a);if((f||!f&&!s)&&((dn(a)!=="body"||Kn(i))&&(c=Io(a)),Et(a))){const m=un(a);d=Mn(a),u.x=m.x+a.clientLeft,u.y=m.y+a.clientTop}const h=i&&!f&&!s?Ys(i,c):_t(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 Fu(e){return Array.from(e.getClientRects())}function Iu(e){const t=Bt(e),o=Io(e),a=e.ownerDocument.body,r=it(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),s=it(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let i=-o.scrollLeft+Ro(e);const l=-o.scrollTop;return yt(a).direction==="rtl"&&(i+=it(t.clientWidth,a.clientWidth)-r),{width:r,height:s,x:i,y:l}}const Ks=25;function Ru(e,t){const o=lt(e),a=Bt(e),r=o.visualViewport;let s=a.clientWidth,i=a.clientHeight,l=0,c=0;if(r){s=r.width,i=r.height;const u=ar();(!u||u&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const d=Ro(a);if(d<=0){const u=a.ownerDocument,f=u.body,h=getComputedStyle(f),m=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(a.clientWidth-f.clientWidth-m);p<=Ks&&(s-=p)}else d<=Ks&&(s+=d);return{width:s,height:i,x:l,y:c}}const Lu=new Set(["absolute","fixed"]);function $u(e,t){const o=un(e,!0,t==="fixed"),a=o.top+e.clientTop,r=o.left+e.clientLeft,s=Et(e)?Mn(e):_t(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,d=a*s.y;return{width:i,height:l,x:c,y:d}}function Js(e,t,o){let a;if(t==="viewport")a=Ru(e,o);else if(t==="document")a=Iu(Bt(e));else if(bt(t))a=$u(t,o);else{const r=Xs(e);a={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Oo(a)}function Qs(e,t){const o=Gt(e);return o===t||!bt(o)||Dn(o)?!1:yt(o).position==="fixed"||Qs(o,t)}function Wu(e,t){const o=t.get(e);if(o)return o;let a=Jn(e,[],!1).filter(l=>bt(l)&&dn(l)!=="body"),r=null;const s=yt(e).position==="fixed";let i=s?Gt(e):e;for(;bt(i)&&!Dn(i);){const l=yt(i),c=or(i);!c&&l.position==="fixed"&&(r=null),(s?!c&&!r:!c&&l.position==="static"&&!!r&&Lu.has(r.position)||Kn(i)&&!c&&Qs(e,i))?a=a.filter(u=>u!==i):r=l,i=Gt(i)}return t.set(e,a),a}function ju(e){let{element:t,boundary:o,rootBoundary:a,strategy:r}=e;const i=[...o==="clippingAncestors"?Fo(t)?[]:Wu(t,this._c):[].concat(o),a],l=i[0],c=i.reduce((d,u)=>{const f=Js(t,u,r);return d.top=it(f.top,d.top),d.right=Vn(f.right,d.right),d.bottom=Vn(f.bottom,d.bottom),d.left=it(f.left,d.left),d},Js(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Uu(e){const{width:t,height:o}=Gs(e);return{width:t,height:o}}function Hu(e,t,o){const a=Et(t),r=Bt(t),s=o==="fixed",i=un(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=_t(0);function d(){c.x=Ro(r)}if(a||!a&&!s)if((dn(t)!=="body"||Kn(r))&&(l=Io(t)),a){const m=un(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else r&&d();s&&!a&&r&&d();const u=r&&!a&&!s?Ys(r,l):_t(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 ir(e){return yt(e).position==="static"}function Zs(e,t){if(!Et(e)||yt(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;return Bt(e)===o&&(o=o.ownerDocument.body),o}function ei(e,t){const o=lt(e);if(Fo(e))return o;if(!Et(e)){let r=Gt(e);for(;r&&!Dn(r);){if(bt(r)&&!ir(r))return r;r=Gt(r)}return o}let a=Zs(e,t);for(;a&&Au(a)&&ir(a);)a=Zs(a,t);return a&&Dn(a)&&ir(a)&&!or(a)?o:a||Pu(e)||o}const qu=async function(e){const t=this.getOffsetParent||ei,o=this.getDimensions,a=await o(e.floating);return{reference:Hu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function Gu(e){return yt(e).direction==="rtl"}const Xu={convertOffsetParentRelativeRectToViewportRelativeRect:zu,getDocumentElement:Bt,getClippingRect:ju,getOffsetParent:ei,getElementRects:qu,getClientRects:Fu,getDimensions:Uu,getScale:Mn,isElement:bt,isRTL:Gu};function ti(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yu(e,t){let o=null,a;const r=Bt(e);function s(){var l;clearTimeout(a),(l=o)==null||l.disconnect(),o=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:u,top:f,width:h,height:m}=d;if(l||t(),!h||!m)return;const p=vo(f),g=vo(r.clientWidth-(u+h)),y=vo(r.clientHeight-(f+m)),x=vo(u),C={rootMargin:-p+"px "+-g+"px "+-y+"px "+-x+"px",threshold:it(0,Vn(1,c))||1};let w=!0;function E(B){const k=B[0].intersectionRatio;if(k!==c){if(!w)return i();k?i(!1,k):a=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!ti(d,e.getBoundingClientRect())&&i(),w=!1}try{o=new IntersectionObserver(E,{...C,root:r.ownerDocument})}catch{o=new IntersectionObserver(E,C)}o.observe(e)}return i(!0),s}function lr(e,t,o,a){a===void 0&&(a={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=a,d=sr(e),u=r||s?[...d?Jn(d):[],...Jn(t)]:[];u.forEach(x=>{r&&x.addEventListener("scroll",o,{passive:!0}),s&&x.addEventListener("resize",o)});const f=d&&l?Yu(d,o):null;let h=-1,m=null;i&&(m=new ResizeObserver(x=>{let[_]=x;_&&_.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=m)==null||C.observe(t)})),o()}),d&&!c&&m.observe(d),m.observe(t));let p,g=c?un(e):null;c&&y();function y(){const x=un(e);g&&!ti(g,x)&&o(),g=x,p=requestAnimationFrame(y)}return o(),()=>{var x;u.forEach(_=>{r&&_.removeEventListener("scroll",o),s&&_.removeEventListener("resize",o)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(p)}}const cr=Cu,dr=_u,ur=xu,fr=Bu,Ku=(e,t,o)=>{const a=new Map,r={platform:Xu,...o},s={...r.platform,_c:a};return yu(e,t,{...r,platform:s})};function Ju(e){return e!=null&&typeof e=="object"&&"$el"in e}function ni(e){if(Ju(e)){const t=e.$el;return nr(t)&&dn(t)==="#comment"?null:t}return e}function Qn(e){return typeof e=="function"?e():n.unref(e)}function oi(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ai(e,t){const o=oi(e);return Math.round(t*o)/o}function hr(e,t,o){o===void 0&&(o={});const a=o.whileElementsMounted,r=n.computed(()=>{var k;return(k=Qn(o.open))!=null?k:!0}),s=n.computed(()=>Qn(o.middleware)),i=n.computed(()=>{var k;return(k=Qn(o.placement))!=null?k:"bottom"}),l=n.computed(()=>{var k;return(k=Qn(o.strategy))!=null?k:"absolute"}),c=n.computed(()=>{var k;return(k=Qn(o.transform))!=null?k:!0}),d=n.computed(()=>ni(e.value)),u=n.computed(()=>ni(t.value)),f=n.ref(0),h=n.ref(0),m=n.ref(l.value),p=n.ref(i.value),g=n.shallowRef({}),y=n.ref(!1),x=n.computed(()=>{const k={position:m.value,left:"0",top:"0"};if(!u.value)return k;const b=ai(u.value,f.value),A=ai(u.value,h.value);return c.value?{...k,transform:"translate("+b+"px, "+A+"px)",...oi(u.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:b+"px",top:A+"px"}});let _;function C(){if(d.value==null||u.value==null)return;const k=r.value;Ku(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,p.value=b.placement,g.value=b.middlewareData,y.value=k!==!1})}function w(){typeof _=="function"&&(_(),_=void 0)}function E(){if(w(),a===void 0){C();return}if(d.value!=null&&u.value!=null){_=a(d.value,u.value,C);return}}function B(){r.value||(y.value=!1)}return n.watch([s,i,l,r],C,{flush:"sync"}),n.watch([d,u],E,{flush:"sync"}),n.watch(r,B,{flush:"sync"}),n.getCurrentScope()&&n.onScopeDispose(w),{x:n.shallowReadonly(f),y:n.shallowReadonly(h),strategy:n.shallowReadonly(m),placement:n.shallowReadonly(p),middlewareData:n.shallowReadonly(g),isPositioned:n.shallowReadonly(y),floatingStyles:x,update:C}}const Qu=["aria-busy"],Zu={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},ef=["for"],tf={key:0,class:"ml-1 text-destructive"},nf={class:"relative"},of={key:0,class:"flex items-center text-gray-500 gap-2"},af=["id","placeholder","disabled","readonly","value"],rf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},sf=["disabled"],lf={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},cf=["onMouseenter","onClick"],df={key:0},uf={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},ff={key:0},hf={key:1},mf={key:2},pf={key:1,class:"mt-1 text-xs text-red-600"},Lo=n.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(e,{emit:t}){const o=e,a=t,r=n.useAttrs(),s=n.computed(()=>r.label??void 0),i=U=>{const ae=r[U];return ae===""||ae===!0||ae==="true"||ae===1||ae==="1"},l=n.ref(!1),c=n.computed(()=>o.itemTitle||r["item-title"]||r.itemTitle||"name"),d=n.computed(()=>o.itemValue||r["item-value"]||r.itemValue||"id"),u=n.computed(()=>o.disabled),f=n.computed(()=>i("required")),h=n.computed(()=>i("readonly")),m=n.computed(()=>o.returnObject||i("return-object")||i("returnObject")),p=n.computed(()=>f.value||i("aria-required")),g=n.computed(()=>o.error||o.errorMessage||r["error-message"]),y=n.computed(()=>r.placeholder??""),x=n.computed(()=>{const U=r.minChars??r["min-chars"];if(U==null||U==="")return 0;const ae=typeof U=="number"?U:Number.parseInt(String(U),10);return Number.isFinite(ae)&&ae>0?ae:0}),_=n.computed(()=>{const U=r.rules;return Array.isArray(U)?U:[]}),C=n.computed(()=>{const U=r.id||r.label;return U?`app-autocomplete-${U}-${Math.random().toString(36).slice(2,7)}`:void 0}),w=n.ref(o.modelValue),E=n.ref([]),B=n.ref(!1),k=n.ref(!1),b=n.computed(()=>r.items),A=n.computed(()=>{const U=z.value;return U.apiModule&&U.apiAction||U.apiUrl||o.fetchItems?E.value:b.value??[]}),D=n.computed(()=>!!r.loading),P=n.computed(()=>D.value||B.value),V=n.computed(()=>{const{label:U,items:ae,loading:pe,rules:ve,"item-title":Ae,"item-value":Z,itemTitle:oe,itemValue:re,minChars:ge,"min-chars":$e,clearable:Pt,required:qa,"aria-required":zd,disabled:Ga,readonly:Fd,visible:nt,"return-object":Id,returnObject:Xa,class:Rd,"fetch-items":Ya,fetchItems:Ld,error:vs,errorMessage:$d,"error-message":Wd,...Ka}=r||{};return Ka}),M=()=>{if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions},z=n.computed(()=>{const U=o.endpoint||{};return{apiModule:o.apiModule||U.apiModule,apiAction:o.apiAction||U.apiAction,apiUrl:U.apiUrl,apiMethod:U.apiMethod||"GET"}}),N=n.ref(null),v=n.ref(null),T=n.ref(null),{floatingStyles:R}=hr(v,T,{placement:"bottom-start",whileElementsMounted:lr,middleware:[cr(4),ur(),dr(),fr({apply({rects:U,elements:ae,availableHeight:pe}){Object.assign(ae.floating.style,{width:`${U.reference.width}px`,maxHeight:`${pe}px`})}})]}),H=n.ref(!1),O=n.ref(""),$=n.ref(-1),Y=n.ref(null),X=n.computed(()=>!x.value||(O.value||"").trim().length>=x.value?"":`Ketik minimal ${x.value} karakter`),j=U=>{if(U==null)return"";if(typeof U=="string"||typeof U=="number")return String(U);const ae=c.value;return typeof ae=="function"?ae(U):(U==null?void 0:U[ae])??(U==null?void 0:U.name)??(U==null?void 0:U.nama)??(U==null?void 0:U.label)??(U==null?void 0:U.title)??"-"},ee=U=>{if(U==null)return null;if(typeof U=="string"||typeof U=="number")return U;const ae=d.value;return typeof ae=="function"?ae(U):(U==null?void 0:U[ae])??(U==null?void 0:U.id)??(U==null?void 0:U.value)??(U==null?void 0:U.code)??null},ne=n.computed(()=>{const U=w.value;if(U==null||U==="")return"";if(Array.isArray(U))return U.length?U.map(ve=>{if(m.value&&typeof ve=="object"||typeof ve=="object")return j(ve);const Ae=A.value.find(Z=>ee(Z)==ve);return Ae?j(Ae):String(ve)}).join(", "):"";if(typeof U=="object")return j(U);const ae=A.value.find(pe=>ee(pe)==U);return ae?j(ae):String(U)}),fe=n.computed(()=>{const U=A.value||[],ae=(O.value||"").trim().toLowerCase(),pe=(ne.value||"").toLowerCase(),ve=!ae||ae===pe;let Ae=U;if(ve||(Ae=U.filter(Z=>j(Z).toLowerCase().includes(ae))),Ae.length>0){const Z=oe=>{const re=ee(oe);return Array.isArray(w.value)?w.value.some(ge=>ge==re):w.value==re};Ae=[...Ae].sort((oe,re)=>{const ge=Z(oe),$e=Z(re);return ge&&!$e?-1:!ge&&$e?1:0})}return Ae}),ye=U=>Array.isArray(U)?U.length===0:U==null||U==="",he=U=>{if(Y.value=null,f.value&&ye(U)&&!_.value.length)return Y.value="This field is required",!1;for(const ae of _.value){const pe=ae(U);if(pe===!1)return Y.value="Invalid value",!1;if(typeof pe=="string")return Y.value=pe,!1}return!0},G=async()=>{if(u.value||h.value)return;H.value=!0,$.value=fe.value.length?0:-1,O.value=ne.value||"";const U=z.value,ae=U.apiModule&&U.apiAction||U.apiUrl||o.fetchItems;o.autoFetchOnOpen&&ae&&!k.value&&(await Oe(),$.value=fe.value.length?0:-1)},F=()=>{H.value=!1,$.value=-1,O.value=ne.value||""},q=U=>{const ae=m.value?U:ee(U);let pe=ae;Array.isArray(w.value)&&(pe=[ae]),w.value=pe,a("update:modelValue",pe),Y.value=null,he(pe),O.value=j(U),F()},Q=()=>{E.value=[],k.value=!1,w.value=Array.isArray(w.value)?[]:null,a("update:modelValue",w.value),O.value="",Y.value=null},ue=()=>{l.value=!0,Q(),F(),setTimeout(()=>{l.value=!1},0)},_e=U=>{if(u.value||h.value)return;const ae=U.target.value;O.value=ae,Y.value&&(Y.value=null),H.value||(H.value=!0),$.value=fe.value.length?0:-1;const pe=z.value.apiModule&&z.value.apiAction||z.value.apiUrl||o.fetchItems;o.autoFetchOnOpen&&pe&&!P.value&&!k.value&&Oe()},Ce=U=>{var pe;if(u.value||h.value)return;const ae={ArrowDown:()=>{if(U.preventDefault(),!H.value){G();return}fe.value.length&&($.value=Math.min($.value+1,fe.value.length-1))},ArrowUp:()=>{!H.value||!fe.value.length||(U.preventDefault(),$.value=Math.max($.value-1,0))},Enter:()=>{if(!H.value)return;U.preventDefault();const ve=fe.value[$.value];ve&&q(ve)},Escape:()=>{U.preventDefault(),F()},Tab:()=>{F()}};(pe=ae[U.key])==null||pe.call(ae)},Oe=async()=>{const U=z.value;if(U.apiModule&&U.apiAction||U.apiUrl||o.fetchItems){B.value=!0;try{let pe;if(o.fetchItems){const ve=M()||{},Ae={page:1,perPage:100,search:(O.value||"").trim(),...ve,...o.apiParams},Z=await o.fetchItems(Ae),oe=(Z==null?void 0:Z.data)??Z;pe=(oe==null?void 0:oe.data)??oe}else{const Ae=Je().DCodeApi;if(typeof Ae!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const oe={page:1,perPage:100,...M()||{},...o.apiParams};let re;U.apiUrl?re=await Ae("","",oe,{_url:U.apiUrl,_method:U.apiMethod||"POST"}):re=await Ae(U.apiModule,U.apiAction,oe);const ge=(re==null?void 0:re.data)??re;pe=(ge==null?void 0:ge.data)??ge}E.value=Array.isArray(pe)?pe:[],k.value=!0}catch(pe){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",pe),Y.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(pe==null?void 0:pe.message)||(pe==null?void 0:pe.toString())||"Failed to load options"}`,E.value=[],k.value=!0}finally{B.value=!1}}},Ke=U=>{const ae=ee(U);return m.value?w.value?Array.isArray(w.value)?w.value.some(pe=>ee(pe)==ae):ee(w.value)==ae:!1:Array.isArray(w.value)?w.value.some(pe=>pe==ae):w.value==ae};n.watch(()=>[M(),z.value,o.apiParams],([U,ae,pe],[ve,Ae,Z])=>{const oe=z.value;if(!(oe.apiModule&&oe.apiAction||oe.apiUrl||o.fetchItems)){Q();return}const ge=JSON.stringify(U??null)===JSON.stringify(ve??null),$e=JSON.stringify(pe??null)===JSON.stringify(Z??null);ge&&$e||(Q(),$e||Oe())},{deep:!0}),n.watch(()=>o.modelValue,(U,ae)=>{w.value=U,!l.value&&(U==null||U==="")&&ae!=null&&o.apiModule&&o.apiAction&&(E.value=[],k.value=!1),O.value=ne.value||""},{immediate:!0});const at=z.value;(at.apiModule&&at.apiAction||at.apiUrl||o.fetchItems)&&(o.autoFetchOnMount||!ye(o.modelValue))&&Oe();const ln=U=>{const ae=N.value,pe=T.value,ve=U.target;ae&&ae.contains(ve)||pe&&pe.contains(ve)||H.value&&F()},Mo=n.computed(()=>{const U=o.modelValue;return U==null?!1:typeof U=="string"?U.trim().length>0:Array.isArray(U)?U.length>0:typeof U=="object"?Object.keys(U).length>0:!0}),No=n.computed(()=>!!o.clearable&&Mo.value&&!o.disabled);return n.onMounted(()=>{document.addEventListener("mousedown",ln)}),n.onBeforeUnmount(()=>{document.removeEventListener("mousedown",ln)}),(U,ae)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{ref_key:"rootEl",ref:N,class:n.normalizeClass(["w-full",n.unref(r).class]),"aria-busy":e.skeleton},[e.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.value?(n.openBlock(),n.createElementBlock("div",Zu)):n.createCommentVNode("",!0),ae[6]||(ae[6]=n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[s.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:C.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[n.createTextVNode(n.toDisplayString(s.value)+" ",1),p.value?(n.openBlock(),n.createElementBlock("span",tf,"*")):n.createCommentVNode("",!0)],8,ef)):n.createCommentVNode("",!0),n.createElementVNode("div",nf,[n.createElementVNode("div",{ref_key:"reference",ref:v,class:n.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 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":"",Y.value||g.value?"border-red-500 focus-within:ring-red-500":""]])},[o.icon||U.$slots["prepend-inner"]?(n.openBlock(),n.createElementBlock("div",of,[n.renderSlot(U.$slots,"prepend-inner",{},()=>[o.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0),n.createElementVNode("input",n.mergeProps(V.value,{id:C.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:H.value?O.value:ne.value||O.value,onFocus:ae[0]||(ae[0]=()=>{H.value||G()}),onClick:ae[1]||(ae[1]=()=>{H.value||G()}),onInput:_e,onKeydown:Ce,onBlur:ae[2]||(ae[2]=()=>he(w.value))}),null,16,af),P.value?(n.openBlock(),n.createElementBlock("svg",rf,[...ae[7]||(ae[7]=[n.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),n.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):No.value?(n.openBlock(),n.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:ae[3]||(ae[3]=n.withModifiers(()=>{},["prevent"])),onClick:n.withModifiers(ue,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(n.openBlock(),n.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:ae[4]||(ae[4]=pe=>H.value?F():G()),"aria-label":"Toggle"},[n.createVNode(n.unref(te.ChevronDown),{class:n.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":H.value}])},null,8,["class"])],8,sf))],2),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[H.value?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"floating",ref:T,style:n.normalizeStyle(n.unref(R)),class:"z-[50] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-gray-700 dark:bg-neutral-900"},[n.createElementVNode("div",lf,[fe.value.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(fe.value,(pe,ve)=>(n.openBlock(),n.createElementBlock("button",{key:ee(pe)??ve,type:"button",class:n.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",ve===$.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:Ae=>$.value=ve,onMousedown:ae[5]||(ae[5]=n.withModifiers(()=>{},["prevent"])),onClick:Ae=>q(pe)},[n.createTextVNode(n.toDisplayString(j(pe))+" ",1),Ke(pe)?(n.openBlock(),n.createElementBlock("span",df," ✓ ")):n.createCommentVNode("",!0)],42,cf))),128)):n.renderSlot(U.$slots,"no-data",{key:1},()=>[n.createElementVNode("div",uf,[P.value?(n.openBlock(),n.createElementBlock("span",ff,"Loading data…")):X.value?(n.openBlock(),n.createElementBlock("span",hf,n.toDisplayString(X.value),1)):(n.openBlock(),n.createElementBlock("span",mf,"No data available"))])])])],4)):n.createCommentVNode("",!0)]))]),Y.value||g.value?(n.openBlock(),n.createElementBlock("p",pf,n.toDisplayString(Y.value||g.value),1)):n.createCommentVNode("",!0)],64))],10,Qu)),[[n.vShow,e.visible]])}}),gf=["aria-busy"],bf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},yf=["for"],xf={key:0,class:"ml-1 text-destructive"},kf={class:"relative"},wf={key:0,class:"flex items-center text-gray-500 gap-2"},Cf=["id","placeholder","disabled","value"],_f={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},Bf=["disabled"],Ef={key:0,class:"p-3 space-y-2"},Sf=["onMouseenter","onClick"],Af={class:"flex items-center space-x-3"},Vf={class:"flex-1"},Df={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Mf={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},Nf={key:0},Pf={key:2,class:"p-3 text-center"},vf={class:"inline-flex items-center space-x-2"},Tf={class:"text-sm text-gray-500"},Of={key:3,class:"p-3 text-center"},zf={class:"text-xs text-gray-400"},Ff={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},If={key:1,class:"mt-1 text-xs text-red-600"},Rf={key:2,class:"mt-1 text-xs text-gray-500"},ri=n.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(e,{emit:t}){const o=e,a=t,r=n.useAttrs(),s=n.ref(),i=n.ref(),l=n.ref(),c=n.ref(),d=n.ref(),u=n.computed(()=>{const $=o.label||o.placeholder;return $?`app-infinite-autocomplete-${$}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=n.ref(""),h=n.ref([]),m=n.ref(!1),p=n.ref(!1),g=n.ref(-1),y=n.ref(1),x=n.ref(!0),_=n.ref(0),C=n.ref(),{floatingStyles:w}=hr(c,d,{placement:"bottom-start",whileElementsMounted:lr,middleware:[cr(4),ur(),dr(),fr({apply({rects:$,elements:Y}){Object.assign(Y.floating.style,{width:`${$.reference.width}px`})}})]});n.computed(()=>({"opacity-50 pointer-events-none":o.disabled,relative:!0}));const E=n.computed(()=>f.value?h.value.filter($=>A($).toLowerCase().includes(f.value.toLowerCase())):h.value),B=n.computed(()=>{if(p.value&&f.value)return f.value;if(o.modelValue){if(o.returnObject)return A(o.modelValue);{const $=h.value.find(Y=>D(Y)===o.modelValue);return $?A($):String(o.modelValue)}}return""}),k=()=>{p.value=!0},b=()=>{p.value=!1},A=$=>typeof o.itemTitle=="function"?o.itemTitle($):$[o.itemTitle]||"",D=$=>typeof o.itemValue=="function"?o.itemValue($):$[o.itemValue]||$,P=$=>o.itemSubtitle?typeof o.itemSubtitle=="function"?o.itemSubtitle($):$[o.itemSubtitle]||"":"",V=$=>o.modelValue?o.returnObject?D($)===D(o.modelValue):D($)===o.modelValue:!1,M=$=>{var X;const Y=o.returnObject?$:D($);a("update:modelValue",Y),a("select",$),p.value=!1,f.value="",(X=s.value)==null||X.blur()},z=()=>{var $;a("update:modelValue",null),f.value="",($=s.value)==null||$.focus()},N=$=>{p.value=!0,a("focus",$),o.autoFetchOnOpen&&!m.value&&(o.refreshOnOpen||h.value.length===0)&&O(!0)},v=$=>{setTimeout(()=>{p.value=!1,a("blur",$)},200)},T=$=>{const Y=$.target;f.value=Y.value,C.value&&clearTimeout(C.value),C.value=setTimeout(()=>{a("search",f.value),y.value=1,x.value=!0,O(!0)},o.debounceMs)},R=$=>{if(p.value)switch($.key){case"ArrowDown":$.preventDefault(),g.value=Math.min(g.value+1,E.value.length-1);break;case"ArrowUp":$.preventDefault(),g.value=Math.max(g.value-1,0);break;case"Enter":$.preventDefault(),g.value>=0&&E.value[g.value]&&M(E.value[g.value]);break;case"Escape":p.value=!1;break}},H=$=>{if(!x.value||m.value)return;const Y=$.target,{scrollTop:X,scrollHeight:j,clientHeight:ee}=Y;X+ee>=j-o.threshold&&O()},O=async($=!1)=>{var Y,X;if(!m.value){m.value=!0;try{let j=[];if(o.fetchItems)j=await o.fetchItems();else{const ee=Je(),ne=((Y=o.endpoint)==null?void 0:Y.apiModule)||o.apiModule,fe=((X=o.endpoint)==null?void 0:X.apiAction)||o.apiAction;if(!ne||!fe)throw new Error("API module and action are required");const ye={page:$?1:y.value,pageSize:o.pageSize,search:f.value,...o.apiParams},he=await ee.apiUrl(`/${ne}/${fe}`,"GET",ye);j=he.data||he.items||he||[],_.value=he.total||he.totalItems||j.length}$?(h.value=j,y.value=1):(h.value.push(...j),y.value++),x.value=j.length>=o.pageSize,x.value||a("end-of-results"),a("load-more",{items:j,page:y.value,hasMore:x.value,total:_.value})}catch(j){console.error("Error fetching items:",j),a("error",j)}finally{m.value=!1}}};return n.onMounted(()=>{o.autoFetchOnMount&&O()}),n.onUnmounted(()=>{C.value&&clearTimeout(C.value)}),n.watch(()=>o.modelValue,$=>{$||(f.value="")}),($,Y)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{ref_key:"rootEl",ref:l,class:n.normalizeClass(["w-full",n.unref(r).class]),"aria-busy":e.skeleton},[e.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.label?(n.openBlock(),n.createElementBlock("div",bf)):n.createCommentVNode("",!0),Y[3]||(Y[3]=n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[e.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:u.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",xf,"*")):n.createCommentVNode("",!0)],8,yf)):n.createCommentVNode("",!0),n.createElementVNode("div",kf,[n.createElementVNode("div",{ref_key:"reference",ref:c,class:n.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[e.disabled?"opacity-60 cursor-not-allowed":"",e.error?"border-red-500 focus-within:ring-red-500":""]])},[o.icon?(n.openBlock(),n.createElementBlock("div",wf,[o.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("input",n.mergeProps({ref_key:"inputRef",ref:s},$.$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",e.disabled?"cursor-not-allowed":"cursor-text"],placeholder:e.placeholder,disabled:e.disabled,value:B.value,onFocus:N,onBlur:v,onInput:T,onKeydown:R}),null,16,Cf),m.value?(n.openBlock(),n.createElementBlock("svg",_f,[...Y[4]||(Y[4]=[n.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),n.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):e.clearable&&e.modelValue?(n.openBlock(),n.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:Y[0]||(Y[0]=n.withModifiers(()=>{},["prevent"])),onClick:n.withModifiers(z,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(n.openBlock(),n.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:e.disabled,onClick:Y[1]||(Y[1]=X=>p.value?b():k()),"aria-label":"Toggle"},[n.createVNode(n.unref(te.ChevronDown),{class:n.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":p.value}])},null,8,["class"])],8,Bf))],2),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[p.value?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:n.normalizeStyle(n.unref(w)),class:"z-[9999] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-gray-700 dark:bg-neutral-900"},[n.createElementVNode("div",{ref_key:"scrollContainer",ref:i,class:"max-h-64 overflow-auto",onScroll:H},[m.value&&h.value.length===0?(n.openBlock(),n.createElementBlock("div",Ef,[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(5,X=>n.createElementVNode("div",{key:X,class:"flex items-center space-x-3"},[...Y[5]||(Y[5]=[n.createElementVNode("div",{class:"skeleton h-4 w-4 bg-gray-200 rounded"},null,-1),n.createElementVNode("div",{class:"skeleton h-4 flex-1 bg-gray-200 rounded"},null,-1)])])),64))])):E.value.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(E.value,(X,j)=>(n.openBlock(),n.createElementBlock("button",{key:D(X)??j,type:"button",class:n.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",j===g.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:ee=>g.value=j,onMousedown:Y[2]||(Y[2]=n.withModifiers(()=>{},["prevent"])),onClick:ee=>M(X)},[n.renderSlot($.$slots,"item",{item:X,index:j},()=>[n.createElementVNode("div",Af,[n.createElementVNode("div",Vf,[n.createElementVNode("div",Df,n.toDisplayString(A(X)),1),e.itemSubtitle?(n.openBlock(),n.createElementBlock("div",Mf,n.toDisplayString(P(X)),1)):n.createCommentVNode("",!0)])])]),V(X)?(n.openBlock(),n.createElementBlock("span",Nf," ✓ ")):n.createCommentVNode("",!0)],42,Sf))),128)):n.createCommentVNode("",!0),m.value&&h.value.length>0?(n.openBlock(),n.createElementBlock("div",Pf,[n.createElementVNode("div",vf,[Y[6]||(Y[6]=n.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),n.createElementVNode("span",Tf,n.toDisplayString(e.loadingText),1)])])):n.createCommentVNode("",!0),!x.value&&h.value.length>0?(n.openBlock(),n.createElementBlock("div",Of,[n.createElementVNode("div",zf,n.toDisplayString(e.endOfResultsText),1)])):!m.value&&h.value.length===0?(n.openBlock(),n.createElementBlock("div",Ff,n.toDisplayString(e.noResultsText),1)):n.createCommentVNode("",!0)],544)],4)):n.createCommentVNode("",!0)]))]),e.error?(n.openBlock(),n.createElementBlock("p",If,n.toDisplayString(e.errorMessage||e.error),1)):e.helperText?(n.openBlock(),n.createElementBlock("p",Rf,n.toDisplayString(e.helperText),1)):n.createCommentVNode("",!0)],64))],10,gf)),[[n.vShow,e.visible]])}});function si(e){var t,o,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(o=si(e[t]))&&(a&&(a+=" "),a+=o)}else for(o in e)e[o]&&(a&&(a+=" "),a+=o);return a}function ii(){for(var e,t,o=0,a="",r=arguments.length;o<r;o++)(e=arguments[o])&&(t=si(e))&&(a&&(a+=" "),a+=t);return a}const Lf=(e,t)=>{const o=new Array(e.length+t.length);for(let a=0;a<e.length;a++)o[a]=e[a];for(let a=0;a<t.length;a++)o[e.length+a]=t[a];return o},$f=(e,t)=>({classGroupId:e,validator:t}),li=(e=new Map,t=null,o)=>({nextPart:e,validators:t,classGroupId:o}),$o="-",ci=[],Wf="arbitrary..",jf=e=>{const t=Hf(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Uf(i);const l=i.split($o),c=l[0]===""&&l.length>1?1:0;return di(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=a[i],d=o[i];return c?d?Lf(d,c):c:d||ci}return o[i]||ci}}},di=(e,t,o)=>{if(e.length-t===0)return o.classGroupId;const r=e[t],s=o.nextPart.get(r);if(s){const d=di(e,t+1,s);if(d)return d}const i=o.validators;if(i===null)return;const l=t===0?e.join($o):e.slice(t).join($o),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},Uf=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),o=t.indexOf(":"),a=t.slice(0,o);return a?Wf+a:void 0})(),Hf=e=>{const{theme:t,classGroups:o}=e;return qf(o,t)},qf=(e,t)=>{const o=li();for(const a in e){const r=e[a];mr(r,o,a,t)}return o},mr=(e,t,o,a)=>{const r=e.length;for(let s=0;s<r;s++){const i=e[s];Gf(i,t,o,a)}},Gf=(e,t,o,a)=>{if(typeof e=="string"){Xf(e,t,o);return}if(typeof e=="function"){Yf(e,t,o,a);return}Kf(e,t,o,a)},Xf=(e,t,o)=>{const a=e===""?t:ui(t,e);a.classGroupId=o},Yf=(e,t,o,a)=>{if(Jf(e)){mr(e(a),t,o,a);return}t.validators===null&&(t.validators=[]),t.validators.push($f(o,e))},Kf=(e,t,o,a)=>{const r=Object.entries(e),s=r.length;for(let i=0;i<s;i++){const[l,c]=r[i];mr(c,ui(t,l),o,a)}},ui=(e,t)=>{let o=e;const a=t.split($o),r=a.length;for(let s=0;s<r;s++){const i=a[s];let l=o.nextPart.get(i);l||(l=li(),o.nextPart.set(i,l)),o=l}return o},Jf=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Qf=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=Object.create(null),a=Object.create(null);const r=(s,i)=>{o[s]=i,t++,t>e&&(t=0,a=o,o=Object.create(null))};return{get(s){let i=o[s];if(i!==void 0)return i;if((i=a[s])!==void 0)return r(s,i),i},set(s,i){s in o?o[s]=i:r(s,i)}}},pr="!",fi=":",Zf=[],hi=(e,t,o,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:o,maybePostfixModifierPosition:a,isExternal:r}),eh=e=>{const{prefix:t,experimentalParseClassName:o}=e;let a=r=>{const s=[];let i=0,l=0,c=0,d;const u=r.length;for(let g=0;g<u;g++){const y=r[g];if(i===0&&l===0){if(y===fi){s.push(r.slice(c,g)),c=g+1;continue}if(y==="/"){d=g;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const f=s.length===0?r:r.slice(c);let h=f,m=!1;f.endsWith(pr)?(h=f.slice(0,-1),m=!0):f.startsWith(pr)&&(h=f.slice(1),m=!0);const p=d&&d>c?d-c:void 0;return hi(s,m,h,p)};if(t){const r=t+fi,s=a;a=i=>i.startsWith(r)?s(i.slice(r.length)):hi(Zf,!1,i,void 0,!0)}if(o){const r=a;a=s=>o({className:s,parseClassName:r})}return a},th=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((o,a)=>{t.set(o,1e6+a)}),o=>{const a=[];let r=[];for(let s=0;s<o.length;s++){const i=o[s],l=i[0]==="[",c=t.has(i);l||c?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(i)):r.push(i)}return r.length>0&&(r.sort(),a.push(...r)),a}},nh=e=>({cache:Qf(e.cacheSize),parseClassName:eh(e),sortModifiers:th(e),...jf(e)}),oh=/\s+/,ah=(e,t)=>{const{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:s}=t,i=[],l=e.trim().split(oh);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:h,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:g}=o(u);if(f){c=u+(c.length>0?" "+c:c);continue}let y=!!g,x=a(y?p.substring(0,g):p);if(!x){if(!y){c=u+(c.length>0?" "+c:c);continue}if(x=a(p),!x){c=u+(c.length>0?" "+c:c);continue}y=!1}const _=h.length===0?"":h.length===1?h[0]:s(h).join(":"),C=m?_+pr:_,w=C+x;if(i.indexOf(w)>-1)continue;i.push(w);const E=r(x,y);for(let B=0;B<E.length;++B){const k=E[B];i.push(C+k)}c=u+(c.length>0?" "+c:c)}return c},rh=(...e)=>{let t=0,o,a,r="";for(;t<e.length;)(o=e[t++])&&(a=mi(o))&&(r&&(r+=" "),r+=a);return r},mi=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=mi(e[a]))&&(o&&(o+=" "),o+=t);return o},sh=(e,...t)=>{let o,a,r,s;const i=c=>{const d=t.reduce((u,f)=>f(u),e());return o=nh(d),a=o.cache.get,r=o.cache.set,s=l,l(c)},l=c=>{const d=a(c);if(d)return d;const u=ah(c,o);return r(c,u),u};return s=i,(...c)=>s(rh(...c))},ih=[],He=e=>{const t=o=>o[e]||ih;return t.isThemeGetter=!0,t},pi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,gi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,lh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ch=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dh=/\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$/,uh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xt=e=>lh.test(e),ke=e=>!!e&&!Number.isNaN(Number(e)),Yt=e=>!!e&&Number.isInteger(Number(e)),gr=e=>e.endsWith("%")&&ke(e.slice(0,-1)),Ot=e=>ch.test(e),bi=()=>!0,mh=e=>dh.test(e)&&!uh.test(e),br=()=>!1,ph=e=>fh.test(e),gh=e=>hh.test(e),bh=e=>!le(e)&&!ce(e),yh=e=>Kt(e,_i,br),le=e=>pi.test(e),fn=e=>Kt(e,Bi,mh),yi=e=>Kt(e,Sh,ke),xh=e=>Kt(e,Si,bi),kh=e=>Kt(e,Ei,br),xi=e=>Kt(e,wi,br),wh=e=>Kt(e,Ci,gh),Wo=e=>Kt(e,Ai,ph),ce=e=>gi.test(e),Zn=e=>hn(e,Bi),Ch=e=>hn(e,Ei),ki=e=>hn(e,wi),_h=e=>hn(e,_i),Bh=e=>hn(e,Ci),jo=e=>hn(e,Ai,!0),Eh=e=>hn(e,Si,!0),Kt=(e,t,o)=>{const a=pi.exec(e);return a?a[1]?t(a[1]):o(a[2]):!1},hn=(e,t,o=!1)=>{const a=gi.exec(e);return a?a[1]?t(a[1]):o:!1},wi=e=>e==="position"||e==="percentage",Ci=e=>e==="image"||e==="url",_i=e=>e==="length"||e==="size"||e==="bg-size",Bi=e=>e==="length",Sh=e=>e==="number",Ei=e=>e==="family-name",Si=e=>e==="number"||e==="weight",Ai=e=>e==="shadow",Ah=sh(()=>{const e=He("color"),t=He("font"),o=He("text"),a=He("font-weight"),r=He("tracking"),s=He("leading"),i=He("breakpoint"),l=He("container"),c=He("spacing"),d=He("radius"),u=He("shadow"),f=He("inset-shadow"),h=He("text-shadow"),m=He("drop-shadow"),p=He("blur"),g=He("perspective"),y=He("aspect"),x=He("ease"),_=He("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...w(),ce,le],B=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],b=()=>[ce,le,c],A=()=>[Xt,"full","auto",...b()],D=()=>[Yt,"none","subgrid",ce,le],P=()=>["auto",{span:["full",Yt,ce,le]},Yt,ce,le],V=()=>[Yt,"auto",ce,le],M=()=>["auto","min","max","fr",ce,le],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],N=()=>["start","end","center","stretch","center-safe","end-safe"],v=()=>["auto",...b()],T=()=>[Xt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],R=()=>[Xt,"screen","full","dvw","lvw","svw","min","max","fit",...b()],H=()=>[Xt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...b()],O=()=>[e,ce,le],$=()=>[...w(),ki,xi,{position:[ce,le]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],X=()=>["auto","cover","contain",_h,yh,{size:[ce,le]}],j=()=>[gr,Zn,fn],ee=()=>["","none","full",d,ce,le],ne=()=>["",ke,Zn,fn],fe=()=>["solid","dashed","dotted","double"],ye=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>[ke,gr,ki,xi],G=()=>["","none",p,ce,le],F=()=>["none",ke,ce,le],q=()=>["none",ke,ce,le],Q=()=>[ke,ce,le],ue=()=>[Xt,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ot],breakpoint:[Ot],color:[bi],container:[Ot],"drop-shadow":[Ot],ease:["in","out","in-out"],font:[bh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ot],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ot],shadow:[Ot],spacing:["px",ke],text:[Ot],"text-shadow":[Ot],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xt,le,ce,y]}],container:["container"],columns:[{columns:[ke,le,ce,l]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:E()}],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:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[Yt,"auto",ce,le]}],basis:[{basis:[Xt,"full","auto",l,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ke,Xt,"auto","initial","none",le]}],grow:[{grow:["",ke,ce,le]}],shrink:[{shrink:["",ke,ce,le]}],order:[{order:[Yt,"first","last","none",ce,le]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...N(),"normal"]}],"justify-self":[{"justify-self":["auto",...N()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...N(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...N(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...N(),"baseline"]}],"place-self":[{"place-self":["auto",...N()]}],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:v()}],mx:[{mx:v()}],my:[{my:v()}],ms:[{ms:v()}],me:[{me:v()}],mbs:[{mbs:v()}],mbe:[{mbe:v()}],mt:[{mt:v()}],mr:[{mr:v()}],mb:[{mb:v()}],ml:[{ml:v()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:T()}],"inline-size":[{inline:["auto",...R()]}],"min-inline-size":[{"min-inline":["auto",...R()]}],"max-inline-size":[{"max-inline":["none",...R()]}],"block-size":[{block:["auto",...H()]}],"min-block-size":[{"min-block":["auto",...H()]}],"max-block-size":[{"max-block":["none",...H()]}],w:[{w:[l,"screen",...T()]}],"min-w":[{"min-w":[l,"screen","none",...T()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...T()]}],h:[{h:["screen","lh",...T()]}],"min-h":[{"min-h":["screen","lh","none",...T()]}],"max-h":[{"max-h":["screen","lh",...T()]}],"font-size":[{text:["base",o,Zn,fn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Eh,xh]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gr,le]}],"font-family":[{font:[Ch,kh,t]}],"font-features":[{"font-features":[le]}],"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:[r,ce,le]}],"line-clamp":[{"line-clamp":[ke,"none",ce,yi]}],leading:[{leading:[s,...b()]}],"list-image":[{"list-image":["none",ce,le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ce,le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[ke,"from-font","auto",ce,fn]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[ke,"auto",ce,le]}],"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",ce,le]}],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",ce,le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:X()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Yt,ce,le],radial:["",ce,le],conic:[Yt,ce,le]},Bh,wh]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:j()}],"gradient-via-pos":[{via:j()}],"gradient-to-pos":[{to:j()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ke,ce,le]}],"outline-w":[{outline:["",ke,Zn,fn]}],"outline-color":[{outline:O()}],shadow:[{shadow:["","none",u,jo,Wo]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":["none",f,jo,Wo]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[ke,fn]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":["none",h,jo,Wo]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[ke,ce,le]}],"mix-blend":[{"mix-blend":[...ye(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ye()}],"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":[ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[ce,le]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"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":w()}],"mask-image-conic-pos":[{"mask-conic":[ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:X()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ce,le]}],filter:[{filter:["","none",ce,le]}],blur:[{blur:G()}],brightness:[{brightness:[ke,ce,le]}],contrast:[{contrast:[ke,ce,le]}],"drop-shadow":[{"drop-shadow":["","none",m,jo,Wo]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:["",ke,ce,le]}],"hue-rotate":[{"hue-rotate":[ke,ce,le]}],invert:[{invert:["",ke,ce,le]}],saturate:[{saturate:[ke,ce,le]}],sepia:[{sepia:["",ke,ce,le]}],"backdrop-filter":[{"backdrop-filter":["","none",ce,le]}],"backdrop-blur":[{"backdrop-blur":G()}],"backdrop-brightness":[{"backdrop-brightness":[ke,ce,le]}],"backdrop-contrast":[{"backdrop-contrast":[ke,ce,le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ke,ce,le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ke,ce,le]}],"backdrop-invert":[{"backdrop-invert":["",ke,ce,le]}],"backdrop-opacity":[{"backdrop-opacity":[ke,ce,le]}],"backdrop-saturate":[{"backdrop-saturate":[ke,ce,le]}],"backdrop-sepia":[{"backdrop-sepia":["",ke,ce,le]}],"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",ce,le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ke,"initial",ce,le]}],ease:[{ease:["linear","initial",x,ce,le]}],delay:[{delay:[ke,ce,le]}],animate:[{animate:["none",_,ce,le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,ce,le]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:F()}],"rotate-x":[{"rotate-x":F()}],"rotate-y":[{"rotate-y":F()}],"rotate-z":[{"rotate-z":F()}],scale:[{scale:q()}],"scale-x":[{"scale-x":q()}],"scale-y":[{"scale-y":q()}],"scale-z":[{"scale-z":q()}],"scale-3d":["scale-3d"],skew:[{skew:Q()}],"skew-x":[{"skew-x":Q()}],"skew-y":[{"skew-y":Q()}],transform:[{transform:[ce,le,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":["translate-none"],accent:[{accent:O()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:O()}],"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",ce,le]}],"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",ce,le]}],fill:[{fill:["none",...O()]}],"stroke-w":[{stroke:[ke,Zn,fn,yi]}],stroke:[{stroke:["none",...O()]}],"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(...e){return Ah(ii(e))}function Vh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yr={},xr={},Uo={exports:{}},Vi;function Dh(){if(Vi)return Uo.exports;Vi=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return Uo.exports=t(),Uo.exports.createColors=t,Uo.exports}var Di;function Mh(){return Di||(Di=1,(function(e){var t={};Object.defineProperty(e,"__esModule",{value:!0});function o(d,u){for(var f in u)Object.defineProperty(d,f,{enumerable:!0,get:u[f]})}o(e,{dim:function(){return l},default:function(){return c}});const a=r(Dh());function r(d){return d&&d.__esModule?d:{default:d}}let s=new Set;function i(d,u,f){typeof process<"u"&&t.JEST_WORKER_ID||f&&s.has(f)||(f&&s.add(f),console.warn(""),u.forEach(h=>console.warn(d,"-",h)))}function l(d){return a.default.dim(d)}const c={info(d,u){i(a.default.bold(a.default.cyan("info")),...Array.isArray(d)?[d]:[u,d])},warn(d,u){i(a.default.bold(a.default.yellow("warn")),...Array.isArray(d)?[d]:[u,d])},risk(d,u){i(a.default.bold(a.default.magenta("risk")),...Array.isArray(d)?[d]:[u,d])}}})(xr)),xr}var Mi;function Nh(){return Mi||(Mi=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});const t=o(Mh());function o(s){return s&&s.__esModule?s:{default:s}}function a({version:s,from:i,to:l}){t.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 r={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 a({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return a({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return a({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return a({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return a({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(yr)),yr}var kr,Ni;function Ph(){if(Ni)return kr;Ni=1;let e=Nh();return kr=(e.__esModule?e:{default:e}).default,kr}var vh=Ph();const Th=Vh(vh),Pi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,vi=ii,eo=(e,t)=>o=>{var a;if((t==null?void 0:t.variants)==null)return vi(e,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:r,defaultVariants:s}=t,i=Object.keys(r).map(d=>{const u=o==null?void 0:o[d],f=s==null?void 0:s[d];if(u===null)return null;const h=Pi(u)||Pi(f);return r[d][h]}),l=o&&Object.entries(o).reduce((d,u)=>{let[f,h]=u;return h===void 0||(d[f]=h),d},{}),c=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((d,u)=>{let{class:f,className:h,...m}=u;return Object.entries(m).every(p=>{let[g,y]=p;return Array.isArray(y)?y.includes({...s,...l}[g]):{...s,...l}[g]===y})?[...d,f,h]:d},[]);return vi(e,i,c,o==null?void 0:o.class,o==null?void 0:o.className)},ut=n.defineComponent({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ie.Primitive),{as:e.as,"as-child":e.asChild,class:n.normalizeClass(n.unref(we)(n.unref(Nn)({variant:e.variant,size:e.size}),t.class))},{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),Nn=eo("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"}}),Ti=n.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(e,{emit:t}){const o=e,a=t,r=ie.useForwardPropsEmits(o,a);return(s,i)=>(n.openBlock(),n.createBlock(n.unref(ie.TooltipRoot),n.normalizeProps(n.guardReactiveProps(n.unref(r))),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16))}}),Oi=n.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(e,{emit:t}){const o=e,a=t,r=ze.reactiveOmit(o,"class"),s=ie.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(ie.TooltipPortal),null,{default:n.withCtx(()=>[n.createVNode(n.unref(ie.TooltipContent),n.mergeProps({...n.unref(s),...i.$attrs},{class:n.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:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),zi=n.defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ie.TooltipProvider),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),Fi=n.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ie.TooltipTrigger),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),Oh={class:"relative z-10"},zh="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] shadow-[0_3px_0_0_rgba(0,0,0,0.12),0_12px_22px_-10px_rgba(0,0,0,0.35)] hover:shadow-[0_6px_20px_-4px_rgba(0,0,0,0.3),0_10px_40px_-10px_rgba(0,0,0,0.2)] active:shadow-[0_1px_0_0_rgba(0,0,0,0.2),0_4px_8px_-4px_rgba(0,0,0,0.35)] 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",Fh=n.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(e){const t=n.useAttrs(),o=e,a=n.computed(()=>o.icon&&Ct[o.icon]||null),r=n.computed(()=>!!o.tooltip),s=n.computed(()=>o.visible??!0),i=n.computed(()=>{const X=String(o.variant||"default").toLowerCase();return X==="tonal"?"secondary":X==="elevated"?"default":X}),l=n.computed(()=>String(o.bgColor||"").toLowerCase()),c=n.computed(()=>String(o.type||"button").toLowerCase()),d=n.computed(()=>{const{class:X,...j}=t;return j}),u=n.computed(()=>we(t.class)),f=n.computed(()=>((u.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),h=n.computed(()=>o.size==="sm"?"h-9":o.size==="lg"?"h-11":o.size==="icon"?"h-10 w-10":"h-10"),m=n.computed(()=>o.size==="icon"?"":!o.text&&o.icon?"w-10":"w-28"),p=n.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}`:""),g=n.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=n.computed(()=>we("inline-flex items-center justify-center bg-gray-200 dark:bg-gray-700 animate-pulse",p.value,h.value,m.value,f.value)),x=n.computed(()=>{const j=(u.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return j?j[0]:null}),_=n.computed(()=>{const j=(u.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return j?j[0]:null}),C=n.computed(()=>!!x.value),w=n.computed(()=>/\bborder-/.test(u.value??"")),E=n.computed(()=>/\bhover:/.test(u.value??"")),B=n.computed(()=>{const X=u.value??"";return i.value!=="outline"?X:X.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),k=n.ref(null),b=X=>{const j=X.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return j?{r:Number(j[1]),g:Number(j[2]),b:Number(j[3]),a:j[4]?Number(j[4]):1}:null},A=(X,j)=>{const ee=b(X);if(!ee)return X;const ne=fe=>Math.max(0,Math.min(255,Math.round(fe)));return`rgba(${ne(ee.r*(1-j))}, ${ne(ee.g*(1-j))}, ${ne(ee.b*(1-j))}, ${ee.a})`},D=X=>{if(globalThis.window===void 0)return null;const j=document.createElement("div");j.className=X,j.style.position="absolute",j.style.visibility="hidden",j.style.pointerEvents="none",j.style.width="1px",j.style.height="1px",document.body.appendChild(j);const ee=globalThis.getComputedStyle(j).backgroundColor;return j.remove(),!ee||ee==="transparent"||ee==="rgba(0, 0, 0, 0)"?null:ee},P=[50,100,200,300,400,500,600,700,800,900,950],V=X=>{const j=P.indexOf(X);return j===-1?X:P[Math.min(P.length-1,j+2)]},M=(X,j)=>{const ee=Th[X];if(!ee)return null;if(typeof ee=="string")return ee;if(!j)return null;const ne=ee[j];return typeof ne=="string"?ne:null},z=(X,j=!1)=>{if(!X)return null;const ee=j?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,ne=X.match(ee);return ne?{colorName:ne[1],shade:ne[2]?Number.parseInt(ne[2],10):null}:null},N=()=>{const X=x.value;if(!X){k.value=null;return}const j=z(X),ee=j==null?void 0:j.colorName,ne=(j==null?void 0:j.shade)??null,fe=(ee?M(ee,ne):null)??D(X);if(!fe){k.value=null;return}let ye;const he=z(_.value,!0),G=he?M(he.colorName,he.shade??null):null;if(G)ye=G;else if(ee&&ne){const F=V(ne);ye=M(ee,F)??A(fe,.2)}else ye=A(fe,.2);k.value={"--btn-color":fe,"--btn-color-hover":ye}};n.onMounted(()=>{N()}),n.watch([x,_],async()=>{await n.nextTick(),N()});const v=n.computed(()=>{const X=/\bdark:bg-/.test(u.value??"");return!C.value||i.value==="outline"||X?"":k.value?"dcode-btn--fill dcode-btn--fill-hover":E.value?"":"hover:brightness-90"}),T=n.computed(()=>{if(!C.value||i.value!=="outline")return"";const X=["dcode-btn--outline","dcode-btn--outline-hover"];return w.value||X.push("border"),!k.value&&!E.value&&X.push("hover:brightness-90"),X.join(" ")}),R=n.computed(()=>k.value??void 0),H={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"}},O={"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"}},$=n.computed(()=>{const X=[],j=l.value,ee=String(o.borderColor||"").toLowerCase(),ne=j?H[j]:null,fe=j?O[j]:null,ye=ee?H[ee]:null;return j&&(ne?ye&&ee!==j?(X.push(ne.bg,ye.hoverBg),o.textColor||X.push(ne.text,ye.hoverText)):(X.push(ne.bg,ne.hoverBg),o.textColor||X.push(ne.text,ne.hoverText)):fe?(X.push(fe.bg,fe.hover),o.textColor||X.push(fe.text)):j==="transparent"?ye?(X.push("bg-transparent",ye.hoverBg),o.textColor||X.push("text-inherit",ye.hoverText)):X.push("bg-transparent hover:bg-black/5 dark:hover:bg-white/5"):X.push(j)),ee?ye?X.push(ye.border,ye.hoverBorder):X.push(ee):ne&&i.value!=="ghost"&&i.value!=="link"&&X.push(ne.border,ne.hoverBorder),o.textColor&&X.push(o.textColor),X.join(" ")}),Y=n.computed(()=>we(zh,p.value,g.value,B.value,v.value,T.value,$.value));return(X,j)=>s.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.skeleton?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(y.value),"aria-hidden":"true"},null,2)):(n.openBlock(),n.createBlock(n.unref(zi),{key:1,"delay-duration":0},{default:n.withCtx(()=>[r.value?(n.openBlock(),n.createBlock(n.unref(Ti),{key:0},{default:n.withCtx(()=>[n.createVNode(n.unref(Fi),{"as-child":""},{default:n.withCtx(()=>[n.createVNode(n.unref(ut),n.mergeProps({variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:Y.value,style:R.value},d.value),{default:n.withCtx(()=>[a.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(a.value),{key:0,class:"h-[18px] w-[18px]"})):n.createCommentVNode("",!0),o.text?(n.openBlock(),n.createElementBlock("span",{key:1,class:n.normalizeClass(a.value?"ml-1":"")},n.toDisplayString(o.text),3)):n.createCommentVNode("",!0)]),_:1},16,["variant","size","disabled","type","class","style"])]),_:1}),n.createVNode(n.unref(Oi),{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:n.withCtx(()=>[n.createElementVNode("span",Oh,n.toDisplayString(o.tooltip),1)]),_:1})]),_:1})):(n.openBlock(),n.createBlock(n.unref(ut),n.mergeProps({key:1,variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:Y.value,style:R.value},d.value),{default:n.withCtx(()=>[n.renderSlot(X.$slots,"default",{},()=>[a.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(a.value),{key:0,class:"h-[18px] w-[18px]"})):n.createCommentVNode("",!0),o.text?(n.openBlock(),n.createElementBlock("span",{key:1,class:n.normalizeClass(a.value?"ml-1":"")},n.toDisplayString(o.text),3)):n.createCommentVNode("",!0)],!0)]),_:3},16,["variant","size","disabled","type","class","style"]))]),_:3}))],64)):n.createCommentVNode("",!0)}}),xt=(e,t)=>{const o=e.__vccOpts||e;for(const[a,r]of t)o[a]=r;return o},qe=xt(Fh,[["__scopeId","data-v-d4cd902d"]]),Ih={key:0,class:"flex items-center justify-between mb-4"},Rh={class:"flex flex-col gap-1"},Lh={key:0,class:"text-lg font-semibold text-neutral-900 dark:text-neutral-50 leading-tight"},$h={key:1,class:"text-sm text-neutral-500 dark:text-neutral-400"},Wh={key:0,class:"flex items-center gap-2"},jh={class:"relative z-10"},Uh={key:1,class:"mt-6 pt-6 border-t border-neutral-200 dark:border-neutral-800"},Hh={name:"DCodeCard"},Ii=n.defineComponent({...Hh,props:{level:{default:1},title:{},subtitle:{},shadow:{type:Boolean,default:!1},border:{type:Boolean,default:!0},padding:{default:"p-6"}},setup(e){const t=e,o=n.computed(()=>{switch(t.level){case 2:return"bg-neutral-50 dark:bg-neutral-800";case 3:return"bg-neutral-100 dark:bg-neutral-700";case 1:default:return"bg-white dark:bg-neutral-900"}});return(a,r)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["transition-shadow duration-300 dcode-card",[o.value,e.padding,{"shadow-md":e.shadow},{"border-transparent":!e.border},{"border-neutral-200 dark:border-neutral-800":e.border&&e.level===1},{"border-neutral-300 dark:border-neutral-700":e.border&&e.level!==1}]])},[e.title||a.$slots.header||a.$slots.actions?(n.openBlock(),n.createElementBlock("div",Ih,[n.createElementVNode("div",Rh,[n.renderSlot(a.$slots,"header",{},()=>[e.title?(n.openBlock(),n.createElementBlock("h3",Lh,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),e.subtitle?(n.openBlock(),n.createElementBlock("p",$h,n.toDisplayString(e.subtitle),1)):n.createCommentVNode("",!0)])]),a.$slots.actions?(n.openBlock(),n.createElementBlock("div",Wh,[n.renderSlot(a.$slots,"actions")])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",jh,[n.renderSlot(a.$slots,"default")]),a.$slots.footer?(n.openBlock(),n.createElementBlock("div",Uh,[n.renderSlot(a.$slots,"footer")])):n.createCommentVNode("",!0)],2))}});/*!
|
|
1
|
+
(function(le,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("lucide-vue-next"),require("reka-ui"),require("@vueuse/core"),require("@vuepic/vue-datepicker"),require("@uppy/core"),require("@uppy/dashboard"),require("@uppy/image-editor"),require("vue-i18n"),require("vue-router"),require("vue3-lottie")):typeof define=="function"&&define.amd?define(["exports","vue","lucide-vue-next","reka-ui","@vueuse/core","@vuepic/vue-datepicker","@uppy/core","@uppy/dashboard","@uppy/image-editor","vue-i18n","vue-router","vue3-lottie"],n):(le=typeof globalThis<"u"?globalThis:le||self,n(le.DynamicUI={},le.Vue,le.LucideIcons,le.rekaUi,le.core,le.VueDatePicker,le.Uppy,le.UppyDashboard,le.UppyImageEditor,le.VueI18n,le.VueRouter,le.Vue3Lottie))})(this,(function(le,n,te,ce,Fe,Jd,Qd,Os,Zd,Ht,An,eu){"use strict";var PS=Object.defineProperty;var vS=(le,n,te)=>n in le?PS(le,n,{enumerable:!0,configurable:!0,writable:!0,value:te}):le[n]=te;var fe=(le,n,te)=>vS(le,typeof n!="symbol"?n+"":n,te);var Ha;function tu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,a.get?a:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const Ct=tu(te);let gt={};function zs(e){gt={...gt,...e}}function nu(){return gt}function ou(){return gt.apiBaseUrl?gt.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function au(){const e={"Content-Type":"application/json",Accept:"application/json"};let t=null;if(gt.getAuthToken?t=gt.getAuthToken():typeof window<"u"&&window.__MICRO_AUTH_TOKEN__?t=window.__MICRO_AUTH_TOKEN__:typeof localStorage<"u"&&(t=localStorage.getItem("token")||sessionStorage.getItem("token")),t&&(e.Authorization=`Bearer ${t}`),gt.getHeaders){const o=gt.getHeaders();return{...e,...o}}return e}function ru(){gt.onUnauthorized&>.onUnauthorized()}async function Fs(e,t,o,a){const r=nu();if(r.apiClient)return r.apiClient(e,t||"GET",o);if(!e||!e.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=(t||"").trim().toUpperCase(),l=s.includes(i)?i:"GET";s.includes(i)||console.warn(`[DynamicUI][useApi] HTTP method '${t}' tidak valid, fallback ke 'GET'.`);const c=ou(),d=e.startsWith("http")?e:`${c}${e}`,u={method:l,headers:{...au(),...a||{}}};o&&!["GET","DELETE"].includes(l)&&(u.body=JSON.stringify(o));let f=d;if(o&&l==="GET"){const p=new URLSearchParams;Object.entries(o).forEach(([g,x])=>{x!=null&&p.append(g,String(x))});const b=p.toString();b&&(f=`${d}${d.includes("?")?"&":"?"}${b}`)}const h=await fetch(f,u);if(h.status===401&&ru(),!h.ok){const p=await h.text();throw new Error(`HTTP ${h.status}: ${p}`)}return(h.headers.get("content-type")||"").includes("application/json")?h.json():{status:!0,data:await h.text()}}function Je(){return{apiUrl:(o,a,r,s)=>Fs(o,a,r,s),DCodeApi:(o,a,r,s)=>{let i=o,l=a,c=r;return s&&s._url?(i=s._url,l=s._method||l||"POST",s._data&&(c={...c||{},...s._data})):o&&a&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(a.toUpperCase())||(i=`${o.endsWith("/")?o.slice(0,-1):o}/${a}`,l="POST")),Fs(i,l,c,s==null?void 0:s.headers)}}}const Vn=Math.min,it=Math.max,Po=Math.round,vo=Math.floor,_t=e=>({x:e,y:e}),su={left:"right",right:"left",bottom:"top",top:"bottom"},iu={start:"end",end:"start"};function Is(e,t,o){return it(e,Vn(t,o))}function Yn(e,t){return typeof e=="function"?e(t):e}function qt(e){return e.split("-")[0]}function Kn(e){return e.split("-")[1]}function Rs(e){return e==="x"?"y":"x"}function Ls(e){return e==="y"?"height":"width"}const lu=new Set(["top","bottom"]);function Tt(e){return lu.has(qt(e))?"y":"x"}function $s(e){return Rs(Tt(e))}function cu(e,t,o){o===void 0&&(o=!1);const a=Kn(e),r=$s(e),s=Ls(r);let i=r==="x"?a===(o?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=To(i)),[i,To(i)]}function du(e){const t=To(e);return[tr(e),t,tr(t)]}function tr(e){return e.replace(/start|end/g,t=>iu[t])}const Ws=["left","right"],js=["right","left"],uu=["top","bottom"],fu=["bottom","top"];function hu(e,t,o){switch(e){case"top":case"bottom":return o?t?js:Ws:t?Ws:js;case"left":case"right":return t?uu:fu;default:return[]}}function mu(e,t,o,a){const r=Kn(e);let s=hu(qt(e),o==="start",a);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(tr)))),s}function To(e){return e.replace(/left|right|bottom|top/g,t=>su[t])}function pu(e){return{top:0,right:0,bottom:0,left:0,...e}}function gu(e){return typeof e!="number"?pu(e):{top:e,right:e,bottom:e,left:e}}function Oo(e){const{x:t,y:o,width:a,height:r}=e;return{width:a,height:r,top:o,left:t,right:t+a,bottom:o+r,x:t,y:o}}function Us(e,t,o){let{reference:a,floating:r}=e;const s=Tt(t),i=$s(t),l=Ls(i),c=qt(t),d=s==="y",u=a.x+a.width/2-r.width/2,f=a.y+a.height/2-r.height/2,h=a[l]/2-r[l]/2;let m;switch(c){case"top":m={x:u,y:a.y-r.height};break;case"bottom":m={x:u,y:a.y+a.height};break;case"right":m={x:a.x+a.width,y:f};break;case"left":m={x:a.x-r.width,y:f};break;default:m={x:a.x,y:a.y}}switch(Kn(t)){case"start":m[i]-=h*(o&&d?-1:1);break;case"end":m[i]+=h*(o&&d?-1:1);break}return m}async function bu(e,t){var o;t===void 0&&(t={});const{x:a,y:r,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Yn(t,e),p=gu(m),g=l[h?f==="floating"?"reference":"floating":f],x=Oo(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(g)))==null||o?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),_=f==="floating"?{x:a,y:r,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),w=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},E=Oo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:C,strategy:c}):_);return{top:(x.top-E.top+p.top)/w.y,bottom:(E.bottom-x.bottom+p.bottom)/w.y,left:(x.left-E.left+p.left)/w.x,right:(E.right-x.right+p.right)/w.x}}const yu=async(e,t,o)=>{const{placement:a="bottom",strategy:r="absolute",middleware:s=[],platform:i}=o,l=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=Us(d,a,c),h=a,m={},p=0;for(let g=0;g<l.length;g++){var b;const{name:x,fn:_}=l[g],{x:C,y:w,data:E,reset:B}=await _({x:u,y:f,initialPlacement:a,placement:h,strategy:r,middlewareData:m,rects:d,platform:{...i,detectOverflow:(b=i.detectOverflow)!=null?b:bu},elements:{reference:e,floating:t}});u=C??u,f=w??f,m={...m,[x]:{...m[x],...E}},B&&p<=50&&(p++,typeof B=="object"&&(B.placement&&(h=B.placement),B.rects&&(d=B.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):B.rects),{x:u,y:f}=Us(d,h,c)),g=-1)}return{x:u,y:f,placement:h,strategy:r,middlewareData:m}},xu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var o,a;const{placement:r,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:b=!0,...g}=Yn(e,t);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const x=qt(r),_=Tt(l),C=qt(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),E=h||(C||!b?[To(l)]:du(l)),B=p!=="none";!h&&B&&E.push(...mu(l,b,p,w));const k=[l,...E],y=await c.detectOverflow(t,g),A=[];let D=((a=s.flip)==null?void 0:a.overflows)||[];if(u&&A.push(y[x]),f){const T=cu(r,i,w);A.push(y[T[0]],y[T[1]])}if(D=[...D,{placement:r,overflows:A}],!A.every(T=>T<=0)){var N,V;const T=(((N=s.flip)==null?void 0:N.index)||0)+1,U=k[T];if(U&&(!(f==="alignment"?_!==Tt(U):!1)||D.every(P=>Tt(P.placement)===_?P.overflows[0]>0:!0)))return{data:{index:T,overflows:D},reset:{placement:U}};let L=(V=D.filter(R=>R.overflows[0]<=0).sort((R,P)=>R.overflows[1]-P.overflows[1])[0])==null?void 0:V.placement;if(!L)switch(m){case"bestFit":{var M;const R=(M=D.filter(P=>{if(B){const W=Tt(P.placement);return W===_||W==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(W=>W>0).reduce((W,v)=>W+v,0)]).sort((P,W)=>P[1]-W[1])[0])==null?void 0:M[0];R&&(L=R);break}case"initialPlacement":L=l;break}if(r!==L)return{reset:{placement:L}}}return{}}}},ku=new Set(["left","top"]);async function wu(e,t){const{placement:o,platform:a,elements:r}=e,s=await(a.isRTL==null?void 0:a.isRTL(r.floating)),i=qt(o),l=Kn(o),c=Tt(o)==="y",d=ku.has(i)?-1:1,u=s&&c?-1:1,f=Yn(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof p=="number"&&(m=l==="end"?p*-1:p),c?{x:m*u,y:h*d}:{x:h*d,y:m*u}}const Cu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var o,a;const{x:r,y:s,placement:i,middlewareData:l}=t,c=await wu(t,e);return i===((o=l.offset)==null?void 0:o.placement)&&(a=l.arrow)!=null&&a.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},_u=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:a,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:x=>{let{x:_,y:C}=x;return{x:_,y:C}}},...d}=Yn(e,t),u={x:o,y:a},f=await s.detectOverflow(t,d),h=Tt(qt(r)),m=Rs(h);let p=u[m],b=u[h];if(i){const x=m==="y"?"top":"left",_=m==="y"?"bottom":"right",C=p+f[x],w=p-f[_];p=Is(C,p,w)}if(l){const x=h==="y"?"top":"left",_=h==="y"?"bottom":"right",C=b+f[x],w=b-f[_];b=Is(C,b,w)}const g=c.fn({...t,[m]:p,[h]:b});return{...g,data:{x:g.x-o,y:g.y-a,enabled:{[m]:i,[h]:l}}}}}},Bu=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var o,a;const{placement:r,rects:s,platform:i,elements:l}=t,{apply:c=()=>{},...d}=Yn(e,t),u=await i.detectOverflow(t,d),f=qt(r),h=Kn(r),m=Tt(r)==="y",{width:p,height:b}=s.floating;let g,x;f==="top"||f==="bottom"?(g=f,x=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(x=f,g=h==="end"?"top":"bottom");const _=b-u.top-u.bottom,C=p-u.left-u.right,w=Vn(b-u[g],_),E=Vn(p-u[x],C),B=!t.middlewareData.shift;let k=w,y=E;if((o=t.middlewareData.shift)!=null&&o.enabled.x&&(y=C),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(k=_),B&&!h){const D=it(u.left,0),N=it(u.right,0),V=it(u.top,0),M=it(u.bottom,0);m?y=p-2*(D!==0||N!==0?D+N:it(u.left,u.right)):k=b-2*(V!==0||M!==0?V+M:it(u.top,u.bottom))}await c({...t,availableWidth:y,availableHeight:k});const A=await i.getDimensions(l.floating);return p!==A.width||b!==A.height?{reset:{rects:!0}}:{}}}};function zo(){return typeof window<"u"}function dn(e){return nr(e)?(e.nodeName||"").toLowerCase():"#document"}function lt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bt(e){var t;return(t=(nr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function nr(e){return zo()?e instanceof Node||e instanceof lt(e).Node:!1}function bt(e){return zo()?e instanceof Element||e instanceof lt(e).Element:!1}function Et(e){return zo()?e instanceof HTMLElement||e instanceof lt(e).HTMLElement:!1}function Hs(e){return!zo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof lt(e).ShadowRoot}const Eu=new Set(["inline","contents"]);function Jn(e){const{overflow:t,overflowX:o,overflowY:a,display:r}=yt(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+o)&&!Eu.has(r)}const Su=new Set(["table","td","th"]);function Au(e){return Su.has(dn(e))}const Vu=[":popover-open",":modal"];function Fo(e){return Vu.some(t=>{try{return e.matches(t)}catch{return!1}})}const Du=["transform","translate","scale","rotate","perspective"],Mu=["transform","translate","scale","rotate","perspective","filter"],Nu=["paint","layout","strict","content"];function or(e){const t=ar(),o=bt(e)?yt(e):e;return Du.some(a=>o[a]?o[a]!=="none":!1)||(o.containerType?o.containerType!=="normal":!1)||!t&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!t&&(o.filter?o.filter!=="none":!1)||Mu.some(a=>(o.willChange||"").includes(a))||Nu.some(a=>(o.contain||"").includes(a))}function Pu(e){let t=Gt(e);for(;Et(t)&&!Dn(t);){if(or(t))return t;if(Fo(t))return null;t=Gt(t)}return null}function ar(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vu=new Set(["html","body","#document"]);function Dn(e){return vu.has(dn(e))}function yt(e){return lt(e).getComputedStyle(e)}function Io(e){return bt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gt(e){if(dn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Hs(e)&&e.host||Bt(e);return Hs(t)?t.host:t}function qs(e){const t=Gt(e);return Dn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Et(t)&&Jn(t)?t:qs(t)}function Qn(e,t,o){var a;t===void 0&&(t=[]),o===void 0&&(o=!0);const r=qs(e),s=r===((a=e.ownerDocument)==null?void 0:a.body),i=lt(r);if(s){const l=rr(i);return t.concat(i,i.visualViewport||[],Jn(r)?r:[],l&&o?Qn(l):[])}return t.concat(r,Qn(r,[],o))}function rr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gs(e){const t=yt(e);let o=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=Et(e),s=r?e.offsetWidth:o,i=r?e.offsetHeight:a,l=Po(o)!==s||Po(a)!==i;return l&&(o=s,a=i),{width:o,height:a,$:l}}function sr(e){return bt(e)?e:e.contextElement}function Mn(e){const t=sr(e);if(!Et(t))return _t(1);const o=t.getBoundingClientRect(),{width:a,height:r,$:s}=Gs(t);let i=(s?Po(o.width):o.width)/a,l=(s?Po(o.height):o.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Tu=_t(0);function Xs(e){const t=lt(e);return!ar()||!t.visualViewport?Tu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ou(e,t,o){return t===void 0&&(t=!1),!o||t&&o!==lt(e)?!1:t}function un(e,t,o,a){t===void 0&&(t=!1),o===void 0&&(o=!1);const r=e.getBoundingClientRect(),s=sr(e);let i=_t(1);t&&(a?bt(a)&&(i=Mn(a)):i=Mn(e));const l=Ou(s,o,a)?Xs(s):_t(0);let c=(r.left+l.x)/i.x,d=(r.top+l.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s){const h=lt(s),m=a&&bt(a)?lt(a):a;let p=h,b=rr(p);for(;b&&a&&m!==p;){const g=Mn(b),x=b.getBoundingClientRect(),_=yt(b),C=x.left+(b.clientLeft+parseFloat(_.paddingLeft))*g.x,w=x.top+(b.clientTop+parseFloat(_.paddingTop))*g.y;c*=g.x,d*=g.y,u*=g.x,f*=g.y,c+=C,d+=w,p=lt(b),b=rr(p)}}return Oo({width:u,height:f,x:c,y:d})}function Ro(e,t){const o=Io(e).scrollLeft;return t?t.left+o:un(Bt(e)).left+o}function Ys(e,t){const o=e.getBoundingClientRect(),a=o.left+t.scrollLeft-Ro(e,o),r=o.top+t.scrollTop;return{x:a,y:r}}function zu(e){let{elements:t,rect:o,offsetParent:a,strategy:r}=e;const s=r==="fixed",i=Bt(a),l=t?Fo(t.floating):!1;if(a===i||l&&s)return o;let c={scrollLeft:0,scrollTop:0},d=_t(1);const u=_t(0),f=Et(a);if((f||!f&&!s)&&((dn(a)!=="body"||Jn(i))&&(c=Io(a)),Et(a))){const m=un(a);d=Mn(a),u.x=m.x+a.clientLeft,u.y=m.y+a.clientTop}const h=i&&!f&&!s?Ys(i,c):_t(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 Fu(e){return Array.from(e.getClientRects())}function Iu(e){const t=Bt(e),o=Io(e),a=e.ownerDocument.body,r=it(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),s=it(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let i=-o.scrollLeft+Ro(e);const l=-o.scrollTop;return yt(a).direction==="rtl"&&(i+=it(t.clientWidth,a.clientWidth)-r),{width:r,height:s,x:i,y:l}}const Ks=25;function Ru(e,t){const o=lt(e),a=Bt(e),r=o.visualViewport;let s=a.clientWidth,i=a.clientHeight,l=0,c=0;if(r){s=r.width,i=r.height;const u=ar();(!u||u&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const d=Ro(a);if(d<=0){const u=a.ownerDocument,f=u.body,h=getComputedStyle(f),m=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(a.clientWidth-f.clientWidth-m);p<=Ks&&(s-=p)}else d<=Ks&&(s+=d);return{width:s,height:i,x:l,y:c}}const Lu=new Set(["absolute","fixed"]);function $u(e,t){const o=un(e,!0,t==="fixed"),a=o.top+e.clientTop,r=o.left+e.clientLeft,s=Et(e)?Mn(e):_t(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,d=a*s.y;return{width:i,height:l,x:c,y:d}}function Js(e,t,o){let a;if(t==="viewport")a=Ru(e,o);else if(t==="document")a=Iu(Bt(e));else if(bt(t))a=$u(t,o);else{const r=Xs(e);a={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Oo(a)}function Qs(e,t){const o=Gt(e);return o===t||!bt(o)||Dn(o)?!1:yt(o).position==="fixed"||Qs(o,t)}function Wu(e,t){const o=t.get(e);if(o)return o;let a=Qn(e,[],!1).filter(l=>bt(l)&&dn(l)!=="body"),r=null;const s=yt(e).position==="fixed";let i=s?Gt(e):e;for(;bt(i)&&!Dn(i);){const l=yt(i),c=or(i);!c&&l.position==="fixed"&&(r=null),(s?!c&&!r:!c&&l.position==="static"&&!!r&&Lu.has(r.position)||Jn(i)&&!c&&Qs(e,i))?a=a.filter(u=>u!==i):r=l,i=Gt(i)}return t.set(e,a),a}function ju(e){let{element:t,boundary:o,rootBoundary:a,strategy:r}=e;const i=[...o==="clippingAncestors"?Fo(t)?[]:Wu(t,this._c):[].concat(o),a],l=i[0],c=i.reduce((d,u)=>{const f=Js(t,u,r);return d.top=it(f.top,d.top),d.right=Vn(f.right,d.right),d.bottom=Vn(f.bottom,d.bottom),d.left=it(f.left,d.left),d},Js(t,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Uu(e){const{width:t,height:o}=Gs(e);return{width:t,height:o}}function Hu(e,t,o){const a=Et(t),r=Bt(t),s=o==="fixed",i=un(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=_t(0);function d(){c.x=Ro(r)}if(a||!a&&!s)if((dn(t)!=="body"||Jn(r))&&(l=Io(t)),a){const m=un(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else r&&d();s&&!a&&r&&d();const u=r&&!a&&!s?Ys(r,l):_t(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 ir(e){return yt(e).position==="static"}function Zs(e,t){if(!Et(e)||yt(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;return Bt(e)===o&&(o=o.ownerDocument.body),o}function ei(e,t){const o=lt(e);if(Fo(e))return o;if(!Et(e)){let r=Gt(e);for(;r&&!Dn(r);){if(bt(r)&&!ir(r))return r;r=Gt(r)}return o}let a=Zs(e,t);for(;a&&Au(a)&&ir(a);)a=Zs(a,t);return a&&Dn(a)&&ir(a)&&!or(a)?o:a||Pu(e)||o}const qu=async function(e){const t=this.getOffsetParent||ei,o=this.getDimensions,a=await o(e.floating);return{reference:Hu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function Gu(e){return yt(e).direction==="rtl"}const Xu={convertOffsetParentRelativeRectToViewportRelativeRect:zu,getDocumentElement:Bt,getClippingRect:ju,getOffsetParent:ei,getElementRects:qu,getClientRects:Fu,getDimensions:Uu,getScale:Mn,isElement:bt,isRTL:Gu};function ti(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yu(e,t){let o=null,a;const r=Bt(e);function s(){var l;clearTimeout(a),(l=o)==null||l.disconnect(),o=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:u,top:f,width:h,height:m}=d;if(l||t(),!h||!m)return;const p=vo(f),b=vo(r.clientWidth-(u+h)),g=vo(r.clientHeight-(f+m)),x=vo(u),C={rootMargin:-p+"px "+-b+"px "+-g+"px "+-x+"px",threshold:it(0,Vn(1,c))||1};let w=!0;function E(B){const k=B[0].intersectionRatio;if(k!==c){if(!w)return i();k?i(!1,k):a=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!ti(d,e.getBoundingClientRect())&&i(),w=!1}try{o=new IntersectionObserver(E,{...C,root:r.ownerDocument})}catch{o=new IntersectionObserver(E,C)}o.observe(e)}return i(!0),s}function lr(e,t,o,a){a===void 0&&(a={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=a,d=sr(e),u=r||s?[...d?Qn(d):[],...Qn(t)]:[];u.forEach(x=>{r&&x.addEventListener("scroll",o,{passive:!0}),s&&x.addEventListener("resize",o)});const f=d&&l?Yu(d,o):null;let h=-1,m=null;i&&(m=new ResizeObserver(x=>{let[_]=x;_&&_.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=m)==null||C.observe(t)})),o()}),d&&!c&&m.observe(d),m.observe(t));let p,b=c?un(e):null;c&&g();function g(){const x=un(e);b&&!ti(b,x)&&o(),b=x,p=requestAnimationFrame(g)}return o(),()=>{var x;u.forEach(_=>{r&&_.removeEventListener("scroll",o),s&&_.removeEventListener("resize",o)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(p)}}const cr=Cu,dr=_u,ur=xu,fr=Bu,Ku=(e,t,o)=>{const a=new Map,r={platform:Xu,...o},s={...r.platform,_c:a};return yu(e,t,{...r,platform:s})};function Ju(e){return e!=null&&typeof e=="object"&&"$el"in e}function ni(e){if(Ju(e)){const t=e.$el;return nr(t)&&dn(t)==="#comment"?null:t}return e}function Zn(e){return typeof e=="function"?e():n.unref(e)}function oi(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ai(e,t){const o=oi(e);return Math.round(t*o)/o}function hr(e,t,o){o===void 0&&(o={});const a=o.whileElementsMounted,r=n.computed(()=>{var k;return(k=Zn(o.open))!=null?k:!0}),s=n.computed(()=>Zn(o.middleware)),i=n.computed(()=>{var k;return(k=Zn(o.placement))!=null?k:"bottom"}),l=n.computed(()=>{var k;return(k=Zn(o.strategy))!=null?k:"absolute"}),c=n.computed(()=>{var k;return(k=Zn(o.transform))!=null?k:!0}),d=n.computed(()=>ni(e.value)),u=n.computed(()=>ni(t.value)),f=n.ref(0),h=n.ref(0),m=n.ref(l.value),p=n.ref(i.value),b=n.shallowRef({}),g=n.ref(!1),x=n.computed(()=>{const k={position:m.value,left:"0",top:"0"};if(!u.value)return k;const y=ai(u.value,f.value),A=ai(u.value,h.value);return c.value?{...k,transform:"translate("+y+"px, "+A+"px)",...oi(u.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:y+"px",top:A+"px"}});let _;function C(){if(d.value==null||u.value==null)return;const k=r.value;Ku(d.value,u.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(y=>{f.value=y.x,h.value=y.y,m.value=y.strategy,p.value=y.placement,b.value=y.middlewareData,g.value=k!==!1})}function w(){typeof _=="function"&&(_(),_=void 0)}function E(){if(w(),a===void 0){C();return}if(d.value!=null&&u.value!=null){_=a(d.value,u.value,C);return}}function B(){r.value||(g.value=!1)}return n.watch([s,i,l,r],C,{flush:"sync"}),n.watch([d,u],E,{flush:"sync"}),n.watch(r,B,{flush:"sync"}),n.getCurrentScope()&&n.onScopeDispose(w),{x:n.shallowReadonly(f),y:n.shallowReadonly(h),strategy:n.shallowReadonly(m),placement:n.shallowReadonly(p),middlewareData:n.shallowReadonly(b),isPositioned:n.shallowReadonly(g),floatingStyles:x,update:C}}const Qu=["aria-busy"],Zu={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},ef=["for"],tf={key:0,class:"ml-1 text-destructive"},nf={class:"relative"},of={key:0,class:"flex items-center text-gray-500 gap-2"},af=["id","placeholder","disabled","readonly","value"],rf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},sf=["disabled"],lf={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},cf=["onMouseenter","onClick"],df={key:0},uf={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},ff={key:0},hf={key:1},mf={key:2},pf={key:1,class:"mt-1 text-xs text-red-600"},Lo=n.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(e,{emit:t}){const o=e,a=t,r=n.useAttrs(),s=n.computed(()=>r.label??void 0),i=q=>{const ae=r[q];return ae===""||ae===!0||ae==="true"||ae===1||ae==="1"},l=n.ref(!1),c=n.computed(()=>o.itemTitle||r["item-title"]||r.itemTitle||"name"),d=n.computed(()=>o.itemValue||r["item-value"]||r.itemValue||"id"),u=n.computed(()=>o.disabled),f=n.computed(()=>i("required")),h=n.computed(()=>i("readonly")),m=n.computed(()=>o.returnObject||i("return-object")||i("returnObject")),p=n.computed(()=>f.value||i("aria-required")),b=n.computed(()=>o.error||o.errorMessage||r["error-message"]),g=n.computed(()=>r.placeholder??""),x=n.computed(()=>{const q=r.minChars??r["min-chars"];if(q==null||q==="")return 0;const ae=typeof q=="number"?q:Number.parseInt(String(q),10);return Number.isFinite(ae)&&ae>0?ae:0}),_=n.computed(()=>{const q=r.rules;return Array.isArray(q)?q:[]}),C=n.computed(()=>{const q=r.id||r.label;return q?`app-autocomplete-${q}-${Math.random().toString(36).slice(2,7)}`:void 0}),w=n.ref(o.modelValue),E=n.ref([]),B=n.ref(!1),k=n.ref(!1),y=n.computed(()=>r.items),A=n.computed(()=>{const q=T.value;return q.apiModule&&q.apiAction||q.apiUrl||o.fetchItems?E.value:y.value??[]}),D=n.computed(()=>!!r.loading),N=n.computed(()=>D.value||B.value),V=n.computed(()=>{const{label:q,items:ae,loading:pe,rules:Oe,"item-title":Ae,"item-value":ee,itemTitle:ne,itemValue:re,minChars:be,"min-chars":We,clearable:Pt,required:qa,"aria-required":zd,disabled:Ga,readonly:Fd,visible:ot,"return-object":Id,returnObject:Xa,class:Rd,"fetch-items":Ya,fetchItems:Ld,error:vs,errorMessage:$d,"error-message":Wd,...Ka}=r||{};return Ka}),M=()=>{if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions},T=n.computed(()=>{const q=o.endpoint||{};return{apiModule:o.apiModule||q.apiModule,apiAction:o.apiAction||q.apiAction,apiUrl:q.apiUrl,apiMethod:q.apiMethod||"GET"}}),U=n.ref(null),L=n.ref(null),R=n.ref(null),{floatingStyles:P}=hr(L,R,{placement:"bottom-start",whileElementsMounted:lr,middleware:[cr(4),ur(),dr(),fr({apply({rects:q,elements:ae,availableHeight:pe}){Object.assign(ae.floating.style,{width:`${q.reference.width}px`,maxHeight:`${pe}px`})}})]}),W=n.ref(!1),v=n.ref(""),z=n.ref(-1),H=n.ref(null),G=n.computed(()=>!x.value||(v.value||"").trim().length>=x.value?"":`Ketik minimal ${x.value} karakter`),K=q=>{if(q==null)return"";if(typeof q=="string"||typeof q=="number")return String(q);const ae=c.value;return typeof ae=="function"?ae(q):(q==null?void 0:q[ae])??(q==null?void 0:q.name)??(q==null?void 0:q.nama)??(q==null?void 0:q.label)??(q==null?void 0:q.title)??"-"},X=q=>{if(q==null)return null;if(typeof q=="string"||typeof q=="number")return q;const ae=d.value;return typeof ae=="function"?ae(q):(q==null?void 0:q[ae])??(q==null?void 0:q.id)??(q==null?void 0:q.value)??(q==null?void 0:q.code)??null},oe=n.computed(()=>{const q=w.value;if(q==null||q==="")return"";if(Array.isArray(q))return q.length?q.map(Oe=>{if(m.value&&typeof Oe=="object"||typeof Oe=="object")return K(Oe);const Ae=A.value.find(ee=>X(ee)==Oe);return Ae?K(Ae):String(Oe)}).join(", "):"";if(typeof q=="object")return K(q);const ae=A.value.find(pe=>X(pe)==q);return ae?K(ae):String(q)}),he=n.computed(()=>{const q=A.value||[],ae=(v.value||"").trim().toLowerCase(),pe=(oe.value||"").toLowerCase(),Oe=!ae||ae===pe;let Ae=q;if(Oe||(Ae=q.filter(ee=>K(ee).toLowerCase().includes(ae))),Ae.length>0){const ee=ne=>{const re=X(ne);return Array.isArray(w.value)?w.value.some(be=>be==re):w.value==re};Ae=[...Ae].sort((ne,re)=>{const be=ee(ne),We=ee(re);return be&&!We?-1:!be&&We?1:0})}return Ae}),ge=q=>Array.isArray(q)?q.length===0:q==null||q==="",se=q=>{if(H.value=null,f.value&&ge(q)&&!_.value.length)return H.value="This field is required",!1;for(const ae of _.value){const pe=ae(q);if(pe===!1)return H.value="Invalid value",!1;if(typeof pe=="string")return H.value=pe,!1}return!0},J=async()=>{if(u.value||h.value)return;W.value=!0,z.value=he.value.length?0:-1,v.value=oe.value||"";const q=T.value,ae=q.apiModule&&q.apiAction||q.apiUrl||o.fetchItems;o.autoFetchOnOpen&&ae&&!k.value&&(await Me(),z.value=he.value.length?0:-1)},O=()=>{W.value=!1,z.value=-1,v.value=oe.value||""},j=q=>{const ae=m.value?q:X(q);let pe=ae;Array.isArray(w.value)&&(pe=[ae]),w.value=pe,a("update:modelValue",pe),H.value=null,se(pe),v.value=K(q),O()},Y=()=>{E.value=[],k.value=!1,w.value=Array.isArray(w.value)?[]:null,a("update:modelValue",w.value),v.value="",H.value=null},ie=()=>{l.value=!0,Y(),O(),setTimeout(()=>{l.value=!1},0)},ye=q=>{if(u.value||h.value)return;const ae=q.target.value;v.value=ae,H.value&&(H.value=null),W.value||(W.value=!0),z.value=he.value.length?0:-1;const pe=T.value.apiModule&&T.value.apiAction||T.value.apiUrl||o.fetchItems;o.autoFetchOnOpen&&pe&&!N.value&&!k.value&&Me()},ke=q=>{var pe;if(u.value||h.value)return;const ae={ArrowDown:()=>{if(q.preventDefault(),!W.value){J();return}he.value.length&&(z.value=Math.min(z.value+1,he.value.length-1))},ArrowUp:()=>{!W.value||!he.value.length||(q.preventDefault(),z.value=Math.max(z.value-1,0))},Enter:()=>{if(!W.value)return;q.preventDefault();const Oe=he.value[z.value];Oe&&j(Oe)},Escape:()=>{q.preventDefault(),O()},Tab:()=>{O()}};(pe=ae[q.key])==null||pe.call(ae)},Me=async()=>{const q=T.value;if(q.apiModule&&q.apiAction||q.apiUrl||o.fetchItems){B.value=!0;try{let pe;if(o.fetchItems){const Oe=M()||{},Ae={page:1,perPage:100,search:(v.value||"").trim(),...Oe,...o.apiParams},ee=await o.fetchItems(Ae),ne=(ee==null?void 0:ee.data)??ee;pe=(ne==null?void 0:ne.data)??ne}else{const Ae=Je().DCodeApi;if(typeof Ae!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const ne={page:1,perPage:100,...M()||{},...o.apiParams};let re;q.apiUrl?re=await Ae("","",ne,{_url:q.apiUrl,_method:q.apiMethod||"POST"}):re=await Ae(q.apiModule,q.apiAction,ne);const be=(re==null?void 0:re.data)??re;pe=(be==null?void 0:be.data)??be}E.value=Array.isArray(pe)?pe:[],k.value=!0}catch(pe){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",pe),H.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(pe==null?void 0:pe.message)||(pe==null?void 0:pe.toString())||"Failed to load options"}`,E.value=[],k.value=!0}finally{B.value=!1}}},Te=q=>{const ae=X(q);return m.value?w.value?Array.isArray(w.value)?w.value.some(pe=>X(pe)==ae):X(w.value)==ae:!1:Array.isArray(w.value)?w.value.some(pe=>pe==ae):w.value==ae};n.watch(()=>[M(),T.value,o.apiParams],([q,ae,pe],[Oe,Ae,ee])=>{const ne=T.value;if(!(ne.apiModule&&ne.apiAction||ne.apiUrl||o.fetchItems)){Y();return}const be=JSON.stringify(q??null)===JSON.stringify(Oe??null),We=JSON.stringify(pe??null)===JSON.stringify(ee??null);be&&We||(Y(),We||Me())},{deep:!0}),n.watch(()=>o.modelValue,(q,ae)=>{w.value=q,!l.value&&(q==null||q==="")&&ae!=null&&o.apiModule&&o.apiAction&&(E.value=[],k.value=!1),v.value=oe.value||""},{immediate:!0});const Qe=T.value;(Qe.apiModule&&Qe.apiAction||Qe.apiUrl||o.fetchItems)&&(o.autoFetchOnMount||!ge(o.modelValue))&&Me();const ln=q=>{const ae=U.value,pe=R.value,Oe=q.target;ae&&ae.contains(Oe)||pe&&pe.contains(Oe)||W.value&&O()},Mo=n.computed(()=>{const q=o.modelValue;return q==null?!1:typeof q=="string"?q.trim().length>0:Array.isArray(q)?q.length>0:typeof q=="object"?Object.keys(q).length>0:!0}),No=n.computed(()=>!!o.clearable&&Mo.value&&!o.disabled);return n.onMounted(()=>{document.addEventListener("mousedown",ln)}),n.onBeforeUnmount(()=>{document.removeEventListener("mousedown",ln)}),(q,ae)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{ref_key:"rootEl",ref:U,class:n.normalizeClass(["w-full",n.unref(r).class]),"aria-busy":e.skeleton},[e.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.value?(n.openBlock(),n.createElementBlock("div",Zu)):n.createCommentVNode("",!0),ae[6]||(ae[6]=n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[s.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:C.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[n.createTextVNode(n.toDisplayString(s.value)+" ",1),p.value?(n.openBlock(),n.createElementBlock("span",tf,"*")):n.createCommentVNode("",!0)],8,ef)):n.createCommentVNode("",!0),n.createElementVNode("div",nf,[n.createElementVNode("div",{ref_key:"reference",ref:L,class:n.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 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":"",H.value||b.value?"border-red-500 focus-within:ring-red-500":""]])},[o.icon||q.$slots["prepend-inner"]?(n.openBlock(),n.createElementBlock("div",of,[n.renderSlot(q.$slots,"prepend-inner",{},()=>[o.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0),n.createElementVNode("input",n.mergeProps(V.value,{id:C.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:g.value,disabled:u.value,readonly:h.value,value:W.value?v.value:oe.value||v.value,onFocus:ae[0]||(ae[0]=()=>{W.value||J()}),onClick:ae[1]||(ae[1]=()=>{W.value||J()}),onInput:ye,onKeydown:ke,onBlur:ae[2]||(ae[2]=()=>se(w.value))}),null,16,af),N.value?(n.openBlock(),n.createElementBlock("svg",rf,[...ae[7]||(ae[7]=[n.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),n.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):No.value?(n.openBlock(),n.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:ae[3]||(ae[3]=n.withModifiers(()=>{},["prevent"])),onClick:n.withModifiers(ie,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(n.openBlock(),n.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:ae[4]||(ae[4]=pe=>W.value?O():J()),"aria-label":"Toggle"},[n.createVNode(n.unref(te.ChevronDown),{class:n.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":W.value}])},null,8,["class"])],8,sf))],2),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[W.value?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"floating",ref:R,style:n.normalizeStyle(n.unref(P)),class:"z-[50] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-gray-700 dark:bg-neutral-900"},[n.createElementVNode("div",lf,[he.value.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(he.value,(pe,Oe)=>(n.openBlock(),n.createElementBlock("button",{key:X(pe)??Oe,type:"button",class:n.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",Oe===z.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:Ae=>z.value=Oe,onMousedown:ae[5]||(ae[5]=n.withModifiers(()=>{},["prevent"])),onClick:Ae=>j(pe)},[n.createTextVNode(n.toDisplayString(K(pe))+" ",1),Te(pe)?(n.openBlock(),n.createElementBlock("span",df," ✓ ")):n.createCommentVNode("",!0)],42,cf))),128)):n.renderSlot(q.$slots,"no-data",{key:1},()=>[n.createElementVNode("div",uf,[N.value?(n.openBlock(),n.createElementBlock("span",ff,"Loading data…")):G.value?(n.openBlock(),n.createElementBlock("span",hf,n.toDisplayString(G.value),1)):(n.openBlock(),n.createElementBlock("span",mf,"No data available"))])])])],4)):n.createCommentVNode("",!0)]))]),H.value||b.value?(n.openBlock(),n.createElementBlock("p",pf,n.toDisplayString(H.value||b.value),1)):n.createCommentVNode("",!0)],64))],10,Qu)),[[n.vShow,e.visible]])}}),gf=["aria-busy"],bf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},yf=["for"],xf={key:0,class:"ml-1 text-destructive"},kf={class:"relative"},wf={key:0,class:"flex items-center text-gray-500 gap-2"},Cf=["id","placeholder","disabled","value"],_f={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},Bf=["disabled"],Ef={key:0,class:"p-3 space-y-2"},Sf=["onMouseenter","onClick"],Af={class:"flex items-center space-x-3"},Vf={class:"flex-1"},Df={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Mf={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},Nf={key:0},Pf={key:2,class:"p-3 text-center"},vf={class:"inline-flex items-center space-x-2"},Tf={class:"text-sm text-gray-500"},Of={key:3,class:"p-3 text-center"},zf={class:"text-xs text-gray-400"},Ff={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},If={key:1,class:"mt-1 text-xs text-red-600"},Rf={key:2,class:"mt-1 text-xs text-gray-500"},ri=n.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(e,{emit:t}){const o=e,a=t,r=n.useAttrs(),s=n.ref(),i=n.ref(),l=n.ref(),c=n.ref(),d=n.ref(),u=n.computed(()=>{const z=o.label||o.placeholder;return z?`app-infinite-autocomplete-${z}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=n.ref(""),h=n.ref([]),m=n.ref(!1),p=n.ref(!1),b=n.ref(-1),g=n.ref(1),x=n.ref(!0),_=n.ref(0),C=n.ref(),{floatingStyles:w}=hr(c,d,{placement:"bottom-start",whileElementsMounted:lr,middleware:[cr(4),ur(),dr(),fr({apply({rects:z,elements:H}){Object.assign(H.floating.style,{width:`${z.reference.width}px`})}})]});n.computed(()=>({"opacity-50 pointer-events-none":o.disabled,relative:!0}));const E=n.computed(()=>f.value?h.value.filter(z=>A(z).toLowerCase().includes(f.value.toLowerCase())):h.value),B=n.computed(()=>{if(p.value&&f.value)return f.value;if(o.modelValue){if(o.returnObject)return A(o.modelValue);{const z=h.value.find(H=>D(H)===o.modelValue);return z?A(z):String(o.modelValue)}}return""}),k=()=>{p.value=!0},y=()=>{p.value=!1},A=z=>typeof o.itemTitle=="function"?o.itemTitle(z):z[o.itemTitle]||"",D=z=>typeof o.itemValue=="function"?o.itemValue(z):z[o.itemValue]||z,N=z=>o.itemSubtitle?typeof o.itemSubtitle=="function"?o.itemSubtitle(z):z[o.itemSubtitle]||"":"",V=z=>o.modelValue?o.returnObject?D(z)===D(o.modelValue):D(z)===o.modelValue:!1,M=z=>{var G;const H=o.returnObject?z:D(z);a("update:modelValue",H),a("select",z),p.value=!1,f.value="",(G=s.value)==null||G.blur()},T=()=>{var z;a("update:modelValue",null),f.value="",(z=s.value)==null||z.focus()},U=z=>{p.value=!0,a("focus",z),o.autoFetchOnOpen&&!m.value&&(o.refreshOnOpen||h.value.length===0)&&v(!0)},L=z=>{setTimeout(()=>{p.value=!1,a("blur",z)},200)},R=z=>{const H=z.target;f.value=H.value,C.value&&clearTimeout(C.value),C.value=setTimeout(()=>{a("search",f.value),g.value=1,x.value=!0,v(!0)},o.debounceMs)},P=z=>{if(p.value)switch(z.key){case"ArrowDown":z.preventDefault(),b.value=Math.min(b.value+1,E.value.length-1);break;case"ArrowUp":z.preventDefault(),b.value=Math.max(b.value-1,0);break;case"Enter":z.preventDefault(),b.value>=0&&E.value[b.value]&&M(E.value[b.value]);break;case"Escape":p.value=!1;break}},W=z=>{if(!x.value||m.value)return;const H=z.target,{scrollTop:G,scrollHeight:K,clientHeight:X}=H;G+X>=K-o.threshold&&v()},v=async(z=!1)=>{var H,G;if(!m.value){m.value=!0;try{let K=[];if(o.fetchItems)K=await o.fetchItems();else{const X=Je(),oe=((H=o.endpoint)==null?void 0:H.apiModule)||o.apiModule,he=((G=o.endpoint)==null?void 0:G.apiAction)||o.apiAction;if(!oe||!he)throw new Error("API module and action are required");const ge={page:z?1:g.value,pageSize:o.pageSize,search:f.value,...o.apiParams},se=await X.apiUrl(`/${oe}/${he}`,"GET",ge);K=se.data||se.items||se||[],_.value=se.total||se.totalItems||K.length}z?(h.value=K,g.value=1):(h.value.push(...K),g.value++),x.value=K.length>=o.pageSize,x.value||a("end-of-results"),a("load-more",{items:K,page:g.value,hasMore:x.value,total:_.value})}catch(K){console.error("Error fetching items:",K),a("error",K)}finally{m.value=!1}}};return n.onMounted(()=>{o.autoFetchOnMount&&v()}),n.onUnmounted(()=>{C.value&&clearTimeout(C.value)}),n.watch(()=>o.modelValue,z=>{z||(f.value="")}),(z,H)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{ref_key:"rootEl",ref:l,class:n.normalizeClass(["w-full",n.unref(r).class]),"aria-busy":e.skeleton},[e.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.label?(n.openBlock(),n.createElementBlock("div",bf)):n.createCommentVNode("",!0),H[3]||(H[3]=n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[e.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:u.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",xf,"*")):n.createCommentVNode("",!0)],8,yf)):n.createCommentVNode("",!0),n.createElementVNode("div",kf,[n.createElementVNode("div",{ref_key:"reference",ref:c,class:n.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[e.disabled?"opacity-60 cursor-not-allowed":"",e.error?"border-red-500 focus-within:ring-red-500":""]])},[o.icon?(n.openBlock(),n.createElementBlock("div",wf,[o.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("input",n.mergeProps({ref_key:"inputRef",ref:s},z.$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",e.disabled?"cursor-not-allowed":"cursor-text"],placeholder:e.placeholder,disabled:e.disabled,value:B.value,onFocus:U,onBlur:L,onInput:R,onKeydown:P}),null,16,Cf),m.value?(n.openBlock(),n.createElementBlock("svg",_f,[...H[4]||(H[4]=[n.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),n.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):e.clearable&&e.modelValue?(n.openBlock(),n.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:H[0]||(H[0]=n.withModifiers(()=>{},["prevent"])),onClick:n.withModifiers(T,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(n.openBlock(),n.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:e.disabled,onClick:H[1]||(H[1]=G=>p.value?y():k()),"aria-label":"Toggle"},[n.createVNode(n.unref(te.ChevronDown),{class:n.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":p.value}])},null,8,["class"])],8,Bf))],2),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[p.value?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:n.normalizeStyle(n.unref(w)),class:"z-[9999] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-gray-700 dark:bg-neutral-900"},[n.createElementVNode("div",{ref_key:"scrollContainer",ref:i,class:"max-h-64 overflow-auto",onScroll:W},[m.value&&h.value.length===0?(n.openBlock(),n.createElementBlock("div",Ef,[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(5,G=>n.createElementVNode("div",{key:G,class:"flex items-center space-x-3"},[...H[5]||(H[5]=[n.createElementVNode("div",{class:"skeleton h-4 w-4 bg-gray-200 rounded"},null,-1),n.createElementVNode("div",{class:"skeleton h-4 flex-1 bg-gray-200 rounded"},null,-1)])])),64))])):E.value.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(E.value,(G,K)=>(n.openBlock(),n.createElementBlock("button",{key:D(G)??K,type:"button",class:n.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",K===b.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:X=>b.value=K,onMousedown:H[2]||(H[2]=n.withModifiers(()=>{},["prevent"])),onClick:X=>M(G)},[n.renderSlot(z.$slots,"item",{item:G,index:K},()=>[n.createElementVNode("div",Af,[n.createElementVNode("div",Vf,[n.createElementVNode("div",Df,n.toDisplayString(A(G)),1),e.itemSubtitle?(n.openBlock(),n.createElementBlock("div",Mf,n.toDisplayString(N(G)),1)):n.createCommentVNode("",!0)])])]),V(G)?(n.openBlock(),n.createElementBlock("span",Nf," ✓ ")):n.createCommentVNode("",!0)],42,Sf))),128)):n.createCommentVNode("",!0),m.value&&h.value.length>0?(n.openBlock(),n.createElementBlock("div",Pf,[n.createElementVNode("div",vf,[H[6]||(H[6]=n.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),n.createElementVNode("span",Tf,n.toDisplayString(e.loadingText),1)])])):n.createCommentVNode("",!0),!x.value&&h.value.length>0?(n.openBlock(),n.createElementBlock("div",Of,[n.createElementVNode("div",zf,n.toDisplayString(e.endOfResultsText),1)])):!m.value&&h.value.length===0?(n.openBlock(),n.createElementBlock("div",Ff,n.toDisplayString(e.noResultsText),1)):n.createCommentVNode("",!0)],544)],4)):n.createCommentVNode("",!0)]))]),e.error?(n.openBlock(),n.createElementBlock("p",If,n.toDisplayString(e.errorMessage||e.error),1)):e.helperText?(n.openBlock(),n.createElementBlock("p",Rf,n.toDisplayString(e.helperText),1)):n.createCommentVNode("",!0)],64))],10,gf)),[[n.vShow,e.visible]])}});function si(e){var t,o,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(o=si(e[t]))&&(a&&(a+=" "),a+=o)}else for(o in e)e[o]&&(a&&(a+=" "),a+=o);return a}function ii(){for(var e,t,o=0,a="",r=arguments.length;o<r;o++)(e=arguments[o])&&(t=si(e))&&(a&&(a+=" "),a+=t);return a}const Lf=(e,t)=>{const o=new Array(e.length+t.length);for(let a=0;a<e.length;a++)o[a]=e[a];for(let a=0;a<t.length;a++)o[e.length+a]=t[a];return o},$f=(e,t)=>({classGroupId:e,validator:t}),li=(e=new Map,t=null,o)=>({nextPart:e,validators:t,classGroupId:o}),$o="-",ci=[],Wf="arbitrary..",jf=e=>{const t=Hf(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Uf(i);const l=i.split($o),c=l[0]===""&&l.length>1?1:0;return di(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=a[i],d=o[i];return c?d?Lf(d,c):c:d||ci}return o[i]||ci}}},di=(e,t,o)=>{if(e.length-t===0)return o.classGroupId;const r=e[t],s=o.nextPart.get(r);if(s){const d=di(e,t+1,s);if(d)return d}const i=o.validators;if(i===null)return;const l=t===0?e.join($o):e.slice(t).join($o),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},Uf=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),o=t.indexOf(":"),a=t.slice(0,o);return a?Wf+a:void 0})(),Hf=e=>{const{theme:t,classGroups:o}=e;return qf(o,t)},qf=(e,t)=>{const o=li();for(const a in e){const r=e[a];mr(r,o,a,t)}return o},mr=(e,t,o,a)=>{const r=e.length;for(let s=0;s<r;s++){const i=e[s];Gf(i,t,o,a)}},Gf=(e,t,o,a)=>{if(typeof e=="string"){Xf(e,t,o);return}if(typeof e=="function"){Yf(e,t,o,a);return}Kf(e,t,o,a)},Xf=(e,t,o)=>{const a=e===""?t:ui(t,e);a.classGroupId=o},Yf=(e,t,o,a)=>{if(Jf(e)){mr(e(a),t,o,a);return}t.validators===null&&(t.validators=[]),t.validators.push($f(o,e))},Kf=(e,t,o,a)=>{const r=Object.entries(e),s=r.length;for(let i=0;i<s;i++){const[l,c]=r[i];mr(c,ui(t,l),o,a)}},ui=(e,t)=>{let o=e;const a=t.split($o),r=a.length;for(let s=0;s<r;s++){const i=a[s];let l=o.nextPart.get(i);l||(l=li(),o.nextPart.set(i,l)),o=l}return o},Jf=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Qf=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=Object.create(null),a=Object.create(null);const r=(s,i)=>{o[s]=i,t++,t>e&&(t=0,a=o,o=Object.create(null))};return{get(s){let i=o[s];if(i!==void 0)return i;if((i=a[s])!==void 0)return r(s,i),i},set(s,i){s in o?o[s]=i:r(s,i)}}},pr="!",fi=":",Zf=[],hi=(e,t,o,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:o,maybePostfixModifierPosition:a,isExternal:r}),eh=e=>{const{prefix:t,experimentalParseClassName:o}=e;let a=r=>{const s=[];let i=0,l=0,c=0,d;const u=r.length;for(let b=0;b<u;b++){const g=r[b];if(i===0&&l===0){if(g===fi){s.push(r.slice(c,b)),c=b+1;continue}if(g==="/"){d=b;continue}}g==="["?i++:g==="]"?i--:g==="("?l++:g===")"&&l--}const f=s.length===0?r:r.slice(c);let h=f,m=!1;f.endsWith(pr)?(h=f.slice(0,-1),m=!0):f.startsWith(pr)&&(h=f.slice(1),m=!0);const p=d&&d>c?d-c:void 0;return hi(s,m,h,p)};if(t){const r=t+fi,s=a;a=i=>i.startsWith(r)?s(i.slice(r.length)):hi(Zf,!1,i,void 0,!0)}if(o){const r=a;a=s=>o({className:s,parseClassName:r})}return a},th=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((o,a)=>{t.set(o,1e6+a)}),o=>{const a=[];let r=[];for(let s=0;s<o.length;s++){const i=o[s],l=i[0]==="[",c=t.has(i);l||c?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(i)):r.push(i)}return r.length>0&&(r.sort(),a.push(...r)),a}},nh=e=>({cache:Qf(e.cacheSize),parseClassName:eh(e),sortModifiers:th(e),...jf(e)}),oh=/\s+/,ah=(e,t)=>{const{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:s}=t,i=[],l=e.trim().split(oh);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:h,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:b}=o(u);if(f){c=u+(c.length>0?" "+c:c);continue}let g=!!b,x=a(g?p.substring(0,b):p);if(!x){if(!g){c=u+(c.length>0?" "+c:c);continue}if(x=a(p),!x){c=u+(c.length>0?" "+c:c);continue}g=!1}const _=h.length===0?"":h.length===1?h[0]:s(h).join(":"),C=m?_+pr:_,w=C+x;if(i.indexOf(w)>-1)continue;i.push(w);const E=r(x,g);for(let B=0;B<E.length;++B){const k=E[B];i.push(C+k)}c=u+(c.length>0?" "+c:c)}return c},rh=(...e)=>{let t=0,o,a,r="";for(;t<e.length;)(o=e[t++])&&(a=mi(o))&&(r&&(r+=" "),r+=a);return r},mi=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=mi(e[a]))&&(o&&(o+=" "),o+=t);return o},sh=(e,...t)=>{let o,a,r,s;const i=c=>{const d=t.reduce((u,f)=>f(u),e());return o=nh(d),a=o.cache.get,r=o.cache.set,s=l,l(c)},l=c=>{const d=a(c);if(d)return d;const u=ah(c,o);return r(c,u),u};return s=i,(...c)=>s(rh(...c))},ih=[],qe=e=>{const t=o=>o[e]||ih;return t.isThemeGetter=!0,t},pi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,gi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,lh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ch=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dh=/\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$/,uh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xt=e=>lh.test(e),Ce=e=>!!e&&!Number.isNaN(Number(e)),Yt=e=>!!e&&Number.isInteger(Number(e)),gr=e=>e.endsWith("%")&&Ce(e.slice(0,-1)),Ot=e=>ch.test(e),bi=()=>!0,mh=e=>dh.test(e)&&!uh.test(e),br=()=>!1,ph=e=>fh.test(e),gh=e=>hh.test(e),bh=e=>!de(e)&&!ue(e),yh=e=>Kt(e,_i,br),de=e=>pi.test(e),fn=e=>Kt(e,Bi,mh),yi=e=>Kt(e,Sh,Ce),xh=e=>Kt(e,Si,bi),kh=e=>Kt(e,Ei,br),xi=e=>Kt(e,wi,br),wh=e=>Kt(e,Ci,gh),Wo=e=>Kt(e,Ai,ph),ue=e=>gi.test(e),eo=e=>hn(e,Bi),Ch=e=>hn(e,Ei),ki=e=>hn(e,wi),_h=e=>hn(e,_i),Bh=e=>hn(e,Ci),jo=e=>hn(e,Ai,!0),Eh=e=>hn(e,Si,!0),Kt=(e,t,o)=>{const a=pi.exec(e);return a?a[1]?t(a[1]):o(a[2]):!1},hn=(e,t,o=!1)=>{const a=gi.exec(e);return a?a[1]?t(a[1]):o:!1},wi=e=>e==="position"||e==="percentage",Ci=e=>e==="image"||e==="url",_i=e=>e==="length"||e==="size"||e==="bg-size",Bi=e=>e==="length",Sh=e=>e==="number",Ei=e=>e==="family-name",Si=e=>e==="number"||e==="weight",Ai=e=>e==="shadow",Ah=sh(()=>{const e=qe("color"),t=qe("font"),o=qe("text"),a=qe("font-weight"),r=qe("tracking"),s=qe("leading"),i=qe("breakpoint"),l=qe("container"),c=qe("spacing"),d=qe("radius"),u=qe("shadow"),f=qe("inset-shadow"),h=qe("text-shadow"),m=qe("drop-shadow"),p=qe("blur"),b=qe("perspective"),g=qe("aspect"),x=qe("ease"),_=qe("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...w(),ue,de],B=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],y=()=>[ue,de,c],A=()=>[Xt,"full","auto",...y()],D=()=>[Yt,"none","subgrid",ue,de],N=()=>["auto",{span:["full",Yt,ue,de]},Yt,ue,de],V=()=>[Yt,"auto",ue,de],M=()=>["auto","min","max","fr",ue,de],T=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...y()],R=()=>[Xt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...y()],P=()=>[Xt,"screen","full","dvw","lvw","svw","min","max","fit",...y()],W=()=>[Xt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...y()],v=()=>[e,ue,de],z=()=>[...w(),ki,xi,{position:[ue,de]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",_h,yh,{size:[ue,de]}],K=()=>[gr,eo,fn],X=()=>["","none","full",d,ue,de],oe=()=>["",Ce,eo,fn],he=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[Ce,gr,ki,xi],J=()=>["","none",p,ue,de],O=()=>["none",Ce,ue,de],j=()=>["none",Ce,ue,de],Y=()=>[Ce,ue,de],ie=()=>[Xt,"full",...y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ot],breakpoint:[Ot],color:[bi],container:[Ot],"drop-shadow":[Ot],ease:["in","out","in-out"],font:[bh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ot],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ot],shadow:[Ot],spacing:["px",Ce],text:[Ot],"text-shadow":[Ot],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xt,de,ue,g]}],container:["container"],columns:[{columns:[Ce,de,ue,l]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:E()}],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:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[Yt,"auto",ue,de]}],basis:[{basis:[Xt,"full","auto",l,...y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ce,Xt,"auto","initial","none",de]}],grow:[{grow:["",Ce,ue,de]}],shrink:[{shrink:["",Ce,ue,de]}],order:[{order:[Yt,"first","last","none",ue,de]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:y()}],"gap-x":[{"gap-x":y()}],"gap-y":[{"gap-y":y()}],"justify-content":[{justify:[...T(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...T()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":T()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],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:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":y()}],"space-y-reverse":["space-y-reverse"],size:[{size:R()}],"inline-size":[{inline:["auto",...P()]}],"min-inline-size":[{"min-inline":["auto",...P()]}],"max-inline-size":[{"max-inline":["none",...P()]}],"block-size":[{block:["auto",...W()]}],"min-block-size":[{"min-block":["auto",...W()]}],"max-block-size":[{"max-block":["none",...W()]}],w:[{w:[l,"screen",...R()]}],"min-w":[{"min-w":[l,"screen","none",...R()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...R()]}],h:[{h:["screen","lh",...R()]}],"min-h":[{"min-h":["screen","lh","none",...R()]}],"max-h":[{"max-h":["screen","lh",...R()]}],"font-size":[{text:["base",o,eo,fn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Eh,xh]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gr,de]}],"font-family":[{font:[Ch,kh,t]}],"font-features":[{"font-features":[de]}],"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:[r,ue,de]}],"line-clamp":[{"line-clamp":[Ce,"none",ue,yi]}],leading:[{leading:[s,...y()]}],"list-image":[{"list-image":["none",ue,de]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ue,de]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:v()}],"text-color":[{text:v()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ce,"from-font","auto",ue,fn]}],"text-decoration-color":[{decoration:v()}],"underline-offset":[{"underline-offset":[Ce,"auto",ue,de]}],"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",ue,de]}],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",ue,de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Yt,ue,de],radial:["",ue,de],conic:[Yt,ue,de]},Bh,wh]}],"bg-color":[{bg:v()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:v()}],"gradient-via":[{via:v()}],"gradient-to":[{to:v()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:v()}],"border-color-x":[{"border-x":v()}],"border-color-y":[{"border-y":v()}],"border-color-s":[{"border-s":v()}],"border-color-e":[{"border-e":v()}],"border-color-bs":[{"border-bs":v()}],"border-color-be":[{"border-be":v()}],"border-color-t":[{"border-t":v()}],"border-color-r":[{"border-r":v()}],"border-color-b":[{"border-b":v()}],"border-color-l":[{"border-l":v()}],"divide-color":[{divide:v()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ce,ue,de]}],"outline-w":[{outline:["",Ce,eo,fn]}],"outline-color":[{outline:v()}],shadow:[{shadow:["","none",u,jo,Wo]}],"shadow-color":[{shadow:v()}],"inset-shadow":[{"inset-shadow":["none",f,jo,Wo]}],"inset-shadow-color":[{"inset-shadow":v()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:v()}],"ring-offset-w":[{"ring-offset":[Ce,fn]}],"ring-offset-color":[{"ring-offset":v()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":v()}],"text-shadow":[{"text-shadow":["none",h,jo,Wo]}],"text-shadow-color":[{"text-shadow":v()}],opacity:[{opacity:[Ce,ue,de]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"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":[Ce]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":v()}],"mask-image-linear-to-color":[{"mask-linear-to":v()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":v()}],"mask-image-t-to-color":[{"mask-t-to":v()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":v()}],"mask-image-r-to-color":[{"mask-r-to":v()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":v()}],"mask-image-b-to-color":[{"mask-b-to":v()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":v()}],"mask-image-l-to-color":[{"mask-l-to":v()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":v()}],"mask-image-x-to-color":[{"mask-x-to":v()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":v()}],"mask-image-y-to-color":[{"mask-y-to":v()}],"mask-image-radial":[{"mask-radial":[ue,de]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":v()}],"mask-image-radial-to-color":[{"mask-radial-to":v()}],"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":w()}],"mask-image-conic-pos":[{"mask-conic":[Ce]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":v()}],"mask-image-conic-to-color":[{"mask-conic-to":v()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ue,de]}],filter:[{filter:["","none",ue,de]}],blur:[{blur:J()}],brightness:[{brightness:[Ce,ue,de]}],contrast:[{contrast:[Ce,ue,de]}],"drop-shadow":[{"drop-shadow":["","none",m,jo,Wo]}],"drop-shadow-color":[{"drop-shadow":v()}],grayscale:[{grayscale:["",Ce,ue,de]}],"hue-rotate":[{"hue-rotate":[Ce,ue,de]}],invert:[{invert:["",Ce,ue,de]}],saturate:[{saturate:[Ce,ue,de]}],sepia:[{sepia:["",Ce,ue,de]}],"backdrop-filter":[{"backdrop-filter":["","none",ue,de]}],"backdrop-blur":[{"backdrop-blur":J()}],"backdrop-brightness":[{"backdrop-brightness":[Ce,ue,de]}],"backdrop-contrast":[{"backdrop-contrast":[Ce,ue,de]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ce,ue,de]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ce,ue,de]}],"backdrop-invert":[{"backdrop-invert":["",Ce,ue,de]}],"backdrop-opacity":[{"backdrop-opacity":[Ce,ue,de]}],"backdrop-saturate":[{"backdrop-saturate":[Ce,ue,de]}],"backdrop-sepia":[{"backdrop-sepia":["",Ce,ue,de]}],"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",ue,de]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ce,"initial",ue,de]}],ease:[{ease:["linear","initial",x,ue,de]}],delay:[{delay:[Ce,ue,de]}],animate:[{animate:["none",_,ue,de]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ue,de]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:O()}],"rotate-x":[{"rotate-x":O()}],"rotate-y":[{"rotate-y":O()}],"rotate-z":[{"rotate-z":O()}],scale:[{scale:j()}],"scale-x":[{"scale-x":j()}],"scale-y":[{"scale-y":j()}],"scale-z":[{"scale-z":j()}],"scale-3d":["scale-3d"],skew:[{skew:Y()}],"skew-x":[{"skew-x":Y()}],"skew-y":[{"skew-y":Y()}],transform:[{transform:[ue,de,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ie()}],"translate-x":[{"translate-x":ie()}],"translate-y":[{"translate-y":ie()}],"translate-z":[{"translate-z":ie()}],"translate-none":["translate-none"],accent:[{accent:v()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:v()}],"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",ue,de]}],"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",ue,de]}],fill:[{fill:["none",...v()]}],"stroke-w":[{stroke:[Ce,eo,fn,yi]}],stroke:[{stroke:["none",...v()]}],"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 _e(...e){return Ah(ii(e))}function Vh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yr={},xr={},Uo={exports:{}},Vi;function Dh(){if(Vi)return Uo.exports;Vi=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return Uo.exports=t(),Uo.exports.createColors=t,Uo.exports}var Di;function Mh(){return Di||(Di=1,(function(e){var t={};Object.defineProperty(e,"__esModule",{value:!0});function o(d,u){for(var f in u)Object.defineProperty(d,f,{enumerable:!0,get:u[f]})}o(e,{dim:function(){return l},default:function(){return c}});const a=r(Dh());function r(d){return d&&d.__esModule?d:{default:d}}let s=new Set;function i(d,u,f){typeof process<"u"&&t.JEST_WORKER_ID||f&&s.has(f)||(f&&s.add(f),console.warn(""),u.forEach(h=>console.warn(d,"-",h)))}function l(d){return a.default.dim(d)}const c={info(d,u){i(a.default.bold(a.default.cyan("info")),...Array.isArray(d)?[d]:[u,d])},warn(d,u){i(a.default.bold(a.default.yellow("warn")),...Array.isArray(d)?[d]:[u,d])},risk(d,u){i(a.default.bold(a.default.magenta("risk")),...Array.isArray(d)?[d]:[u,d])}}})(xr)),xr}var Mi;function Nh(){return Mi||(Mi=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});const t=o(Mh());function o(s){return s&&s.__esModule?s:{default:s}}function a({version:s,from:i,to:l}){t.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 r={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 a({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return a({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return a({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return a({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return a({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(yr)),yr}var kr,Ni;function Ph(){if(Ni)return kr;Ni=1;let e=Nh();return kr=(e.__esModule?e:{default:e}).default,kr}var vh=Ph();const Th=Vh(vh),Pi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,vi=ii,to=(e,t)=>o=>{var a;if((t==null?void 0:t.variants)==null)return vi(e,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:r,defaultVariants:s}=t,i=Object.keys(r).map(d=>{const u=o==null?void 0:o[d],f=s==null?void 0:s[d];if(u===null)return null;const h=Pi(u)||Pi(f);return r[d][h]}),l=o&&Object.entries(o).reduce((d,u)=>{let[f,h]=u;return h===void 0||(d[f]=h),d},{}),c=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((d,u)=>{let{class:f,className:h,...m}=u;return Object.entries(m).every(p=>{let[b,g]=p;return Array.isArray(g)?g.includes({...s,...l}[b]):{...s,...l}[b]===g})?[...d,f,h]:d},[]);return vi(e,i,c,o==null?void 0:o.class,o==null?void 0:o.className)},ut=n.defineComponent({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ce.Primitive),{as:e.as,"as-child":e.asChild,class:n.normalizeClass(n.unref(_e)(n.unref(Nn)({variant:e.variant,size:e.size}),t.class))},{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),Nn=to("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"}}),Ti=n.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(e,{emit:t}){const o=e,a=t,r=ce.useForwardPropsEmits(o,a);return(s,i)=>(n.openBlock(),n.createBlock(n.unref(ce.TooltipRoot),n.normalizeProps(n.guardReactiveProps(n.unref(r))),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16))}}),Oi=n.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(e,{emit:t}){const o=e,a=t,r=Fe.reactiveOmit(o,"class"),s=ce.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(ce.TooltipPortal),null,{default:n.withCtx(()=>[n.createVNode(n.unref(ce.TooltipContent),n.mergeProps({...n.unref(s),...i.$attrs},{class:n.unref(_e)("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:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),zi=n.defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ce.TooltipProvider),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),Fi=n.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ce.TooltipTrigger),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),Oh={class:"relative z-10"},zh="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] shadow-[0_3px_0_0_rgba(0,0,0,0.12),0_12px_22px_-10px_rgba(0,0,0,0.35)] hover:shadow-[0_6px_20px_-4px_rgba(0,0,0,0.3),0_10px_40px_-10px_rgba(0,0,0,0.2)] active:shadow-[0_1px_0_0_rgba(0,0,0,0.2),0_4px_8px_-4px_rgba(0,0,0,0.35)] 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",Fh=n.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(e){const t=n.useAttrs(),o=e,a=n.computed(()=>o.icon&&Ct[o.icon]||null),r=n.computed(()=>!!o.tooltip),s=n.computed(()=>o.visible??!0),i=n.computed(()=>{const G=String(o.variant||"default").toLowerCase();return G==="tonal"?"secondary":G==="elevated"?"default":G}),l=n.computed(()=>String(o.bgColor||"").toLowerCase()),c=n.computed(()=>String(o.type||"button").toLowerCase()),d=n.computed(()=>{const{class:G,...K}=t;return K}),u=n.computed(()=>_e(t.class)),f=n.computed(()=>((u.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),h=n.computed(()=>o.size==="sm"?"h-9":o.size==="lg"?"h-11":o.size==="icon"?"h-10 w-10":"h-10"),m=n.computed(()=>o.size==="icon"?"":!o.text&&o.icon?"w-10":"w-28"),p=n.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=n.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"),g=n.computed(()=>_e("inline-flex items-center justify-center bg-gray-200 dark:bg-gray-700 animate-pulse",p.value,h.value,m.value,f.value)),x=n.computed(()=>{const K=(u.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return K?K[0]:null}),_=n.computed(()=>{const K=(u.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return K?K[0]:null}),C=n.computed(()=>!!x.value),w=n.computed(()=>/\bborder-/.test(u.value??"")),E=n.computed(()=>/\bhover:/.test(u.value??"")),B=n.computed(()=>{const G=u.value??"";return i.value!=="outline"?G:G.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),k=n.ref(null),y=G=>{const K=G.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},A=(G,K)=>{const X=y(G);if(!X)return G;const oe=he=>Math.max(0,Math.min(255,Math.round(he)));return`rgba(${oe(X.r*(1-K))}, ${oe(X.g*(1-K))}, ${oe(X.b*(1-K))}, ${X.a})`},D=G=>{if(globalThis.window===void 0)return null;const K=document.createElement("div");K.className=G,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 X=globalThis.getComputedStyle(K).backgroundColor;return K.remove(),!X||X==="transparent"||X==="rgba(0, 0, 0, 0)"?null:X},N=[50,100,200,300,400,500,600,700,800,900,950],V=G=>{const K=N.indexOf(G);return K===-1?G:N[Math.min(N.length-1,K+2)]},M=(G,K)=>{const X=Th[G];if(!X)return null;if(typeof X=="string")return X;if(!K)return null;const oe=X[K];return typeof oe=="string"?oe:null},T=(G,K=!1)=>{if(!G)return null;const X=K?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,oe=G.match(X);return oe?{colorName:oe[1],shade:oe[2]?Number.parseInt(oe[2],10):null}:null},U=()=>{const G=x.value;if(!G){k.value=null;return}const K=T(G),X=K==null?void 0:K.colorName,oe=(K==null?void 0:K.shade)??null,he=(X?M(X,oe):null)??D(G);if(!he){k.value=null;return}let ge;const se=T(_.value,!0),J=se?M(se.colorName,se.shade??null):null;if(J)ge=J;else if(X&&oe){const O=V(oe);ge=M(X,O)??A(he,.2)}else ge=A(he,.2);k.value={"--btn-color":he,"--btn-color-hover":ge}};n.onMounted(()=>{U()}),n.watch([x,_],async()=>{await n.nextTick(),U()});const L=n.computed(()=>{const G=/\bdark:bg-/.test(u.value??"");return!C.value||i.value==="outline"||G?"":k.value?"dcode-btn--fill dcode-btn--fill-hover":E.value?"":"hover:brightness-90"}),R=n.computed(()=>{if(!C.value||i.value!=="outline")return"";const G=["dcode-btn--outline","dcode-btn--outline-hover"];return w.value||G.push("border"),!k.value&&!E.value&&G.push("hover:brightness-90"),G.join(" ")}),P=n.computed(()=>k.value??void 0),W={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"}},v={"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"}},z=n.computed(()=>{const G=[],K=l.value,X=String(o.borderColor||"").toLowerCase(),oe=K?W[K]:null,he=K?v[K]:null,ge=X?W[X]:null;return K&&(oe?ge&&X!==K?(G.push(oe.bg,ge.hoverBg),o.textColor||G.push(oe.text,ge.hoverText)):(G.push(oe.bg,oe.hoverBg),o.textColor||G.push(oe.text,oe.hoverText)):he?(G.push(he.bg,he.hover),o.textColor||G.push(he.text)):K==="transparent"?ge?(G.push("bg-transparent",ge.hoverBg),o.textColor||G.push("text-inherit",ge.hoverText)):G.push("bg-transparent hover:bg-black/5 dark:hover:bg-white/5"):G.push(K)),X?ge?G.push(ge.border,ge.hoverBorder):G.push(X):oe&&i.value!=="ghost"&&i.value!=="link"&&G.push(oe.border,oe.hoverBorder),o.textColor&&G.push(o.textColor),G.join(" ")}),H=n.computed(()=>_e(zh,p.value,b.value,B.value,L.value,R.value,z.value));return(G,K)=>s.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.skeleton?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(g.value),"aria-hidden":"true"},null,2)):(n.openBlock(),n.createBlock(n.unref(zi),{key:1,"delay-duration":0},{default:n.withCtx(()=>[r.value?(n.openBlock(),n.createBlock(n.unref(Ti),{key:0},{default:n.withCtx(()=>[n.createVNode(n.unref(Fi),{"as-child":""},{default:n.withCtx(()=>[n.createVNode(n.unref(ut),n.mergeProps({variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:H.value,style:P.value},d.value),{default:n.withCtx(()=>[a.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(a.value),{key:0,class:"h-[18px] w-[18px]"})):n.createCommentVNode("",!0),o.text?(n.openBlock(),n.createElementBlock("span",{key:1,class:n.normalizeClass(a.value?"ml-1":"")},n.toDisplayString(o.text),3)):n.createCommentVNode("",!0)]),_:1},16,["variant","size","disabled","type","class","style"])]),_:1}),n.createVNode(n.unref(Oi),{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:n.withCtx(()=>[n.createElementVNode("span",Oh,n.toDisplayString(o.tooltip),1)]),_:1})]),_:1})):(n.openBlock(),n.createBlock(n.unref(ut),n.mergeProps({key:1,variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:H.value,style:P.value},d.value),{default:n.withCtx(()=>[n.renderSlot(G.$slots,"default",{},()=>[a.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(a.value),{key:0,class:"h-[18px] w-[18px]"})):n.createCommentVNode("",!0),o.text?(n.openBlock(),n.createElementBlock("span",{key:1,class:n.normalizeClass(a.value?"ml-1":"")},n.toDisplayString(o.text),3)):n.createCommentVNode("",!0)],!0)]),_:3},16,["variant","size","disabled","type","class","style"]))]),_:3}))],64)):n.createCommentVNode("",!0)}}),xt=(e,t)=>{const o=e.__vccOpts||e;for(const[a,r]of t)o[a]=r;return o},Ge=xt(Fh,[["__scopeId","data-v-d4cd902d"]]),Ih={key:0,class:"flex items-center justify-between mb-4"},Rh={class:"flex flex-col gap-1"},Lh={key:0,class:"text-lg font-semibold text-neutral-900 dark:text-neutral-50 leading-tight"},$h={key:1,class:"text-sm text-neutral-500 dark:text-neutral-400"},Wh={key:0,class:"flex items-center gap-2"},jh={class:"relative z-10"},Uh={key:1,class:"mt-6 pt-6 border-t border-neutral-200 dark:border-neutral-800"},Hh={name:"DCodeCard"},Ii=n.defineComponent({...Hh,props:{level:{default:1},title:{},subtitle:{},shadow:{type:Boolean,default:!1},border:{type:Boolean,default:!0},padding:{default:"p-6"}},setup(e){const t=e,o=n.computed(()=>{switch(t.level){case 2:return"bg-neutral-50 dark:bg-neutral-800";case 3:return"bg-neutral-100 dark:bg-neutral-700";case 1:default:return"bg-white dark:bg-neutral-900"}});return(a,r)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["transition-shadow duration-300 dcode-card",[o.value,e.padding,{"shadow-md":e.shadow},{"border-transparent":!e.border},{"border-neutral-200 dark:border-neutral-800":e.border&&e.level===1},{"border-neutral-300 dark:border-neutral-700":e.border&&e.level!==1}]])},[e.title||a.$slots.header||a.$slots.actions?(n.openBlock(),n.createElementBlock("div",Ih,[n.createElementVNode("div",Rh,[n.renderSlot(a.$slots,"header",{},()=>[e.title?(n.openBlock(),n.createElementBlock("h3",Lh,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),e.subtitle?(n.openBlock(),n.createElementBlock("p",$h,n.toDisplayString(e.subtitle),1)):n.createCommentVNode("",!0)])]),a.$slots.actions?(n.openBlock(),n.createElementBlock("div",Wh,[n.renderSlot(a.$slots,"actions")])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",jh,[n.renderSlot(a.$slots,"default")]),a.$slots.footer?(n.openBlock(),n.createElementBlock("div",Uh,[n.renderSlot(a.$slots,"footer")])):n.createCommentVNode("",!0)],2))}});/*!
|
|
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
|
|
6
|
+
*/function no(e){return e+.5|0}const Jt=(e,t,o)=>Math.max(Math.min(e,o),t);function oo(e){return Jt(no(e*2.55),0,255)}function Qt(e){return Jt(no(e*255),0,255)}function zt(e){return Jt(no(e/2.55)/100,0,1)}function Ri(e){return Jt(no(e*100),0,100)}const ft={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},wr=[..."0123456789ABCDEF"],qh=e=>wr[e&15],Gh=e=>wr[(e&240)>>4]+wr[e&15],Ho=e=>(e&240)>>4===(e&15),Xh=e=>Ho(e.r)&&Ho(e.g)&&Ho(e.b)&&Ho(e.a);function Yh(e){var t=e.length,o;return e[0]==="#"&&(t===4||t===5?o={r:255&ft[e[1]]*17,g:255&ft[e[2]]*17,b:255&ft[e[3]]*17,a:t===5?ft[e[4]]*17:255}:(t===7||t===9)&&(o={r:ft[e[1]]<<4|ft[e[2]],g:ft[e[3]]<<4|ft[e[4]],b:ft[e[5]]<<4|ft[e[6]],a:t===9?ft[e[7]]<<4|ft[e[8]]:255})),o}const Kh=(e,t)=>e<255?t(e):"";function Jh(e){var t=Xh(e)?qh:Gh;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Kh(e.a,t):void 0}const Qh=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Li(e,t,o){const a=t*Math.min(o,1-o),r=(s,i=(s+e/30)%12)=>o-a*Math.max(Math.min(i-3,9-i,1),-1);return[r(0),r(8),r(4)]}function Zh(e,t,o){const a=(r,s=(r+e/60)%6)=>o-o*t*Math.max(Math.min(s,4-s,1),0);return[a(5),a(3),a(1)]}function em(e,t,o){const a=Li(e,1,.5);let r;for(t+o>1&&(r=1/(t+o),t*=r,o*=r),r=0;r<3;r++)a[r]*=1-t-o,a[r]+=t;return a}function tm(e,t,o,a,r){return e===r?(t-o)/a+(t<o?6:0):t===r?(o-e)/a+2:(e-t)/a+4}function Cr(e){const o=e.r/255,a=e.g/255,r=e.b/255,s=Math.max(o,a,r),i=Math.min(o,a,r),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=tm(o,a,r,u,s),c=c*60+.5),[c|0,d||0,l]}function _r(e,t,o,a){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,o,a)).map(Qt)}function Br(e,t,o){return _r(Li,e,t,o)}function nm(e,t,o){return _r(em,e,t,o)}function om(e,t,o){return _r(Zh,e,t,o)}function $i(e){return(e%360+360)%360}function am(e){const t=Qh.exec(e);let o=255,a;if(!t)return;t[5]!==a&&(o=t[6]?oo(+t[5]):Qt(+t[5]));const r=$i(+t[2]),s=+t[3]/100,i=+t[4]/100;return t[1]==="hwb"?a=nm(r,s,i):t[1]==="hsv"?a=om(r,s,i):a=Br(r,s,i),{r:a[0],g:a[1],b:a[2],a:o}}function rm(e,t){var o=Cr(e);o[0]=$i(o[0]+t),o=Br(o),e.r=o[0],e.g=o[1],e.b=o[2]}function sm(e){if(!e)return;const t=Cr(e),o=t[0],a=Ri(t[1]),r=Ri(t[2]);return e.a<255?`hsla(${o}, ${a}%, ${r}%, ${zt(e.a)})`:`hsl(${o}, ${a}%, ${r}%)`}const Wi={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"},ji={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 im(){const e={},t=Object.keys(ji),o=Object.keys(Wi);let a,r,s,i,l;for(a=0;a<t.length;a++){for(i=l=t[a],r=0;r<o.length;r++)s=o[r],l=l.replace(s,Wi[s]);s=parseInt(ji[i],16),e[l]=[s>>16&255,s>>8&255,s&255]}return e}let qo;function lm(e){qo||(qo=im(),qo.transparent=[0,0,0,0]);const t=qo[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const cm=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function dm(e){const t=cm.exec(e);let o=255,a,r,s;if(t){if(t[7]!==a){const i=+t[7];o=t[8]?oo(i):Jt(i*255,0,255)}return a=+t[1],r=+t[3],s=+t[5],a=255&(t[2]?oo(a):Jt(a,0,255)),r=255&(t[4]?oo(r):Jt(r,0,255)),s=255&(t[6]?oo(s):Jt(s,0,255)),{r:a,g:r,b:s,a:o}}}function um(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${zt(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Er=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Pn=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function fm(e,t,o){const a=Pn(zt(e.r)),r=Pn(zt(e.g)),s=Pn(zt(e.b));return{r:Qt(Er(a+o*(Pn(zt(t.r))-a))),g:Qt(Er(r+o*(Pn(zt(t.g))-r))),b:Qt(Er(s+o*(Pn(zt(t.b))-s))),a:e.a+o*(t.a-e.a)}}function Go(e,t,o){if(e){let a=Cr(e);a[t]=Math.max(0,Math.min(a[t]+a[t]*o,t===0?360:1)),a=Br(a),e.r=a[0],e.g=a[1],e.b=a[2]}}function Ui(e,t){return e&&Object.assign(t||{},e)}function Hi(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Qt(e[3]))):(t=Ui(e,{r:0,g:0,b:0,a:1}),t.a=Qt(t.a)),t}function hm(e){return e.charAt(0)==="r"?dm(e):am(e)}class ao{constructor(t){if(t instanceof ao)return t;const o=typeof t;let a;o==="object"?a=Hi(t):o==="string"&&(a=Yh(t)||lm(t)||hm(t)),this._rgb=a,this._valid=!!a}get valid(){return this._valid}get rgb(){var t=Ui(this._rgb);return t&&(t.a=zt(t.a)),t}set rgb(t){this._rgb=Hi(t)}rgbString(){return this._valid?um(this._rgb):void 0}hexString(){return this._valid?Jh(this._rgb):void 0}hslString(){return this._valid?sm(this._rgb):void 0}mix(t,o){if(t){const a=this.rgb,r=t.rgb;let s;const i=o===s?.5:o,l=2*i-1,c=a.a-r.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;s=1-d,a.r=255&d*a.r+s*r.r+.5,a.g=255&d*a.g+s*r.g+.5,a.b=255&d*a.b+s*r.b+.5,a.a=i*a.a+(1-i)*r.a,this.rgb=a}return this}interpolate(t,o){return t&&(this._rgb=fm(this._rgb,t._rgb,o)),this}clone(){return new ao(this.rgb)}alpha(t){return this._rgb.a=Qt(t),this}clearer(t){const o=this._rgb;return o.a*=1-t,this}greyscale(){const t=this._rgb,o=no(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=o,this}opaquer(t){const o=this._rgb;return o.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Go(this._rgb,2,t),this}darken(t){return Go(this._rgb,2,-t),this}saturate(t){return Go(this._rgb,1,t),this}desaturate(t){return Go(this._rgb,1,-t),this}rotate(t){return rm(this._rgb,t),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 Ft(){}const mm=(()=>{let e=0;return()=>e++})();function De(e){return e==null}function Ue(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Be(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Qe(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function St(e,t){return Qe(e)?e:t}function xe(e,t){return typeof e>"u"?t:e}const pm=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,qi=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Fe(e,t,o){if(e&&typeof e.call=="function")return e.apply(o,t)}function Me(e,t,o,a){let r,s,i;if(Ue(e))for(s=e.length,r=0;r<s;r++)t.call(o,e[r],r);else if(Be(e))for(i=Object.keys(e),s=i.length,r=0;r<s;r++)t.call(o,e[i[r]],i[r])}function Xo(e,t){let o,a,r,s;if(!e||!t||e.length!==t.length)return!1;for(o=0,a=e.length;o<a;++o)if(r=e[o],s=t[o],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function Yo(e){if(Ue(e))return e.map(Yo);if(Be(e)){const t=Object.create(null),o=Object.keys(e),a=o.length;let r=0;for(;r<a;++r)t[o[r]]=Yo(e[o[r]]);return t}return e}function Gi(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function gm(e,t,o,a){if(!Gi(e))return;const r=t[e],s=o[e];Be(r)&&Be(s)?ao(r,s,a):t[e]=Yo(s)}function ao(e,t,o){const a=Ue(t)?t:[t],r=a.length;if(!Be(e))return e;o=o||{};const s=o.merger||gm;let i;for(let l=0;l<r;++l){if(i=a[l],!Be(i))continue;const c=Object.keys(i);for(let d=0,u=c.length;d<u;++d)s(c[d],e,i,o)}return e}function ro(e,t){return ao(e,t,{merger:bm})}function bm(e,t,o){if(!Gi(e))return;const a=t[e],r=o[e];Be(a)&&Be(r)?ro(a,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Yo(r))}const Xi={"":e=>e,x:e=>e.x,y:e=>e.y};function ym(e){const t=e.split("."),o=[];let a="";for(const r of t)a+=r,a.endsWith("\\")?a=a.slice(0,-1)+".":(o.push(a),a="");return o}function xm(e){const t=ym(e);return o=>{for(const a of t){if(a==="")break;o=o&&o[a]}return o}}function mn(e,t){return(Xi[t]||(Xi[t]=xm(t)))(e)}function Sr(e){return e.charAt(0).toUpperCase()+e.slice(1)}const so=e=>typeof e<"u",Zt=e=>typeof e=="function",Yi=(e,t)=>{if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0};function km(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Ne=Math.PI,Le=2*Ne,wm=Le+Ne,Ko=Number.POSITIVE_INFINITY,Cm=Ne/180,Ge=Ne/2,pn=Ne/4,Ki=Ne*2/3,Ji=Math.log10,At=Math.sign;function io(e,t,o){return Math.abs(e-t)<o}function Qi(e){const t=Math.round(e);e=io(e,t,e/1e3)?t:e;const o=Math.pow(10,Math.floor(Ji(e))),a=e/o;return(a<=1?1:a<=2?2:a<=5?5:10)*o}function _m(e){const t=[],o=Math.sqrt(e);let a;for(a=1;a<o;a++)e%a===0&&(t.push(a),t.push(e/a));return o===(o|0)&&t.push(o),t.sort((r,s)=>r-s).pop(),t}function Bm(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function lo(e){return!Bm(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Em(e,t){const o=Math.round(e);return o-t<=e&&o+t>=e}function Sm(e,t,o){let a,r,s;for(a=0,r=e.length;a<r;a++)s=e[a][o],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function It(e){return e*(Ne/180)}function Am(e){return e*(180/Ne)}function Zi(e){if(!Qe(e))return;let t=1,o=0;for(;Math.round(e*t)/t!==e;)t*=10,o++;return o}function el(e,t){const o=t.x-e.x,a=t.y-e.y,r=Math.sqrt(o*o+a*a);let s=Math.atan2(a,o);return s<-.5*Ne&&(s+=Le),{angle:s,distance:r}}function Ar(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Vm(e,t){return(e-t+wm)%Le-Ne}function ct(e){return(e%Le+Le)%Le}function co(e,t,o,a){const r=ct(e),s=ct(t),i=ct(o),l=ct(s-r),c=ct(i-r),d=ct(r-s),u=ct(r-i);return r===s||r===i||a&&s===i||l>c&&d<u}function Ze(e,t,o){return Math.max(t,Math.min(o,e))}function Dm(e){return Ze(e,-32768,32767)}function Rt(e,t,o,a=1e-6){return e>=Math.min(t,o)-a&&e<=Math.max(t,o)+a}function Vr(e,t,o){o=o||(i=>e[i]<t);let a=e.length-1,r=0,s;for(;a-r>1;)s=r+a>>1,o(s)?r=s:a=s;return{lo:r,hi:a}}const gn=(e,t,o,a)=>Vr(e,o,a?r=>{const s=e[r][t];return s<o||s===o&&e[r+1][t]===o}:r=>e[r][t]<o),Mm=(e,t,o)=>Vr(e,o,a=>e[a][t]>=o);function Nm(e,t,o){let a=0,r=e.length;for(;a<r&&e[a]<t;)a++;for(;r>a&&e[r-1]>o;)r--;return a>0||r<e.length?e.slice(a,r):e}const tl=["push","pop","shift","splice","unshift"];function Pm(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),tl.forEach(o=>{const a="_onData"+Sr(o),r=e[o];Object.defineProperty(e,o,{configurable:!0,enumerable:!1,value(...s){const i=r.apply(this,s);return e._chartjs.listeners.forEach(l=>{typeof l[a]=="function"&&l[a](...s)}),i}})})}function nl(e,t){const o=e._chartjs;if(!o)return;const a=o.listeners,r=a.indexOf(t);r!==-1&&a.splice(r,1),!(a.length>0)&&(tl.forEach(s=>{delete e[s]}),delete e._chartjs)}function ol(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const al=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function rl(e,t){let o=[],a=!1;return function(...r){o=r,a||(a=!0,al.call(window,()=>{a=!1,e.apply(t,o)}))}}function vm(e,t){let o;return function(...a){return t?(clearTimeout(o),o=setTimeout(e,t,a)):e.apply(this,a),t}}const Dr=e=>e==="start"?"left":e==="end"?"right":"center",et=(e,t,o)=>e==="start"?t:e==="end"?o:(t+o)/2,Tm=(e,t,o,a)=>e===(a?"left":"right")?o:e==="center"?(t+o)/2:t;function Om(e,t,o){const a=t.length;let r=0,s=a;if(e._sorted){const{iScale:i,vScale:l,_parsed:c}=e,d=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=i.axis,{min:f,max:h,minDefined:m,maxDefined:p}=i.getUserBounds();if(m){if(r=Math.min(gn(c,u,f).lo,o?a:gn(t,u,i.getPixelForValue(f)).lo),d){const g=c.slice(0,r+1).reverse().findIndex(y=>!De(y[l.axis]));r-=Math.max(0,g)}r=Ze(r,0,a-1)}if(p){let g=Math.max(gn(c,i.axis,h,!0).hi+1,o?0:gn(t,u,i.getPixelForValue(h),!0).hi+1);if(d){const y=c.slice(g-1).findIndex(x=>!De(x[l.axis]));g+=Math.max(0,y)}s=Ze(g,r,a)-r}else s=a-r}return{start:r,count:s}}function zm(e){const{xScale:t,yScale:o,_scaleRanges:a}=e,r={xmin:t.min,xmax:t.max,ymin:o.min,ymax:o.max};if(!a)return e._scaleRanges=r,!0;const s=a.xmin!==t.min||a.xmax!==t.max||a.ymin!==o.min||a.ymax!==o.max;return Object.assign(a,r),s}const Jo=e=>e===0||e===1,sl=(e,t,o)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Le/o)),il=(e,t,o)=>Math.pow(2,-10*e)*Math.sin((e-t)*Le/o)+1,uo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Ge)+1,easeOutSine:e=>Math.sin(e*Ge),easeInOutSine:e=>-.5*(Math.cos(Ne*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Jo(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Jo(e)?e:sl(e,.075,.3),easeOutElastic:e=>Jo(e)?e:il(e,.075,.3),easeInOutElastic(e){return Jo(e)?e:e<.5?.5*sl(e*2,.1125,.45):.5+.5*il(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-uo.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?uo.easeInBounce(e*2)*.5:uo.easeOutBounce(e*2-1)*.5+.5};function Mr(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ll(e){return Mr(e)?e:new oo(e)}function Nr(e){return Mr(e)?e:new oo(e).saturate(.5).darken(.1).hexString()}const Fm=["x","y","borderWidth","radius","tension"],Im=["color","borderColor","backgroundColor"];function Rm(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Im},numbers:{type:"number",properties:Fm}}),e.describe("animations",{_fallback:"animation"}),e.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:t=>t|0}}}})}function Lm(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const cl=new Map;function $m(e,t){t=t||{};const o=e+JSON.stringify(t);let a=cl.get(o);return a||(a=new Intl.NumberFormat(e,t),cl.set(o,a)),a}function Pr(e,t,o){return $m(t,o).format(e)}const Wm={values(e){return Ue(e)?e:""+e},numeric(e,t,o){if(e===0)return"0";const a=this.chart.options.locale;let r,s=e;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)&&(r="scientific"),s=jm(e,o)}const i=Ji(Math.abs(s)),l=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Pr(e,a,c)}};function jm(e,t){let o=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(o)>=1&&e!==Math.floor(e)&&(o=e-Math.floor(e)),o}var dl={formatters:Wm};function Um(e){e.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:(t,o)=>o.lineWidth,tickColor:(t,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:dl.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const bn=Object.create(null),vr=Object.create(null);function fo(e,t){if(!t)return e;const o=t.split(".");for(let a=0,r=o.length;a<r;++a){const s=o[a];e=e[s]||(e[s]=Object.create(null))}return e}function Tr(e,t,o){return typeof t=="string"?ao(fo(e,t),o):ao(fo(e,""),t)}class Hm{constructor(t,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=a=>a.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=(a,r)=>Nr(r.backgroundColor),this.hoverBorderColor=(a,r)=>Nr(r.borderColor),this.hoverColor=(a,r)=>Nr(r.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(t),this.apply(o)}set(t,o){return Tr(this,t,o)}get(t){return fo(this,t)}describe(t,o){return Tr(vr,t,o)}override(t,o){return Tr(bn,t,o)}route(t,o,a,r){const s=fo(this,t),i=fo(this,a),l="_"+o;Object.defineProperties(s,{[l]:{value:s[o],writable:!0},[o]:{enumerable:!0,get(){const c=this[l],d=i[r];return Be(c)?Object.assign({},d,c):xe(c,d)},set(c){this[l]=c}}})}apply(t){t.forEach(o=>o(this))}}var We=new Hm({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Rm,Lm,Um]);function qm(e){return!e||De(e.size)||De(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function ul(e,t,o,a,r){let s=t[r];return s||(s=t[r]=e.measureText(r).width,o.push(r)),s>a&&(a=s),a}function yn(e,t,o){const a=e.currentDevicePixelRatio,r=o!==0?Math.max(o/2,.5):0;return Math.round((t-r)*a)/a+r}function fl(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Or(e,t,o,a){hl(e,t,o,a,null)}function hl(e,t,o,a,r){let s,i,l,c,d,u,f,h;const m=t.pointStyle,p=t.rotation,g=t.radius;let y=(p||0)*Cm;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(o,a),e.rotate(y),e.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),e.restore();return}if(!(isNaN(g)||g<=0)){switch(e.beginPath(),m){default:r?e.ellipse(o,a,r/2,g,0,0,Le):e.arc(o,a,g,0,Le),e.closePath();break;case"triangle":u=r?r/2:g,e.moveTo(o+Math.sin(y)*u,a-Math.cos(y)*g),y+=Ki,e.lineTo(o+Math.sin(y)*u,a-Math.cos(y)*g),y+=Ki,e.lineTo(o+Math.sin(y)*u,a-Math.cos(y)*g),e.closePath();break;case"rectRounded":d=g*.516,c=g-d,i=Math.cos(y+pn)*c,f=Math.cos(y+pn)*(r?r/2-d:c),l=Math.sin(y+pn)*c,h=Math.sin(y+pn)*(r?r/2-d:c),e.arc(o-f,a-l,d,y-Ne,y-Ge),e.arc(o+h,a-i,d,y-Ge,y),e.arc(o+f,a+l,d,y,y+Ge),e.arc(o-h,a+i,d,y+Ge,y+Ne),e.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*g,u=r?r/2:c,e.rect(o-u,a-c,2*u,2*c);break}y+=pn;case"rectRot":f=Math.cos(y)*(r?r/2:g),i=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(r?r/2:g),e.moveTo(o-f,a-l),e.lineTo(o+h,a-i),e.lineTo(o+f,a+l),e.lineTo(o-h,a+i),e.closePath();break;case"crossRot":y+=pn;case"cross":f=Math.cos(y)*(r?r/2:g),i=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(r?r/2:g),e.moveTo(o-f,a-l),e.lineTo(o+f,a+l),e.moveTo(o+h,a-i),e.lineTo(o-h,a+i);break;case"star":f=Math.cos(y)*(r?r/2:g),i=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(r?r/2:g),e.moveTo(o-f,a-l),e.lineTo(o+f,a+l),e.moveTo(o+h,a-i),e.lineTo(o-h,a+i),y+=pn,f=Math.cos(y)*(r?r/2:g),i=Math.cos(y)*g,l=Math.sin(y)*g,h=Math.sin(y)*(r?r/2:g),e.moveTo(o-f,a-l),e.lineTo(o+f,a+l),e.moveTo(o+h,a-i),e.lineTo(o-h,a+i);break;case"line":i=r?r/2:Math.cos(y)*g,l=Math.sin(y)*g,e.moveTo(o-i,a-l),e.lineTo(o+i,a+l);break;case"dash":e.moveTo(o,a),e.lineTo(o+Math.cos(y)*(r?r/2:g),a+Math.sin(y)*g);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function ho(e,t,o){return o=o||.5,!t||e&&e.x>t.left-o&&e.x<t.right+o&&e.y>t.top-o&&e.y<t.bottom+o}function Qo(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Zo(e){e.restore()}function Gm(e,t,o,a,r){if(!t)return e.lineTo(o.x,o.y);if(r==="middle"){const s=(t.x+o.x)/2;e.lineTo(s,t.y),e.lineTo(s,o.y)}else r==="after"!=!!a?e.lineTo(t.x,o.y):e.lineTo(o.x,t.y);e.lineTo(o.x,o.y)}function Xm(e,t,o,a){if(!t)return e.lineTo(o.x,o.y);e.bezierCurveTo(a?t.cp1x:t.cp2x,a?t.cp1y:t.cp2y,a?o.cp2x:o.cp1x,a?o.cp2y:o.cp1y,o.x,o.y)}function Ym(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),De(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Km(e,t,o,a,r){if(r.strikethrough||r.underline){const s=e.measureText(a),i=t-s.actualBoundingBoxLeft,l=t+s.actualBoundingBoxRight,c=o-s.actualBoundingBoxAscent,d=o+s.actualBoundingBoxDescent,u=r.strikethrough?(c+d)/2:d;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=r.decorationWidth||2,e.moveTo(i,u),e.lineTo(l,u),e.stroke()}}function Jm(e,t){const o=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=o}function mo(e,t,o,a,r,s={}){const i=Ue(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(e.save(),e.font=r.string,Ym(e,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&Jm(e,s.backdrop),l&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),De(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(d,o,a,s.maxWidth)),e.fillText(d,o,a,s.maxWidth),Km(e,o,a,d,s),a+=Number(r.lineHeight);e.restore()}function ea(e,t){const{x:o,y:a,w:r,h:s,radius:i}=t;e.arc(o+i.topLeft,a+i.topLeft,i.topLeft,1.5*Ne,Ne,!0),e.lineTo(o,a+s-i.bottomLeft),e.arc(o+i.bottomLeft,a+s-i.bottomLeft,i.bottomLeft,Ne,Ge,!0),e.lineTo(o+r-i.bottomRight,a+s),e.arc(o+r-i.bottomRight,a+s-i.bottomRight,i.bottomRight,Ge,0,!0),e.lineTo(o+r,a+i.topRight),e.arc(o+r-i.topRight,a+i.topRight,i.topRight,0,-Ge,!0),e.lineTo(o+i.topLeft,a)}const Qm=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Zm=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ep(e,t){const o=(""+e).match(Qm);if(!o||o[1]==="normal")return t*1.2;switch(e=+o[2],o[3]){case"px":return e;case"%":e/=100;break}return t*e}const tp=e=>+e||0;function zr(e,t){const o={},a=Be(t),r=a?Object.keys(t):t,s=Be(e)?a?i=>xe(e[i],e[t[i]]):i=>e[i]:()=>e;for(const i of r)o[i]=tp(s(i));return o}function ml(e){return zr(e,{top:"y",right:"x",bottom:"y",left:"x"})}function vn(e){return zr(e,["topLeft","topRight","bottomLeft","bottomRight"])}function ht(e){const t=ml(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function tt(e,t){e=e||{},t=t||We.font;let o=xe(e.size,t.size);typeof o=="string"&&(o=parseInt(o,10));let a=xe(e.style,t.style);a&&!(""+a).match(Zm)&&(console.warn('Invalid font style specified: "'+a+'"'),a=void 0);const r={family:xe(e.family,t.family),lineHeight:ep(xe(e.lineHeight,t.lineHeight),o),size:o,style:a,weight:xe(e.weight,t.weight),string:""};return r.string=qm(r),r}function ta(e,t,o,a){let r,s,i;for(r=0,s=e.length;r<s;++r)if(i=e[r],i!==void 0&&i!==void 0)return i}function np(e,t,o){const{min:a,max:r}=e,s=qi(t,(r-a)/2),i=(l,c)=>o&&l===0?0:l+c;return{min:i(a,-Math.abs(s)),max:i(r,s)}}function xn(e,t){return Object.assign(Object.create(e),t)}function Fr(e,t=[""],o,a,r=()=>e[0]){const s=o||e;typeof a>"u"&&(a=xl("_fallback",e));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:a,_getTarget:r,override:l=>Fr([l,...e],t,s,a)};return new Proxy(i,{deleteProperty(l,c){return delete l[c],delete l._keys,delete e[0][c],!0},get(l,c){return gl(l,c,()=>dp(c,t,e,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,c){return kl(l).includes(c)},ownKeys(l){return kl(l)},set(l,c,d){const u=l._storage||(l._storage=r());return l[c]=u[c]=d,delete l._keys,!0}})}function Tn(e,t,o,a){const r={_cacheable:!1,_proxy:e,_context:t,_subProxy:o,_stack:new Set,_descriptors:pl(e,a),setContext:s=>Tn(e,s,o,a),override:s=>Tn(e.override(s),t,o,a)};return new Proxy(r,{deleteProperty(s,i){return delete s[i],delete e[i],!0},get(s,i,l){return gl(s,i,()=>ap(s,i,l))},getOwnPropertyDescriptor(s,i){return s._descriptors.allKeys?Reflect.has(e,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,i)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,i){return Reflect.has(e,i)},ownKeys(){return Reflect.ownKeys(e)},set(s,i,l){return e[i]=l,delete s[i],!0}})}function pl(e,t={scriptable:!0,indexable:!0}){const{_scriptable:o=t.scriptable,_indexable:a=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:o,indexable:a,isScriptable:Zt(o)?o:()=>o,isIndexable:Zt(a)?a:()=>a}}const op=(e,t)=>e?e+Sr(t):t,Ir=(e,t)=>Be(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function gl(e,t,o){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const a=o();return e[t]=a,a}function ap(e,t,o){const{_proxy:a,_context:r,_subProxy:s,_descriptors:i}=e;let l=a[t];return Zt(l)&&i.isScriptable(t)&&(l=rp(t,l,e,o)),Ue(l)&&l.length&&(l=sp(t,l,e,i.isIndexable)),Ir(t,l)&&(l=Tn(l,r,s&&s[t],i)),l}function rp(e,t,o,a){const{_proxy:r,_context:s,_subProxy:i,_stack:l}=o;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);let c=t(s,i||a);return l.delete(e),Ir(e,c)&&(c=Rr(r._scopes,r,e,c)),c}function sp(e,t,o,a){const{_proxy:r,_context:s,_subProxy:i,_descriptors:l}=o;if(typeof s.index<"u"&&a(e))return t[s.index%t.length];if(Be(t[0])){const c=t,d=r._scopes.filter(u=>u!==c);t=[];for(const u of c){const f=Rr(d,r,e,u);t.push(Tn(f,s,i&&i[e],l))}}return t}function bl(e,t,o){return Zt(e)?e(t,o):e}const ip=(e,t)=>e===!0?t:typeof e=="string"?mn(t,e):void 0;function lp(e,t,o,a,r){for(const s of t){const i=ip(o,s);if(i){e.add(i);const l=bl(i._fallback,o,r);if(typeof l<"u"&&l!==o&&l!==a)return l}else if(i===!1&&typeof a<"u"&&o!==a)return null}return!1}function Rr(e,t,o,a){const r=t._rootScopes,s=bl(t._fallback,o,a),i=[...e,...r],l=new Set;l.add(a);let c=yl(l,i,o,s||o,a);return c===null||typeof s<"u"&&s!==o&&(c=yl(l,i,s,c,a),c===null)?!1:Fr(Array.from(l),[""],r,s,()=>cp(t,o,a))}function yl(e,t,o,a,r){for(;o;)o=lp(e,t,o,a,r);return o}function cp(e,t,o){const a=e._getTarget();t in a||(a[t]={});const r=a[t];return Ue(r)&&Be(o)?o:r||{}}function dp(e,t,o,a){let r;for(const s of t)if(r=xl(op(s,e),o),typeof r<"u")return Ir(e,r)?Rr(o,a,e,r):r}function xl(e,t){for(const o of t){if(!o)continue;const a=o[e];if(typeof a<"u")return a}}function kl(e){let t=e._keys;return t||(t=e._keys=up(e._scopes)),t}function up(e){const t=new Set;for(const o of e)for(const a of Object.keys(o).filter(r=>!r.startsWith("_")))t.add(a);return Array.from(t)}const fp=Number.EPSILON||1e-14,On=(e,t)=>t<e.length&&!e[t].skip&&e[t],wl=e=>e==="x"?"y":"x";function hp(e,t,o,a){const r=e.skip?t:e,s=t,i=o.skip?t:o,l=Ar(s,r),c=Ar(i,s);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=a*d,h=a*u;return{previous:{x:s.x-f*(i.x-r.x),y:s.y-f*(i.y-r.y)},next:{x:s.x+h*(i.x-r.x),y:s.y+h*(i.y-r.y)}}}function mp(e,t,o){const a=e.length;let r,s,i,l,c,d=On(e,0);for(let u=0;u<a-1;++u)if(c=d,d=On(e,u+1),!(!c||!d)){if(io(t[u],0,fp)){o[u]=o[u+1]=0;continue}r=o[u]/t[u],s=o[u+1]/t[u],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(i=3/Math.sqrt(l),o[u]=r*i*t[u],o[u+1]=s*i*t[u])}}function pp(e,t,o="x"){const a=wl(o),r=e.length;let s,i,l,c=On(e,0);for(let d=0;d<r;++d){if(i=l,l=c,c=On(e,d+1),!l)continue;const u=l[o],f=l[a];i&&(s=(u-i[o])/3,l[`cp1${o}`]=u-s,l[`cp1${a}`]=f-s*t[d]),c&&(s=(c[o]-u)/3,l[`cp2${o}`]=u+s,l[`cp2${a}`]=f+s*t[d])}}function gp(e,t="x"){const o=wl(t),a=e.length,r=Array(a).fill(0),s=Array(a);let i,l,c,d=On(e,0);for(i=0;i<a;++i)if(l=c,c=d,d=On(e,i+1),!!c){if(d){const u=d[t]-c[t];r[i]=u!==0?(d[o]-c[o])/u:0}s[i]=l?d?At(r[i-1])!==At(r[i])?0:(r[i-1]+r[i])/2:r[i-1]:r[i]}mp(e,r,s),pp(e,s,t)}function na(e,t,o){return Math.max(Math.min(e,o),t)}function bp(e,t){let o,a,r,s,i,l=ho(e[0],t);for(o=0,a=e.length;o<a;++o)i=s,s=l,l=o<a-1&&ho(e[o+1],t),s&&(r=e[o],i&&(r.cp1x=na(r.cp1x,t.left,t.right),r.cp1y=na(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=na(r.cp2x,t.left,t.right),r.cp2y=na(r.cp2y,t.top,t.bottom)))}function yp(e,t,o,a,r){let s,i,l,c;if(t.spanGaps&&(e=e.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")gp(e,r);else{let d=a?e[e.length-1]:e[0];for(s=0,i=e.length;s<i;++s)l=e[s],c=hp(d,l,e[Math.min(s+1,i-(a?0:1))%i],t.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}t.capBezierPoints&&bp(e,o)}function Lr(){return typeof window<"u"&&typeof document<"u"}function $r(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function oa(e,t,o){let a;return typeof e=="string"?(a=parseInt(e,10),e.indexOf("%")!==-1&&(a=a/100*t.parentNode[o])):a=e,a}const aa=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function xp(e,t){return aa(e).getPropertyValue(t)}const kp=["top","right","bottom","left"];function kn(e,t,o){const a={};o=o?"-"+o:"";for(let r=0;r<4;r++){const s=kp[r];a[s]=parseFloat(e[t+"-"+s+o])||0}return a.width=a.left+a.right,a.height=a.top+a.bottom,a}const wp=(e,t,o)=>(e>0||t>0)&&(!o||!o.shadowRoot);function Cp(e,t){const o=e.touches,a=o&&o.length?o[0]:e,{offsetX:r,offsetY:s}=a;let i=!1,l,c;if(wp(r,s,e.target))l=r,c=s;else{const d=t.getBoundingClientRect();l=a.clientX-d.left,c=a.clientY-d.top,i=!0}return{x:l,y:c,box:i}}function wn(e,t){if("native"in e)return e;const{canvas:o,currentDevicePixelRatio:a}=t,r=aa(o),s=r.boxSizing==="border-box",i=kn(r,"padding"),l=kn(r,"border","width"),{x:c,y:d,box:u}=Cp(e,o),f=i.left+(u&&l.left),h=i.top+(u&&l.top);let{width:m,height:p}=t;return s&&(m-=i.width+l.width,p-=i.height+l.height),{x:Math.round((c-f)/m*o.width/a),y:Math.round((d-h)/p*o.height/a)}}function _p(e,t,o){let a,r;if(t===void 0||o===void 0){const s=e&&$r(e);if(!s)t=e.clientWidth,o=e.clientHeight;else{const i=s.getBoundingClientRect(),l=aa(s),c=kn(l,"border","width"),d=kn(l,"padding");t=i.width-d.width-c.width,o=i.height-d.height-c.height,a=oa(l.maxWidth,s,"clientWidth"),r=oa(l.maxHeight,s,"clientHeight")}}return{width:t,height:o,maxWidth:a||Ko,maxHeight:r||Ko}}const en=e=>Math.round(e*10)/10;function Bp(e,t,o,a){const r=aa(e),s=kn(r,"margin"),i=oa(r.maxWidth,e,"clientWidth")||Ko,l=oa(r.maxHeight,e,"clientHeight")||Ko,c=_p(e,t,o);let{width:d,height:u}=c;if(r.boxSizing==="content-box"){const h=kn(r,"border","width"),m=kn(r,"padding");d-=m.width+h.width,u-=m.height+h.height}return d=Math.max(0,d-s.width),u=Math.max(0,a?d/a:u-s.height),d=en(Math.min(d,i,c.maxWidth)),u=en(Math.min(u,l,c.maxHeight)),d&&!u&&(u=en(d/2)),(t!==void 0||o!==void 0)&&a&&c.height&&u>c.height&&(u=c.height,d=en(Math.floor(u*a))),{width:d,height:u}}function Cl(e,t,o){const a=t||1,r=en(e.height*a),s=en(e.width*a);e.height=en(e.height),e.width=en(e.width);const i=e.canvas;return i.style&&(o||!i.style.height&&!i.style.width)&&(i.style.height=`${e.height}px`,i.style.width=`${e.width}px`),e.currentDevicePixelRatio!==a||i.height!==r||i.width!==s?(e.currentDevicePixelRatio=a,i.height=r,i.width=s,e.ctx.setTransform(a,0,0,a,0,0),!0):!1}const Ep=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Lr()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function _l(e,t){const o=xp(e,t),a=o&&o.match(/^(\d+)(\.\d+)?px$/);return a?+a[1]:void 0}function Cn(e,t,o,a){return{x:e.x+o*(t.x-e.x),y:e.y+o*(t.y-e.y)}}function Sp(e,t,o,a){return{x:e.x+o*(t.x-e.x),y:a==="middle"?o<.5?e.y:t.y:a==="after"?o<1?e.y:t.y:o>0?t.y:e.y}}function Ap(e,t,o,a){const r={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},i=Cn(e,r,o),l=Cn(r,s,o),c=Cn(s,t,o),d=Cn(i,l,o),u=Cn(l,c,o);return Cn(d,u,o)}const Vp=function(e,t){return{x(o){return e+e+t-o},setWidth(o){t=o},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,a){return o-a},leftForLtr(o,a){return o-a}}},Dp=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function zn(e,t,o){return e?Vp(t,o):Dp()}function Bl(e,t){let o,a;(t==="ltr"||t==="rtl")&&(o=e.canvas.style,a=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",t,"important"),e.prevTextDirection=a)}function El(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Sl(e){return e==="angle"?{between:co,compare:Vm,normalize:ct}:{between:Rt,compare:(t,o)=>t-o,normalize:t=>t}}function Al({start:e,end:t,count:o,loop:a,style:r}){return{start:e%o,end:t%o,loop:a&&(t-e+1)%o===0,style:r}}function Mp(e,t,o){const{property:a,start:r,end:s}=o,{between:i,normalize:l}=Sl(a),c=t.length;let{start:d,end:u,loop:f}=e,h,m;if(f){for(d+=c,u+=c,h=0,m=c;h<m&&i(l(t[d%c][a]),r,s);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:e.style}}function Vl(e,t,o){if(!o)return[e];const{property:a,start:r,end:s}=o,i=t.length,{compare:l,between:c,normalize:d}=Sl(a),{start:u,end:f,loop:h,style:m}=Mp(e,t,o),p=[];let g=!1,y=null,x,_,C;const w=()=>c(r,C,x)&&l(r,C)!==0,E=()=>l(s,x)===0||c(s,C,x),B=()=>g||w(),k=()=>!g||E();for(let b=u,A=u;b<=f;++b)_=t[b%i],!_.skip&&(x=d(_[a]),x!==C&&(g=c(x,r,s),y===null&&B()&&(y=l(x,r)===0?b:A),y!==null&&k()&&(p.push(Al({start:y,end:b,loop:h,count:i,style:m})),y=null),A=b,C=x));return y!==null&&p.push(Al({start:y,end:f,loop:h,count:i,style:m})),p}function Dl(e,t){const o=[],a=e.segments;for(let r=0;r<a.length;r++){const s=Vl(a[r],e.points,t);s.length&&o.push(...s)}return o}function Np(e,t,o,a){let r=0,s=t-1;if(o&&!a)for(;r<t&&!e[r].skip;)r++;for(;r<t&&e[r].skip;)r++;for(r%=t,o&&(s+=r);s>r&&e[s%t].skip;)s--;return s%=t,{start:r,end:s}}function Pp(e,t,o,a){const r=e.length,s=[];let i=t,l=e[t],c;for(c=t+1;c<=o;++c){const d=e[c%r];d.skip||d.stop?l.skip||(a=!1,s.push({start:t%r,end:(c-1)%r,loop:a}),t=i=d.stop?c:null):(i=c,l.skip&&(t=c)),l=d}return i!==null&&s.push({start:t%r,end:i%r,loop:a}),s}function vp(e,t){const o=e.points,a=e.options.spanGaps,r=o.length;if(!r)return[];const s=!!e._loop,{start:i,end:l}=Np(o,r,s,a);if(a===!0)return Ml(e,[{start:i,end:l,loop:s}],o,t);const c=l<i?l+r:l,d=!!e._fullLoop&&i===0&&l===r-1;return Ml(e,Pp(o,i,c,d),o,t)}function Ml(e,t,o,a){return!a||!a.setContext||!o?t:Tp(e,t,o,a)}function Tp(e,t,o,a){const r=e._chart.getContext(),s=Nl(e.options),{_datasetIndex:i,options:{spanGaps:l}}=e,c=o.length,d=[];let u=s,f=t[0].start,h=f;function m(p,g,y,x){const _=l?-1:1;if(p!==g){for(p+=c;o[p%c].skip;)p-=_;for(;o[g%c].skip;)g+=_;p%c!==g%c&&(d.push({start:p%c,end:g%c,loop:y,style:x}),u=x,f=g%c)}}for(const p of t){f=l?f:p.start;let g=o[f%c],y;for(h=f+1;h<=p.end;h++){const x=o[h%c];y=Nl(a.setContext(xn(r,{type:"segment",p0:g,p1:x,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:i}))),Op(y,u)&&m(f,h-1,p.loop,u),g=x,u=y}f<h-1&&m(f,h-1,p.loop,u)}return d}function Nl(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Op(e,t){if(!t)return!1;const o=[],a=function(r,s){return Mr(s)?(o.includes(s)||o.push(s),o.indexOf(s)):s};return JSON.stringify(e,a)!==JSON.stringify(t,a)}function ra(e,t,o){return e.options.clip?e[o]:t[o]}function zp(e,t){const{xScale:o,yScale:a}=e;return o&&a?{left:ra(o,t,"left"),right:ra(o,t,"right"),top:ra(a,t,"top"),bottom:ra(a,t,"bottom")}:t}function Pl(e,t){const o=t._clip;if(o.disabled)return!1;const a=zp(t,e.chartArea);return{left:o.left===!1?0:a.left-(o.left===!0?0:o.left),right:o.right===!1?e.width:a.right+(o.right===!0?0:o.right),top:o.top===!1?0:a.top-(o.top===!0?0:o.top),bottom:o.bottom===!1?e.height:a.bottom+(o.bottom===!0?0:o.bottom)}}/*!
|
|
11
|
+
*/function Ft(){}const mm=(()=>{let e=0;return()=>e++})();function De(e){return e==null}function He(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Be(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Ze(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function St(e,t){return Ze(e)?e:t}function we(e,t){return typeof e>"u"?t:e}const pm=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,qi=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ie(e,t,o){if(e&&typeof e.call=="function")return e.apply(o,t)}function Ne(e,t,o,a){let r,s,i;if(He(e))for(s=e.length,r=0;r<s;r++)t.call(o,e[r],r);else if(Be(e))for(i=Object.keys(e),s=i.length,r=0;r<s;r++)t.call(o,e[i[r]],i[r])}function Xo(e,t){let o,a,r,s;if(!e||!t||e.length!==t.length)return!1;for(o=0,a=e.length;o<a;++o)if(r=e[o],s=t[o],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function Yo(e){if(He(e))return e.map(Yo);if(Be(e)){const t=Object.create(null),o=Object.keys(e),a=o.length;let r=0;for(;r<a;++r)t[o[r]]=Yo(e[o[r]]);return t}return e}function Gi(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function gm(e,t,o,a){if(!Gi(e))return;const r=t[e],s=o[e];Be(r)&&Be(s)?ro(r,s,a):t[e]=Yo(s)}function ro(e,t,o){const a=He(t)?t:[t],r=a.length;if(!Be(e))return e;o=o||{};const s=o.merger||gm;let i;for(let l=0;l<r;++l){if(i=a[l],!Be(i))continue;const c=Object.keys(i);for(let d=0,u=c.length;d<u;++d)s(c[d],e,i,o)}return e}function so(e,t){return ro(e,t,{merger:bm})}function bm(e,t,o){if(!Gi(e))return;const a=t[e],r=o[e];Be(a)&&Be(r)?so(a,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Yo(r))}const Xi={"":e=>e,x:e=>e.x,y:e=>e.y};function ym(e){const t=e.split("."),o=[];let a="";for(const r of t)a+=r,a.endsWith("\\")?a=a.slice(0,-1)+".":(o.push(a),a="");return o}function xm(e){const t=ym(e);return o=>{for(const a of t){if(a==="")break;o=o&&o[a]}return o}}function mn(e,t){return(Xi[t]||(Xi[t]=xm(t)))(e)}function Sr(e){return e.charAt(0).toUpperCase()+e.slice(1)}const io=e=>typeof e<"u",Zt=e=>typeof e=="function",Yi=(e,t)=>{if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0};function km(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Pe=Math.PI,$e=2*Pe,wm=$e+Pe,Ko=Number.POSITIVE_INFINITY,Cm=Pe/180,Xe=Pe/2,pn=Pe/4,Ki=Pe*2/3,Ji=Math.log10,At=Math.sign;function lo(e,t,o){return Math.abs(e-t)<o}function Qi(e){const t=Math.round(e);e=lo(e,t,e/1e3)?t:e;const o=Math.pow(10,Math.floor(Ji(e))),a=e/o;return(a<=1?1:a<=2?2:a<=5?5:10)*o}function _m(e){const t=[],o=Math.sqrt(e);let a;for(a=1;a<o;a++)e%a===0&&(t.push(a),t.push(e/a));return o===(o|0)&&t.push(o),t.sort((r,s)=>r-s).pop(),t}function Bm(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function co(e){return!Bm(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Em(e,t){const o=Math.round(e);return o-t<=e&&o+t>=e}function Sm(e,t,o){let a,r,s;for(a=0,r=e.length;a<r;a++)s=e[a][o],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function It(e){return e*(Pe/180)}function Am(e){return e*(180/Pe)}function Zi(e){if(!Ze(e))return;let t=1,o=0;for(;Math.round(e*t)/t!==e;)t*=10,o++;return o}function el(e,t){const o=t.x-e.x,a=t.y-e.y,r=Math.sqrt(o*o+a*a);let s=Math.atan2(a,o);return s<-.5*Pe&&(s+=$e),{angle:s,distance:r}}function Ar(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Vm(e,t){return(e-t+wm)%$e-Pe}function ct(e){return(e%$e+$e)%$e}function uo(e,t,o,a){const r=ct(e),s=ct(t),i=ct(o),l=ct(s-r),c=ct(i-r),d=ct(r-s),u=ct(r-i);return r===s||r===i||a&&s===i||l>c&&d<u}function et(e,t,o){return Math.max(t,Math.min(o,e))}function Dm(e){return et(e,-32768,32767)}function Rt(e,t,o,a=1e-6){return e>=Math.min(t,o)-a&&e<=Math.max(t,o)+a}function Vr(e,t,o){o=o||(i=>e[i]<t);let a=e.length-1,r=0,s;for(;a-r>1;)s=r+a>>1,o(s)?r=s:a=s;return{lo:r,hi:a}}const gn=(e,t,o,a)=>Vr(e,o,a?r=>{const s=e[r][t];return s<o||s===o&&e[r+1][t]===o}:r=>e[r][t]<o),Mm=(e,t,o)=>Vr(e,o,a=>e[a][t]>=o);function Nm(e,t,o){let a=0,r=e.length;for(;a<r&&e[a]<t;)a++;for(;r>a&&e[r-1]>o;)r--;return a>0||r<e.length?e.slice(a,r):e}const tl=["push","pop","shift","splice","unshift"];function Pm(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),tl.forEach(o=>{const a="_onData"+Sr(o),r=e[o];Object.defineProperty(e,o,{configurable:!0,enumerable:!1,value(...s){const i=r.apply(this,s);return e._chartjs.listeners.forEach(l=>{typeof l[a]=="function"&&l[a](...s)}),i}})})}function nl(e,t){const o=e._chartjs;if(!o)return;const a=o.listeners,r=a.indexOf(t);r!==-1&&a.splice(r,1),!(a.length>0)&&(tl.forEach(s=>{delete e[s]}),delete e._chartjs)}function ol(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const al=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function rl(e,t){let o=[],a=!1;return function(...r){o=r,a||(a=!0,al.call(window,()=>{a=!1,e.apply(t,o)}))}}function vm(e,t){let o;return function(...a){return t?(clearTimeout(o),o=setTimeout(e,t,a)):e.apply(this,a),t}}const Dr=e=>e==="start"?"left":e==="end"?"right":"center",tt=(e,t,o)=>e==="start"?t:e==="end"?o:(t+o)/2,Tm=(e,t,o,a)=>e===(a?"left":"right")?o:e==="center"?(t+o)/2:t;function Om(e,t,o){const a=t.length;let r=0,s=a;if(e._sorted){const{iScale:i,vScale:l,_parsed:c}=e,d=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=i.axis,{min:f,max:h,minDefined:m,maxDefined:p}=i.getUserBounds();if(m){if(r=Math.min(gn(c,u,f).lo,o?a:gn(t,u,i.getPixelForValue(f)).lo),d){const b=c.slice(0,r+1).reverse().findIndex(g=>!De(g[l.axis]));r-=Math.max(0,b)}r=et(r,0,a-1)}if(p){let b=Math.max(gn(c,i.axis,h,!0).hi+1,o?0:gn(t,u,i.getPixelForValue(h),!0).hi+1);if(d){const g=c.slice(b-1).findIndex(x=>!De(x[l.axis]));b+=Math.max(0,g)}s=et(b,r,a)-r}else s=a-r}return{start:r,count:s}}function zm(e){const{xScale:t,yScale:o,_scaleRanges:a}=e,r={xmin:t.min,xmax:t.max,ymin:o.min,ymax:o.max};if(!a)return e._scaleRanges=r,!0;const s=a.xmin!==t.min||a.xmax!==t.max||a.ymin!==o.min||a.ymax!==o.max;return Object.assign(a,r),s}const Jo=e=>e===0||e===1,sl=(e,t,o)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*$e/o)),il=(e,t,o)=>Math.pow(2,-10*e)*Math.sin((e-t)*$e/o)+1,fo={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Xe)+1,easeOutSine:e=>Math.sin(e*Xe),easeInOutSine:e=>-.5*(Math.cos(Pe*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Jo(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Jo(e)?e:sl(e,.075,.3),easeOutElastic:e=>Jo(e)?e:il(e,.075,.3),easeInOutElastic(e){return Jo(e)?e:e<.5?.5*sl(e*2,.1125,.45):.5+.5*il(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-fo.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?fo.easeInBounce(e*2)*.5:fo.easeOutBounce(e*2-1)*.5+.5};function Mr(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ll(e){return Mr(e)?e:new ao(e)}function Nr(e){return Mr(e)?e:new ao(e).saturate(.5).darken(.1).hexString()}const Fm=["x","y","borderWidth","radius","tension"],Im=["color","borderColor","backgroundColor"];function Rm(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Im},numbers:{type:"number",properties:Fm}}),e.describe("animations",{_fallback:"animation"}),e.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:t=>t|0}}}})}function Lm(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const cl=new Map;function $m(e,t){t=t||{};const o=e+JSON.stringify(t);let a=cl.get(o);return a||(a=new Intl.NumberFormat(e,t),cl.set(o,a)),a}function Pr(e,t,o){return $m(t,o).format(e)}const Wm={values(e){return He(e)?e:""+e},numeric(e,t,o){if(e===0)return"0";const a=this.chart.options.locale;let r,s=e;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)&&(r="scientific"),s=jm(e,o)}const i=Ji(Math.abs(s)),l=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Pr(e,a,c)}};function jm(e,t){let o=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(o)>=1&&e!==Math.floor(e)&&(o=e-Math.floor(e)),o}var dl={formatters:Wm};function Um(e){e.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:(t,o)=>o.lineWidth,tickColor:(t,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:dl.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const bn=Object.create(null),vr=Object.create(null);function ho(e,t){if(!t)return e;const o=t.split(".");for(let a=0,r=o.length;a<r;++a){const s=o[a];e=e[s]||(e[s]=Object.create(null))}return e}function Tr(e,t,o){return typeof t=="string"?ro(ho(e,t),o):ro(ho(e,""),t)}class Hm{constructor(t,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=a=>a.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=(a,r)=>Nr(r.backgroundColor),this.hoverBorderColor=(a,r)=>Nr(r.borderColor),this.hoverColor=(a,r)=>Nr(r.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(t),this.apply(o)}set(t,o){return Tr(this,t,o)}get(t){return ho(this,t)}describe(t,o){return Tr(vr,t,o)}override(t,o){return Tr(bn,t,o)}route(t,o,a,r){const s=ho(this,t),i=ho(this,a),l="_"+o;Object.defineProperties(s,{[l]:{value:s[o],writable:!0},[o]:{enumerable:!0,get(){const c=this[l],d=i[r];return Be(c)?Object.assign({},d,c):we(c,d)},set(c){this[l]=c}}})}apply(t){t.forEach(o=>o(this))}}var je=new Hm({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Rm,Lm,Um]);function qm(e){return!e||De(e.size)||De(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function ul(e,t,o,a,r){let s=t[r];return s||(s=t[r]=e.measureText(r).width,o.push(r)),s>a&&(a=s),a}function yn(e,t,o){const a=e.currentDevicePixelRatio,r=o!==0?Math.max(o/2,.5):0;return Math.round((t-r)*a)/a+r}function fl(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Or(e,t,o,a){hl(e,t,o,a,null)}function hl(e,t,o,a,r){let s,i,l,c,d,u,f,h;const m=t.pointStyle,p=t.rotation,b=t.radius;let g=(p||0)*Cm;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(o,a),e.rotate(g),e.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),e.restore();return}if(!(isNaN(b)||b<=0)){switch(e.beginPath(),m){default:r?e.ellipse(o,a,r/2,b,0,0,$e):e.arc(o,a,b,0,$e),e.closePath();break;case"triangle":u=r?r/2:b,e.moveTo(o+Math.sin(g)*u,a-Math.cos(g)*b),g+=Ki,e.lineTo(o+Math.sin(g)*u,a-Math.cos(g)*b),g+=Ki,e.lineTo(o+Math.sin(g)*u,a-Math.cos(g)*b),e.closePath();break;case"rectRounded":d=b*.516,c=b-d,i=Math.cos(g+pn)*c,f=Math.cos(g+pn)*(r?r/2-d:c),l=Math.sin(g+pn)*c,h=Math.sin(g+pn)*(r?r/2-d:c),e.arc(o-f,a-l,d,g-Pe,g-Xe),e.arc(o+h,a-i,d,g-Xe,g),e.arc(o+f,a+l,d,g,g+Xe),e.arc(o-h,a+i,d,g+Xe,g+Pe),e.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*b,u=r?r/2:c,e.rect(o-u,a-c,2*u,2*c);break}g+=pn;case"rectRot":f=Math.cos(g)*(r?r/2:b),i=Math.cos(g)*b,l=Math.sin(g)*b,h=Math.sin(g)*(r?r/2:b),e.moveTo(o-f,a-l),e.lineTo(o+h,a-i),e.lineTo(o+f,a+l),e.lineTo(o-h,a+i),e.closePath();break;case"crossRot":g+=pn;case"cross":f=Math.cos(g)*(r?r/2:b),i=Math.cos(g)*b,l=Math.sin(g)*b,h=Math.sin(g)*(r?r/2:b),e.moveTo(o-f,a-l),e.lineTo(o+f,a+l),e.moveTo(o+h,a-i),e.lineTo(o-h,a+i);break;case"star":f=Math.cos(g)*(r?r/2:b),i=Math.cos(g)*b,l=Math.sin(g)*b,h=Math.sin(g)*(r?r/2:b),e.moveTo(o-f,a-l),e.lineTo(o+f,a+l),e.moveTo(o+h,a-i),e.lineTo(o-h,a+i),g+=pn,f=Math.cos(g)*(r?r/2:b),i=Math.cos(g)*b,l=Math.sin(g)*b,h=Math.sin(g)*(r?r/2:b),e.moveTo(o-f,a-l),e.lineTo(o+f,a+l),e.moveTo(o+h,a-i),e.lineTo(o-h,a+i);break;case"line":i=r?r/2:Math.cos(g)*b,l=Math.sin(g)*b,e.moveTo(o-i,a-l),e.lineTo(o+i,a+l);break;case"dash":e.moveTo(o,a),e.lineTo(o+Math.cos(g)*(r?r/2:b),a+Math.sin(g)*b);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function mo(e,t,o){return o=o||.5,!t||e&&e.x>t.left-o&&e.x<t.right+o&&e.y>t.top-o&&e.y<t.bottom+o}function Qo(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Zo(e){e.restore()}function Gm(e,t,o,a,r){if(!t)return e.lineTo(o.x,o.y);if(r==="middle"){const s=(t.x+o.x)/2;e.lineTo(s,t.y),e.lineTo(s,o.y)}else r==="after"!=!!a?e.lineTo(t.x,o.y):e.lineTo(o.x,t.y);e.lineTo(o.x,o.y)}function Xm(e,t,o,a){if(!t)return e.lineTo(o.x,o.y);e.bezierCurveTo(a?t.cp1x:t.cp2x,a?t.cp1y:t.cp2y,a?o.cp2x:o.cp1x,a?o.cp2y:o.cp1y,o.x,o.y)}function Ym(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),De(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Km(e,t,o,a,r){if(r.strikethrough||r.underline){const s=e.measureText(a),i=t-s.actualBoundingBoxLeft,l=t+s.actualBoundingBoxRight,c=o-s.actualBoundingBoxAscent,d=o+s.actualBoundingBoxDescent,u=r.strikethrough?(c+d)/2:d;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=r.decorationWidth||2,e.moveTo(i,u),e.lineTo(l,u),e.stroke()}}function Jm(e,t){const o=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=o}function po(e,t,o,a,r,s={}){const i=He(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(e.save(),e.font=r.string,Ym(e,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&Jm(e,s.backdrop),l&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),De(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(d,o,a,s.maxWidth)),e.fillText(d,o,a,s.maxWidth),Km(e,o,a,d,s),a+=Number(r.lineHeight);e.restore()}function ea(e,t){const{x:o,y:a,w:r,h:s,radius:i}=t;e.arc(o+i.topLeft,a+i.topLeft,i.topLeft,1.5*Pe,Pe,!0),e.lineTo(o,a+s-i.bottomLeft),e.arc(o+i.bottomLeft,a+s-i.bottomLeft,i.bottomLeft,Pe,Xe,!0),e.lineTo(o+r-i.bottomRight,a+s),e.arc(o+r-i.bottomRight,a+s-i.bottomRight,i.bottomRight,Xe,0,!0),e.lineTo(o+r,a+i.topRight),e.arc(o+r-i.topRight,a+i.topRight,i.topRight,0,-Xe,!0),e.lineTo(o+i.topLeft,a)}const Qm=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Zm=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ep(e,t){const o=(""+e).match(Qm);if(!o||o[1]==="normal")return t*1.2;switch(e=+o[2],o[3]){case"px":return e;case"%":e/=100;break}return t*e}const tp=e=>+e||0;function zr(e,t){const o={},a=Be(t),r=a?Object.keys(t):t,s=Be(e)?a?i=>we(e[i],e[t[i]]):i=>e[i]:()=>e;for(const i of r)o[i]=tp(s(i));return o}function ml(e){return zr(e,{top:"y",right:"x",bottom:"y",left:"x"})}function vn(e){return zr(e,["topLeft","topRight","bottomLeft","bottomRight"])}function ht(e){const t=ml(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function nt(e,t){e=e||{},t=t||je.font;let o=we(e.size,t.size);typeof o=="string"&&(o=parseInt(o,10));let a=we(e.style,t.style);a&&!(""+a).match(Zm)&&(console.warn('Invalid font style specified: "'+a+'"'),a=void 0);const r={family:we(e.family,t.family),lineHeight:ep(we(e.lineHeight,t.lineHeight),o),size:o,style:a,weight:we(e.weight,t.weight),string:""};return r.string=qm(r),r}function ta(e,t,o,a){let r,s,i;for(r=0,s=e.length;r<s;++r)if(i=e[r],i!==void 0&&i!==void 0)return i}function np(e,t,o){const{min:a,max:r}=e,s=qi(t,(r-a)/2),i=(l,c)=>o&&l===0?0:l+c;return{min:i(a,-Math.abs(s)),max:i(r,s)}}function xn(e,t){return Object.assign(Object.create(e),t)}function Fr(e,t=[""],o,a,r=()=>e[0]){const s=o||e;typeof a>"u"&&(a=xl("_fallback",e));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:a,_getTarget:r,override:l=>Fr([l,...e],t,s,a)};return new Proxy(i,{deleteProperty(l,c){return delete l[c],delete l._keys,delete e[0][c],!0},get(l,c){return gl(l,c,()=>dp(c,t,e,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,c){return kl(l).includes(c)},ownKeys(l){return kl(l)},set(l,c,d){const u=l._storage||(l._storage=r());return l[c]=u[c]=d,delete l._keys,!0}})}function Tn(e,t,o,a){const r={_cacheable:!1,_proxy:e,_context:t,_subProxy:o,_stack:new Set,_descriptors:pl(e,a),setContext:s=>Tn(e,s,o,a),override:s=>Tn(e.override(s),t,o,a)};return new Proxy(r,{deleteProperty(s,i){return delete s[i],delete e[i],!0},get(s,i,l){return gl(s,i,()=>ap(s,i,l))},getOwnPropertyDescriptor(s,i){return s._descriptors.allKeys?Reflect.has(e,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,i)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,i){return Reflect.has(e,i)},ownKeys(){return Reflect.ownKeys(e)},set(s,i,l){return e[i]=l,delete s[i],!0}})}function pl(e,t={scriptable:!0,indexable:!0}){const{_scriptable:o=t.scriptable,_indexable:a=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:o,indexable:a,isScriptable:Zt(o)?o:()=>o,isIndexable:Zt(a)?a:()=>a}}const op=(e,t)=>e?e+Sr(t):t,Ir=(e,t)=>Be(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function gl(e,t,o){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const a=o();return e[t]=a,a}function ap(e,t,o){const{_proxy:a,_context:r,_subProxy:s,_descriptors:i}=e;let l=a[t];return Zt(l)&&i.isScriptable(t)&&(l=rp(t,l,e,o)),He(l)&&l.length&&(l=sp(t,l,e,i.isIndexable)),Ir(t,l)&&(l=Tn(l,r,s&&s[t],i)),l}function rp(e,t,o,a){const{_proxy:r,_context:s,_subProxy:i,_stack:l}=o;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);let c=t(s,i||a);return l.delete(e),Ir(e,c)&&(c=Rr(r._scopes,r,e,c)),c}function sp(e,t,o,a){const{_proxy:r,_context:s,_subProxy:i,_descriptors:l}=o;if(typeof s.index<"u"&&a(e))return t[s.index%t.length];if(Be(t[0])){const c=t,d=r._scopes.filter(u=>u!==c);t=[];for(const u of c){const f=Rr(d,r,e,u);t.push(Tn(f,s,i&&i[e],l))}}return t}function bl(e,t,o){return Zt(e)?e(t,o):e}const ip=(e,t)=>e===!0?t:typeof e=="string"?mn(t,e):void 0;function lp(e,t,o,a,r){for(const s of t){const i=ip(o,s);if(i){e.add(i);const l=bl(i._fallback,o,r);if(typeof l<"u"&&l!==o&&l!==a)return l}else if(i===!1&&typeof a<"u"&&o!==a)return null}return!1}function Rr(e,t,o,a){const r=t._rootScopes,s=bl(t._fallback,o,a),i=[...e,...r],l=new Set;l.add(a);let c=yl(l,i,o,s||o,a);return c===null||typeof s<"u"&&s!==o&&(c=yl(l,i,s,c,a),c===null)?!1:Fr(Array.from(l),[""],r,s,()=>cp(t,o,a))}function yl(e,t,o,a,r){for(;o;)o=lp(e,t,o,a,r);return o}function cp(e,t,o){const a=e._getTarget();t in a||(a[t]={});const r=a[t];return He(r)&&Be(o)?o:r||{}}function dp(e,t,o,a){let r;for(const s of t)if(r=xl(op(s,e),o),typeof r<"u")return Ir(e,r)?Rr(o,a,e,r):r}function xl(e,t){for(const o of t){if(!o)continue;const a=o[e];if(typeof a<"u")return a}}function kl(e){let t=e._keys;return t||(t=e._keys=up(e._scopes)),t}function up(e){const t=new Set;for(const o of e)for(const a of Object.keys(o).filter(r=>!r.startsWith("_")))t.add(a);return Array.from(t)}const fp=Number.EPSILON||1e-14,On=(e,t)=>t<e.length&&!e[t].skip&&e[t],wl=e=>e==="x"?"y":"x";function hp(e,t,o,a){const r=e.skip?t:e,s=t,i=o.skip?t:o,l=Ar(s,r),c=Ar(i,s);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=a*d,h=a*u;return{previous:{x:s.x-f*(i.x-r.x),y:s.y-f*(i.y-r.y)},next:{x:s.x+h*(i.x-r.x),y:s.y+h*(i.y-r.y)}}}function mp(e,t,o){const a=e.length;let r,s,i,l,c,d=On(e,0);for(let u=0;u<a-1;++u)if(c=d,d=On(e,u+1),!(!c||!d)){if(lo(t[u],0,fp)){o[u]=o[u+1]=0;continue}r=o[u]/t[u],s=o[u+1]/t[u],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(i=3/Math.sqrt(l),o[u]=r*i*t[u],o[u+1]=s*i*t[u])}}function pp(e,t,o="x"){const a=wl(o),r=e.length;let s,i,l,c=On(e,0);for(let d=0;d<r;++d){if(i=l,l=c,c=On(e,d+1),!l)continue;const u=l[o],f=l[a];i&&(s=(u-i[o])/3,l[`cp1${o}`]=u-s,l[`cp1${a}`]=f-s*t[d]),c&&(s=(c[o]-u)/3,l[`cp2${o}`]=u+s,l[`cp2${a}`]=f+s*t[d])}}function gp(e,t="x"){const o=wl(t),a=e.length,r=Array(a).fill(0),s=Array(a);let i,l,c,d=On(e,0);for(i=0;i<a;++i)if(l=c,c=d,d=On(e,i+1),!!c){if(d){const u=d[t]-c[t];r[i]=u!==0?(d[o]-c[o])/u:0}s[i]=l?d?At(r[i-1])!==At(r[i])?0:(r[i-1]+r[i])/2:r[i-1]:r[i]}mp(e,r,s),pp(e,s,t)}function na(e,t,o){return Math.max(Math.min(e,o),t)}function bp(e,t){let o,a,r,s,i,l=mo(e[0],t);for(o=0,a=e.length;o<a;++o)i=s,s=l,l=o<a-1&&mo(e[o+1],t),s&&(r=e[o],i&&(r.cp1x=na(r.cp1x,t.left,t.right),r.cp1y=na(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=na(r.cp2x,t.left,t.right),r.cp2y=na(r.cp2y,t.top,t.bottom)))}function yp(e,t,o,a,r){let s,i,l,c;if(t.spanGaps&&(e=e.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")gp(e,r);else{let d=a?e[e.length-1]:e[0];for(s=0,i=e.length;s<i;++s)l=e[s],c=hp(d,l,e[Math.min(s+1,i-(a?0:1))%i],t.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}t.capBezierPoints&&bp(e,o)}function Lr(){return typeof window<"u"&&typeof document<"u"}function $r(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function oa(e,t,o){let a;return typeof e=="string"?(a=parseInt(e,10),e.indexOf("%")!==-1&&(a=a/100*t.parentNode[o])):a=e,a}const aa=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function xp(e,t){return aa(e).getPropertyValue(t)}const kp=["top","right","bottom","left"];function kn(e,t,o){const a={};o=o?"-"+o:"";for(let r=0;r<4;r++){const s=kp[r];a[s]=parseFloat(e[t+"-"+s+o])||0}return a.width=a.left+a.right,a.height=a.top+a.bottom,a}const wp=(e,t,o)=>(e>0||t>0)&&(!o||!o.shadowRoot);function Cp(e,t){const o=e.touches,a=o&&o.length?o[0]:e,{offsetX:r,offsetY:s}=a;let i=!1,l,c;if(wp(r,s,e.target))l=r,c=s;else{const d=t.getBoundingClientRect();l=a.clientX-d.left,c=a.clientY-d.top,i=!0}return{x:l,y:c,box:i}}function wn(e,t){if("native"in e)return e;const{canvas:o,currentDevicePixelRatio:a}=t,r=aa(o),s=r.boxSizing==="border-box",i=kn(r,"padding"),l=kn(r,"border","width"),{x:c,y:d,box:u}=Cp(e,o),f=i.left+(u&&l.left),h=i.top+(u&&l.top);let{width:m,height:p}=t;return s&&(m-=i.width+l.width,p-=i.height+l.height),{x:Math.round((c-f)/m*o.width/a),y:Math.round((d-h)/p*o.height/a)}}function _p(e,t,o){let a,r;if(t===void 0||o===void 0){const s=e&&$r(e);if(!s)t=e.clientWidth,o=e.clientHeight;else{const i=s.getBoundingClientRect(),l=aa(s),c=kn(l,"border","width"),d=kn(l,"padding");t=i.width-d.width-c.width,o=i.height-d.height-c.height,a=oa(l.maxWidth,s,"clientWidth"),r=oa(l.maxHeight,s,"clientHeight")}}return{width:t,height:o,maxWidth:a||Ko,maxHeight:r||Ko}}const en=e=>Math.round(e*10)/10;function Bp(e,t,o,a){const r=aa(e),s=kn(r,"margin"),i=oa(r.maxWidth,e,"clientWidth")||Ko,l=oa(r.maxHeight,e,"clientHeight")||Ko,c=_p(e,t,o);let{width:d,height:u}=c;if(r.boxSizing==="content-box"){const h=kn(r,"border","width"),m=kn(r,"padding");d-=m.width+h.width,u-=m.height+h.height}return d=Math.max(0,d-s.width),u=Math.max(0,a?d/a:u-s.height),d=en(Math.min(d,i,c.maxWidth)),u=en(Math.min(u,l,c.maxHeight)),d&&!u&&(u=en(d/2)),(t!==void 0||o!==void 0)&&a&&c.height&&u>c.height&&(u=c.height,d=en(Math.floor(u*a))),{width:d,height:u}}function Cl(e,t,o){const a=t||1,r=en(e.height*a),s=en(e.width*a);e.height=en(e.height),e.width=en(e.width);const i=e.canvas;return i.style&&(o||!i.style.height&&!i.style.width)&&(i.style.height=`${e.height}px`,i.style.width=`${e.width}px`),e.currentDevicePixelRatio!==a||i.height!==r||i.width!==s?(e.currentDevicePixelRatio=a,i.height=r,i.width=s,e.ctx.setTransform(a,0,0,a,0,0),!0):!1}const Ep=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Lr()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function _l(e,t){const o=xp(e,t),a=o&&o.match(/^(\d+)(\.\d+)?px$/);return a?+a[1]:void 0}function Cn(e,t,o,a){return{x:e.x+o*(t.x-e.x),y:e.y+o*(t.y-e.y)}}function Sp(e,t,o,a){return{x:e.x+o*(t.x-e.x),y:a==="middle"?o<.5?e.y:t.y:a==="after"?o<1?e.y:t.y:o>0?t.y:e.y}}function Ap(e,t,o,a){const r={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},i=Cn(e,r,o),l=Cn(r,s,o),c=Cn(s,t,o),d=Cn(i,l,o),u=Cn(l,c,o);return Cn(d,u,o)}const Vp=function(e,t){return{x(o){return e+e+t-o},setWidth(o){t=o},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,a){return o-a},leftForLtr(o,a){return o-a}}},Dp=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function zn(e,t,o){return e?Vp(t,o):Dp()}function Bl(e,t){let o,a;(t==="ltr"||t==="rtl")&&(o=e.canvas.style,a=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",t,"important"),e.prevTextDirection=a)}function El(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Sl(e){return e==="angle"?{between:uo,compare:Vm,normalize:ct}:{between:Rt,compare:(t,o)=>t-o,normalize:t=>t}}function Al({start:e,end:t,count:o,loop:a,style:r}){return{start:e%o,end:t%o,loop:a&&(t-e+1)%o===0,style:r}}function Mp(e,t,o){const{property:a,start:r,end:s}=o,{between:i,normalize:l}=Sl(a),c=t.length;let{start:d,end:u,loop:f}=e,h,m;if(f){for(d+=c,u+=c,h=0,m=c;h<m&&i(l(t[d%c][a]),r,s);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:e.style}}function Vl(e,t,o){if(!o)return[e];const{property:a,start:r,end:s}=o,i=t.length,{compare:l,between:c,normalize:d}=Sl(a),{start:u,end:f,loop:h,style:m}=Mp(e,t,o),p=[];let b=!1,g=null,x,_,C;const w=()=>c(r,C,x)&&l(r,C)!==0,E=()=>l(s,x)===0||c(s,C,x),B=()=>b||w(),k=()=>!b||E();for(let y=u,A=u;y<=f;++y)_=t[y%i],!_.skip&&(x=d(_[a]),x!==C&&(b=c(x,r,s),g===null&&B()&&(g=l(x,r)===0?y:A),g!==null&&k()&&(p.push(Al({start:g,end:y,loop:h,count:i,style:m})),g=null),A=y,C=x));return g!==null&&p.push(Al({start:g,end:f,loop:h,count:i,style:m})),p}function Dl(e,t){const o=[],a=e.segments;for(let r=0;r<a.length;r++){const s=Vl(a[r],e.points,t);s.length&&o.push(...s)}return o}function Np(e,t,o,a){let r=0,s=t-1;if(o&&!a)for(;r<t&&!e[r].skip;)r++;for(;r<t&&e[r].skip;)r++;for(r%=t,o&&(s+=r);s>r&&e[s%t].skip;)s--;return s%=t,{start:r,end:s}}function Pp(e,t,o,a){const r=e.length,s=[];let i=t,l=e[t],c;for(c=t+1;c<=o;++c){const d=e[c%r];d.skip||d.stop?l.skip||(a=!1,s.push({start:t%r,end:(c-1)%r,loop:a}),t=i=d.stop?c:null):(i=c,l.skip&&(t=c)),l=d}return i!==null&&s.push({start:t%r,end:i%r,loop:a}),s}function vp(e,t){const o=e.points,a=e.options.spanGaps,r=o.length;if(!r)return[];const s=!!e._loop,{start:i,end:l}=Np(o,r,s,a);if(a===!0)return Ml(e,[{start:i,end:l,loop:s}],o,t);const c=l<i?l+r:l,d=!!e._fullLoop&&i===0&&l===r-1;return Ml(e,Pp(o,i,c,d),o,t)}function Ml(e,t,o,a){return!a||!a.setContext||!o?t:Tp(e,t,o,a)}function Tp(e,t,o,a){const r=e._chart.getContext(),s=Nl(e.options),{_datasetIndex:i,options:{spanGaps:l}}=e,c=o.length,d=[];let u=s,f=t[0].start,h=f;function m(p,b,g,x){const _=l?-1:1;if(p!==b){for(p+=c;o[p%c].skip;)p-=_;for(;o[b%c].skip;)b+=_;p%c!==b%c&&(d.push({start:p%c,end:b%c,loop:g,style:x}),u=x,f=b%c)}}for(const p of t){f=l?f:p.start;let b=o[f%c],g;for(h=f+1;h<=p.end;h++){const x=o[h%c];g=Nl(a.setContext(xn(r,{type:"segment",p0:b,p1:x,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:i}))),Op(g,u)&&m(f,h-1,p.loop,u),b=x,u=g}f<h-1&&m(f,h-1,p.loop,u)}return d}function Nl(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Op(e,t){if(!t)return!1;const o=[],a=function(r,s){return Mr(s)?(o.includes(s)||o.push(s),o.indexOf(s)):s};return JSON.stringify(e,a)!==JSON.stringify(t,a)}function ra(e,t,o){return e.options.clip?e[o]:t[o]}function zp(e,t){const{xScale:o,yScale:a}=e;return o&&a?{left:ra(o,t,"left"),right:ra(o,t,"right"),top:ra(a,t,"top"),bottom:ra(a,t,"bottom")}:t}function Pl(e,t){const o=t._clip;if(o.disabled)return!1;const a=zp(t,e.chartArea);return{left:o.left===!1?0:a.left-(o.left===!0?0:o.left),right:o.right===!1?e.width:a.right+(o.right===!0?0:o.right),top:o.top===!1?0:a.top-(o.top===!0?0:o.top),bottom:o.bottom===!1?e.height:a.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 Fp{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,o,a,r){const s=o.listeners[r],i=o.duration;s.forEach(l=>l({chart:t,initial:o.initial,numSteps:i,currentStep:Math.min(a-o.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=al.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let o=0;this._charts.forEach((a,r)=>{if(!a.running||!a.items.length)return;const s=a.items;let i=s.length-1,l=!1,c;for(;i>=0;--i)c=s[i],c._active?(c._total>a.duration&&(a.duration=c._total),c.tick(t),l=!0):(s[i]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,a,t,"progress")),s.length||(a.running=!1,this._notify(r,a,t,"complete"),a.initial=!1),o+=s.length}),this._lastDate=t,o===0&&(this._running=!1)}_getAnims(t){const o=this._charts;let a=o.get(t);return a||(a={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},o.set(t,a)),a}listen(t,o,a){this._getAnims(t).listeners[o].push(a)}add(t,o){!o||!o.length||this._getAnims(t).items.push(...o)}has(t){return this._getAnims(t).items.length>0}start(t){const o=this._charts.get(t);o&&(o.running=!0,o.start=Date.now(),o.duration=o.items.reduce((a,r)=>Math.max(a,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const o=this._charts.get(t);return!(!o||!o.running||!o.items.length)}stop(t){const o=this._charts.get(t);if(!o||!o.items.length)return;const a=o.items;let r=a.length-1;for(;r>=0;--r)a[r].cancel();o.items=[],this._notify(t,o,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Lt=new Fp;const vl="transparent",Ip={boolean(e,t,o){return o>.5?t:e},color(e,t,o){const a=ll(e||vl),r=a.valid&&ll(t||vl);return r&&r.valid?r.mix(a,o).hexString():t},number(e,t,o){return e+(t-e)*o}};class Rp{constructor(t,o,a,r){const s=o[a];r=ta([t.to,r,s,t.from]);const i=ta([t.from,s,r]);this._active=!0,this._fn=t.fn||Ip[t.type||typeof i],this._easing=uo[t.easing]||uo.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=o,this._prop=a,this._from=i,this._to=r,this._promises=void 0}active(){return this._active}update(t,o,a){if(this._active){this._notify(!1);const r=this._target[this._prop],s=a-this._start,i=this._duration-s;this._start=a,this._duration=Math.floor(Math.max(i,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=ta([t.to,o,r,t.from]),this._from=ta([t.from,r,o])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const o=t-this._start,a=this._duration,r=this._prop,s=this._from,i=this._loop,l=this._to;let c;if(this._active=s!==l&&(i||o<a),!this._active){this._target[r]=l,this._notify(!0);return}if(o<0){this._target[r]=s;return}c=o/a%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[r]=this._fn(s,l,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((o,a)=>{t.push({res:o,rej:a})})}_notify(t){const o=t?"res":"rej",a=this._promises||[];for(let r=0;r<a.length;r++)a[r][o]()}}class Tl{constructor(t,o){this._chart=t,this._properties=new Map,this.configure(o)}configure(t){if(!Be(t))return;const o=Object.keys(We.animation),a=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Be(s))return;const i={};for(const l of o)i[l]=s[l];(Ue(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!a.has(l))&&a.set(l,i)})})}_animateOptions(t,o){const a=o.options,r=$p(t,a);if(!r)return[];const s=this._createAnimations(r,a);return a.$shared&&Lp(t.options.$animations,a).then(()=>{t.options=a},()=>{}),s}_createAnimations(t,o){const a=this._properties,r=[],s=t.$animations||(t.$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"){r.push(...this._animateOptions(t,o));continue}const u=o[d];let f=s[d];const h=a.get(d);if(f)if(h&&f.active()){f.update(h,u,l);continue}else f.cancel();if(!h||!h.duration){t[d]=u;continue}s[d]=f=new Rp(h,t,d,u),r.push(f)}return r}update(t,o){if(this._properties.size===0){Object.assign(t,o);return}const a=this._createAnimations(t,o);if(a.length)return Lt.add(this._chart,a),!0}}function Lp(e,t){const o=[],a=Object.keys(t);for(let r=0;r<a.length;r++){const s=e[a[r]];s&&s.active()&&o.push(s.wait())}return Promise.all(o)}function $p(e,t){if(!t)return;let o=e.options;if(!o){e.options=t;return}return o.$shared&&(e.options=o=Object.assign({},o,{$shared:!1,$animations:{}})),o}function Ol(e,t){const o=e&&e.options||{},a=o.reverse,r=o.min===void 0?t:0,s=o.max===void 0?t:0;return{start:a?s:r,end:a?r:s}}function Wp(e,t,o){if(o===!1)return!1;const a=Ol(e,o),r=Ol(t,o);return{top:r.end,right:a.end,bottom:r.start,left:a.start}}function jp(e){let t,o,a,r;return Be(e)?(t=e.top,o=e.right,a=e.bottom,r=e.left):t=o=a=r=e,{top:t,right:o,bottom:a,left:r,disabled:e===!1}}function zl(e,t){const o=[],a=e._getSortedDatasetMetas(t);let r,s;for(r=0,s=a.length;r<s;++r)o.push(a[r].index);return o}function Fl(e,t,o,a={}){const r=e.keys,s=a.mode==="single";let i,l,c,d;if(t===null)return;let u=!1;for(i=0,l=r.length;i<l;++i){if(c=+r[i],c===o){if(u=!0,a.all)continue;break}d=e.values[c],Qe(d)&&(s||t===0||At(t)===At(d))&&(t+=d)}return!u&&!a.all?0:t}function Up(e,t){const{iScale:o,vScale:a}=t,r=o.axis==="x"?"x":"y",s=a.axis==="x"?"x":"y",i=Object.keys(e),l=new Array(i.length);let c,d,u;for(c=0,d=i.length;c<d;++c)u=i[c],l[c]={[r]:u,[s]:e[u]};return l}function Wr(e,t){const o=e&&e.options.stacked;return o||o===void 0&&t.stack!==void 0}function Hp(e,t,o){return`${e.id}.${t.id}.${o.stack||o.type}`}function qp(e){const{min:t,max:o,minDefined:a,maxDefined:r}=e.getUserBounds();return{min:a?t:Number.NEGATIVE_INFINITY,max:r?o:Number.POSITIVE_INFINITY}}function Gp(e,t,o){const a=e[t]||(e[t]={});return a[o]||(a[o]={})}function Il(e,t,o,a){for(const r of t.getMatchingVisibleMetas(a).reverse()){const s=e[r.index];if(o&&s>0||!o&&s<0)return r.index}return null}function Rl(e,t){const{chart:o,_cachedMeta:a}=e,r=o._stacks||(o._stacks={}),{iScale:s,vScale:i,index:l}=a,c=s.axis,d=i.axis,u=Hp(s,i,a),f=t.length;let h;for(let m=0;m<f;++m){const p=t[m],{[c]:g,[d]:y}=p,x=p._stacks||(p._stacks={});h=x[d]=Gp(r,u,g),h[l]=y,h._top=Il(h,i,!0,a.type),h._bottom=Il(h,i,!1,a.type);const _=h._visualValues||(h._visualValues={});_[l]=y}}function jr(e,t){const o=e.scales;return Object.keys(o).filter(a=>o[a].axis===t).shift()}function Xp(e,t){return xn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Yp(e,t,o){return xn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:o,index:t,mode:"default",type:"data"})}function po(e,t){const o=e.controller.index,a=e.vScale&&e.vScale.axis;if(a){t=t||e._parsed;for(const r of t){const s=r._stacks;if(!s||s[a]===void 0||s[a][o]===void 0)return;delete s[a][o],s[a]._visualValues!==void 0&&s[a]._visualValues[o]!==void 0&&delete s[a]._visualValues[o]}}}const Ur=e=>e==="reset"||e==="none",Ll=(e,t)=>t?e:Object.assign({},e),Kp=(e,t,o)=>e&&!t.hidden&&t._stacked&&{keys:zl(o,!0),values:null};class _n{constructor(t,o){this.chart=t,this._ctx=t.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 t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Wr(t.vScale,t),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(t){this.index!==t&&po(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,o=this._cachedMeta,a=this.getDataset(),r=(f,h,m,p)=>f==="x"?h:f==="r"?p:m,s=o.xAxisID=xe(a.xAxisID,jr(t,"x")),i=o.yAxisID=xe(a.yAxisID,jr(t,"y")),l=o.rAxisID=xe(a.rAxisID,jr(t,"r")),c=o.indexAxis,d=o.iAxisID=r(c,s,i,l),u=o.vAxisID=r(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(t){return this.chart.scales[t]}_getOtherScale(t){const o=this._cachedMeta;return t===o.iScale?o.vScale:o.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&nl(this._data,this),t._stacked&&po(t)}_dataCheck(){const t=this.getDataset(),o=t.data||(t.data=[]),a=this._data;if(Be(o)){const r=this._cachedMeta;this._data=Up(o,r)}else if(a!==o){if(a){nl(a,this);const r=this._cachedMeta;po(r),r._parsed=[]}o&&Object.isExtensible(o)&&Pm(o,this),this._syncList=[],this._data=o}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const o=this._cachedMeta,a=this.getDataset();let r=!1;this._dataCheck();const s=o._stacked;o._stacked=Wr(o.vScale,o),o.stack!==a.stack&&(r=!0,po(o),o.stack=a.stack),this._resyncElements(t),(r||s!==o._stacked)&&(Rl(this,o._parsed),o._stacked=Wr(o.vScale,o))}configure(){const t=this.chart.config,o=t.datasetScopeKeys(this._type),a=t.getOptionScopes(this.getDataset(),o,!0);this.options=t.createResolver(a,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,o){const{_cachedMeta:a,_data:r}=this,{iScale:s,_stacked:i}=a,l=s.axis;let c=t===0&&o===r.length?!0:a._sorted,d=t>0&&a._parsed[t-1],u,f,h;if(this._parsing===!1)a._parsed=r,a._sorted=!0,h=r;else{Ue(r[t])?h=this.parseArrayData(a,r,t,o):Be(r[t])?h=this.parseObjectData(a,r,t,o):h=this.parsePrimitiveData(a,r,t,o);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<o;++u)a._parsed[u+t]=f=h[u],c&&(m()&&(c=!1),d=f);a._sorted=c}i&&Rl(this,h)}parsePrimitiveData(t,o,a,r){const{iScale:s,vScale:i}=t,l=s.axis,c=i.axis,d=s.getLabels(),u=s===i,f=new Array(r);let h,m,p;for(h=0,m=r;h<m;++h)p=h+a,f[h]={[l]:u||s.parse(d[p],p),[c]:i.parse(o[p],p)};return f}parseArrayData(t,o,a,r){const{xScale:s,yScale:i}=t,l=new Array(r);let c,d,u,f;for(c=0,d=r;c<d;++c)u=c+a,f=o[u],l[c]={x:s.parse(f[0],u),y:i.parse(f[1],u)};return l}parseObjectData(t,o,a,r){const{xScale:s,yScale:i}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(r);let u,f,h,m;for(u=0,f=r;u<f;++u)h=u+a,m=o[h],d[u]={x:s.parse(mn(m,l),h),y:i.parse(mn(m,c),h)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,o,a){const r=this.chart,s=this._cachedMeta,i=o[t.axis],l={keys:zl(r,!0),values:o._stacks[t.axis]._visualValues};return Fl(l,i,s.index,{mode:a})}updateRangeFromParsed(t,o,a,r){const s=a[o.axis];let i=s===null?NaN:s;const l=r&&a._stacks[o.axis];r&&l&&(r.values=l,i=Fl(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}getMinMax(t,o){const a=this._cachedMeta,r=a._parsed,s=a._sorted&&t===a.iScale,i=r.length,l=this._getOtherScale(t),c=Kp(o,a,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=qp(l);let h,m;function p(){m=r[h];const g=m[l.axis];return!Qe(m[t.axis])||u>g||f<g}for(h=0;h<i&&!(!p()&&(this.updateRangeFromParsed(d,t,m,c),s));++h);if(s){for(h=i-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(d,t,m,c);break}}return d}getAllParsedValues(t){const o=this._cachedMeta._parsed,a=[];let r,s,i;for(r=0,s=o.length;r<s;++r)i=o[r][t.axis],Qe(i)&&a.push(i);return a}getMaxOverflow(){return!1}getLabelAndValue(t){const o=this._cachedMeta,a=o.iScale,r=o.vScale,s=this.getParsed(t);return{label:a?""+a.getLabelForValue(s[a.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const o=this._cachedMeta;this.update(t||"default"),o._clip=jp(xe(this.options.clip,Wp(o.xScale,o.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,o=this.chart,a=this._cachedMeta,r=a.data||[],s=o.chartArea,i=[],l=this._drawStart||0,c=this._drawCount||r.length-l,d=this.options.drawActiveElementsOnTop;let u;for(a.dataset&&a.dataset.draw(t,s,l,c),u=l;u<l+c;++u){const f=r[u];f.hidden||(f.active&&d?i.push(f):f.draw(t,s))}for(u=0;u<i.length;++u)i[u].draw(t,s)}getStyle(t,o){const a=o?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(a):this.resolveDataElementOptions(t||0,a)}getContext(t,o,a){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const i=this._cachedMeta.data[t];s=i.$context||(i.$context=Yp(this.getContext(),t,i)),s.parsed=this.getParsed(t),s.raw=r.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=Xp(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!o,s.mode=a,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,o){return this._resolveElementOptions(this.dataElementType.id,o,t)}_resolveElementOptions(t,o="default",a){const r=o==="active",s=this._cachedDataOpts,i=t+"-"+o,l=s[i],c=this.enableOptionSharing&&so(a);if(l)return Ll(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,t),f=r?[`${t}Hover`,"hover",t,""]:[t,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(We.elements[t]),p=()=>this.getContext(a,r,o),g=d.resolveNamedOptions(h,m,p,f);return g.$shared&&(g.$shared=c,s[i]=Object.freeze(Ll(g,c))),g}_resolveAnimations(t,o,a){const r=this.chart,s=this._cachedDataOpts,i=`animation-${o}`,l=s[i];if(l)return l;let c;if(r.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(t,a,o))}const d=new Tl(r,c&&c.animations);return c&&c._cacheable&&(s[i]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,o){return!o||Ur(t)||this.chart._animationsDisabled}_getSharedOptions(t,o){const a=this.resolveDataElementOptions(t,o),r=this._sharedOptions,s=this.getSharedOptions(a),i=this.includeOptions(o,s)||s!==r;return this.updateSharedOptions(s,o,a),{sharedOptions:s,includeOptions:i}}updateElement(t,o,a,r){Ur(r)?Object.assign(t,a):this._resolveAnimations(o,r).update(t,a)}updateSharedOptions(t,o,a){t&&!Ur(o)&&this._resolveAnimations(void 0,o).update(t,a)}_setStyle(t,o,a,r){t.active=r;const s=this.getStyle(o,r);this._resolveAnimations(o,a,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,o,a){this._setStyle(t,a,"active",!1)}setHoverStyle(t,o,a){this._setStyle(t,a,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const o=this._data,a=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const r=a.length,s=o.length,i=Math.min(s,r);i&&this.parse(0,i),s>r?this._insertElements(r,s-r,t):s<r&&this._removeElements(s,r-s)}_insertElements(t,o,a=!0){const r=this._cachedMeta,s=r.data,i=t+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=t;l<i;++l)s[l]=new this.dataElementType;this._parsing&&c(r._parsed),this.parse(t,o),a&&this.updateElements(s,t,o,"reset")}updateElements(t,o,a,r){}_removeElements(t,o){const a=this._cachedMeta;if(this._parsing){const r=a._parsed.splice(t,o);a._stacked&&po(a,r)}a.data.splice(t,o)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[o,a,r]=t;this[o](a,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,o){o&&this._sync(["_removeElements",t,o]);const a=arguments.length-2;a&&this._sync(["_insertElements",t,a])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}de(_n,"defaults",{}),de(_n,"datasetElementType",null),de(_n,"dataElementType",null);function Jp(e,t){if(!e._cache.$bar){const o=e.getMatchingVisibleMetas(t);let a=[];for(let r=0,s=o.length;r<s;r++)a=a.concat(o[r].controller.getAllParsedValues(e));e._cache.$bar=ol(a.sort((r,s)=>r-s))}return e._cache.$bar}function Qp(e){const t=e.iScale,o=Jp(t,e.type);let a=t._length,r,s,i,l;const c=()=>{i===32767||i===-32768||(so(l)&&(a=Math.min(a,Math.abs(i-l)||a)),l=i)};for(r=0,s=o.length;r<s;++r)i=t.getPixelForValue(o[r]),c();for(l=void 0,r=0,s=t.ticks.length;r<s;++r)i=t.getPixelForTick(r),c();return a}function Zp(e,t,o,a){const r=o.barThickness;let s,i;return De(r)?(s=t.min*o.categoryPercentage,i=o.barPercentage):(s=r*a,i=1),{chunk:s/a,ratio:i,start:t.pixels[e]-s/2}}function eg(e,t,o,a){const r=t.pixels,s=r[e];let i=e>0?r[e-1]:null,l=e<r.length-1?r[e+1]:null;const c=o.categoryPercentage;i===null&&(i=s-(l===null?t.end-t.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/a,ratio:o.barPercentage,start:d}}function tg(e,t,o,a){const r=o.parse(e[0],a),s=o.parse(e[1],a),i=Math.min(r,s),l=Math.max(r,s);let c=i,d=l;Math.abs(i)>Math.abs(l)&&(c=l,d=i),t[o.axis]=d,t._custom={barStart:c,barEnd:d,start:r,end:s,min:i,max:l}}function $l(e,t,o,a){return Ue(e)?tg(e,t,o,a):t[o.axis]=o.parse(e,a),t}function Wl(e,t,o,a){const r=e.iScale,s=e.vScale,i=r.getLabels(),l=r===s,c=[];let d,u,f,h;for(d=o,u=o+a;d<u;++d)h=t[d],f={},f[r.axis]=l||r.parse(i[d],d),c.push($l(h,f,s,d));return c}function Hr(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function ng(e,t,o){return e!==0?At(e):(t.isHorizontal()?1:-1)*(t.min>=o?1:-1)}function og(e){let t,o,a,r,s;return e.horizontal?(t=e.base>e.x,o="left",a="right"):(t=e.base<e.y,o="bottom",a="top"),t?(r="end",s="start"):(r="start",s="end"),{start:o,end:a,reverse:t,top:r,bottom:s}}function ag(e,t,o,a){let r=t.borderSkipped;const s={};if(!r){e.borderSkipped=s;return}if(r===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:l,reverse:c,top:d,bottom:u}=og(e);r==="middle"&&o&&(e.enableBorderRadius=!0,(o._top||0)===a?r=d:(o._bottom||0)===a?r=u:(s[jl(u,i,l,c)]=!0,r=d)),s[jl(r,i,l,c)]=!0,e.borderSkipped=s}function jl(e,t,o,a){return a?(e=rg(e,t,o),e=Ul(e,o,t)):e=Ul(e,t,o),e}function rg(e,t,o){return e===t?o:e===o?t:e}function Ul(e,t,o){return e==="start"?t:e==="end"?o:e}function sg(e,{inflateAmount:t},o){e.inflateAmount=t==="auto"?o===1?.33:0:t}class sa extends _n{parsePrimitiveData(t,o,a,r){return Wl(t,o,a,r)}parseArrayData(t,o,a,r){return Wl(t,o,a,r)}parseObjectData(t,o,a,r){const{iScale:s,vScale:i}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?l:c,u=i.axis==="x"?l:c,f=[];let h,m,p,g;for(h=a,m=a+r;h<m;++h)g=o[h],p={},p[s.axis]=s.parse(mn(g,d),h),f.push($l(mn(g,u),p,i,h));return f}updateRangeFromParsed(t,o,a,r){super.updateRangeFromParsed(t,o,a,r);const s=a._custom;s&&o===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const o=this._cachedMeta,{iScale:a,vScale:r}=o,s=this.getParsed(t),i=s._custom,l=Hr(i)?"["+i.start+", "+i.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+a.getLabelForValue(s[a.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const o=this._cachedMeta;this.updateElements(o.data,0,o.data.length,t)}updateElements(t,o,a,r){const s=r==="reset",{index:i,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(o,r);for(let m=o;m<o+a;m++){const p=this.getParsed(m),g=s||De(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),y=this._calculateBarIndexPixels(m,u),x=(p._stacks||{})[l.axis],_={horizontal:d,base:g.base,enableBorderRadius:!x||Hr(p._custom)||i===x._top||i===x._bottom,x:d?g.head:y.center,y:d?y.center:g.head,height:d?y.size:Math.abs(g.size),width:d?Math.abs(g.size):y.size};h&&(_.options=f||this.resolveDataElementOptions(m,t[m].active?"active":r));const C=_.options||t[m].options;ag(_,C,x,i),sg(_,C,u.ratio),this.updateElement(t[m],m,_,r)}}_getStacks(t,o){const{iScale:a}=this._cachedMeta,r=a.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=a.options.stacked,i=[],l=this._cachedMeta.controller.getParsed(o),c=l&&l[a.axis],d=u=>{const f=u._parsed.find(m=>m[a.axis]===c),h=f&&f[u.vScale.axis];if(De(h)||isNaN(h))return!0};for(const u of r)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===t))break;return i.length||i.push(void 0),i}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,o=this.chart.options.indexAxis;return Object.keys(t).filter(a=>t[a].axis===o).shift()}_getAxis(){const t={},o=this.getFirstScaleIdForIndexAxis();for(const a of this.chart.data.datasets)t[xe(this.chart.options.indexAxis==="x"?a.xAxisID:a.yAxisID,o)]=!0;return Object.keys(t)}_getStackIndex(t,o,a){const r=this._getStacks(t,a),s=o!==void 0?r.indexOf(o):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,o=this._cachedMeta,a=o.iScale,r=[];let s,i;for(s=0,i=o.data.length;s<i;++s)r.push(a.getPixelForValue(this.getParsed(s)[a.axis],s));const l=t.barThickness;return{min:l||Qp(o),pixels:r,start:a._startPixel,end:a._endPixel,stackCount:this._getStackCount(),scale:a,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:o,_stacked:a,index:r},options:{base:s,minBarLength:i}}=this,l=s||0,c=this.getParsed(t),d=c._custom,u=Hr(d);let f=c[o.axis],h=0,m=a?this.applyStack(o,c,a):f,p,g;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&At(f)!==At(d.barEnd)&&(h=0),h+=f);const y=!De(s)&&!u?s:h;let x=o.getPixelForValue(y);if(this.chart.getDataVisibility(t)?p=o.getPixelForValue(h+m):p=x,g=p-x,Math.abs(g)<i){g=ng(g,o,l)*i,f===l&&(x-=g/2);const _=o.getPixelForDecimal(0),C=o.getPixelForDecimal(1),w=Math.min(_,C),E=Math.max(_,C);x=Math.max(Math.min(x,E),w),p=x+g,a&&!u&&(c._stacks[o.axis]._visualValues[r]=o.getValueForPixel(p)-o.getValueForPixel(x))}if(x===o.getPixelForValue(l)){const _=At(g)*o.getLineWidthForValue(l)/2;x+=_,g-=_}return{size:g,base:x,head:p,center:p+g/2}}_calculateBarIndexPixels(t,o){const a=o.scale,r=this.options,s=r.skipNull,i=xe(r.maxBarThickness,1/0);let l,c;const d=this._getAxisCount();if(o.grouped){const u=s?this._getStackCount(t):o.stackCount,f=r.barThickness==="flex"?eg(t,o,r,u*d):Zp(t,o,r,u*d),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(xe(h,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+m;l=f.start+f.chunk*p+f.chunk/2,c=Math.min(i,f.chunk*f.ratio)}else l=a.getPixelForValue(this.getParsed(t)[a.axis],t),c=Math.min(i,o.min*o.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const t=this._cachedMeta,o=t.vScale,a=t.data,r=a.length;let s=0;for(;s<r;++s)this.getParsed(s)[o.axis]!==null&&!a[s].hidden&&a[s].draw(this._ctx)}}de(sa,"id","bar"),de(sa,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),de(sa,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function ig(e,t,o){let a=1,r=1,s=0,i=0;if(t<Le){const l=e,c=l+t,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(C,w,E)=>co(C,l,c,!0)?1:Math.max(w,w*o,E,E*o),p=(C,w,E)=>co(C,l,c,!0)?-1:Math.min(w,w*o,E,E*o),g=m(0,d,f),y=m(Ge,u,h),x=p(Ne,d,f),_=p(Ne+Ge,u,h);a=(g-x)/2,r=(y-_)/2,s=-(g+x)/2,i=-(y+_)/2}return{ratioX:a,ratioY:r,offsetX:s,offsetY:i}}class Fn extends _n{constructor(t,o){super(t,o),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,o){const a=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=a;else{let s=c=>+a[c];if(Be(a[t])){const{key:c="value"}=this._parsing;s=d=>+mn(a[d],c)}let i,l;for(i=t,l=t+o;i<l;++i)r._parsed[i]=s(i)}}_getRotation(){return It(this.options.rotation-90)}_getCircumference(){return It(this.options.circumference)}_getRotationExtents(){let t=Le,o=-Le;for(let a=0;a<this.chart.data.datasets.length;++a)if(this.chart.isDatasetVisible(a)&&this.chart.getDatasetMeta(a).type===this._type){const r=this.chart.getDatasetMeta(a).controller,s=r._getRotation(),i=r._getCircumference();t=Math.min(t,s),o=Math.max(o,s+i)}return{rotation:t,circumference:o-t}}update(t){const o=this.chart,{chartArea:a}=o,r=this._cachedMeta,s=r.data,i=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(a.width,a.height)-i)/2,0),c=Math.min(pm(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:g}=ig(f,u,c),y=(a.width-i)/h,x=(a.height-i)/m,_=Math.max(Math.min(y,x)/2,0),C=qi(this.options.radius,_),w=Math.max(C*c,0),E=(C-w)/this._getVisibleDatasetWeightTotal();this.offsetX=p*C,this.offsetY=g*C,r.total=this.calculateTotal(),this.outerRadius=C-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*d,0),this.updateElements(s,0,s.length,t)}_circumference(t,o){const a=this.options,r=this._cachedMeta,s=this._getCircumference();return o&&a.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/Le)}updateElements(t,o,a,r){const s=r==="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,p=h?0:this.outerRadius,{sharedOptions:g,includeOptions:y}=this._getSharedOptions(o,r);let x=this._getRotation(),_;for(_=0;_<o;++_)x+=this._circumference(_,s);for(_=o;_<o+a;++_){const C=this._circumference(_,s),w=t[_],E={x:u+this.offsetX,y:f+this.offsetY,startAngle:x,endAngle:x+C,circumference:C,outerRadius:p,innerRadius:m};y&&(E.options=g||this.resolveDataElementOptions(_,w.active?"active":r)),x+=C,this.updateElement(w,_,E,r)}}calculateTotal(){const t=this._cachedMeta,o=t.data;let a=0,r;for(r=0;r<o.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!o[r].hidden&&(a+=Math.abs(s))}return a}calculateCircumference(t){const o=this._cachedMeta.total;return o>0&&!isNaN(t)?Le*(Math.abs(t)/o):0}getLabelAndValue(t){const o=this._cachedMeta,a=this.chart,r=a.data.labels||[],s=Pr(o._parsed[t],a.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let o=0;const a=this.chart;let r,s,i,l,c;if(!t){for(r=0,s=a.data.datasets.length;r<s;++r)if(a.isDatasetVisible(r)){i=a.getDatasetMeta(r),t=i.data,l=i.controller;break}}if(!t)return 0;for(r=0,s=t.length;r<s;++r)c=l.resolveDataElementOptions(r),c.borderAlign!=="inner"&&(o=Math.max(o,c.borderWidth||0,c.hoverBorderWidth||0));return o}getMaxOffset(t){let o=0;for(let a=0,r=t.length;a<r;++a){const s=this.resolveDataElementOptions(a);o=Math.max(o,s.offset||0,s.hoverOffset||0)}return o}_getRingWeightOffset(t){let o=0;for(let a=0;a<t;++a)this.chart.isDatasetVisible(a)&&(o+=this._getRingWeight(a));return o}_getRingWeight(t){return Math.max(xe(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}de(Fn,"id","doughnut"),de(Fn,"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"}),de(Fn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),de(Fn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const o=t.data,{labels:{pointStyle:a,textAlign:r,color:s,useBorderRadius:i,borderRadius:l}}=t.legend.options;return o.labels.length&&o.datasets.length?o.labels.map((c,d)=>{const f=t.getDatasetMeta(0).controller.getStyle(d);return{text:c,fillStyle:f.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:r,pointStyle:a,borderRadius:i&&(l||f.borderRadius),index:d}}):[]}},onClick(t,o,a){a.chart.toggleDataVisibility(o.index),a.chart.update()}}}});class ia extends _n{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const o=this._cachedMeta,{dataset:a,data:r=[],_dataset:s}=o,i=this.chart._animationsDisabled;let{start:l,count:c}=Om(o,r,i);this._drawStart=l,this._drawCount=c,zm(o)&&(l=0,c=r.length),a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!s._decimated,a.points=r;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:d},t),this.updateElements(r,l,c,t)}updateElements(t,o,a,r){const s=r==="reset",{iScale:i,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(o,r),h=i.axis,m=l.axis,{spanGaps:p,segment:g}=this.options,y=lo(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||s||r==="none",_=o+a,C=t.length;let w=o>0&&this.getParsed(o-1);for(let E=0;E<C;++E){const B=t[E],k=x?B:{};if(E<o||E>=_){k.skip=!0;continue}const b=this.getParsed(E),A=De(b[m]),D=k[h]=i.getPixelForValue(b[h],E),P=k[m]=s||A?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,b,c):b[m],E);k.skip=isNaN(D)||isNaN(P)||A,k.stop=E>0&&Math.abs(b[h]-w[h])>y,g&&(k.parsed=b,k.raw=d.data[E]),f&&(k.options=u||this.resolveDataElementOptions(E,B.active?"active":r)),x||this.updateElement(B,E,k,r),w=b}}getMaxOverflow(){const t=this._cachedMeta,o=t.dataset,a=o.options&&o.options.borderWidth||0,r=t.data||[];if(!r.length)return a;const s=r[0].size(this.resolveDataElementOptions(0)),i=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(a,s,i)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}de(ia,"id","line"),de(ia,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),de(ia,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class qr extends Fn{}de(qr,"id","pie"),de(qr,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function Bn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Gr{constructor(t){de(this,"options");this.options=t||{}}static override(t){Object.assign(Gr.prototype,t)}init(){}formats(){return Bn()}parse(){return Bn()}format(){return Bn()}add(){return Bn()}diff(){return Bn()}startOf(){return Bn()}endOf(){return Bn()}}var lg={_date:Gr};function cg(e,t,o,a){const{controller:r,data:s,_sorted:i}=e,l=r._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&i&&s.length){const d=l._reversePixels?Mm:gn;if(a){if(r._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(t);if(f){const h=d(s,t,o-f),m=d(s,t,o+f);return{lo:h.lo,hi:m.hi}}}}else{const u=d(s,t,o);if(c){const{vScale:f}=r._cachedMeta,{_parsed:h}=e,m=h.slice(0,u.lo+1).reverse().findIndex(g=>!De(g[f.axis]));u.lo-=Math.max(0,m);const p=h.slice(u.hi).findIndex(g=>!De(g[f.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:s.length-1}}function la(e,t,o,a,r){const s=e.getSortedVisibleDatasetMetas(),i=o[t];for(let l=0,c=s.length;l<c;++l){const{index:d,data:u}=s[l],{lo:f,hi:h}=cg(s[l],t,i,r);for(let m=f;m<=h;++m){const p=u[m];p.skip||a(p,d,m)}}}function dg(e){const t=e.indexOf("x")!==-1,o=e.indexOf("y")!==-1;return function(a,r){const s=t?Math.abs(a.x-r.x):0,i=o?Math.abs(a.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(i,2))}}function Xr(e,t,o,a,r){const s=[];return!r&&!e.isPointInArea(t)||la(e,o,t,function(l,c,d){!r&&!ho(l,e.chartArea,0)||l.inRange(t.x,t.y,a)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function ug(e,t,o,a){let r=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],a),{angle:f}=el(i,{x:t.x,y:t.y});co(f,d,u)&&r.push({element:i,datasetIndex:l,index:c})}return la(e,o,t,s),r}function fg(e,t,o,a,r,s){let i=[];const l=dg(o);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(t.x,t.y,r);if(a&&!m)return;const p=u.getCenterPoint(r);if(!(!!s||e.isPointInArea(p))&&!m)return;const y=l(t,p);y<c?(i=[{element:u,datasetIndex:f,index:h}],c=y):y===c&&i.push({element:u,datasetIndex:f,index:h})}return la(e,o,t,d),i}function Yr(e,t,o,a,r,s){return!s&&!e.isPointInArea(t)?[]:o==="r"&&!a?ug(e,t,o,r):fg(e,t,o,a,r,s)}function Hl(e,t,o,a,r){const s=[],i=o==="x"?"inXRange":"inYRange";let l=!1;return la(e,o,t,(c,d,u)=>{c[i]&&c[i](t[o],r)&&(s.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(t.x,t.y,r))}),a&&!l?[]:s}var hg={modes:{index(e,t,o,a){const r=wn(t,e),s=o.axis||"x",i=o.includeInvisible||!1,l=o.intersect?Xr(e,r,s,a,i):Yr(e,r,s,!1,a,i),c=[];return l.length?(e.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(e,t,o,a){const r=wn(t,e),s=o.axis||"xy",i=o.includeInvisible||!1;let l=o.intersect?Xr(e,r,s,a,i):Yr(e,r,s,!1,a,i);if(l.length>0){const c=l[0].datasetIndex,d=e.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(e,t,o,a){const r=wn(t,e),s=o.axis||"xy",i=o.includeInvisible||!1;return Xr(e,r,s,a,i)},nearest(e,t,o,a){const r=wn(t,e),s=o.axis||"xy",i=o.includeInvisible||!1;return Yr(e,r,s,o.intersect,a,i)},x(e,t,o,a){const r=wn(t,e);return Hl(e,r,"x",o.intersect,a)},y(e,t,o,a){const r=wn(t,e);return Hl(e,r,"y",o.intersect,a)}}};const ql=["left","top","right","bottom"];function go(e,t){return e.filter(o=>o.pos===t)}function Gl(e,t){return e.filter(o=>ql.indexOf(o.pos)===-1&&o.box.axis===t)}function bo(e,t){return e.sort((o,a)=>{const r=t?a:o,s=t?o:a;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function mg(e){const t=[];let o,a,r,s,i,l;for(o=0,a=(e||[]).length;o<a;++o)r=e[o],{position:s,options:{stack:i,stackWeight:l=1}}=r,t.push({index:o,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:i&&s+i,stackWeight:l});return t}function pg(e){const t={};for(const o of e){const{stack:a,pos:r,stackWeight:s}=o;if(!a||!ql.includes(r))continue;const i=t[a]||(t[a]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=s}return t}function gg(e,t){const o=pg(e),{vBoxMaxWidth:a,hBoxMaxHeight:r}=t;let s,i,l;for(s=0,i=e.length;s<i;++s){l=e[s];const{fullSize:c}=l.box,d=o[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*a:c&&t.availableWidth,l.height=r):(l.width=a,l.height=u?u*r:c&&t.availableHeight)}return o}function bg(e){const t=mg(e),o=bo(t.filter(d=>d.box.fullSize),!0),a=bo(go(t,"left"),!0),r=bo(go(t,"right")),s=bo(go(t,"top"),!0),i=bo(go(t,"bottom")),l=Gl(t,"x"),c=Gl(t,"y");return{fullSize:o,leftAndTop:a.concat(s),rightAndBottom:r.concat(c).concat(i).concat(l),chartArea:go(t,"chartArea"),vertical:a.concat(r).concat(c),horizontal:s.concat(i).concat(l)}}function Xl(e,t,o,a){return Math.max(e[o],t[o])+Math.max(e[a],t[a])}function Yl(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function yg(e,t,o,a){const{pos:r,box:s}=o,i=e.maxPadding;if(!Be(r)){o.size&&(e[r]-=o.size);const f=a[o.stack]||{size:0,count:1};f.size=Math.max(f.size,o.horizontal?s.height:s.width),o.size=f.size/f.count,e[r]+=o.size}s.getPadding&&Yl(i,s.getPadding());const l=Math.max(0,t.outerWidth-Xl(i,e,"left","right")),c=Math.max(0,t.outerHeight-Xl(i,e,"top","bottom")),d=l!==e.w,u=c!==e.h;return e.w=l,e.h=c,o.horizontal?{same:d,other:u}:{same:u,other:d}}function xg(e){const t=e.maxPadding;function o(a){const r=Math.max(t[a]-e[a],0);return e[a]+=r,r}e.y+=o("top"),e.x+=o("left"),o("right"),o("bottom")}function kg(e,t){const o=t.maxPadding;function a(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(i=>{s[i]=Math.max(t[i],o[i])}),s}return a(e?["left","right"]:["top","bottom"])}function yo(e,t,o,a){const r=[];let s,i,l,c,d,u;for(s=0,i=e.length,d=0;s<i;++s){l=e[s],c=l.box,c.update(l.width||t.w,l.height||t.h,kg(l.horizontal,t));const{same:f,other:h}=yg(t,o,l,a);d|=f&&r.length,u=u||h,c.fullSize||r.push(l)}return d&&yo(r,t,o,a)||u}function ca(e,t,o,a,r){e.top=o,e.left=t,e.right=t+a,e.bottom=o+r,e.width=a,e.height=r}function Kl(e,t,o,a){const r=o.padding;let{x:s,y:i}=t;for(const l of e){const c=l.box,d=a[l.stack]||{placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=t.w*u,h=d.size||c.height;so(d.start)&&(i=d.start),c.fullSize?ca(c,r.left,i,o.outerWidth-r.right-r.left,h):ca(c,t.left+d.placed,i,f,h),d.start=i,d.placed+=f,i=c.bottom}else{const f=t.h*u,h=d.size||c.width;so(d.start)&&(s=d.start),c.fullSize?ca(c,s,r.top,h,o.outerHeight-r.bottom-r.top):ca(c,s,t.top+d.placed,h,f),d.start=s,d.placed+=f,s=c.right}}t.x=s,t.y=i}var mt={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(o){t.draw(o)}}]},e.boxes.push(t)},removeBox(e,t){const o=e.boxes?e.boxes.indexOf(t):-1;o!==-1&&e.boxes.splice(o,1)},configure(e,t,o){t.fullSize=o.fullSize,t.position=o.position,t.weight=o.weight},update(e,t,o,a){if(!e)return;const r=ht(e.options.layout.padding),s=Math.max(t-r.width,0),i=Math.max(o-r.height,0),l=bg(e.boxes),c=l.vertical,d=l.horizontal;Me(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=c.reduce((g,y)=>y.box.options&&y.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:o,padding:r,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),h=Object.assign({},r);Yl(h,ht(a));const m=Object.assign({maxPadding:h,w:s,h:i,x:r.left,y:r.top},r),p=gg(c.concat(d),f);yo(l.fullSize,m,f,p),yo(c,m,f,p),yo(d,m,f,p)&&yo(c,m,f,p),xg(m),Kl(l.leftAndTop,m,f,p),m.x+=m.w,m.y+=m.h,Kl(l.rightAndBottom,m,f,p),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Me(l.chartArea,g=>{const y=g.box;Object.assign(y,e.chartArea),y.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Jl{acquireContext(t,o){}releaseContext(t){return!1}addEventListener(t,o,a){}removeEventListener(t,o,a){}getDevicePixelRatio(){return 1}getMaximumSize(t,o,a,r){return o=Math.max(0,o||t.width),a=a||t.height,{width:o,height:Math.max(0,r?Math.floor(o/r):a)}}isAttached(t){return!0}updateConfig(t){}}class wg extends Jl{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const da="$chartjs",Cg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ql=e=>e===null||e==="";function _g(e,t){const o=e.style,a=e.getAttribute("height"),r=e.getAttribute("width");if(e[da]={initial:{height:a,width:r,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",Ql(r)){const s=_l(e,"width");s!==void 0&&(e.width=s)}if(Ql(a))if(e.style.height==="")e.height=e.width/(t||2);else{const s=_l(e,"height");s!==void 0&&(e.height=s)}return e}const Zl=Ep?{passive:!0}:!1;function Bg(e,t,o){e&&e.addEventListener(t,o,Zl)}function Eg(e,t,o){e&&e.canvas&&e.canvas.removeEventListener(t,o,Zl)}function Sg(e,t){const o=Cg[e.type]||e.type,{x:a,y:r}=wn(e,t);return{type:o,chart:t,native:e,x:a!==void 0?a:null,y:r!==void 0?r:null}}function ua(e,t){for(const o of e)if(o===t||o.contains(t))return!0}function Ag(e,t,o){const a=e.canvas,r=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||ua(l.addedNodes,a),i=i&&!ua(l.removedNodes,a);i&&o()});return r.observe(document,{childList:!0,subtree:!0}),r}function Vg(e,t,o){const a=e.canvas,r=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||ua(l.removedNodes,a),i=i&&!ua(l.addedNodes,a);i&&o()});return r.observe(document,{childList:!0,subtree:!0}),r}const xo=new Map;let ec=0;function tc(){const e=window.devicePixelRatio;e!==ec&&(ec=e,xo.forEach((t,o)=>{o.currentDevicePixelRatio!==e&&t()}))}function Dg(e,t){xo.size||window.addEventListener("resize",tc),xo.set(e,t)}function Mg(e){xo.delete(e),xo.size||window.removeEventListener("resize",tc)}function Ng(e,t,o){const a=e.canvas,r=a&&$r(a);if(!r)return;const s=rl((l,c)=>{const d=r.clientWidth;o(l,c),d<r.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(r),Dg(e,s),i}function Kr(e,t,o){o&&o.disconnect(),t==="resize"&&Mg(e)}function Pg(e,t,o){const a=e.canvas,r=rl(s=>{e.ctx!==null&&o(Sg(s,e))},e);return Bg(a,t,r),r}class vg extends Jl{acquireContext(t,o){const a=t&&t.getContext&&t.getContext("2d");return a&&a.canvas===t?(_g(t,o),a):null}releaseContext(t){const o=t.canvas;if(!o[da])return!1;const a=o[da].initial;["height","width"].forEach(s=>{const i=a[s];De(i)?o.removeAttribute(s):o.setAttribute(s,i)});const r=a.style||{};return Object.keys(r).forEach(s=>{o.style[s]=r[s]}),o.width=o.width,delete o[da],!0}addEventListener(t,o,a){this.removeEventListener(t,o);const r=t.$proxies||(t.$proxies={}),i={attach:Ag,detach:Vg,resize:Ng}[o]||Pg;r[o]=i(t,o,a)}removeEventListener(t,o){const a=t.$proxies||(t.$proxies={}),r=a[o];if(!r)return;({attach:Kr,detach:Kr,resize:Kr}[o]||Eg)(t,o,r),a[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,o,a,r){return Bp(t,o,a,r)}isAttached(t){const o=t&&$r(t);return!!(o&&o.isConnected)}}function Tg(e){return!Lr()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?wg:vg}let $t=(Ha=class{constructor(){de(this,"x");de(this,"y");de(this,"active",!1);de(this,"options");de(this,"$animations")}tooltipPosition(t){const{x:o,y:a}=this.getProps(["x","y"],t);return{x:o,y:a}}hasValue(){return lo(this.x)&&lo(this.y)}getProps(t,o){const a=this.$animations;if(!o||!a)return this;const r={};return t.forEach(s=>{r[s]=a[s]&&a[s].active()?a[s]._to:this[s]}),r}},de(Ha,"defaults",{}),de(Ha,"defaultRoutes"),Ha);function Og(e,t){const o=e.options.ticks,a=zg(e),r=Math.min(o.maxTicksLimit||a,a),s=o.major.enabled?Ig(t):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>r)return Rg(t,d,s,i/r),d;const u=Fg(s,t,r);if(i>0){let f,h;const m=i>1?Math.round((c-l)/(i-1)):null;for(fa(t,d,u,De(m)?0:l-m,l),f=0,h=i-1;f<h;f++)fa(t,d,u,s[f],s[f+1]);return fa(t,d,u,c,De(m)?t.length:c+m),d}return fa(t,d,u),d}function zg(e){const t=e.options.offset,o=e._tickSize(),a=e._length/o+(t?0:1),r=e._maxLength/o;return Math.floor(Math.min(a,r))}function Fg(e,t,o){const a=Lg(e),r=t.length/o;if(!a)return Math.max(r,1);const s=_m(a);for(let i=0,l=s.length-1;i<l;i++){const c=s[i];if(c>r)return c}return Math.max(r,1)}function Ig(e){const t=[];let o,a;for(o=0,a=e.length;o<a;o++)e[o].major&&t.push(o);return t}function Rg(e,t,o,a){let r=0,s=o[0],i;for(a=Math.ceil(a),i=0;i<e.length;i++)i===s&&(t.push(e[i]),r++,s=o[r*a])}function fa(e,t,o,a,r){const s=xe(a,0),i=Math.min(xe(r,e.length),e.length);let l=0,c,d,u;for(o=Math.ceil(o),r&&(c=r-a,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&&(t.push(e[d]),l++,u=Math.round(s+l*o))}function Lg(e){const t=e.length;let o,a;if(t<2)return!1;for(a=e[0],o=1;o<t;++o)if(e[o]-e[o-1]!==a)return!1;return a}const $g=e=>e==="left"?"right":e==="right"?"left":e,nc=(e,t,o)=>t==="top"||t==="left"?e[t]+o:e[t]-o,oc=(e,t)=>Math.min(t||e,e);function ac(e,t){const o=[],a=e.length/t,r=e.length;let s=0;for(;s<r;s+=a)o.push(e[Math.floor(s)]);return o}function Wg(e,t,o){const a=e.ticks.length,r=Math.min(t,a-1),s=e._startPixel,i=e._endPixel,l=1e-6;let c=e.getPixelForTick(r),d;if(!(o&&(a===1?d=Math.max(c-s,i-c):t===0?d=(e.getPixelForTick(1)-c)/2:d=(c-e.getPixelForTick(r-1))/2,c+=r<t?d:-d,c<s-l||c>i+l)))return c}function jg(e,t){Me(e,o=>{const a=o.gc,r=a.length/2;let s;if(r>t){for(s=0;s<r;++s)delete o.data[a[s]];a.splice(0,r)}})}function ko(e){return e.drawTicks?e.tickLength:0}function rc(e,t){if(!e.display)return 0;const o=tt(e.font,t),a=ht(e.padding);return(Ue(e.text)?e.text.length:1)*o.lineHeight+a.height}function Ug(e,t){return xn(e,{scale:t,type:"scale"})}function Hg(e,t,o){return xn(e,{tick:o,index:t,type:"tick"})}function qg(e,t,o){let a=Dr(e);return(o&&t!=="right"||!o&&t==="right")&&(a=$g(a)),a}function Gg(e,t,o,a){const{top:r,left:s,bottom:i,right:l,chart:c}=e,{chartArea:d,scales:u}=c;let f=0,h,m,p;const g=i-r,y=l-s;if(e.isHorizontal()){if(m=et(a,s,l),Be(o)){const x=Object.keys(o)[0],_=o[x];p=u[x].getPixelForValue(_)+g-t}else o==="center"?p=(d.bottom+d.top)/2+g-t:p=nc(e,o,t);h=l-s}else{if(Be(o)){const x=Object.keys(o)[0],_=o[x];m=u[x].getPixelForValue(_)-y+t}else o==="center"?m=(d.left+d.right)/2-y+t:m=nc(e,o,t);p=et(a,i,r),f=o==="left"?-Ge:Ge}return{titleX:m,titleY:p,maxWidth:h,rotation:f}}class In extends $t{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.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(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,o){return t}getUserBounds(){let{_userMin:t,_userMax:o,_suggestedMin:a,_suggestedMax:r}=this;return t=St(t,Number.POSITIVE_INFINITY),o=St(o,Number.NEGATIVE_INFINITY),a=St(a,Number.POSITIVE_INFINITY),r=St(r,Number.NEGATIVE_INFINITY),{min:St(t,a),max:St(o,r),minDefined:Qe(t),maxDefined:Qe(o)}}getMinMax(t){let{min:o,max:a,minDefined:r,maxDefined:s}=this.getUserBounds(),i;if(r&&s)return{min:o,max:a};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)i=l[c].controller.getMinMax(this,t),r||(o=Math.min(o,i.min)),s||(a=Math.max(a,i.max));return o=s&&o>a?a:o,a=r&&o>a?o:a,{min:St(o,St(a,o)),max:St(a,St(o,a))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Fe(this.options.beforeUpdate,[this])}update(t,o,a){const{beginAtZero:r,grace:s,ticks:i}=this.options,l=i.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=o,this._margins=a=Object.assign({left:0,right:0,top:0,bottom:0},a),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+a.left+a.right:this.height+a.top+a.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=np(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?ac(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=Og(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,o,a;this.isHorizontal()?(o=this.left,a=this.right):(o=this.top,a=this.bottom,t=!t),this._startPixel=o,this._endPixel=a,this._reversePixels=t,this._length=a-o,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Fe(this.options.afterUpdate,[this])}beforeSetDimensions(){Fe(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(){Fe(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Fe(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Fe(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const o=this.options.ticks;let a,r,s;for(a=0,r=t.length;a<r;a++)s=t[a],s.label=Fe(o.callback,[s.value,a,t],this)}afterTickToLabelConversion(){Fe(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Fe(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,o=t.ticks,a=oc(this.ticks.length,t.ticks.maxTicksLimit),r=o.minRotation||0,s=o.maxRotation;let i=r,l,c,d;if(!this._isVisible()||!o.display||r>=s||a<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=Ze(this.chart.width-f,0,this.maxWidth);l=t.offset?this.maxWidth/a:m/(a-1),f+6>l&&(l=m/(a-(t.offset?.5:1)),c=this.maxHeight-ko(t.grid)-o.padding-rc(t.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),i=Am(Math.min(Math.asin(Ze((u.highest.height+6)/l,-1,1)),Math.asin(Ze(c/d,-1,1))-Math.asin(Ze(h/d,-1,1)))),i=Math.max(r,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){Fe(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Fe(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:o,options:{ticks:a,title:r,grid:s}}=this,i=this._isVisible(),l=this.isHorizontal();if(i){const c=rc(r,o.options.font);if(l?(t.width=this.maxWidth,t.height=ko(s)+c):(t.height=this.maxHeight,t.width=ko(s)+c),a.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=a.padding*2,p=It(this.labelRotation),g=Math.cos(p),y=Math.sin(p);if(l){const x=a.mirror?0:y*f.width+g*h.height;t.height=Math.min(this.maxHeight,t.height+x+m)}else{const x=a.mirror?0:g*f.width+y*h.height;t.width=Math.min(this.maxWidth,t.width+x+m)}this._calculatePadding(d,u,y,g)}}this._handleMargins(),l?(this.width=this._length=o.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=o.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,o,a,r){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=r*t.width,m=a*o.height):(h=a*t.height,m=r*o.width):s==="start"?m=o.width:s==="end"?h=t.width:s!=="inner"&&(h=t.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=t.height/2;s==="start"?(u=0,f=t.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(){Fe(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:o}=this.options;return o==="top"||o==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let o,a;for(o=0,a=t.length;o<a;o++)De(t[o].label)&&(t.splice(o,1),a--,o--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const o=this.options.ticks.sampleSize;let a=this.ticks;o<a.length&&(a=ac(a,o)),this._labelSizes=t=this._computeLabelSizes(a,a.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,o,a){const{ctx:r,_longestTextCache:s}=this,i=[],l=[],c=Math.floor(o/oc(o,a));let d=0,u=0,f,h,m,p,g,y,x,_,C,w,E;for(f=0;f<o;f+=c){if(p=t[f].label,g=this._resolveTickFontOptions(f),r.font=y=g.string,x=s[y]=s[y]||{data:{},gc:[]},_=g.lineHeight,C=w=0,!De(p)&&!Ue(p))C=ul(r,x.data,x.gc,C,p),w=_;else if(Ue(p))for(h=0,m=p.length;h<m;++h)E=p[h],!De(E)&&!Ue(E)&&(C=ul(r,x.data,x.gc,C,E),w+=_);i.push(C),l.push(w),d=Math.max(C,d),u=Math.max(w,u)}jg(s,o);const B=i.indexOf(d),k=l.indexOf(u),b=A=>({width:i[A]||0,height:l[A]||0});return{first:b(0),last:b(o-1),widest:b(B),highest:b(k),widths:i,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,o){return NaN}getValueForPixel(t){}getPixelForTick(t){const o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const o=this._startPixel+t*this._length;return Dm(this._alignToPixels?yn(this.chart,o,0):o)}getDecimalForPixel(t){const o=(t-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:o}=this;return t<0&&o<0?o:t>0&&o>0?t:0}getContext(t){const o=this.ticks||[];if(t>=0&&t<o.length){const a=o[t];return a.$context||(a.$context=Hg(this.getContext(),t,a))}return this.$context||(this.$context=Ug(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,o=It(this.labelRotation),a=Math.abs(Math.cos(o)),r=Math.abs(Math.sin(o)),s=this._getLabelSizes(),i=t.autoSkipPadding||0,l=s?s.widest.width+i:0,c=s?s.highest.height+i:0;return this.isHorizontal()?c*a>l*r?l/a:c/r:c*r<l*a?c/a:l/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const o=this.axis,a=this.chart,r=this.options,{grid:s,position:i,border:l}=r,c=s.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),h=ko(s),m=[],p=l.setContext(this.getContext()),g=p.display?p.width:0,y=g/2,x=function(v){return yn(a,v,g)};let _,C,w,E,B,k,b,A,D,P,V,M;if(i==="top")_=x(this.bottom),k=this.bottom-h,A=_-y,P=x(t.top)+y,M=t.bottom;else if(i==="bottom")_=x(this.top),P=t.top,M=x(t.bottom)-y,k=_+y,A=this.top+h;else if(i==="left")_=x(this.right),B=this.right-h,b=_-y,D=x(t.left)+y,V=t.right;else if(i==="right")_=x(this.left),D=t.left,V=x(t.right)-y,B=_+y,b=this.left+h;else if(o==="x"){if(i==="center")_=x((t.top+t.bottom)/2+.5);else if(Be(i)){const v=Object.keys(i)[0],T=i[v];_=x(this.chart.scales[v].getPixelForValue(T))}P=t.top,M=t.bottom,k=_+y,A=k+h}else if(o==="y"){if(i==="center")_=x((t.left+t.right)/2);else if(Be(i)){const v=Object.keys(i)[0],T=i[v];_=x(this.chart.scales[v].getPixelForValue(T))}B=_-y,b=B-h,D=t.left,V=t.right}const z=xe(r.ticks.maxTicksLimit,f),N=Math.max(1,Math.ceil(f/z));for(C=0;C<f;C+=N){const v=this.getContext(C),T=s.setContext(v),R=l.setContext(v),H=T.lineWidth,O=T.color,$=R.dash||[],Y=R.dashOffset,X=T.tickWidth,j=T.tickColor,ee=T.tickBorderDash||[],ne=T.tickBorderDashOffset;w=Wg(this,C,c),w!==void 0&&(E=yn(a,w,H),d?B=b=D=V=E:k=A=P=M=E,m.push({tx1:B,ty1:k,tx2:b,ty2:A,x1:D,y1:P,x2:V,y2:M,width:H,color:O,borderDash:$,borderDashOffset:Y,tickWidth:X,tickColor:j,tickBorderDash:ee,tickBorderDashOffset:ne}))}return this._ticksLength=f,this._borderValue=_,m}_computeLabelItems(t){const o=this.axis,a=this.options,{position:r,ticks:s}=a,i=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=s,h=ko(a.grid),m=h+u,p=f?-u:m,g=-It(this.labelRotation),y=[];let x,_,C,w,E,B,k,b,A,D,P,V,M="middle";if(r==="top")B=this.bottom-p,k=this._getXAxisLabelAlignment();else if(r==="bottom")B=this.top+p,k=this._getXAxisLabelAlignment();else if(r==="left"){const N=this._getYAxisLabelAlignment(h);k=N.textAlign,E=N.x}else if(r==="right"){const N=this._getYAxisLabelAlignment(h);k=N.textAlign,E=N.x}else if(o==="x"){if(r==="center")B=(t.top+t.bottom)/2+m;else if(Be(r)){const N=Object.keys(r)[0],v=r[N];B=this.chart.scales[N].getPixelForValue(v)+m}k=this._getXAxisLabelAlignment()}else if(o==="y"){if(r==="center")E=(t.left+t.right)/2-m;else if(Be(r)){const N=Object.keys(r)[0],v=r[N];E=this.chart.scales[N].getPixelForValue(v)}k=this._getYAxisLabelAlignment(h).textAlign}o==="y"&&(c==="start"?M="top":c==="end"&&(M="bottom"));const z=this._getLabelSizes();for(x=0,_=l.length;x<_;++x){C=l[x],w=C.label;const N=s.setContext(this.getContext(x));b=this.getPixelForTick(x)+s.labelOffset,A=this._resolveTickFontOptions(x),D=A.lineHeight,P=Ue(w)?w.length:1;const v=P/2,T=N.color,R=N.textStrokeColor,H=N.textStrokeWidth;let O=k;i?(E=b,k==="inner"&&(x===_-1?O=this.options.reverse?"left":"right":x===0?O=this.options.reverse?"right":"left":O="center"),r==="top"?d==="near"||g!==0?V=-P*D+D/2:d==="center"?V=-z.highest.height/2-v*D+D:V=-z.highest.height+D/2:d==="near"||g!==0?V=D/2:d==="center"?V=z.highest.height/2-v*D:V=z.highest.height-P*D,f&&(V*=-1),g!==0&&!N.showLabelBackdrop&&(E+=D/2*Math.sin(g))):(B=b,V=(1-P)*D/2);let $;if(N.showLabelBackdrop){const Y=ht(N.backdropPadding),X=z.heights[x],j=z.widths[x];let ee=V-Y.top,ne=0-Y.left;switch(M){case"middle":ee-=X/2;break;case"bottom":ee-=X;break}switch(k){case"center":ne-=j/2;break;case"right":ne-=j;break;case"inner":x===_-1?ne-=j:x>0&&(ne-=j/2);break}$={left:ne,top:ee,width:j+Y.width,height:X+Y.height,color:N.backdropColor}}y.push({label:w,font:A,textOffset:V,options:{rotation:g,color:T,strokeColor:R,strokeWidth:H,textAlign:O,textBaseline:M,translation:[E,B],backdrop:$}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:o}=this.options;if(-It(this.labelRotation))return t==="top"?"left":"right";let r="center";return o.align==="start"?r="left":o.align==="end"?r="right":o.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:o,ticks:{crossAlign:a,mirror:r,padding:s}}=this.options,i=this._getLabelSizes(),l=t+s,c=i.widest.width;let d,u;return o==="left"?r?(u=this.right+s,a==="near"?d="left":a==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,a==="near"?d="right":a==="center"?(d="center",u-=c/2):(d="left",u=this.left)):o==="right"?r?(u=this.left+s,a==="near"?d="right":a==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,a==="near"?d="left":a==="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 t=this.chart,o=this.options.position;if(o==="left"||o==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(o==="top"||o==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:o},left:a,top:r,width:s,height:i}=this;o&&(t.save(),t.fillStyle=o,t.fillRect(a,r,s,i),t.restore())}getLineWidthForValue(t){const o=this.options.grid;if(!this._isVisible()||!o.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?o.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const o=this.options.grid,a=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,i;const l=(c,d,u)=>{!u.width||!u.color||(a.save(),a.lineWidth=u.width,a.strokeStyle=u.color,a.setLineDash(u.borderDash||[]),a.lineDashOffset=u.borderDashOffset,a.beginPath(),a.moveTo(c.x,c.y),a.lineTo(d.x,d.y),a.stroke(),a.restore())};if(o.display)for(s=0,i=r.length;s<i;++s){const c=r[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:t,ctx:o,options:{border:a,grid:r}}=this,s=a.setContext(this.getContext()),i=a.display?s.width:0;if(!i)return;const l=r.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,h;this.isHorizontal()?(d=yn(t,this.left,i)-i/2,u=yn(t,this.right,l)+l/2,f=h=c):(f=yn(t,this.top,i)-i/2,h=yn(t,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(t){if(!this.options.ticks.display)return;const a=this.ctx,r=this._computeLabelArea();r&&Qo(a,r);const s=this.getLabelItems(t);for(const i of s){const l=i.options,c=i.font,d=i.label,u=i.textOffset;mo(a,d,0,u,c,l)}r&&Zo(a)}drawTitle(){const{ctx:t,options:{position:o,title:a,reverse:r}}=this;if(!a.display)return;const s=tt(a.font),i=ht(a.padding),l=a.align;let c=s.lineHeight/2;o==="bottom"||o==="center"||Be(o)?(c+=i.bottom,Ue(a.text)&&(c+=s.lineHeight*(a.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=Gg(this,c,o,l);mo(t,a.text,0,0,s,{color:a.color,maxWidth:f,rotation:h,textAlign:qg(l,o,r),textBaseline:"middle",translation:[d,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,o=t.ticks&&t.ticks.z||0,a=xe(t.grid&&t.grid.z,-1),r=xe(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==In.prototype.draw?[{z:o,draw:s=>{this.draw(s)}}]:[{z:a,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:o,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const o=this.chart.getSortedVisibleDatasetMetas(),a=this.axis+"AxisID",r=[];let s,i;for(s=0,i=o.length;s<i;++s){const l=o[s];l[a]===this.id&&(!t||l.type===t)&&r.push(l)}return r}_resolveTickFontOptions(t){const o=this.options.ticks.setContext(this.getContext(t));return tt(o.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ha{constructor(t,o,a){this.type=t,this.scope=o,this.override=a,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const o=Object.getPrototypeOf(t);let a;Kg(o)&&(a=this.register(o));const r=this.items,s=t.id,i=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,Xg(t,i,a),this.override&&We.override(t.id,t.overrides)),i}get(t){return this.items[t]}unregister(t){const o=this.items,a=t.id,r=this.scope;a in o&&delete o[a],r&&a in We[r]&&(delete We[r][a],this.override&&delete bn[a])}}function Xg(e,t,o){const a=ao(Object.create(null),[o?We.get(o):{},We.get(t),e.defaults]);We.set(t,a),e.defaultRoutes&&Yg(t,e.defaultRoutes),e.descriptors&&We.describe(t,e.descriptors)}function Yg(e,t){Object.keys(t).forEach(o=>{const a=o.split("."),r=a.pop(),s=[e].concat(a).join("."),i=t[o].split("."),l=i.pop(),c=i.join(".");We.route(s,r,c,l)})}function Kg(e){return"id"in e&&"defaults"in e}class Jg{constructor(){this.controllers=new ha(_n,"datasets",!0),this.elements=new ha($t,"elements"),this.plugins=new ha(Object,"plugins"),this.scales=new ha(In,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,o,a){[...o].forEach(r=>{const s=a||this._getRegistryForType(r);a||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Me(r,i=>{const l=a||this._getRegistryForType(i);this._exec(t,l,i)})})}_exec(t,o,a){const r=Sr(t);Fe(a["before"+r],[],a),o[t](a),Fe(a["after"+r],[],a)}_getRegistryForType(t){for(let o=0;o<this._typedRegistries.length;o++){const a=this._typedRegistries[o];if(a.isForType(t))return a}return this.plugins}_get(t,o,a){const r=o.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+a+".");return r}}var Vt=new Jg;class Qg{constructor(){this._init=void 0}notify(t,o,a,r){if(o==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const s=r?this._descriptors(t).filter(r):this._descriptors(t),i=this._notify(s,t,o,a);return o==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),i}_notify(t,o,a,r){r=r||{};for(const s of t){const i=s.plugin,l=i[a],c=[o,r,s.options];if(Fe(l,c,i)===!1&&r.cancelable)return!1}return!0}invalidate(){De(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const o=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),o}_createDescriptors(t,o){const a=t&&t.config,r=xe(a.options&&a.options.plugins,{}),s=Zg(a);return r===!1&&!o?[]:t0(t,s,r,o)}_notifyStateChanges(t){const o=this._oldCache||[],a=this._cache,r=(s,i)=>s.filter(l=>!i.some(c=>l.plugin.id===c.plugin.id));this._notify(r(o,a),t,"stop"),this._notify(r(a,o),t,"start")}}function Zg(e){const t={},o=[],a=Object.keys(Vt.plugins.items);for(let s=0;s<a.length;s++)o.push(Vt.getPlugin(a[s]));const r=e.plugins||[];for(let s=0;s<r.length;s++){const i=r[s];o.indexOf(i)===-1&&(o.push(i),t[i.id]=!0)}return{plugins:o,localIds:t}}function e0(e,t){return!t&&e===!1?null:e===!0?{}:e}function t0(e,{plugins:t,localIds:o},a,r){const s=[],i=e.getContext();for(const l of t){const c=l.id,d=e0(a[c],r);d!==null&&s.push({plugin:l,options:n0(e.config,{plugin:l,local:o[c]},d,i)})}return s}function n0(e,{plugin:t,local:o},a,r){const s=e.pluginScopeKeys(t),i=e.getOptionScopes(a,s);return o&&t.defaults&&i.push(t.defaults),e.createResolver(i,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Jr(e,t){const o=We.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||o.indexAxis||"x"}function o0(e,t){let o=e;return e==="_index_"?o=t:e==="_value_"&&(o=t==="x"?"y":"x"),o}function a0(e,t){return e===t?"_index_":"_value_"}function sc(e){if(e==="x"||e==="y"||e==="r")return e}function r0(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Qr(e,...t){if(sc(e))return e;for(const o of t){const a=o.axis||r0(o.position)||e.length>1&&sc(e[0].toLowerCase());if(a)return a}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ic(e,t,o){if(o[t+"AxisID"]===e)return{axis:t}}function s0(e,t){if(t.data&&t.data.datasets){const o=t.data.datasets.filter(a=>a.xAxisID===e||a.yAxisID===e);if(o.length)return ic(e,"x",o[0])||ic(e,"y",o[0])}return{}}function i0(e,t){const o=bn[e.type]||{scales:{}},a=t.scales||{},r=Jr(e.type,t),s=Object.create(null);return Object.keys(a).forEach(i=>{const l=a[i];if(!Be(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=Qr(i,l,s0(i,e),We.scales[l.type]),d=a0(c,r),u=o.scales||{};s[i]=ro(Object.create(null),[{axis:c},l,u[c],u[d]])}),e.data.datasets.forEach(i=>{const l=i.type||e.type,c=i.indexAxis||Jr(l,t),u=(bn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=o0(f,c),m=i[h+"AxisID"]||h;s[m]=s[m]||Object.create(null),ro(s[m],[{axis:h},a[m],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];ro(l,[We.scales[l.type],We.scale])}),s}function lc(e){const t=e.options||(e.options={});t.plugins=xe(t.plugins,{}),t.scales=i0(e,t)}function cc(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function l0(e){return e=e||{},e.data=cc(e.data),lc(e),e}const dc=new Map,uc=new Set;function ma(e,t){let o=dc.get(e);return o||(o=t(),dc.set(e,o),uc.add(o)),o}const wo=(e,t,o)=>{const a=mn(t,o);a!==void 0&&e.add(a)};class c0{constructor(t){this._config=l0(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=cc(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),lc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ma(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,o){return ma(`${t}.transition.${o}`,()=>[[`datasets.${t}.transitions.${o}`,`transitions.${o}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,o){return ma(`${t}-${o}`,()=>[[`datasets.${t}.elements.${o}`,`datasets.${t}`,`elements.${o}`,""]])}pluginScopeKeys(t){const o=t.id,a=this.type;return ma(`${a}-plugin-${o}`,()=>[[`plugins.${o}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,o){const a=this._scopeCache;let r=a.get(t);return(!r||o)&&(r=new Map,a.set(t,r)),r}getOptionScopes(t,o,a){const{options:r,type:s}=this,i=this._cachedScopes(t,a),l=i.get(o);if(l)return l;const c=new Set;o.forEach(u=>{t&&(c.add(t),u.forEach(f=>wo(c,t,f))),u.forEach(f=>wo(c,r,f)),u.forEach(f=>wo(c,bn[s]||{},f)),u.forEach(f=>wo(c,We,f)),u.forEach(f=>wo(c,vr,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:t,type:o}=this;return[t,bn[o]||{},We.datasets[o]||{},{type:o},We,vr]}resolveNamedOptions(t,o,a,r=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=fc(this._resolverCache,t,r);let c=i;if(u0(i,o)){s.$shared=!1,a=Zt(a)?a():a;const d=this.createResolver(t,a,l);c=Tn(i,a,d)}for(const d of o)s[d]=c[d];return s}createResolver(t,o,a=[""],r){const{resolver:s}=fc(this._resolverCache,t,a);return Be(o)?Tn(s,o,void 0,r):s}}function fc(e,t,o){let a=e.get(t);a||(a=new Map,e.set(t,a));const r=o.join();let s=a.get(r);return s||(s={resolver:Fr(t,o),subPrefixes:o.filter(l=>!l.toLowerCase().includes("hover"))},a.set(r,s)),s}const d0=e=>Be(e)&&Object.getOwnPropertyNames(e).some(t=>Zt(e[t]));function u0(e,t){const{isScriptable:o,isIndexable:a}=pl(e);for(const r of t){const s=o(r),i=a(r),l=(i||s)&&e[r];if(s&&(Zt(l)||d0(l))||i&&Ue(l))return!0}return!1}var f0="4.5.1";const h0=["top","bottom","left","right","chartArea"];function hc(e,t){return e==="top"||e==="bottom"||h0.indexOf(e)===-1&&t==="x"}function mc(e,t){return function(o,a){return o[e]===a[e]?o[t]-a[t]:o[e]-a[e]}}function pc(e){const t=e.chart,o=t.options.animation;t.notifyPlugins("afterRender"),Fe(o&&o.onComplete,[e],t)}function m0(e){const t=e.chart,o=t.options.animation;Fe(o&&o.onProgress,[e],t)}function gc(e){return Lr()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const pa={},bc=e=>{const t=gc(e);return Object.values(pa).filter(o=>o.canvas===t).pop()};function p0(e,t,o){const a=Object.keys(e);for(const r of a){const s=+r;if(s>=t){const i=e[r];delete e[r],(o>0||s>t)&&(e[s+o]=i)}}}function g0(e,t,o,a){return!o||e.type==="mouseout"?null:a?t:e}class Wt{static register(...t){Vt.add(...t),yc()}static unregister(...t){Vt.remove(...t),yc()}constructor(t,o){const a=this.config=new c0(o),r=gc(t),s=bc(r);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=a.createResolver(a.chartOptionScopes(),this.getContext());this.platform=new(a.platform||Tg(r)),this.platform.updateConfig(a);const l=this.platform.acquireContext(r,i.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=mm(),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 Qg,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=vm(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],pa[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Lt.listen(this,"complete",pc),Lt.listen(this,"progress",m0),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:o},width:a,height:r,_aspectRatio:s}=this;return De(t)?o&&s?s:r?a/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Vt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Cl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return fl(this.canvas,this.ctx),this}stop(){return Lt.stop(this),this}resize(t,o){Lt.running(this)?this._resizeBeforeDraw={width:t,height:o}:this._resize(t,o)}_resize(t,o){const a=this.options,r=this.canvas,s=a.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(r,t,o,s),l=a.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,Cl(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),Fe(a.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};Me(o,(a,r)=>{a.id=r})}buildOrUpdateScales(){const t=this.options,o=t.scales,a=this.scales,r=Object.keys(a).reduce((i,l)=>(i[l]=!1,i),{});let s=[];o&&(s=s.concat(Object.keys(o).map(i=>{const l=o[i],c=Qr(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Me(s,i=>{const l=i.options,c=l.id,d=Qr(c,l),u=xe(l.type,i.dtype);(l.position===void 0||hc(l.position,d)!==hc(i.dposition))&&(l.position=i.dposition),r[c]=!0;let f=null;if(c in a&&a[c].type===u)f=a[c];else{const h=Vt.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),a[f.id]=f}f.init(l,t)}),Me(r,(i,l)=>{i||delete a[l]}),Me(a,i=>{mt.configure(this,i,i.options),mt.addBox(this,i)})}_updateMetasets(){const t=this._metasets,o=this.data.datasets.length,a=t.length;if(t.sort((r,s)=>r.index-s.index),a>o){for(let r=o;r<a;++r)this._destroyDatasetMeta(r);t.splice(o,a-o)}this._sortedMetasets=t.slice(0).sort(mc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:o}}=this;t.length>o.length&&delete this._stacks,t.forEach((a,r)=>{o.filter(s=>s===a._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],o=this.data.datasets;let a,r;for(this._removeUnreferencedMetasets(),a=0,r=o.length;a<r;a++){const s=o[a];let i=this.getDatasetMeta(a);const l=s.type||this.config.type;if(i.type&&i.type!==l&&(this._destroyDatasetMeta(a),i=this.getDatasetMeta(a)),i.type=l,i.indexAxis=s.indexAxis||Jr(l,this.options),i.order=s.order||0,i.index=a,i.label=""+s.label,i.visible=this.isDatasetVisible(a),i.controller)i.controller.updateIndex(a),i.controller.linkScales();else{const c=Vt.getController(l),{datasetElementType:d,dataElementType:u}=We.datasets[l];Object.assign(c,{dataElementType:Vt.getElement(u),datasetElementType:d&&Vt.getElement(d)}),i.controller=new c(this,a),t.push(i.controller)}}return this._updateMetasets(),t}_resetElements(){Me(this.data.datasets,(t,o)=>{this.getDatasetMeta(o).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const o=this.config;o.update();const a=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!a.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,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=!r&&s.indexOf(f)===-1;f.buildOrUpdateElements(h),i=Math.max(+f.getMaxOverflow(),i)}i=this._minPadding=a.layout.autoPadding?i:0,this._updateLayout(i),r||Me(s,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(mc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Me(this.scales,t=>{mt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,o=new Set(Object.keys(this._listeners)),a=new Set(t.events);(!Yi(o,a)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,o=this._getUniformDataChanges()||[];for(const{method:a,start:r,count:s}of o){const i=a==="_removeElements"?-s:s;p0(t,r,i)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const o=this.data.datasets.length,a=s=>new Set(t.filter(i=>i[0]===s).map((i,l)=>l+","+i.splice(1).join(","))),r=a(0);for(let s=1;s<o;s++)if(!Yi(r,a(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;mt.update(this,this.width,this.height,t);const o=this.chartArea,a=o.width<=0||o.height<=0;this._layers=[],Me(this.boxes,r=>{a&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let o=0,a=this.data.datasets.length;o<a;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,a=this.data.datasets.length;o<a;++o)this._updateDataset(o,Zt(t)?t({datasetIndex:o}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,o){const a=this.getDatasetMeta(t),r={meta:a,index:t,mode:o,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(a.controller._update(o),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Lt.has(this)?this.attached&&!Lt.running(this)&&Lt.start(this):(this.draw(),pc({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:a,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(a,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const o=this._layers;for(t=0;t<o.length&&o[t].z<=0;++t)o[t].draw(this.chartArea);for(this._drawDatasets();t<o.length;++t)o[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const o=this._sortedMetasets,a=[];let r,s;for(r=0,s=o.length;r<s;++r){const i=o[r];(!t||i.visible)&&a.push(i)}return a}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let o=t.length-1;o>=0;--o)this._drawDataset(t[o]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const o=this.ctx,a={meta:t,index:t.index,cancelable:!0},r=Pl(this,t);this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(r&&Qo(o,r),t.controller.draw(),r&&Zo(o),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return ho(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,o,a,r){const s=hg.modes[o];return typeof s=="function"?s(this,t,a,r):[]}getDatasetMeta(t){const o=this.data.datasets[t],a=this._metasets;let r=a.filter(s=>s&&s._dataset===o).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:o&&o.order||0,index:t,_dataset:o,_parsed:[],_sorted:!1},a.push(r)),r}getContext(){return this.$context||(this.$context=xn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const o=this.data.datasets[t];if(!o)return!1;const a=this.getDatasetMeta(t);return typeof a.hidden=="boolean"?!a.hidden:!o.hidden}setDatasetVisibility(t,o){const a=this.getDatasetMeta(t);a.hidden=!o}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,o,a){const r=a?"show":"hide",s=this.getDatasetMeta(t),i=s.controller._resolveAnimations(void 0,r);so(o)?(s.data[o].hidden=!a,this.update()):(this.setDatasetVisibility(t,a),i.update(s,{visible:a}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,o){this._updateVisibility(t,o,!1)}show(t,o){this._updateVisibility(t,o,!0)}_destroyDatasetMeta(t){const o=this._metasets[t];o&&o.controller&&o.controller._destroy(),delete this._metasets[t]}_stop(){let t,o;for(this.stop(),Lt.remove(this),t=0,o=this.data.datasets.length;t<o;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:o}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),fl(t,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete pa[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,o=this.platform,a=(s,i)=>{o.addEventListener(this,s,i),t[s]=i},r=(s,i,l)=>{s.offsetX=i,s.offsetY=l,this._eventHandler(s)};Me(this.options.events,s=>a(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,o=this.platform,a=(c,d)=>{o.addEventListener(this,c,d),t[c]=d},r=(c,d)=>{t[c]&&(o.removeEventListener(this,c,d),delete t[c])},s=(c,d)=>{this.canvas&&this.resize(c,d)};let i;const l=()=>{r("attach",l),this.attached=!0,this.resize(),a("resize",s),a("detach",i)};i=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),a("attach",l)},o.isAttached(this.canvas)?l():i()}unbindEvents(){Me(this._listeners,(t,o)=>{this.platform.removeEventListener(this,o,t)}),this._listeners={},Me(this._responsiveListeners,(t,o)=>{this.platform.removeEventListener(this,o,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,o,a){const r=a?"set":"remove";let s,i,l,c;for(o==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){i=t[l];const d=i&&this.getDatasetMeta(i.datasetIndex).controller;d&&d[r+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const o=this._active||[],a=t.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}});!Xo(a,o)&&(this._active=a,this._lastEvent=null,this._updateHoverStyles(a,o))}notifyPlugins(t,o,a){return this._plugins.notify(this,t,o,a)}isPluginEnabled(t){return this._plugins._cache.filter(o=>o.plugin.id===t).length===1}_updateHoverStyles(t,o,a){const r=this.options.hover,s=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),i=s(o,t),l=a?t:s(t,o);i.length&&this.updateHoverStyle(i,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,o){const a={event:t,replay:o,cancelable:!0,inChartArea:this.isPointInArea(t)},r=i=>(i.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",a,r)===!1)return;const s=this._handleEvent(t,o,a.inChartArea);return a.cancelable=!1,this.notifyPlugins("afterEvent",a,r),(s||a.changed)&&this.render(),this}_handleEvent(t,o,a){const{_active:r=[],options:s}=this,i=o,l=this._getActiveElements(t,r,a,i),c=km(t),d=g0(t,this._lastEvent,a,c);a&&(this._lastEvent=null,Fe(s.onHover,[t,l,this],this),c&&Fe(s.onClick,[t,l,this],this));const u=!Xo(l,r);return(u||o)&&(this._active=l,this._updateHoverStyles(l,r,o)),this._lastEvent=d,u}_getActiveElements(t,o,a,r){if(t.type==="mouseout")return[];if(!a)return o;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}}de(Wt,"defaults",We),de(Wt,"instances",pa),de(Wt,"overrides",bn),de(Wt,"registry",Vt),de(Wt,"version",f0),de(Wt,"getChart",bc);function yc(){return Me(Wt.instances,e=>e._plugins.invalidate())}function b0(e,t,o){const{startAngle:a,x:r,y:s,outerRadius:i,innerRadius:l,options:c}=t,{borderWidth:d,borderJoinStyle:u}=c,f=Math.min(d/i,ct(a-o));if(e.beginPath(),e.arc(r,s,i-d/2,a+f/2,o-f/2),l>0){const h=Math.min(d/l,ct(a-o));e.arc(r,s,l+d/2,o-h/2,a+h/2,!0)}else{const h=Math.min(d/2,i*ct(a-o));if(u==="round")e.arc(r,s,h,o-Ne/2,a+Ne/2,!0);else if(u==="bevel"){const m=2*h*h,p=-m*Math.cos(o+Ne/2)+r,g=-m*Math.sin(o+Ne/2)+s,y=m*Math.cos(a+Ne/2)+r,x=m*Math.sin(a+Ne/2)+s;e.lineTo(p,g),e.lineTo(y,x)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function y0(e,t,o){const{startAngle:a,pixelMargin:r,x:s,y:i,outerRadius:l,innerRadius:c}=t;let d=r/l;e.beginPath(),e.arc(s,i,l,a-d,o+d),c>r?(d=r/c,e.arc(s,i,c,o+d,a-d,!0)):e.arc(s,i,r,o+Ge,a-Ge),e.closePath(),e.clip()}function x0(e){return zr(e,["outerStart","outerEnd","innerStart","innerEnd"])}function k0(e,t,o,a){const r=x0(e.options.borderRadius),s=(o-t)/2,i=Math.min(s,a*t/2),l=c=>{const d=(o-Math.min(s,c))*a/2;return Ze(c,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:Ze(r.innerStart,0,i),innerEnd:Ze(r.innerEnd,0,i)}}function Rn(e,t,o,a){return{x:o+e*Math.cos(t),y:a+e*Math.sin(t)}}function ga(e,t,o,a,r,s){const{x:i,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=t,f=Math.max(t.outerRadius+a+o-d,0),h=u>0?u+a+o+d:0;let m=0;const p=r-c;if(a){const N=u>0?u-a:0,v=f>0?f-a:0,T=(N+v)/2,R=T!==0?p*T/(T+a):p;m=(p-R)/2}const g=Math.max(.001,p*f-o/Ne)/f,y=(p-g)/2,x=c+y+m,_=r-y-m,{outerStart:C,outerEnd:w,innerStart:E,innerEnd:B}=k0(t,h,f,_-x),k=f-C,b=f-w,A=x+C/k,D=_-w/b,P=h+E,V=h+B,M=x+E/P,z=_-B/V;if(e.beginPath(),s){const N=(A+D)/2;if(e.arc(i,l,f,A,N),e.arc(i,l,f,N,D),w>0){const H=Rn(b,D,i,l);e.arc(H.x,H.y,w,D,_+Ge)}const v=Rn(V,_,i,l);if(e.lineTo(v.x,v.y),B>0){const H=Rn(V,z,i,l);e.arc(H.x,H.y,B,_+Ge,z+Math.PI)}const T=(_-B/h+(x+E/h))/2;if(e.arc(i,l,h,_-B/h,T,!0),e.arc(i,l,h,T,x+E/h,!0),E>0){const H=Rn(P,M,i,l);e.arc(H.x,H.y,E,M+Math.PI,x-Ge)}const R=Rn(k,x,i,l);if(e.lineTo(R.x,R.y),C>0){const H=Rn(k,A,i,l);e.arc(H.x,H.y,C,x-Ge,A)}}else{e.moveTo(i,l);const N=Math.cos(A)*f+i,v=Math.sin(A)*f+l;e.lineTo(N,v);const T=Math.cos(D)*f+i,R=Math.sin(D)*f+l;e.lineTo(T,R)}e.closePath()}function w0(e,t,o,a,r){const{fullCircles:s,startAngle:i,circumference:l}=t;let c=t.endAngle;if(s){ga(e,t,o,a,c,r);for(let d=0;d<s;++d)e.fill();isNaN(l)||(c=i+(l%Le||Le))}return ga(e,t,o,a,c,r),e.fill(),c}function C0(e,t,o,a,r){const{fullCircles:s,startAngle:i,circumference:l,options:c}=t,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h,borderRadius:m}=c,p=c.borderAlign==="inner";if(!d)return;e.setLineDash(f||[]),e.lineDashOffset=h,p?(e.lineWidth=d*2,e.lineJoin=u||"round"):(e.lineWidth=d,e.lineJoin=u||"bevel");let g=t.endAngle;if(s){ga(e,t,o,a,g,r);for(let y=0;y<s;++y)e.stroke();isNaN(l)||(g=i+(l%Le||Le))}p&&y0(e,t,g),c.selfJoin&&g-i>=Ne&&m===0&&u!=="miter"&&b0(e,t,g),s||(ga(e,t,o,a,g,r),e.stroke())}class Co extends $t{constructor(o){super();de(this,"circumference");de(this,"endAngle");de(this,"fullCircles");de(this,"innerRadius");de(this,"outerRadius");de(this,"pixelMargin");de(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,a,r){const s=this.getProps(["x","y"],r),{angle:i,distance:l}=el(s,{x:o,y:a}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),m=(this.options.spacing+this.options.borderWidth)/2,p=xe(h,d-c),g=co(i,c,d)&&c!==d,y=p>=Le||g,x=Rt(l,u+m,f+m);return y&&x}getCenterPoint(o){const{x:a,y:r,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:a+Math.cos(f)*h,y:r+Math.sin(f)*h}}tooltipPosition(o){return this.getCenterPoint(o)}draw(o){const{options:a,circumference:r}=this,s=(a.offset||0)/4,i=(a.spacing||0)/2,l=a.circular;if(this.pixelMargin=a.borderAlign==="inner"?.33:0,this.fullCircles=r>Le?Math.floor(r/Le):0,r===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(Ne,r||0)),u=s*d;o.fillStyle=a.backgroundColor,o.strokeStyle=a.borderColor,w0(o,this,u,i,l),C0(o,this,u,i,l),o.restore()}}de(Co,"id","arc"),de(Co,"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}),de(Co,"defaultRoutes",{backgroundColor:"backgroundColor"}),de(Co,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function xc(e,t,o=t){e.lineCap=xe(o.borderCapStyle,t.borderCapStyle),e.setLineDash(xe(o.borderDash,t.borderDash)),e.lineDashOffset=xe(o.borderDashOffset,t.borderDashOffset),e.lineJoin=xe(o.borderJoinStyle,t.borderJoinStyle),e.lineWidth=xe(o.borderWidth,t.borderWidth),e.strokeStyle=xe(o.borderColor,t.borderColor)}function _0(e,t,o){e.lineTo(o.x,o.y)}function B0(e){return e.stepped?Gm:e.tension||e.cubicInterpolationMode==="monotone"?Xm:_0}function kc(e,t,o={}){const a=e.length,{start:r=0,end:s=a-1}=o,{start:i,end:l}=t,c=Math.max(r,i),d=Math.min(s,l),u=r<i&&s<i||r>l&&s>l;return{count:a,start:c,loop:t.loop,ilen:d<c&&!u?a+d-c:d-c}}function E0(e,t,o,a){const{points:r,options:s}=t,{count:i,start:l,loop:c,ilen:d}=kc(r,o,a),u=B0(s);let{move:f=!0,reverse:h}=a||{},m,p,g;for(m=0;m<=d;++m)p=r[(l+(h?d-m:m))%i],!p.skip&&(f?(e.moveTo(p.x,p.y),f=!1):u(e,g,p,h,s.stepped),g=p);return c&&(p=r[(l+(h?d:0))%i],u(e,g,p,h,s.stepped)),!!c}function S0(e,t,o,a){const r=t.points,{count:s,start:i,ilen:l}=kc(r,o,a),{move:c=!0,reverse:d}=a||{};let u=0,f=0,h,m,p,g,y,x;const _=w=>(i+(d?l-w:w))%s,C=()=>{g!==y&&(e.lineTo(u,y),e.lineTo(u,g),e.lineTo(u,x))};for(c&&(m=r[_(0)],e.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=r[_(h)],m.skip)continue;const w=m.x,E=m.y,B=w|0;B===p?(E<g?g=E:E>y&&(y=E),u=(f*u+w)/++f):(C(),e.lineTo(w,E),p=B,f=0,g=y=E),x=E}C()}function Zr(e){const t=e.options,o=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!o?S0:E0}function A0(e){return e.stepped?Sp:e.tension||e.cubicInterpolationMode==="monotone"?Ap:Cn}function V0(e,t,o,a){let r=t._path;r||(r=t._path=new Path2D,t.path(r,o,a)&&r.closePath()),xc(e,t.options),e.stroke(r)}function D0(e,t,o,a){const{segments:r,options:s}=t,i=Zr(t);for(const l of r)xc(e,s,l.style),e.beginPath(),i(e,t,l,{start:o,end:o+a-1})&&e.closePath(),e.stroke()}const M0=typeof Path2D=="function";function N0(e,t,o,a){M0&&!t.options.segment?V0(e,t,o,a):D0(e,t,o,a)}class tn extends $t{constructor(t){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,t&&Object.assign(this,t)}updateControlPoints(t,o){const a=this.options;if((a.tension||a.cubicInterpolationMode==="monotone")&&!a.stepped&&!this._pointsUpdated){const r=a.spanGaps?this._loop:this._fullLoop;yp(this._points,a,t,r,o),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=vp(this,this.options.segment))}first(){const t=this.segments,o=this.points;return t.length&&o[t[0].start]}last(){const t=this.segments,o=this.points,a=t.length;return a&&o[t[a-1].end]}interpolate(t,o){const a=this.options,r=t[o],s=this.points,i=Dl(this,{property:o,start:r,end:r});if(!i.length)return;const l=[],c=A0(a);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:h}=i[d],m=s[f],p=s[h];if(m===p){l.push(m);continue}const g=Math.abs((r-m[o])/(p[o]-m[o])),y=c(m,p,g,a.stepped);y[o]=t[o],l.push(y)}return l.length===1?l[0]:l}pathSegment(t,o,a){return Zr(this)(t,this,o,a)}path(t,o,a){const r=this.segments,s=Zr(this);let i=this._loop;o=o||0,a=a||this.points.length-o;for(const l of r)i&=s(t,this,l,{start:o,end:o+a-1});return!!i}draw(t,o,a,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),N0(t,this,a,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}de(tn,"id","line"),de(tn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),de(tn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),de(tn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function wc(e,t,o,a){const r=e.options,{[o]:s}=e.getProps([o],a);return Math.abs(t-s)<r.radius+r.hitRadius}class ba extends $t{constructor(o){super();de(this,"parsed");de(this,"skip");de(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,a,r){const s=this.options,{x:i,y:l}=this.getProps(["x","y"],r);return Math.pow(o-i,2)+Math.pow(a-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(o,a){return wc(this,o,"x",a)}inYRange(o,a){return wc(this,o,"y",a)}getCenterPoint(o){const{x:a,y:r}=this.getProps(["x","y"],o);return{x:a,y:r}}size(o){o=o||this.options||{};let a=o.radius||0;a=Math.max(a,a&&o.hoverRadius||0);const r=a&&o.borderWidth||0;return(a+r)*2}draw(o,a){const r=this.options;this.skip||r.radius<.1||!ho(this,a,this.size(r)/2)||(o.strokeStyle=r.borderColor,o.lineWidth=r.borderWidth,o.fillStyle=r.backgroundColor,Or(o,r,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}de(ba,"id","point"),de(ba,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),de(ba,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Cc(e,t){const{x:o,y:a,base:r,width:s,height:i}=e.getProps(["x","y","base","width","height"],t);let l,c,d,u,f;return e.horizontal?(f=i/2,l=Math.min(o,r),c=Math.max(o,r),d=a-f,u=a+f):(f=s/2,l=o-f,c=o+f,d=Math.min(a,r),u=Math.max(a,r)),{left:l,top:d,right:c,bottom:u}}function nn(e,t,o,a){return e?0:Ze(t,o,a)}function P0(e,t,o){const a=e.options.borderWidth,r=e.borderSkipped,s=ml(a);return{t:nn(r.top,s.top,0,o),r:nn(r.right,s.right,0,t),b:nn(r.bottom,s.bottom,0,o),l:nn(r.left,s.left,0,t)}}function v0(e,t,o){const{enableBorderRadius:a}=e.getProps(["enableBorderRadius"]),r=e.options.borderRadius,s=vn(r),i=Math.min(t,o),l=e.borderSkipped,c=a||Be(r);return{topLeft:nn(!c||l.top||l.left,s.topLeft,0,i),topRight:nn(!c||l.top||l.right,s.topRight,0,i),bottomLeft:nn(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:nn(!c||l.bottom||l.right,s.bottomRight,0,i)}}function T0(e){const t=Cc(e),o=t.right-t.left,a=t.bottom-t.top,r=P0(e,o/2,a/2),s=v0(e,o/2,a/2);return{outer:{x:t.left,y:t.top,w:o,h:a,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:o-r.l-r.r,h:a-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function es(e,t,o,a){const r=t===null,s=o===null,l=e&&!(r&&s)&&Cc(e,a);return l&&(r||Rt(t,l.left,l.right))&&(s||Rt(o,l.top,l.bottom))}function O0(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function z0(e,t){e.rect(t.x,t.y,t.w,t.h)}function ts(e,t,o={}){const a=e.x!==o.x?-t:0,r=e.y!==o.y?-t:0,s=(e.x+e.w!==o.x+o.w?t:0)-a,i=(e.y+e.h!==o.y+o.h?t:0)-r;return{x:e.x+a,y:e.y+r,w:e.w+s,h:e.h+i,radius:e.radius}}class ya extends $t{constructor(t){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,t&&Object.assign(this,t)}draw(t){const{inflateAmount:o,options:{borderColor:a,backgroundColor:r}}=this,{inner:s,outer:i}=T0(this),l=O0(i.radius)?ea:z0;t.save(),(i.w!==s.w||i.h!==s.h)&&(t.beginPath(),l(t,ts(i,o,s)),t.clip(),l(t,ts(s,-o,i)),t.fillStyle=a,t.fill("evenodd")),t.beginPath(),l(t,ts(s,o)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,o,a){return es(this,t,o,a)}inXRange(t,o){return es(this,t,null,o)}inYRange(t,o){return es(this,null,t,o)}getCenterPoint(t){const{x:o,y:a,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(o+r)/2:o,y:s?a:(a+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}de(ya,"id","bar"),de(ya,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),de(ya,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function F0(e,t,o){const a=e.segments,r=e.points,s=t.points,i=[];for(const l of a){let{start:c,end:d}=l;d=xa(c,d,r);const u=ns(o,r[c],r[d],l.loop);if(!t.segments){i.push({source:l,target:u,start:r[c],end:r[d]});continue}const f=Dl(t,u);for(const h of f){const m=ns(o,s[h.start],s[h.end],h.loop),p=Vl(l,r,m);for(const g of p)i.push({source:g,target:h,start:{[o]:_c(u,m,"start",Math.max)},end:{[o]:_c(u,m,"end",Math.min)}})}}return i}function ns(e,t,o,a){if(a)return;let r=t[e],s=o[e];return e==="angle"&&(r=ct(r),s=ct(s)),{property:e,start:r,end:s}}function I0(e,t){const{x:o=null,y:a=null}=e||{},r=t.points,s=[];return t.segments.forEach(({start:i,end:l})=>{l=xa(i,l,r);const c=r[i],d=r[l];a!==null?(s.push({x:c.x,y:a}),s.push({x:d.x,y:a})):o!==null&&(s.push({x:o,y:c.y}),s.push({x:o,y:d.y}))}),s}function xa(e,t,o){for(;t>e;t--){const a=o[t];if(!isNaN(a.x)&&!isNaN(a.y))break}return t}function _c(e,t,o,a){return e&&t?a(e[o],t[o]):e?e[o]:t?t[o]:0}function Bc(e,t){let o=[],a=!1;return Ue(e)?(a=!0,o=e):o=I0(e,t),o.length?new tn({points:o,options:{tension:0},_loop:a,_fullLoop:a}):null}function Ec(e){return e&&e.fill!==!1}function R0(e,t,o){let r=e[t].fill;const s=[t];let i;if(!o)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!Qe(r))return r;if(i=e[r],!i)return!1;if(i.visible)return r;s.push(r),r=i.fill}return!1}function L0(e,t,o){const a=U0(e);if(Be(a))return isNaN(a.value)?!1:a;let r=parseFloat(a);return Qe(r)&&Math.floor(r)===r?$0(a[0],t,r,o):["origin","start","end","stack","shape"].indexOf(a)>=0&&a}function $0(e,t,o,a){return(e==="-"||e==="+")&&(o=t+o),o===t||o<0||o>=a?!1:o}function W0(e,t){let o=null;return e==="start"?o=t.bottom:e==="end"?o=t.top:Be(e)?o=t.getPixelForValue(e.value):t.getBasePixel&&(o=t.getBasePixel()),o}function j0(e,t,o){let a;return e==="start"?a=o:e==="end"?a=t.options.reverse?t.min:t.max:Be(e)?a=e.value:a=t.getBaseValue(),a}function U0(e){const t=e.options,o=t.fill;let a=xe(o&&o.target,o);return a===void 0&&(a=!!t.backgroundColor),a===!1||a===null?!1:a===!0?"origin":a}function H0(e){const{scale:t,index:o,line:a}=e,r=[],s=a.segments,i=a.points,l=q0(t,o);l.push(Bc({x:null,y:t.bottom},a));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)G0(r,i[u],l)}return new tn({points:r,options:{}})}function q0(e,t){const o=[],a=e.getMatchingVisibleMetas("line");for(let r=0;r<a.length;r++){const s=a[r];if(s.index===t)break;s.hidden||o.unshift(s.dataset)}return o}function G0(e,t,o){const a=[];for(let r=0;r<o.length;r++){const s=o[r],{first:i,last:l,point:c}=X0(s,t,"x");if(!(!c||i&&l)){if(i)a.unshift(c);else if(e.push(c),!l)break}}e.push(...a)}function X0(e,t,o){const a=e.interpolate(t,o);if(!a)return{};const r=a[o],s=e.segments,i=e.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(Rt(r,f,h)){l=r===f,c=r===h;break}}return{first:l,last:c,point:a}}class Sc{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,o,a){const{x:r,y:s,radius:i}=this;return o=o||{start:0,end:Le},t.arc(r,s,i,o.end,o.start,!0),!a.bounds}interpolate(t){const{x:o,y:a,radius:r}=this,s=t.angle;return{x:o+Math.cos(s)*r,y:a+Math.sin(s)*r,angle:s}}}function Y0(e){const{chart:t,fill:o,line:a}=e;if(Qe(o))return K0(t,o);if(o==="stack")return H0(e);if(o==="shape")return!0;const r=J0(e);return r instanceof Sc?r:Bc(r,a)}function K0(e,t){const o=e.getDatasetMeta(t);return o&&e.isDatasetVisible(t)?o.dataset:null}function J0(e){return(e.scale||{}).getPointPositionForValue?Z0(e):Q0(e)}function Q0(e){const{scale:t={},fill:o}=e,a=W0(o,t);if(Qe(a)){const r=t.isHorizontal();return{x:r?a:null,y:r?null:a}}return null}function Z0(e){const{scale:t,fill:o}=e,a=t.options,r=t.getLabels().length,s=a.reverse?t.max:t.min,i=j0(o,t,s),l=[];if(a.grid.circular){const c=t.getPointPositionForValue(0,s);return new Sc({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(i)})}for(let c=0;c<r;++c)l.push(t.getPointPositionForValue(c,i));return l}function os(e,t,o){const a=Y0(t),{chart:r,index:s,line:i,scale:l,axis:c}=t,d=i.options,u=d.fill,f=d.backgroundColor,{above:h=f,below:m=f}=u||{},p=r.getDatasetMeta(s),g=Pl(r,p);a&&i.points.length&&(Qo(e,o),eb(e,{line:i,target:a,above:h,below:m,area:o,scale:l,axis:c,clip:g}),Zo(e))}function eb(e,t){const{line:o,target:a,above:r,below:s,area:i,scale:l,clip:c}=t,d=o._loop?"angle":t.axis;e.save();let u=s;s!==r&&(d==="x"?(Ac(e,a,i.top),as(e,{line:o,target:a,color:r,scale:l,property:d,clip:c}),e.restore(),e.save(),Ac(e,a,i.bottom)):d==="y"&&(Vc(e,a,i.left),as(e,{line:o,target:a,color:s,scale:l,property:d,clip:c}),e.restore(),e.save(),Vc(e,a,i.right),u=r)),as(e,{line:o,target:a,color:u,scale:l,property:d,clip:c}),e.restore()}function Ac(e,t,o){const{segments:a,points:r}=t;let s=!0,i=!1;e.beginPath();for(const l of a){const{start:c,end:d}=l,u=r[c],f=r[xa(c,d,r)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(u.x,o),e.lineTo(u.x,u.y)),i=!!t.pathSegment(e,l,{move:i}),i?e.closePath():e.lineTo(f.x,o)}e.lineTo(t.first().x,o),e.closePath(),e.clip()}function Vc(e,t,o){const{segments:a,points:r}=t;let s=!0,i=!1;e.beginPath();for(const l of a){const{start:c,end:d}=l,u=r[c],f=r[xa(c,d,r)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(o,u.y),e.lineTo(u.x,u.y)),i=!!t.pathSegment(e,l,{move:i}),i?e.closePath():e.lineTo(o,f.y)}e.lineTo(o,t.first().y),e.closePath(),e.clip()}function as(e,t){const{line:o,target:a,property:r,color:s,scale:i,clip:l}=t,c=F0(o,a,r);for(const{source:d,target:u,start:f,end:h}of c){const{style:{backgroundColor:m=s}={}}=d,p=a!==!0;e.save(),e.fillStyle=m,tb(e,i,l,p&&ns(r,f,h)),e.beginPath();const g=!!o.pathSegment(e,d);let y;if(p){g?e.closePath():Dc(e,a,h,r);const x=!!a.pathSegment(e,u,{move:g,reverse:!0});y=g&&x,y||Dc(e,a,f,r)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function tb(e,t,o,a){const r=t.chart.chartArea,{property:s,start:i,end:l}=a||{};if(s==="x"||s==="y"){let c,d,u,f;s==="x"?(c=i,d=r.top,u=l,f=r.bottom):(c=r.left,d=i,u=r.right,f=l),e.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)),e.rect(c,d,u-c,f-d),e.clip()}}function Dc(e,t,o,a){const r=t.interpolate(o,a);r&&e.lineTo(r.x,r.y)}var nb={id:"filler",afterDatasetsUpdate(e,t,o){const a=(e.data.datasets||[]).length,r=[];let s,i,l,c;for(i=0;i<a;++i)s=e.getDatasetMeta(i),l=s.dataset,c=null,l&&l.options&&l instanceof tn&&(c={visible:e.isDatasetVisible(i),index:i,fill:L0(l,i,a),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=c,r.push(c);for(i=0;i<a;++i)c=r[i],!(!c||c.fill===!1)&&(c.fill=R0(r,i,o.propagate))},beforeDraw(e,t,o){const a=o.drawTime==="beforeDraw",r=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let i=r.length-1;i>=0;--i){const l=r[i].$filler;l&&(l.line.updateControlPoints(s,l.axis),a&&l.fill&&os(e.ctx,l,s))}},beforeDatasetsDraw(e,t,o){if(o.drawTime!=="beforeDatasetsDraw")return;const a=e.getSortedVisibleDatasetMetas();for(let r=a.length-1;r>=0;--r){const s=a[r].$filler;Ec(s)&&os(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,o){const a=t.meta.$filler;!Ec(a)||o.drawTime!=="beforeDatasetDraw"||os(e.ctx,a,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Mc=(e,t)=>{let{boxHeight:o=t,boxWidth:a=t}=e;return e.usePointStyle&&(o=Math.min(o,t),a=e.pointStyleWidth||Math.min(a,t)),{boxWidth:a,boxHeight:o,itemHeight:Math.max(t,o)}},ob=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Nc extends $t{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,o,a){this.maxWidth=t,this.maxHeight=o,this._margins=a,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 t=this.options.labels||{};let o=Fe(t.generateLabels,[this.chart],this)||[];t.filter&&(o=o.filter(a=>t.filter(a,this.chart.data))),t.sort&&(o=o.sort((a,r)=>t.sort(a,r,this.chart.data))),this.options.reverse&&o.reverse(),this.legendItems=o}fit(){const{options:t,ctx:o}=this;if(!t.display){this.width=this.height=0;return}const a=t.labels,r=tt(a.font),s=r.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=Mc(a,s);let d,u;o.font=r.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(i,s,l,c)+10):(u=this.maxHeight,d=this._fitCols(i,r,l,c)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,o,a,r){const{ctx:s,maxWidth:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=r+l;let f=t;s.textAlign="left",s.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((p,g)=>{const y=a+o/2+s.measureText(p.text).width;(g===0||d[d.length-1]+y+2*l>i)&&(f+=u,d[d.length-(g>0?0:1)]=0,m+=u,h++),c[g]={left:0,top:m,row:h,width:y,height:r},d[d.length-1]+=y+l}),f}_fitCols(t,o,a,r){const{ctx:s,maxHeight:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=i-t;let f=l,h=0,m=0,p=0,g=0;return this.legendItems.forEach((y,x)=>{const{itemWidth:_,itemHeight:C}=ab(a,o,s,y,r);x>0&&m+C+2*l>u&&(f+=h+l,d.push({width:h,height:m}),p+=h+l,g++,h=m=0),c[x]={left:p,top:m,col:g,width:_,height:C},h=Math.max(h,_),m+=C+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:a,labels:{padding:r},rtl:s}}=this,i=zn(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=et(a,this.left+r,this.right-this.lineWidths[l]);for(const d of o)l!==d.row&&(l=d.row,c=et(a,this.left+r,this.right-this.lineWidths[l])),d.top+=this.top+t+r,d.left=i.leftForLtr(i.x(c),d.width),c+=d.width+r}else{let l=0,c=et(a,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const d of o)d.col!==l&&(l=d.col,c=et(a,this.top+t+r,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+r,d.left=i.leftForLtr(i.x(d.left),d.width),c+=d.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Qo(t,this),this._draw(),Zo(t)}}_draw(){const{options:t,columnSizes:o,lineWidths:a,ctx:r}=this,{align:s,labels:i}=t,l=We.color,c=zn(t.rtl,this.left,this.width),d=tt(i.font),{padding:u}=i,f=d.size,h=f/2;let m;this.drawTitle(),r.textAlign=c.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=d.string;const{boxWidth:p,boxHeight:g,itemHeight:y}=Mc(i,f),x=function(B,k,b){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;r.save();const A=xe(b.lineWidth,1);if(r.fillStyle=xe(b.fillStyle,l),r.lineCap=xe(b.lineCap,"butt"),r.lineDashOffset=xe(b.lineDashOffset,0),r.lineJoin=xe(b.lineJoin,"miter"),r.lineWidth=A,r.strokeStyle=xe(b.strokeStyle,l),r.setLineDash(xe(b.lineDash,[])),i.usePointStyle){const D={radius:g*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:A},P=c.xPlus(B,p/2),V=k+h;hl(r,D,P,V,i.pointStyleWidth&&p)}else{const D=k+Math.max((f-g)/2,0),P=c.leftForLtr(B,p),V=vn(b.borderRadius);r.beginPath(),Object.values(V).some(M=>M!==0)?ea(r,{x:P,y:D,w:p,h:g,radius:V}):r.rect(P,D,p,g),r.fill(),A!==0&&r.stroke()}r.restore()},_=function(B,k,b){mo(r,b.text,B,k+y/2,d,{strikethrough:b.hidden,textAlign:c.textAlign(b.textAlign)})},C=this.isHorizontal(),w=this._computeTitleHeight();C?m={x:et(s,this.left+u,this.right-a[0]),y:this.top+u+w,line:0}:m={x:this.left+u,y:et(s,this.top+w+u,this.bottom-o[0].height),line:0},Bl(this.ctx,t.textDirection);const E=y+u;this.legendItems.forEach((B,k)=>{r.strokeStyle=B.fontColor,r.fillStyle=B.fontColor;const b=r.measureText(B.text).width,A=c.textAlign(B.textAlign||(B.textAlign=i.textAlign)),D=p+h+b;let P=m.x,V=m.y;c.setWidth(this.width),C?k>0&&P+D+u>this.right&&(V=m.y+=E,m.line++,P=m.x=et(s,this.left+u,this.right-a[m.line])):k>0&&V+E>this.bottom&&(P=m.x=P+o[m.line].width+u,m.line++,V=m.y=et(s,this.top+w+u,this.bottom-o[m.line].height));const M=c.x(P);if(x(M,V,B),P=Tm(A,P+p+h,C?P+D:this.right,t.rtl),_(c.x(P),V,B),C)m.x+=D+u;else if(typeof B.text!="string"){const z=d.lineHeight;m.y+=Pc(B,z)+u}else m.y+=E}),El(this.ctx,t.textDirection)}drawTitle(){const t=this.options,o=t.title,a=tt(o.font),r=ht(o.padding);if(!o.display)return;const s=zn(t.rtl,this.left,this.width),i=this.ctx,l=o.position,c=a.size/2,d=r.top+c;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+d,f=et(t.align,f,this.right-h);else{const p=this.columnSizes.reduce((g,y)=>Math.max(g,y.height),0);u=d+et(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const m=et(l,f,f+h);i.textAlign=s.textAlign(Dr(l)),i.textBaseline="middle",i.strokeStyle=o.color,i.fillStyle=o.color,i.font=a.string,mo(i,o.text,m,u,a)}_computeTitleHeight(){const t=this.options.title,o=tt(t.font),a=ht(t.padding);return t.display?o.lineHeight+a.height:0}_getLegendItemAt(t,o){let a,r,s;if(Rt(t,this.left,this.right)&&Rt(o,this.top,this.bottom)){for(s=this.legendHitBoxes,a=0;a<s.length;++a)if(r=s[a],Rt(t,r.left,r.left+r.width)&&Rt(o,r.top,r.top+r.height))return this.legendItems[a]}return null}handleEvent(t){const o=this.options;if(!ib(t.type,o))return;const a=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=ob(r,a);r&&!s&&Fe(o.onLeave,[t,r,this],this),this._hoveredItem=a,a&&!s&&Fe(o.onHover,[t,a,this],this)}else a&&Fe(o.onClick,[t,a,this],this)}}function ab(e,t,o,a,r){const s=rb(a,e,t,o),i=sb(r,a,t.lineHeight);return{itemWidth:s,itemHeight:i}}function rb(e,t,o,a){let r=e.text;return r&&typeof r!="string"&&(r=r.reduce((s,i)=>s.length>i.length?s:i)),t+o.size/2+a.measureText(r).width}function sb(e,t,o){let a=e;return typeof t.text!="string"&&(a=Pc(t,o)),a}function Pc(e,t){const o=e.text?e.text.length:0;return t*o}function ib(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var lb={id:"legend",_element:Nc,start(e,t,o){const a=e.legend=new Nc({ctx:e.ctx,options:o,chart:e});mt.configure(e,a,o),mt.addBox(e,a)},stop(e){mt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,o){const a=e.legend;mt.configure(e,a,o),a.options=o},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,o){const a=t.datasetIndex,r=o.chart;r.isDatasetVisible(a)?(r.hide(a),t.hidden=!0):(r.show(a),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:o,pointStyle:a,textAlign:r,color:s,useBorderRadius:i,borderRadius:l}}=e.legend.options;return e._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(o?0:void 0),u=ht(d.borderWidth);return{text:t[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:a||d.pointStyle,rotation:d.rotation,textAlign:r||d.textAlign,borderRadius:i&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class vc extends $t{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,o){const a=this.options;if(this.left=0,this.top=0,!a.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=o;const r=Ue(a.text)?a.text.length:1;this._padding=ht(a.padding);const s=r*tt(a.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:o,left:a,bottom:r,right:s,options:i}=this,l=i.align;let c=0,d,u,f;return this.isHorizontal()?(u=et(l,a,s),f=o+t,d=s-a):(i.position==="left"?(u=a+t,f=et(l,r,o),c=Ne*-.5):(u=s-t,f=et(l,o,r),c=Ne*.5),d=r-o),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const t=this.ctx,o=this.options;if(!o.display)return;const a=tt(o.font),s=a.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);mo(t,o.text,0,0,a,{color:o.color,maxWidth:c,rotation:d,textAlign:Dr(o.align),textBaseline:"middle",translation:[i,l]})}}function cb(e,t){const o=new vc({ctx:e.ctx,options:t,chart:e});mt.configure(e,o,t),mt.addBox(e,o),e.titleBlock=o}var db={id:"title",_element:vc,start(e,t,o){cb(e,o)},stop(e){const t=e.titleBlock;mt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,o){const a=e.titleBlock;mt.configure(e,a,o),a.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 _o={average(e){if(!e.length)return!1;let t,o,a=new Set,r=0,s=0;for(t=0,o=e.length;t<o;++t){const l=e[t].element;if(l&&l.hasValue()){const c=l.tooltipPosition();a.add(c.x),r+=c.y,++s}}return s===0||a.size===0?!1:{x:[...a].reduce((l,c)=>l+c)/a.size,y:r/s}},nearest(e,t){if(!e.length)return!1;let o=t.x,a=t.y,r=Number.POSITIVE_INFINITY,s,i,l;for(s=0,i=e.length;s<i;++s){const c=e[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=Ar(t,d);u<r&&(r=u,l=c)}}if(l){const c=l.tooltipPosition();o=c.x,a=c.y}return{x:o,y:a}}};function Dt(e,t){return t&&(Ue(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function jt(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
16
|
+
*/class Fp{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,o,a,r){const s=o.listeners[r],i=o.duration;s.forEach(l=>l({chart:t,initial:o.initial,numSteps:i,currentStep:Math.min(a-o.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=al.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let o=0;this._charts.forEach((a,r)=>{if(!a.running||!a.items.length)return;const s=a.items;let i=s.length-1,l=!1,c;for(;i>=0;--i)c=s[i],c._active?(c._total>a.duration&&(a.duration=c._total),c.tick(t),l=!0):(s[i]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,a,t,"progress")),s.length||(a.running=!1,this._notify(r,a,t,"complete"),a.initial=!1),o+=s.length}),this._lastDate=t,o===0&&(this._running=!1)}_getAnims(t){const o=this._charts;let a=o.get(t);return a||(a={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},o.set(t,a)),a}listen(t,o,a){this._getAnims(t).listeners[o].push(a)}add(t,o){!o||!o.length||this._getAnims(t).items.push(...o)}has(t){return this._getAnims(t).items.length>0}start(t){const o=this._charts.get(t);o&&(o.running=!0,o.start=Date.now(),o.duration=o.items.reduce((a,r)=>Math.max(a,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const o=this._charts.get(t);return!(!o||!o.running||!o.items.length)}stop(t){const o=this._charts.get(t);if(!o||!o.items.length)return;const a=o.items;let r=a.length-1;for(;r>=0;--r)a[r].cancel();o.items=[],this._notify(t,o,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Lt=new Fp;const vl="transparent",Ip={boolean(e,t,o){return o>.5?t:e},color(e,t,o){const a=ll(e||vl),r=a.valid&&ll(t||vl);return r&&r.valid?r.mix(a,o).hexString():t},number(e,t,o){return e+(t-e)*o}};class Rp{constructor(t,o,a,r){const s=o[a];r=ta([t.to,r,s,t.from]);const i=ta([t.from,s,r]);this._active=!0,this._fn=t.fn||Ip[t.type||typeof i],this._easing=fo[t.easing]||fo.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=o,this._prop=a,this._from=i,this._to=r,this._promises=void 0}active(){return this._active}update(t,o,a){if(this._active){this._notify(!1);const r=this._target[this._prop],s=a-this._start,i=this._duration-s;this._start=a,this._duration=Math.floor(Math.max(i,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=ta([t.to,o,r,t.from]),this._from=ta([t.from,r,o])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const o=t-this._start,a=this._duration,r=this._prop,s=this._from,i=this._loop,l=this._to;let c;if(this._active=s!==l&&(i||o<a),!this._active){this._target[r]=l,this._notify(!0);return}if(o<0){this._target[r]=s;return}c=o/a%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[r]=this._fn(s,l,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((o,a)=>{t.push({res:o,rej:a})})}_notify(t){const o=t?"res":"rej",a=this._promises||[];for(let r=0;r<a.length;r++)a[r][o]()}}class Tl{constructor(t,o){this._chart=t,this._properties=new Map,this.configure(o)}configure(t){if(!Be(t))return;const o=Object.keys(je.animation),a=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!Be(s))return;const i={};for(const l of o)i[l]=s[l];(He(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!a.has(l))&&a.set(l,i)})})}_animateOptions(t,o){const a=o.options,r=$p(t,a);if(!r)return[];const s=this._createAnimations(r,a);return a.$shared&&Lp(t.options.$animations,a).then(()=>{t.options=a},()=>{}),s}_createAnimations(t,o){const a=this._properties,r=[],s=t.$animations||(t.$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"){r.push(...this._animateOptions(t,o));continue}const u=o[d];let f=s[d];const h=a.get(d);if(f)if(h&&f.active()){f.update(h,u,l);continue}else f.cancel();if(!h||!h.duration){t[d]=u;continue}s[d]=f=new Rp(h,t,d,u),r.push(f)}return r}update(t,o){if(this._properties.size===0){Object.assign(t,o);return}const a=this._createAnimations(t,o);if(a.length)return Lt.add(this._chart,a),!0}}function Lp(e,t){const o=[],a=Object.keys(t);for(let r=0;r<a.length;r++){const s=e[a[r]];s&&s.active()&&o.push(s.wait())}return Promise.all(o)}function $p(e,t){if(!t)return;let o=e.options;if(!o){e.options=t;return}return o.$shared&&(e.options=o=Object.assign({},o,{$shared:!1,$animations:{}})),o}function Ol(e,t){const o=e&&e.options||{},a=o.reverse,r=o.min===void 0?t:0,s=o.max===void 0?t:0;return{start:a?s:r,end:a?r:s}}function Wp(e,t,o){if(o===!1)return!1;const a=Ol(e,o),r=Ol(t,o);return{top:r.end,right:a.end,bottom:r.start,left:a.start}}function jp(e){let t,o,a,r;return Be(e)?(t=e.top,o=e.right,a=e.bottom,r=e.left):t=o=a=r=e,{top:t,right:o,bottom:a,left:r,disabled:e===!1}}function zl(e,t){const o=[],a=e._getSortedDatasetMetas(t);let r,s;for(r=0,s=a.length;r<s;++r)o.push(a[r].index);return o}function Fl(e,t,o,a={}){const r=e.keys,s=a.mode==="single";let i,l,c,d;if(t===null)return;let u=!1;for(i=0,l=r.length;i<l;++i){if(c=+r[i],c===o){if(u=!0,a.all)continue;break}d=e.values[c],Ze(d)&&(s||t===0||At(t)===At(d))&&(t+=d)}return!u&&!a.all?0:t}function Up(e,t){const{iScale:o,vScale:a}=t,r=o.axis==="x"?"x":"y",s=a.axis==="x"?"x":"y",i=Object.keys(e),l=new Array(i.length);let c,d,u;for(c=0,d=i.length;c<d;++c)u=i[c],l[c]={[r]:u,[s]:e[u]};return l}function Wr(e,t){const o=e&&e.options.stacked;return o||o===void 0&&t.stack!==void 0}function Hp(e,t,o){return`${e.id}.${t.id}.${o.stack||o.type}`}function qp(e){const{min:t,max:o,minDefined:a,maxDefined:r}=e.getUserBounds();return{min:a?t:Number.NEGATIVE_INFINITY,max:r?o:Number.POSITIVE_INFINITY}}function Gp(e,t,o){const a=e[t]||(e[t]={});return a[o]||(a[o]={})}function Il(e,t,o,a){for(const r of t.getMatchingVisibleMetas(a).reverse()){const s=e[r.index];if(o&&s>0||!o&&s<0)return r.index}return null}function Rl(e,t){const{chart:o,_cachedMeta:a}=e,r=o._stacks||(o._stacks={}),{iScale:s,vScale:i,index:l}=a,c=s.axis,d=i.axis,u=Hp(s,i,a),f=t.length;let h;for(let m=0;m<f;++m){const p=t[m],{[c]:b,[d]:g}=p,x=p._stacks||(p._stacks={});h=x[d]=Gp(r,u,b),h[l]=g,h._top=Il(h,i,!0,a.type),h._bottom=Il(h,i,!1,a.type);const _=h._visualValues||(h._visualValues={});_[l]=g}}function jr(e,t){const o=e.scales;return Object.keys(o).filter(a=>o[a].axis===t).shift()}function Xp(e,t){return xn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Yp(e,t,o){return xn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:o,index:t,mode:"default",type:"data"})}function go(e,t){const o=e.controller.index,a=e.vScale&&e.vScale.axis;if(a){t=t||e._parsed;for(const r of t){const s=r._stacks;if(!s||s[a]===void 0||s[a][o]===void 0)return;delete s[a][o],s[a]._visualValues!==void 0&&s[a]._visualValues[o]!==void 0&&delete s[a]._visualValues[o]}}}const Ur=e=>e==="reset"||e==="none",Ll=(e,t)=>t?e:Object.assign({},e),Kp=(e,t,o)=>e&&!t.hidden&&t._stacked&&{keys:zl(o,!0),values:null};class _n{constructor(t,o){this.chart=t,this._ctx=t.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 t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Wr(t.vScale,t),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(t){this.index!==t&&go(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,o=this._cachedMeta,a=this.getDataset(),r=(f,h,m,p)=>f==="x"?h:f==="r"?p:m,s=o.xAxisID=we(a.xAxisID,jr(t,"x")),i=o.yAxisID=we(a.yAxisID,jr(t,"y")),l=o.rAxisID=we(a.rAxisID,jr(t,"r")),c=o.indexAxis,d=o.iAxisID=r(c,s,i,l),u=o.vAxisID=r(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(t){return this.chart.scales[t]}_getOtherScale(t){const o=this._cachedMeta;return t===o.iScale?o.vScale:o.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&nl(this._data,this),t._stacked&&go(t)}_dataCheck(){const t=this.getDataset(),o=t.data||(t.data=[]),a=this._data;if(Be(o)){const r=this._cachedMeta;this._data=Up(o,r)}else if(a!==o){if(a){nl(a,this);const r=this._cachedMeta;go(r),r._parsed=[]}o&&Object.isExtensible(o)&&Pm(o,this),this._syncList=[],this._data=o}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const o=this._cachedMeta,a=this.getDataset();let r=!1;this._dataCheck();const s=o._stacked;o._stacked=Wr(o.vScale,o),o.stack!==a.stack&&(r=!0,go(o),o.stack=a.stack),this._resyncElements(t),(r||s!==o._stacked)&&(Rl(this,o._parsed),o._stacked=Wr(o.vScale,o))}configure(){const t=this.chart.config,o=t.datasetScopeKeys(this._type),a=t.getOptionScopes(this.getDataset(),o,!0);this.options=t.createResolver(a,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,o){const{_cachedMeta:a,_data:r}=this,{iScale:s,_stacked:i}=a,l=s.axis;let c=t===0&&o===r.length?!0:a._sorted,d=t>0&&a._parsed[t-1],u,f,h;if(this._parsing===!1)a._parsed=r,a._sorted=!0,h=r;else{He(r[t])?h=this.parseArrayData(a,r,t,o):Be(r[t])?h=this.parseObjectData(a,r,t,o):h=this.parsePrimitiveData(a,r,t,o);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<o;++u)a._parsed[u+t]=f=h[u],c&&(m()&&(c=!1),d=f);a._sorted=c}i&&Rl(this,h)}parsePrimitiveData(t,o,a,r){const{iScale:s,vScale:i}=t,l=s.axis,c=i.axis,d=s.getLabels(),u=s===i,f=new Array(r);let h,m,p;for(h=0,m=r;h<m;++h)p=h+a,f[h]={[l]:u||s.parse(d[p],p),[c]:i.parse(o[p],p)};return f}parseArrayData(t,o,a,r){const{xScale:s,yScale:i}=t,l=new Array(r);let c,d,u,f;for(c=0,d=r;c<d;++c)u=c+a,f=o[u],l[c]={x:s.parse(f[0],u),y:i.parse(f[1],u)};return l}parseObjectData(t,o,a,r){const{xScale:s,yScale:i}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(r);let u,f,h,m;for(u=0,f=r;u<f;++u)h=u+a,m=o[h],d[u]={x:s.parse(mn(m,l),h),y:i.parse(mn(m,c),h)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,o,a){const r=this.chart,s=this._cachedMeta,i=o[t.axis],l={keys:zl(r,!0),values:o._stacks[t.axis]._visualValues};return Fl(l,i,s.index,{mode:a})}updateRangeFromParsed(t,o,a,r){const s=a[o.axis];let i=s===null?NaN:s;const l=r&&a._stacks[o.axis];r&&l&&(r.values=l,i=Fl(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}getMinMax(t,o){const a=this._cachedMeta,r=a._parsed,s=a._sorted&&t===a.iScale,i=r.length,l=this._getOtherScale(t),c=Kp(o,a,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=qp(l);let h,m;function p(){m=r[h];const b=m[l.axis];return!Ze(m[t.axis])||u>b||f<b}for(h=0;h<i&&!(!p()&&(this.updateRangeFromParsed(d,t,m,c),s));++h);if(s){for(h=i-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(d,t,m,c);break}}return d}getAllParsedValues(t){const o=this._cachedMeta._parsed,a=[];let r,s,i;for(r=0,s=o.length;r<s;++r)i=o[r][t.axis],Ze(i)&&a.push(i);return a}getMaxOverflow(){return!1}getLabelAndValue(t){const o=this._cachedMeta,a=o.iScale,r=o.vScale,s=this.getParsed(t);return{label:a?""+a.getLabelForValue(s[a.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const o=this._cachedMeta;this.update(t||"default"),o._clip=jp(we(this.options.clip,Wp(o.xScale,o.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,o=this.chart,a=this._cachedMeta,r=a.data||[],s=o.chartArea,i=[],l=this._drawStart||0,c=this._drawCount||r.length-l,d=this.options.drawActiveElementsOnTop;let u;for(a.dataset&&a.dataset.draw(t,s,l,c),u=l;u<l+c;++u){const f=r[u];f.hidden||(f.active&&d?i.push(f):f.draw(t,s))}for(u=0;u<i.length;++u)i[u].draw(t,s)}getStyle(t,o){const a=o?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(a):this.resolveDataElementOptions(t||0,a)}getContext(t,o,a){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const i=this._cachedMeta.data[t];s=i.$context||(i.$context=Yp(this.getContext(),t,i)),s.parsed=this.getParsed(t),s.raw=r.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=Xp(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!o,s.mode=a,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,o){return this._resolveElementOptions(this.dataElementType.id,o,t)}_resolveElementOptions(t,o="default",a){const r=o==="active",s=this._cachedDataOpts,i=t+"-"+o,l=s[i],c=this.enableOptionSharing&&io(a);if(l)return Ll(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,t),f=r?[`${t}Hover`,"hover",t,""]:[t,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(je.elements[t]),p=()=>this.getContext(a,r,o),b=d.resolveNamedOptions(h,m,p,f);return b.$shared&&(b.$shared=c,s[i]=Object.freeze(Ll(b,c))),b}_resolveAnimations(t,o,a){const r=this.chart,s=this._cachedDataOpts,i=`animation-${o}`,l=s[i];if(l)return l;let c;if(r.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(t,a,o))}const d=new Tl(r,c&&c.animations);return c&&c._cacheable&&(s[i]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,o){return!o||Ur(t)||this.chart._animationsDisabled}_getSharedOptions(t,o){const a=this.resolveDataElementOptions(t,o),r=this._sharedOptions,s=this.getSharedOptions(a),i=this.includeOptions(o,s)||s!==r;return this.updateSharedOptions(s,o,a),{sharedOptions:s,includeOptions:i}}updateElement(t,o,a,r){Ur(r)?Object.assign(t,a):this._resolveAnimations(o,r).update(t,a)}updateSharedOptions(t,o,a){t&&!Ur(o)&&this._resolveAnimations(void 0,o).update(t,a)}_setStyle(t,o,a,r){t.active=r;const s=this.getStyle(o,r);this._resolveAnimations(o,a,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,o,a){this._setStyle(t,a,"active",!1)}setHoverStyle(t,o,a){this._setStyle(t,a,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const o=this._data,a=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const r=a.length,s=o.length,i=Math.min(s,r);i&&this.parse(0,i),s>r?this._insertElements(r,s-r,t):s<r&&this._removeElements(s,r-s)}_insertElements(t,o,a=!0){const r=this._cachedMeta,s=r.data,i=t+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=t;l<i;++l)s[l]=new this.dataElementType;this._parsing&&c(r._parsed),this.parse(t,o),a&&this.updateElements(s,t,o,"reset")}updateElements(t,o,a,r){}_removeElements(t,o){const a=this._cachedMeta;if(this._parsing){const r=a._parsed.splice(t,o);a._stacked&&go(a,r)}a.data.splice(t,o)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[o,a,r]=t;this[o](a,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,o){o&&this._sync(["_removeElements",t,o]);const a=arguments.length-2;a&&this._sync(["_insertElements",t,a])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}fe(_n,"defaults",{}),fe(_n,"datasetElementType",null),fe(_n,"dataElementType",null);function Jp(e,t){if(!e._cache.$bar){const o=e.getMatchingVisibleMetas(t);let a=[];for(let r=0,s=o.length;r<s;r++)a=a.concat(o[r].controller.getAllParsedValues(e));e._cache.$bar=ol(a.sort((r,s)=>r-s))}return e._cache.$bar}function Qp(e){const t=e.iScale,o=Jp(t,e.type);let a=t._length,r,s,i,l;const c=()=>{i===32767||i===-32768||(io(l)&&(a=Math.min(a,Math.abs(i-l)||a)),l=i)};for(r=0,s=o.length;r<s;++r)i=t.getPixelForValue(o[r]),c();for(l=void 0,r=0,s=t.ticks.length;r<s;++r)i=t.getPixelForTick(r),c();return a}function Zp(e,t,o,a){const r=o.barThickness;let s,i;return De(r)?(s=t.min*o.categoryPercentage,i=o.barPercentage):(s=r*a,i=1),{chunk:s/a,ratio:i,start:t.pixels[e]-s/2}}function eg(e,t,o,a){const r=t.pixels,s=r[e];let i=e>0?r[e-1]:null,l=e<r.length-1?r[e+1]:null;const c=o.categoryPercentage;i===null&&(i=s-(l===null?t.end-t.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/a,ratio:o.barPercentage,start:d}}function tg(e,t,o,a){const r=o.parse(e[0],a),s=o.parse(e[1],a),i=Math.min(r,s),l=Math.max(r,s);let c=i,d=l;Math.abs(i)>Math.abs(l)&&(c=l,d=i),t[o.axis]=d,t._custom={barStart:c,barEnd:d,start:r,end:s,min:i,max:l}}function $l(e,t,o,a){return He(e)?tg(e,t,o,a):t[o.axis]=o.parse(e,a),t}function Wl(e,t,o,a){const r=e.iScale,s=e.vScale,i=r.getLabels(),l=r===s,c=[];let d,u,f,h;for(d=o,u=o+a;d<u;++d)h=t[d],f={},f[r.axis]=l||r.parse(i[d],d),c.push($l(h,f,s,d));return c}function Hr(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function ng(e,t,o){return e!==0?At(e):(t.isHorizontal()?1:-1)*(t.min>=o?1:-1)}function og(e){let t,o,a,r,s;return e.horizontal?(t=e.base>e.x,o="left",a="right"):(t=e.base<e.y,o="bottom",a="top"),t?(r="end",s="start"):(r="start",s="end"),{start:o,end:a,reverse:t,top:r,bottom:s}}function ag(e,t,o,a){let r=t.borderSkipped;const s={};if(!r){e.borderSkipped=s;return}if(r===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:l,reverse:c,top:d,bottom:u}=og(e);r==="middle"&&o&&(e.enableBorderRadius=!0,(o._top||0)===a?r=d:(o._bottom||0)===a?r=u:(s[jl(u,i,l,c)]=!0,r=d)),s[jl(r,i,l,c)]=!0,e.borderSkipped=s}function jl(e,t,o,a){return a?(e=rg(e,t,o),e=Ul(e,o,t)):e=Ul(e,t,o),e}function rg(e,t,o){return e===t?o:e===o?t:e}function Ul(e,t,o){return e==="start"?t:e==="end"?o:e}function sg(e,{inflateAmount:t},o){e.inflateAmount=t==="auto"?o===1?.33:0:t}class sa extends _n{parsePrimitiveData(t,o,a,r){return Wl(t,o,a,r)}parseArrayData(t,o,a,r){return Wl(t,o,a,r)}parseObjectData(t,o,a,r){const{iScale:s,vScale:i}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?l:c,u=i.axis==="x"?l:c,f=[];let h,m,p,b;for(h=a,m=a+r;h<m;++h)b=o[h],p={},p[s.axis]=s.parse(mn(b,d),h),f.push($l(mn(b,u),p,i,h));return f}updateRangeFromParsed(t,o,a,r){super.updateRangeFromParsed(t,o,a,r);const s=a._custom;s&&o===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const o=this._cachedMeta,{iScale:a,vScale:r}=o,s=this.getParsed(t),i=s._custom,l=Hr(i)?"["+i.start+", "+i.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+a.getLabelForValue(s[a.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const o=this._cachedMeta;this.updateElements(o.data,0,o.data.length,t)}updateElements(t,o,a,r){const s=r==="reset",{index:i,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(o,r);for(let m=o;m<o+a;m++){const p=this.getParsed(m),b=s||De(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),g=this._calculateBarIndexPixels(m,u),x=(p._stacks||{})[l.axis],_={horizontal:d,base:b.base,enableBorderRadius:!x||Hr(p._custom)||i===x._top||i===x._bottom,x:d?b.head:g.center,y:d?g.center:b.head,height:d?g.size:Math.abs(b.size),width:d?Math.abs(b.size):g.size};h&&(_.options=f||this.resolveDataElementOptions(m,t[m].active?"active":r));const C=_.options||t[m].options;ag(_,C,x,i),sg(_,C,u.ratio),this.updateElement(t[m],m,_,r)}}_getStacks(t,o){const{iScale:a}=this._cachedMeta,r=a.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=a.options.stacked,i=[],l=this._cachedMeta.controller.getParsed(o),c=l&&l[a.axis],d=u=>{const f=u._parsed.find(m=>m[a.axis]===c),h=f&&f[u.vScale.axis];if(De(h)||isNaN(h))return!0};for(const u of r)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===t))break;return i.length||i.push(void 0),i}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,o=this.chart.options.indexAxis;return Object.keys(t).filter(a=>t[a].axis===o).shift()}_getAxis(){const t={},o=this.getFirstScaleIdForIndexAxis();for(const a of this.chart.data.datasets)t[we(this.chart.options.indexAxis==="x"?a.xAxisID:a.yAxisID,o)]=!0;return Object.keys(t)}_getStackIndex(t,o,a){const r=this._getStacks(t,a),s=o!==void 0?r.indexOf(o):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,o=this._cachedMeta,a=o.iScale,r=[];let s,i;for(s=0,i=o.data.length;s<i;++s)r.push(a.getPixelForValue(this.getParsed(s)[a.axis],s));const l=t.barThickness;return{min:l||Qp(o),pixels:r,start:a._startPixel,end:a._endPixel,stackCount:this._getStackCount(),scale:a,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:o,_stacked:a,index:r},options:{base:s,minBarLength:i}}=this,l=s||0,c=this.getParsed(t),d=c._custom,u=Hr(d);let f=c[o.axis],h=0,m=a?this.applyStack(o,c,a):f,p,b;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&At(f)!==At(d.barEnd)&&(h=0),h+=f);const g=!De(s)&&!u?s:h;let x=o.getPixelForValue(g);if(this.chart.getDataVisibility(t)?p=o.getPixelForValue(h+m):p=x,b=p-x,Math.abs(b)<i){b=ng(b,o,l)*i,f===l&&(x-=b/2);const _=o.getPixelForDecimal(0),C=o.getPixelForDecimal(1),w=Math.min(_,C),E=Math.max(_,C);x=Math.max(Math.min(x,E),w),p=x+b,a&&!u&&(c._stacks[o.axis]._visualValues[r]=o.getValueForPixel(p)-o.getValueForPixel(x))}if(x===o.getPixelForValue(l)){const _=At(b)*o.getLineWidthForValue(l)/2;x+=_,b-=_}return{size:b,base:x,head:p,center:p+b/2}}_calculateBarIndexPixels(t,o){const a=o.scale,r=this.options,s=r.skipNull,i=we(r.maxBarThickness,1/0);let l,c;const d=this._getAxisCount();if(o.grouped){const u=s?this._getStackCount(t):o.stackCount,f=r.barThickness==="flex"?eg(t,o,r,u*d):Zp(t,o,r,u*d),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(we(h,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+m;l=f.start+f.chunk*p+f.chunk/2,c=Math.min(i,f.chunk*f.ratio)}else l=a.getPixelForValue(this.getParsed(t)[a.axis],t),c=Math.min(i,o.min*o.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const t=this._cachedMeta,o=t.vScale,a=t.data,r=a.length;let s=0;for(;s<r;++s)this.getParsed(s)[o.axis]!==null&&!a[s].hidden&&a[s].draw(this._ctx)}}fe(sa,"id","bar"),fe(sa,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),fe(sa,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function ig(e,t,o){let a=1,r=1,s=0,i=0;if(t<$e){const l=e,c=l+t,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(C,w,E)=>uo(C,l,c,!0)?1:Math.max(w,w*o,E,E*o),p=(C,w,E)=>uo(C,l,c,!0)?-1:Math.min(w,w*o,E,E*o),b=m(0,d,f),g=m(Xe,u,h),x=p(Pe,d,f),_=p(Pe+Xe,u,h);a=(b-x)/2,r=(g-_)/2,s=-(b+x)/2,i=-(g+_)/2}return{ratioX:a,ratioY:r,offsetX:s,offsetY:i}}class Fn extends _n{constructor(t,o){super(t,o),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,o){const a=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=a;else{let s=c=>+a[c];if(Be(a[t])){const{key:c="value"}=this._parsing;s=d=>+mn(a[d],c)}let i,l;for(i=t,l=t+o;i<l;++i)r._parsed[i]=s(i)}}_getRotation(){return It(this.options.rotation-90)}_getCircumference(){return It(this.options.circumference)}_getRotationExtents(){let t=$e,o=-$e;for(let a=0;a<this.chart.data.datasets.length;++a)if(this.chart.isDatasetVisible(a)&&this.chart.getDatasetMeta(a).type===this._type){const r=this.chart.getDatasetMeta(a).controller,s=r._getRotation(),i=r._getCircumference();t=Math.min(t,s),o=Math.max(o,s+i)}return{rotation:t,circumference:o-t}}update(t){const o=this.chart,{chartArea:a}=o,r=this._cachedMeta,s=r.data,i=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(a.width,a.height)-i)/2,0),c=Math.min(pm(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:b}=ig(f,u,c),g=(a.width-i)/h,x=(a.height-i)/m,_=Math.max(Math.min(g,x)/2,0),C=qi(this.options.radius,_),w=Math.max(C*c,0),E=(C-w)/this._getVisibleDatasetWeightTotal();this.offsetX=p*C,this.offsetY=b*C,r.total=this.calculateTotal(),this.outerRadius=C-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*d,0),this.updateElements(s,0,s.length,t)}_circumference(t,o){const a=this.options,r=this._cachedMeta,s=this._getCircumference();return o&&a.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/$e)}updateElements(t,o,a,r){const s=r==="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,p=h?0:this.outerRadius,{sharedOptions:b,includeOptions:g}=this._getSharedOptions(o,r);let x=this._getRotation(),_;for(_=0;_<o;++_)x+=this._circumference(_,s);for(_=o;_<o+a;++_){const C=this._circumference(_,s),w=t[_],E={x:u+this.offsetX,y:f+this.offsetY,startAngle:x,endAngle:x+C,circumference:C,outerRadius:p,innerRadius:m};g&&(E.options=b||this.resolveDataElementOptions(_,w.active?"active":r)),x+=C,this.updateElement(w,_,E,r)}}calculateTotal(){const t=this._cachedMeta,o=t.data;let a=0,r;for(r=0;r<o.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!o[r].hidden&&(a+=Math.abs(s))}return a}calculateCircumference(t){const o=this._cachedMeta.total;return o>0&&!isNaN(t)?$e*(Math.abs(t)/o):0}getLabelAndValue(t){const o=this._cachedMeta,a=this.chart,r=a.data.labels||[],s=Pr(o._parsed[t],a.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let o=0;const a=this.chart;let r,s,i,l,c;if(!t){for(r=0,s=a.data.datasets.length;r<s;++r)if(a.isDatasetVisible(r)){i=a.getDatasetMeta(r),t=i.data,l=i.controller;break}}if(!t)return 0;for(r=0,s=t.length;r<s;++r)c=l.resolveDataElementOptions(r),c.borderAlign!=="inner"&&(o=Math.max(o,c.borderWidth||0,c.hoverBorderWidth||0));return o}getMaxOffset(t){let o=0;for(let a=0,r=t.length;a<r;++a){const s=this.resolveDataElementOptions(a);o=Math.max(o,s.offset||0,s.hoverOffset||0)}return o}_getRingWeightOffset(t){let o=0;for(let a=0;a<t;++a)this.chart.isDatasetVisible(a)&&(o+=this._getRingWeight(a));return o}_getRingWeight(t){return Math.max(we(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}fe(Fn,"id","doughnut"),fe(Fn,"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"}),fe(Fn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),fe(Fn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const o=t.data,{labels:{pointStyle:a,textAlign:r,color:s,useBorderRadius:i,borderRadius:l}}=t.legend.options;return o.labels.length&&o.datasets.length?o.labels.map((c,d)=>{const f=t.getDatasetMeta(0).controller.getStyle(d);return{text:c,fillStyle:f.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:r,pointStyle:a,borderRadius:i&&(l||f.borderRadius),index:d}}):[]}},onClick(t,o,a){a.chart.toggleDataVisibility(o.index),a.chart.update()}}}});class ia extends _n{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const o=this._cachedMeta,{dataset:a,data:r=[],_dataset:s}=o,i=this.chart._animationsDisabled;let{start:l,count:c}=Om(o,r,i);this._drawStart=l,this._drawCount=c,zm(o)&&(l=0,c=r.length),a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!s._decimated,a.points=r;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:d},t),this.updateElements(r,l,c,t)}updateElements(t,o,a,r){const s=r==="reset",{iScale:i,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(o,r),h=i.axis,m=l.axis,{spanGaps:p,segment:b}=this.options,g=co(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||s||r==="none",_=o+a,C=t.length;let w=o>0&&this.getParsed(o-1);for(let E=0;E<C;++E){const B=t[E],k=x?B:{};if(E<o||E>=_){k.skip=!0;continue}const y=this.getParsed(E),A=De(y[m]),D=k[h]=i.getPixelForValue(y[h],E),N=k[m]=s||A?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,y,c):y[m],E);k.skip=isNaN(D)||isNaN(N)||A,k.stop=E>0&&Math.abs(y[h]-w[h])>g,b&&(k.parsed=y,k.raw=d.data[E]),f&&(k.options=u||this.resolveDataElementOptions(E,B.active?"active":r)),x||this.updateElement(B,E,k,r),w=y}}getMaxOverflow(){const t=this._cachedMeta,o=t.dataset,a=o.options&&o.options.borderWidth||0,r=t.data||[];if(!r.length)return a;const s=r[0].size(this.resolveDataElementOptions(0)),i=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(a,s,i)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}fe(ia,"id","line"),fe(ia,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),fe(ia,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class qr extends Fn{}fe(qr,"id","pie"),fe(qr,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function Bn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Gr{constructor(t){fe(this,"options");this.options=t||{}}static override(t){Object.assign(Gr.prototype,t)}init(){}formats(){return Bn()}parse(){return Bn()}format(){return Bn()}add(){return Bn()}diff(){return Bn()}startOf(){return Bn()}endOf(){return Bn()}}var lg={_date:Gr};function cg(e,t,o,a){const{controller:r,data:s,_sorted:i}=e,l=r._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&i&&s.length){const d=l._reversePixels?Mm:gn;if(a){if(r._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(t);if(f){const h=d(s,t,o-f),m=d(s,t,o+f);return{lo:h.lo,hi:m.hi}}}}else{const u=d(s,t,o);if(c){const{vScale:f}=r._cachedMeta,{_parsed:h}=e,m=h.slice(0,u.lo+1).reverse().findIndex(b=>!De(b[f.axis]));u.lo-=Math.max(0,m);const p=h.slice(u.hi).findIndex(b=>!De(b[f.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:s.length-1}}function la(e,t,o,a,r){const s=e.getSortedVisibleDatasetMetas(),i=o[t];for(let l=0,c=s.length;l<c;++l){const{index:d,data:u}=s[l],{lo:f,hi:h}=cg(s[l],t,i,r);for(let m=f;m<=h;++m){const p=u[m];p.skip||a(p,d,m)}}}function dg(e){const t=e.indexOf("x")!==-1,o=e.indexOf("y")!==-1;return function(a,r){const s=t?Math.abs(a.x-r.x):0,i=o?Math.abs(a.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(i,2))}}function Xr(e,t,o,a,r){const s=[];return!r&&!e.isPointInArea(t)||la(e,o,t,function(l,c,d){!r&&!mo(l,e.chartArea,0)||l.inRange(t.x,t.y,a)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function ug(e,t,o,a){let r=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],a),{angle:f}=el(i,{x:t.x,y:t.y});uo(f,d,u)&&r.push({element:i,datasetIndex:l,index:c})}return la(e,o,t,s),r}function fg(e,t,o,a,r,s){let i=[];const l=dg(o);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(t.x,t.y,r);if(a&&!m)return;const p=u.getCenterPoint(r);if(!(!!s||e.isPointInArea(p))&&!m)return;const g=l(t,p);g<c?(i=[{element:u,datasetIndex:f,index:h}],c=g):g===c&&i.push({element:u,datasetIndex:f,index:h})}return la(e,o,t,d),i}function Yr(e,t,o,a,r,s){return!s&&!e.isPointInArea(t)?[]:o==="r"&&!a?ug(e,t,o,r):fg(e,t,o,a,r,s)}function Hl(e,t,o,a,r){const s=[],i=o==="x"?"inXRange":"inYRange";let l=!1;return la(e,o,t,(c,d,u)=>{c[i]&&c[i](t[o],r)&&(s.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(t.x,t.y,r))}),a&&!l?[]:s}var hg={modes:{index(e,t,o,a){const r=wn(t,e),s=o.axis||"x",i=o.includeInvisible||!1,l=o.intersect?Xr(e,r,s,a,i):Yr(e,r,s,!1,a,i),c=[];return l.length?(e.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(e,t,o,a){const r=wn(t,e),s=o.axis||"xy",i=o.includeInvisible||!1;let l=o.intersect?Xr(e,r,s,a,i):Yr(e,r,s,!1,a,i);if(l.length>0){const c=l[0].datasetIndex,d=e.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(e,t,o,a){const r=wn(t,e),s=o.axis||"xy",i=o.includeInvisible||!1;return Xr(e,r,s,a,i)},nearest(e,t,o,a){const r=wn(t,e),s=o.axis||"xy",i=o.includeInvisible||!1;return Yr(e,r,s,o.intersect,a,i)},x(e,t,o,a){const r=wn(t,e);return Hl(e,r,"x",o.intersect,a)},y(e,t,o,a){const r=wn(t,e);return Hl(e,r,"y",o.intersect,a)}}};const ql=["left","top","right","bottom"];function bo(e,t){return e.filter(o=>o.pos===t)}function Gl(e,t){return e.filter(o=>ql.indexOf(o.pos)===-1&&o.box.axis===t)}function yo(e,t){return e.sort((o,a)=>{const r=t?a:o,s=t?o:a;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function mg(e){const t=[];let o,a,r,s,i,l;for(o=0,a=(e||[]).length;o<a;++o)r=e[o],{position:s,options:{stack:i,stackWeight:l=1}}=r,t.push({index:o,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:i&&s+i,stackWeight:l});return t}function pg(e){const t={};for(const o of e){const{stack:a,pos:r,stackWeight:s}=o;if(!a||!ql.includes(r))continue;const i=t[a]||(t[a]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=s}return t}function gg(e,t){const o=pg(e),{vBoxMaxWidth:a,hBoxMaxHeight:r}=t;let s,i,l;for(s=0,i=e.length;s<i;++s){l=e[s];const{fullSize:c}=l.box,d=o[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*a:c&&t.availableWidth,l.height=r):(l.width=a,l.height=u?u*r:c&&t.availableHeight)}return o}function bg(e){const t=mg(e),o=yo(t.filter(d=>d.box.fullSize),!0),a=yo(bo(t,"left"),!0),r=yo(bo(t,"right")),s=yo(bo(t,"top"),!0),i=yo(bo(t,"bottom")),l=Gl(t,"x"),c=Gl(t,"y");return{fullSize:o,leftAndTop:a.concat(s),rightAndBottom:r.concat(c).concat(i).concat(l),chartArea:bo(t,"chartArea"),vertical:a.concat(r).concat(c),horizontal:s.concat(i).concat(l)}}function Xl(e,t,o,a){return Math.max(e[o],t[o])+Math.max(e[a],t[a])}function Yl(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function yg(e,t,o,a){const{pos:r,box:s}=o,i=e.maxPadding;if(!Be(r)){o.size&&(e[r]-=o.size);const f=a[o.stack]||{size:0,count:1};f.size=Math.max(f.size,o.horizontal?s.height:s.width),o.size=f.size/f.count,e[r]+=o.size}s.getPadding&&Yl(i,s.getPadding());const l=Math.max(0,t.outerWidth-Xl(i,e,"left","right")),c=Math.max(0,t.outerHeight-Xl(i,e,"top","bottom")),d=l!==e.w,u=c!==e.h;return e.w=l,e.h=c,o.horizontal?{same:d,other:u}:{same:u,other:d}}function xg(e){const t=e.maxPadding;function o(a){const r=Math.max(t[a]-e[a],0);return e[a]+=r,r}e.y+=o("top"),e.x+=o("left"),o("right"),o("bottom")}function kg(e,t){const o=t.maxPadding;function a(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(i=>{s[i]=Math.max(t[i],o[i])}),s}return a(e?["left","right"]:["top","bottom"])}function xo(e,t,o,a){const r=[];let s,i,l,c,d,u;for(s=0,i=e.length,d=0;s<i;++s){l=e[s],c=l.box,c.update(l.width||t.w,l.height||t.h,kg(l.horizontal,t));const{same:f,other:h}=yg(t,o,l,a);d|=f&&r.length,u=u||h,c.fullSize||r.push(l)}return d&&xo(r,t,o,a)||u}function ca(e,t,o,a,r){e.top=o,e.left=t,e.right=t+a,e.bottom=o+r,e.width=a,e.height=r}function Kl(e,t,o,a){const r=o.padding;let{x:s,y:i}=t;for(const l of e){const c=l.box,d=a[l.stack]||{placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=t.w*u,h=d.size||c.height;io(d.start)&&(i=d.start),c.fullSize?ca(c,r.left,i,o.outerWidth-r.right-r.left,h):ca(c,t.left+d.placed,i,f,h),d.start=i,d.placed+=f,i=c.bottom}else{const f=t.h*u,h=d.size||c.width;io(d.start)&&(s=d.start),c.fullSize?ca(c,s,r.top,h,o.outerHeight-r.bottom-r.top):ca(c,s,t.top+d.placed,h,f),d.start=s,d.placed+=f,s=c.right}}t.x=s,t.y=i}var mt={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(o){t.draw(o)}}]},e.boxes.push(t)},removeBox(e,t){const o=e.boxes?e.boxes.indexOf(t):-1;o!==-1&&e.boxes.splice(o,1)},configure(e,t,o){t.fullSize=o.fullSize,t.position=o.position,t.weight=o.weight},update(e,t,o,a){if(!e)return;const r=ht(e.options.layout.padding),s=Math.max(t-r.width,0),i=Math.max(o-r.height,0),l=bg(e.boxes),c=l.vertical,d=l.horizontal;Ne(e.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=c.reduce((b,g)=>g.box.options&&g.box.options.display===!1?b:b+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:o,padding:r,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),h=Object.assign({},r);Yl(h,ht(a));const m=Object.assign({maxPadding:h,w:s,h:i,x:r.left,y:r.top},r),p=gg(c.concat(d),f);xo(l.fullSize,m,f,p),xo(c,m,f,p),xo(d,m,f,p)&&xo(c,m,f,p),xg(m),Kl(l.leftAndTop,m,f,p),m.x+=m.w,m.y+=m.h,Kl(l.rightAndBottom,m,f,p),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Ne(l.chartArea,b=>{const g=b.box;Object.assign(g,e.chartArea),g.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Jl{acquireContext(t,o){}releaseContext(t){return!1}addEventListener(t,o,a){}removeEventListener(t,o,a){}getDevicePixelRatio(){return 1}getMaximumSize(t,o,a,r){return o=Math.max(0,o||t.width),a=a||t.height,{width:o,height:Math.max(0,r?Math.floor(o/r):a)}}isAttached(t){return!0}updateConfig(t){}}class wg extends Jl{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const da="$chartjs",Cg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ql=e=>e===null||e==="";function _g(e,t){const o=e.style,a=e.getAttribute("height"),r=e.getAttribute("width");if(e[da]={initial:{height:a,width:r,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",Ql(r)){const s=_l(e,"width");s!==void 0&&(e.width=s)}if(Ql(a))if(e.style.height==="")e.height=e.width/(t||2);else{const s=_l(e,"height");s!==void 0&&(e.height=s)}return e}const Zl=Ep?{passive:!0}:!1;function Bg(e,t,o){e&&e.addEventListener(t,o,Zl)}function Eg(e,t,o){e&&e.canvas&&e.canvas.removeEventListener(t,o,Zl)}function Sg(e,t){const o=Cg[e.type]||e.type,{x:a,y:r}=wn(e,t);return{type:o,chart:t,native:e,x:a!==void 0?a:null,y:r!==void 0?r:null}}function ua(e,t){for(const o of e)if(o===t||o.contains(t))return!0}function Ag(e,t,o){const a=e.canvas,r=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||ua(l.addedNodes,a),i=i&&!ua(l.removedNodes,a);i&&o()});return r.observe(document,{childList:!0,subtree:!0}),r}function Vg(e,t,o){const a=e.canvas,r=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||ua(l.removedNodes,a),i=i&&!ua(l.addedNodes,a);i&&o()});return r.observe(document,{childList:!0,subtree:!0}),r}const ko=new Map;let ec=0;function tc(){const e=window.devicePixelRatio;e!==ec&&(ec=e,ko.forEach((t,o)=>{o.currentDevicePixelRatio!==e&&t()}))}function Dg(e,t){ko.size||window.addEventListener("resize",tc),ko.set(e,t)}function Mg(e){ko.delete(e),ko.size||window.removeEventListener("resize",tc)}function Ng(e,t,o){const a=e.canvas,r=a&&$r(a);if(!r)return;const s=rl((l,c)=>{const d=r.clientWidth;o(l,c),d<r.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(r),Dg(e,s),i}function Kr(e,t,o){o&&o.disconnect(),t==="resize"&&Mg(e)}function Pg(e,t,o){const a=e.canvas,r=rl(s=>{e.ctx!==null&&o(Sg(s,e))},e);return Bg(a,t,r),r}class vg extends Jl{acquireContext(t,o){const a=t&&t.getContext&&t.getContext("2d");return a&&a.canvas===t?(_g(t,o),a):null}releaseContext(t){const o=t.canvas;if(!o[da])return!1;const a=o[da].initial;["height","width"].forEach(s=>{const i=a[s];De(i)?o.removeAttribute(s):o.setAttribute(s,i)});const r=a.style||{};return Object.keys(r).forEach(s=>{o.style[s]=r[s]}),o.width=o.width,delete o[da],!0}addEventListener(t,o,a){this.removeEventListener(t,o);const r=t.$proxies||(t.$proxies={}),i={attach:Ag,detach:Vg,resize:Ng}[o]||Pg;r[o]=i(t,o,a)}removeEventListener(t,o){const a=t.$proxies||(t.$proxies={}),r=a[o];if(!r)return;({attach:Kr,detach:Kr,resize:Kr}[o]||Eg)(t,o,r),a[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,o,a,r){return Bp(t,o,a,r)}isAttached(t){const o=t&&$r(t);return!!(o&&o.isConnected)}}function Tg(e){return!Lr()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?wg:vg}let $t=(Ha=class{constructor(){fe(this,"x");fe(this,"y");fe(this,"active",!1);fe(this,"options");fe(this,"$animations")}tooltipPosition(t){const{x:o,y:a}=this.getProps(["x","y"],t);return{x:o,y:a}}hasValue(){return co(this.x)&&co(this.y)}getProps(t,o){const a=this.$animations;if(!o||!a)return this;const r={};return t.forEach(s=>{r[s]=a[s]&&a[s].active()?a[s]._to:this[s]}),r}},fe(Ha,"defaults",{}),fe(Ha,"defaultRoutes"),Ha);function Og(e,t){const o=e.options.ticks,a=zg(e),r=Math.min(o.maxTicksLimit||a,a),s=o.major.enabled?Ig(t):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>r)return Rg(t,d,s,i/r),d;const u=Fg(s,t,r);if(i>0){let f,h;const m=i>1?Math.round((c-l)/(i-1)):null;for(fa(t,d,u,De(m)?0:l-m,l),f=0,h=i-1;f<h;f++)fa(t,d,u,s[f],s[f+1]);return fa(t,d,u,c,De(m)?t.length:c+m),d}return fa(t,d,u),d}function zg(e){const t=e.options.offset,o=e._tickSize(),a=e._length/o+(t?0:1),r=e._maxLength/o;return Math.floor(Math.min(a,r))}function Fg(e,t,o){const a=Lg(e),r=t.length/o;if(!a)return Math.max(r,1);const s=_m(a);for(let i=0,l=s.length-1;i<l;i++){const c=s[i];if(c>r)return c}return Math.max(r,1)}function Ig(e){const t=[];let o,a;for(o=0,a=e.length;o<a;o++)e[o].major&&t.push(o);return t}function Rg(e,t,o,a){let r=0,s=o[0],i;for(a=Math.ceil(a),i=0;i<e.length;i++)i===s&&(t.push(e[i]),r++,s=o[r*a])}function fa(e,t,o,a,r){const s=we(a,0),i=Math.min(we(r,e.length),e.length);let l=0,c,d,u;for(o=Math.ceil(o),r&&(c=r-a,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&&(t.push(e[d]),l++,u=Math.round(s+l*o))}function Lg(e){const t=e.length;let o,a;if(t<2)return!1;for(a=e[0],o=1;o<t;++o)if(e[o]-e[o-1]!==a)return!1;return a}const $g=e=>e==="left"?"right":e==="right"?"left":e,nc=(e,t,o)=>t==="top"||t==="left"?e[t]+o:e[t]-o,oc=(e,t)=>Math.min(t||e,e);function ac(e,t){const o=[],a=e.length/t,r=e.length;let s=0;for(;s<r;s+=a)o.push(e[Math.floor(s)]);return o}function Wg(e,t,o){const a=e.ticks.length,r=Math.min(t,a-1),s=e._startPixel,i=e._endPixel,l=1e-6;let c=e.getPixelForTick(r),d;if(!(o&&(a===1?d=Math.max(c-s,i-c):t===0?d=(e.getPixelForTick(1)-c)/2:d=(c-e.getPixelForTick(r-1))/2,c+=r<t?d:-d,c<s-l||c>i+l)))return c}function jg(e,t){Ne(e,o=>{const a=o.gc,r=a.length/2;let s;if(r>t){for(s=0;s<r;++s)delete o.data[a[s]];a.splice(0,r)}})}function wo(e){return e.drawTicks?e.tickLength:0}function rc(e,t){if(!e.display)return 0;const o=nt(e.font,t),a=ht(e.padding);return(He(e.text)?e.text.length:1)*o.lineHeight+a.height}function Ug(e,t){return xn(e,{scale:t,type:"scale"})}function Hg(e,t,o){return xn(e,{tick:o,index:t,type:"tick"})}function qg(e,t,o){let a=Dr(e);return(o&&t!=="right"||!o&&t==="right")&&(a=$g(a)),a}function Gg(e,t,o,a){const{top:r,left:s,bottom:i,right:l,chart:c}=e,{chartArea:d,scales:u}=c;let f=0,h,m,p;const b=i-r,g=l-s;if(e.isHorizontal()){if(m=tt(a,s,l),Be(o)){const x=Object.keys(o)[0],_=o[x];p=u[x].getPixelForValue(_)+b-t}else o==="center"?p=(d.bottom+d.top)/2+b-t:p=nc(e,o,t);h=l-s}else{if(Be(o)){const x=Object.keys(o)[0],_=o[x];m=u[x].getPixelForValue(_)-g+t}else o==="center"?m=(d.left+d.right)/2-g+t:m=nc(e,o,t);p=tt(a,i,r),f=o==="left"?-Xe:Xe}return{titleX:m,titleY:p,maxWidth:h,rotation:f}}class In extends $t{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.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(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,o){return t}getUserBounds(){let{_userMin:t,_userMax:o,_suggestedMin:a,_suggestedMax:r}=this;return t=St(t,Number.POSITIVE_INFINITY),o=St(o,Number.NEGATIVE_INFINITY),a=St(a,Number.POSITIVE_INFINITY),r=St(r,Number.NEGATIVE_INFINITY),{min:St(t,a),max:St(o,r),minDefined:Ze(t),maxDefined:Ze(o)}}getMinMax(t){let{min:o,max:a,minDefined:r,maxDefined:s}=this.getUserBounds(),i;if(r&&s)return{min:o,max:a};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)i=l[c].controller.getMinMax(this,t),r||(o=Math.min(o,i.min)),s||(a=Math.max(a,i.max));return o=s&&o>a?a:o,a=r&&o>a?o:a,{min:St(o,St(a,o)),max:St(a,St(o,a))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ie(this.options.beforeUpdate,[this])}update(t,o,a){const{beginAtZero:r,grace:s,ticks:i}=this.options,l=i.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=o,this._margins=a=Object.assign({left:0,right:0,top:0,bottom:0},a),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+a.left+a.right:this.height+a.top+a.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=np(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?ac(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=Og(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,o,a;this.isHorizontal()?(o=this.left,a=this.right):(o=this.top,a=this.bottom,t=!t),this._startPixel=o,this._endPixel=a,this._reversePixels=t,this._length=a-o,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Ie(this.options.afterUpdate,[this])}beforeSetDimensions(){Ie(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(){Ie(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Ie(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ie(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const o=this.options.ticks;let a,r,s;for(a=0,r=t.length;a<r;a++)s=t[a],s.label=Ie(o.callback,[s.value,a,t],this)}afterTickToLabelConversion(){Ie(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ie(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,o=t.ticks,a=oc(this.ticks.length,t.ticks.maxTicksLimit),r=o.minRotation||0,s=o.maxRotation;let i=r,l,c,d;if(!this._isVisible()||!o.display||r>=s||a<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=et(this.chart.width-f,0,this.maxWidth);l=t.offset?this.maxWidth/a:m/(a-1),f+6>l&&(l=m/(a-(t.offset?.5:1)),c=this.maxHeight-wo(t.grid)-o.padding-rc(t.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),i=Am(Math.min(Math.asin(et((u.highest.height+6)/l,-1,1)),Math.asin(et(c/d,-1,1))-Math.asin(et(h/d,-1,1)))),i=Math.max(r,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){Ie(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ie(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:o,options:{ticks:a,title:r,grid:s}}=this,i=this._isVisible(),l=this.isHorizontal();if(i){const c=rc(r,o.options.font);if(l?(t.width=this.maxWidth,t.height=wo(s)+c):(t.height=this.maxHeight,t.width=wo(s)+c),a.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=a.padding*2,p=It(this.labelRotation),b=Math.cos(p),g=Math.sin(p);if(l){const x=a.mirror?0:g*f.width+b*h.height;t.height=Math.min(this.maxHeight,t.height+x+m)}else{const x=a.mirror?0:b*f.width+g*h.height;t.width=Math.min(this.maxWidth,t.width+x+m)}this._calculatePadding(d,u,g,b)}}this._handleMargins(),l?(this.width=this._length=o.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=o.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,o,a,r){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=r*t.width,m=a*o.height):(h=a*t.height,m=r*o.width):s==="start"?m=o.width:s==="end"?h=t.width:s!=="inner"&&(h=t.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=t.height/2;s==="start"?(u=0,f=t.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(){Ie(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:o}=this.options;return o==="top"||o==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let o,a;for(o=0,a=t.length;o<a;o++)De(t[o].label)&&(t.splice(o,1),a--,o--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const o=this.options.ticks.sampleSize;let a=this.ticks;o<a.length&&(a=ac(a,o)),this._labelSizes=t=this._computeLabelSizes(a,a.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,o,a){const{ctx:r,_longestTextCache:s}=this,i=[],l=[],c=Math.floor(o/oc(o,a));let d=0,u=0,f,h,m,p,b,g,x,_,C,w,E;for(f=0;f<o;f+=c){if(p=t[f].label,b=this._resolveTickFontOptions(f),r.font=g=b.string,x=s[g]=s[g]||{data:{},gc:[]},_=b.lineHeight,C=w=0,!De(p)&&!He(p))C=ul(r,x.data,x.gc,C,p),w=_;else if(He(p))for(h=0,m=p.length;h<m;++h)E=p[h],!De(E)&&!He(E)&&(C=ul(r,x.data,x.gc,C,E),w+=_);i.push(C),l.push(w),d=Math.max(C,d),u=Math.max(w,u)}jg(s,o);const B=i.indexOf(d),k=l.indexOf(u),y=A=>({width:i[A]||0,height:l[A]||0});return{first:y(0),last:y(o-1),widest:y(B),highest:y(k),widths:i,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,o){return NaN}getValueForPixel(t){}getPixelForTick(t){const o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const o=this._startPixel+t*this._length;return Dm(this._alignToPixels?yn(this.chart,o,0):o)}getDecimalForPixel(t){const o=(t-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:o}=this;return t<0&&o<0?o:t>0&&o>0?t:0}getContext(t){const o=this.ticks||[];if(t>=0&&t<o.length){const a=o[t];return a.$context||(a.$context=Hg(this.getContext(),t,a))}return this.$context||(this.$context=Ug(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,o=It(this.labelRotation),a=Math.abs(Math.cos(o)),r=Math.abs(Math.sin(o)),s=this._getLabelSizes(),i=t.autoSkipPadding||0,l=s?s.widest.width+i:0,c=s?s.highest.height+i:0;return this.isHorizontal()?c*a>l*r?l/a:c/r:c*r<l*a?c/a:l/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const o=this.axis,a=this.chart,r=this.options,{grid:s,position:i,border:l}=r,c=s.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),h=wo(s),m=[],p=l.setContext(this.getContext()),b=p.display?p.width:0,g=b/2,x=function(L){return yn(a,L,b)};let _,C,w,E,B,k,y,A,D,N,V,M;if(i==="top")_=x(this.bottom),k=this.bottom-h,A=_-g,N=x(t.top)+g,M=t.bottom;else if(i==="bottom")_=x(this.top),N=t.top,M=x(t.bottom)-g,k=_+g,A=this.top+h;else if(i==="left")_=x(this.right),B=this.right-h,y=_-g,D=x(t.left)+g,V=t.right;else if(i==="right")_=x(this.left),D=t.left,V=x(t.right)-g,B=_+g,y=this.left+h;else if(o==="x"){if(i==="center")_=x((t.top+t.bottom)/2+.5);else if(Be(i)){const L=Object.keys(i)[0],R=i[L];_=x(this.chart.scales[L].getPixelForValue(R))}N=t.top,M=t.bottom,k=_+g,A=k+h}else if(o==="y"){if(i==="center")_=x((t.left+t.right)/2);else if(Be(i)){const L=Object.keys(i)[0],R=i[L];_=x(this.chart.scales[L].getPixelForValue(R))}B=_-g,y=B-h,D=t.left,V=t.right}const T=we(r.ticks.maxTicksLimit,f),U=Math.max(1,Math.ceil(f/T));for(C=0;C<f;C+=U){const L=this.getContext(C),R=s.setContext(L),P=l.setContext(L),W=R.lineWidth,v=R.color,z=P.dash||[],H=P.dashOffset,G=R.tickWidth,K=R.tickColor,X=R.tickBorderDash||[],oe=R.tickBorderDashOffset;w=Wg(this,C,c),w!==void 0&&(E=yn(a,w,W),d?B=y=D=V=E:k=A=N=M=E,m.push({tx1:B,ty1:k,tx2:y,ty2:A,x1:D,y1:N,x2:V,y2:M,width:W,color:v,borderDash:z,borderDashOffset:H,tickWidth:G,tickColor:K,tickBorderDash:X,tickBorderDashOffset:oe}))}return this._ticksLength=f,this._borderValue=_,m}_computeLabelItems(t){const o=this.axis,a=this.options,{position:r,ticks:s}=a,i=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=s,h=wo(a.grid),m=h+u,p=f?-u:m,b=-It(this.labelRotation),g=[];let x,_,C,w,E,B,k,y,A,D,N,V,M="middle";if(r==="top")B=this.bottom-p,k=this._getXAxisLabelAlignment();else if(r==="bottom")B=this.top+p,k=this._getXAxisLabelAlignment();else if(r==="left"){const U=this._getYAxisLabelAlignment(h);k=U.textAlign,E=U.x}else if(r==="right"){const U=this._getYAxisLabelAlignment(h);k=U.textAlign,E=U.x}else if(o==="x"){if(r==="center")B=(t.top+t.bottom)/2+m;else if(Be(r)){const U=Object.keys(r)[0],L=r[U];B=this.chart.scales[U].getPixelForValue(L)+m}k=this._getXAxisLabelAlignment()}else if(o==="y"){if(r==="center")E=(t.left+t.right)/2-m;else if(Be(r)){const U=Object.keys(r)[0],L=r[U];E=this.chart.scales[U].getPixelForValue(L)}k=this._getYAxisLabelAlignment(h).textAlign}o==="y"&&(c==="start"?M="top":c==="end"&&(M="bottom"));const T=this._getLabelSizes();for(x=0,_=l.length;x<_;++x){C=l[x],w=C.label;const U=s.setContext(this.getContext(x));y=this.getPixelForTick(x)+s.labelOffset,A=this._resolveTickFontOptions(x),D=A.lineHeight,N=He(w)?w.length:1;const L=N/2,R=U.color,P=U.textStrokeColor,W=U.textStrokeWidth;let v=k;i?(E=y,k==="inner"&&(x===_-1?v=this.options.reverse?"left":"right":x===0?v=this.options.reverse?"right":"left":v="center"),r==="top"?d==="near"||b!==0?V=-N*D+D/2:d==="center"?V=-T.highest.height/2-L*D+D:V=-T.highest.height+D/2:d==="near"||b!==0?V=D/2:d==="center"?V=T.highest.height/2-L*D:V=T.highest.height-N*D,f&&(V*=-1),b!==0&&!U.showLabelBackdrop&&(E+=D/2*Math.sin(b))):(B=y,V=(1-N)*D/2);let z;if(U.showLabelBackdrop){const H=ht(U.backdropPadding),G=T.heights[x],K=T.widths[x];let X=V-H.top,oe=0-H.left;switch(M){case"middle":X-=G/2;break;case"bottom":X-=G;break}switch(k){case"center":oe-=K/2;break;case"right":oe-=K;break;case"inner":x===_-1?oe-=K:x>0&&(oe-=K/2);break}z={left:oe,top:X,width:K+H.width,height:G+H.height,color:U.backdropColor}}g.push({label:w,font:A,textOffset:V,options:{rotation:b,color:R,strokeColor:P,strokeWidth:W,textAlign:v,textBaseline:M,translation:[E,B],backdrop:z}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:o}=this.options;if(-It(this.labelRotation))return t==="top"?"left":"right";let r="center";return o.align==="start"?r="left":o.align==="end"?r="right":o.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:o,ticks:{crossAlign:a,mirror:r,padding:s}}=this.options,i=this._getLabelSizes(),l=t+s,c=i.widest.width;let d,u;return o==="left"?r?(u=this.right+s,a==="near"?d="left":a==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,a==="near"?d="right":a==="center"?(d="center",u-=c/2):(d="left",u=this.left)):o==="right"?r?(u=this.left+s,a==="near"?d="right":a==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,a==="near"?d="left":a==="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 t=this.chart,o=this.options.position;if(o==="left"||o==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(o==="top"||o==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:o},left:a,top:r,width:s,height:i}=this;o&&(t.save(),t.fillStyle=o,t.fillRect(a,r,s,i),t.restore())}getLineWidthForValue(t){const o=this.options.grid;if(!this._isVisible()||!o.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?o.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const o=this.options.grid,a=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,i;const l=(c,d,u)=>{!u.width||!u.color||(a.save(),a.lineWidth=u.width,a.strokeStyle=u.color,a.setLineDash(u.borderDash||[]),a.lineDashOffset=u.borderDashOffset,a.beginPath(),a.moveTo(c.x,c.y),a.lineTo(d.x,d.y),a.stroke(),a.restore())};if(o.display)for(s=0,i=r.length;s<i;++s){const c=r[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:t,ctx:o,options:{border:a,grid:r}}=this,s=a.setContext(this.getContext()),i=a.display?s.width:0;if(!i)return;const l=r.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,h;this.isHorizontal()?(d=yn(t,this.left,i)-i/2,u=yn(t,this.right,l)+l/2,f=h=c):(f=yn(t,this.top,i)-i/2,h=yn(t,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(t){if(!this.options.ticks.display)return;const a=this.ctx,r=this._computeLabelArea();r&&Qo(a,r);const s=this.getLabelItems(t);for(const i of s){const l=i.options,c=i.font,d=i.label,u=i.textOffset;po(a,d,0,u,c,l)}r&&Zo(a)}drawTitle(){const{ctx:t,options:{position:o,title:a,reverse:r}}=this;if(!a.display)return;const s=nt(a.font),i=ht(a.padding),l=a.align;let c=s.lineHeight/2;o==="bottom"||o==="center"||Be(o)?(c+=i.bottom,He(a.text)&&(c+=s.lineHeight*(a.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=Gg(this,c,o,l);po(t,a.text,0,0,s,{color:a.color,maxWidth:f,rotation:h,textAlign:qg(l,o,r),textBaseline:"middle",translation:[d,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,o=t.ticks&&t.ticks.z||0,a=we(t.grid&&t.grid.z,-1),r=we(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==In.prototype.draw?[{z:o,draw:s=>{this.draw(s)}}]:[{z:a,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:o,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const o=this.chart.getSortedVisibleDatasetMetas(),a=this.axis+"AxisID",r=[];let s,i;for(s=0,i=o.length;s<i;++s){const l=o[s];l[a]===this.id&&(!t||l.type===t)&&r.push(l)}return r}_resolveTickFontOptions(t){const o=this.options.ticks.setContext(this.getContext(t));return nt(o.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ha{constructor(t,o,a){this.type=t,this.scope=o,this.override=a,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const o=Object.getPrototypeOf(t);let a;Kg(o)&&(a=this.register(o));const r=this.items,s=t.id,i=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,Xg(t,i,a),this.override&&je.override(t.id,t.overrides)),i}get(t){return this.items[t]}unregister(t){const o=this.items,a=t.id,r=this.scope;a in o&&delete o[a],r&&a in je[r]&&(delete je[r][a],this.override&&delete bn[a])}}function Xg(e,t,o){const a=ro(Object.create(null),[o?je.get(o):{},je.get(t),e.defaults]);je.set(t,a),e.defaultRoutes&&Yg(t,e.defaultRoutes),e.descriptors&&je.describe(t,e.descriptors)}function Yg(e,t){Object.keys(t).forEach(o=>{const a=o.split("."),r=a.pop(),s=[e].concat(a).join("."),i=t[o].split("."),l=i.pop(),c=i.join(".");je.route(s,r,c,l)})}function Kg(e){return"id"in e&&"defaults"in e}class Jg{constructor(){this.controllers=new ha(_n,"datasets",!0),this.elements=new ha($t,"elements"),this.plugins=new ha(Object,"plugins"),this.scales=new ha(In,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,o,a){[...o].forEach(r=>{const s=a||this._getRegistryForType(r);a||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Ne(r,i=>{const l=a||this._getRegistryForType(i);this._exec(t,l,i)})})}_exec(t,o,a){const r=Sr(t);Ie(a["before"+r],[],a),o[t](a),Ie(a["after"+r],[],a)}_getRegistryForType(t){for(let o=0;o<this._typedRegistries.length;o++){const a=this._typedRegistries[o];if(a.isForType(t))return a}return this.plugins}_get(t,o,a){const r=o.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+a+".");return r}}var Vt=new Jg;class Qg{constructor(){this._init=void 0}notify(t,o,a,r){if(o==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const s=r?this._descriptors(t).filter(r):this._descriptors(t),i=this._notify(s,t,o,a);return o==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),i}_notify(t,o,a,r){r=r||{};for(const s of t){const i=s.plugin,l=i[a],c=[o,r,s.options];if(Ie(l,c,i)===!1&&r.cancelable)return!1}return!0}invalidate(){De(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const o=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),o}_createDescriptors(t,o){const a=t&&t.config,r=we(a.options&&a.options.plugins,{}),s=Zg(a);return r===!1&&!o?[]:t0(t,s,r,o)}_notifyStateChanges(t){const o=this._oldCache||[],a=this._cache,r=(s,i)=>s.filter(l=>!i.some(c=>l.plugin.id===c.plugin.id));this._notify(r(o,a),t,"stop"),this._notify(r(a,o),t,"start")}}function Zg(e){const t={},o=[],a=Object.keys(Vt.plugins.items);for(let s=0;s<a.length;s++)o.push(Vt.getPlugin(a[s]));const r=e.plugins||[];for(let s=0;s<r.length;s++){const i=r[s];o.indexOf(i)===-1&&(o.push(i),t[i.id]=!0)}return{plugins:o,localIds:t}}function e0(e,t){return!t&&e===!1?null:e===!0?{}:e}function t0(e,{plugins:t,localIds:o},a,r){const s=[],i=e.getContext();for(const l of t){const c=l.id,d=e0(a[c],r);d!==null&&s.push({plugin:l,options:n0(e.config,{plugin:l,local:o[c]},d,i)})}return s}function n0(e,{plugin:t,local:o},a,r){const s=e.pluginScopeKeys(t),i=e.getOptionScopes(a,s);return o&&t.defaults&&i.push(t.defaults),e.createResolver(i,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Jr(e,t){const o=je.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||o.indexAxis||"x"}function o0(e,t){let o=e;return e==="_index_"?o=t:e==="_value_"&&(o=t==="x"?"y":"x"),o}function a0(e,t){return e===t?"_index_":"_value_"}function sc(e){if(e==="x"||e==="y"||e==="r")return e}function r0(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Qr(e,...t){if(sc(e))return e;for(const o of t){const a=o.axis||r0(o.position)||e.length>1&&sc(e[0].toLowerCase());if(a)return a}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ic(e,t,o){if(o[t+"AxisID"]===e)return{axis:t}}function s0(e,t){if(t.data&&t.data.datasets){const o=t.data.datasets.filter(a=>a.xAxisID===e||a.yAxisID===e);if(o.length)return ic(e,"x",o[0])||ic(e,"y",o[0])}return{}}function i0(e,t){const o=bn[e.type]||{scales:{}},a=t.scales||{},r=Jr(e.type,t),s=Object.create(null);return Object.keys(a).forEach(i=>{const l=a[i];if(!Be(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=Qr(i,l,s0(i,e),je.scales[l.type]),d=a0(c,r),u=o.scales||{};s[i]=so(Object.create(null),[{axis:c},l,u[c],u[d]])}),e.data.datasets.forEach(i=>{const l=i.type||e.type,c=i.indexAxis||Jr(l,t),u=(bn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=o0(f,c),m=i[h+"AxisID"]||h;s[m]=s[m]||Object.create(null),so(s[m],[{axis:h},a[m],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];so(l,[je.scales[l.type],je.scale])}),s}function lc(e){const t=e.options||(e.options={});t.plugins=we(t.plugins,{}),t.scales=i0(e,t)}function cc(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function l0(e){return e=e||{},e.data=cc(e.data),lc(e),e}const dc=new Map,uc=new Set;function ma(e,t){let o=dc.get(e);return o||(o=t(),dc.set(e,o),uc.add(o)),o}const Co=(e,t,o)=>{const a=mn(t,o);a!==void 0&&e.add(a)};class c0{constructor(t){this._config=l0(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=cc(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),lc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ma(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,o){return ma(`${t}.transition.${o}`,()=>[[`datasets.${t}.transitions.${o}`,`transitions.${o}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,o){return ma(`${t}-${o}`,()=>[[`datasets.${t}.elements.${o}`,`datasets.${t}`,`elements.${o}`,""]])}pluginScopeKeys(t){const o=t.id,a=this.type;return ma(`${a}-plugin-${o}`,()=>[[`plugins.${o}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,o){const a=this._scopeCache;let r=a.get(t);return(!r||o)&&(r=new Map,a.set(t,r)),r}getOptionScopes(t,o,a){const{options:r,type:s}=this,i=this._cachedScopes(t,a),l=i.get(o);if(l)return l;const c=new Set;o.forEach(u=>{t&&(c.add(t),u.forEach(f=>Co(c,t,f))),u.forEach(f=>Co(c,r,f)),u.forEach(f=>Co(c,bn[s]||{},f)),u.forEach(f=>Co(c,je,f)),u.forEach(f=>Co(c,vr,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:t,type:o}=this;return[t,bn[o]||{},je.datasets[o]||{},{type:o},je,vr]}resolveNamedOptions(t,o,a,r=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=fc(this._resolverCache,t,r);let c=i;if(u0(i,o)){s.$shared=!1,a=Zt(a)?a():a;const d=this.createResolver(t,a,l);c=Tn(i,a,d)}for(const d of o)s[d]=c[d];return s}createResolver(t,o,a=[""],r){const{resolver:s}=fc(this._resolverCache,t,a);return Be(o)?Tn(s,o,void 0,r):s}}function fc(e,t,o){let a=e.get(t);a||(a=new Map,e.set(t,a));const r=o.join();let s=a.get(r);return s||(s={resolver:Fr(t,o),subPrefixes:o.filter(l=>!l.toLowerCase().includes("hover"))},a.set(r,s)),s}const d0=e=>Be(e)&&Object.getOwnPropertyNames(e).some(t=>Zt(e[t]));function u0(e,t){const{isScriptable:o,isIndexable:a}=pl(e);for(const r of t){const s=o(r),i=a(r),l=(i||s)&&e[r];if(s&&(Zt(l)||d0(l))||i&&He(l))return!0}return!1}var f0="4.5.1";const h0=["top","bottom","left","right","chartArea"];function hc(e,t){return e==="top"||e==="bottom"||h0.indexOf(e)===-1&&t==="x"}function mc(e,t){return function(o,a){return o[e]===a[e]?o[t]-a[t]:o[e]-a[e]}}function pc(e){const t=e.chart,o=t.options.animation;t.notifyPlugins("afterRender"),Ie(o&&o.onComplete,[e],t)}function m0(e){const t=e.chart,o=t.options.animation;Ie(o&&o.onProgress,[e],t)}function gc(e){return Lr()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const pa={},bc=e=>{const t=gc(e);return Object.values(pa).filter(o=>o.canvas===t).pop()};function p0(e,t,o){const a=Object.keys(e);for(const r of a){const s=+r;if(s>=t){const i=e[r];delete e[r],(o>0||s>t)&&(e[s+o]=i)}}}function g0(e,t,o,a){return!o||e.type==="mouseout"?null:a?t:e}class Wt{static register(...t){Vt.add(...t),yc()}static unregister(...t){Vt.remove(...t),yc()}constructor(t,o){const a=this.config=new c0(o),r=gc(t),s=bc(r);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=a.createResolver(a.chartOptionScopes(),this.getContext());this.platform=new(a.platform||Tg(r)),this.platform.updateConfig(a);const l=this.platform.acquireContext(r,i.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=mm(),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 Qg,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=vm(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],pa[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Lt.listen(this,"complete",pc),Lt.listen(this,"progress",m0),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:o},width:a,height:r,_aspectRatio:s}=this;return De(t)?o&&s?s:r?a/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Vt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Cl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return fl(this.canvas,this.ctx),this}stop(){return Lt.stop(this),this}resize(t,o){Lt.running(this)?this._resizeBeforeDraw={width:t,height:o}:this._resize(t,o)}_resize(t,o){const a=this.options,r=this.canvas,s=a.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(r,t,o,s),l=a.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,Cl(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),Ie(a.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};Ne(o,(a,r)=>{a.id=r})}buildOrUpdateScales(){const t=this.options,o=t.scales,a=this.scales,r=Object.keys(a).reduce((i,l)=>(i[l]=!1,i),{});let s=[];o&&(s=s.concat(Object.keys(o).map(i=>{const l=o[i],c=Qr(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Ne(s,i=>{const l=i.options,c=l.id,d=Qr(c,l),u=we(l.type,i.dtype);(l.position===void 0||hc(l.position,d)!==hc(i.dposition))&&(l.position=i.dposition),r[c]=!0;let f=null;if(c in a&&a[c].type===u)f=a[c];else{const h=Vt.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),a[f.id]=f}f.init(l,t)}),Ne(r,(i,l)=>{i||delete a[l]}),Ne(a,i=>{mt.configure(this,i,i.options),mt.addBox(this,i)})}_updateMetasets(){const t=this._metasets,o=this.data.datasets.length,a=t.length;if(t.sort((r,s)=>r.index-s.index),a>o){for(let r=o;r<a;++r)this._destroyDatasetMeta(r);t.splice(o,a-o)}this._sortedMetasets=t.slice(0).sort(mc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:o}}=this;t.length>o.length&&delete this._stacks,t.forEach((a,r)=>{o.filter(s=>s===a._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],o=this.data.datasets;let a,r;for(this._removeUnreferencedMetasets(),a=0,r=o.length;a<r;a++){const s=o[a];let i=this.getDatasetMeta(a);const l=s.type||this.config.type;if(i.type&&i.type!==l&&(this._destroyDatasetMeta(a),i=this.getDatasetMeta(a)),i.type=l,i.indexAxis=s.indexAxis||Jr(l,this.options),i.order=s.order||0,i.index=a,i.label=""+s.label,i.visible=this.isDatasetVisible(a),i.controller)i.controller.updateIndex(a),i.controller.linkScales();else{const c=Vt.getController(l),{datasetElementType:d,dataElementType:u}=je.datasets[l];Object.assign(c,{dataElementType:Vt.getElement(u),datasetElementType:d&&Vt.getElement(d)}),i.controller=new c(this,a),t.push(i.controller)}}return this._updateMetasets(),t}_resetElements(){Ne(this.data.datasets,(t,o)=>{this.getDatasetMeta(o).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const o=this.config;o.update();const a=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!a.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,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=!r&&s.indexOf(f)===-1;f.buildOrUpdateElements(h),i=Math.max(+f.getMaxOverflow(),i)}i=this._minPadding=a.layout.autoPadding?i:0,this._updateLayout(i),r||Ne(s,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(mc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Ne(this.scales,t=>{mt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,o=new Set(Object.keys(this._listeners)),a=new Set(t.events);(!Yi(o,a)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,o=this._getUniformDataChanges()||[];for(const{method:a,start:r,count:s}of o){const i=a==="_removeElements"?-s:s;p0(t,r,i)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const o=this.data.datasets.length,a=s=>new Set(t.filter(i=>i[0]===s).map((i,l)=>l+","+i.splice(1).join(","))),r=a(0);for(let s=1;s<o;s++)if(!Yi(r,a(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;mt.update(this,this.width,this.height,t);const o=this.chartArea,a=o.width<=0||o.height<=0;this._layers=[],Ne(this.boxes,r=>{a&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let o=0,a=this.data.datasets.length;o<a;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,a=this.data.datasets.length;o<a;++o)this._updateDataset(o,Zt(t)?t({datasetIndex:o}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,o){const a=this.getDatasetMeta(t),r={meta:a,index:t,mode:o,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(a.controller._update(o),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Lt.has(this)?this.attached&&!Lt.running(this)&&Lt.start(this):(this.draw(),pc({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:a,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(a,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const o=this._layers;for(t=0;t<o.length&&o[t].z<=0;++t)o[t].draw(this.chartArea);for(this._drawDatasets();t<o.length;++t)o[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const o=this._sortedMetasets,a=[];let r,s;for(r=0,s=o.length;r<s;++r){const i=o[r];(!t||i.visible)&&a.push(i)}return a}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let o=t.length-1;o>=0;--o)this._drawDataset(t[o]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const o=this.ctx,a={meta:t,index:t.index,cancelable:!0},r=Pl(this,t);this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(r&&Qo(o,r),t.controller.draw(),r&&Zo(o),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return mo(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,o,a,r){const s=hg.modes[o];return typeof s=="function"?s(this,t,a,r):[]}getDatasetMeta(t){const o=this.data.datasets[t],a=this._metasets;let r=a.filter(s=>s&&s._dataset===o).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:o&&o.order||0,index:t,_dataset:o,_parsed:[],_sorted:!1},a.push(r)),r}getContext(){return this.$context||(this.$context=xn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const o=this.data.datasets[t];if(!o)return!1;const a=this.getDatasetMeta(t);return typeof a.hidden=="boolean"?!a.hidden:!o.hidden}setDatasetVisibility(t,o){const a=this.getDatasetMeta(t);a.hidden=!o}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,o,a){const r=a?"show":"hide",s=this.getDatasetMeta(t),i=s.controller._resolveAnimations(void 0,r);io(o)?(s.data[o].hidden=!a,this.update()):(this.setDatasetVisibility(t,a),i.update(s,{visible:a}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,o){this._updateVisibility(t,o,!1)}show(t,o){this._updateVisibility(t,o,!0)}_destroyDatasetMeta(t){const o=this._metasets[t];o&&o.controller&&o.controller._destroy(),delete this._metasets[t]}_stop(){let t,o;for(this.stop(),Lt.remove(this),t=0,o=this.data.datasets.length;t<o;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:o}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),fl(t,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete pa[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,o=this.platform,a=(s,i)=>{o.addEventListener(this,s,i),t[s]=i},r=(s,i,l)=>{s.offsetX=i,s.offsetY=l,this._eventHandler(s)};Ne(this.options.events,s=>a(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,o=this.platform,a=(c,d)=>{o.addEventListener(this,c,d),t[c]=d},r=(c,d)=>{t[c]&&(o.removeEventListener(this,c,d),delete t[c])},s=(c,d)=>{this.canvas&&this.resize(c,d)};let i;const l=()=>{r("attach",l),this.attached=!0,this.resize(),a("resize",s),a("detach",i)};i=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),a("attach",l)},o.isAttached(this.canvas)?l():i()}unbindEvents(){Ne(this._listeners,(t,o)=>{this.platform.removeEventListener(this,o,t)}),this._listeners={},Ne(this._responsiveListeners,(t,o)=>{this.platform.removeEventListener(this,o,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,o,a){const r=a?"set":"remove";let s,i,l,c;for(o==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){i=t[l];const d=i&&this.getDatasetMeta(i.datasetIndex).controller;d&&d[r+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const o=this._active||[],a=t.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}});!Xo(a,o)&&(this._active=a,this._lastEvent=null,this._updateHoverStyles(a,o))}notifyPlugins(t,o,a){return this._plugins.notify(this,t,o,a)}isPluginEnabled(t){return this._plugins._cache.filter(o=>o.plugin.id===t).length===1}_updateHoverStyles(t,o,a){const r=this.options.hover,s=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),i=s(o,t),l=a?t:s(t,o);i.length&&this.updateHoverStyle(i,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,o){const a={event:t,replay:o,cancelable:!0,inChartArea:this.isPointInArea(t)},r=i=>(i.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",a,r)===!1)return;const s=this._handleEvent(t,o,a.inChartArea);return a.cancelable=!1,this.notifyPlugins("afterEvent",a,r),(s||a.changed)&&this.render(),this}_handleEvent(t,o,a){const{_active:r=[],options:s}=this,i=o,l=this._getActiveElements(t,r,a,i),c=km(t),d=g0(t,this._lastEvent,a,c);a&&(this._lastEvent=null,Ie(s.onHover,[t,l,this],this),c&&Ie(s.onClick,[t,l,this],this));const u=!Xo(l,r);return(u||o)&&(this._active=l,this._updateHoverStyles(l,r,o)),this._lastEvent=d,u}_getActiveElements(t,o,a,r){if(t.type==="mouseout")return[];if(!a)return o;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}}fe(Wt,"defaults",je),fe(Wt,"instances",pa),fe(Wt,"overrides",bn),fe(Wt,"registry",Vt),fe(Wt,"version",f0),fe(Wt,"getChart",bc);function yc(){return Ne(Wt.instances,e=>e._plugins.invalidate())}function b0(e,t,o){const{startAngle:a,x:r,y:s,outerRadius:i,innerRadius:l,options:c}=t,{borderWidth:d,borderJoinStyle:u}=c,f=Math.min(d/i,ct(a-o));if(e.beginPath(),e.arc(r,s,i-d/2,a+f/2,o-f/2),l>0){const h=Math.min(d/l,ct(a-o));e.arc(r,s,l+d/2,o-h/2,a+h/2,!0)}else{const h=Math.min(d/2,i*ct(a-o));if(u==="round")e.arc(r,s,h,o-Pe/2,a+Pe/2,!0);else if(u==="bevel"){const m=2*h*h,p=-m*Math.cos(o+Pe/2)+r,b=-m*Math.sin(o+Pe/2)+s,g=m*Math.cos(a+Pe/2)+r,x=m*Math.sin(a+Pe/2)+s;e.lineTo(p,b),e.lineTo(g,x)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function y0(e,t,o){const{startAngle:a,pixelMargin:r,x:s,y:i,outerRadius:l,innerRadius:c}=t;let d=r/l;e.beginPath(),e.arc(s,i,l,a-d,o+d),c>r?(d=r/c,e.arc(s,i,c,o+d,a-d,!0)):e.arc(s,i,r,o+Xe,a-Xe),e.closePath(),e.clip()}function x0(e){return zr(e,["outerStart","outerEnd","innerStart","innerEnd"])}function k0(e,t,o,a){const r=x0(e.options.borderRadius),s=(o-t)/2,i=Math.min(s,a*t/2),l=c=>{const d=(o-Math.min(s,c))*a/2;return et(c,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:et(r.innerStart,0,i),innerEnd:et(r.innerEnd,0,i)}}function Rn(e,t,o,a){return{x:o+e*Math.cos(t),y:a+e*Math.sin(t)}}function ga(e,t,o,a,r,s){const{x:i,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=t,f=Math.max(t.outerRadius+a+o-d,0),h=u>0?u+a+o+d:0;let m=0;const p=r-c;if(a){const U=u>0?u-a:0,L=f>0?f-a:0,R=(U+L)/2,P=R!==0?p*R/(R+a):p;m=(p-P)/2}const b=Math.max(.001,p*f-o/Pe)/f,g=(p-b)/2,x=c+g+m,_=r-g-m,{outerStart:C,outerEnd:w,innerStart:E,innerEnd:B}=k0(t,h,f,_-x),k=f-C,y=f-w,A=x+C/k,D=_-w/y,N=h+E,V=h+B,M=x+E/N,T=_-B/V;if(e.beginPath(),s){const U=(A+D)/2;if(e.arc(i,l,f,A,U),e.arc(i,l,f,U,D),w>0){const W=Rn(y,D,i,l);e.arc(W.x,W.y,w,D,_+Xe)}const L=Rn(V,_,i,l);if(e.lineTo(L.x,L.y),B>0){const W=Rn(V,T,i,l);e.arc(W.x,W.y,B,_+Xe,T+Math.PI)}const R=(_-B/h+(x+E/h))/2;if(e.arc(i,l,h,_-B/h,R,!0),e.arc(i,l,h,R,x+E/h,!0),E>0){const W=Rn(N,M,i,l);e.arc(W.x,W.y,E,M+Math.PI,x-Xe)}const P=Rn(k,x,i,l);if(e.lineTo(P.x,P.y),C>0){const W=Rn(k,A,i,l);e.arc(W.x,W.y,C,x-Xe,A)}}else{e.moveTo(i,l);const U=Math.cos(A)*f+i,L=Math.sin(A)*f+l;e.lineTo(U,L);const R=Math.cos(D)*f+i,P=Math.sin(D)*f+l;e.lineTo(R,P)}e.closePath()}function w0(e,t,o,a,r){const{fullCircles:s,startAngle:i,circumference:l}=t;let c=t.endAngle;if(s){ga(e,t,o,a,c,r);for(let d=0;d<s;++d)e.fill();isNaN(l)||(c=i+(l%$e||$e))}return ga(e,t,o,a,c,r),e.fill(),c}function C0(e,t,o,a,r){const{fullCircles:s,startAngle:i,circumference:l,options:c}=t,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h,borderRadius:m}=c,p=c.borderAlign==="inner";if(!d)return;e.setLineDash(f||[]),e.lineDashOffset=h,p?(e.lineWidth=d*2,e.lineJoin=u||"round"):(e.lineWidth=d,e.lineJoin=u||"bevel");let b=t.endAngle;if(s){ga(e,t,o,a,b,r);for(let g=0;g<s;++g)e.stroke();isNaN(l)||(b=i+(l%$e||$e))}p&&y0(e,t,b),c.selfJoin&&b-i>=Pe&&m===0&&u!=="miter"&&b0(e,t,b),s||(ga(e,t,o,a,b,r),e.stroke())}class _o extends $t{constructor(o){super();fe(this,"circumference");fe(this,"endAngle");fe(this,"fullCircles");fe(this,"innerRadius");fe(this,"outerRadius");fe(this,"pixelMargin");fe(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,a,r){const s=this.getProps(["x","y"],r),{angle:i,distance:l}=el(s,{x:o,y:a}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),m=(this.options.spacing+this.options.borderWidth)/2,p=we(h,d-c),b=uo(i,c,d)&&c!==d,g=p>=$e||b,x=Rt(l,u+m,f+m);return g&&x}getCenterPoint(o){const{x:a,y:r,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:a+Math.cos(f)*h,y:r+Math.sin(f)*h}}tooltipPosition(o){return this.getCenterPoint(o)}draw(o){const{options:a,circumference:r}=this,s=(a.offset||0)/4,i=(a.spacing||0)/2,l=a.circular;if(this.pixelMargin=a.borderAlign==="inner"?.33:0,this.fullCircles=r>$e?Math.floor(r/$e):0,r===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(Pe,r||0)),u=s*d;o.fillStyle=a.backgroundColor,o.strokeStyle=a.borderColor,w0(o,this,u,i,l),C0(o,this,u,i,l),o.restore()}}fe(_o,"id","arc"),fe(_o,"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}),fe(_o,"defaultRoutes",{backgroundColor:"backgroundColor"}),fe(_o,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function xc(e,t,o=t){e.lineCap=we(o.borderCapStyle,t.borderCapStyle),e.setLineDash(we(o.borderDash,t.borderDash)),e.lineDashOffset=we(o.borderDashOffset,t.borderDashOffset),e.lineJoin=we(o.borderJoinStyle,t.borderJoinStyle),e.lineWidth=we(o.borderWidth,t.borderWidth),e.strokeStyle=we(o.borderColor,t.borderColor)}function _0(e,t,o){e.lineTo(o.x,o.y)}function B0(e){return e.stepped?Gm:e.tension||e.cubicInterpolationMode==="monotone"?Xm:_0}function kc(e,t,o={}){const a=e.length,{start:r=0,end:s=a-1}=o,{start:i,end:l}=t,c=Math.max(r,i),d=Math.min(s,l),u=r<i&&s<i||r>l&&s>l;return{count:a,start:c,loop:t.loop,ilen:d<c&&!u?a+d-c:d-c}}function E0(e,t,o,a){const{points:r,options:s}=t,{count:i,start:l,loop:c,ilen:d}=kc(r,o,a),u=B0(s);let{move:f=!0,reverse:h}=a||{},m,p,b;for(m=0;m<=d;++m)p=r[(l+(h?d-m:m))%i],!p.skip&&(f?(e.moveTo(p.x,p.y),f=!1):u(e,b,p,h,s.stepped),b=p);return c&&(p=r[(l+(h?d:0))%i],u(e,b,p,h,s.stepped)),!!c}function S0(e,t,o,a){const r=t.points,{count:s,start:i,ilen:l}=kc(r,o,a),{move:c=!0,reverse:d}=a||{};let u=0,f=0,h,m,p,b,g,x;const _=w=>(i+(d?l-w:w))%s,C=()=>{b!==g&&(e.lineTo(u,g),e.lineTo(u,b),e.lineTo(u,x))};for(c&&(m=r[_(0)],e.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=r[_(h)],m.skip)continue;const w=m.x,E=m.y,B=w|0;B===p?(E<b?b=E:E>g&&(g=E),u=(f*u+w)/++f):(C(),e.lineTo(w,E),p=B,f=0,b=g=E),x=E}C()}function Zr(e){const t=e.options,o=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!o?S0:E0}function A0(e){return e.stepped?Sp:e.tension||e.cubicInterpolationMode==="monotone"?Ap:Cn}function V0(e,t,o,a){let r=t._path;r||(r=t._path=new Path2D,t.path(r,o,a)&&r.closePath()),xc(e,t.options),e.stroke(r)}function D0(e,t,o,a){const{segments:r,options:s}=t,i=Zr(t);for(const l of r)xc(e,s,l.style),e.beginPath(),i(e,t,l,{start:o,end:o+a-1})&&e.closePath(),e.stroke()}const M0=typeof Path2D=="function";function N0(e,t,o,a){M0&&!t.options.segment?V0(e,t,o,a):D0(e,t,o,a)}class tn extends $t{constructor(t){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,t&&Object.assign(this,t)}updateControlPoints(t,o){const a=this.options;if((a.tension||a.cubicInterpolationMode==="monotone")&&!a.stepped&&!this._pointsUpdated){const r=a.spanGaps?this._loop:this._fullLoop;yp(this._points,a,t,r,o),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=vp(this,this.options.segment))}first(){const t=this.segments,o=this.points;return t.length&&o[t[0].start]}last(){const t=this.segments,o=this.points,a=t.length;return a&&o[t[a-1].end]}interpolate(t,o){const a=this.options,r=t[o],s=this.points,i=Dl(this,{property:o,start:r,end:r});if(!i.length)return;const l=[],c=A0(a);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:h}=i[d],m=s[f],p=s[h];if(m===p){l.push(m);continue}const b=Math.abs((r-m[o])/(p[o]-m[o])),g=c(m,p,b,a.stepped);g[o]=t[o],l.push(g)}return l.length===1?l[0]:l}pathSegment(t,o,a){return Zr(this)(t,this,o,a)}path(t,o,a){const r=this.segments,s=Zr(this);let i=this._loop;o=o||0,a=a||this.points.length-o;for(const l of r)i&=s(t,this,l,{start:o,end:o+a-1});return!!i}draw(t,o,a,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),N0(t,this,a,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}fe(tn,"id","line"),fe(tn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),fe(tn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),fe(tn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function wc(e,t,o,a){const r=e.options,{[o]:s}=e.getProps([o],a);return Math.abs(t-s)<r.radius+r.hitRadius}class ba extends $t{constructor(o){super();fe(this,"parsed");fe(this,"skip");fe(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,a,r){const s=this.options,{x:i,y:l}=this.getProps(["x","y"],r);return Math.pow(o-i,2)+Math.pow(a-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(o,a){return wc(this,o,"x",a)}inYRange(o,a){return wc(this,o,"y",a)}getCenterPoint(o){const{x:a,y:r}=this.getProps(["x","y"],o);return{x:a,y:r}}size(o){o=o||this.options||{};let a=o.radius||0;a=Math.max(a,a&&o.hoverRadius||0);const r=a&&o.borderWidth||0;return(a+r)*2}draw(o,a){const r=this.options;this.skip||r.radius<.1||!mo(this,a,this.size(r)/2)||(o.strokeStyle=r.borderColor,o.lineWidth=r.borderWidth,o.fillStyle=r.backgroundColor,Or(o,r,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}fe(ba,"id","point"),fe(ba,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),fe(ba,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Cc(e,t){const{x:o,y:a,base:r,width:s,height:i}=e.getProps(["x","y","base","width","height"],t);let l,c,d,u,f;return e.horizontal?(f=i/2,l=Math.min(o,r),c=Math.max(o,r),d=a-f,u=a+f):(f=s/2,l=o-f,c=o+f,d=Math.min(a,r),u=Math.max(a,r)),{left:l,top:d,right:c,bottom:u}}function nn(e,t,o,a){return e?0:et(t,o,a)}function P0(e,t,o){const a=e.options.borderWidth,r=e.borderSkipped,s=ml(a);return{t:nn(r.top,s.top,0,o),r:nn(r.right,s.right,0,t),b:nn(r.bottom,s.bottom,0,o),l:nn(r.left,s.left,0,t)}}function v0(e,t,o){const{enableBorderRadius:a}=e.getProps(["enableBorderRadius"]),r=e.options.borderRadius,s=vn(r),i=Math.min(t,o),l=e.borderSkipped,c=a||Be(r);return{topLeft:nn(!c||l.top||l.left,s.topLeft,0,i),topRight:nn(!c||l.top||l.right,s.topRight,0,i),bottomLeft:nn(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:nn(!c||l.bottom||l.right,s.bottomRight,0,i)}}function T0(e){const t=Cc(e),o=t.right-t.left,a=t.bottom-t.top,r=P0(e,o/2,a/2),s=v0(e,o/2,a/2);return{outer:{x:t.left,y:t.top,w:o,h:a,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:o-r.l-r.r,h:a-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function es(e,t,o,a){const r=t===null,s=o===null,l=e&&!(r&&s)&&Cc(e,a);return l&&(r||Rt(t,l.left,l.right))&&(s||Rt(o,l.top,l.bottom))}function O0(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function z0(e,t){e.rect(t.x,t.y,t.w,t.h)}function ts(e,t,o={}){const a=e.x!==o.x?-t:0,r=e.y!==o.y?-t:0,s=(e.x+e.w!==o.x+o.w?t:0)-a,i=(e.y+e.h!==o.y+o.h?t:0)-r;return{x:e.x+a,y:e.y+r,w:e.w+s,h:e.h+i,radius:e.radius}}class ya extends $t{constructor(t){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,t&&Object.assign(this,t)}draw(t){const{inflateAmount:o,options:{borderColor:a,backgroundColor:r}}=this,{inner:s,outer:i}=T0(this),l=O0(i.radius)?ea:z0;t.save(),(i.w!==s.w||i.h!==s.h)&&(t.beginPath(),l(t,ts(i,o,s)),t.clip(),l(t,ts(s,-o,i)),t.fillStyle=a,t.fill("evenodd")),t.beginPath(),l(t,ts(s,o)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,o,a){return es(this,t,o,a)}inXRange(t,o){return es(this,t,null,o)}inYRange(t,o){return es(this,null,t,o)}getCenterPoint(t){const{x:o,y:a,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(o+r)/2:o,y:s?a:(a+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}fe(ya,"id","bar"),fe(ya,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),fe(ya,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function F0(e,t,o){const a=e.segments,r=e.points,s=t.points,i=[];for(const l of a){let{start:c,end:d}=l;d=xa(c,d,r);const u=ns(o,r[c],r[d],l.loop);if(!t.segments){i.push({source:l,target:u,start:r[c],end:r[d]});continue}const f=Dl(t,u);for(const h of f){const m=ns(o,s[h.start],s[h.end],h.loop),p=Vl(l,r,m);for(const b of p)i.push({source:b,target:h,start:{[o]:_c(u,m,"start",Math.max)},end:{[o]:_c(u,m,"end",Math.min)}})}}return i}function ns(e,t,o,a){if(a)return;let r=t[e],s=o[e];return e==="angle"&&(r=ct(r),s=ct(s)),{property:e,start:r,end:s}}function I0(e,t){const{x:o=null,y:a=null}=e||{},r=t.points,s=[];return t.segments.forEach(({start:i,end:l})=>{l=xa(i,l,r);const c=r[i],d=r[l];a!==null?(s.push({x:c.x,y:a}),s.push({x:d.x,y:a})):o!==null&&(s.push({x:o,y:c.y}),s.push({x:o,y:d.y}))}),s}function xa(e,t,o){for(;t>e;t--){const a=o[t];if(!isNaN(a.x)&&!isNaN(a.y))break}return t}function _c(e,t,o,a){return e&&t?a(e[o],t[o]):e?e[o]:t?t[o]:0}function Bc(e,t){let o=[],a=!1;return He(e)?(a=!0,o=e):o=I0(e,t),o.length?new tn({points:o,options:{tension:0},_loop:a,_fullLoop:a}):null}function Ec(e){return e&&e.fill!==!1}function R0(e,t,o){let r=e[t].fill;const s=[t];let i;if(!o)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!Ze(r))return r;if(i=e[r],!i)return!1;if(i.visible)return r;s.push(r),r=i.fill}return!1}function L0(e,t,o){const a=U0(e);if(Be(a))return isNaN(a.value)?!1:a;let r=parseFloat(a);return Ze(r)&&Math.floor(r)===r?$0(a[0],t,r,o):["origin","start","end","stack","shape"].indexOf(a)>=0&&a}function $0(e,t,o,a){return(e==="-"||e==="+")&&(o=t+o),o===t||o<0||o>=a?!1:o}function W0(e,t){let o=null;return e==="start"?o=t.bottom:e==="end"?o=t.top:Be(e)?o=t.getPixelForValue(e.value):t.getBasePixel&&(o=t.getBasePixel()),o}function j0(e,t,o){let a;return e==="start"?a=o:e==="end"?a=t.options.reverse?t.min:t.max:Be(e)?a=e.value:a=t.getBaseValue(),a}function U0(e){const t=e.options,o=t.fill;let a=we(o&&o.target,o);return a===void 0&&(a=!!t.backgroundColor),a===!1||a===null?!1:a===!0?"origin":a}function H0(e){const{scale:t,index:o,line:a}=e,r=[],s=a.segments,i=a.points,l=q0(t,o);l.push(Bc({x:null,y:t.bottom},a));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)G0(r,i[u],l)}return new tn({points:r,options:{}})}function q0(e,t){const o=[],a=e.getMatchingVisibleMetas("line");for(let r=0;r<a.length;r++){const s=a[r];if(s.index===t)break;s.hidden||o.unshift(s.dataset)}return o}function G0(e,t,o){const a=[];for(let r=0;r<o.length;r++){const s=o[r],{first:i,last:l,point:c}=X0(s,t,"x");if(!(!c||i&&l)){if(i)a.unshift(c);else if(e.push(c),!l)break}}e.push(...a)}function X0(e,t,o){const a=e.interpolate(t,o);if(!a)return{};const r=a[o],s=e.segments,i=e.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(Rt(r,f,h)){l=r===f,c=r===h;break}}return{first:l,last:c,point:a}}class Sc{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,o,a){const{x:r,y:s,radius:i}=this;return o=o||{start:0,end:$e},t.arc(r,s,i,o.end,o.start,!0),!a.bounds}interpolate(t){const{x:o,y:a,radius:r}=this,s=t.angle;return{x:o+Math.cos(s)*r,y:a+Math.sin(s)*r,angle:s}}}function Y0(e){const{chart:t,fill:o,line:a}=e;if(Ze(o))return K0(t,o);if(o==="stack")return H0(e);if(o==="shape")return!0;const r=J0(e);return r instanceof Sc?r:Bc(r,a)}function K0(e,t){const o=e.getDatasetMeta(t);return o&&e.isDatasetVisible(t)?o.dataset:null}function J0(e){return(e.scale||{}).getPointPositionForValue?Z0(e):Q0(e)}function Q0(e){const{scale:t={},fill:o}=e,a=W0(o,t);if(Ze(a)){const r=t.isHorizontal();return{x:r?a:null,y:r?null:a}}return null}function Z0(e){const{scale:t,fill:o}=e,a=t.options,r=t.getLabels().length,s=a.reverse?t.max:t.min,i=j0(o,t,s),l=[];if(a.grid.circular){const c=t.getPointPositionForValue(0,s);return new Sc({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(i)})}for(let c=0;c<r;++c)l.push(t.getPointPositionForValue(c,i));return l}function os(e,t,o){const a=Y0(t),{chart:r,index:s,line:i,scale:l,axis:c}=t,d=i.options,u=d.fill,f=d.backgroundColor,{above:h=f,below:m=f}=u||{},p=r.getDatasetMeta(s),b=Pl(r,p);a&&i.points.length&&(Qo(e,o),eb(e,{line:i,target:a,above:h,below:m,area:o,scale:l,axis:c,clip:b}),Zo(e))}function eb(e,t){const{line:o,target:a,above:r,below:s,area:i,scale:l,clip:c}=t,d=o._loop?"angle":t.axis;e.save();let u=s;s!==r&&(d==="x"?(Ac(e,a,i.top),as(e,{line:o,target:a,color:r,scale:l,property:d,clip:c}),e.restore(),e.save(),Ac(e,a,i.bottom)):d==="y"&&(Vc(e,a,i.left),as(e,{line:o,target:a,color:s,scale:l,property:d,clip:c}),e.restore(),e.save(),Vc(e,a,i.right),u=r)),as(e,{line:o,target:a,color:u,scale:l,property:d,clip:c}),e.restore()}function Ac(e,t,o){const{segments:a,points:r}=t;let s=!0,i=!1;e.beginPath();for(const l of a){const{start:c,end:d}=l,u=r[c],f=r[xa(c,d,r)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(u.x,o),e.lineTo(u.x,u.y)),i=!!t.pathSegment(e,l,{move:i}),i?e.closePath():e.lineTo(f.x,o)}e.lineTo(t.first().x,o),e.closePath(),e.clip()}function Vc(e,t,o){const{segments:a,points:r}=t;let s=!0,i=!1;e.beginPath();for(const l of a){const{start:c,end:d}=l,u=r[c],f=r[xa(c,d,r)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(o,u.y),e.lineTo(u.x,u.y)),i=!!t.pathSegment(e,l,{move:i}),i?e.closePath():e.lineTo(o,f.y)}e.lineTo(o,t.first().y),e.closePath(),e.clip()}function as(e,t){const{line:o,target:a,property:r,color:s,scale:i,clip:l}=t,c=F0(o,a,r);for(const{source:d,target:u,start:f,end:h}of c){const{style:{backgroundColor:m=s}={}}=d,p=a!==!0;e.save(),e.fillStyle=m,tb(e,i,l,p&&ns(r,f,h)),e.beginPath();const b=!!o.pathSegment(e,d);let g;if(p){b?e.closePath():Dc(e,a,h,r);const x=!!a.pathSegment(e,u,{move:b,reverse:!0});g=b&&x,g||Dc(e,a,f,r)}e.closePath(),e.fill(g?"evenodd":"nonzero"),e.restore()}}function tb(e,t,o,a){const r=t.chart.chartArea,{property:s,start:i,end:l}=a||{};if(s==="x"||s==="y"){let c,d,u,f;s==="x"?(c=i,d=r.top,u=l,f=r.bottom):(c=r.left,d=i,u=r.right,f=l),e.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)),e.rect(c,d,u-c,f-d),e.clip()}}function Dc(e,t,o,a){const r=t.interpolate(o,a);r&&e.lineTo(r.x,r.y)}var nb={id:"filler",afterDatasetsUpdate(e,t,o){const a=(e.data.datasets||[]).length,r=[];let s,i,l,c;for(i=0;i<a;++i)s=e.getDatasetMeta(i),l=s.dataset,c=null,l&&l.options&&l instanceof tn&&(c={visible:e.isDatasetVisible(i),index:i,fill:L0(l,i,a),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=c,r.push(c);for(i=0;i<a;++i)c=r[i],!(!c||c.fill===!1)&&(c.fill=R0(r,i,o.propagate))},beforeDraw(e,t,o){const a=o.drawTime==="beforeDraw",r=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let i=r.length-1;i>=0;--i){const l=r[i].$filler;l&&(l.line.updateControlPoints(s,l.axis),a&&l.fill&&os(e.ctx,l,s))}},beforeDatasetsDraw(e,t,o){if(o.drawTime!=="beforeDatasetsDraw")return;const a=e.getSortedVisibleDatasetMetas();for(let r=a.length-1;r>=0;--r){const s=a[r].$filler;Ec(s)&&os(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,o){const a=t.meta.$filler;!Ec(a)||o.drawTime!=="beforeDatasetDraw"||os(e.ctx,a,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Mc=(e,t)=>{let{boxHeight:o=t,boxWidth:a=t}=e;return e.usePointStyle&&(o=Math.min(o,t),a=e.pointStyleWidth||Math.min(a,t)),{boxWidth:a,boxHeight:o,itemHeight:Math.max(t,o)}},ob=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Nc extends $t{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,o,a){this.maxWidth=t,this.maxHeight=o,this._margins=a,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 t=this.options.labels||{};let o=Ie(t.generateLabels,[this.chart],this)||[];t.filter&&(o=o.filter(a=>t.filter(a,this.chart.data))),t.sort&&(o=o.sort((a,r)=>t.sort(a,r,this.chart.data))),this.options.reverse&&o.reverse(),this.legendItems=o}fit(){const{options:t,ctx:o}=this;if(!t.display){this.width=this.height=0;return}const a=t.labels,r=nt(a.font),s=r.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=Mc(a,s);let d,u;o.font=r.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(i,s,l,c)+10):(u=this.maxHeight,d=this._fitCols(i,r,l,c)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,o,a,r){const{ctx:s,maxWidth:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=r+l;let f=t;s.textAlign="left",s.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((p,b)=>{const g=a+o/2+s.measureText(p.text).width;(b===0||d[d.length-1]+g+2*l>i)&&(f+=u,d[d.length-(b>0?0:1)]=0,m+=u,h++),c[b]={left:0,top:m,row:h,width:g,height:r},d[d.length-1]+=g+l}),f}_fitCols(t,o,a,r){const{ctx:s,maxHeight:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=i-t;let f=l,h=0,m=0,p=0,b=0;return this.legendItems.forEach((g,x)=>{const{itemWidth:_,itemHeight:C}=ab(a,o,s,g,r);x>0&&m+C+2*l>u&&(f+=h+l,d.push({width:h,height:m}),p+=h+l,b++,h=m=0),c[x]={left:p,top:m,col:b,width:_,height:C},h=Math.max(h,_),m+=C+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:a,labels:{padding:r},rtl:s}}=this,i=zn(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=tt(a,this.left+r,this.right-this.lineWidths[l]);for(const d of o)l!==d.row&&(l=d.row,c=tt(a,this.left+r,this.right-this.lineWidths[l])),d.top+=this.top+t+r,d.left=i.leftForLtr(i.x(c),d.width),c+=d.width+r}else{let l=0,c=tt(a,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const d of o)d.col!==l&&(l=d.col,c=tt(a,this.top+t+r,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+r,d.left=i.leftForLtr(i.x(d.left),d.width),c+=d.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Qo(t,this),this._draw(),Zo(t)}}_draw(){const{options:t,columnSizes:o,lineWidths:a,ctx:r}=this,{align:s,labels:i}=t,l=je.color,c=zn(t.rtl,this.left,this.width),d=nt(i.font),{padding:u}=i,f=d.size,h=f/2;let m;this.drawTitle(),r.textAlign=c.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=d.string;const{boxWidth:p,boxHeight:b,itemHeight:g}=Mc(i,f),x=function(B,k,y){if(isNaN(p)||p<=0||isNaN(b)||b<0)return;r.save();const A=we(y.lineWidth,1);if(r.fillStyle=we(y.fillStyle,l),r.lineCap=we(y.lineCap,"butt"),r.lineDashOffset=we(y.lineDashOffset,0),r.lineJoin=we(y.lineJoin,"miter"),r.lineWidth=A,r.strokeStyle=we(y.strokeStyle,l),r.setLineDash(we(y.lineDash,[])),i.usePointStyle){const D={radius:b*Math.SQRT2/2,pointStyle:y.pointStyle,rotation:y.rotation,borderWidth:A},N=c.xPlus(B,p/2),V=k+h;hl(r,D,N,V,i.pointStyleWidth&&p)}else{const D=k+Math.max((f-b)/2,0),N=c.leftForLtr(B,p),V=vn(y.borderRadius);r.beginPath(),Object.values(V).some(M=>M!==0)?ea(r,{x:N,y:D,w:p,h:b,radius:V}):r.rect(N,D,p,b),r.fill(),A!==0&&r.stroke()}r.restore()},_=function(B,k,y){po(r,y.text,B,k+g/2,d,{strikethrough:y.hidden,textAlign:c.textAlign(y.textAlign)})},C=this.isHorizontal(),w=this._computeTitleHeight();C?m={x:tt(s,this.left+u,this.right-a[0]),y:this.top+u+w,line:0}:m={x:this.left+u,y:tt(s,this.top+w+u,this.bottom-o[0].height),line:0},Bl(this.ctx,t.textDirection);const E=g+u;this.legendItems.forEach((B,k)=>{r.strokeStyle=B.fontColor,r.fillStyle=B.fontColor;const y=r.measureText(B.text).width,A=c.textAlign(B.textAlign||(B.textAlign=i.textAlign)),D=p+h+y;let N=m.x,V=m.y;c.setWidth(this.width),C?k>0&&N+D+u>this.right&&(V=m.y+=E,m.line++,N=m.x=tt(s,this.left+u,this.right-a[m.line])):k>0&&V+E>this.bottom&&(N=m.x=N+o[m.line].width+u,m.line++,V=m.y=tt(s,this.top+w+u,this.bottom-o[m.line].height));const M=c.x(N);if(x(M,V,B),N=Tm(A,N+p+h,C?N+D:this.right,t.rtl),_(c.x(N),V,B),C)m.x+=D+u;else if(typeof B.text!="string"){const T=d.lineHeight;m.y+=Pc(B,T)+u}else m.y+=E}),El(this.ctx,t.textDirection)}drawTitle(){const t=this.options,o=t.title,a=nt(o.font),r=ht(o.padding);if(!o.display)return;const s=zn(t.rtl,this.left,this.width),i=this.ctx,l=o.position,c=a.size/2,d=r.top+c;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+d,f=tt(t.align,f,this.right-h);else{const p=this.columnSizes.reduce((b,g)=>Math.max(b,g.height),0);u=d+tt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const m=tt(l,f,f+h);i.textAlign=s.textAlign(Dr(l)),i.textBaseline="middle",i.strokeStyle=o.color,i.fillStyle=o.color,i.font=a.string,po(i,o.text,m,u,a)}_computeTitleHeight(){const t=this.options.title,o=nt(t.font),a=ht(t.padding);return t.display?o.lineHeight+a.height:0}_getLegendItemAt(t,o){let a,r,s;if(Rt(t,this.left,this.right)&&Rt(o,this.top,this.bottom)){for(s=this.legendHitBoxes,a=0;a<s.length;++a)if(r=s[a],Rt(t,r.left,r.left+r.width)&&Rt(o,r.top,r.top+r.height))return this.legendItems[a]}return null}handleEvent(t){const o=this.options;if(!ib(t.type,o))return;const a=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=ob(r,a);r&&!s&&Ie(o.onLeave,[t,r,this],this),this._hoveredItem=a,a&&!s&&Ie(o.onHover,[t,a,this],this)}else a&&Ie(o.onClick,[t,a,this],this)}}function ab(e,t,o,a,r){const s=rb(a,e,t,o),i=sb(r,a,t.lineHeight);return{itemWidth:s,itemHeight:i}}function rb(e,t,o,a){let r=e.text;return r&&typeof r!="string"&&(r=r.reduce((s,i)=>s.length>i.length?s:i)),t+o.size/2+a.measureText(r).width}function sb(e,t,o){let a=e;return typeof t.text!="string"&&(a=Pc(t,o)),a}function Pc(e,t){const o=e.text?e.text.length:0;return t*o}function ib(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var lb={id:"legend",_element:Nc,start(e,t,o){const a=e.legend=new Nc({ctx:e.ctx,options:o,chart:e});mt.configure(e,a,o),mt.addBox(e,a)},stop(e){mt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,o){const a=e.legend;mt.configure(e,a,o),a.options=o},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,o){const a=t.datasetIndex,r=o.chart;r.isDatasetVisible(a)?(r.hide(a),t.hidden=!0):(r.show(a),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:o,pointStyle:a,textAlign:r,color:s,useBorderRadius:i,borderRadius:l}}=e.legend.options;return e._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(o?0:void 0),u=ht(d.borderWidth);return{text:t[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:a||d.pointStyle,rotation:d.rotation,textAlign:r||d.textAlign,borderRadius:i&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class vc extends $t{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,o){const a=this.options;if(this.left=0,this.top=0,!a.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=o;const r=He(a.text)?a.text.length:1;this._padding=ht(a.padding);const s=r*nt(a.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:o,left:a,bottom:r,right:s,options:i}=this,l=i.align;let c=0,d,u,f;return this.isHorizontal()?(u=tt(l,a,s),f=o+t,d=s-a):(i.position==="left"?(u=a+t,f=tt(l,r,o),c=Pe*-.5):(u=s-t,f=tt(l,o,r),c=Pe*.5),d=r-o),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const t=this.ctx,o=this.options;if(!o.display)return;const a=nt(o.font),s=a.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);po(t,o.text,0,0,a,{color:o.color,maxWidth:c,rotation:d,textAlign:Dr(o.align),textBaseline:"middle",translation:[i,l]})}}function cb(e,t){const o=new vc({ctx:e.ctx,options:t,chart:e});mt.configure(e,o,t),mt.addBox(e,o),e.titleBlock=o}var db={id:"title",_element:vc,start(e,t,o){cb(e,o)},stop(e){const t=e.titleBlock;mt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,o){const a=e.titleBlock;mt.configure(e,a,o),a.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 Bo={average(e){if(!e.length)return!1;let t,o,a=new Set,r=0,s=0;for(t=0,o=e.length;t<o;++t){const l=e[t].element;if(l&&l.hasValue()){const c=l.tooltipPosition();a.add(c.x),r+=c.y,++s}}return s===0||a.size===0?!1:{x:[...a].reduce((l,c)=>l+c)/a.size,y:r/s}},nearest(e,t){if(!e.length)return!1;let o=t.x,a=t.y,r=Number.POSITIVE_INFINITY,s,i,l;for(s=0,i=e.length;s<i;++s){const c=e[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=Ar(t,d);u<r&&(r=u,l=c)}}if(l){const c=l.tooltipPosition();o=c.x,a=c.y}return{x:o,y:a}}};function Dt(e,t){return t&&(He(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function jt(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
17
17
|
`)>-1?e.split(`
|
|
18
|
-
`):e}function ub(e,t){const{element:o,datasetIndex:a,index:r}=t,s=e.getDatasetMeta(a).controller,{label:i,value:l}=s.getLabelAndValue(r);return{chart:e,label:i,parsed:s.getParsed(r),raw:e.data.datasets[a].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:a,element:o}}function Tc(e,t){const o=e.chart.ctx,{body:a,footer:r,title:s}=e,{boxWidth:i,boxHeight:l}=t,c=tt(t.bodyFont),d=tt(t.titleFont),u=tt(t.footerFont),f=s.length,h=r.length,m=a.length,p=ht(t.padding);let g=p.height,y=0,x=a.reduce((w,E)=>w+E.before.length+E.lines.length+E.after.length,0);if(x+=e.beforeBody.length+e.afterBody.length,f&&(g+=f*d.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),x){const w=t.displayColors?Math.max(l,c.lineHeight):c.lineHeight;g+=m*w+(x-m)*c.lineHeight+(x-1)*t.bodySpacing}h&&(g+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let _=0;const C=function(w){y=Math.max(y,o.measureText(w).width+_)};return o.save(),o.font=d.string,Me(e.title,C),o.font=c.string,Me(e.beforeBody.concat(e.afterBody),C),_=t.displayColors?i+2+t.boxPadding:0,Me(a,w=>{Me(w.before,C),Me(w.lines,C),Me(w.after,C)}),_=0,o.font=u.string,Me(e.footer,C),o.restore(),y+=p.width,{width:y,height:g}}function fb(e,t){const{y:o,height:a}=t;return o<a/2?"top":o>e.height-a/2?"bottom":"center"}function hb(e,t,o,a){const{x:r,width:s}=a,i=o.caretSize+o.caretPadding;if(e==="left"&&r+s+i>t.width||e==="right"&&r-s-i<0)return!0}function mb(e,t,o,a){const{x:r,width:s}=o,{width:i,chartArea:{left:l,right:c}}=e;let d="center";return a==="center"?d=r<=(l+c)/2?"left":"right":r<=s/2?d="left":r>=i-s/2&&(d="right"),hb(d,e,t,o)&&(d="center"),d}function Oc(e,t,o){const a=o.yAlign||t.yAlign||fb(e,o);return{xAlign:o.xAlign||t.xAlign||mb(e,t,o,a),yAlign:a}}function pb(e,t){let{x:o,width:a}=e;return t==="right"?o-=a:t==="center"&&(o-=a/2),o}function gb(e,t,o){let{y:a,height:r}=e;return t==="top"?a+=o:t==="bottom"?a-=r+o:a-=r/2,a}function zc(e,t,o,a){const{caretSize:r,caretPadding:s,cornerRadius:i}=e,{xAlign:l,yAlign:c}=o,d=r+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=vn(i);let p=pb(t,l);const g=gb(t,c,d);return c==="center"?l==="left"?p+=d:l==="right"&&(p-=d):l==="left"?p-=Math.max(u,h)+r:l==="right"&&(p+=Math.max(f,m)+r),{x:Ze(p,0,a.width-t.width),y:Ze(g,0,a.height-t.height)}}function ka(e,t,o){const a=ht(o.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-a.right:e.x+a.left}function Fc(e){return Dt([],jt(e))}function bb(e,t,o){return xn(e,{tooltip:t,tooltipItems:o,type:"tooltip"})}function Ic(e,t){const o=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return o?e.override(o):e}const Rc={beforeTitle:Ft,title(e){if(e.length>0){const t=e[0],o=t.chart.data.labels,a=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(a>0&&t.dataIndex<a)return o[t.dataIndex]}return""},afterTitle:Ft,beforeBody:Ft,beforeLabel:Ft,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const o=e.formattedValue;return De(o)||(t+=o),t},labelColor(e){const o=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.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(e){const o=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:Ft,afterBody:Ft,beforeFooter:Ft,footer:Ft,afterFooter:Ft};function rt(e,t,o,a){const r=e[t].call(o,a);return typeof r>"u"?Rc[t].call(o,a):r}class rs extends $t{constructor(t){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=t.chart,this.options=t.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(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const o=this.chart,a=this.options.setContext(this.getContext()),r=a.enabled&&o.options.animation&&a.animations,s=new Tl(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=bb(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,o){const{callbacks:a}=o,r=rt(a,"beforeTitle",this,t),s=rt(a,"title",this,t),i=rt(a,"afterTitle",this,t);let l=[];return l=Dt(l,jt(r)),l=Dt(l,jt(s)),l=Dt(l,jt(i)),l}getBeforeBody(t,o){return Fc(rt(o.callbacks,"beforeBody",this,t))}getBody(t,o){const{callbacks:a}=o,r=[];return Me(t,s=>{const i={before:[],lines:[],after:[]},l=Ic(a,s);Dt(i.before,jt(rt(l,"beforeLabel",this,s))),Dt(i.lines,rt(l,"label",this,s)),Dt(i.after,jt(rt(l,"afterLabel",this,s))),r.push(i)}),r}getAfterBody(t,o){return Fc(rt(o.callbacks,"afterBody",this,t))}getFooter(t,o){const{callbacks:a}=o,r=rt(a,"beforeFooter",this,t),s=rt(a,"footer",this,t),i=rt(a,"afterFooter",this,t);let l=[];return l=Dt(l,jt(r)),l=Dt(l,jt(s)),l=Dt(l,jt(i)),l}_createItems(t){const o=this._active,a=this.chart.data,r=[],s=[],i=[];let l=[],c,d;for(c=0,d=o.length;c<d;++c)l.push(ub(this.chart,o[c]));return t.filter&&(l=l.filter((u,f,h)=>t.filter(u,f,h,a))),t.itemSort&&(l=l.sort((u,f)=>t.itemSort(u,f,a))),Me(l,u=>{const f=Ic(t.callbacks,u);r.push(rt(f,"labelColor",this,u)),s.push(rt(f,"labelPointStyle",this,u)),i.push(rt(f,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(t,o){const a=this.options.setContext(this.getContext()),r=this._active;let s,i=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const l=_o[a.position].call(this,r,this._eventPosition);i=this._createItems(a),this.title=this.getTitle(i,a),this.beforeBody=this.getBeforeBody(i,a),this.body=this.getBody(i,a),this.afterBody=this.getAfterBody(i,a),this.footer=this.getFooter(i,a);const c=this._size=Tc(this,a),d=Object.assign({},l,c),u=Oc(this.chart,a,d),f=zc(a,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),t&&a.external&&a.external.call(this,{chart:this.chart,tooltip:this,replay:o})}drawCaret(t,o,a,r){const s=this.getCaretPosition(t,a,r);o.lineTo(s.x1,s.y1),o.lineTo(s.x2,s.y2),o.lineTo(s.x3,s.y3)}getCaretPosition(t,o,a){const{xAlign:r,yAlign:s}=this,{caretSize:i,cornerRadius:l}=a,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=vn(l),{x:h,y:m}=t,{width:p,height:g}=o;let y,x,_,C,w,E;return s==="center"?(w=m+g/2,r==="left"?(y=h,x=y-i,C=w+i,E=w-i):(y=h+p,x=y+i,C=w-i,E=w+i),_=y):(r==="left"?x=h+Math.max(c,u)+i:r==="right"?x=h+p-Math.max(d,f)-i:x=this.caretX,s==="top"?(C=m,w=C-i,y=x-i,_=x+i):(C=m+g,w=C+i,y=x+i,_=x-i),E=C),{x1:y,x2:x,x3:_,y1:C,y2:w,y3:E}}drawTitle(t,o,a){const r=this.title,s=r.length;let i,l,c;if(s){const d=zn(a.rtl,this.x,this.width);for(t.x=ka(this,a.titleAlign,a),o.textAlign=d.textAlign(a.titleAlign),o.textBaseline="middle",i=tt(a.titleFont),l=a.titleSpacing,o.fillStyle=a.titleColor,o.font=i.string,c=0;c<s;++c)o.fillText(r[c],d.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+l,c+1===s&&(t.y+=a.titleMarginBottom-l)}}_drawColorBox(t,o,a,r,s){const i=this.labelColors[a],l=this.labelPointStyles[a],{boxHeight:c,boxWidth:d}=s,u=tt(s.bodyFont),f=ka(this,"left",s),h=r.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,p=o.y+m;if(s.usePointStyle){const g={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},y=r.leftForLtr(h,d)+d/2,x=p+c/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Or(t,g,y,x),t.strokeStyle=i.borderColor,t.fillStyle=i.backgroundColor,Or(t,g,y,x)}else{t.lineWidth=Be(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,t.strokeStyle=i.borderColor,t.setLineDash(i.borderDash||[]),t.lineDashOffset=i.borderDashOffset||0;const g=r.leftForLtr(h,d),y=r.leftForLtr(r.xPlus(h,1),d-2),x=vn(i.borderRadius);Object.values(x).some(_=>_!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,ea(t,{x:g,y:p,w:d,h:c,radius:x}),t.fill(),t.stroke(),t.fillStyle=i.backgroundColor,t.beginPath(),ea(t,{x:y,y:p+1,w:d-2,h:c-2,radius:x}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(g,p,d,c),t.strokeRect(g,p,d,c),t.fillStyle=i.backgroundColor,t.fillRect(y,p+1,d-2,c-2))}t.fillStyle=this.labelTextColors[a]}drawBody(t,o,a){const{body:r}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=a,f=tt(a.bodyFont);let h=f.lineHeight,m=0;const p=zn(a.rtl,this.x,this.width),g=function(b){o.fillText(b,p.x(t.x+m),t.y+h/2),t.y+=h+s},y=p.textAlign(i);let x,_,C,w,E,B,k;for(o.textAlign=i,o.textBaseline="middle",o.font=f.string,t.x=ka(this,y,a),o.fillStyle=a.bodyColor,Me(this.beforeBody,g),m=l&&y!=="right"?i==="center"?d/2+u:d+2+u:0,w=0,B=r.length;w<B;++w){for(x=r[w],_=this.labelTextColors[w],o.fillStyle=_,Me(x.before,g),C=x.lines,l&&C.length&&(this._drawColorBox(o,t,w,p,a),h=Math.max(f.lineHeight,c)),E=0,k=C.length;E<k;++E)g(C[E]),h=f.lineHeight;Me(x.after,g)}m=0,h=f.lineHeight,Me(this.afterBody,g),t.y-=s}drawFooter(t,o,a){const r=this.footer,s=r.length;let i,l;if(s){const c=zn(a.rtl,this.x,this.width);for(t.x=ka(this,a.footerAlign,a),t.y+=a.footerMarginTop,o.textAlign=c.textAlign(a.footerAlign),o.textBaseline="middle",i=tt(a.footerFont),o.fillStyle=a.footerColor,o.font=i.string,l=0;l<s;++l)o.fillText(r[l],c.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+a.footerSpacing}}drawBackground(t,o,a,r){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=t,{width:d,height:u}=a,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:p}=vn(r.cornerRadius);o.fillStyle=r.backgroundColor,o.strokeStyle=r.borderColor,o.lineWidth=r.borderWidth,o.beginPath(),o.moveTo(l+f,c),i==="top"&&this.drawCaret(t,o,a,r),o.lineTo(l+d-h,c),o.quadraticCurveTo(l+d,c,l+d,c+h),i==="center"&&s==="right"&&this.drawCaret(t,o,a,r),o.lineTo(l+d,c+u-p),o.quadraticCurveTo(l+d,c+u,l+d-p,c+u),i==="bottom"&&this.drawCaret(t,o,a,r),o.lineTo(l+m,c+u),o.quadraticCurveTo(l,c+u,l,c+u-m),i==="center"&&s==="left"&&this.drawCaret(t,o,a,r),o.lineTo(l,c+f),o.quadraticCurveTo(l,c,l+f,c),o.closePath(),o.fill(),r.borderWidth>0&&o.stroke()}_updateAnimationTarget(t){const o=this.chart,a=this.$animations,r=a&&a.x,s=a&&a.y;if(r||s){const i=_o[t.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=Tc(this,t),c=Object.assign({},i,this._size),d=Oc(o,t,c),u=zc(t,c,d,o);(r._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(t){const o=this.options.setContext(this.getContext());let a=this.opacity;if(!a)return;this._updateAnimationTarget(o);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};a=Math.abs(a)<.001?0:a;const i=ht(o.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;o.enabled&&l&&(t.save(),t.globalAlpha=a,this.drawBackground(s,t,r,o),Bl(t,o.textDirection),s.y+=i.top,this.drawTitle(s,t,o),this.drawBody(s,t,o),this.drawFooter(s,t,o),El(t,o.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,o){const a=this._active,r=t.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=!Xo(a,r),i=this._positionChanged(r,o);(s||i)&&(this._active=r,this._eventPosition=o,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,o,a=!0){if(o&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],i=this._getActiveElements(t,s,o,a),l=this._positionChanged(i,t),c=o||!Xo(i,s)||l;return c&&(this._active=i,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,o))),c}_getActiveElements(t,o,a,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)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(t,s.mode,s,a);return s.reverse&&i.reverse(),i}_positionChanged(t,o){const{caretX:a,caretY:r,options:s}=this,i=_o[s.position].call(this,t,o);return i!==!1&&(a!==i.x||r!==i.y)}}de(rs,"positioners",_o);var yb={id:"tooltip",_element:rs,positioners:_o,afterInit(e,t,o){o&&(e.tooltip=new rs({chart:e,options:o}))},beforeUpdate(e,t,o){e.tooltip&&e.tooltip.initialize(o)},reset(e,t,o){e.tooltip&&e.tooltip.initialize(o)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const o={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...o,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",o)}},afterEvent(e,t){if(e.tooltip){const o=t.replay;e.tooltip.handleEvent(t.event,o,t.inChartArea)&&(t.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:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.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:Rc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const xb=(e,t,o,a)=>(typeof t=="string"?(o=e.push(t)-1,a.unshift({index:o,label:t})):isNaN(t)&&(o=null),o);function kb(e,t,o,a){const r=e.indexOf(t);if(r===-1)return xb(e,t,o,a);const s=e.lastIndexOf(t);return r!==s?o:r}const wb=(e,t)=>e===null?null:Ze(Math.round(e),0,t);function Lc(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class ss extends In{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const o=this._addedLabels;if(o.length){const a=this.getLabels();for(const{index:r,label:s}of o)a[r]===s&&a.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,o){if(De(t))return null;const a=this.getLabels();return o=isFinite(o)&&a[o]===t?o:kb(a,t,xe(o,t),this._addedLabels),wb(o,a.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:o}=this.getUserBounds();let{min:a,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(a=0),o||(r=this.getLabels().length-1)),this.min=a,this.max=r}buildTicks(){const t=this.min,o=this.max,a=this.options.offset,r=[];let s=this.getLabels();s=t===0&&o===s.length-1?s:s.slice(t,o+1),this._valueRange=Math.max(s.length-(a?0:1),1),this._startValue=this.min-(a?.5:0);for(let i=t;i<=o;i++)r.push({value:i});return r}getLabelForValue(t){return Lc.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}de(ss,"id","category"),de(ss,"defaults",{ticks:{callback:Lc}});function Cb(e,t){const o=[],{bounds:r,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=e,m=s||1,p=u-1,{min:g,max:y}=t,x=!De(i),_=!De(l),C=!De(d),w=(y-g)/(f+1);let E=Qi((y-g)/p/m)*m,B,k,b,A;if(E<1e-14&&!x&&!_)return[{value:g},{value:y}];A=Math.ceil(y/E)-Math.floor(g/E),A>p&&(E=Qi(A*E/p/m)*m),De(c)||(B=Math.pow(10,c),E=Math.ceil(E*B)/B),r==="ticks"?(k=Math.floor(g/E)*E,b=Math.ceil(y/E)*E):(k=g,b=y),x&&_&&s&&Em((l-i)/s,E/1e3)?(A=Math.round(Math.min((l-i)/E,u)),E=(l-i)/A,k=i,b=l):C?(k=x?i:k,b=_?l:b,A=d-1,E=(b-k)/A):(A=(b-k)/E,io(A,Math.round(A),E/1e3)?A=Math.round(A):A=Math.ceil(A));const D=Math.max(Zi(E),Zi(k));B=Math.pow(10,De(c)?D:c),k=Math.round(k*B)/B,b=Math.round(b*B)/B;let P=0;for(x&&(h&&k!==i?(o.push({value:i}),k<i&&P++,io(Math.round((k+P*E)*B)/B,i,$c(i,w,e))&&P++):k<i&&P++);P<A;++P){const V=Math.round((k+P*E)*B)/B;if(_&&V>l)break;o.push({value:V})}return _&&h&&b!==l?o.length&&io(o[o.length-1].value,l,$c(l,w,e))?o[o.length-1].value=l:o.push({value:l}):(!_||b===l)&&o.push({value:b}),o}function $c(e,t,{horizontal:o,minRotation:a}){const r=It(a),s=(o?Math.sin(r):Math.cos(r))||.001,i=.75*t*(""+e).length;return Math.min(t/s,i)}class _b extends In{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,o){return De(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:o,maxDefined:a}=this.getUserBounds();let{min:r,max:s}=this;const i=c=>r=o?r:c,l=c=>s=a?s:c;if(t){const c=At(r),d=At(s);c<0&&d<0?l(0):c>0&&d>0&&i(0)}if(r===s){let c=s===0?1:Math.abs(s*.05);l(s+c),t||i(r-c)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:o,stepSize:a}=t,r;return a?(r=Math.ceil(this.max/a)-Math.floor(this.min/a)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${a} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),o=o||11),o&&(r=Math.min(o,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,o=t.ticks;let a=this.getTickLimit();a=Math.max(2,a);const r={maxTicks:a,bounds:t.bounds,min:t.min,max:t.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=Cb(r,s);return t.bounds==="ticks"&&Sm(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let o=this.min,a=this.max;if(super.configure(),this.options.offset&&t.length){const r=(a-o)/Math.max(t.length-1,1)/2;o-=r,a+=r}this._startValue=o,this._endValue=a,this._valueRange=a-o}getLabelForValue(t){return Pr(t,this.chart.options.locale,this.options.ticks.format)}}class is extends _b{determineDataLimits(){const{min:t,max:o}=this.getMinMax(!0);this.min=Qe(t)?t:0,this.max=Qe(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),o=t?this.width:this.height,a=It(this.options.ticks.minRotation),r=(t?Math.sin(a):Math.cos(a))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}de(is,"id","linear"),de(is,"defaults",{ticks:{callback:dl.formatters.numeric}});const wa={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}},st=Object.keys(wa);function Wc(e,t){return e-t}function jc(e,t){if(De(t))return null;const o=e._adapter,{parser:a,round:r,isoWeekday:s}=e._parseOpts;let i=t;return typeof a=="function"&&(i=a(i)),Qe(i)||(i=typeof a=="string"?o.parse(i,a):o.parse(i)),i===null?null:(r&&(i=r==="week"&&(lo(s)||s===!0)?o.startOf(i,"isoWeek",s):o.startOf(i,r)),+i)}function Uc(e,t,o,a){const r=st.length;for(let s=st.indexOf(e);s<r-1;++s){const i=wa[st[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((o-t)/(l*i.size))<=a)return st[s]}return st[r-1]}function Bb(e,t,o,a,r){for(let s=st.length-1;s>=st.indexOf(o);s--){const i=st[s];if(wa[i].common&&e._adapter.diff(r,a,i)>=t-1)return i}return st[o?st.indexOf(o):0]}function Eb(e){for(let t=st.indexOf(e)+1,o=st.length;t<o;++t)if(wa[st[t]].common)return st[t]}function Hc(e,t,o){if(!o)e[t]=!0;else if(o.length){const{lo:a,hi:r}=Vr(o,t),s=o[a]>=t?o[a]:o[r];e[s]=!0}}function Sb(e,t,o,a){const r=e._adapter,s=+r.startOf(t[0].value,a),i=t[t.length-1].value;let l,c;for(l=s;l<=i;l=+r.add(l,1,a))c=o[l],c>=0&&(t[c].major=!0);return t}function qc(e,t,o){const a=[],r={},s=t.length;let i,l;for(i=0;i<s;++i)l=t[i],r[l]=i,a.push({value:l,major:!1});return s===0||!o?a:Sb(e,a,r,o)}class Ca extends In{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,o={}){const a=t.time||(t.time={}),r=this._adapter=new lg._date(t.adapters.date);r.init(o),ro(a.displayFormats,r.formats()),this._parseOpts={parser:a.parser,round:a.round,isoWeekday:a.isoWeekday},super.init(t),this._normalized=o.normalized}parse(t,o){return t===void 0?null:jc(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,o=this._adapter,a=t.time.unit||"day";let{min:r,max:s,minDefined:i,maxDefined:l}=this.getUserBounds();function c(d){!i&&!isNaN(d.min)&&(r=Math.min(r,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!i||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),r=Qe(r)&&!isNaN(r)?r:+o.startOf(Date.now(),a),s=Qe(s)&&!isNaN(s)?s:+o.endOf(Date.now(),a)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;return t.length&&(o=t[0],a=t[t.length-1]),{min:o,max:a}}buildTicks(){const t=this.options,o=t.time,a=t.ticks,r=a.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,i=this.max,l=Nm(r,s,i);return this._unit=o.unit||(a.autoSkip?Uc(o.minUnit,this.min,this.max,this._getLabelCapacity(s)):Bb(this,l.length,o.minUnit,this.min,this.max)),this._majorUnit=!a.major.enabled||this._unit==="year"?void 0:Eb(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),qc(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let o=0,a=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?o=1-r:o=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?a=s:a=(s-this.getDecimalForValue(t[t.length-2]))/2);const i=t.length<3?.5:.25;o=Ze(o,0,i),a=Ze(a,0,i),this._offsets={start:o,end:a,factor:1/(o+1+a)}}_generate(){const t=this._adapter,o=this.min,a=this.max,r=this.options,s=r.time,i=s.unit||Uc(s.minUnit,o,a,this._getLabelCapacity(o)),l=xe(r.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=lo(c)||c===!0,u={};let f=o,h,m;if(d&&(f=+t.startOf(f,"isoWeek",c)),f=+t.startOf(f,d?"day":i),t.diff(a,o,i)>1e5*l)throw new Error(o+" and "+a+" are too far apart with stepSize of "+l+" "+i);const p=r.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<a;h=+t.add(h,l,i),m++)Hc(u,h,p);return(h===a||r.bounds==="ticks"||m===1)&&Hc(u,h,p),Object.keys(u).sort(Wc).map(g=>+g)}getLabelForValue(t){const o=this._adapter,a=this.options.time;return a.tooltipFormat?o.format(t,a.tooltipFormat):o.format(t,a.displayFormats.datetime)}format(t,o){const r=this.options.time.displayFormats,s=this._unit,i=o||r[s];return this._adapter.format(t,i)}_tickFormatFunction(t,o,a,r){const s=this.options,i=s.ticks.callback;if(i)return Fe(i,[t,o,a],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=a[o],m=d&&f&&h&&h.major;return this._adapter.format(t,r||(m?f:u))}generateTickLabels(t){let o,a,r;for(o=0,a=t.length;o<a;++o)r=t[o],r.label=this._tickFormatFunction(r.value,o,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const o=this._offsets,a=this.getDecimalForValue(t);return this.getPixelForDecimal((o.start+a)*o.factor)}getValueForPixel(t){const o=this._offsets,a=this.getDecimalForPixel(t)/o.factor-o.end;return this.min+a*(this.max-this.min)}_getLabelSize(t){const o=this.options.ticks,a=this.ctx.measureText(t).width,r=It(this.isHorizontal()?o.maxRotation:o.minRotation),s=Math.cos(r),i=Math.sin(r),l=this._resolveTickFontOptions(0).size;return{w:a*s+l*i,h:a*i+l*s}}_getLabelCapacity(t){const o=this.options.time,a=o.displayFormats,r=a[o.unit]||a.millisecond,s=this._tickFormatFunction(t,0,qc(this,[t],this._majorUnit),r),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 t=this._cache.data||[],o,a;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(o=0,a=r.length;o<a;++o)t=t.concat(r[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let o,a;if(t.length)return t;const r=this.getLabels();for(o=0,a=r.length;o<a;++o)t.push(jc(this,r[o]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ol(t.sort(Wc))}}de(Ca,"id","time"),de(Ca,"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 _a(e,t,o){let a=0,r=e.length-1,s,i,l,c;o?(t>=e[a].pos&&t<=e[r].pos&&({lo:a,hi:r}=gn(e,"pos",t)),{pos:s,time:l}=e[a],{pos:i,time:c}=e[r]):(t>=e[a].time&&t<=e[r].time&&({lo:a,hi:r}=gn(e,"time",t)),{time:s,pos:l}=e[a],{time:i,pos:c}=e[r]);const d=i-s;return d?l+(c-l)*(t-s)/d:l}class Gc extends Ca{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(t);this._minPos=_a(o,this.min),this._tableRange=_a(o,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:o,max:a}=this,r=[],s=[];let i,l,c,d,u;for(i=0,l=t.length;i<l;++i)d=t[i],d>=o&&d<=a&&r.push(d);if(r.length<2)return[{time:o,pos:0},{time:a,pos:1}];for(i=0,l=r.length;i<l;++i)u=r[i+1],c=r[i-1],d=r[i],Math.round((u+c)/2)!==d&&s.push({time:d,pos:i/(l-1)});return s}_generate(){const t=this.min,o=this.max;let a=super.getDataTimestamps();return(!a.includes(t)||!a.length)&&a.splice(0,0,t),(!a.includes(o)||a.length===1)&&a.push(o),a.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const o=this.getDataTimestamps(),a=this.getLabelTimestamps();return o.length&&a.length?t=this.normalize(o.concat(a)):t=o.length?o:a,t=this._cache.all=t,t}getDecimalForValue(t){return(_a(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const o=this._offsets,a=this.getDecimalForPixel(t)/o.factor-o.end;return _a(this._table,a*this._tableRange+this._minPos,!0)}}de(Gc,"id","timeseries"),de(Gc,"defaults",Ca.defaults);const Ab={key:0,class:"mb-2 text-sm font-medium text-gray-700"},Vb={key:0,class:"text-red-500 ml-1"},Db={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},Mb={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},Nb={class:"text-red-600 text-sm"},Pb={key:1,class:"mt-2 text-xs text-gray-500"},vb={key:0},Xc=xt(n.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(e,{expose:t,emit:o}){Wt.register(ss,is,ba,tn,ya,Co,db,yb,lb,nb,ia,sa,qr,Fn);const a=e,r=o,s=n.ref(null),i=n.shallowRef(null),l=n.ref(null),c=n.computed(()=>({"opacity-50 pointer-events-none":a.loading||a.error})),d=()=>{const h=a.theme==="dark";return{responsive:a.responsive,maintainAspectRatio:a.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:m=>{let p=0;return m.type==="data"&&m.mode==="default"&&(p=m.dataIndex*100+m.datasetIndex*50),p},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:a.type!=="pie"&&a.type!=="doughnut"&&a.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,p)=>{const g=p%a.colors.length,y=a.colors[g];let x=m.backgroundColor,_=m.borderColor;return["pie","doughnut","polarArea"].includes(a.type)&&(!x||x.length===0)?m.data&&(x=m.data.map((C,w)=>a.colors[w%a.colors.length]+"80"),_=m.data.map((C,w)=>a.colors[w%a.colors.length])):(x=x||y+"40",_=_||y),{...m,borderColor:_,backgroundColor:x,pointBackgroundColor:m.pointBackgroundColor||y,pointBorderColor:m.pointBorderColor||y,hoverBackgroundColor:m.hoverBackgroundColor||y+"60",hoverBorderColor:m.hoverBorderColor||y}})},f=async()=>{if(!s.value)return;await n.nextTick(),i.value&&i.value.destroy();const h=a.data||a.modelValue;let m=h;if(Array.isArray(h))if(h.length>0&&typeof h[0]=="object"&&h[0]!==null){const g=Object.keys(h[0]),y=g.find(_=>["label","name","x","category","title"].includes(_.toLowerCase()))||g[0],x=g.find(_=>_!==y&&["value","y","count","amount","total","data"].includes(_.toLowerCase()))||g.find(_=>_!==y&&typeof h[0][_]=="number")||(g.length>1?g.find(_=>_!==y):g[0]);m={labels:h.map(_=>_[y||""]),datasets:[{label:a.label||"Data",data:h.map(_=>_[x||""])}]}}else h.length>0?m={labels:h.map((g,y)=>`Data ${y+1}`),datasets:[{label:a.label||"Data",data:h}]}:m={labels:[],datasets:[]};if(l.value=u(m),!l.value)return;const p={...d(),...a.options,onClick:(g,y)=>{r("click",g,y),a.onClick&&a.onClick(g,y)},onHover:(g,y)=>{r("hover",g,y),a.onHover&&a.onHover(g,y)}};i.value=new Wt(s.value,{type:a.type,data:l.value,options:p}),r("ready",i.value)};return n.watch(()=>[a.data,a.modelValue,a.type,a.options,a.theme],()=>{f()},{deep:!0}),n.watch(()=>[a.width,a.height],()=>{i.value&&i.value.resize()}),n.onMounted(()=>{f()}),n.onUnmounted(()=>{i.value&&i.value.destroy()}),t({chart:i,updateChart:f}),(h,m)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["d-code-chart",c.value])},[e.label?(n.openBlock(),n.createElementBlock("div",Ab,[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",Vb,"*")):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"relative",style:n.normalizeStyle({height:e.height+"px"})},[n.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),e.loading?(n.openBlock(),n.createElementBlock("div",Db,[...m[0]||(m[0]=[n.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):n.createCommentVNode("",!0),e.error?(n.openBlock(),n.createElementBlock("div",Mb,[n.createElementVNode("div",Nb,n.toDisplayString(e.error),1)])):n.createCommentVNode("",!0)],4),e.showInfo&&l.value?(n.openBlock(),n.createElementBlock("div",Pb,[l.value.datasets?(n.openBlock(),n.createElementBlock("div",vb,n.toDisplayString(l.value.datasets.length)+" dataset(s) • "+n.toDisplayString(l.value.labels?l.value.labels.length:0)+" data points ",1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1c7c58f"]]),Tb=["aria-busy"],Ob={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},zb={key:1,class:"flex items-center gap-2.5"},Fb=["id","checked","indeterminate","disabled","required"],Ib=["for"],Rb={key:0,class:"ml-1 text-red-500 dark:text-red-400","aria-label":"required"},on=xt(n.defineComponent({name:"DCodeCheckbox",inheritAttrs:!1,__name:"DCodeCheckbox",props:{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(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=n.computed(()=>o.label),i=n.computed(()=>o.placeholder),l=n.computed(()=>o.title),c=n.computed(()=>r.visible??!0),d=n.computed(()=>o.required===""||o.required===!0||o.required==="true"),u=Math.random().toString(36).slice(2,7),f=n.computed(()=>`dcode-checkbox-${o.id||s.value||"checkbox"}-${u}`),h=n.ref(!!r.modelValue);n.watch(()=>r.modelValue,g=>{h.value=!!g},{immediate:!0});const m=()=>{if(r.disabled)return;const g=!h.value;h.value=g,a("update:modelValue",g)},p=g=>{(g.key===" "||g.key==="Enter")&&(g.preventDefault(),m())};return(g,y)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["",[n.unref(o).class,{"opacity-60 cursor-not-allowed":e.disabled}]]),"aria-busy":e.skeleton},[e.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.value?(n.openBlock(),n.createElementBlock("div",Ob)):n.createCommentVNode("",!0),y[0]||(y[0]=n.createElementVNode("div",{class:"flex items-center gap-2.5"},[n.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),n.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(n.openBlock(),n.createElementBlock("div",zb,[n.createElementVNode("label",{class:n.normalizeClass(["flex items-start gap-2.5 group relative",{"cursor-pointer":!e.disabled,"opacity-50 cursor-not-allowed":e.disabled}])},[n.createElementVNode("input",{type:"checkbox",id:f.value,class:"sr-only peer",checked:h.value,indeterminate:e.indeterminate,disabled:e.disabled,required:d.value,onChange:m,onKeydown:p},null,40,Fb),n.createElementVNode("div",{class:n.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 mt-0.5",[h.value||e.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-900",e.disabled?"cursor-not-allowed":"cursor-pointer"]]),"aria-hidden":"true"},[h.value&&!e.indeterminate?(n.openBlock(),n.createBlock(n.unref(te.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):e.indeterminate?(n.openBlock(),n.createBlock(n.unref(te.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):n.createCommentVNode("",!0)],2),i.value||l.value?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass(["text-sm leading-relaxed select-none transition-colors",[e.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"]])},n.toDisplayString(i.value||l.value),3)):n.createCommentVNode("",!0)],2),s.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:f.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300 select-none cursor-pointer"},[n.createTextVNode(n.toDisplayString(s.value)+" ",1),d.value?(n.openBlock(),n.createElementBlock("span",Rb," * ")):n.createCommentVNode("",!0)],8,Ib)):n.createCommentVNode("",!0)]))],10,Tb)),[[n.vShow,c.value]])}}),[["__scopeId","data-v-fedb92bf"]]),Lb=["aria-busy"],$b={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Wb={key:1,class:"flex justify-end"},jb=["for"],Ub={key:0,class:"ml-1 text-destructive"},Hb={class:"relative w-full group"},qb={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700"},Gb={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},Xb=["id","disabled","readonly","placeholder","maxlength"],Yb={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"},Kb={key:1,class:"flex items-center gap-1 text-xs text-destructive"},ls=n.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(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=Math.random().toString(36).slice(2,7),i=n.computed(()=>`app-currency-field-${o.id||r.label||"currency-field"}-${s}`),l=n.computed(()=>{const P=o.required,V=o["aria-required"];return P===""||P===!0||P==="true"||(V==="true"||V===!0)}),c=n.computed(()=>{const P=o.maxlength??o.maxLength;let V=Number.NaN;return typeof P=="number"?V=P:typeof P=="string"&&(V=Number.parseInt(P,10)),Number.isFinite(V)&&V>0?V:void 0}),d=n.computed(()=>r.locale?r.locale:"en-US"),u=n.computed(()=>r.prependInner?r.prependInner:r.currency==="USD"?"$":r.currency==="IDR"?"Rp":r.currency),f=n.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),h=P=>{const V=P.replaceAll(/\D/g,"");return V?Number(V):null},m=P=>f.value.format(P),p=n.ref(""),g=n.ref(null);n.watch(()=>r.modelValue,P=>{P==null?p.value="":h(p.value)!==P&&(p.value=m(P))},{immediate:!0});const y=(P,V)=>{let M=0;for(let z=0;z<V;z++)/\d/.test(P[z])&&M++;return M},x=(P,V)=>{let M=0;for(let z=0;z<P.length;z++)if(/\d/.test(P[z])&&(M++,M===V))return z+1;return P.length},_=P=>{const V=P.target,M=V.value,z=V.selectionStart??M.length,N=h(M);if(N===null){p.value="",a("update:modelValue",null);return}const v=m(N);if(M!==v){const T=y(M,z);p.value=v,n.nextTick(()=>{if(g.value){const R=x(v,T);g.value.setSelectionRange(R,R)}})}a("update:modelValue",N)},C=()=>{p.value="",a("update:modelValue",null),a("clear")},w=n.computed(()=>!r.clearable||r.disabled||r.readonly?!1:r.hideClearWhenEmpty?p.value.length>0:!0),E=n.computed(()=>!!r.error),B=n.computed(()=>{const{class:P,maxlength:V,maxLength:M,...z}=o;return z}),k=n.computed(()=>p.value.length),b=n.computed(()=>r.showCharCount?(c.value??0)>0:!1),A=n.computed(()=>b.value&&k.value>0),D=n.computed(()=>`${k.value} / ${c.value}`);return(P,V)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1.5 w-full",n.unref(o).class]),"aria-busy":r.skeleton},[r.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.label?(n.openBlock(),n.createElementBlock("div",$b)):n.createCommentVNode("",!0),V[2]||(V[2]=n.createElementVNode("div",{class:"relative w-full"},[n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),b.value?(n.openBlock(),n.createElementBlock("div",Wb,[...V[1]||(V[1]=[n.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[e.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[n.createTextVNode(n.toDisplayString(e.label)+" ",1),l.value?(n.openBlock(),n.createElementBlock("span",Ub,"*")):n.createCommentVNode("",!0)],8,jb)):n.createCommentVNode("",!0),n.createElementVNode("div",Hb,[n.createElementVNode("div",{class:n.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-900",E.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",r.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":""])},[n.createElementVNode("div",qb,[n.createElementVNode("span",Gb,n.toDisplayString(u.value),1)]),n.withDirectives(n.createElementVNode("input",n.mergeProps({id:i.value,ref_key:"inputRef",ref:g,"onUpdate:modelValue":V[0]||(V[0]=M=>p.value=M),onInput:_,type:"text",inputmode:"numeric"},B.value,{disabled:r.disabled,readonly:r.readonly,placeholder:r.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",w.value?"pr-8":""]}),null,16,Xb),[[n.vModelText,p.value]]),w.value?(n.openBlock(),n.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:C},[n.createVNode(n.unref(te.X),{class:"w-3.5 h-3.5"})])):n.createCommentVNode("",!0)],2),A.value&&!E.value?(n.openBlock(),n.createElementBlock("p",Yb,n.toDisplayString(D.value),1)):n.createCommentVNode("",!0)]),E.value?(n.openBlock(),n.createElementBlock("p",Kb,[n.createVNode(n.unref(te.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),n.createTextVNode(" "+n.toDisplayString(r.error),1)])):n.createCommentVNode("",!0)],64))],10,Lb))}}),Yc=6048e5,Jb=864e5,Kc=Symbol.for("constructDateFrom");function an(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Kc in e?e[Kc](t):e instanceof Date?new e.constructor(t):new Date(t)}function kt(e,t){return an(t||e,e)}let Qb={};function Ba(){return Qb}function Bo(e,t){var l,c,d,u;const o=Ba(),a=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.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,r=kt(e,t==null?void 0:t.in),s=r.getDay(),i=(s<a?7:0)+s-a;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function Ea(e,t){return Bo(e,{...t,weekStartsOn:1})}function Jc(e,t){const o=kt(e,t==null?void 0:t.in),a=o.getFullYear(),r=an(o,0);r.setFullYear(a+1,0,4),r.setHours(0,0,0,0);const s=Ea(r),i=an(o,0);i.setFullYear(a,0,4),i.setHours(0,0,0,0);const l=Ea(i);return o.getTime()>=s.getTime()?a+1:o.getTime()>=l.getTime()?a:a-1}function Qc(e){const t=kt(e),o=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return o.setUTCFullYear(t.getFullYear()),+e-+o}function Zb(e,...t){const o=an.bind(null,t.find(a=>typeof a=="object"));return t.map(o)}function Zc(e,t){const o=kt(e,t==null?void 0:t.in);return o.setHours(0,0,0,0),o}function ey(e,t,o){const[a,r]=Zb(o==null?void 0:o.in,e,t),s=Zc(a),i=Zc(r),l=+s-Qc(s),c=+i-Qc(i);return Math.round((l-c)/Jb)}function ty(e,t){const o=Jc(e,t),a=an(e,0);return a.setFullYear(o,0,4),a.setHours(0,0,0,0),Ea(a)}function ny(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function oy(e){return!(!ny(e)&&typeof e!="number"||isNaN(+kt(e)))}function ay(e,t){const o=kt(e,t==null?void 0:t.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}const ry={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"}},sy=(e,t,o)=>{let a;const r=ry[e];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+a:a+" ago":a};function Ln(e){return(t={})=>{const o=t.width?String(t.width):e.defaultWidth;return e.formats[o]||e.formats[e.defaultWidth]}}const iy={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ly={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},cy={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dy={date:Ln({formats:iy,defaultWidth:"full"}),time:Ln({formats:ly,defaultWidth:"full"}),dateTime:Ln({formats:cy,defaultWidth:"full"})},uy={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},fy=(e,t,o,a)=>uy[e];function Mt(e){return(t,o)=>{const a=o!=null&&o.context?String(o.context):"standalone";let r;if(a==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,l=o!=null&&o.width?String(o.width):i;r=e.formattingValues[l]||e.formattingValues[i]}else{const i=e.defaultWidth,l=o!=null&&o.width?String(o.width):e.defaultWidth;r=e.values[l]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}const hy={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},my={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},py={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"]},gy={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"]},by={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"}},yy={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"}},xy={ordinalNumber:(e,t)=>{const o=Number(e),a=o%100;if(a>20||a<10)switch(a%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},era:Mt({values:hy,defaultWidth:"wide"}),quarter:Mt({values:my,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Mt({values:py,defaultWidth:"wide"}),day:Mt({values:gy,defaultWidth:"wide"}),dayPeriod:Mt({values:by,defaultWidth:"wide",formattingValues:yy,defaultFormattingWidth:"wide"})};function Nt(e){return(t,o={})=>{const a=o.width,r=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const i=s[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?wy(l,f=>f.test(i)):ky(l,f=>f.test(i));let d;d=e.valueCallback?e.valueCallback(c):c,d=o.valueCallback?o.valueCallback(d):d;const u=t.slice(i.length);return{value:d,rest:u}}}function ky(e,t){for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t(e[o]))return o}function wy(e,t){for(let o=0;o<e.length;o++)if(t(e[o]))return o}function ed(e){return(t,o={})=>{const a=t.match(e.matchPattern);if(!a)return null;const r=a[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=o.valueCallback?o.valueCallback(i):i;const l=t.slice(r.length);return{value:i,rest:l}}}const Cy=/^(\d+)(th|st|nd|rd)?/i,_y=/\d+/i,By={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},Ey={any:[/^b/i,/^(a|c)/i]},Sy={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ay={any:[/1/i,/2/i,/3/i,/4/i]},Vy={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},Dy={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]},My={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},Ny={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]},Py={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},vy={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}},Ty={ordinalNumber:ed({matchPattern:Cy,parsePattern:_y,valueCallback:e=>parseInt(e,10)}),era:Nt({matchPatterns:By,defaultMatchWidth:"wide",parsePatterns:Ey,defaultParseWidth:"any"}),quarter:Nt({matchPatterns:Sy,defaultMatchWidth:"wide",parsePatterns:Ay,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Nt({matchPatterns:Vy,defaultMatchWidth:"wide",parsePatterns:Dy,defaultParseWidth:"any"}),day:Nt({matchPatterns:My,defaultMatchWidth:"wide",parsePatterns:Ny,defaultParseWidth:"any"}),dayPeriod:Nt({matchPatterns:Py,defaultMatchWidth:"any",parsePatterns:vy,defaultParseWidth:"any"})},td={code:"en-US",formatDistance:sy,formatLong:dy,formatRelative:fy,localize:xy,match:Ty,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Oy(e,t){const o=kt(e,t==null?void 0:t.in);return ey(o,ay(o))+1}function zy(e,t){const o=kt(e,t==null?void 0:t.in),a=+Ea(o)-+ty(o);return Math.round(a/Yc)+1}function nd(e,t){var u,f,h,m;const o=kt(e,t==null?void 0:t.in),a=o.getFullYear(),r=Ba(),s=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,i=an((t==null?void 0:t.in)||e,0);i.setFullYear(a+1,0,s),i.setHours(0,0,0,0);const l=Bo(i,t),c=an((t==null?void 0:t.in)||e,0);c.setFullYear(a,0,s),c.setHours(0,0,0,0);const d=Bo(c,t);return+o>=+l?a+1:+o>=+d?a:a-1}function Fy(e,t){var l,c,d,u;const o=Ba(),a=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.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,r=nd(e,t),s=an((t==null?void 0:t.in)||e,0);return s.setFullYear(r,0,a),s.setHours(0,0,0,0),Bo(s,t)}function Iy(e,t){const o=kt(e,t==null?void 0:t.in),a=+Bo(o,t)-+Fy(o,t);return Math.round(a/Yc)+1}function Pe(e,t){const o=e<0?"-":"",a=Math.abs(e).toString().padStart(t,"0");return o+a}const rn={y(e,t){const o=e.getFullYear(),a=o>0?o:1-o;return Pe(t==="yy"?a%100:a,t.length)},M(e,t){const o=e.getMonth();return t==="M"?String(o+1):Pe(o+1,2)},d(e,t){return Pe(e.getDate(),t.length)},a(e,t){const o=e.getHours()/12>=1?"pm":"am";switch(t){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(e,t){return Pe(e.getHours()%12||12,t.length)},H(e,t){return Pe(e.getHours(),t.length)},m(e,t){return Pe(e.getMinutes(),t.length)},s(e,t){return Pe(e.getSeconds(),t.length)},S(e,t){const o=t.length,a=e.getMilliseconds(),r=Math.trunc(a*Math.pow(10,o-3));return Pe(r,t.length)}},$n={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},od={G:function(e,t,o){const a=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return o.era(a,{width:"abbreviated"});case"GGGGG":return o.era(a,{width:"narrow"});case"GGGG":default:return o.era(a,{width:"wide"})}},y:function(e,t,o){if(t==="yo"){const a=e.getFullYear(),r=a>0?a:1-a;return o.ordinalNumber(r,{unit:"year"})}return rn.y(e,t)},Y:function(e,t,o,a){const r=nd(e,a),s=r>0?r:1-r;if(t==="YY"){const i=s%100;return Pe(i,2)}return t==="Yo"?o.ordinalNumber(s,{unit:"year"}):Pe(s,t.length)},R:function(e,t){const o=Jc(e);return Pe(o,t.length)},u:function(e,t){const o=e.getFullYear();return Pe(o,t.length)},Q:function(e,t,o){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return Pe(a,2);case"Qo":return o.ordinalNumber(a,{unit:"quarter"});case"QQQ":return o.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,o){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return Pe(a,2);case"qo":return o.ordinalNumber(a,{unit:"quarter"});case"qqq":return o.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,o){const a=e.getMonth();switch(t){case"M":case"MM":return rn.M(e,t);case"Mo":return o.ordinalNumber(a+1,{unit:"month"});case"MMM":return o.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,o){const a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return Pe(a+1,2);case"Lo":return o.ordinalNumber(a+1,{unit:"month"});case"LLL":return o.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,o,a){const r=Iy(e,a);return t==="wo"?o.ordinalNumber(r,{unit:"week"}):Pe(r,t.length)},I:function(e,t,o){const a=zy(e);return t==="Io"?o.ordinalNumber(a,{unit:"week"}):Pe(a,t.length)},d:function(e,t,o){return t==="do"?o.ordinalNumber(e.getDate(),{unit:"date"}):rn.d(e,t)},D:function(e,t,o){const a=Oy(e);return t==="Do"?o.ordinalNumber(a,{unit:"dayOfYear"}):Pe(a,t.length)},E:function(e,t,o){const a=e.getDay();switch(t){case"E":case"EE":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"})}},e:function(e,t,o,a){const r=e.getDay(),s=(r-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Pe(s,2);case"eo":return o.ordinalNumber(s,{unit:"day"});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"})}},c:function(e,t,o,a){const r=e.getDay(),s=(r-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Pe(s,t.length);case"co":return o.ordinalNumber(s,{unit:"day"});case"ccc":return o.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(r,{width:"narrow",context:"standalone"});case"cccccc":return o.day(r,{width:"short",context:"standalone"});case"cccc":default:return o.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,o){const a=e.getDay(),r=a===0?7:a;switch(t){case"i":return String(r);case"ii":return Pe(r,t.length);case"io":return o.ordinalNumber(r,{unit:"day"});case"iii":return o.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(a,{width:"short",context:"formatting"});case"iiii":default:return o.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,o){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,o){const a=e.getHours();let r;switch(a===12?r=$n.noon:a===0?r=$n.midnight:r=a/12>=1?"pm":"am",t){case"b":case"bb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,o){const a=e.getHours();let r;switch(a>=17?r=$n.evening:a>=12?r=$n.afternoon:a>=4?r=$n.morning:r=$n.night,t){case"B":case"BB":case"BBB":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,o){if(t==="ho"){let a=e.getHours()%12;return a===0&&(a=12),o.ordinalNumber(a,{unit:"hour"})}return rn.h(e,t)},H:function(e,t,o){return t==="Ho"?o.ordinalNumber(e.getHours(),{unit:"hour"}):rn.H(e,t)},K:function(e,t,o){const a=e.getHours()%12;return t==="Ko"?o.ordinalNumber(a,{unit:"hour"}):Pe(a,t.length)},k:function(e,t,o){let a=e.getHours();return a===0&&(a=24),t==="ko"?o.ordinalNumber(a,{unit:"hour"}):Pe(a,t.length)},m:function(e,t,o){return t==="mo"?o.ordinalNumber(e.getMinutes(),{unit:"minute"}):rn.m(e,t)},s:function(e,t,o){return t==="so"?o.ordinalNumber(e.getSeconds(),{unit:"second"}):rn.s(e,t)},S:function(e,t){return rn.S(e,t)},X:function(e,t,o){const a=e.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return rd(a);case"XXXX":case"XX":return En(a);case"XXXXX":case"XXX":default:return En(a,":")}},x:function(e,t,o){const a=e.getTimezoneOffset();switch(t){case"x":return rd(a);case"xxxx":case"xx":return En(a);case"xxxxx":case"xxx":default:return En(a,":")}},O:function(e,t,o){const a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ad(a,":");case"OOOO":default:return"GMT"+En(a,":")}},z:function(e,t,o){const a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ad(a,":");case"zzzz":default:return"GMT"+En(a,":")}},t:function(e,t,o){const a=Math.trunc(+e/1e3);return Pe(a,t.length)},T:function(e,t,o){return Pe(+e,t.length)}};function ad(e,t=""){const o=e>0?"-":"+",a=Math.abs(e),r=Math.trunc(a/60),s=a%60;return s===0?o+String(r):o+String(r)+t+Pe(s,2)}function rd(e,t){return e%60===0?(e>0?"-":"+")+Pe(Math.abs(e)/60,2):En(e,t)}function En(e,t=""){const o=e>0?"-":"+",a=Math.abs(e),r=Pe(Math.trunc(a/60),2),s=Pe(a%60,2);return o+r+t+s}const sd=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},id=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ry={p:id,P:(e,t)=>{const o=e.match(/(P+)(p+)?/)||[],a=o[1],r=o[2];if(!r)return sd(e,t);let s;switch(a){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",sd(a,t)).replace("{{time}}",id(r,t))}},Ly=/^D+$/,$y=/^Y+$/,Wy=["D","DD","YY","YYYY"];function jy(e){return Ly.test(e)}function Uy(e){return $y.test(e)}function Hy(e,t,o){const a=qy(e,t,o);if(console.warn(a),Wy.includes(e))throw new RangeError(a)}function qy(e,t,o){const a=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Gy=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Xy=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Yy=/^'([^]*?)'?$/,Ky=/''/g,Jy=/[a-zA-Z]/;function ld(e,t,o){var u,f,h,m;const a=Ba(),r=a.locale??td,s=a.firstWeekContainsDate??((f=(u=a.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,i=a.weekStartsOn??((m=(h=a.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=kt(e,o==null?void 0:o.in);if(!oy(l))throw new RangeError("Invalid time value");let c=t.match(Xy).map(p=>{const g=p[0];if(g==="p"||g==="P"){const y=Ry[g];return y(p,r.formatLong)}return p}).join("").match(Gy).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:Qy(p)};if(od[g])return{isToken:!0,value:p};if(g.match(Jy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:p}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:r};return c.map(p=>{if(!p.isToken)return p.value;const g=p.value;(Uy(g)||jy(g))&&Hy(g,t,String(e));const y=od[g[0]];return y(l,g,r.localize,d)}).join("")}function Qy(e){const t=e.match(Yy);return t?t[1].replace(Ky,"'"):e}const Zy={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"}},ex=(e,t,o)=>{let a;const r=Zy[e];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"dalam waktu "+a:a+" yang lalu":a},tx={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},nx={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},ox={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ax={date:Ln({formats:tx,defaultWidth:"full"}),time:Ln({formats:nx,defaultWidth:"full"}),dateTime:Ln({formats:ox,defaultWidth:"full"})},rx={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},sx=(e,t,o,a)=>rx[e],ix={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},lx={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},cx={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"]},dx={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"]},ux={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"}},fx={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"}},hx={ordinalNumber:(e,t)=>"ke-"+Number(e),era:Mt({values:ix,defaultWidth:"wide"}),quarter:Mt({values:lx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Mt({values:cx,defaultWidth:"wide"}),day:Mt({values:dx,defaultWidth:"wide"}),dayPeriod:Mt({values:ux,defaultWidth:"wide",formattingValues:fx,defaultFormattingWidth:"wide"})},mx=/^ke-(\d+)?/i,px=/\d+/i,gx={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},bx={any:[/^s/i,/^(m|e)/i]},yx={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},xx={any:[/1/i,/2/i,/3/i,/4/i]},kx={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},wx={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]},Cx={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},_x={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]},Bx={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},Ex={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}},Sx={ordinalNumber:ed({matchPattern:mx,parsePattern:px,valueCallback:e=>parseInt(e,10)}),era:Nt({matchPatterns:gx,defaultMatchWidth:"wide",parsePatterns:bx,defaultParseWidth:"any"}),quarter:Nt({matchPatterns:yx,defaultMatchWidth:"wide",parsePatterns:xx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Nt({matchPatterns:kx,defaultMatchWidth:"wide",parsePatterns:wx,defaultParseWidth:"any"}),day:Nt({matchPatterns:Cx,defaultMatchWidth:"wide",parsePatterns:_x,defaultParseWidth:"any"}),dayPeriod:Nt({matchPatterns:Bx,defaultMatchWidth:"any",parsePatterns:Ex,defaultParseWidth:"any"})},Ax={code:"id",formatDistance:ex,formatLong:ax,formatRelative:sx,localize:hx,match:Sx,options:{weekStartsOn:1,firstWeekContainsDate:1}},cd={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)"}}},dd="dcode-dp-theme-forced";function Vx(e,t=dd){const o=cd[e]??cd.primary,a=`
|
|
18
|
+
`):e}function ub(e,t){const{element:o,datasetIndex:a,index:r}=t,s=e.getDatasetMeta(a).controller,{label:i,value:l}=s.getLabelAndValue(r);return{chart:e,label:i,parsed:s.getParsed(r),raw:e.data.datasets[a].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:a,element:o}}function Tc(e,t){const o=e.chart.ctx,{body:a,footer:r,title:s}=e,{boxWidth:i,boxHeight:l}=t,c=nt(t.bodyFont),d=nt(t.titleFont),u=nt(t.footerFont),f=s.length,h=r.length,m=a.length,p=ht(t.padding);let b=p.height,g=0,x=a.reduce((w,E)=>w+E.before.length+E.lines.length+E.after.length,0);if(x+=e.beforeBody.length+e.afterBody.length,f&&(b+=f*d.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),x){const w=t.displayColors?Math.max(l,c.lineHeight):c.lineHeight;b+=m*w+(x-m)*c.lineHeight+(x-1)*t.bodySpacing}h&&(b+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let _=0;const C=function(w){g=Math.max(g,o.measureText(w).width+_)};return o.save(),o.font=d.string,Ne(e.title,C),o.font=c.string,Ne(e.beforeBody.concat(e.afterBody),C),_=t.displayColors?i+2+t.boxPadding:0,Ne(a,w=>{Ne(w.before,C),Ne(w.lines,C),Ne(w.after,C)}),_=0,o.font=u.string,Ne(e.footer,C),o.restore(),g+=p.width,{width:g,height:b}}function fb(e,t){const{y:o,height:a}=t;return o<a/2?"top":o>e.height-a/2?"bottom":"center"}function hb(e,t,o,a){const{x:r,width:s}=a,i=o.caretSize+o.caretPadding;if(e==="left"&&r+s+i>t.width||e==="right"&&r-s-i<0)return!0}function mb(e,t,o,a){const{x:r,width:s}=o,{width:i,chartArea:{left:l,right:c}}=e;let d="center";return a==="center"?d=r<=(l+c)/2?"left":"right":r<=s/2?d="left":r>=i-s/2&&(d="right"),hb(d,e,t,o)&&(d="center"),d}function Oc(e,t,o){const a=o.yAlign||t.yAlign||fb(e,o);return{xAlign:o.xAlign||t.xAlign||mb(e,t,o,a),yAlign:a}}function pb(e,t){let{x:o,width:a}=e;return t==="right"?o-=a:t==="center"&&(o-=a/2),o}function gb(e,t,o){let{y:a,height:r}=e;return t==="top"?a+=o:t==="bottom"?a-=r+o:a-=r/2,a}function zc(e,t,o,a){const{caretSize:r,caretPadding:s,cornerRadius:i}=e,{xAlign:l,yAlign:c}=o,d=r+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=vn(i);let p=pb(t,l);const b=gb(t,c,d);return c==="center"?l==="left"?p+=d:l==="right"&&(p-=d):l==="left"?p-=Math.max(u,h)+r:l==="right"&&(p+=Math.max(f,m)+r),{x:et(p,0,a.width-t.width),y:et(b,0,a.height-t.height)}}function ka(e,t,o){const a=ht(o.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-a.right:e.x+a.left}function Fc(e){return Dt([],jt(e))}function bb(e,t,o){return xn(e,{tooltip:t,tooltipItems:o,type:"tooltip"})}function Ic(e,t){const o=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return o?e.override(o):e}const Rc={beforeTitle:Ft,title(e){if(e.length>0){const t=e[0],o=t.chart.data.labels,a=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(a>0&&t.dataIndex<a)return o[t.dataIndex]}return""},afterTitle:Ft,beforeBody:Ft,beforeLabel:Ft,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const o=e.formattedValue;return De(o)||(t+=o),t},labelColor(e){const o=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.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(e){const o=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:Ft,afterBody:Ft,beforeFooter:Ft,footer:Ft,afterFooter:Ft};function rt(e,t,o,a){const r=e[t].call(o,a);return typeof r>"u"?Rc[t].call(o,a):r}class rs extends $t{constructor(t){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=t.chart,this.options=t.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(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const o=this.chart,a=this.options.setContext(this.getContext()),r=a.enabled&&o.options.animation&&a.animations,s=new Tl(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=bb(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,o){const{callbacks:a}=o,r=rt(a,"beforeTitle",this,t),s=rt(a,"title",this,t),i=rt(a,"afterTitle",this,t);let l=[];return l=Dt(l,jt(r)),l=Dt(l,jt(s)),l=Dt(l,jt(i)),l}getBeforeBody(t,o){return Fc(rt(o.callbacks,"beforeBody",this,t))}getBody(t,o){const{callbacks:a}=o,r=[];return Ne(t,s=>{const i={before:[],lines:[],after:[]},l=Ic(a,s);Dt(i.before,jt(rt(l,"beforeLabel",this,s))),Dt(i.lines,rt(l,"label",this,s)),Dt(i.after,jt(rt(l,"afterLabel",this,s))),r.push(i)}),r}getAfterBody(t,o){return Fc(rt(o.callbacks,"afterBody",this,t))}getFooter(t,o){const{callbacks:a}=o,r=rt(a,"beforeFooter",this,t),s=rt(a,"footer",this,t),i=rt(a,"afterFooter",this,t);let l=[];return l=Dt(l,jt(r)),l=Dt(l,jt(s)),l=Dt(l,jt(i)),l}_createItems(t){const o=this._active,a=this.chart.data,r=[],s=[],i=[];let l=[],c,d;for(c=0,d=o.length;c<d;++c)l.push(ub(this.chart,o[c]));return t.filter&&(l=l.filter((u,f,h)=>t.filter(u,f,h,a))),t.itemSort&&(l=l.sort((u,f)=>t.itemSort(u,f,a))),Ne(l,u=>{const f=Ic(t.callbacks,u);r.push(rt(f,"labelColor",this,u)),s.push(rt(f,"labelPointStyle",this,u)),i.push(rt(f,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(t,o){const a=this.options.setContext(this.getContext()),r=this._active;let s,i=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const l=Bo[a.position].call(this,r,this._eventPosition);i=this._createItems(a),this.title=this.getTitle(i,a),this.beforeBody=this.getBeforeBody(i,a),this.body=this.getBody(i,a),this.afterBody=this.getAfterBody(i,a),this.footer=this.getFooter(i,a);const c=this._size=Tc(this,a),d=Object.assign({},l,c),u=Oc(this.chart,a,d),f=zc(a,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),t&&a.external&&a.external.call(this,{chart:this.chart,tooltip:this,replay:o})}drawCaret(t,o,a,r){const s=this.getCaretPosition(t,a,r);o.lineTo(s.x1,s.y1),o.lineTo(s.x2,s.y2),o.lineTo(s.x3,s.y3)}getCaretPosition(t,o,a){const{xAlign:r,yAlign:s}=this,{caretSize:i,cornerRadius:l}=a,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=vn(l),{x:h,y:m}=t,{width:p,height:b}=o;let g,x,_,C,w,E;return s==="center"?(w=m+b/2,r==="left"?(g=h,x=g-i,C=w+i,E=w-i):(g=h+p,x=g+i,C=w-i,E=w+i),_=g):(r==="left"?x=h+Math.max(c,u)+i:r==="right"?x=h+p-Math.max(d,f)-i:x=this.caretX,s==="top"?(C=m,w=C-i,g=x-i,_=x+i):(C=m+b,w=C+i,g=x+i,_=x-i),E=C),{x1:g,x2:x,x3:_,y1:C,y2:w,y3:E}}drawTitle(t,o,a){const r=this.title,s=r.length;let i,l,c;if(s){const d=zn(a.rtl,this.x,this.width);for(t.x=ka(this,a.titleAlign,a),o.textAlign=d.textAlign(a.titleAlign),o.textBaseline="middle",i=nt(a.titleFont),l=a.titleSpacing,o.fillStyle=a.titleColor,o.font=i.string,c=0;c<s;++c)o.fillText(r[c],d.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+l,c+1===s&&(t.y+=a.titleMarginBottom-l)}}_drawColorBox(t,o,a,r,s){const i=this.labelColors[a],l=this.labelPointStyles[a],{boxHeight:c,boxWidth:d}=s,u=nt(s.bodyFont),f=ka(this,"left",s),h=r.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,p=o.y+m;if(s.usePointStyle){const b={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},g=r.leftForLtr(h,d)+d/2,x=p+c/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Or(t,b,g,x),t.strokeStyle=i.borderColor,t.fillStyle=i.backgroundColor,Or(t,b,g,x)}else{t.lineWidth=Be(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,t.strokeStyle=i.borderColor,t.setLineDash(i.borderDash||[]),t.lineDashOffset=i.borderDashOffset||0;const b=r.leftForLtr(h,d),g=r.leftForLtr(r.xPlus(h,1),d-2),x=vn(i.borderRadius);Object.values(x).some(_=>_!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,ea(t,{x:b,y:p,w:d,h:c,radius:x}),t.fill(),t.stroke(),t.fillStyle=i.backgroundColor,t.beginPath(),ea(t,{x:g,y:p+1,w:d-2,h:c-2,radius:x}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(b,p,d,c),t.strokeRect(b,p,d,c),t.fillStyle=i.backgroundColor,t.fillRect(g,p+1,d-2,c-2))}t.fillStyle=this.labelTextColors[a]}drawBody(t,o,a){const{body:r}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=a,f=nt(a.bodyFont);let h=f.lineHeight,m=0;const p=zn(a.rtl,this.x,this.width),b=function(y){o.fillText(y,p.x(t.x+m),t.y+h/2),t.y+=h+s},g=p.textAlign(i);let x,_,C,w,E,B,k;for(o.textAlign=i,o.textBaseline="middle",o.font=f.string,t.x=ka(this,g,a),o.fillStyle=a.bodyColor,Ne(this.beforeBody,b),m=l&&g!=="right"?i==="center"?d/2+u:d+2+u:0,w=0,B=r.length;w<B;++w){for(x=r[w],_=this.labelTextColors[w],o.fillStyle=_,Ne(x.before,b),C=x.lines,l&&C.length&&(this._drawColorBox(o,t,w,p,a),h=Math.max(f.lineHeight,c)),E=0,k=C.length;E<k;++E)b(C[E]),h=f.lineHeight;Ne(x.after,b)}m=0,h=f.lineHeight,Ne(this.afterBody,b),t.y-=s}drawFooter(t,o,a){const r=this.footer,s=r.length;let i,l;if(s){const c=zn(a.rtl,this.x,this.width);for(t.x=ka(this,a.footerAlign,a),t.y+=a.footerMarginTop,o.textAlign=c.textAlign(a.footerAlign),o.textBaseline="middle",i=nt(a.footerFont),o.fillStyle=a.footerColor,o.font=i.string,l=0;l<s;++l)o.fillText(r[l],c.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+a.footerSpacing}}drawBackground(t,o,a,r){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=t,{width:d,height:u}=a,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:p}=vn(r.cornerRadius);o.fillStyle=r.backgroundColor,o.strokeStyle=r.borderColor,o.lineWidth=r.borderWidth,o.beginPath(),o.moveTo(l+f,c),i==="top"&&this.drawCaret(t,o,a,r),o.lineTo(l+d-h,c),o.quadraticCurveTo(l+d,c,l+d,c+h),i==="center"&&s==="right"&&this.drawCaret(t,o,a,r),o.lineTo(l+d,c+u-p),o.quadraticCurveTo(l+d,c+u,l+d-p,c+u),i==="bottom"&&this.drawCaret(t,o,a,r),o.lineTo(l+m,c+u),o.quadraticCurveTo(l,c+u,l,c+u-m),i==="center"&&s==="left"&&this.drawCaret(t,o,a,r),o.lineTo(l,c+f),o.quadraticCurveTo(l,c,l+f,c),o.closePath(),o.fill(),r.borderWidth>0&&o.stroke()}_updateAnimationTarget(t){const o=this.chart,a=this.$animations,r=a&&a.x,s=a&&a.y;if(r||s){const i=Bo[t.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=Tc(this,t),c=Object.assign({},i,this._size),d=Oc(o,t,c),u=zc(t,c,d,o);(r._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(t){const o=this.options.setContext(this.getContext());let a=this.opacity;if(!a)return;this._updateAnimationTarget(o);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};a=Math.abs(a)<.001?0:a;const i=ht(o.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;o.enabled&&l&&(t.save(),t.globalAlpha=a,this.drawBackground(s,t,r,o),Bl(t,o.textDirection),s.y+=i.top,this.drawTitle(s,t,o),this.drawBody(s,t,o),this.drawFooter(s,t,o),El(t,o.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,o){const a=this._active,r=t.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=!Xo(a,r),i=this._positionChanged(r,o);(s||i)&&(this._active=r,this._eventPosition=o,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,o,a=!0){if(o&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],i=this._getActiveElements(t,s,o,a),l=this._positionChanged(i,t),c=o||!Xo(i,s)||l;return c&&(this._active=i,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,o))),c}_getActiveElements(t,o,a,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)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(t,s.mode,s,a);return s.reverse&&i.reverse(),i}_positionChanged(t,o){const{caretX:a,caretY:r,options:s}=this,i=Bo[s.position].call(this,t,o);return i!==!1&&(a!==i.x||r!==i.y)}}fe(rs,"positioners",Bo);var yb={id:"tooltip",_element:rs,positioners:Bo,afterInit(e,t,o){o&&(e.tooltip=new rs({chart:e,options:o}))},beforeUpdate(e,t,o){e.tooltip&&e.tooltip.initialize(o)},reset(e,t,o){e.tooltip&&e.tooltip.initialize(o)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const o={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...o,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",o)}},afterEvent(e,t){if(e.tooltip){const o=t.replay;e.tooltip.handleEvent(t.event,o,t.inChartArea)&&(t.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:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.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:Rc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const xb=(e,t,o,a)=>(typeof t=="string"?(o=e.push(t)-1,a.unshift({index:o,label:t})):isNaN(t)&&(o=null),o);function kb(e,t,o,a){const r=e.indexOf(t);if(r===-1)return xb(e,t,o,a);const s=e.lastIndexOf(t);return r!==s?o:r}const wb=(e,t)=>e===null?null:et(Math.round(e),0,t);function Lc(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class ss extends In{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const o=this._addedLabels;if(o.length){const a=this.getLabels();for(const{index:r,label:s}of o)a[r]===s&&a.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,o){if(De(t))return null;const a=this.getLabels();return o=isFinite(o)&&a[o]===t?o:kb(a,t,we(o,t),this._addedLabels),wb(o,a.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:o}=this.getUserBounds();let{min:a,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(a=0),o||(r=this.getLabels().length-1)),this.min=a,this.max=r}buildTicks(){const t=this.min,o=this.max,a=this.options.offset,r=[];let s=this.getLabels();s=t===0&&o===s.length-1?s:s.slice(t,o+1),this._valueRange=Math.max(s.length-(a?0:1),1),this._startValue=this.min-(a?.5:0);for(let i=t;i<=o;i++)r.push({value:i});return r}getLabelForValue(t){return Lc.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}fe(ss,"id","category"),fe(ss,"defaults",{ticks:{callback:Lc}});function Cb(e,t){const o=[],{bounds:r,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=e,m=s||1,p=u-1,{min:b,max:g}=t,x=!De(i),_=!De(l),C=!De(d),w=(g-b)/(f+1);let E=Qi((g-b)/p/m)*m,B,k,y,A;if(E<1e-14&&!x&&!_)return[{value:b},{value:g}];A=Math.ceil(g/E)-Math.floor(b/E),A>p&&(E=Qi(A*E/p/m)*m),De(c)||(B=Math.pow(10,c),E=Math.ceil(E*B)/B),r==="ticks"?(k=Math.floor(b/E)*E,y=Math.ceil(g/E)*E):(k=b,y=g),x&&_&&s&&Em((l-i)/s,E/1e3)?(A=Math.round(Math.min((l-i)/E,u)),E=(l-i)/A,k=i,y=l):C?(k=x?i:k,y=_?l:y,A=d-1,E=(y-k)/A):(A=(y-k)/E,lo(A,Math.round(A),E/1e3)?A=Math.round(A):A=Math.ceil(A));const D=Math.max(Zi(E),Zi(k));B=Math.pow(10,De(c)?D:c),k=Math.round(k*B)/B,y=Math.round(y*B)/B;let N=0;for(x&&(h&&k!==i?(o.push({value:i}),k<i&&N++,lo(Math.round((k+N*E)*B)/B,i,$c(i,w,e))&&N++):k<i&&N++);N<A;++N){const V=Math.round((k+N*E)*B)/B;if(_&&V>l)break;o.push({value:V})}return _&&h&&y!==l?o.length&&lo(o[o.length-1].value,l,$c(l,w,e))?o[o.length-1].value=l:o.push({value:l}):(!_||y===l)&&o.push({value:y}),o}function $c(e,t,{horizontal:o,minRotation:a}){const r=It(a),s=(o?Math.sin(r):Math.cos(r))||.001,i=.75*t*(""+e).length;return Math.min(t/s,i)}class _b extends In{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,o){return De(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:o,maxDefined:a}=this.getUserBounds();let{min:r,max:s}=this;const i=c=>r=o?r:c,l=c=>s=a?s:c;if(t){const c=At(r),d=At(s);c<0&&d<0?l(0):c>0&&d>0&&i(0)}if(r===s){let c=s===0?1:Math.abs(s*.05);l(s+c),t||i(r-c)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:o,stepSize:a}=t,r;return a?(r=Math.ceil(this.max/a)-Math.floor(this.min/a)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${a} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),o=o||11),o&&(r=Math.min(o,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,o=t.ticks;let a=this.getTickLimit();a=Math.max(2,a);const r={maxTicks:a,bounds:t.bounds,min:t.min,max:t.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=Cb(r,s);return t.bounds==="ticks"&&Sm(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let o=this.min,a=this.max;if(super.configure(),this.options.offset&&t.length){const r=(a-o)/Math.max(t.length-1,1)/2;o-=r,a+=r}this._startValue=o,this._endValue=a,this._valueRange=a-o}getLabelForValue(t){return Pr(t,this.chart.options.locale,this.options.ticks.format)}}class is extends _b{determineDataLimits(){const{min:t,max:o}=this.getMinMax(!0);this.min=Ze(t)?t:0,this.max=Ze(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),o=t?this.width:this.height,a=It(this.options.ticks.minRotation),r=(t?Math.sin(a):Math.cos(a))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}fe(is,"id","linear"),fe(is,"defaults",{ticks:{callback:dl.formatters.numeric}});const wa={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}},st=Object.keys(wa);function Wc(e,t){return e-t}function jc(e,t){if(De(t))return null;const o=e._adapter,{parser:a,round:r,isoWeekday:s}=e._parseOpts;let i=t;return typeof a=="function"&&(i=a(i)),Ze(i)||(i=typeof a=="string"?o.parse(i,a):o.parse(i)),i===null?null:(r&&(i=r==="week"&&(co(s)||s===!0)?o.startOf(i,"isoWeek",s):o.startOf(i,r)),+i)}function Uc(e,t,o,a){const r=st.length;for(let s=st.indexOf(e);s<r-1;++s){const i=wa[st[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((o-t)/(l*i.size))<=a)return st[s]}return st[r-1]}function Bb(e,t,o,a,r){for(let s=st.length-1;s>=st.indexOf(o);s--){const i=st[s];if(wa[i].common&&e._adapter.diff(r,a,i)>=t-1)return i}return st[o?st.indexOf(o):0]}function Eb(e){for(let t=st.indexOf(e)+1,o=st.length;t<o;++t)if(wa[st[t]].common)return st[t]}function Hc(e,t,o){if(!o)e[t]=!0;else if(o.length){const{lo:a,hi:r}=Vr(o,t),s=o[a]>=t?o[a]:o[r];e[s]=!0}}function Sb(e,t,o,a){const r=e._adapter,s=+r.startOf(t[0].value,a),i=t[t.length-1].value;let l,c;for(l=s;l<=i;l=+r.add(l,1,a))c=o[l],c>=0&&(t[c].major=!0);return t}function qc(e,t,o){const a=[],r={},s=t.length;let i,l;for(i=0;i<s;++i)l=t[i],r[l]=i,a.push({value:l,major:!1});return s===0||!o?a:Sb(e,a,r,o)}class Ca extends In{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,o={}){const a=t.time||(t.time={}),r=this._adapter=new lg._date(t.adapters.date);r.init(o),so(a.displayFormats,r.formats()),this._parseOpts={parser:a.parser,round:a.round,isoWeekday:a.isoWeekday},super.init(t),this._normalized=o.normalized}parse(t,o){return t===void 0?null:jc(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,o=this._adapter,a=t.time.unit||"day";let{min:r,max:s,minDefined:i,maxDefined:l}=this.getUserBounds();function c(d){!i&&!isNaN(d.min)&&(r=Math.min(r,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!i||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),r=Ze(r)&&!isNaN(r)?r:+o.startOf(Date.now(),a),s=Ze(s)&&!isNaN(s)?s:+o.endOf(Date.now(),a)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;return t.length&&(o=t[0],a=t[t.length-1]),{min:o,max:a}}buildTicks(){const t=this.options,o=t.time,a=t.ticks,r=a.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,i=this.max,l=Nm(r,s,i);return this._unit=o.unit||(a.autoSkip?Uc(o.minUnit,this.min,this.max,this._getLabelCapacity(s)):Bb(this,l.length,o.minUnit,this.min,this.max)),this._majorUnit=!a.major.enabled||this._unit==="year"?void 0:Eb(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),qc(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let o=0,a=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?o=1-r:o=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?a=s:a=(s-this.getDecimalForValue(t[t.length-2]))/2);const i=t.length<3?.5:.25;o=et(o,0,i),a=et(a,0,i),this._offsets={start:o,end:a,factor:1/(o+1+a)}}_generate(){const t=this._adapter,o=this.min,a=this.max,r=this.options,s=r.time,i=s.unit||Uc(s.minUnit,o,a,this._getLabelCapacity(o)),l=we(r.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=co(c)||c===!0,u={};let f=o,h,m;if(d&&(f=+t.startOf(f,"isoWeek",c)),f=+t.startOf(f,d?"day":i),t.diff(a,o,i)>1e5*l)throw new Error(o+" and "+a+" are too far apart with stepSize of "+l+" "+i);const p=r.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<a;h=+t.add(h,l,i),m++)Hc(u,h,p);return(h===a||r.bounds==="ticks"||m===1)&&Hc(u,h,p),Object.keys(u).sort(Wc).map(b=>+b)}getLabelForValue(t){const o=this._adapter,a=this.options.time;return a.tooltipFormat?o.format(t,a.tooltipFormat):o.format(t,a.displayFormats.datetime)}format(t,o){const r=this.options.time.displayFormats,s=this._unit,i=o||r[s];return this._adapter.format(t,i)}_tickFormatFunction(t,o,a,r){const s=this.options,i=s.ticks.callback;if(i)return Ie(i,[t,o,a],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=a[o],m=d&&f&&h&&h.major;return this._adapter.format(t,r||(m?f:u))}generateTickLabels(t){let o,a,r;for(o=0,a=t.length;o<a;++o)r=t[o],r.label=this._tickFormatFunction(r.value,o,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const o=this._offsets,a=this.getDecimalForValue(t);return this.getPixelForDecimal((o.start+a)*o.factor)}getValueForPixel(t){const o=this._offsets,a=this.getDecimalForPixel(t)/o.factor-o.end;return this.min+a*(this.max-this.min)}_getLabelSize(t){const o=this.options.ticks,a=this.ctx.measureText(t).width,r=It(this.isHorizontal()?o.maxRotation:o.minRotation),s=Math.cos(r),i=Math.sin(r),l=this._resolveTickFontOptions(0).size;return{w:a*s+l*i,h:a*i+l*s}}_getLabelCapacity(t){const o=this.options.time,a=o.displayFormats,r=a[o.unit]||a.millisecond,s=this._tickFormatFunction(t,0,qc(this,[t],this._majorUnit),r),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 t=this._cache.data||[],o,a;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(o=0,a=r.length;o<a;++o)t=t.concat(r[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let o,a;if(t.length)return t;const r=this.getLabels();for(o=0,a=r.length;o<a;++o)t.push(jc(this,r[o]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ol(t.sort(Wc))}}fe(Ca,"id","time"),fe(Ca,"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 _a(e,t,o){let a=0,r=e.length-1,s,i,l,c;o?(t>=e[a].pos&&t<=e[r].pos&&({lo:a,hi:r}=gn(e,"pos",t)),{pos:s,time:l}=e[a],{pos:i,time:c}=e[r]):(t>=e[a].time&&t<=e[r].time&&({lo:a,hi:r}=gn(e,"time",t)),{time:s,pos:l}=e[a],{time:i,pos:c}=e[r]);const d=i-s;return d?l+(c-l)*(t-s)/d:l}class Gc extends Ca{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(t);this._minPos=_a(o,this.min),this._tableRange=_a(o,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:o,max:a}=this,r=[],s=[];let i,l,c,d,u;for(i=0,l=t.length;i<l;++i)d=t[i],d>=o&&d<=a&&r.push(d);if(r.length<2)return[{time:o,pos:0},{time:a,pos:1}];for(i=0,l=r.length;i<l;++i)u=r[i+1],c=r[i-1],d=r[i],Math.round((u+c)/2)!==d&&s.push({time:d,pos:i/(l-1)});return s}_generate(){const t=this.min,o=this.max;let a=super.getDataTimestamps();return(!a.includes(t)||!a.length)&&a.splice(0,0,t),(!a.includes(o)||a.length===1)&&a.push(o),a.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const o=this.getDataTimestamps(),a=this.getLabelTimestamps();return o.length&&a.length?t=this.normalize(o.concat(a)):t=o.length?o:a,t=this._cache.all=t,t}getDecimalForValue(t){return(_a(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const o=this._offsets,a=this.getDecimalForPixel(t)/o.factor-o.end;return _a(this._table,a*this._tableRange+this._minPos,!0)}}fe(Gc,"id","timeseries"),fe(Gc,"defaults",Ca.defaults);const Ab={key:0,class:"mb-2 text-sm font-medium text-gray-700"},Vb={key:0,class:"text-red-500 ml-1"},Db={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},Mb={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},Nb={class:"text-red-600 text-sm"},Pb={key:1,class:"mt-2 text-xs text-gray-500"},vb={key:0},Xc=xt(n.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(e,{expose:t,emit:o}){Wt.register(ss,is,ba,tn,ya,_o,db,yb,lb,nb,ia,sa,qr,Fn);const a=e,r=o,s=n.ref(null),i=n.shallowRef(null),l=n.ref(null),c=n.computed(()=>({"opacity-50 pointer-events-none":a.loading||a.error})),d=()=>{const h=a.theme==="dark";return{responsive:a.responsive,maintainAspectRatio:a.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:m=>{let p=0;return m.type==="data"&&m.mode==="default"&&(p=m.dataIndex*100+m.datasetIndex*50),p},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:a.type!=="pie"&&a.type!=="doughnut"&&a.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,p)=>{const b=p%a.colors.length,g=a.colors[b];let x=m.backgroundColor,_=m.borderColor;return["pie","doughnut","polarArea"].includes(a.type)&&(!x||x.length===0)?m.data&&(x=m.data.map((C,w)=>a.colors[w%a.colors.length]+"80"),_=m.data.map((C,w)=>a.colors[w%a.colors.length])):(x=x||g+"40",_=_||g),{...m,borderColor:_,backgroundColor:x,pointBackgroundColor:m.pointBackgroundColor||g,pointBorderColor:m.pointBorderColor||g,hoverBackgroundColor:m.hoverBackgroundColor||g+"60",hoverBorderColor:m.hoverBorderColor||g}})},f=async()=>{if(!s.value)return;await n.nextTick(),i.value&&i.value.destroy();const h=a.data||a.modelValue;let m=h;if(Array.isArray(h))if(h.length>0&&typeof h[0]=="object"&&h[0]!==null){const b=Object.keys(h[0]),g=b.find(_=>["label","name","x","category","title"].includes(_.toLowerCase()))||b[0],x=b.find(_=>_!==g&&["value","y","count","amount","total","data"].includes(_.toLowerCase()))||b.find(_=>_!==g&&typeof h[0][_]=="number")||(b.length>1?b.find(_=>_!==g):b[0]);m={labels:h.map(_=>_[g||""]),datasets:[{label:a.label||"Data",data:h.map(_=>_[x||""])}]}}else h.length>0?m={labels:h.map((b,g)=>`Data ${g+1}`),datasets:[{label:a.label||"Data",data:h}]}:m={labels:[],datasets:[]};if(l.value=u(m),!l.value)return;const p={...d(),...a.options,onClick:(b,g)=>{r("click",b,g),a.onClick&&a.onClick(b,g)},onHover:(b,g)=>{r("hover",b,g),a.onHover&&a.onHover(b,g)}};i.value=new Wt(s.value,{type:a.type,data:l.value,options:p}),r("ready",i.value)};return n.watch(()=>[a.data,a.modelValue,a.type,a.options,a.theme],()=>{f()},{deep:!0}),n.watch(()=>[a.width,a.height],()=>{i.value&&i.value.resize()}),n.onMounted(()=>{f()}),n.onUnmounted(()=>{i.value&&i.value.destroy()}),t({chart:i,updateChart:f}),(h,m)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["d-code-chart",c.value])},[e.label?(n.openBlock(),n.createElementBlock("div",Ab,[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",Vb,"*")):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"relative",style:n.normalizeStyle({height:e.height+"px"})},[n.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),e.loading?(n.openBlock(),n.createElementBlock("div",Db,[...m[0]||(m[0]=[n.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):n.createCommentVNode("",!0),e.error?(n.openBlock(),n.createElementBlock("div",Mb,[n.createElementVNode("div",Nb,n.toDisplayString(e.error),1)])):n.createCommentVNode("",!0)],4),e.showInfo&&l.value?(n.openBlock(),n.createElementBlock("div",Pb,[l.value.datasets?(n.openBlock(),n.createElementBlock("div",vb,n.toDisplayString(l.value.datasets.length)+" dataset(s) • "+n.toDisplayString(l.value.labels?l.value.labels.length:0)+" data points ",1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1c7c58f"]]),Tb=["aria-busy"],Ob={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},zb={key:1,class:"flex items-center gap-2.5"},Fb=["id","checked","indeterminate","disabled","required"],Ib=["for"],Rb={key:0,class:"ml-1 text-red-500 dark:text-red-400","aria-label":"required"},on=xt(n.defineComponent({name:"DCodeCheckbox",inheritAttrs:!1,__name:"DCodeCheckbox",props:{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(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=n.computed(()=>o.label),i=n.computed(()=>o.placeholder),l=n.computed(()=>o.title),c=n.computed(()=>r.visible??!0),d=n.computed(()=>o.required===""||o.required===!0||o.required==="true"),u=Math.random().toString(36).slice(2,7),f=n.computed(()=>`dcode-checkbox-${o.id||s.value||"checkbox"}-${u}`),h=n.ref(!!r.modelValue);n.watch(()=>r.modelValue,b=>{h.value=!!b},{immediate:!0});const m=()=>{if(r.disabled)return;const b=!h.value;h.value=b,a("update:modelValue",b)},p=b=>{(b.key===" "||b.key==="Enter")&&(b.preventDefault(),m())};return(b,g)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["",[n.unref(o).class,{"opacity-60 cursor-not-allowed":e.disabled}]]),"aria-busy":e.skeleton},[e.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.value?(n.openBlock(),n.createElementBlock("div",Ob)):n.createCommentVNode("",!0),g[0]||(g[0]=n.createElementVNode("div",{class:"flex items-center gap-2.5"},[n.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),n.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(n.openBlock(),n.createElementBlock("div",zb,[n.createElementVNode("label",{class:n.normalizeClass(["flex items-start gap-2.5 group relative",{"cursor-pointer":!e.disabled,"opacity-50 cursor-not-allowed":e.disabled}])},[n.createElementVNode("input",{type:"checkbox",id:f.value,class:"sr-only peer",checked:h.value,indeterminate:e.indeterminate,disabled:e.disabled,required:d.value,onChange:m,onKeydown:p},null,40,Fb),n.createElementVNode("div",{class:n.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 mt-0.5",[h.value||e.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-900",e.disabled?"cursor-not-allowed":"cursor-pointer"]]),"aria-hidden":"true"},[h.value&&!e.indeterminate?(n.openBlock(),n.createBlock(n.unref(te.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):e.indeterminate?(n.openBlock(),n.createBlock(n.unref(te.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):n.createCommentVNode("",!0)],2),i.value||l.value?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass(["text-sm leading-relaxed select-none transition-colors",[e.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"]])},n.toDisplayString(i.value||l.value),3)):n.createCommentVNode("",!0)],2),s.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:f.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300 select-none cursor-pointer"},[n.createTextVNode(n.toDisplayString(s.value)+" ",1),d.value?(n.openBlock(),n.createElementBlock("span",Rb," * ")):n.createCommentVNode("",!0)],8,Ib)):n.createCommentVNode("",!0)]))],10,Tb)),[[n.vShow,c.value]])}}),[["__scopeId","data-v-fedb92bf"]]),Lb=["aria-busy"],$b={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Wb={key:1,class:"flex justify-end"},jb=["for"],Ub={key:0,class:"ml-1 text-destructive"},Hb={class:"relative w-full group"},qb={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700"},Gb={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},Xb=["id","disabled","readonly","placeholder","maxlength"],Yb={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"},Kb={key:1,class:"flex items-center gap-1 text-xs text-destructive"},ls=n.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(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=Math.random().toString(36).slice(2,7),i=n.computed(()=>`app-currency-field-${o.id||r.label||"currency-field"}-${s}`),l=n.computed(()=>{const N=o.required,V=o["aria-required"];return N===""||N===!0||N==="true"||(V==="true"||V===!0)}),c=n.computed(()=>{const N=o.maxlength??o.maxLength;let V=Number.NaN;return typeof N=="number"?V=N:typeof N=="string"&&(V=Number.parseInt(N,10)),Number.isFinite(V)&&V>0?V:void 0}),d=n.computed(()=>r.locale?r.locale:"en-US"),u=n.computed(()=>r.prependInner?r.prependInner:r.currency==="USD"?"$":r.currency==="IDR"?"Rp":r.currency),f=n.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),h=N=>{const V=N.replaceAll(/\D/g,"");return V?Number(V):null},m=N=>f.value.format(N),p=n.ref(""),b=n.ref(null);n.watch(()=>r.modelValue,N=>{N==null?p.value="":h(p.value)!==N&&(p.value=m(N))},{immediate:!0});const g=(N,V)=>{let M=0;for(let T=0;T<V;T++)/\d/.test(N[T])&&M++;return M},x=(N,V)=>{let M=0;for(let T=0;T<N.length;T++)if(/\d/.test(N[T])&&(M++,M===V))return T+1;return N.length},_=N=>{const V=N.target,M=V.value,T=V.selectionStart??M.length,U=h(M);if(U===null){p.value="",a("update:modelValue",null);return}const L=m(U);if(M!==L){const R=g(M,T);p.value=L,n.nextTick(()=>{if(b.value){const P=x(L,R);b.value.setSelectionRange(P,P)}})}a("update:modelValue",U)},C=()=>{p.value="",a("update:modelValue",null),a("clear")},w=n.computed(()=>!r.clearable||r.disabled||r.readonly?!1:r.hideClearWhenEmpty?p.value.length>0:!0),E=n.computed(()=>!!r.error),B=n.computed(()=>{const{class:N,maxlength:V,maxLength:M,...T}=o;return T}),k=n.computed(()=>p.value.length),y=n.computed(()=>r.showCharCount?(c.value??0)>0:!1),A=n.computed(()=>y.value&&k.value>0),D=n.computed(()=>`${k.value} / ${c.value}`);return(N,V)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1.5 w-full",n.unref(o).class]),"aria-busy":r.skeleton},[r.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.label?(n.openBlock(),n.createElementBlock("div",$b)):n.createCommentVNode("",!0),V[2]||(V[2]=n.createElementVNode("div",{class:"relative w-full"},[n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),y.value?(n.openBlock(),n.createElementBlock("div",Wb,[...V[1]||(V[1]=[n.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[e.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[n.createTextVNode(n.toDisplayString(e.label)+" ",1),l.value?(n.openBlock(),n.createElementBlock("span",Ub,"*")):n.createCommentVNode("",!0)],8,jb)):n.createCommentVNode("",!0),n.createElementVNode("div",Hb,[n.createElementVNode("div",{class:n.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-900",E.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",r.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":""])},[n.createElementVNode("div",qb,[n.createElementVNode("span",Gb,n.toDisplayString(u.value),1)]),n.withDirectives(n.createElementVNode("input",n.mergeProps({id:i.value,ref_key:"inputRef",ref:b,"onUpdate:modelValue":V[0]||(V[0]=M=>p.value=M),onInput:_,type:"text",inputmode:"numeric"},B.value,{disabled:r.disabled,readonly:r.readonly,placeholder:r.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",w.value?"pr-8":""]}),null,16,Xb),[[n.vModelText,p.value]]),w.value?(n.openBlock(),n.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:C},[n.createVNode(n.unref(te.X),{class:"w-3.5 h-3.5"})])):n.createCommentVNode("",!0)],2),A.value&&!E.value?(n.openBlock(),n.createElementBlock("p",Yb,n.toDisplayString(D.value),1)):n.createCommentVNode("",!0)]),E.value?(n.openBlock(),n.createElementBlock("p",Kb,[n.createVNode(n.unref(te.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),n.createTextVNode(" "+n.toDisplayString(r.error),1)])):n.createCommentVNode("",!0)],64))],10,Lb))}}),Yc=6048e5,Jb=864e5,Kc=Symbol.for("constructDateFrom");function an(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Kc in e?e[Kc](t):e instanceof Date?new e.constructor(t):new Date(t)}function kt(e,t){return an(t||e,e)}let Qb={};function Ba(){return Qb}function Eo(e,t){var l,c,d,u;const o=Ba(),a=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.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,r=kt(e,t==null?void 0:t.in),s=r.getDay(),i=(s<a?7:0)+s-a;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function Ea(e,t){return Eo(e,{...t,weekStartsOn:1})}function Jc(e,t){const o=kt(e,t==null?void 0:t.in),a=o.getFullYear(),r=an(o,0);r.setFullYear(a+1,0,4),r.setHours(0,0,0,0);const s=Ea(r),i=an(o,0);i.setFullYear(a,0,4),i.setHours(0,0,0,0);const l=Ea(i);return o.getTime()>=s.getTime()?a+1:o.getTime()>=l.getTime()?a:a-1}function Qc(e){const t=kt(e),o=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return o.setUTCFullYear(t.getFullYear()),+e-+o}function Zb(e,...t){const o=an.bind(null,t.find(a=>typeof a=="object"));return t.map(o)}function Zc(e,t){const o=kt(e,t==null?void 0:t.in);return o.setHours(0,0,0,0),o}function ey(e,t,o){const[a,r]=Zb(o==null?void 0:o.in,e,t),s=Zc(a),i=Zc(r),l=+s-Qc(s),c=+i-Qc(i);return Math.round((l-c)/Jb)}function ty(e,t){const o=Jc(e,t),a=an(e,0);return a.setFullYear(o,0,4),a.setHours(0,0,0,0),Ea(a)}function ny(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function oy(e){return!(!ny(e)&&typeof e!="number"||isNaN(+kt(e)))}function ay(e,t){const o=kt(e,t==null?void 0:t.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}const ry={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"}},sy=(e,t,o)=>{let a;const r=ry[e];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+a:a+" ago":a};function Ln(e){return(t={})=>{const o=t.width?String(t.width):e.defaultWidth;return e.formats[o]||e.formats[e.defaultWidth]}}const iy={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ly={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},cy={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dy={date:Ln({formats:iy,defaultWidth:"full"}),time:Ln({formats:ly,defaultWidth:"full"}),dateTime:Ln({formats:cy,defaultWidth:"full"})},uy={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},fy=(e,t,o,a)=>uy[e];function Mt(e){return(t,o)=>{const a=o!=null&&o.context?String(o.context):"standalone";let r;if(a==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,l=o!=null&&o.width?String(o.width):i;r=e.formattingValues[l]||e.formattingValues[i]}else{const i=e.defaultWidth,l=o!=null&&o.width?String(o.width):e.defaultWidth;r=e.values[l]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}const hy={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},my={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},py={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"]},gy={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"]},by={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"}},yy={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"}},xy={ordinalNumber:(e,t)=>{const o=Number(e),a=o%100;if(a>20||a<10)switch(a%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},era:Mt({values:hy,defaultWidth:"wide"}),quarter:Mt({values:my,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Mt({values:py,defaultWidth:"wide"}),day:Mt({values:gy,defaultWidth:"wide"}),dayPeriod:Mt({values:by,defaultWidth:"wide",formattingValues:yy,defaultFormattingWidth:"wide"})};function Nt(e){return(t,o={})=>{const a=o.width,r=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const i=s[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?wy(l,f=>f.test(i)):ky(l,f=>f.test(i));let d;d=e.valueCallback?e.valueCallback(c):c,d=o.valueCallback?o.valueCallback(d):d;const u=t.slice(i.length);return{value:d,rest:u}}}function ky(e,t){for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t(e[o]))return o}function wy(e,t){for(let o=0;o<e.length;o++)if(t(e[o]))return o}function ed(e){return(t,o={})=>{const a=t.match(e.matchPattern);if(!a)return null;const r=a[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=o.valueCallback?o.valueCallback(i):i;const l=t.slice(r.length);return{value:i,rest:l}}}const Cy=/^(\d+)(th|st|nd|rd)?/i,_y=/\d+/i,By={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},Ey={any:[/^b/i,/^(a|c)/i]},Sy={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ay={any:[/1/i,/2/i,/3/i,/4/i]},Vy={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},Dy={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]},My={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},Ny={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]},Py={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},vy={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}},Ty={ordinalNumber:ed({matchPattern:Cy,parsePattern:_y,valueCallback:e=>parseInt(e,10)}),era:Nt({matchPatterns:By,defaultMatchWidth:"wide",parsePatterns:Ey,defaultParseWidth:"any"}),quarter:Nt({matchPatterns:Sy,defaultMatchWidth:"wide",parsePatterns:Ay,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Nt({matchPatterns:Vy,defaultMatchWidth:"wide",parsePatterns:Dy,defaultParseWidth:"any"}),day:Nt({matchPatterns:My,defaultMatchWidth:"wide",parsePatterns:Ny,defaultParseWidth:"any"}),dayPeriod:Nt({matchPatterns:Py,defaultMatchWidth:"any",parsePatterns:vy,defaultParseWidth:"any"})},td={code:"en-US",formatDistance:sy,formatLong:dy,formatRelative:fy,localize:xy,match:Ty,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Oy(e,t){const o=kt(e,t==null?void 0:t.in);return ey(o,ay(o))+1}function zy(e,t){const o=kt(e,t==null?void 0:t.in),a=+Ea(o)-+ty(o);return Math.round(a/Yc)+1}function nd(e,t){var u,f,h,m;const o=kt(e,t==null?void 0:t.in),a=o.getFullYear(),r=Ba(),s=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,i=an((t==null?void 0:t.in)||e,0);i.setFullYear(a+1,0,s),i.setHours(0,0,0,0);const l=Eo(i,t),c=an((t==null?void 0:t.in)||e,0);c.setFullYear(a,0,s),c.setHours(0,0,0,0);const d=Eo(c,t);return+o>=+l?a+1:+o>=+d?a:a-1}function Fy(e,t){var l,c,d,u;const o=Ba(),a=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.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,r=nd(e,t),s=an((t==null?void 0:t.in)||e,0);return s.setFullYear(r,0,a),s.setHours(0,0,0,0),Eo(s,t)}function Iy(e,t){const o=kt(e,t==null?void 0:t.in),a=+Eo(o,t)-+Fy(o,t);return Math.round(a/Yc)+1}function ve(e,t){const o=e<0?"-":"",a=Math.abs(e).toString().padStart(t,"0");return o+a}const rn={y(e,t){const o=e.getFullYear(),a=o>0?o:1-o;return ve(t==="yy"?a%100:a,t.length)},M(e,t){const o=e.getMonth();return t==="M"?String(o+1):ve(o+1,2)},d(e,t){return ve(e.getDate(),t.length)},a(e,t){const o=e.getHours()/12>=1?"pm":"am";switch(t){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(e,t){return ve(e.getHours()%12||12,t.length)},H(e,t){return ve(e.getHours(),t.length)},m(e,t){return ve(e.getMinutes(),t.length)},s(e,t){return ve(e.getSeconds(),t.length)},S(e,t){const o=t.length,a=e.getMilliseconds(),r=Math.trunc(a*Math.pow(10,o-3));return ve(r,t.length)}},$n={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},od={G:function(e,t,o){const a=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return o.era(a,{width:"abbreviated"});case"GGGGG":return o.era(a,{width:"narrow"});case"GGGG":default:return o.era(a,{width:"wide"})}},y:function(e,t,o){if(t==="yo"){const a=e.getFullYear(),r=a>0?a:1-a;return o.ordinalNumber(r,{unit:"year"})}return rn.y(e,t)},Y:function(e,t,o,a){const r=nd(e,a),s=r>0?r:1-r;if(t==="YY"){const i=s%100;return ve(i,2)}return t==="Yo"?o.ordinalNumber(s,{unit:"year"}):ve(s,t.length)},R:function(e,t){const o=Jc(e);return ve(o,t.length)},u:function(e,t){const o=e.getFullYear();return ve(o,t.length)},Q:function(e,t,o){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return ve(a,2);case"Qo":return o.ordinalNumber(a,{unit:"quarter"});case"QQQ":return o.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,o){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return ve(a,2);case"qo":return o.ordinalNumber(a,{unit:"quarter"});case"qqq":return o.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,o){const a=e.getMonth();switch(t){case"M":case"MM":return rn.M(e,t);case"Mo":return o.ordinalNumber(a+1,{unit:"month"});case"MMM":return o.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,o){const a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return ve(a+1,2);case"Lo":return o.ordinalNumber(a+1,{unit:"month"});case"LLL":return o.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,o,a){const r=Iy(e,a);return t==="wo"?o.ordinalNumber(r,{unit:"week"}):ve(r,t.length)},I:function(e,t,o){const a=zy(e);return t==="Io"?o.ordinalNumber(a,{unit:"week"}):ve(a,t.length)},d:function(e,t,o){return t==="do"?o.ordinalNumber(e.getDate(),{unit:"date"}):rn.d(e,t)},D:function(e,t,o){const a=Oy(e);return t==="Do"?o.ordinalNumber(a,{unit:"dayOfYear"}):ve(a,t.length)},E:function(e,t,o){const a=e.getDay();switch(t){case"E":case"EE":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"})}},e:function(e,t,o,a){const r=e.getDay(),s=(r-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return ve(s,2);case"eo":return o.ordinalNumber(s,{unit:"day"});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"})}},c:function(e,t,o,a){const r=e.getDay(),s=(r-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return ve(s,t.length);case"co":return o.ordinalNumber(s,{unit:"day"});case"ccc":return o.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(r,{width:"narrow",context:"standalone"});case"cccccc":return o.day(r,{width:"short",context:"standalone"});case"cccc":default:return o.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,o){const a=e.getDay(),r=a===0?7:a;switch(t){case"i":return String(r);case"ii":return ve(r,t.length);case"io":return o.ordinalNumber(r,{unit:"day"});case"iii":return o.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(a,{width:"short",context:"formatting"});case"iiii":default:return o.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,o){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,o){const a=e.getHours();let r;switch(a===12?r=$n.noon:a===0?r=$n.midnight:r=a/12>=1?"pm":"am",t){case"b":case"bb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,o){const a=e.getHours();let r;switch(a>=17?r=$n.evening:a>=12?r=$n.afternoon:a>=4?r=$n.morning:r=$n.night,t){case"B":case"BB":case"BBB":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,o){if(t==="ho"){let a=e.getHours()%12;return a===0&&(a=12),o.ordinalNumber(a,{unit:"hour"})}return rn.h(e,t)},H:function(e,t,o){return t==="Ho"?o.ordinalNumber(e.getHours(),{unit:"hour"}):rn.H(e,t)},K:function(e,t,o){const a=e.getHours()%12;return t==="Ko"?o.ordinalNumber(a,{unit:"hour"}):ve(a,t.length)},k:function(e,t,o){let a=e.getHours();return a===0&&(a=24),t==="ko"?o.ordinalNumber(a,{unit:"hour"}):ve(a,t.length)},m:function(e,t,o){return t==="mo"?o.ordinalNumber(e.getMinutes(),{unit:"minute"}):rn.m(e,t)},s:function(e,t,o){return t==="so"?o.ordinalNumber(e.getSeconds(),{unit:"second"}):rn.s(e,t)},S:function(e,t){return rn.S(e,t)},X:function(e,t,o){const a=e.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return rd(a);case"XXXX":case"XX":return En(a);case"XXXXX":case"XXX":default:return En(a,":")}},x:function(e,t,o){const a=e.getTimezoneOffset();switch(t){case"x":return rd(a);case"xxxx":case"xx":return En(a);case"xxxxx":case"xxx":default:return En(a,":")}},O:function(e,t,o){const a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ad(a,":");case"OOOO":default:return"GMT"+En(a,":")}},z:function(e,t,o){const a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ad(a,":");case"zzzz":default:return"GMT"+En(a,":")}},t:function(e,t,o){const a=Math.trunc(+e/1e3);return ve(a,t.length)},T:function(e,t,o){return ve(+e,t.length)}};function ad(e,t=""){const o=e>0?"-":"+",a=Math.abs(e),r=Math.trunc(a/60),s=a%60;return s===0?o+String(r):o+String(r)+t+ve(s,2)}function rd(e,t){return e%60===0?(e>0?"-":"+")+ve(Math.abs(e)/60,2):En(e,t)}function En(e,t=""){const o=e>0?"-":"+",a=Math.abs(e),r=ve(Math.trunc(a/60),2),s=ve(a%60,2);return o+r+t+s}const sd=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},id=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ry={p:id,P:(e,t)=>{const o=e.match(/(P+)(p+)?/)||[],a=o[1],r=o[2];if(!r)return sd(e,t);let s;switch(a){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",sd(a,t)).replace("{{time}}",id(r,t))}},Ly=/^D+$/,$y=/^Y+$/,Wy=["D","DD","YY","YYYY"];function jy(e){return Ly.test(e)}function Uy(e){return $y.test(e)}function Hy(e,t,o){const a=qy(e,t,o);if(console.warn(a),Wy.includes(e))throw new RangeError(a)}function qy(e,t,o){const a=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Gy=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Xy=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Yy=/^'([^]*?)'?$/,Ky=/''/g,Jy=/[a-zA-Z]/;function ld(e,t,o){var u,f,h,m;const a=Ba(),r=a.locale??td,s=a.firstWeekContainsDate??((f=(u=a.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,i=a.weekStartsOn??((m=(h=a.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=kt(e,o==null?void 0:o.in);if(!oy(l))throw new RangeError("Invalid time value");let c=t.match(Xy).map(p=>{const b=p[0];if(b==="p"||b==="P"){const g=Ry[b];return g(p,r.formatLong)}return p}).join("").match(Gy).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const b=p[0];if(b==="'")return{isToken:!1,value:Qy(p)};if(od[b])return{isToken:!0,value:p};if(b.match(Jy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:p}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:r};return c.map(p=>{if(!p.isToken)return p.value;const b=p.value;(Uy(b)||jy(b))&&Hy(b,t,String(e));const g=od[b[0]];return g(l,b,r.localize,d)}).join("")}function Qy(e){const t=e.match(Yy);return t?t[1].replace(Ky,"'"):e}const Zy={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"}},ex=(e,t,o)=>{let a;const r=Zy[e];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"dalam waktu "+a:a+" yang lalu":a},tx={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},nx={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},ox={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ax={date:Ln({formats:tx,defaultWidth:"full"}),time:Ln({formats:nx,defaultWidth:"full"}),dateTime:Ln({formats:ox,defaultWidth:"full"})},rx={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},sx=(e,t,o,a)=>rx[e],ix={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},lx={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},cx={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"]},dx={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"]},ux={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"}},fx={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"}},hx={ordinalNumber:(e,t)=>"ke-"+Number(e),era:Mt({values:ix,defaultWidth:"wide"}),quarter:Mt({values:lx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Mt({values:cx,defaultWidth:"wide"}),day:Mt({values:dx,defaultWidth:"wide"}),dayPeriod:Mt({values:ux,defaultWidth:"wide",formattingValues:fx,defaultFormattingWidth:"wide"})},mx=/^ke-(\d+)?/i,px=/\d+/i,gx={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},bx={any:[/^s/i,/^(m|e)/i]},yx={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},xx={any:[/1/i,/2/i,/3/i,/4/i]},kx={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},wx={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]},Cx={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},_x={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]},Bx={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},Ex={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}},Sx={ordinalNumber:ed({matchPattern:mx,parsePattern:px,valueCallback:e=>parseInt(e,10)}),era:Nt({matchPatterns:gx,defaultMatchWidth:"wide",parsePatterns:bx,defaultParseWidth:"any"}),quarter:Nt({matchPatterns:yx,defaultMatchWidth:"wide",parsePatterns:xx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Nt({matchPatterns:kx,defaultMatchWidth:"wide",parsePatterns:wx,defaultParseWidth:"any"}),day:Nt({matchPatterns:Cx,defaultMatchWidth:"wide",parsePatterns:_x,defaultParseWidth:"any"}),dayPeriod:Nt({matchPatterns:Bx,defaultMatchWidth:"any",parsePatterns:Ex,defaultParseWidth:"any"})},Ax={code:"id",formatDistance:ex,formatLong:ax,formatRelative:sx,localize:hx,match:Sx,options:{weekStartsOn:1,firstWeekContainsDate:1}},cd={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)"}}},dd="dcode-dp-theme-forced";function Vx(e,t=dd){const o=cd[e]??cd.primary,a=`
|
|
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,7 +63,7 @@
|
|
|
63
63
|
.dcode-datepicker-menu .dp__menu_inner {
|
|
64
64
|
padding: 0 !important;
|
|
65
65
|
}
|
|
66
|
-
`.trim();let r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,document.head.appendChild(r)),r.textContent=a}function Dx(e,t=dd){n.watch(e,o=>Vx(o,t),{immediate:!0})}const Mx={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Nx=["for"],Px={key:0,class:"ml-1 text-destructive"},vx=["disabled","onClick"],Tx={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},Ox=["id","value","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],zx={class:"h-full p-2 flex flex-col gap-3 w-32"},Fx=["onClick"],Ix={class:"flex items-center justify-end gap-2 w-full p-2"},Rx=["disabled","onClick"],Lx={key:1,class:"text-xs text-destructive"},Sa=n.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(e,{emit:t}){const o=n.useAttrs(),a=e,r=t,s=Math.random().toString(36).slice(2,7),i=n.computed(()=>`dcode-datepicker-${o.id||a.label||"date-picker"}-${s}`),l=n.computed(()=>{const M=o.required,z=o["aria-required"];return M===""||M===!0||M==="true"||z==="true"||z===!0}),c=n.computed(()=>!!a.error),d=n.computed({get:()=>a.modelValue,set:M=>{r("update:modelValue",M),r("change",M)}}),u=n.computed(()=>a.locale==="en"?td:Ax),f=n.computed(()=>a.range?2:!1),h=n.computed(()=>{if(!a.range)return!1;const M={partialRange:!1};return a.autoRangeDays&&a.autoRangeDays>0&&(M.maxRange=a.autoRangeDays,M.autoRange=a.autoRangeDays),M}),m=M=>{const z=new Date(M);return z.setHours(0,0,0,0),z},p=M=>{const z=new Date(M);return z.setHours(23,59,59,999),z},g=(M,z)=>{const N=new Date(M);return N.setDate(N.getDate()+z),N},y=n.computed(()=>{if(a.disablePast)return m(new Date)}),x=n.computed(()=>{if(a.maxDaysAhead&&a.maxDaysAhead>0)return p(g(new Date,a.maxDaysAhead))}),_=n.ref(null),C=n.ref(null),w=M=>{C.value={month:M.month,year:M.year}},E=n.ref(!1);let B=null;n.onMounted(()=>{const M=document.documentElement,z=()=>E.value=M.classList.contains("dark");z(),B=new MutationObserver(z),B.observe(M,{attributes:!0,attributeFilter:["class"]})}),n.onBeforeUnmount(()=>{B==null||B.disconnect(),B=null}),Dx(n.toRef(a,"tone"));const k=M=>{const z=new Date(M),N=z.getDay(),v=z.getDate()-N+(N===0?-6:1);return z.setDate(v),m(z)},b=M=>{const z=k(M);return z.setDate(z.getDate()+6),p(z)},A=M=>{const z=new Date(M);return z.setDate(1),m(z)},D=M=>{const z=new Date(M);return z.setMonth(z.getMonth()+1),z.setDate(0),p(z)},P=n.computed(()=>{if(!a.range)return[];const M=new Date,z=m(M),N=k(M),v=b(M),T=A(M),R=D(M),H=(O,$)=>{let Y=O;a.disablePast&&Y<z&&(Y=z);let X=$;if(a.autoRangeDays&&a.autoRangeDays>0){const j=p(g(Y,a.autoRangeDays-1));X>j&&(X=j)}return X<Y&&(X=p(new Date(Y))),[Y,X]};return[{label:a.locale==="id"?"Minggu Ini":"This Week",range:H(N,v)},{label:a.locale==="id"?"Bulan Ini":"This Month",range:H(T,R)}]}),V=async M=>{var $,Y;const z=a.modelType||"yyyy-MM-dd";if(M.length===0){d.value=null;return}if(M.length<2)return;const N=ld(M[0],z),v=ld(M[1],z);d.value=[N,v],await n.nextTick();const T=M[0],R=T.getMonth(),H=T.getFullYear();C.value&&C.value.month===R&&C.value.year===H||($=_.value)==null||$.setMonthYear({month:R,year:H}),(Y=_.value)==null||Y.openMenu()};return(M,z)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1 w-full",n.unref(o).class])},[e.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.label?(n.openBlock(),n.createElementBlock("div",Mx)):n.createCommentVNode("",!0),z[2]||(z[2]=n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[e.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium"},[n.createTextVNode(n.toDisplayString(e.label)+" ",1),l.value?(n.openBlock(),n.createElementBlock("span",Px,"*")):n.createCommentVNode("",!0)],8,Nx)):n.createCommentVNode("",!0),n.createVNode(n.unref(Jd.VueDatePicker),{ref_key:"dpRef",ref:_,modelValue:d.value,"onUpdate:modelValue":z[1]||(z[1]=N=>d.value=N),dark:E.value,range:h.value,"multi-calendars":f.value,disabled:e.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":e.modelType,formats:{input:e.displayFormat},"min-date":y.value,"max-date":x.value,"preset-ranges":P.value,floating:{placement:e.placement,offset:8,arrow:!1,flip:!1,shift:!0},teleport:!0,"menu-class-name":"dcode-datepicker-menu","calendar-class-name":"dcode-datepicker-calendar",onUpdateMonthYear:w},n.createSlots({"dp-input":n.withCtx(({value:N,onInput:v,onEnter:T,onTab:R,onBlur:H,onFocus:O,onKeypress:$,onPaste:Y,toggleMenu:X})=>[n.createElementVNode("div",{class:n.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 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":"",e.disabled?"opacity-50 cursor-not-allowed":""]])},[n.createElementVNode("button",{type:"button",tabindex:"-1",disabled:e.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:j=>X()},[n.createVNode(n.unref(te.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,vx),z[4]||(z[4]=n.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),e.prependInner?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("span",Tx,n.toDisplayString(e.prependInner),1),z[3]||(z[3]=n.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):n.createCommentVNode("",!0),n.createElementVNode("input",{id:i.value,value:N,placeholder:e.placeholder,disabled:e.disabled,autocomplete:"off",readonly:"",class:n.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",e.disabled?"cursor-not-allowed":"cursor-pointer"]),onClick:j=>X(),onFocus:j=>O(),onBlur:j=>H(),onInput:j=>v(j),onKeydown:[n.withKeys(j=>T(j),["enter"]),n.withKeys(j=>R(j),["tab"])],onKeypress:j=>$(j),onPaste:j=>Y()},null,42,Ox)],2)]),"action-buttons":n.withCtx(({selectDate:N,selectionDisabled:v})=>[n.createElementVNode("div",Ix,[n.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:z[0]||(z[0]=T=>{var R;return(R=_.value)==null?void 0:R.closeMenu()})},n.toDisplayString(e.cancelLabel),1),n.createElementVNode("button",{type:"button",disabled:v,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:T=>N()},n.toDisplayString(e.selectLabel),9,Rx)])]),_:2},[e.range?{name:"left-sidebar",fn:n.withCtx(()=>[n.createElementVNode("div",zx,[P.value.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(P.value,N=>(n.openBlock(),n.createElementBlock("button",{key:N.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:v=>V(N.range)},n.toDisplayString(N.label),9,Fx))),128)):n.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?(n.openBlock(),n.createElementBlock("p",Lx,n.toDisplayString(a.error),1)):n.createCommentVNode("",!0)],64))],2))}}),$x=n.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const o=e,a=t,r=ie.useForwardPropsEmits(o,a);return(s,i)=>(n.openBlock(),n.createBlock(n.unref(ie.DialogRoot),n.normalizeProps(n.guardReactiveProps(n.unref(r))),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16))}}),Wx=n.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(e,{emit:t}){const o=e,a=t,r=ze.reactiveOmit(o,"class"),s=ie.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(ie.DialogPortal),null,{default:n.withCtx(()=>[n.createVNode(n.unref(ie.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"}),n.createVNode(n.unref(ie.DialogContent),n.mergeProps({...n.unref(s),...i.$attrs},{class:n.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:n.withCtx(()=>[n.renderSlot(i.$slots,"default"),n.createVNode(n.unref(ie.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:n.withCtx(()=>[n.createVNode(n.unref(te.X),{class:"w-4 h-4"}),l[0]||(l[0]=n.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),jx=n.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=ze.reactiveOmit(t,"class"),a=ie.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ie.DialogDescription),n.mergeProps(n.unref(a),{class:n.unref(we)("text-sm text-muted-foreground",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Ux=n.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=ze.reactiveOmit(t,"class"),a=ie.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ie.DialogTitle),n.mergeProps(n.unref(a),{class:n.unref(we)("text-lg font-medium leading-none tracking-tight",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Hx={key:0,class:"px-6 py-4 flex items-center justify-between border-b border-neutral-200 dark:border-neutral-800 bg-white/80 dark:bg-neutral-900/80 backdrop-blur-md sticky top-0 z-20"},qx={class:"flex items-center gap-3"},Gx={class:"flex flex-col"},Xx={key:0,class:"flex items-center gap-2"},Yx={key:1,class:"px-6 py-4 border-t border-neutral-200 dark:border-neutral-800 bg-neutral-50/50 dark:bg-neutral-900/50 sticky bottom-0 z-20"},Kx={class:"flex justify-end gap-3 flex-wrap"},Eo=xt(n.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(e,{emit:t}){const o=e,a=t,r=n.useAttrs(),s=n.computed(()=>{const{style:d,...u}=r;return u}),i=n.computed(()=>({maxWidth:typeof o.maxWidth=="number"?`${o.maxWidth}px`:o.maxWidth,width:"100%"})),l=n.computed(()=>o.icon?Ct[o.icon]??null:null),c=d=>{a("update:modelValue",d)};return(d,u)=>(n.openBlock(),n.createBlock(n.unref($x),{open:e.modelValue,"onUpdate:open":c},{default:n.withCtx(()=>[n.createVNode(n.unref(Wx),n.mergeProps(s.value,{style:i.value,class:"p-0 overflow-hidden rounded-xl flex flex-col max-h-[90vh] bg-white dark:bg-neutral-950 border-0",onInteractOutside:u[0]||(u[0]=f=>e.persistent?f.preventDefault():null),onEscapeKeyDown:u[1]||(u[1]=f=>e.persistent?f.preventDefault():null)}),{default:n.withCtx(()=>[e.title||d.$slots["header-append"]?(n.openBlock(),n.createElementBlock("div",Hx,[n.createElementVNode("div",qx,[l.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["p-2 rounded-lg",e.iconClass||"bg-primary/10 text-primary"])},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.value),{class:"h-5 w-5"}))],2)):n.createCommentVNode("",!0),n.createElementVNode("div",Gx,[n.createVNode(n.unref(Ux),{class:"text-lg font-bold text-neutral-900 dark:text-neutral-50 leading-tight"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1}),n.createVNode(n.unref(jx),{class:"hidden"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title||"Dialog Content"),1)]),_:1})])]),d.$slots["header-append"]?(n.openBlock(),n.createElementBlock("div",Xx,[n.renderSlot(d.$slots,"header-append",{},void 0,!0)])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["flex-1 overflow-y-auto custom-scrollbar",e.contentClass]),style:n.normalizeStyle(e.contentStyle)},[n.renderSlot(d.$slots,"default",{},void 0,!0)],6),d.$slots.actions?(n.openBlock(),n.createElementBlock("div",Yx,[n.createElementVNode("div",Kx,[n.renderSlot(d.$slots,"actions",{},void 0,!0)])])):n.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-ca4cb507"]]),ud=n.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(e){const t=e,o=n.computed(()=>Ct[t.icon]??Ct.X);return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ut),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(o.value),{size:Number(e.iconSize)},null,8,["size"]))]),_:1}))}}),Jx=n.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(we)(n.unref(Zx)({variant:e.variant}),t.class)),role:"alert"},[n.renderSlot(o.$slots,"default")],2))}}),Qx=n.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(we)("text-sm [&_p]:leading-relaxed",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),Zx=eo("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"}}),Wn=n.defineComponent({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(we)(n.unref(ek)({variant:e.variant}),t.class))},[n.renderSlot(o.$slots,"default")],2))}}),ek=eo("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"}}),cs=n.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(we)("rounded-xl border bg-card text-card-foreground shadow",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),ds=n.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(we)("p-6 pt-0",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),us=n.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(we)("flex flex-col gap-y-1.5 p-6",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),fs=n.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("h3",{class:n.normalizeClass(n.unref(we)("font-medium leading-none tracking-tight",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),tk={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},nk={class:"flex flex-wrap items-center justify-center gap-2"},ok=["accept","multiple"],Aa=xt(n.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(e,{emit:t}){const o=e,a=t,r=n.ref(null),s=n.ref(!1),i=n.ref(null),l=n.ref(null),c=n.ref(null);n.computed(()=>o.accept||"file/*");const d=n.computed(()=>o.error??i.value);function u(){var k;o.disabled||(k=r.value)==null||k.click()}function f(k){const b=k/1024,A=b/1024;return A>=1?`${A.toFixed(2)} MB`:b>=1?`${b.toFixed(1)} KB`:`${k} B`}function h(k){var A;if(!k)return"File tidak valid";if((A=o.accept)!=null&&A.includes("image/")&&!k.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const b=(o.maxSizeMb??2)*1024*1024;return k.size>b?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null}function m(k){l.value=k.name,c.value=k.size}function p(k){if(i.value=null,!k.length)return;if(o.mode==="single"){const A=k[0],D=h(A);if(D){i.value=D,a("error",D);return}o.showSelected&&m(A),a("picked",A);return}const b=[];for(const A of k){const D=h(A);if(D){i.value=D,a("error",D);return}b.push(A)}b.length&&(o.showSelected&&m(b[0]),a("picked:multiple",b))}function g(k){const b=k.target,A=Array.from(b.files??[]);p(A),b.value=""}function y(){o.disabled||(s.value=!0)}function x(){o.disabled||(s.value=!0)}function _(){s.value=!1}function C(k){var D,P;if(o.disabled)return;s.value=!1;const b=Array.from(((D=k.dataTransfer)==null?void 0:D.files)??[]),A=(P=o.accept)!=null&&P.includes("image/")?b.filter(V=>V.type.startsWith("image/")):b;p(A)}const w=n.computed(()=>(o.accept||"file/*").split(",").map(k=>k.trim()).filter(Boolean).map(k=>k==="image/*"?"IMAGE":k.replace(/^image\//,"").replace(/^\./,"")).join(", "));n.computed(()=>`${o.maxSizeMb??0}MB`);const E=n.ref(!1),B=n.computed(()=>{if(o.disabled||!E.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,b)=>(n.openBlock(),n.createBlock(n.unref(cs),{class:n.normalizeClass([e.disabled?"opacity-60":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:n.withCtx(()=>[n.createVNode(n.unref(us),{class:"pb-2"},{default:n.withCtx(()=>[n.createVNode(n.unref(fs),{class:"text-sm font-semibold dark:text-neutral-100"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label),1)]),_:1})]),_:1}),n.createVNode(n.unref(ds),{class:"pt-2"},{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.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",e.disabled?"is-disabled":""]]),style:n.normalizeStyle([{minHeight:"190px"},B.value]),onClick:u,onDragenter:n.withModifiers(y,["prevent"]),onDragover:n.withModifiers(x,["prevent"]),onDragleave:n.withModifiers(_,["prevent"]),onDrop:n.withModifiers(C,["prevent"]),onMouseenter:b[0]||(b[0]=A=>E.value=!0),onMouseleave:b[1]||(b[1]=A=>E.value=!1)},[n.createElementVNode("div",tk,[b[2]||(b[2]=n.createElementVNode("div",{class:"text-sm font-medium dark:text-neutral-200"},"Drag & drop file di sini",-1)),b[3]||(b[3]=n.createElementVNode("div",{class:"text-xs text-muted-foreground dark:text-neutral-400"},"atau klik area ini untuk memilih file",-1)),n.createElementVNode("div",nk,[n.createVNode(n.unref(Wn),{variant:"secondary",class:"text-[11px] dark:bg-neutral-700 dark:text-neutral-300"},{default:n.withCtx(()=>[n.createTextVNode(" Allowed: "+n.toDisplayString(w.value),1)]),_:1}),n.createVNode(n.unref(Wn),{variant:"secondary",class:"text-[11px] dark:bg-neutral-700 dark:text-neutral-300"},{default:n.withCtx(()=>[n.createTextVNode(" Max: "+n.toDisplayString(o.maxSizeMb)+"MB ",1)]),_:1})]),e.showSelected&&l.value?(n.openBlock(),n.createBlock(n.unref(Wn),{key:0,variant:"secondary",class:"mt-2 dark:bg-neutral-700 dark:text-neutral-300"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(l.value)+" • "+n.toDisplayString(c.value?f(c.value):""),1)]),_:1})):n.createCommentVNode("",!0)]),n.createElementVNode("input",{ref_key:"fileInputEl",ref:r,type:"file",class:"hidden",accept:e.accept,multiple:e.mode==="multiple",onChange:g},null,40,ok)],38),d.value?(n.openBlock(),n.createBlock(n.unref(Jx),{key:0,variant:"destructive",class:"mt-3"},{default:n.withCtx(()=>[n.createVNode(n.unref(Qx),{class:"text-sm"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(d.value),1)]),_:1})]),_:1})):n.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"]))}}),[["__scopeId","data-v-02ca61c0"]]),ak={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},rk=["src"],sk={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"},ik={class:"space-y-0.5"},lk={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},ck={class:"text-xs opacity-70"},dk=["disabled"],uk={key:1},fk=["disabled"],hk={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},mk={class:"flex gap-2"},pk={class:"font-medium truncate"},gk={class:"flex gap-2"},bk={class:"font-medium"},yk={class:"flex gap-2"},xk={class:"font-medium truncate"},hs=xt(n.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(e,{emit:t}){const o=e,a=t,r=n.ref(null),s=n.computed(()=>o.forceFileIcon||!o.file?!1:(o.file.type||"").startsWith("image/"));n.watch(()=>o.file,m=>{r.value&&URL.revokeObjectURL(r.value),r.value=m?URL.createObjectURL(m):null},{immediate:!0}),n.onBeforeUnmount(()=>{r.value&&URL.revokeObjectURL(r.value),u&&u.disconnect()});function i(m){const p=m/1024,g=p/1024;return g>=1?`${g.toFixed(2)} MB`:p>=1?`${p.toFixed(1)} KB`:`${m} B`}const l=n.computed(()=>o.file?{name:o.file.name,size:i(o.file.size),type:o.file.type||"unknown"}:null),c=n.ref(!1),d=n.ref(!1);let u=null;const f=()=>{typeof document<"u"&&(d.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};n.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=n.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,p)=>e.file?(n.openBlock(),n.createBlock(cs,{key:0,class:n.normalizeClass([e.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:n.withCtx(()=>[n.createVNode(us,{class:"pb-2"},{default:n.withCtx(()=>[n.createVNode(fs,{class:"text-sm font-semibold dark:text-neutral-100"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1}),e.description?(n.openBlock(),n.createElementBlock("div",ak,n.toDisplayString(e.description),1)):n.createCommentVNode("",!0)]),_:1}),n.createVNode(ds,{class:"pt-2"},{default:n.withCtx(()=>{var g,y,x,_,C;return[n.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-800/50 border-border dark:border-neutral-700 w-full",style:n.normalizeStyle([{height:`${e.previewHeight}px`},h.value]),onMouseenter:p[2]||(p[2]=w=>c.value=!0),onMouseleave:p[3]||(p[3]=w=>c.value=!1)},[s.value&&r.value?(n.openBlock(),n.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,rk)):(n.openBlock(),n.createElementBlock("div",sk,[n.createVNode(n.unref(te.FileText),{class:"w-10 h-10"}),n.createElementVNode("div",ik,[n.createElementVNode("p",lk,n.toDisplayString((g=l.value)==null?void 0:g.name),1),n.createElementVNode("p",ck,n.toDisplayString((y=l.value)==null?void 0:y.size),1)])])),n.createElementVNode("div",{class:"d-action-buttons",style:n.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"})},[e.showEdit&&s.value?(n.openBlock(),n.createElementBlock("button",{key:0,disabled:e.disabled,class:"d-action-btn shadow-md",style:n.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:e.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:p[0]||(p[0]=w=>a("edit"))},[n.createVNode(n.unref(te.Pencil),{style:{width:"16px",height:"16px"}})],12,dk)):(n.openBlock(),n.createElementBlock("div",uk)),e.showRemove?(n.openBlock(),n.createElementBlock("button",{key:2,disabled:e.disabled,class:"d-action-btn shadow-md",style:n.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:e.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:p[1]||(p[1]=w=>a("remove"))},[n.createVNode(n.unref(te.Trash2),{style:{width:"16px",height:"16px"}})],12,fk)):n.createCommentVNode("",!0)],4),n.createElementVNode("div",{class:"d-metadata-overlay",style:n.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"})},[n.createElementVNode("div",hk,[n.createElementVNode("div",mk,[p[4]||(p[4]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),n.createElementVNode("span",pk,n.toDisplayString((x=l.value)==null?void 0:x.name),1)]),n.createElementVNode("div",gk,[p[5]||(p[5]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),n.createElementVNode("span",bk,n.toDisplayString((_=l.value)==null?void 0:_.size),1)]),n.createElementVNode("div",yk,[p[6]||(p[6]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),n.createElementVNode("span",xk,n.toDisplayString((C=l.value)==null?void 0:C.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-4f5c1d5e"]]);function ms(){const e=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:e,success:(s,i)=>e({type:"success",message:s,title:i}),error:(s,i)=>e({type:"error",message:s,title:i}),warning:(s,i)=>e({type:"warning",message:s,title:i}),info:(s,i)=>e({type:"info",message:s,title:i})}}const kk={class:"space-y-3"},wk={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"},fd=n.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(e,{emit:t}){const o=e,a=t,r=n.computed({get:()=>o.modelValue,set:B=>a("update:modelValue",B)}),s=n.ref(null),i=n.ref(null);function l(B){i.value=B,a("error",B)}function c(){i.value=null}const d=n.computed(()=>{const B=(o.allowedTypes??"").trim();return B?B.split(/[,\s;]+/g).map(b=>b.trim().toLowerCase()).filter(Boolean).map(b=>b.includes("/")||b.startsWith(".")?b:`.${b}`):[]});function u(B){const k=B.lastIndexOf(".");return k>=0?B.slice(k).toLowerCase():""}const f=n.computed(()=>{if(d.value.length){const B=d.value.filter(b=>b.startsWith("."));return[...d.value.filter(b=>b.includes("/")),...B].join(",")}return o.accept}),h=n.computed(()=>d.value.length?d.value.join(", "):o.accept||"Semua File");function m(B){if(d.value.length){const k=(B.type||"").toLowerCase(),b=u(B.name);return d.value.some(A=>A.includes("/")?k===A:A.startsWith(".")?b===A:b===`.${A}`)}if(o.accept){if(o.accept==="*/*")return!0;const k=o.accept.split(",").map(D=>D.trim().toLowerCase()),b=(B.type||"").toLowerCase(),A=u(B.name);return k.some(D=>{if(D.endsWith("/*")){const P=D.slice(0,-2);return b.startsWith(P)}return D.startsWith(".")?A===D:b===D})}return!0}function p(B){return B*1024*1024}async function g(B){return B?m(B)?o.minSizeMb!=null&&B.size<p(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&B.size>p(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${h.value}`:"File tidak valid"}const{DCodeApi:y}=Je(),x=ms(),_=n.ref(!1);async function C(B){var k;if(o.uploadFn){try{_.value=!0;const b=await o.uploadFn(B);r.value=B,a("uploaded",b)}catch(b){console.error("Upload Error",b),x.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{_.value=!1}return}if(!((k=o.endpoint)!=null&&k.apiUrl)){r.value=B;return}if(typeof y!="function"){l("useApi() must expose DCodeApi()");return}try{_.value=!0;const b=new FormData;b.append("doc",B);const A=(o.endpoint.apiMethod||"POST").toUpperCase(),D=o.endpoint.apiUrl,P=await y("","",b,{_url:D,_method:A,withCredentials:!0,transformRequest:[(M,z)=>(z&&(delete z["Content-Type"],delete z["content-type"]),M)]}),V=(P==null?void 0:P.data)??P;r.value=B,a("uploaded",V)}catch(b){console.error("Upload Error",b),x.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{_.value=!1}}async function w(B){var b;if(o.disabled)return;c();const k=await g(B);if(k){l(k);return}s.value=B,o.uploadFn||(b=o.endpoint)!=null&&b.apiUrl?await C(B):r.value=B}function E(){c(),r.value=null,s.value=null}return n.watch(()=>o.modelValue,B=>{B&&!s.value&&(s.value=B),B||(s.value=null)},{immediate:!0}),(B,k)=>(n.openBlock(),n.createElementBlock("div",kk,[r.value?_.value?(n.openBlock(),n.createElementBlock("div",wk,[...k[1]||(k[1]=[n.createElementVNode("span",{class:"text-sm text-muted-foreground dark:text-neutral-400 animate-pulse"},"Uploading...",-1)])])):(n.openBlock(),n.createBlock(hs,{key:2,file:r.value,title:e.label,description:e.hint,disabled:e.disabled,"show-edit":!1,"show-replace":!1,"show-remove":!0,"force-file-icon":!0,"preview-height":e.previewHeight,"preview-width":e.previewWidth,onRemove:E},null,8,["file","title","description","disabled","preview-height","preview-width"])):(n.openBlock(),n.createBlock(Aa,{key:0,label:e.label,hint:e.hint,accept:f.value,maxSizeMb:e.maxSizeMb,disabled:e.disabled||_.value,onPicked:w,error:i.value,onError:k[0]||(k[0]=b=>l(b))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),Ck=["for"],_k={key:0,class:"!ml-1 !text-destructive"},Bk={class:"relative w-full block box-border"},Ek={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},Sk=["id","readonly","disabled","placeholder"],Ak={class:"absolute inset-y-0 right-4 flex items-center z-10"},Vk={key:1,class:"absolute z-50 mt-1 w-full rounded-xl border bg-white dark:bg-neutral-900 shadow-lg box-border"},Dk={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},Mk={key:1,class:"text-sm text-muted-foreground text-center"},Nk=["onClick","title"],Pk={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},vk={class:"flex items-center justify-center flex-1"},Tk={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},Ok={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},hd=n.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(e,{emit:t}){const o=e,a=t,r=Ct,s=n.ref(null),i=n.ref(null),l=Math.random().toString(36).slice(2,7),c=n.computed(()=>`dcode-icon-dropdown-${o.label||"icon-dropdown"}-${l}`),d=n.ref(!1),u=n.computed(()=>(o.modelValue??"").trim()||""),f=n.ref(""),h=n.ref(!1),m=n.ref(!1),p=n.ref(!1),g=n.shallowRef([]),y=n.ref(o.pageSize),x=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),_=async()=>{if(m.value||p.value)return;p.value=!0,await new Promise($=>setTimeout($,0));const O=Object.keys(r).filter($=>!x.has($)).filter($=>/^[A-Z]/.test($)).filter($=>typeof r[$]=="function"||typeof r[$]=="object"&&r[$]).sort(($,Y)=>$.localeCompare(Y));g.value=O,m.value=!0,p.value=!1},C=n.computed(()=>!m.value||!u.value||!g.value.includes(u.value)?null:r[u.value]),w=n.ref(u.value),E=n.computed(()=>!!u.value&&!d.value),B=n.computed(()=>{if(!m.value)return[];const O=(f.value??"").trim().toLowerCase();return O?g.value.filter($=>$.toLowerCase().includes(O)):g.value}),k=n.computed(()=>B.value.slice(0,y.value)),b=n.computed(()=>{const O=o.columns;return O<=2?"grid-cols-2":O===3?"grid-cols-3":O===4?"grid-cols-4":O===5?"grid-cols-5":O>=8?"grid-cols-8":"grid-cols-6"});n.computed(()=>o.clearable?"!pr-10":"!pr-3"),n.computed(()=>C.value&&!d.value?"!pl-12":"!pl-3");const A=async()=>{var O;await n.nextTick(),(O=i.value)==null||O.focus()},D=async O=>{if(o.disabled)return;const $=O!==!1;if(h.value){h.value=!1;return}d.value=!0,await _(),$&&(f.value="",w.value=""),y.value=o.pageSize,await A()},P=()=>{d.value=!1,f.value="",w.value=u.value,y.value=o.pageSize},V=async()=>{o.disabled||(d.value?P():await D())};let M=null;const z=async O=>{if(o.disabled)return;a("update:modelValue",null),d.value||await D(!1),M&&clearTimeout(M);const $=w.value;M=setTimeout(()=>{f.value=$},300)},N=O=>{o.disabled||(a("update:modelValue",O),P(),queueMicrotask(()=>{var $;return($=i.value)==null?void 0:$.blur()}))},v=()=>{o.disabled||(a("update:modelValue",null),a("clear"),h.value=!0,P(),queueMicrotask(()=>{var O;return(O=i.value)==null?void 0:O.focus()}))},T=O=>{if(O.key==="Escape"){O.preventDefault(),P();return}if(O.key==="Enter"&&d.value){const $=B.value[0];$&&(O.preventDefault(),N($))}},R=O=>{if(!d.value)return;const $=O.target;s.value&&!s.value.contains($)&&P()},H=O=>{const $=O.target;$.scrollTop+$.clientHeight>=$.scrollHeight-24&&y.value<B.value.length&&(y.value=Math.min(y.value+o.pageSize,B.value.length))};return n.onMounted(()=>{document.addEventListener("mousedown",R),queueMicrotask(()=>{var O;i.value=((O=s.value)==null?void 0:O.querySelector("input"))??null}),u.value&&_()}),n.onBeforeUnmount(()=>{document.removeEventListener("mousedown",R),M&&clearTimeout(M)}),n.watch(u,O=>{d.value||(w.value=O)}),n.watch(()=>f.value,()=>{y.value=o.pageSize}),(O,$)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"rootEl",ref:s,class:"!w-full !block !box-border"},[o.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:c.value,class:"!text-sm !font-medium !mb-1 !block"},[n.createTextVNode(n.toDisplayString(o.label)+" ",1),o.required?(n.openBlock(),n.createElementBlock("span",_k,"*")):n.createCommentVNode("",!0)],8,Ck)):n.createCommentVNode("",!0),n.createElementVNode("div",Bk,[C.value&&!d.value?(n.openBlock(),n.createElementBlock("div",Ek,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(C.value),{size:18}))])):n.createCommentVNode("",!0),n.withDirectives(n.createElementVNode("input",{id:c.value,"onUpdate:modelValue":$[0]||($[0]=Y=>w.value=Y),readonly:E.value,disabled:o.disabled,placeholder:o.placeholder,class:n.normalizeClass(["w-full h-10 m-0 py-0 rounded-lg border bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 pr-10 outline-none box-border truncate",[C.value&&!d.value?"pl-10":"pl-4",E.value?"cursor-pointer select-none":""]]),onClick:D,onFocus:D,onInput:z,onKeydown:T},null,42,Sk),[[n.vModelText,w.value]]),n.createElementVNode("div",Ak,[o.clearable&&u.value?(n.openBlock(),n.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:$[1]||($[1]=n.withModifiers(()=>{},["prevent"])),onClick:v,title:"Clear"},[n.createVNode(n.unref(te.X),{class:"h-4 w-4"})],32)):(n.openBlock(),n.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:$[2]||($[2]=n.withModifiers(()=>{},["prevent"])),onClick:V,title:"Open"},[n.createVNode(n.unref(te.ChevronDown),{class:"h-4 w-4"})],32))]),d.value?(n.openBlock(),n.createElementBlock("div",Vk,[n.createElementVNode("div",{class:"p-2 overflow-auto",style:n.normalizeStyle({maxHeight:o.maxHeight}),onScroll:H},[p.value?(n.openBlock(),n.createElementBlock("div",Dk,[n.createVNode(n.unref(te.Loader2),{class:"h-4 w-4 animate-spin"}),$[3]||($[3]=n.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):m.value&&B.value.length===0?(n.openBlock(),n.createElementBlock("div",Mk," Icon tidak ditemukan ")):(n.openBlock(),n.createElementBlock("div",{key:2,class:n.normalizeClass(["grid gap-2",b.value])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(k.value,Y=>(n.openBlock(),n.createElementBlock("button",{key:Y,type:"button",class:n.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===Y?"ring-1 ring-primary":""]),onClick:X=>N(Y),title:Y},[n.createElementVNode("div",Pk,[n.createElementVNode("div",vk,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(r)[Y]),{size:o.iconSize,class:"shrink-0"},null,8,["size"]))]),n.createElementVNode("span",Tk,n.toDisplayString(Y),1)])],10,Nk))),128))],2)),m.value&&B.value.length>0?(n.openBlock(),n.createElementBlock("div",Ok," Showing "+n.toDisplayString(k.value.length)+" / "+n.toDisplayString(B.value.length),1)):n.createCommentVNode("",!0)],36)])):n.createCommentVNode("",!0)])],512))}}),zk={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},Fk={class:"flex items-center justify-between border-b dark:border-neutral-800 px-6 py-4"},Ik={class:"relative overflow-auto p-0"},ps=n.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(e,{emit:t}){const o=e,a=t,r=n.computed({get:()=>o.modelValue,set:C=>a("update:modelValue",C)}),s=n.ref(null),i=n.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(C,w,E,B,k){const b=await new Promise((P,V)=>{const M=URL.createObjectURL(C),z=new Image;z.onload=()=>{URL.revokeObjectURL(M),P(z)},z.onerror=N=>{URL.revokeObjectURL(M),V(N)},z.src=M}),A=document.createElement("canvas");A.width=w,A.height=E;const D=A.getContext("2d");return D?(D.drawImage(b,0,0,w,E),await new Promise(P=>{A.toBlob(V=>P(V||C),B,k)})):C}function m(){if(!l||!i.value)return;const C=l.getPlugin("Dashboard"),w=l.getFile(i.value);!C||!w||requestAnimationFrame(()=>{try{C.openFileEditor(w)}catch{try{C.openFileEditor(i.value)}catch{}}})}async function p(C){if(l){l.cancelAll(),i.value=null;try{const w=l.addFile({name:C.name,type:C.type,data:C,source:"Local",isRemote:!1});i.value=String(w)}catch{}}}function g(){if(!s.value)return;l&&f(),l=new Qd({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const C=document.documentElement.classList.contains("dark");l.use(Os,{target:s.value,inline:!0,height:480,theme:C?"dark":"light",proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),u=new MutationObserver(()=>{if(!l)return;const w=document.documentElement.classList.contains("dark"),E=l.getPlugin("Dashboard");E&&E.setOptions({theme:w?"dark":"light"})}),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(Zd,{target:Os,quality:o.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:o.aspectRatio==null?Number.NaN:o.aspectRatio}}),l.on("file-editor:cancel",()=>{r.value=!1}),l.on("file-added",w=>{i.value=(w==null?void 0:w.id)??null,o.autoOpenEditor&&setTimeout(()=>m(),80)}),l.on("file-editor:complete",async w=>{const E=++d;try{const B=w.data,k=B.type||w.type||"image/jpeg";let b=B;if(o.outputWidth&&o.outputHeight&&(b=await h(B,o.outputWidth,o.outputHeight,k,o.quality)),c||E!==d)return;const A=w.name||"edited-image.jpg",D=new File([b],A,{type:k});await y(D,"UPPY_EDITOR_COMPLETE"),a("done",D),r.value=!1}catch{}})}async function y(C,w="CROP_RESULT"){const E=URL.createObjectURL(C);try{const B=await new Promise((k,b)=>{const A=new Image;A.onload=()=>k(A),A.onerror=b,A.src=E});console.group(w),console.log("file:",C),console.table({name:C.name,type:C.type,sizeBytes:C.size,sizeMB:+(C.size/1024/1024).toFixed(3),width:B.naturalWidth,height:B.naturalHeight,ratio:+(B.naturalWidth/B.naturalHeight).toFixed(4)}),console.log("previewUrl:",E),console.groupEnd()}finally{URL.revokeObjectURL(E)}}n.watch(r,async C=>{c=!C,d++,C?(await n.nextTick(),g(),o.file&&await p(o.file)):f()},{flush:"post"}),n.watch(()=>o.file,async C=>{r.value&&C&&(await n.nextTick(),await p(C))}),n.onBeforeUnmount(()=>{c=!0,d++,f()});const x=C=>{C.key==="Escape"&&r.value&&(r.value=!1)};n.watch(r,C=>{C?globalThis.addEventListener("keydown",x):globalThis.removeEventListener("keydown",x)},{immediate:!0});const _=n.ref(!1);return(C,w)=>r.value?(n.openBlock(),n.createElementBlock("div",zk,[n.createVNode(n.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:n.withCtx(()=>[r.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:w[0]||(w[0]=E=>r.value=!1)})):n.createCommentVNode("",!0)]),_:1}),n.createVNode(n.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:n.withCtx(()=>[r.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"relative flex w-fit max-w-4xl flex-col overflow-hidden rounded-xl border border-border dark:border-neutral-800 bg-background dark:bg-neutral-900 shadow-2xl transition-all",onClick:w[4]||(w[4]=n.withModifiers(()=>{},["stop"]))},[n.createElementVNode("div",Fk,[w[6]||(w[6]=n.createElementVNode("h3",{class:"text-lg font-semibold leading-none tracking-tight dark:text-neutral-100"}," Crop & Resize ",-1)),n.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:n.normalizeStyle({opacity:_.value?1:.7}),onClick:w[1]||(w[1]=E=>r.value=!1),onMouseenter:w[2]||(w[2]=E=>_.value=!0),onMouseleave:w[3]||(w[3]=E=>_.value=!1)},[n.createVNode(n.unref(te.X),{class:"h-4 w-4"}),w[5]||(w[5]=n.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),n.createElementVNode("div",Ik,[n.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):n.createCommentVNode("",!0)]),_:1})])):n.createCommentVNode("",!0)}}),Rk={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Lk=["src"],$k=["disabled"],Wk=["disabled"],jk={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},Uk={class:"flex gap-2"},Hk={class:"font-medium truncate"},qk={class:"flex gap-2"},Gk={class:"font-medium"},Xk={class:"flex gap-2"},Yk={class:"font-medium truncate"},gs=xt(n.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(e,{emit:t}){const o=e,a=t,r=n.ref(null);n.watch(()=>o.file,h=>{r.value&&URL.revokeObjectURL(r.value),r.value=h?URL.createObjectURL(h):null},{immediate:!0}),n.onBeforeUnmount(()=>{r.value&&URL.revokeObjectURL(r.value),d&&d.disconnect()});function s(h){const m=h/1024,p=m/1024;return p>=1?`${p.toFixed(2)} MB`:m>=1?`${m.toFixed(1)} KB`:`${h} B`}const i=n.computed(()=>o.file?{name:o.file.name,size:s(o.file.size),type:o.file.type||"unknown"}:null),l=n.ref(!1),c=n.ref(!1);let d=null;const u=()=>{typeof document<"u"&&(c.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};n.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=n.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)=>e.file?(n.openBlock(),n.createBlock(cs,{key:0,class:n.normalizeClass([e.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:n.withCtx(()=>[n.createVNode(us,{class:"pb-2"},{default:n.withCtx(()=>[n.createVNode(fs,{class:"text-sm font-semibold dark:text-neutral-100"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1}),e.description?(n.openBlock(),n.createElementBlock("div",Rk,n.toDisplayString(e.description),1)):n.createCommentVNode("",!0)]),_:1}),n.createVNode(ds,{class:"pt-2"},{default:n.withCtx(()=>{var p,g,y;return[n.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-800/50 border-border dark:border-neutral-700 w-full",style:n.normalizeStyle([{height:`${e.previewHeight}px`},f.value]),onMouseenter:m[2]||(m[2]=x=>l.value=!0),onMouseleave:m[3]||(m[3]=x=>l.value=!1)},[r.value?(n.openBlock(),n.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Lk)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"d-action-buttons",style:n.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"})},[e.showEdit?(n.openBlock(),n.createElementBlock("button",{key:0,disabled:e.disabled,class:"d-action-btn shadow-md",style:n.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:e.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]=x=>a("edit"))},[n.createVNode(n.unref(te.Pencil),{style:{width:"16px",height:"16px"}})],12,$k)):n.createCommentVNode("",!0),e.showRemove?(n.openBlock(),n.createElementBlock("button",{key:1,disabled:e.disabled,class:"d-action-btn shadow-md",style:n.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:e.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]=x=>a("remove"))},[n.createVNode(n.unref(te.Trash2),{style:{width:"16px",height:"16px"}})],12,Wk)):n.createCommentVNode("",!0)],4),n.createElementVNode("div",{class:"d-metadata-overlay",style:n.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"})},[n.createElementVNode("div",jk,[n.createElementVNode("div",Uk,[m[4]||(m[4]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),n.createElementVNode("span",Hk,n.toDisplayString((p=i.value)==null?void 0:p.name),1)]),n.createElementVNode("div",qk,[m[5]||(m[5]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),n.createElementVNode("span",Gk,n.toDisplayString((g=i.value)==null?void 0:g.size),1)]),n.createElementVNode("div",Xk,[m[6]||(m[6]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),n.createElementVNode("span",Yk,n.toDisplayString((y=i.value)==null?void 0:y.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-72c623f7"]]),Kk={class:"space-y-3"},Va=n.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(e,{emit:t}){const o=e,a=t,r=n.computed({get:()=>o.modelValue,set:v=>a("update:modelValue",v)}),s=n.ref(!1),i=n.ref(null),l=n.ref(null),c=n.ref(null);function d(v){c.value=v,a("error",v)}function u(){c.value=null}const f=n.computed(()=>{const v=(o.allowedTypes??"").trim();return v?v.split(/[,\s;]+/g).map(R=>R.trim().toLowerCase()).filter(Boolean).map(R=>R.includes("/")||R.startsWith(".")?R:`.${R}`):[]});function h(v){const T=v.lastIndexOf(".");return T>=0?v.slice(T).toLowerCase():""}const m=n.computed(()=>{if(f.value.length){const v=f.value.filter(R=>R.startsWith("."));return[...f.value.filter(R=>R.includes("/")),...v].join(",")}return o.accept||"image/*"}),p=n.computed(()=>f.value.length?f.value.join(", "):o.accept||"image/*");function g(v){if(f.value.length){const R=(v.type||"").toLowerCase(),H=h(v.name);return f.value.some(O=>O.includes("/")?R===O:O.startsWith(".")?H===O:H===`.${O}`)}return(o.accept||"image/*").toLowerCase().includes("image/")?(v.type||"").toLowerCase().startsWith("image/"):!0}function y(v){return v*1024*1024}async function x(v){var T;return(T=v.type)!=null&&T.startsWith("image/")?await new Promise(R=>{const H=URL.createObjectURL(v),O=new Image;O.onload=()=>{URL.revokeObjectURL(H),R({w:O.naturalWidth,h:O.naturalHeight})},O.onerror=()=>{URL.revokeObjectURL(H),R(null)},O.src=H}):null}async function _(v){if(!(o.minWidth!=null||o.minHeight!=null||o.maxWidth!=null||o.maxHeight!=null))return null;const R=await x(v);return R?o.minWidth!=null&&R.w<o.minWidth?`Lebar gambar minimal ${o.minWidth}px`:o.minHeight!=null&&R.h<o.minHeight?`Tinggi gambar minimal ${o.minHeight}px`:o.maxWidth!=null&&R.w>o.maxWidth?`Lebar gambar maksimal ${o.maxWidth}px`:o.maxHeight!=null&&R.h>o.maxHeight?`Tinggi gambar maksimal ${o.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function C(v){return v?g(v)?o.minSizeMb!=null&&v.size<y(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&v.size>y(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:await _(v):`only Allowed: ${p.value}`:"File tidak valid"}function w(v){o.disabled||(i.value=v,s.value=!0)}async function E(v){if(o.disabled)return;u();const T=await C(v);if(T){d(T);return}l.value=v,w(v)}const{DCodeApi:B}=Je(),k=ms(),b=n.ref(!1);n.ref(null);function A(v,T){return!v||!T?null:v.replace(/\/+$/,"")+"/"+T.replace(/^\/+/,"")}function D(v){var O;const T=(v==null?void 0:v.data)??v,R=(O=T==null?void 0:T.data)==null?void 0:O[0];if(!R)return null;const H=A(R.server,R.url);return{...R,fullUrl:H?encodeURI(H):null}}async function P(v){var T;if(o.uploadFn){try{b.value=!0;const R=await o.uploadFn(v);r.value=v,a("uploaded",R)}catch(R){console.error("Upload Error",R),k.error("Upload Failed",(R==null?void 0:R.message)||"Unknown error"),d((R==null?void 0:R.message)||"Upload Failed")}finally{b.value=!1}return}if(!((T=o.endpoint)!=null&&T.apiUrl)){r.value=v;return}if(typeof B!="function"){d("useApi() must expose DCodeApi()");return}try{b.value=!0;const R=new FormData;R.append("doc",v);const H=(o.endpoint.apiMethod||"POST").toUpperCase(),O=o.endpoint.apiUrl,$=await B("","",R,{_url:O,_method:H,withCredentials:!0,transformRequest:[(X,j)=>(j&&(delete j["Content-Type"],delete j["content-type"]),X)]}),Y=($==null?void 0:$.data)??$;D(Y),r.value=v,a("uploaded",Y)}catch(R){console.error("Upload Error",R),k.error("Upload Failed",(R==null?void 0:R.message)||"Unknown error"),d((R==null?void 0:R.message)||"Upload Failed")}finally{b.value=!1}}async function V(v){var T;u(),o.uploadFn||(T=o.endpoint)!=null&&T.apiUrl?await P(v):r.value=v,s.value=!1,i.value=null}function M(){s.value=!1,i.value=null}async function z(){if(!r.value)return;u();const v=o.editUseOriginal?l.value??r.value:r.value,T=await C(v);if(T){d(T);return}w(v)}function N(){u(),r.value=null,i.value=null,s.value=!1,l.value=null}return n.watch(()=>o.modelValue,v=>{v&&!l.value&&(l.value=v),v||(l.value=null)},{immediate:!0}),(v,T)=>(n.openBlock(),n.createElementBlock("div",Kk,[r.value?(n.openBlock(),n.createBlock(gs,{key:1,file:r.value,title:e.label,description:e.description,"preview-width":e.previewWidth,disabled:e.disabled,"show-edit":!0,"show-remove":!0,"show-replace":!1,onEdit:z,onRemove:N,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(n.openBlock(),n.createBlock(Aa,{key:0,label:e.label,hint:e.hint,accept:m.value,maxSizeMb:e.maxSizeMb,disabled:e.disabled,onPicked:E,error:c.value,onError:T[0]||(T[0]=R=>d(R))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),n.createVNode(ps,{modelValue:s.value,"onUpdate:modelValue":T[1]||(T[1]=R=>s.value=R),file:i.value,title:e.title,description:e.description,"auto-open-editor":e.autoOpenEditor,"aspect-ratio":e.aspectRatio,"output-width":e.outputWidth,"output-height":e.outputHeight,quality:e.quality,onDone:V,onCancel:M},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),jn=n.defineComponent({name:"DCodeLabel",inheritAttrs:!1,__name:"DCodeLabel",props:{label:{},text:{},textSize:{},textType:{},icon:{},iconClass:{}},setup(e){const t=n.useAttrs(),o=e,a=n.computed(()=>o.icon&&Ct[o.icon]||null),r=n.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=n.computed(()=>s[o.textSize??"xs"]??"w-3 h-3"),l=n.computed(()=>o.textType==="BOLD"?"font-bold":o.textType==="ITALIC"?"italic font-normal":"font-normal"),c=n.computed(()=>{const u=`${r.value} ${l.value} text-slate-600 ml-1 inline-flex items-center gap-1`,f=t.class??"";return[u,f].filter(Boolean).join(" ")}),d=n.computed(()=>{const{class:u,...f}=t;return f});return(u,f)=>(n.openBlock(),n.createElementBlock("span",n.mergeProps({class:c.value},d.value),[a.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(a.value),{key:0,class:n.normalizeClass(["shrink-0",i.value,e.iconClass])},null,8,["class"])):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(e.label||e.text),1)],16))}}),Jk=["aria-busy"],Qk={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Zk=["for"],ew={key:0,class:"ml-1 text-destructive"},tw=["id","disabled"],nw={class:"min-w-0 flex-1 text-left"},ow={key:0,class:"flex flex-wrap gap-1.5"},aw={class:"max-w-[220px] truncate"},rw=["onClick"],sw={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"},iw={key:1,class:"text-muted-foreground truncate"},lw={class:"flex items-center gap-2 shrink-0"},cw={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},dw=["placeholder","onKeydown"],uw={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},fw=["disabled","onClick"],hw={class:"truncate"},mw={key:0,class:"text-primary-600 dark:text-primary-400"},pw={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},gw={key:0},bw={key:1},yw={key:1,class:"text-xs text-destructive"},bs=n.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(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=n.computed(()=>(r.label||o.label)??void 0),i=n.computed(()=>r.visible??!0),l=Math.random().toString(36).slice(2,7),c=n.computed(()=>`app-multiselect-${o.id||s.value||"field"}-${l}`),d=n.computed(()=>{if(r.required)return!0;const Z=o.required,oe=o["aria-required"];return Z===""||Z===!0||Z==="true"||(oe==="true"||oe===!0)}),u=n.computed(()=>!!r.error);function f(Z){return Z?typeof r.itemTitle=="function"?r.itemTitle(Z)??"":String((Z==null?void 0:Z[r.itemTitle])??""):""}function h(Z){return Z?typeof r.itemValue=="function"?r.itemValue(Z):Z==null?void 0:Z[r.itemValue]:null}function m(Z,oe){return h(Z)??oe}const p=n.computed(()=>Array.isArray(r.modelValue)?r.modelValue:[]),g=n.computed(()=>{var Z;return!!((Z=r.endpoint)!=null&&Z.apiUrl)||!!r.fetchItems}),y=n.ref([]),x=n.ref(!1),_=n.ref(!1),C=n.computed(()=>{var oe;const Z=(oe=r.endpoint)==null?void 0:oe.apiOptions;if(Z)return typeof Z=="function"?Z():Z}),w=n.computed(()=>{var ge,$e;const Z=((ge=r.endpoint)==null?void 0:ge.apiUrl)??"",oe=((($e=r.endpoint)==null?void 0:$e.apiMethod)??"GET").toUpperCase(),re=JSON.stringify(C.value??null);return`${oe} ${Z} :: ${re}`}),E=n.computed(()=>g.value?y.value:r.items||[]);async function B(){var Z;if(g.value&&!(!((Z=r.endpoint)!=null&&Z.apiUrl)&&!r.fetchItems)&&!x.value){x.value=!0;try{let oe;if(r.fetchItems){const re=await r.fetchItems(),ge=(re==null?void 0:re.data)??re;oe=(ge==null?void 0:ge.data)??ge}else{const{DCodeApi:re}=Je();if(typeof re!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const ge={page:1,perPage:100,...C.value||{}},$e=await re("","",ge,{_url:r.endpoint.apiUrl,_method:(r.endpoint.apiMethod||"GET").toUpperCase()}),Pt=($e==null?void 0:$e.data)??$e;oe=(Pt==null?void 0:Pt.data)??Pt}y.value=Array.isArray(oe)?oe:[],_.value=!0}catch(oe){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",oe),y.value=[]}finally{x.value=!1}}}n.watch(()=>w.value,()=>{y.value=[],_.value=!1}),n.onMounted(()=>{r.autoFetchOnMount&&g.value&&B()});const k=n.computed(()=>{const Z=p.value;if(r.returnObject)return Z;const oe=new Map;for(const re of E.value)oe.set(h(re),re);return Z.map(re=>oe.get(re)??{[r.itemValue]:re,[r.itemTitle]:String(re)})}),b=n.computed(()=>r.maxChips===null?k.value:k.value.slice(0,r.maxChips));function A(Z){const oe=p.value;if(r.returnObject){const re=h(Z);return oe.some(ge=>h(ge)===re)}return oe.includes(h(Z))}const D=n.computed(()=>{if(r.maxSelected===null||r.maxSelected===void 0)return null;const Z=Number(r.maxSelected);return Number.isFinite(Z)&&Z>0?Z:null}),P=n.computed(()=>{const Z=D.value;return Z===null?!1:p.value.length>=Z});function V(Z){return!A(Z)&&P.value}const M=n.computed(()=>{const Z=p.value,oe=new Set;if(r.returnObject)for(const re of Z)oe.add(h(re));else for(const re of Z)oe.add(re);return oe}),z=n.computed(()=>{const Z=M.value;return(E.value||[]).filter(oe=>!Z.has(h(oe)))}),N=n.computed(()=>E.value.length===0?!1:z.value.length===0),v=n.ref(null),T=n.ref(null),R=n.ref(null),H=n.ref(!1),O=n.ref(""),$=n.ref(0),Y=n.ref(0),{floatingStyles:X}=hr(v,T,{whileElementsMounted:lr,placement:"bottom-start",middleware:[cr(8),ur(),dr({padding:8}),fr({apply({rects:Z,elements:oe}){Object.assign(oe.floating.style,{width:`${Z.reference.width}px`,"--floating-width":`${Z.reference.width}px`})}})]}),j=n.computed(()=>X.value),ee=n.computed(()=>{const Z=Number(r.maxRows);return Number.isFinite(Z)&&Z>0?Z:5});async function ne(){r.disabled||(H.value=!0,Y.value=0,requestAnimationFrame(()=>{R.value&&(R.value.scrollTop=0),$.value=0}),g.value&&r.autoFetchOnOpen&&(r.refreshOnOpen||!_.value)&&!x.value&&await B())}function fe(){H.value=!1}function ye(){H.value?fe():ne()}function he(Z){var re,ge;if(!H.value)return;const oe=Z.target;(re=v.value)!=null&&re.contains(oe)||(ge=T.value)!=null&&ge.contains(oe)||fe()}n.onMounted(()=>document.addEventListener("mousedown",he)),n.onBeforeUnmount(()=>document.removeEventListener("mousedown",he));function G(Z){if(r.disabled)return;if(V(Z)){a("max");return}const oe=[...p.value];if(r.returnObject){const re=h(Z);if(oe.some($e=>h($e)===re))return;a("update:modelValue",[...oe,Z])}else{const re=h(Z);if(oe.includes(re))return;a("update:modelValue",[...oe,re])}O.value="",Y.value=0,requestAnimationFrame(()=>{R.value&&(R.value.scrollTop=0),$.value=0})}function F(Z){if(r.disabled)return;const oe=[...p.value];if(r.returnObject){const re=h(Z);a("update:modelValue",oe.filter(ge=>h(ge)!==re))}else{const re=h(Z);a("update:modelValue",oe.filter(ge=>ge!==re))}}function q(){r.disabled||(a("update:modelValue",[]),a("clear"),fe())}const Q=n.computed(()=>{const Z=O.value.trim().toLowerCase(),oe=z.value;return Z?oe.filter(re=>f(re).toLowerCase().includes(Z)):oe}),ue=n.computed(()=>Q.value.length);n.watch(H,Z=>{Z||(O.value="")});const _e=n.computed(()=>{if(N.value)return r.itemHeight;const Z=ue.value;return(Z<=0?1:Math.min(Z,ee.value))*r.itemHeight}),Ce=n.computed(()=>r.virtual?ue.value*r.itemHeight:0),Oe=n.computed(()=>r.virtual?Math.ceil(_e.value/r.itemHeight)+r.overscan:ue.value),Ke=n.computed(()=>{if(!r.virtual)return 0;const Z=Math.floor($.value/r.itemHeight)-Math.floor(r.overscan/2);return Math.max(0,Z)}),at=n.computed(()=>r.virtual?Math.min(ue.value,Ke.value+Oe.value):ue.value),wt=n.computed(()=>r.virtual?Ke.value*r.itemHeight:0),ln=n.computed(()=>{const Z=Q.value;return r.virtual?Z.slice(Ke.value,at.value):Z});function Mo(Z){const oe=Z.target;$.value=oe.scrollTop}function No(Z){return Z===Y.value}function U(Z){const oe=R.value;if(!oe||!r.virtual)return;const re=Z*r.itemHeight,ge=re+r.itemHeight,$e=oe.scrollTop,Pt=oe.scrollTop+oe.clientHeight;re<$e?oe.scrollTop=re:ge>Pt&&(oe.scrollTop=ge-oe.clientHeight)}function ae(Z){const oe=Math.max(0,ue.value-1);Y.value=Math.min(oe,Math.max(0,Y.value+Z)),U(Y.value)}function pe(){const Z=Q.value[Y.value];Z&&G(Z)}const ve=n.computed(()=>r.clearable&&!r.disabled&&k.value.length>0),Ae=n.computed(()=>u.value?"border-destructive ring-1 ring-destructive":H.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(Z,oe)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1 w-full",n.unref(o).class]),"aria-busy":r.skeleton},[r.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.value?(n.openBlock(),n.createElementBlock("div",Qk)):n.createCommentVNode("",!0),oe[3]||(oe[3]=n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[s.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[n.createTextVNode(n.toDisplayString(s.value)+" ",1),d.value?(n.openBlock(),n.createElementBlock("span",ew,"*")):n.createCommentVNode("",!0)],8,Zk)):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"referenceEl",ref:v,class:"relative"},[n.createElementVNode("button",{id:c.value,type:"button",class:n.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-900 border-gray-300 dark:border-gray-700 text-foreground dark:text-gray-300",Ae.value]]),disabled:r.disabled,onClick:ye},[n.createElementVNode("div",nw,[k.value.length?(n.openBlock(),n.createElementBlock("div",ow,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(b.value,(re,ge)=>(n.openBlock(),n.createElementBlock("div",{key:`chip-${m(re,ge)}`,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"},[n.createElementVNode("span",aw,n.toDisplayString(f(re)),1),r.disabled?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:n.withModifiers($e=>F(re),["stop"]),"aria-label":"Remove"}," ✕ ",8,rw))]))),128)),r.maxChips!==null&&k.value.length>r.maxChips?(n.openBlock(),n.createElementBlock("div",sw," +"+n.toDisplayString(k.value.length-(r.maxChips??0)),1)):n.createCommentVNode("",!0)])):(n.openBlock(),n.createElementBlock("div",iw,n.toDisplayString(r.placeholder),1))]),n.createElementVNode("div",lw,[ve.value?(n.openBlock(),n.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:n.withModifiers(q,["stop"]),"aria-label":"Clear"}," ✕ ")):n.createCommentVNode("",!0),n.createVNode(n.unref(te.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,tw),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[H.value?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:T,class:"-mt-1 z-[9999] w-[var(--floating-width)] rounded-lg border shadow-lg overflow-hidden bg-white dark:bg-neutral-900 border-gray-200 dark:border-gray-800",style:n.normalizeStyle(j.value)},[r.searchable&&!N.value?(n.openBlock(),n.createElementBlock("div",cw,[n.withDirectives(n.createElementVNode("input",{"onUpdate:modelValue":oe[0]||(oe[0]=re=>O.value=re),placeholder:r.searchPlaceholder,class:"w-full h-10 px-3 py-2 text-sm bg-white dark:bg-neutral-900 border border-gray-200 dark:border-gray-800 rounded-md focus:outline-none focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600",onKeydown:[oe[1]||(oe[1]=n.withKeys(n.withModifiers(re=>ae(1),["prevent"]),["down"])),oe[2]||(oe[2]=n.withKeys(n.withModifiers(re=>ae(-1),["prevent"]),["up"])),n.withKeys(n.withModifiers(pe,["prevent"]),["enter"]),n.withKeys(n.withModifiers(fe,["prevent"]),["esc"])]},null,40,dw),[[n.vModelText,O.value]])])):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"listEl",ref:R,class:"relative overflow-auto",style:n.normalizeStyle({height:_e.value+"px"}),onScroll:Mo},[N.value?(n.openBlock(),n.createElementBlock("div",uw," All items have been selected ")):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[r.virtual?(n.openBlock(),n.createElementBlock("div",{key:0,style:n.normalizeStyle({height:Ce.value+"px"})},null,4)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(r.virtual?"absolute left-0 top-0 w-full":""),style:n.normalizeStyle(r.virtual?{transform:`translateY(${wt.value}px)`}:void 0)},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(ln.value,(re,ge)=>(n.openBlock(),n.createElementBlock("button",{key:String(m(re,Ke.value+ge)),type:"button",class:n.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[V(re)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",No(Ke.value+ge)?"bg-neutral-50 dark:bg-neutral-800/60":"",A(re)?"font-semibold":"font-normal"]]),style:n.normalizeStyle({height:r.itemHeight+"px"}),disabled:r.disabled||V(re),onClick:$e=>G(re)},[n.createElementVNode("span",hw,n.toDisplayString(f(re)),1),A(re)?(n.openBlock(),n.createElementBlock("span",mw,"✓")):n.createCommentVNode("",!0)],14,fw))),128))],6),ue.value===0?(n.openBlock(),n.createElementBlock("div",pw,[x.value?(n.openBlock(),n.createElementBlock("span",gw,"Loading data…")):(n.openBlock(),n.createElementBlock("span",bw,"Tidak ada data"))])):n.createCommentVNode("",!0)],64))],36)],4)):n.createCommentVNode("",!0)]))],512),u.value?(n.openBlock(),n.createElementBlock("p",yw,n.toDisplayString(r.error),1)):n.createCommentVNode("",!0)],64))],10,Jk)),[[n.vShow,i.value]])}}),xw={class:"space-y-4"},kw={key:0,class:"flex flex-col gap-0.5"},ww=["for"],Cw=["for"],_w={class:"text-[11px] text-gray-500 dark:text-gray-400"},Bw={class:"flex items-center gap-2 flex-nowrap"},Ew=["id","value","disabled","onKeydown","onInput","onPaste"],Da=n.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(e,{emit:t}){const o=n.useAttrs(),a=Math.random().toString(36).slice(2,7),r=n.computed(()=>`app-otp-${(o.id||s.label||"otp-field").replaceAll(/\s+/g,"-").toLowerCase()}-${a}`),s=e,i=t,l=n.ref([]),c=n.ref([]),d=n.ref(!1),{DCodeApi:u}=Je(),f=ms(),h=n.computed(()=>{const B=Number(s.totalInput);return B&&B>0?B:6}),m=()=>{c.value=Array.from({length:h.value},(B,k)=>{var b;return((b=s.default)==null?void 0:b[k])??""}),i("updateOtp",c.value.join(""))};m(),n.watch(()=>[s.totalInput,s.default],()=>m());const p=B=>{B<0||B>=h.value||n.nextTick(()=>{var k;return(k=l.value[B])==null?void 0:k.focus()})},g=B=>B.match(/[a-zA-Z0-9]/)?B.match(/[a-zA-Z0-9]/)[0]:"";async function y(B){var k;if(i("complete",B),s.submitFn){try{d.value=!0,i("loading",!0);const b=await s.submitFn(B);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((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 b=(s.endpoint.apiMethod||"POST").toUpperCase(),A=s.endpoint.apiUrl,D=await u("","",{otp:B},{_url:A,_method:b,withCredentials:!0}),P=(D==null?void 0:D.data)??D;i("success",P)}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 x=(B,k)=>{c.value[B]=g(k);const b=c.value.join("");i("updateOtp",b),i("update:modelValue",b),b.length===h.value&&y(b)},_=(B,k)=>{const b=B.key,A=/^\d$/.test(b),D=/^[a-zA-Z]$/.test(b);if(b==="Backspace"){if(B.preventDefault(),c.value[k]){x(k,"");return}k>0&&(x(k-1,""),p(k-1));return}if(b==="ArrowLeft"){B.preventDefault(),p(k-1);return}if(b==="ArrowRight"){B.preventDefault(),p(k+1);return}if(A||D){B.preventDefault(),x(k,b),k<h.value-1&&p(k+1);return}b.length===1&&B.preventDefault()},C=(B,k)=>{const b=B.target,A=b.value??"",D=g(A);b.value=D,x(k,D),D&&k<h.value-1&&p(k+1)},w=(B,k)=>{var V;B.preventDefault();const A=(((V=B.clipboardData)==null?void 0:V.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!A)return;let D=k;for(const M of A){if(D>=h.value)break;c.value[D]=M,D++}const P=c.value.join("");i("updateOtp",P),i("update:modelValue",P),P.length===h.value&&y(P),p(Math.min(D,h.value-1))},E=B=>k=>{l.value[B]=(k==null?void 0:k.$el)??k};return(B,k)=>(n.openBlock(),n.createElementBlock("div",xw,[s.label||h.value?(n.openBlock(),n.createElementBlock("div",kw,[s.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:r.value,class:"text-sm font-medium text-foreground"},n.toDisplayString(s.label),9,ww)):(n.openBlock(),n.createElementBlock("label",{key:1,for:r.value,class:"text-sm font-medium text-foreground"}," Masukkan kode keamanan ",8,Cw)),n.createElementVNode("p",_w," Ketik "+n.toDisplayString(h.value)+" digit kode verifikasi Anda ",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",Bw,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h.value,b=>(n.openBlock(),n.createElementBlock("input",{key:b,id:b===1?r.value:void 0,ref_for:!0,ref:E(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:n.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-900 text-foreground dark:text-gray-300":"border-gray-300 dark:border-gray-700 bg-white dark:bg-neutral-900 text-gray-400 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600"]),onKeydown:A=>_(A,b-1),onInput:A=>C(A,b-1),onPaste:A=>w(A,b-1)},null,42,Ew))),128))])]))}}),Sw={class:"w-full"},Aw={key:0,class:"flex items-center justify-between mb-2"},Vw={key:0,class:"text-sm font-medium text-gray-700"},Dw={key:1,class:"text-sm text-gray-600"},Mw={name:"DCodeProgress"},md=n.defineComponent({...Mw,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(e,{emit:t}){const o=e,a=n.computed(()=>Math.min(o.modelValue/o.max*100,100)),r=n.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[o.size],"bg-gray-200"].join(" ")),s=n.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=n.computed(()=>`${Math.round(a.value)}%`);return(l,c)=>(n.openBlock(),n.createElementBlock("div",Sw,[e.label||e.showValue?(n.openBlock(),n.createElementBlock("div",Aw,[e.label?(n.openBlock(),n.createElementBlock("span",Vw,n.toDisplayString(e.label),1)):n.createCommentVNode("",!0),e.showValue?(n.openBlock(),n.createElementBlock("span",Dw,n.toDisplayString(i.value),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(r.value)},[n.createElementVNode("div",{class:n.normalizeClass(s.value),style:n.normalizeStyle({width:`${a.value}%`})},null,6)],2)]))}}),Nw={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},pd=xt(n.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(e){return(t,o)=>(n.openBlock(),n.createBlock(n.Transition,{name:"fade"},{default:n.withCtx(()=>[e.isApiLoading?(n.openBlock(),n.createElementBlock("div",Nw,[n.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:n.normalizeStyle({width:`${e.apiProgress}%`})},null,4)])):n.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-85c68054"]]),Ma=n.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=ze.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ie.Label),n.mergeProps(n.unref(o),{class:n.unref(we)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t.class)}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),Pw={class:"grid gap-3"},vw={key:0,class:"ml-1 text-destructive"},Tw={class:"flex flex-col"},Ow={key:0,class:"flex items-center gap-2 text-sm text-gray-500 mb-2"},zw={class:"relative flex-shrink-0 mt-0.5"},Fw=["id","name","value","checked","disabled","required","onChange"],Iw=["onClick"],Rw=["for"],Lw={key:0,class:"ml-1 text-red-500"},$w={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},ys=n.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(e,{emit:t}){n.useAttrs();const{apiUrl:o}=Je(),a=t,r=e,s=n.ref([]),i=n.ref(!1),l=n.ref(null),c=async()=>{var w,E;const C=((w=r.endpoint)==null?void 0:w.apiUrl)||r.apiUrl;if(C){i.value=!0,l.value=null;try{const B={page:1,perPage:100},k=((E=r.endpoint)==null?void 0:E.apiMethod)||r.apiMethod,b=await o(C,k,B);let A=b;r.dataPath?A=r.dataPath.split(".").reduce((P,V)=>P&&P[V]!=="undefined"?P[V]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(A=b.data),Array.isArray(A)?s.value=A:(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}}};n.onMounted(()=>{var C;((C=r.endpoint)!=null&&C.apiUrl||r.apiUrl)&&c()});const d=n.computed(()=>{if(r.options&&r.options.length>0)return r.options;if(s.value.length>0)return s.value;const C=r.itemValue||r.model||"id",w=r.itemTitle||(r.label===""?"name":r.label);return w&&r.label!==""?[{[C]:C,[w]:w}]:[]}),u=C=>{if(typeof C!="object")return C;const w=r.itemValue||r.model||"id";return C[w]},f=C=>{if(typeof C!="object")return String(C);const w=r.itemTitle||"name";return C[w]},h=n.computed(()=>r.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),m=n.computed(()=>!!r.error||!!l.value),p=n.computed(()=>r.error||l.value),g=C=>C==null?r.modelValue===C:String(r.modelValue)===String(C),y=n.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"}})[r.size]),x=(C,w)=>{w.target.checked&&(a("update:modelValue",C),a("change",C))},_=C=>{!r.disabled&&!g(C)&&(a("update:modelValue",C),a("change",C))};return(C,w)=>(n.openBlock(),n.createElementBlock("div",Pw,[e.label?(n.openBlock(),n.createBlock(Ma,{key:0,class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",vw,"*")):n.createCommentVNode("",!0)]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Tw,[i.value?(n.openBlock(),n.createElementBlock("div",Ow,[n.createVNode(n.unref(te.Loader2),{class:"w-4 h-4 animate-spin"}),w[0]||(w[0]=n.createTextVNode(" Sedang memuat opsi... ",-1))])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["flex",e.layout?"flex-row flex-wrap gap-4":"flex-col gap-3"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,(E,B)=>(n.openBlock(),n.createElementBlock("div",{key:B,class:n.normalizeClass(["flex items-start",y.value.container,e.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[n.createElementVNode("div",zw,[n.createElementVNode("input",{id:e.id?`${e.id}-${B}`:`${h.value}-${B}`,name:h.value,type:"radio",value:u(E),checked:g(u(E)),disabled:e.disabled,required:e.required&&B===0,onChange:k=>x(u(E),k),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,Fw)]),n.createElementVNode("div",{class:"flex-1 min-w-0",onClick:k=>_(u(E))},[n.createElementVNode("label",{for:e.id?`${e.id}-${B}`:`${h.value}-${B}`,class:n.normalizeClass([y.value.label,"font-medium cursor-pointer select-none text-foreground dark:text-gray-300",e.disabled?"cursor-not-allowed opacity-50":""])},[n.createTextVNode(n.toDisplayString(f(E))+" ",1),e.required&&d.value.length===1&&e.label?(n.openBlock(),n.createElementBlock("span",Lw,"*")):n.createCommentVNode("",!0)],10,Rw)],8,Iw)],2))),128))],2),m.value&&p.value?(n.openBlock(),n.createElementBlock("div",$w,[n.createVNode(n.unref(te.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),n.createTextVNode(" "+n.toDisplayString(p.value),1)])):n.createCommentVNode("",!0)])]))}}),Ww={class:"grid gap-3"},jw={key:0,class:"ml-1 text-destructive"},Uw={class:"flex flex-col"},Hw={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},qw=["onClick"],Gw=["id","name","value","checked","disabled","required","onChange"],Xw={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},Yw=["for"],Kw={key:0,class:"ml-1 text-red-500"},Jw={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},xs=n.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(e,{emit:t}){n.useAttrs();const{apiUrl:o}=Je(),a=t,r=e,s=n.ref(r.modelValue??void 0);n.watch(()=>r.modelValue,A=>{s.value=A},{immediate:!0});const i=n.ref([]),l=n.ref(!1),c=n.ref(null),d=async()=>{var D,P;const A=((D=r.endpoint)==null?void 0:D.apiUrl)||r.apiUrl;if(A){l.value=!0,c.value=null;try{const V={page:1,perPage:100},M=((P=r.endpoint)==null?void 0:P.apiMethod)||r.apiMethod,z=await o(A,M,V);let N=z;r.dataPath?N=r.dataPath.split(".").reduce((T,R)=>T&&T[R]!=="undefined"?T[R]:void 0,z):typeof z=="object"&&!Array.isArray(z)&&z.data&&(N=z.data),Array.isArray(N)?i.value=N:(console.warn("DCodeRadioCustom: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(V){console.error("DCodeRadioCustom fetch error:",V),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=n.ref(!1);let f=null;const h=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};n.onMounted(()=>{var A;((A=r.endpoint)!=null&&A.apiUrl||r.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"]}))}),n.onBeforeUnmount(()=>{f&&f.disconnect()});const m=n.computed(()=>{if(r.options&&r.options.length>0)return r.options;if(i.value.length>0)return i.value;const A=r.itemValue||r.model||"id",D=r.itemTitle||(r.label===""?"name":r.label);return D&&r.label!==""?[{[A]:A,[D]:D}]:[]}),p=A=>{if(typeof A!="object")return A;const D=r.itemValue||r.model||"id";return A[D]},g=A=>{if(typeof A!="object")return String(A);const D=r.itemTitle||"name";return A[D]},y=Math.random().toString(36).slice(2,7),x=n.computed(()=>r.id?`radio-custom-${r.id}`:`radio-custom-${r.model}-${y}`),_=n.computed(()=>!!r.error||!!c.value),C=n.computed(()=>r.error||c.value),w=A=>{const D=s.value;return A==null?D===A:String(D)===String(A)},E=n.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"}})[r.size]),B=n.computed(()=>r.icon&&Ct[r.icon]||null),k=(A,D)=>{D.target.checked&&(s.value=A,a("update:modelValue",A),a("change",A))},b=A=>{r.disabled||w(A)||(s.value=A,a("update:modelValue",A),a("change",A))};return(A,D)=>(n.openBlock(),n.createElementBlock("div",Ww,[e.label?(n.openBlock(),n.createBlock(Ma,{key:0,class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",jw,"*")):n.createCommentVNode("",!0)]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Uw,[l.value?(n.openBlock(),n.createElementBlock("div",Hw,[n.createVNode(n.unref(te.Loader2),{class:"w-4 h-4 animate-spin"}),D[0]||(D[0]=n.createTextVNode(" Sedang memuat opsi... ",-1))])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["grid",e.layout?"grid-cols-2 sm:grid-cols-3":"grid-cols-1","gap-3"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value,(P,V)=>(n.openBlock(),n.createElementBlock("div",{key:V,class:n.normalizeClass(["relative flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 transition-all duration-200",w(p(P))?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",e.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:M=>!e.disabled&&b(p(P))},[n.createElementVNode("input",{id:e.id?`${e.id}-${V}`:`${x.value}-${V}`,name:x.value,type:"radio",value:p(P),checked:w(p(P)),disabled:e.disabled,required:e.required&&V===0,onChange:M=>k(p(P),M),class:"sr-only",tabindex:"-1"},null,40,Gw),n.createElementVNode("div",{class:n.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",w(p(P))?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?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(B.value),{key:0,class:"w-6 h-6"})):(n.openBlock(),n.createElementBlock("svg",Xw,[...D[1]||(D[1]=[n.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2),n.createElementVNode("label",{for:e.id?`${e.id}-${V}`:`${x.value}-${V}`,class:n.normalizeClass([E.value.label,"font-medium text-center leading-tight select-none transition-colors duration-200",w(p(P))?u.value?"text-primary-400":"text-primary-700":u.value?"text-neutral-300":"text-gray-700",e.disabled?"cursor-not-allowed":"cursor-pointer"])},[n.createTextVNode(n.toDisplayString(g(P))+" ",1),e.required&&m.value.length===1&&e.label?(n.openBlock(),n.createElementBlock("span",Kw,"*")):n.createCommentVNode("",!0)],10,Yw)],10,qw))),128))],2),_.value&&C.value?(n.openBlock(),n.createElementBlock("div",Jw,[n.createVNode(n.unref(te.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),n.createTextVNode(" "+n.toDisplayString(C.value),1)])):n.createCommentVNode("",!0)])]))}}),Qw={key:0,class:"ml-1 text-destructive"},Zw={class:"relative w-full"},e1={key:0,class:"mb-2 flex items-center justify-between"},t1={class:"text-sm text-muted-foreground"},n1={class:"text-sm font-medium text-foreground"},o1={class:"text-sm text-muted-foreground"},a1={class:"relative"},r1=["id","value","min","max","step","disabled","placeholder"],s1={key:1,class:"relative mt-2"},i1={class:"text-xs text-muted-foreground mt-1"},l1={key:1,class:"flex items-center gap-1 text-sm text-destructive"},c1={name:"DCodeSlider"},Na=n.defineComponent({...c1,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(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=n.ref(),i=n.ref(!1),l=n.computed(()=>!!r.error),c=n.computed(()=>`slider-${Math.random().toString(36).substr(2,9)}`),d=n.computed(()=>(r.label||o.label)??void 0),u=n.computed(()=>!0),f=n.computed(()=>{const E={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",E[r.size],B[r.color]||B.blue,l.value?"accent-red-500":"",o.class].filter(Boolean).join(" ")}),h=n.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"}[r.size],r.color==="blue"?"focus:ring-blue-500":r.color==="green"?"focus:ring-green-500":r.color==="red"?"focus:ring-red-500":r.color==="yellow"?"focus:ring-yellow-500":r.color==="purple"?"focus:ring-purple-500":"focus:ring-gray-500"].join(" ")),m=n.computed(()=>`${r.valuePrefix}${r.modelValue}${r.valueSuffix}`),p=n.computed(()=>{const E=r.max-r.min;return(r.modelValue-r.min)/E*100}),g=E=>{const B=E.target,k=parseFloat(B.value);a("update:modelValue",k),a("input",k)},y=E=>{const B=E.target,k=parseFloat(B.value);a("change",k)},x=()=>{i.value=!0},_=()=>{i.value=!1},C=E=>{const B=r.max-r.min;return(E-r.min)/B*100},w=n.computed(()=>{const E={sm:16,md:20,lg:24};return`
|
|
66
|
+
`.trim();let r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,document.head.appendChild(r)),r.textContent=a}function Dx(e,t=dd){n.watch(e,o=>Vx(o,t),{immediate:!0})}const Mx={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Nx=["for"],Px={key:0,class:"ml-1 text-destructive"},vx=["disabled","onClick"],Tx={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},Ox=["id","value","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],zx={class:"h-full p-2 flex flex-col gap-3 w-32"},Fx=["onClick"],Ix={class:"flex items-center justify-end gap-2 w-full p-2"},Rx=["disabled","onClick"],Lx={key:1,class:"text-xs text-destructive"},Sa=n.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(e,{emit:t}){const o=n.useAttrs(),a=e,r=t,s=Math.random().toString(36).slice(2,7),i=n.computed(()=>`dcode-datepicker-${o.id||a.label||"date-picker"}-${s}`),l=n.computed(()=>{const M=o.required,T=o["aria-required"];return M===""||M===!0||M==="true"||T==="true"||T===!0}),c=n.computed(()=>!!a.error),d=n.computed({get:()=>a.modelValue,set:M=>{r("update:modelValue",M),r("change",M)}}),u=n.computed(()=>a.locale==="en"?td:Ax),f=n.computed(()=>a.range?2:!1),h=n.computed(()=>{if(!a.range)return!1;const M={partialRange:!1};return a.autoRangeDays&&a.autoRangeDays>0&&(M.maxRange=a.autoRangeDays,M.autoRange=a.autoRangeDays),M}),m=M=>{const T=new Date(M);return T.setHours(0,0,0,0),T},p=M=>{const T=new Date(M);return T.setHours(23,59,59,999),T},b=(M,T)=>{const U=new Date(M);return U.setDate(U.getDate()+T),U},g=n.computed(()=>{if(a.disablePast)return m(new Date)}),x=n.computed(()=>{if(a.maxDaysAhead&&a.maxDaysAhead>0)return p(b(new Date,a.maxDaysAhead))}),_=n.ref(null),C=n.ref(null),w=M=>{C.value={month:M.month,year:M.year}},E=n.ref(!1);let B=null;n.onMounted(()=>{const M=document.documentElement,T=()=>E.value=M.classList.contains("dark");T(),B=new MutationObserver(T),B.observe(M,{attributes:!0,attributeFilter:["class"]})}),n.onBeforeUnmount(()=>{B==null||B.disconnect(),B=null}),Dx(n.toRef(a,"tone"));const k=M=>{const T=new Date(M),U=T.getDay(),L=T.getDate()-U+(U===0?-6:1);return T.setDate(L),m(T)},y=M=>{const T=k(M);return T.setDate(T.getDate()+6),p(T)},A=M=>{const T=new Date(M);return T.setDate(1),m(T)},D=M=>{const T=new Date(M);return T.setMonth(T.getMonth()+1),T.setDate(0),p(T)},N=n.computed(()=>{if(!a.range)return[];const M=new Date,T=m(M),U=k(M),L=y(M),R=A(M),P=D(M),W=(v,z)=>{let H=v;a.disablePast&&H<T&&(H=T);let G=z;if(a.autoRangeDays&&a.autoRangeDays>0){const K=p(b(H,a.autoRangeDays-1));G>K&&(G=K)}return G<H&&(G=p(new Date(H))),[H,G]};return[{label:a.locale==="id"?"Minggu Ini":"This Week",range:W(U,L)},{label:a.locale==="id"?"Bulan Ini":"This Month",range:W(R,P)}]}),V=async M=>{var z,H;const T=a.modelType||"yyyy-MM-dd";if(M.length===0){d.value=null;return}if(M.length<2)return;const U=ld(M[0],T),L=ld(M[1],T);d.value=[U,L],await n.nextTick();const R=M[0],P=R.getMonth(),W=R.getFullYear();C.value&&C.value.month===P&&C.value.year===W||(z=_.value)==null||z.setMonthYear({month:P,year:W}),(H=_.value)==null||H.openMenu()};return(M,T)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1 w-full",n.unref(o).class])},[e.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.label?(n.openBlock(),n.createElementBlock("div",Mx)):n.createCommentVNode("",!0),T[2]||(T[2]=n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[e.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium"},[n.createTextVNode(n.toDisplayString(e.label)+" ",1),l.value?(n.openBlock(),n.createElementBlock("span",Px,"*")):n.createCommentVNode("",!0)],8,Nx)):n.createCommentVNode("",!0),n.createVNode(n.unref(Jd.VueDatePicker),{ref_key:"dpRef",ref:_,modelValue:d.value,"onUpdate:modelValue":T[1]||(T[1]=U=>d.value=U),dark:E.value,range:h.value,"multi-calendars":f.value,disabled:e.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":e.modelType,formats:{input:e.displayFormat},"min-date":g.value,"max-date":x.value,"preset-ranges":N.value,floating:{placement:e.placement,offset:8,arrow:!1,flip:!1,shift:!0},teleport:!0,"menu-class-name":"dcode-datepicker-menu","calendar-class-name":"dcode-datepicker-calendar",onUpdateMonthYear:w},n.createSlots({"dp-input":n.withCtx(({value:U,onInput:L,onEnter:R,onTab:P,onBlur:W,onFocus:v,onKeypress:z,onPaste:H,toggleMenu:G})=>[n.createElementVNode("div",{class:n.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 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":"",e.disabled?"opacity-50 cursor-not-allowed":""]])},[n.createElementVNode("button",{type:"button",tabindex:"-1",disabled:e.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=>G()},[n.createVNode(n.unref(te.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,vx),T[4]||(T[4]=n.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),e.prependInner?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("span",Tx,n.toDisplayString(e.prependInner),1),T[3]||(T[3]=n.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):n.createCommentVNode("",!0),n.createElementVNode("input",{id:i.value,value:U,placeholder:e.placeholder,disabled:e.disabled,autocomplete:"off",readonly:"",class:n.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",e.disabled?"cursor-not-allowed":"cursor-pointer"]),onClick:K=>G(),onFocus:K=>v(),onBlur:K=>W(),onInput:K=>L(K),onKeydown:[n.withKeys(K=>R(K),["enter"]),n.withKeys(K=>P(K),["tab"])],onKeypress:K=>z(K),onPaste:K=>H()},null,42,Ox)],2)]),"action-buttons":n.withCtx(({selectDate:U,selectionDisabled:L})=>[n.createElementVNode("div",Ix,[n.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:T[0]||(T[0]=R=>{var P;return(P=_.value)==null?void 0:P.closeMenu()})},n.toDisplayString(e.cancelLabel),1),n.createElementVNode("button",{type:"button",disabled:L,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:R=>U()},n.toDisplayString(e.selectLabel),9,Rx)])]),_:2},[e.range?{name:"left-sidebar",fn:n.withCtx(()=>[n.createElementVNode("div",zx,[N.value.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(N.value,U=>(n.openBlock(),n.createElementBlock("button",{key:U.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:L=>V(U.range)},n.toDisplayString(U.label),9,Fx))),128)):n.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?(n.openBlock(),n.createElementBlock("p",Lx,n.toDisplayString(a.error),1)):n.createCommentVNode("",!0)],64))],2))}}),$x=n.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const o=e,a=t,r=ce.useForwardPropsEmits(o,a);return(s,i)=>(n.openBlock(),n.createBlock(n.unref(ce.DialogRoot),n.normalizeProps(n.guardReactiveProps(n.unref(r))),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16))}}),Wx=n.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(e,{emit:t}){const o=e,a=t,r=Fe.reactiveOmit(o,"class"),s=ce.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(ce.DialogPortal),null,{default:n.withCtx(()=>[n.createVNode(n.unref(ce.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"}),n.createVNode(n.unref(ce.DialogContent),n.mergeProps({...n.unref(s),...i.$attrs},{class:n.unref(_e)("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:n.withCtx(()=>[n.renderSlot(i.$slots,"default"),n.createVNode(n.unref(ce.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:n.withCtx(()=>[n.createVNode(n.unref(te.X),{class:"w-4 h-4"}),l[0]||(l[0]=n.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),jx=n.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class"),a=ce.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ce.DialogDescription),n.mergeProps(n.unref(a),{class:n.unref(_e)("text-sm text-muted-foreground",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Ux=n.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class"),a=ce.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ce.DialogTitle),n.mergeProps(n.unref(a),{class:n.unref(_e)("text-lg font-medium leading-none tracking-tight",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Hx={key:0,class:"px-6 py-4 flex items-center justify-between border-b border-neutral-200 dark:border-neutral-800 bg-white/80 dark:bg-neutral-900/80 backdrop-blur-md sticky top-0 z-20"},qx={class:"flex items-center gap-3"},Gx={class:"flex flex-col"},Xx={key:0,class:"flex items-center gap-2"},Yx={key:1,class:"px-6 py-4 border-t border-neutral-200 dark:border-neutral-800 bg-neutral-50/50 dark:bg-neutral-900/50 sticky bottom-0 z-20"},Kx={class:"flex justify-end gap-3 flex-wrap"},So=xt(n.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(e,{emit:t}){const o=e,a=t,r=n.useAttrs(),s=n.computed(()=>{const{style:d,...u}=r;return u}),i=n.computed(()=>({maxWidth:typeof o.maxWidth=="number"?`${o.maxWidth}px`:o.maxWidth,width:"100%"})),l=n.computed(()=>o.icon?Ct[o.icon]??null:null),c=d=>{a("update:modelValue",d)};return(d,u)=>(n.openBlock(),n.createBlock(n.unref($x),{open:e.modelValue,"onUpdate:open":c},{default:n.withCtx(()=>[n.createVNode(n.unref(Wx),n.mergeProps(s.value,{style:i.value,class:"p-0 overflow-hidden rounded-xl flex flex-col max-h-[90vh] bg-white dark:bg-neutral-950 border-0",onInteractOutside:u[0]||(u[0]=f=>e.persistent?f.preventDefault():null),onEscapeKeyDown:u[1]||(u[1]=f=>e.persistent?f.preventDefault():null)}),{default:n.withCtx(()=>[e.title||d.$slots["header-append"]?(n.openBlock(),n.createElementBlock("div",Hx,[n.createElementVNode("div",qx,[l.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["p-2 rounded-lg",e.iconClass||"bg-primary/10 text-primary"])},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.value),{class:"h-5 w-5"}))],2)):n.createCommentVNode("",!0),n.createElementVNode("div",Gx,[n.createVNode(n.unref(Ux),{class:"text-lg font-bold text-neutral-900 dark:text-neutral-50 leading-tight"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1}),n.createVNode(n.unref(jx),{class:"hidden"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title||"Dialog Content"),1)]),_:1})])]),d.$slots["header-append"]?(n.openBlock(),n.createElementBlock("div",Xx,[n.renderSlot(d.$slots,"header-append",{},void 0,!0)])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["flex-1 overflow-y-auto custom-scrollbar",e.contentClass]),style:n.normalizeStyle(e.contentStyle)},[n.renderSlot(d.$slots,"default",{},void 0,!0)],6),d.$slots.actions?(n.openBlock(),n.createElementBlock("div",Yx,[n.createElementVNode("div",Kx,[n.renderSlot(d.$slots,"actions",{},void 0,!0)])])):n.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-ca4cb507"]]),ud=n.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(e){const t=e,o=n.computed(()=>Ct[t.icon]??Ct.X);return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ut),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(o.value),{size:Number(e.iconSize)},null,8,["size"]))]),_:1}))}}),Jx=n.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(_e)(n.unref(Zx)({variant:e.variant}),t.class)),role:"alert"},[n.renderSlot(o.$slots,"default")],2))}}),Qx=n.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(_e)("text-sm [&_p]:leading-relaxed",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),Zx=to("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"}}),Wn=n.defineComponent({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(_e)(n.unref(ek)({variant:e.variant}),t.class))},[n.renderSlot(o.$slots,"default")],2))}}),ek=to("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"}}),cs=n.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(_e)("rounded-xl border bg-card text-card-foreground shadow",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),ds=n.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(_e)("p-6 pt-0",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),us=n.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(_e)("flex flex-col gap-y-1.5 p-6",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),fs=n.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("h3",{class:n.normalizeClass(n.unref(_e)("font-medium leading-none tracking-tight",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),tk={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},nk={class:"flex flex-wrap items-center justify-center gap-2"},ok=["accept","multiple"],Aa=xt(n.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(e,{emit:t}){const o=e,a=t,r=n.ref(null),s=n.ref(!1),i=n.ref(null),l=n.ref(null),c=n.ref(null);n.computed(()=>o.accept||"file/*");const d=n.computed(()=>o.error??i.value);function u(){var k;o.disabled||(k=r.value)==null||k.click()}function f(k){const y=k/1024,A=y/1024;return A>=1?`${A.toFixed(2)} MB`:y>=1?`${y.toFixed(1)} KB`:`${k} B`}function h(k){var A;if(!k)return"File tidak valid";if((A=o.accept)!=null&&A.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 p(k){if(i.value=null,!k.length)return;if(o.mode==="single"){const A=k[0],D=h(A);if(D){i.value=D,a("error",D);return}o.showSelected&&m(A),a("picked",A);return}const y=[];for(const A of k){const D=h(A);if(D){i.value=D,a("error",D);return}y.push(A)}y.length&&(o.showSelected&&m(y[0]),a("picked:multiple",y))}function b(k){const y=k.target,A=Array.from(y.files??[]);p(A),y.value=""}function g(){o.disabled||(s.value=!0)}function x(){o.disabled||(s.value=!0)}function _(){s.value=!1}function C(k){var D,N;if(o.disabled)return;s.value=!1;const y=Array.from(((D=k.dataTransfer)==null?void 0:D.files)??[]),A=(N=o.accept)!=null&&N.includes("image/")?y.filter(V=>V.type.startsWith("image/")):y;p(A)}const w=n.computed(()=>(o.accept||"file/*").split(",").map(k=>k.trim()).filter(Boolean).map(k=>k==="image/*"?"IMAGE":k.replace(/^image\//,"").replace(/^\./,"")).join(", "));n.computed(()=>`${o.maxSizeMb??0}MB`);const E=n.ref(!1),B=n.computed(()=>{if(o.disabled||!E.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)=>(n.openBlock(),n.createBlock(n.unref(cs),{class:n.normalizeClass([e.disabled?"opacity-60":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:n.withCtx(()=>[n.createVNode(n.unref(us),{class:"pb-2"},{default:n.withCtx(()=>[n.createVNode(n.unref(fs),{class:"text-sm font-semibold dark:text-neutral-100"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label),1)]),_:1})]),_:1}),n.createVNode(n.unref(ds),{class:"pt-2"},{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.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",e.disabled?"is-disabled":""]]),style:n.normalizeStyle([{minHeight:"190px"},B.value]),onClick:u,onDragenter:n.withModifiers(g,["prevent"]),onDragover:n.withModifiers(x,["prevent"]),onDragleave:n.withModifiers(_,["prevent"]),onDrop:n.withModifiers(C,["prevent"]),onMouseenter:y[0]||(y[0]=A=>E.value=!0),onMouseleave:y[1]||(y[1]=A=>E.value=!1)},[n.createElementVNode("div",tk,[y[2]||(y[2]=n.createElementVNode("div",{class:"text-sm font-medium dark:text-neutral-200"},"Drag & drop file di sini",-1)),y[3]||(y[3]=n.createElementVNode("div",{class:"text-xs text-muted-foreground dark:text-neutral-400"},"atau klik area ini untuk memilih file",-1)),n.createElementVNode("div",nk,[n.createVNode(n.unref(Wn),{variant:"secondary",class:"text-[11px] dark:bg-neutral-700 dark:text-neutral-300"},{default:n.withCtx(()=>[n.createTextVNode(" Allowed: "+n.toDisplayString(w.value),1)]),_:1}),n.createVNode(n.unref(Wn),{variant:"secondary",class:"text-[11px] dark:bg-neutral-700 dark:text-neutral-300"},{default:n.withCtx(()=>[n.createTextVNode(" Max: "+n.toDisplayString(o.maxSizeMb)+"MB ",1)]),_:1})]),e.showSelected&&l.value?(n.openBlock(),n.createBlock(n.unref(Wn),{key:0,variant:"secondary",class:"mt-2 dark:bg-neutral-700 dark:text-neutral-300"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(l.value)+" • "+n.toDisplayString(c.value?f(c.value):""),1)]),_:1})):n.createCommentVNode("",!0)]),n.createElementVNode("input",{ref_key:"fileInputEl",ref:r,type:"file",class:"hidden",accept:e.accept,multiple:e.mode==="multiple",onChange:b},null,40,ok)],38),d.value?(n.openBlock(),n.createBlock(n.unref(Jx),{key:0,variant:"destructive",class:"mt-3"},{default:n.withCtx(()=>[n.createVNode(n.unref(Qx),{class:"text-sm"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(d.value),1)]),_:1})]),_:1})):n.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"]))}}),[["__scopeId","data-v-02ca61c0"]]),ak={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},rk=["src"],sk={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"},ik={class:"space-y-0.5"},lk={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},ck={class:"text-xs opacity-70"},dk=["disabled"],uk={key:1},fk=["disabled"],hk={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},mk={class:"flex gap-2"},pk={class:"font-medium truncate"},gk={class:"flex gap-2"},bk={class:"font-medium"},yk={class:"flex gap-2"},xk={class:"font-medium truncate"},hs=xt(n.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(e,{emit:t}){const o=e,a=t,r=n.ref(null),s=n.computed(()=>o.forceFileIcon||!o.file?!1:(o.file.type||"").startsWith("image/"));n.watch(()=>o.file,m=>{r.value&&URL.revokeObjectURL(r.value),r.value=m?URL.createObjectURL(m):null},{immediate:!0}),n.onBeforeUnmount(()=>{r.value&&URL.revokeObjectURL(r.value),u&&u.disconnect()});function i(m){const p=m/1024,b=p/1024;return b>=1?`${b.toFixed(2)} MB`:p>=1?`${p.toFixed(1)} KB`:`${m} B`}const l=n.computed(()=>o.file?{name:o.file.name,size:i(o.file.size),type:o.file.type||"unknown"}:null),c=n.ref(!1),d=n.ref(!1);let u=null;const f=()=>{typeof document<"u"&&(d.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};n.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=n.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,p)=>e.file?(n.openBlock(),n.createBlock(cs,{key:0,class:n.normalizeClass([e.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:n.withCtx(()=>[n.createVNode(us,{class:"pb-2"},{default:n.withCtx(()=>[n.createVNode(fs,{class:"text-sm font-semibold dark:text-neutral-100"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1}),e.description?(n.openBlock(),n.createElementBlock("div",ak,n.toDisplayString(e.description),1)):n.createCommentVNode("",!0)]),_:1}),n.createVNode(ds,{class:"pt-2"},{default:n.withCtx(()=>{var b,g,x,_,C;return[n.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-800/50 border-border dark:border-neutral-700 w-full",style:n.normalizeStyle([{height:`${e.previewHeight}px`},h.value]),onMouseenter:p[2]||(p[2]=w=>c.value=!0),onMouseleave:p[3]||(p[3]=w=>c.value=!1)},[s.value&&r.value?(n.openBlock(),n.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,rk)):(n.openBlock(),n.createElementBlock("div",sk,[n.createVNode(n.unref(te.FileText),{class:"w-10 h-10"}),n.createElementVNode("div",ik,[n.createElementVNode("p",lk,n.toDisplayString((b=l.value)==null?void 0:b.name),1),n.createElementVNode("p",ck,n.toDisplayString((g=l.value)==null?void 0:g.size),1)])])),n.createElementVNode("div",{class:"d-action-buttons",style:n.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"})},[e.showEdit&&s.value?(n.openBlock(),n.createElementBlock("button",{key:0,disabled:e.disabled,class:"d-action-btn shadow-md",style:n.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:e.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:p[0]||(p[0]=w=>a("edit"))},[n.createVNode(n.unref(te.Pencil),{style:{width:"16px",height:"16px"}})],12,dk)):(n.openBlock(),n.createElementBlock("div",uk)),e.showRemove?(n.openBlock(),n.createElementBlock("button",{key:2,disabled:e.disabled,class:"d-action-btn shadow-md",style:n.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:e.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:p[1]||(p[1]=w=>a("remove"))},[n.createVNode(n.unref(te.Trash2),{style:{width:"16px",height:"16px"}})],12,fk)):n.createCommentVNode("",!0)],4),n.createElementVNode("div",{class:"d-metadata-overlay",style:n.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"})},[n.createElementVNode("div",hk,[n.createElementVNode("div",mk,[p[4]||(p[4]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),n.createElementVNode("span",pk,n.toDisplayString((x=l.value)==null?void 0:x.name),1)]),n.createElementVNode("div",gk,[p[5]||(p[5]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),n.createElementVNode("span",bk,n.toDisplayString((_=l.value)==null?void 0:_.size),1)]),n.createElementVNode("div",yk,[p[6]||(p[6]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),n.createElementVNode("span",xk,n.toDisplayString((C=l.value)==null?void 0:C.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-4f5c1d5e"]]);function ms(){const e=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:e,success:(s,i)=>e({type:"success",message:s,title:i}),error:(s,i)=>e({type:"error",message:s,title:i}),warning:(s,i)=>e({type:"warning",message:s,title:i}),info:(s,i)=>e({type:"info",message:s,title:i})}}const kk={class:"space-y-3"},wk={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"},fd=n.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(e,{emit:t}){const o=e,a=t,r=n.computed({get:()=>o.modelValue,set:B=>a("update:modelValue",B)}),s=n.ref(null),i=n.ref(null);function l(B){i.value=B,a("error",B)}function c(){i.value=null}const d=n.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 f=n.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}),h=n.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(A=>A.includes("/")?k===A:A.startsWith(".")?y===A:y===`.${A}`)}if(o.accept){if(o.accept==="*/*")return!0;const k=o.accept.split(",").map(D=>D.trim().toLowerCase()),y=(B.type||"").toLowerCase(),A=u(B.name);return k.some(D=>{if(D.endsWith("/*")){const N=D.slice(0,-2);return y.startsWith(N)}return D.startsWith(".")?A===D:y===D})}return!0}function p(B){return B*1024*1024}async function b(B){return B?m(B)?o.minSizeMb!=null&&B.size<p(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&B.size>p(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${h.value}`:"File tidak valid"}const{DCodeApi:g}=Je(),x=ms(),_=n.ref(!1);async function C(B){var k;if(o.uploadFn){try{_.value=!0;const y=await o.uploadFn(B);r.value=B,a("uploaded",y)}catch(y){console.error("Upload Error",y),x.error("Upload Failed",(y==null?void 0:y.message)||"Unknown error"),l((y==null?void 0:y.message)||"Upload Failed")}finally{_.value=!1}return}if(!((k=o.endpoint)!=null&&k.apiUrl)){r.value=B;return}if(typeof g!="function"){l("useApi() must expose DCodeApi()");return}try{_.value=!0;const y=new FormData;y.append("doc",B);const A=(o.endpoint.apiMethod||"POST").toUpperCase(),D=o.endpoint.apiUrl,N=await g("","",y,{_url:D,_method:A,withCredentials:!0,transformRequest:[(M,T)=>(T&&(delete T["Content-Type"],delete T["content-type"]),M)]}),V=(N==null?void 0:N.data)??N;r.value=B,a("uploaded",V)}catch(y){console.error("Upload Error",y),x.error("Upload Failed",(y==null?void 0:y.message)||"Unknown error"),l((y==null?void 0:y.message)||"Upload Failed")}finally{_.value=!1}}async function w(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 C(B):r.value=B}function E(){c(),r.value=null,s.value=null}return n.watch(()=>o.modelValue,B=>{B&&!s.value&&(s.value=B),B||(s.value=null)},{immediate:!0}),(B,k)=>(n.openBlock(),n.createElementBlock("div",kk,[r.value?_.value?(n.openBlock(),n.createElementBlock("div",wk,[...k[1]||(k[1]=[n.createElementVNode("span",{class:"text-sm text-muted-foreground dark:text-neutral-400 animate-pulse"},"Uploading...",-1)])])):(n.openBlock(),n.createBlock(hs,{key:2,file:r.value,title:e.label,description:e.hint,disabled:e.disabled,"show-edit":!1,"show-replace":!1,"show-remove":!0,"force-file-icon":!0,"preview-height":e.previewHeight,"preview-width":e.previewWidth,onRemove:E},null,8,["file","title","description","disabled","preview-height","preview-width"])):(n.openBlock(),n.createBlock(Aa,{key:0,label:e.label,hint:e.hint,accept:f.value,maxSizeMb:e.maxSizeMb,disabled:e.disabled||_.value,onPicked:w,error:i.value,onError:k[0]||(k[0]=y=>l(y))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),Ck=["for"],_k={key:0,class:"!ml-1 !text-destructive"},Bk={class:"relative w-full block box-border"},Ek={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},Sk=["id","readonly","disabled","placeholder"],Ak={class:"absolute inset-y-0 right-4 flex items-center z-10"},Vk={key:1,class:"absolute z-50 mt-1 w-full rounded-xl border bg-white dark:bg-neutral-900 shadow-lg box-border"},Dk={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},Mk={key:1,class:"text-sm text-muted-foreground text-center"},Nk=["onClick","title"],Pk={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},vk={class:"flex items-center justify-center flex-1"},Tk={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},Ok={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},hd=n.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(e,{emit:t}){const o=e,a=t,r=Ct,s=n.ref(null),i=n.ref(null),l=Math.random().toString(36).slice(2,7),c=n.computed(()=>`dcode-icon-dropdown-${o.label||"icon-dropdown"}-${l}`),d=n.ref(!1),u=n.computed(()=>(o.modelValue??"").trim()||""),f=n.ref(""),h=n.ref(!1),m=n.ref(!1),p=n.ref(!1),b=n.shallowRef([]),g=n.ref(o.pageSize),x=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),_=async()=>{if(m.value||p.value)return;p.value=!0,await new Promise(z=>setTimeout(z,0));const v=Object.keys(r).filter(z=>!x.has(z)).filter(z=>/^[A-Z]/.test(z)).filter(z=>typeof r[z]=="function"||typeof r[z]=="object"&&r[z]).sort((z,H)=>z.localeCompare(H));b.value=v,m.value=!0,p.value=!1},C=n.computed(()=>!m.value||!u.value||!b.value.includes(u.value)?null:r[u.value]),w=n.ref(u.value),E=n.computed(()=>!!u.value&&!d.value),B=n.computed(()=>{if(!m.value)return[];const v=(f.value??"").trim().toLowerCase();return v?b.value.filter(z=>z.toLowerCase().includes(v)):b.value}),k=n.computed(()=>B.value.slice(0,g.value)),y=n.computed(()=>{const v=o.columns;return v<=2?"grid-cols-2":v===3?"grid-cols-3":v===4?"grid-cols-4":v===5?"grid-cols-5":v>=8?"grid-cols-8":"grid-cols-6"});n.computed(()=>o.clearable?"!pr-10":"!pr-3"),n.computed(()=>C.value&&!d.value?"!pl-12":"!pl-3");const A=async()=>{var v;await n.nextTick(),(v=i.value)==null||v.focus()},D=async v=>{if(o.disabled)return;const z=v!==!1;if(h.value){h.value=!1;return}d.value=!0,await _(),z&&(f.value="",w.value=""),g.value=o.pageSize,await A()},N=()=>{d.value=!1,f.value="",w.value=u.value,g.value=o.pageSize},V=async()=>{o.disabled||(d.value?N():await D())};let M=null;const T=async v=>{if(o.disabled)return;a("update:modelValue",null),d.value||await D(!1),M&&clearTimeout(M);const z=w.value;M=setTimeout(()=>{f.value=z},300)},U=v=>{o.disabled||(a("update:modelValue",v),N(),queueMicrotask(()=>{var z;return(z=i.value)==null?void 0:z.blur()}))},L=()=>{o.disabled||(a("update:modelValue",null),a("clear"),h.value=!0,N(),queueMicrotask(()=>{var v;return(v=i.value)==null?void 0:v.focus()}))},R=v=>{if(v.key==="Escape"){v.preventDefault(),N();return}if(v.key==="Enter"&&d.value){const z=B.value[0];z&&(v.preventDefault(),U(z))}},P=v=>{if(!d.value)return;const z=v.target;s.value&&!s.value.contains(z)&&N()},W=v=>{const z=v.target;z.scrollTop+z.clientHeight>=z.scrollHeight-24&&g.value<B.value.length&&(g.value=Math.min(g.value+o.pageSize,B.value.length))};return n.onMounted(()=>{document.addEventListener("mousedown",P),queueMicrotask(()=>{var v;i.value=((v=s.value)==null?void 0:v.querySelector("input"))??null}),u.value&&_()}),n.onBeforeUnmount(()=>{document.removeEventListener("mousedown",P),M&&clearTimeout(M)}),n.watch(u,v=>{d.value||(w.value=v)}),n.watch(()=>f.value,()=>{g.value=o.pageSize}),(v,z)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"rootEl",ref:s,class:"!w-full !block !box-border"},[o.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:c.value,class:"!text-sm !font-medium !mb-1 !block"},[n.createTextVNode(n.toDisplayString(o.label)+" ",1),o.required?(n.openBlock(),n.createElementBlock("span",_k,"*")):n.createCommentVNode("",!0)],8,Ck)):n.createCommentVNode("",!0),n.createElementVNode("div",Bk,[C.value&&!d.value?(n.openBlock(),n.createElementBlock("div",Ek,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(C.value),{size:18}))])):n.createCommentVNode("",!0),n.withDirectives(n.createElementVNode("input",{id:c.value,"onUpdate:modelValue":z[0]||(z[0]=H=>w.value=H),readonly:E.value,disabled:o.disabled,placeholder:o.placeholder,class:n.normalizeClass(["w-full h-10 m-0 py-0 rounded-lg border bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 pr-10 outline-none box-border truncate",[C.value&&!d.value?"pl-10":"pl-4",E.value?"cursor-pointer select-none":""]]),onClick:D,onFocus:D,onInput:T,onKeydown:R},null,42,Sk),[[n.vModelText,w.value]]),n.createElementVNode("div",Ak,[o.clearable&&u.value?(n.openBlock(),n.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:z[1]||(z[1]=n.withModifiers(()=>{},["prevent"])),onClick:L,title:"Clear"},[n.createVNode(n.unref(te.X),{class:"h-4 w-4"})],32)):(n.openBlock(),n.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:z[2]||(z[2]=n.withModifiers(()=>{},["prevent"])),onClick:V,title:"Open"},[n.createVNode(n.unref(te.ChevronDown),{class:"h-4 w-4"})],32))]),d.value?(n.openBlock(),n.createElementBlock("div",Vk,[n.createElementVNode("div",{class:"p-2 overflow-auto",style:n.normalizeStyle({maxHeight:o.maxHeight}),onScroll:W},[p.value?(n.openBlock(),n.createElementBlock("div",Dk,[n.createVNode(n.unref(te.Loader2),{class:"h-4 w-4 animate-spin"}),z[3]||(z[3]=n.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):m.value&&B.value.length===0?(n.openBlock(),n.createElementBlock("div",Mk," Icon tidak ditemukan ")):(n.openBlock(),n.createElementBlock("div",{key:2,class:n.normalizeClass(["grid gap-2",y.value])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(k.value,H=>(n.openBlock(),n.createElementBlock("button",{key:H,type:"button",class:n.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===H?"ring-1 ring-primary":""]),onClick:G=>U(H),title:H},[n.createElementVNode("div",Pk,[n.createElementVNode("div",vk,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(r)[H]),{size:o.iconSize,class:"shrink-0"},null,8,["size"]))]),n.createElementVNode("span",Tk,n.toDisplayString(H),1)])],10,Nk))),128))],2)),m.value&&B.value.length>0?(n.openBlock(),n.createElementBlock("div",Ok," Showing "+n.toDisplayString(k.value.length)+" / "+n.toDisplayString(B.value.length),1)):n.createCommentVNode("",!0)],36)])):n.createCommentVNode("",!0)])],512))}}),zk={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},Fk={class:"flex items-center justify-between border-b dark:border-neutral-800 px-6 py-4"},Ik={class:"relative overflow-auto p-0"},ps=n.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(e,{emit:t}){const o=e,a=t,r=n.computed({get:()=>o.modelValue,set:C=>a("update:modelValue",C)}),s=n.ref(null),i=n.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(C,w,E,B,k){const y=await new Promise((N,V)=>{const M=URL.createObjectURL(C),T=new Image;T.onload=()=>{URL.revokeObjectURL(M),N(T)},T.onerror=U=>{URL.revokeObjectURL(M),V(U)},T.src=M}),A=document.createElement("canvas");A.width=w,A.height=E;const D=A.getContext("2d");return D?(D.drawImage(y,0,0,w,E),await new Promise(N=>{A.toBlob(V=>N(V||C),B,k)})):C}function m(){if(!l||!i.value)return;const C=l.getPlugin("Dashboard"),w=l.getFile(i.value);!C||!w||requestAnimationFrame(()=>{try{C.openFileEditor(w)}catch{try{C.openFileEditor(i.value)}catch{}}})}async function p(C){if(l){l.cancelAll(),i.value=null;try{const w=l.addFile({name:C.name,type:C.type,data:C,source:"Local",isRemote:!1});i.value=String(w)}catch{}}}function b(){if(!s.value)return;l&&f(),l=new Qd({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const C=document.documentElement.classList.contains("dark");l.use(Os,{target:s.value,inline:!0,height:480,theme:C?"dark":"light",proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),u=new MutationObserver(()=>{if(!l)return;const w=document.documentElement.classList.contains("dark"),E=l.getPlugin("Dashboard");E&&E.setOptions({theme:w?"dark":"light"})}),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(Zd,{target:Os,quality:o.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:o.aspectRatio==null?Number.NaN:o.aspectRatio}}),l.on("file-editor:cancel",()=>{r.value=!1}),l.on("file-added",w=>{i.value=(w==null?void 0:w.id)??null,o.autoOpenEditor&&setTimeout(()=>m(),80)}),l.on("file-editor:complete",async w=>{const E=++d;try{const B=w.data,k=B.type||w.type||"image/jpeg";let y=B;if(o.outputWidth&&o.outputHeight&&(y=await h(B,o.outputWidth,o.outputHeight,k,o.quality)),c||E!==d)return;const A=w.name||"edited-image.jpg",D=new File([y],A,{type:k});await g(D,"UPPY_EDITOR_COMPLETE"),a("done",D),r.value=!1}catch{}})}async function g(C,w="CROP_RESULT"){const E=URL.createObjectURL(C);try{const B=await new Promise((k,y)=>{const A=new Image;A.onload=()=>k(A),A.onerror=y,A.src=E});console.group(w),console.log("file:",C),console.table({name:C.name,type:C.type,sizeBytes:C.size,sizeMB:+(C.size/1024/1024).toFixed(3),width:B.naturalWidth,height:B.naturalHeight,ratio:+(B.naturalWidth/B.naturalHeight).toFixed(4)}),console.log("previewUrl:",E),console.groupEnd()}finally{URL.revokeObjectURL(E)}}n.watch(r,async C=>{c=!C,d++,C?(await n.nextTick(),b(),o.file&&await p(o.file)):f()},{flush:"post"}),n.watch(()=>o.file,async C=>{r.value&&C&&(await n.nextTick(),await p(C))}),n.onBeforeUnmount(()=>{c=!0,d++,f()});const x=C=>{C.key==="Escape"&&r.value&&(r.value=!1)};n.watch(r,C=>{C?globalThis.addEventListener("keydown",x):globalThis.removeEventListener("keydown",x)},{immediate:!0});const _=n.ref(!1);return(C,w)=>r.value?(n.openBlock(),n.createElementBlock("div",zk,[n.createVNode(n.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:n.withCtx(()=>[r.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:w[0]||(w[0]=E=>r.value=!1)})):n.createCommentVNode("",!0)]),_:1}),n.createVNode(n.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:n.withCtx(()=>[r.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"relative flex w-fit max-w-4xl flex-col overflow-hidden rounded-xl border border-border dark:border-neutral-800 bg-background dark:bg-neutral-900 shadow-2xl transition-all",onClick:w[4]||(w[4]=n.withModifiers(()=>{},["stop"]))},[n.createElementVNode("div",Fk,[w[6]||(w[6]=n.createElementVNode("h3",{class:"text-lg font-semibold leading-none tracking-tight dark:text-neutral-100"}," Crop & Resize ",-1)),n.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:n.normalizeStyle({opacity:_.value?1:.7}),onClick:w[1]||(w[1]=E=>r.value=!1),onMouseenter:w[2]||(w[2]=E=>_.value=!0),onMouseleave:w[3]||(w[3]=E=>_.value=!1)},[n.createVNode(n.unref(te.X),{class:"h-4 w-4"}),w[5]||(w[5]=n.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),n.createElementVNode("div",Ik,[n.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):n.createCommentVNode("",!0)]),_:1})])):n.createCommentVNode("",!0)}}),Rk={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Lk=["src"],$k=["disabled"],Wk=["disabled"],jk={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},Uk={class:"flex gap-2"},Hk={class:"font-medium truncate"},qk={class:"flex gap-2"},Gk={class:"font-medium"},Xk={class:"flex gap-2"},Yk={class:"font-medium truncate"},gs=xt(n.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(e,{emit:t}){const o=e,a=t,r=n.ref(null);n.watch(()=>o.file,h=>{r.value&&URL.revokeObjectURL(r.value),r.value=h?URL.createObjectURL(h):null},{immediate:!0}),n.onBeforeUnmount(()=>{r.value&&URL.revokeObjectURL(r.value),d&&d.disconnect()});function s(h){const m=h/1024,p=m/1024;return p>=1?`${p.toFixed(2)} MB`:m>=1?`${m.toFixed(1)} KB`:`${h} B`}const i=n.computed(()=>o.file?{name:o.file.name,size:s(o.file.size),type:o.file.type||"unknown"}:null),l=n.ref(!1),c=n.ref(!1);let d=null;const u=()=>{typeof document<"u"&&(c.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};n.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=n.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)=>e.file?(n.openBlock(),n.createBlock(cs,{key:0,class:n.normalizeClass([e.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:n.withCtx(()=>[n.createVNode(us,{class:"pb-2"},{default:n.withCtx(()=>[n.createVNode(fs,{class:"text-sm font-semibold dark:text-neutral-100"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1}),e.description?(n.openBlock(),n.createElementBlock("div",Rk,n.toDisplayString(e.description),1)):n.createCommentVNode("",!0)]),_:1}),n.createVNode(ds,{class:"pt-2"},{default:n.withCtx(()=>{var p,b,g;return[n.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-800/50 border-border dark:border-neutral-700 w-full",style:n.normalizeStyle([{height:`${e.previewHeight}px`},f.value]),onMouseenter:m[2]||(m[2]=x=>l.value=!0),onMouseleave:m[3]||(m[3]=x=>l.value=!1)},[r.value?(n.openBlock(),n.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Lk)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"d-action-buttons",style:n.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"})},[e.showEdit?(n.openBlock(),n.createElementBlock("button",{key:0,disabled:e.disabled,class:"d-action-btn shadow-md",style:n.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:e.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]=x=>a("edit"))},[n.createVNode(n.unref(te.Pencil),{style:{width:"16px",height:"16px"}})],12,$k)):n.createCommentVNode("",!0),e.showRemove?(n.openBlock(),n.createElementBlock("button",{key:1,disabled:e.disabled,class:"d-action-btn shadow-md",style:n.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:e.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]=x=>a("remove"))},[n.createVNode(n.unref(te.Trash2),{style:{width:"16px",height:"16px"}})],12,Wk)):n.createCommentVNode("",!0)],4),n.createElementVNode("div",{class:"d-metadata-overlay",style:n.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"})},[n.createElementVNode("div",jk,[n.createElementVNode("div",Uk,[m[4]||(m[4]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),n.createElementVNode("span",Hk,n.toDisplayString((p=i.value)==null?void 0:p.name),1)]),n.createElementVNode("div",qk,[m[5]||(m[5]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),n.createElementVNode("span",Gk,n.toDisplayString((b=i.value)==null?void 0:b.size),1)]),n.createElementVNode("div",Xk,[m[6]||(m[6]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),n.createElementVNode("span",Yk,n.toDisplayString((g=i.value)==null?void 0:g.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-72c623f7"]]),Kk={class:"space-y-3"},Va=n.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(e,{emit:t}){const o=e,a=t,r=n.computed({get:()=>o.modelValue,set:L=>a("update:modelValue",L)}),s=n.ref(!1),i=n.ref(null),l=n.ref(null),c=n.ref(null);function d(L){c.value=L,a("error",L)}function u(){c.value=null}const f=n.computed(()=>{const L=(o.allowedTypes??"").trim();return L?L.split(/[,\s;]+/g).map(P=>P.trim().toLowerCase()).filter(Boolean).map(P=>P.includes("/")||P.startsWith(".")?P:`.${P}`):[]});function h(L){const R=L.lastIndexOf(".");return R>=0?L.slice(R).toLowerCase():""}const m=n.computed(()=>{if(f.value.length){const L=f.value.filter(P=>P.startsWith("."));return[...f.value.filter(P=>P.includes("/")),...L].join(",")}return o.accept||"image/*"}),p=n.computed(()=>f.value.length?f.value.join(", "):o.accept||"image/*");function b(L){if(f.value.length){const P=(L.type||"").toLowerCase(),W=h(L.name);return f.value.some(v=>v.includes("/")?P===v:v.startsWith(".")?W===v:W===`.${v}`)}return(o.accept||"image/*").toLowerCase().includes("image/")?(L.type||"").toLowerCase().startsWith("image/"):!0}function g(L){return L*1024*1024}async function x(L){var R;return(R=L.type)!=null&&R.startsWith("image/")?await new Promise(P=>{const W=URL.createObjectURL(L),v=new Image;v.onload=()=>{URL.revokeObjectURL(W),P({w:v.naturalWidth,h:v.naturalHeight})},v.onerror=()=>{URL.revokeObjectURL(W),P(null)},v.src=W}):null}async function _(L){if(!(o.minWidth!=null||o.minHeight!=null||o.maxWidth!=null||o.maxHeight!=null))return null;const P=await x(L);return P?o.minWidth!=null&&P.w<o.minWidth?`Lebar gambar minimal ${o.minWidth}px`:o.minHeight!=null&&P.h<o.minHeight?`Tinggi gambar minimal ${o.minHeight}px`:o.maxWidth!=null&&P.w>o.maxWidth?`Lebar gambar maksimal ${o.maxWidth}px`:o.maxHeight!=null&&P.h>o.maxHeight?`Tinggi gambar maksimal ${o.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function C(L){return L?b(L)?o.minSizeMb!=null&&L.size<g(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&L.size>g(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:await _(L):`only Allowed: ${p.value}`:"File tidak valid"}function w(L){o.disabled||(i.value=L,s.value=!0)}async function E(L){if(o.disabled)return;u();const R=await C(L);if(R){d(R);return}l.value=L,w(L)}const{DCodeApi:B}=Je(),k=ms(),y=n.ref(!1);n.ref(null);function A(L,R){return!L||!R?null:L.replace(/\/+$/,"")+"/"+R.replace(/^\/+/,"")}function D(L){var v;const R=(L==null?void 0:L.data)??L,P=(v=R==null?void 0:R.data)==null?void 0:v[0];if(!P)return null;const W=A(P.server,P.url);return{...P,fullUrl:W?encodeURI(W):null}}async function N(L){var R;if(o.uploadFn){try{y.value=!0;const P=await o.uploadFn(L);r.value=L,a("uploaded",P)}catch(P){console.error("Upload Error",P),k.error("Upload Failed",(P==null?void 0:P.message)||"Unknown error"),d((P==null?void 0:P.message)||"Upload Failed")}finally{y.value=!1}return}if(!((R=o.endpoint)!=null&&R.apiUrl)){r.value=L;return}if(typeof B!="function"){d("useApi() must expose DCodeApi()");return}try{y.value=!0;const P=new FormData;P.append("doc",L);const W=(o.endpoint.apiMethod||"POST").toUpperCase(),v=o.endpoint.apiUrl,z=await B("","",P,{_url:v,_method:W,withCredentials:!0,transformRequest:[(G,K)=>(K&&(delete K["Content-Type"],delete K["content-type"]),G)]}),H=(z==null?void 0:z.data)??z;D(H),r.value=L,a("uploaded",H)}catch(P){console.error("Upload Error",P),k.error("Upload Failed",(P==null?void 0:P.message)||"Unknown error"),d((P==null?void 0:P.message)||"Upload Failed")}finally{y.value=!1}}async function V(L){var R;u(),o.uploadFn||(R=o.endpoint)!=null&&R.apiUrl?await N(L):r.value=L,s.value=!1,i.value=null}function M(){s.value=!1,i.value=null}async function T(){if(!r.value)return;u();const L=o.editUseOriginal?l.value??r.value:r.value,R=await C(L);if(R){d(R);return}w(L)}function U(){u(),r.value=null,i.value=null,s.value=!1,l.value=null}return n.watch(()=>o.modelValue,L=>{L&&!l.value&&(l.value=L),L||(l.value=null)},{immediate:!0}),(L,R)=>(n.openBlock(),n.createElementBlock("div",Kk,[r.value?(n.openBlock(),n.createBlock(gs,{key:1,file:r.value,title:e.label,description:e.description,"preview-width":e.previewWidth,disabled:e.disabled,"show-edit":!0,"show-remove":!0,"show-replace":!1,onEdit:T,onRemove:U,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(n.openBlock(),n.createBlock(Aa,{key:0,label:e.label,hint:e.hint,accept:m.value,maxSizeMb:e.maxSizeMb,disabled:e.disabled,onPicked:E,error:c.value,onError:R[0]||(R[0]=P=>d(P))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),n.createVNode(ps,{modelValue:s.value,"onUpdate:modelValue":R[1]||(R[1]=P=>s.value=P),file:i.value,title:e.title,description:e.description,"auto-open-editor":e.autoOpenEditor,"aspect-ratio":e.aspectRatio,"output-width":e.outputWidth,"output-height":e.outputHeight,quality:e.quality,onDone:V,onCancel:M},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),jn=n.defineComponent({name:"DCodeLabel",inheritAttrs:!1,__name:"DCodeLabel",props:{label:{},text:{},textSize:{},textType:{},icon:{},iconClass:{}},setup(e){const t=n.useAttrs(),o=e,a=n.computed(()=>o.icon&&Ct[o.icon]||null),r=n.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=n.computed(()=>s[o.textSize??"xs"]??"w-3 h-3"),l=n.computed(()=>o.textType==="BOLD"?"font-bold":o.textType==="ITALIC"?"italic font-normal":"font-normal"),c=n.computed(()=>{const u=`${r.value} ${l.value} text-slate-600 ml-1 inline-flex items-center gap-1`,f=t.class??"";return[u,f].filter(Boolean).join(" ")}),d=n.computed(()=>{const{class:u,...f}=t;return f});return(u,f)=>(n.openBlock(),n.createElementBlock("span",n.mergeProps({class:c.value},d.value),[a.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(a.value),{key:0,class:n.normalizeClass(["shrink-0",i.value,e.iconClass])},null,8,["class"])):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(e.label||e.text),1)],16))}}),Jk=["aria-busy"],Qk={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Zk=["for"],ew={key:0,class:"ml-1 text-destructive"},tw=["id","disabled"],nw={class:"min-w-0 flex-1 text-left"},ow={key:0,class:"flex flex-wrap gap-1.5"},aw={class:"max-w-[220px] truncate"},rw=["onClick"],sw={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"},iw={key:1,class:"text-muted-foreground truncate"},lw={class:"flex items-center gap-2 shrink-0"},cw={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},dw=["placeholder","onKeydown"],uw={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},fw=["disabled","onClick"],hw={class:"truncate"},mw={key:0,class:"text-primary-600 dark:text-primary-400"},pw={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},gw={key:0},bw={key:1},yw={key:1,class:"text-xs text-destructive"},bs=n.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(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=n.computed(()=>(r.label||o.label)??void 0),i=n.computed(()=>r.visible??!0),l=Math.random().toString(36).slice(2,7),c=n.computed(()=>`app-multiselect-${o.id||s.value||"field"}-${l}`),d=n.computed(()=>{if(r.required)return!0;const ee=o.required,ne=o["aria-required"];return ee===""||ee===!0||ee==="true"||(ne==="true"||ne===!0)}),u=n.computed(()=>!!r.error);function f(ee){return ee?typeof r.itemTitle=="function"?r.itemTitle(ee)??"":String((ee==null?void 0:ee[r.itemTitle])??""):""}function h(ee){return ee?typeof r.itemValue=="function"?r.itemValue(ee):ee==null?void 0:ee[r.itemValue]:null}function m(ee,ne){return h(ee)??ne}const p=n.computed(()=>Array.isArray(r.modelValue)?r.modelValue:[]),b=n.computed(()=>{var ee;return!!((ee=r.endpoint)!=null&&ee.apiUrl)||!!r.fetchItems}),g=n.ref([]),x=n.ref(!1),_=n.ref(!1),C=n.computed(()=>{var ne;const ee=(ne=r.endpoint)==null?void 0:ne.apiOptions;if(ee)return typeof ee=="function"?ee():ee}),w=n.computed(()=>{var be,We;const ee=((be=r.endpoint)==null?void 0:be.apiUrl)??"",ne=(((We=r.endpoint)==null?void 0:We.apiMethod)??"GET").toUpperCase(),re=JSON.stringify(C.value??null);return`${ne} ${ee} :: ${re}`}),E=n.computed(()=>b.value?g.value:r.items||[]);async function B(){var ee;if(b.value&&!(!((ee=r.endpoint)!=null&&ee.apiUrl)&&!r.fetchItems)&&!x.value){x.value=!0;try{let ne;if(r.fetchItems){const re=await r.fetchItems(),be=(re==null?void 0:re.data)??re;ne=(be==null?void 0:be.data)??be}else{const{DCodeApi:re}=Je();if(typeof re!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const be={page:1,perPage:100,...C.value||{}},We=await re("","",be,{_url:r.endpoint.apiUrl,_method:(r.endpoint.apiMethod||"GET").toUpperCase()}),Pt=(We==null?void 0:We.data)??We;ne=(Pt==null?void 0:Pt.data)??Pt}g.value=Array.isArray(ne)?ne:[],_.value=!0}catch(ne){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",ne),g.value=[]}finally{x.value=!1}}}n.watch(()=>w.value,()=>{g.value=[],_.value=!1}),n.onMounted(()=>{r.autoFetchOnMount&&b.value&&B()});const k=n.computed(()=>{const ee=p.value;if(r.returnObject)return ee;const ne=new Map;for(const re of E.value)ne.set(h(re),re);return ee.map(re=>ne.get(re)??{[r.itemValue]:re,[r.itemTitle]:String(re)})}),y=n.computed(()=>r.maxChips===null?k.value:k.value.slice(0,r.maxChips));function A(ee){const ne=p.value;if(r.returnObject){const re=h(ee);return ne.some(be=>h(be)===re)}return ne.includes(h(ee))}const D=n.computed(()=>{if(r.maxSelected===null||r.maxSelected===void 0)return null;const ee=Number(r.maxSelected);return Number.isFinite(ee)&&ee>0?ee:null}),N=n.computed(()=>{const ee=D.value;return ee===null?!1:p.value.length>=ee});function V(ee){return!A(ee)&&N.value}const M=n.computed(()=>{const ee=p.value,ne=new Set;if(r.returnObject)for(const re of ee)ne.add(h(re));else for(const re of ee)ne.add(re);return ne}),T=n.computed(()=>{const ee=M.value;return(E.value||[]).filter(ne=>!ee.has(h(ne)))}),U=n.computed(()=>E.value.length===0?!1:T.value.length===0),L=n.ref(null),R=n.ref(null),P=n.ref(null),W=n.ref(!1),v=n.ref(""),z=n.ref(0),H=n.ref(0),{floatingStyles:G}=hr(L,R,{whileElementsMounted:lr,placement:"bottom-start",middleware:[cr(8),ur(),dr({padding:8}),fr({apply({rects:ee,elements:ne}){Object.assign(ne.floating.style,{width:`${ee.reference.width}px`,"--floating-width":`${ee.reference.width}px`})}})]}),K=n.computed(()=>G.value),X=n.computed(()=>{const ee=Number(r.maxRows);return Number.isFinite(ee)&&ee>0?ee:5});async function oe(){r.disabled||(W.value=!0,H.value=0,requestAnimationFrame(()=>{P.value&&(P.value.scrollTop=0),z.value=0}),b.value&&r.autoFetchOnOpen&&(r.refreshOnOpen||!_.value)&&!x.value&&await B())}function he(){W.value=!1}function ge(){W.value?he():oe()}function se(ee){var re,be;if(!W.value)return;const ne=ee.target;(re=L.value)!=null&&re.contains(ne)||(be=R.value)!=null&&be.contains(ne)||he()}n.onMounted(()=>document.addEventListener("mousedown",se)),n.onBeforeUnmount(()=>document.removeEventListener("mousedown",se));function J(ee){if(r.disabled)return;if(V(ee)){a("max");return}const ne=[...p.value];if(r.returnObject){const re=h(ee);if(ne.some(We=>h(We)===re))return;a("update:modelValue",[...ne,ee])}else{const re=h(ee);if(ne.includes(re))return;a("update:modelValue",[...ne,re])}v.value="",H.value=0,requestAnimationFrame(()=>{P.value&&(P.value.scrollTop=0),z.value=0})}function O(ee){if(r.disabled)return;const ne=[...p.value];if(r.returnObject){const re=h(ee);a("update:modelValue",ne.filter(be=>h(be)!==re))}else{const re=h(ee);a("update:modelValue",ne.filter(be=>be!==re))}}function j(){r.disabled||(a("update:modelValue",[]),a("clear"),he())}const Y=n.computed(()=>{const ee=v.value.trim().toLowerCase(),ne=T.value;return ee?ne.filter(re=>f(re).toLowerCase().includes(ee)):ne}),ie=n.computed(()=>Y.value.length);n.watch(W,ee=>{ee||(v.value="")});const ye=n.computed(()=>{if(U.value)return r.itemHeight;const ee=ie.value;return(ee<=0?1:Math.min(ee,X.value))*r.itemHeight}),ke=n.computed(()=>r.virtual?ie.value*r.itemHeight:0),Me=n.computed(()=>r.virtual?Math.ceil(ye.value/r.itemHeight)+r.overscan:ie.value),Te=n.computed(()=>{if(!r.virtual)return 0;const ee=Math.floor(z.value/r.itemHeight)-Math.floor(r.overscan/2);return Math.max(0,ee)}),Qe=n.computed(()=>r.virtual?Math.min(ie.value,Te.value+Me.value):ie.value),wt=n.computed(()=>r.virtual?Te.value*r.itemHeight:0),ln=n.computed(()=>{const ee=Y.value;return r.virtual?ee.slice(Te.value,Qe.value):ee});function Mo(ee){const ne=ee.target;z.value=ne.scrollTop}function No(ee){return ee===H.value}function q(ee){const ne=P.value;if(!ne||!r.virtual)return;const re=ee*r.itemHeight,be=re+r.itemHeight,We=ne.scrollTop,Pt=ne.scrollTop+ne.clientHeight;re<We?ne.scrollTop=re:be>Pt&&(ne.scrollTop=be-ne.clientHeight)}function ae(ee){const ne=Math.max(0,ie.value-1);H.value=Math.min(ne,Math.max(0,H.value+ee)),q(H.value)}function pe(){const ee=Y.value[H.value];ee&&J(ee)}const Oe=n.computed(()=>r.clearable&&!r.disabled&&k.value.length>0),Ae=n.computed(()=>u.value?"border-destructive ring-1 ring-destructive":W.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(ee,ne)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1 w-full",n.unref(o).class]),"aria-busy":r.skeleton},[r.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.value?(n.openBlock(),n.createElementBlock("div",Qk)):n.createCommentVNode("",!0),ne[3]||(ne[3]=n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[s.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[n.createTextVNode(n.toDisplayString(s.value)+" ",1),d.value?(n.openBlock(),n.createElementBlock("span",ew,"*")):n.createCommentVNode("",!0)],8,Zk)):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"referenceEl",ref:L,class:"relative"},[n.createElementVNode("button",{id:c.value,type:"button",class:n.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-900 border-gray-300 dark:border-gray-700 text-foreground dark:text-gray-300",Ae.value]]),disabled:r.disabled,onClick:ge},[n.createElementVNode("div",nw,[k.value.length?(n.openBlock(),n.createElementBlock("div",ow,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(y.value,(re,be)=>(n.openBlock(),n.createElementBlock("div",{key:`chip-${m(re,be)}`,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"},[n.createElementVNode("span",aw,n.toDisplayString(f(re)),1),r.disabled?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:n.withModifiers(We=>O(re),["stop"]),"aria-label":"Remove"}," ✕ ",8,rw))]))),128)),r.maxChips!==null&&k.value.length>r.maxChips?(n.openBlock(),n.createElementBlock("div",sw," +"+n.toDisplayString(k.value.length-(r.maxChips??0)),1)):n.createCommentVNode("",!0)])):(n.openBlock(),n.createElementBlock("div",iw,n.toDisplayString(r.placeholder),1))]),n.createElementVNode("div",lw,[Oe.value?(n.openBlock(),n.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:n.withModifiers(j,["stop"]),"aria-label":"Clear"}," ✕ ")):n.createCommentVNode("",!0),n.createVNode(n.unref(te.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,tw),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[W.value?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:R,class:"-mt-1 z-[9999] w-[var(--floating-width)] rounded-lg border shadow-lg overflow-hidden bg-white dark:bg-neutral-900 border-gray-200 dark:border-gray-800",style:n.normalizeStyle(K.value)},[r.searchable&&!U.value?(n.openBlock(),n.createElementBlock("div",cw,[n.withDirectives(n.createElementVNode("input",{"onUpdate:modelValue":ne[0]||(ne[0]=re=>v.value=re),placeholder:r.searchPlaceholder,class:"w-full h-10 px-3 py-2 text-sm bg-white dark:bg-neutral-900 border border-gray-200 dark:border-gray-800 rounded-md focus:outline-none focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600",onKeydown:[ne[1]||(ne[1]=n.withKeys(n.withModifiers(re=>ae(1),["prevent"]),["down"])),ne[2]||(ne[2]=n.withKeys(n.withModifiers(re=>ae(-1),["prevent"]),["up"])),n.withKeys(n.withModifiers(pe,["prevent"]),["enter"]),n.withKeys(n.withModifiers(he,["prevent"]),["esc"])]},null,40,dw),[[n.vModelText,v.value]])])):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"listEl",ref:P,class:"relative overflow-auto",style:n.normalizeStyle({height:ye.value+"px"}),onScroll:Mo},[U.value?(n.openBlock(),n.createElementBlock("div",uw," All items have been selected ")):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[r.virtual?(n.openBlock(),n.createElementBlock("div",{key:0,style:n.normalizeStyle({height:ke.value+"px"})},null,4)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(r.virtual?"absolute left-0 top-0 w-full":""),style:n.normalizeStyle(r.virtual?{transform:`translateY(${wt.value}px)`}:void 0)},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(ln.value,(re,be)=>(n.openBlock(),n.createElementBlock("button",{key:String(m(re,Te.value+be)),type:"button",class:n.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[V(re)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",No(Te.value+be)?"bg-neutral-50 dark:bg-neutral-800/60":"",A(re)?"font-semibold":"font-normal"]]),style:n.normalizeStyle({height:r.itemHeight+"px"}),disabled:r.disabled||V(re),onClick:We=>J(re)},[n.createElementVNode("span",hw,n.toDisplayString(f(re)),1),A(re)?(n.openBlock(),n.createElementBlock("span",mw,"✓")):n.createCommentVNode("",!0)],14,fw))),128))],6),ie.value===0?(n.openBlock(),n.createElementBlock("div",pw,[x.value?(n.openBlock(),n.createElementBlock("span",gw,"Loading data…")):(n.openBlock(),n.createElementBlock("span",bw,"Tidak ada data"))])):n.createCommentVNode("",!0)],64))],36)],4)):n.createCommentVNode("",!0)]))],512),u.value?(n.openBlock(),n.createElementBlock("p",yw,n.toDisplayString(r.error),1)):n.createCommentVNode("",!0)],64))],10,Jk)),[[n.vShow,i.value]])}}),xw={class:"space-y-4"},kw={key:0,class:"flex flex-col gap-0.5"},ww=["for"],Cw=["for"],_w={class:"text-[11px] text-gray-500 dark:text-gray-400"},Bw={class:"flex items-center gap-2 flex-nowrap"},Ew=["id","value","disabled","onKeydown","onInput","onPaste"],Da=n.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(e,{emit:t}){const o=n.useAttrs(),a=Math.random().toString(36).slice(2,7),r=n.computed(()=>`app-otp-${(o.id||s.label||"otp-field").replaceAll(/\s+/g,"-").toLowerCase()}-${a}`),s=e,i=t,l=n.ref([]),c=n.ref([]),d=n.ref(!1),{DCodeApi:u}=Je(),f=ms(),h=n.computed(()=>{const B=Number(s.totalInput);return B&&B>0?B:6}),m=()=>{c.value=Array.from({length:h.value},(B,k)=>{var y;return((y=s.default)==null?void 0:y[k])??""}),i("updateOtp",c.value.join(""))};m(),n.watch(()=>[s.totalInput,s.default],()=>m());const p=B=>{B<0||B>=h.value||n.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 g(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),f.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(),A=s.endpoint.apiUrl,D=await u("","",{otp:B},{_url:A,_method:y,withCredentials:!0}),N=(D==null?void 0:D.data)??D;i("success",N)}catch(y){console.error("OTP Submit Error",y),f.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 x=(B,k)=>{c.value[B]=b(k);const y=c.value.join("");i("updateOtp",y),i("update:modelValue",y),y.length===h.value&&g(y)},_=(B,k)=>{const y=B.key,A=/^\d$/.test(y),D=/^[a-zA-Z]$/.test(y);if(y==="Backspace"){if(B.preventDefault(),c.value[k]){x(k,"");return}k>0&&(x(k-1,""),p(k-1));return}if(y==="ArrowLeft"){B.preventDefault(),p(k-1);return}if(y==="ArrowRight"){B.preventDefault(),p(k+1);return}if(A||D){B.preventDefault(),x(k,y),k<h.value-1&&p(k+1);return}y.length===1&&B.preventDefault()},C=(B,k)=>{const y=B.target,A=y.value??"",D=b(A);y.value=D,x(k,D),D&&k<h.value-1&&p(k+1)},w=(B,k)=>{var V;B.preventDefault();const A=(((V=B.clipboardData)==null?void 0:V.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!A)return;let D=k;for(const M of A){if(D>=h.value)break;c.value[D]=M,D++}const N=c.value.join("");i("updateOtp",N),i("update:modelValue",N),N.length===h.value&&g(N),p(Math.min(D,h.value-1))},E=B=>k=>{l.value[B]=(k==null?void 0:k.$el)??k};return(B,k)=>(n.openBlock(),n.createElementBlock("div",xw,[s.label||h.value?(n.openBlock(),n.createElementBlock("div",kw,[s.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:r.value,class:"text-sm font-medium text-foreground"},n.toDisplayString(s.label),9,ww)):(n.openBlock(),n.createElementBlock("label",{key:1,for:r.value,class:"text-sm font-medium text-foreground"}," Masukkan kode keamanan ",8,Cw)),n.createElementVNode("p",_w," Ketik "+n.toDisplayString(h.value)+" digit kode verifikasi Anda ",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",Bw,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h.value,y=>(n.openBlock(),n.createElementBlock("input",{key:y,id:y===1?r.value:void 0,ref_for:!0,ref:E(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:n.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-900 text-foreground dark:text-gray-300":"border-gray-300 dark:border-gray-700 bg-white dark:bg-neutral-900 text-gray-400 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600"]),onKeydown:A=>_(A,y-1),onInput:A=>C(A,y-1),onPaste:A=>w(A,y-1)},null,42,Ew))),128))])]))}}),Sw={class:"w-full"},Aw={key:0,class:"flex items-center justify-between mb-2"},Vw={key:0,class:"text-sm font-medium text-gray-700"},Dw={key:1,class:"text-sm text-gray-600"},Mw={name:"DCodeProgress"},md=n.defineComponent({...Mw,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(e,{emit:t}){const o=e,a=n.computed(()=>Math.min(o.modelValue/o.max*100,100)),r=n.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[o.size],"bg-gray-200"].join(" ")),s=n.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=n.computed(()=>`${Math.round(a.value)}%`);return(l,c)=>(n.openBlock(),n.createElementBlock("div",Sw,[e.label||e.showValue?(n.openBlock(),n.createElementBlock("div",Aw,[e.label?(n.openBlock(),n.createElementBlock("span",Vw,n.toDisplayString(e.label),1)):n.createCommentVNode("",!0),e.showValue?(n.openBlock(),n.createElementBlock("span",Dw,n.toDisplayString(i.value),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(r.value)},[n.createElementVNode("div",{class:n.normalizeClass(s.value),style:n.normalizeStyle({width:`${a.value}%`})},null,6)],2)]))}}),Nw={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},pd=xt(n.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(e){return(t,o)=>(n.openBlock(),n.createBlock(n.Transition,{name:"fade"},{default:n.withCtx(()=>[e.isApiLoading?(n.openBlock(),n.createElementBlock("div",Nw,[n.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:n.normalizeStyle({width:`${e.apiProgress}%`})},null,4)])):n.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-85c68054"]]),Ma=n.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ce.Label),n.mergeProps(n.unref(o),{class:n.unref(_e)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t.class)}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),Pw={class:"grid gap-3"},vw={key:0,class:"ml-1 text-destructive"},Tw={class:"flex flex-col"},Ow={key:0,class:"flex items-center gap-2 text-sm text-gray-500 mb-2"},zw={class:"relative flex-shrink-0 mt-0.5"},Fw=["id","name","value","checked","disabled","required","onChange"],Iw=["onClick"],Rw=["for"],Lw={key:0,class:"ml-1 text-red-500"},$w={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},ys=n.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(e,{emit:t}){n.useAttrs();const{apiUrl:o}=Je(),a=t,r=e,s=n.ref([]),i=n.ref(!1),l=n.ref(null),c=async()=>{var w,E;const C=((w=r.endpoint)==null?void 0:w.apiUrl)||r.apiUrl;if(C){i.value=!0,l.value=null;try{const B={page:1,perPage:100},k=((E=r.endpoint)==null?void 0:E.apiMethod)||r.apiMethod,y=await o(C,k,B);let A=y;r.dataPath?A=r.dataPath.split(".").reduce((N,V)=>N&&N[V]!=="undefined"?N[V]:void 0,y):typeof y=="object"&&!Array.isArray(y)&&y.data&&(A=y.data),Array.isArray(A)?s.value=A:(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}}};n.onMounted(()=>{var C;((C=r.endpoint)!=null&&C.apiUrl||r.apiUrl)&&c()});const d=n.computed(()=>{if(r.options&&r.options.length>0)return r.options;if(s.value.length>0)return s.value;const C=r.itemValue||r.model||"id",w=r.itemTitle||(r.label===""?"name":r.label);return w&&r.label!==""?[{[C]:C,[w]:w}]:[]}),u=C=>{if(typeof C!="object")return C;const w=r.itemValue||r.model||"id";return C[w]},f=C=>{if(typeof C!="object")return String(C);const w=r.itemTitle||"name";return C[w]},h=n.computed(()=>r.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),m=n.computed(()=>!!r.error||!!l.value),p=n.computed(()=>r.error||l.value),b=C=>C==null?r.modelValue===C:String(r.modelValue)===String(C),g=n.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"}})[r.size]),x=(C,w)=>{w.target.checked&&(a("update:modelValue",C),a("change",C))},_=C=>{!r.disabled&&!b(C)&&(a("update:modelValue",C),a("change",C))};return(C,w)=>(n.openBlock(),n.createElementBlock("div",Pw,[e.label?(n.openBlock(),n.createBlock(Ma,{key:0,class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",vw,"*")):n.createCommentVNode("",!0)]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Tw,[i.value?(n.openBlock(),n.createElementBlock("div",Ow,[n.createVNode(n.unref(te.Loader2),{class:"w-4 h-4 animate-spin"}),w[0]||(w[0]=n.createTextVNode(" Sedang memuat opsi... ",-1))])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["flex",e.layout?"flex-row flex-wrap gap-4":"flex-col gap-3"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,(E,B)=>(n.openBlock(),n.createElementBlock("div",{key:B,class:n.normalizeClass(["flex items-start",g.value.container,e.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[n.createElementVNode("div",zw,[n.createElementVNode("input",{id:e.id?`${e.id}-${B}`:`${h.value}-${B}`,name:h.value,type:"radio",value:u(E),checked:b(u(E)),disabled:e.disabled,required:e.required&&B===0,onChange:k=>x(u(E),k),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,Fw)]),n.createElementVNode("div",{class:"flex-1 min-w-0",onClick:k=>_(u(E))},[n.createElementVNode("label",{for:e.id?`${e.id}-${B}`:`${h.value}-${B}`,class:n.normalizeClass([g.value.label,"font-medium cursor-pointer select-none text-foreground dark:text-gray-300",e.disabled?"cursor-not-allowed opacity-50":""])},[n.createTextVNode(n.toDisplayString(f(E))+" ",1),e.required&&d.value.length===1&&e.label?(n.openBlock(),n.createElementBlock("span",Lw,"*")):n.createCommentVNode("",!0)],10,Rw)],8,Iw)],2))),128))],2),m.value&&p.value?(n.openBlock(),n.createElementBlock("div",$w,[n.createVNode(n.unref(te.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),n.createTextVNode(" "+n.toDisplayString(p.value),1)])):n.createCommentVNode("",!0)])]))}}),Ww={class:"grid gap-3"},jw={key:0,class:"ml-1 text-destructive"},Uw={class:"flex flex-col"},Hw={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},qw=["onClick"],Gw=["id","name","value","checked","disabled","required","onChange"],Xw={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},Yw=["for"],Kw={key:0,class:"ml-1 text-red-500"},Jw={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},xs=n.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(e,{emit:t}){n.useAttrs();const{apiUrl:o}=Je(),a=t,r=e,s=n.ref(r.modelValue??void 0);n.watch(()=>r.modelValue,A=>{s.value=A},{immediate:!0});const i=n.ref([]),l=n.ref(!1),c=n.ref(null),d=async()=>{var D,N;const A=((D=r.endpoint)==null?void 0:D.apiUrl)||r.apiUrl;if(A){l.value=!0,c.value=null;try{const V={page:1,perPage:100},M=((N=r.endpoint)==null?void 0:N.apiMethod)||r.apiMethod,T=await o(A,M,V);let U=T;r.dataPath?U=r.dataPath.split(".").reduce((R,P)=>R&&R[P]!=="undefined"?R[P]:void 0,T):typeof T=="object"&&!Array.isArray(T)&&T.data&&(U=T.data),Array.isArray(U)?i.value=U:(console.warn("DCodeRadioCustom: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(V){console.error("DCodeRadioCustom fetch error:",V),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=n.ref(!1);let f=null;const h=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};n.onMounted(()=>{var A;((A=r.endpoint)!=null&&A.apiUrl||r.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"]}))}),n.onBeforeUnmount(()=>{f&&f.disconnect()});const m=n.computed(()=>{if(r.options&&r.options.length>0)return r.options;if(i.value.length>0)return i.value;const A=r.itemValue||r.model||"id",D=r.itemTitle||(r.label===""?"name":r.label);return D&&r.label!==""?[{[A]:A,[D]:D}]:[]}),p=A=>{if(typeof A!="object")return A;const D=r.itemValue||r.model||"id";return A[D]},b=A=>{if(typeof A!="object")return String(A);const D=r.itemTitle||"name";return A[D]},g=Math.random().toString(36).slice(2,7),x=n.computed(()=>r.id?`radio-custom-${r.id}`:`radio-custom-${r.model}-${g}`),_=n.computed(()=>!!r.error||!!c.value),C=n.computed(()=>r.error||c.value),w=A=>{const D=s.value;return A==null?D===A:String(D)===String(A)},E=n.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"}})[r.size]),B=n.computed(()=>r.icon&&Ct[r.icon]||null),k=(A,D)=>{D.target.checked&&(s.value=A,a("update:modelValue",A),a("change",A))},y=A=>{r.disabled||w(A)||(s.value=A,a("update:modelValue",A),a("change",A))};return(A,D)=>(n.openBlock(),n.createElementBlock("div",Ww,[e.label?(n.openBlock(),n.createBlock(Ma,{key:0,class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",jw,"*")):n.createCommentVNode("",!0)]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Uw,[l.value?(n.openBlock(),n.createElementBlock("div",Hw,[n.createVNode(n.unref(te.Loader2),{class:"w-4 h-4 animate-spin"}),D[0]||(D[0]=n.createTextVNode(" Sedang memuat opsi... ",-1))])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["grid",e.layout?"grid-cols-2 sm:grid-cols-3":"grid-cols-1","gap-3"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value,(N,V)=>(n.openBlock(),n.createElementBlock("div",{key:V,class:n.normalizeClass(["relative flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 transition-all duration-200",w(p(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",e.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:M=>!e.disabled&&y(p(N))},[n.createElementVNode("input",{id:e.id?`${e.id}-${V}`:`${x.value}-${V}`,name:x.value,type:"radio",value:p(N),checked:w(p(N)),disabled:e.disabled,required:e.required&&V===0,onChange:M=>k(p(N),M),class:"sr-only",tabindex:"-1"},null,40,Gw),n.createElementVNode("div",{class:n.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",w(p(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?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(B.value),{key:0,class:"w-6 h-6"})):(n.openBlock(),n.createElementBlock("svg",Xw,[...D[1]||(D[1]=[n.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2),n.createElementVNode("label",{for:e.id?`${e.id}-${V}`:`${x.value}-${V}`,class:n.normalizeClass([E.value.label,"font-medium text-center leading-tight select-none transition-colors duration-200",w(p(N))?u.value?"text-primary-400":"text-primary-700":u.value?"text-neutral-300":"text-gray-700",e.disabled?"cursor-not-allowed":"cursor-pointer"])},[n.createTextVNode(n.toDisplayString(b(N))+" ",1),e.required&&m.value.length===1&&e.label?(n.openBlock(),n.createElementBlock("span",Kw,"*")):n.createCommentVNode("",!0)],10,Yw)],10,qw))),128))],2),_.value&&C.value?(n.openBlock(),n.createElementBlock("div",Jw,[n.createVNode(n.unref(te.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),n.createTextVNode(" "+n.toDisplayString(C.value),1)])):n.createCommentVNode("",!0)])]))}}),Qw={key:0,class:"ml-1 text-destructive"},Zw={class:"relative w-full"},e1={key:0,class:"mb-2 flex items-center justify-between"},t1={class:"text-sm text-muted-foreground"},n1={class:"text-sm font-medium text-foreground"},o1={class:"text-sm text-muted-foreground"},a1={class:"relative"},r1=["id","value","min","max","step","disabled","placeholder"],s1={key:1,class:"relative mt-2"},i1={class:"text-xs text-muted-foreground mt-1"},l1={key:1,class:"flex items-center gap-1 text-sm text-destructive"},c1={name:"DCodeSlider"},Na=n.defineComponent({...c1,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(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=n.ref(),i=n.ref(!1),l=n.computed(()=>!!r.error),c=n.computed(()=>`slider-${Math.random().toString(36).substr(2,9)}`),d=n.computed(()=>(r.label||o.label)??void 0),u=n.computed(()=>!0),f=n.computed(()=>{const E={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",E[r.size],B[r.color]||B.blue,l.value?"accent-red-500":"",o.class].filter(Boolean).join(" ")}),h=n.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"}[r.size],r.color==="blue"?"focus:ring-blue-500":r.color==="green"?"focus:ring-green-500":r.color==="red"?"focus:ring-red-500":r.color==="yellow"?"focus:ring-yellow-500":r.color==="purple"?"focus:ring-purple-500":"focus:ring-gray-500"].join(" ")),m=n.computed(()=>`${r.valuePrefix}${r.modelValue}${r.valueSuffix}`),p=n.computed(()=>{const E=r.max-r.min;return(r.modelValue-r.min)/E*100}),b=E=>{const B=E.target,k=parseFloat(B.value);a("update:modelValue",k),a("input",k)},g=E=>{const B=E.target,k=parseFloat(B.value);a("change",k)},x=()=>{i.value=!0},_=()=>{i.value=!1},C=E=>{const B=r.max-r.min;return(E-r.min)/B*100},w=n.computed(()=>{const E={sm:16,md:20,lg:24};return`
|
|
67
67
|
input[type="range"]::-webkit-slider-thumb {
|
|
68
68
|
${h.value}
|
|
69
69
|
width: ${E[r.size]}px;
|
|
@@ -92,6 +92,6 @@
|
|
|
92
92
|
input[type="range"]:focus::-moz-range-thumb {
|
|
93
93
|
transform: scale(1.1);
|
|
94
94
|
}
|
|
95
|
-
`});return(E,B)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-2 w-full",n.unref(o).class]),"aria-busy":!1},[d.value?(n.openBlock(),n.createBlock(n.unref(Ma),{key:0,for:c.value,class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(d.value)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",Qw,"*")):n.createCommentVNode("",!0)]),_:1},8,["for"])):n.createCommentVNode("",!0),n.createElementVNode("div",Zw,[e.showValue?(n.openBlock(),n.createElementBlock("div",e1,[n.createElementVNode("span",t1,n.toDisplayString(r.valuePrefix)+n.toDisplayString(e.min)+n.toDisplayString(r.valueSuffix),1),n.createElementVNode("span",n1,n.toDisplayString(m.value),1),n.createElementVNode("span",o1,n.toDisplayString(r.valuePrefix)+n.toDisplayString(e.max)+n.toDisplayString(r.valueSuffix),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",a1,[n.createElementVNode("div",{class:n.normalizeClass(["absolute top-1/2 -translate-y-1/2 w-full h-full bg-gray-200 rounded-lg pointer-events-none",[e.size==="sm"?"h-2":e.size==="md"?"h-2.5":"h-3"]])},[n.createElementVNode("div",{class:n.normalizeClass(["absolute top-0 left-0 h-full rounded-lg transition-all",[e.color==="blue"?"bg-blue-500":e.color==="green"?"bg-green-500":e.color==="red"?"bg-red-500":e.color==="yellow"?"bg-yellow-500":e.color==="purple"?"bg-purple-500":"bg-gray-500"]]),style:n.normalizeStyle({width:`${p.value}%`})},null,6)],2),n.createElementVNode("input",{id:c.value,ref_key:"sliderRef",ref:s,type:"range",value:e.modelValue,min:e.min,max:e.max,step:e.step,disabled:e.disabled,placeholder:e.placeholder,class:n.normalizeClass(f.value),onInput:g,onChange:y,onMousedown:x,onMouseup:_,onTouchstart:x,onTouchend:_},null,42,r1)]),e.marks.length>0?(n.openBlock(),n.createElementBlock("div",s1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.marks,k=>(n.openBlock(),n.createElementBlock("div",{key:k.value,class:"absolute flex flex-col items-center",style:n.normalizeStyle({left:`${C(k.value)}%`,transform:"translateX(-50%)"})},[B[0]||(B[0]=n.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),n.createElementVNode("span",i1,n.toDisplayString(k.label),1)],4))),128))])):n.createCommentVNode("",!0)]),l.value?(n.openBlock(),n.createElementBlock("div",l1,[B[1]||(B[1]=n.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[n.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)),n.createTextVNode(" "+n.toDisplayString(e.error),1)])):n.createCommentVNode("",!0),w.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent("style"),{key:2},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(w.value),1)]),_:1})):n.createCommentVNode("",!0)],2)),[[n.vShow,u.value]])}}),d1={class:"grid gap-3"},u1={key:0,class:"ml-1 text-destructive"},f1={class:"inline-flex items-center gap-3"},h1=["id","name","aria-checked","aria-label","disabled"],m1={key:0,class:"absolute inset-0 flex items-center justify-center"},p1={class:"relative z-10 flex items-center gap-2"},g1=["id","name","aria-checked","aria-label","disabled"],b1={key:0,class:"absolute inset-0 flex items-center justify-center"},y1={name:"DCodeSwitch"},Pa=n.defineComponent({...y1,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(e,{emit:t}){const o=e,a=t,r=n.computed({get:()=>o.modelValue,set:f=>{!o.disabled&&!o.loading&&(a("update:modelValue",f),a("change",f))}}),s=n.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=n.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=n.computed(()=>{switch(o.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=n.computed(()=>{if(o.disabled)return"bg-gray-300";if(!r.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=()=>{r.value=!r.value},u=n.computed(()=>r.value?o.tooltipActiveText:o.tooltipInactiveText);return(f,h)=>(n.openBlock(),n.createElementBlock("div",d1,[e.title?(n.openBlock(),n.createBlock(Ma,{key:0,class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",u1,"*")):n.createCommentVNode("",!0)]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",f1,[n.createVNode(n.unref(zi),null,{default:n.withCtx(()=>[e.showTooltip?(n.openBlock(),n.createBlock(n.unref(Ti),{key:0,"delay-duration":200},{default:n.withCtx(()=>[n.createVNode(n.unref(Fi),{"as-child":""},{default:n.withCtx(()=>[n.createElementVNode("button",{type:"button",id:e.id,name:e.name,"aria-checked":r.value?"true":"false","aria-label":e.label||"Toggle switch",disabled:e.disabled||e.loading,class:n.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":e.disabled,"cursor-wait":e.loading,"cursor-pointer":!e.disabled&&!e.loading}]),onClick:d},[n.createElementVNode("span",{class:n.normalizeClass([i.value,r.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"])},[e.loading?(n.openBlock(),n.createElementBlock("span",m1,[...h[0]||(h[0]=[n.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"},[n.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),n.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)])])):n.createCommentVNode("",!0),n.createVNode(n.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:n.withCtx(()=>[r.value&&!e.loading?(n.openBlock(),n.createBlock(n.unref(te.Check),{key:0,class:n.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!r.value&&!e.loading?(n.openBlock(),n.createBlock(n.unref(te.X),{key:1,class:n.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):n.createCommentVNode("",!0)]),_:1})],2)],10,h1)]),_:1}),n.createVNode(n.unref(Oi),{side:"top","side-offset":8,class:n.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",[r.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:n.withCtx(()=>[n.createElementVNode("span",p1,[n.createElementVNode("span",{class:n.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",r.value?"bg-green-200":"bg-gray-300"])},null,2),n.createTextVNode(" "+n.toDisplayString(u.value),1)])]),_:1},8,["class"])]),_:1})):(n.openBlock(),n.createElementBlock("button",{key:1,type:"button",id:e.id,name:e.name,"aria-checked":r.value?"true":"false","aria-label":e.label||"Toggle switch",disabled:e.disabled||e.loading,class:n.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":e.disabled,"cursor-wait":e.loading,"cursor-pointer":!e.disabled&&!e.loading}]),onClick:d},[n.createElementVNode("span",{class:n.normalizeClass([i.value,r.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"])},[e.loading?(n.openBlock(),n.createElementBlock("span",b1,[...h[1]||(h[1]=[n.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"},[n.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),n.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)])])):n.createCommentVNode("",!0),n.createVNode(n.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:n.withCtx(()=>[r.value&&!e.loading?(n.openBlock(),n.createBlock(n.unref(te.Check),{key:0,class:n.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!r.value&&!e.loading?(n.openBlock(),n.createBlock(n.unref(te.X),{key:1,class:n.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):n.createCommentVNode("",!0)]),_:1})],2)],10,g1))]),_:1})])]))}}),x1=["aria-busy"],k1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},w1={key:1,class:"flex justify-end"},C1=["for"],_1={key:0,class:"ml-1 text-destructive"},B1={class:"relative w-full group"},E1={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},S1={key:1},A1=["id","value","placeholder"],V1={key:1,class:"absolute inset-y-0 right-4 flex items-center"},D1={key:2,class:"absolute inset-y-0 right-4 flex items-center"},M1={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"},N1={key:1,class:"text-xs text-destructive"},va=n.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}},emits:["update:modelValue","clear"],setup(e,{emit:t}){const o=n.useAttrs(),a=n.computed(()=>{var F;return((F=l.valueType)==null?void 0:F.toLowerCase())==="password"||o.type==="password"}),r=n.ref(!1),s=()=>{r.value=!r.value},i=t,l=e,c=n.computed(()=>o.label);n.computed(()=>l.visible??!0);const d=Math.random().toString(36).slice(2,7),u=n.computed(()=>`app-text-field-${o.id||c.value||"field"}-${d}`),f=n.computed(()=>{const F=o.required,q=o["aria-required"];return F===""||F===!0||F==="true"||(q==="true"||q===!0)}),h=n.computed(()=>{const{label:F,class:q,id:Q,required:ue,"aria-required":_e,...Ce}=o;return Ce}),m=n.computed(()=>{var q,Q;const F={...h.value};return((q=l.valueType)==null?void 0:q.toLowerCase())==="number"&&(F.type="text",F.inputmode="numeric",F.pattern="[0-9]*"),((Q=l.valueType)==null?void 0:Q.toLowerCase())==="email"&&(F.type="email",F.inputmode="email"),a.value&&(F.type=r.value?"text":"password"),l.disabled&&(F.disabled=!0),F}),p=n.computed(()=>{const F=l.modelValue;return F==null||String(F).length===0}),g=n.computed(()=>l.clearable?l.hideClearWhenEmpty?!p.value:!0:!1),y=n.computed(()=>{switch(l.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),x=n.ref(String(l.modelValue??""));n.watch(()=>l.modelValue,F=>{const q=String(F??"");q!==x.value&&(x.value=q)});const _=n.ref(!1),C=n.ref(!1),w=F=>F.split(/(\s+)/).map(q=>{if(q.trim()==="")return q;const Q=q.toLowerCase();return Q.charAt(0).toUpperCase()+Q.slice(1)}).join(""),E=F=>{const q=F.toLowerCase(),Q=q.search(new RegExp("\\p{L}","u"));return Q<0?q:q.slice(0,Q)+q.charAt(Q).toUpperCase()+q.slice(Q+1)},B=F=>{switch(l.textCase){case"uppercase":return F.toUpperCase();case"lowercase":return F.toLowerCase();case"titlecase":return w(F);case"sentencecase":return E(F);case"none":default:return F}},k=F=>{if(!F)return null;const q=Array.isArray(F)?F.join(""):F;return q?new Set(q):null},b=n.computed(()=>k(l.allowChars)),A=(F,q)=>(F.lastIndex=0,F.test(q)),D=F=>{var Oe;const q=(Oe=l.valueType)==null?void 0:Oe.toLowerCase();if(q==="free"||q==="email"||q==="password")return!0;const Q=F===" ",ue=/\d/.test(F),_e=new RegExp("\\p{L}","u").test(F),Ce=new RegExp("\\p{N}","u").test(F);return q==="number"?ue:q==="letter"?_e||l.allowSpaces&&Q:q==="letternumber"?_e||Ce||l.allowSpaces&&Q:!0},P=F=>{let q="";for(const Q of F){const ue=!!b.value&&b.value.has(Q);l.pattern&&!ue&&!A(l.pattern,Q)||!ue&&!D(Q)||(q+=Q)}return q},V=n.computed(()=>{const F=o.maxlength??o.maxLength;let q=Number.NaN;return typeof F=="number"?q=F:typeof F=="string"&&(q=Number.parseInt(F,10)),Number.isFinite(q)&&q>0?q:-1}),M=n.computed(()=>x.value.length),z=n.computed(()=>l.showCharCount?V.value>0:!1),N=F=>V.value>0?F.slice(0,V.value):F,v=F=>{const q=P(F),Q=l.applyTextCaseToValue?B(q):q;return N(Q)};let T=null;const R=F=>{var q;if(F==="")return null;if(((q=l.valueType)==null?void 0:q.toLowerCase())==="number"&&l.returnNumber){const Q=Number(F);return Number.isFinite(Q)?Q:null}return F},H=F=>{x.value=F,i("update:modelValue",R(F))},O=(F,q)=>{const Q=N(q);C.value=!0,F.value=Q,H(Q),queueMicrotask(()=>C.value=!1)},$=(F,q)=>{const Q=F.selectionStart??F.value.length,ue=F.selectionEnd??F.value.length;if(V.value>0){const _e=F.value.length-(ue-Q),Ce=V.value-_e;if(Ce<=0)return;q=q.slice(0,Ce)}F.setRangeText(q,Q,ue,"end"),O(F,v(F.value))},Y=F=>{var ue;if(!T||_.value||C.value||!((ue=F.inputType)!=null&&ue.startsWith("insert")))return;const q=F.data;if(q==null)return;const Q=v(q);Q!==q&&(F.preventDefault(),Q.length>0&&$(T,Q))},X=F=>{var ue;if(!T||_.value||C.value)return;const q=((ue=F.clipboardData)==null?void 0:ue.getData("text"))??"",Q=v(q);Q!==q&&(F.preventDefault(),Q.length>0&&$(T,Q))},j=F=>{if(!T||_.value||C.value)return;const q=F.target,Q=q.value??"",ue=v(Q);ue===Q?H(ue):O(q,ue)},ee=()=>_.value=!0,ne=()=>{if(_.value=!1,!T)return;const F=T.value??"",q=v(F);q===F?H(q):O(T,q)};n.onMounted(()=>{if(T=document.getElementById(u.value),!T)return;T.addEventListener("beforeinput",Y),T.addEventListener("paste",X),T.addEventListener("input",j),T.addEventListener("compositionstart",ee),T.addEventListener("compositionend",ne);const F=T.value??"",q=v(F);q===F?H(q):O(T,q)}),n.onBeforeUnmount(()=>{T&&(T.removeEventListener("beforeinput",Y),T.removeEventListener("paste",X),T.removeEventListener("input",j),T.removeEventListener("compositionstart",ee),T.removeEventListener("compositionend",ne),T=null)});const fe=()=>{x.value="",T&&(T.value=""),i("update:modelValue",null),i("clear")},ye=n.computed(()=>z.value&&M.value>0),he=n.computed(()=>`${M.value} / ${V.value}`),G=n.computed(()=>!!l.error);return(F,q)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1 w-full",n.unref(o).class]),"aria-busy":l.skeleton},[l.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[c.value?(n.openBlock(),n.createElementBlock("div",k1)):n.createCommentVNode("",!0),q[1]||(q[1]=n.createElementVNode("div",{class:"relative w-full"},[n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),z.value?(n.openBlock(),n.createElementBlock("div",w1,[...q[0]||(q[0]=[n.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[c.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:u.value,class:"text-sm font-medium"},[n.createTextVNode(n.toDisplayString(c.value)+" ",1),f.value?(n.openBlock(),n.createElementBlock("span",_1,"*")):n.createCommentVNode("",!0)],8,C1)):n.createCommentVNode("",!0),n.createElementVNode("div",B1,[l.icon||l.prependInner||F.$slots["prepend-inner"]?(n.openBlock(),n.createElementBlock("div",E1,[n.renderSlot(F.$slots,"prepend-inner",{},()=>[l.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.icon),{key:0,class:"h-4 w-4"})):l.prependInner?(n.openBlock(),n.createElementBlock("span",S1,n.toDisplayString(l.prependInner),1)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0),n.createElementVNode("input",n.mergeProps({id:u.value,value:x.value},m.value,{placeholder:l.placeholder,style:`text-transform: ${y.value}; padding-left: ${l.icon||l.prependInner||F.$slots["prepend-inner"]?"2.5rem":"0.75rem"} !important; padding-right: ${g.value||a.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-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 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",G.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,A1),a.value?(n.openBlock(),n.createElementBlock("div",V1,[n.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground",tabindex:"-1",onClick:s},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(r.value?n.unref(te.Eye):n.unref(te.EyeOff)),{class:"w-4 h-4"}))])])):n.createCommentVNode("",!0),g.value&&!a.value?(n.openBlock(),n.createElementBlock("div",D1,[n.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:fe}," ✕ ")])):n.createCommentVNode("",!0),ye.value&&!G.value?(n.openBlock(),n.createElementBlock("p",M1,n.toDisplayString(he.value),1)):n.createCommentVNode("",!0)]),G.value?(n.openBlock(),n.createElementBlock("p",N1,n.toDisplayString(l.error),1)):n.createCommentVNode("",!0)],64))],10,x1)),[[n.vShow,e.visible]])}}),P1=["aria-busy"],v1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},T1=["for"],O1={key:0,class:"ml-1 text-destructive"},z1={class:"relative w-full group"},F1=["id","value"],I1={key:0,class:"absolute top-1 right-2"},R1={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"},L1={key:1,class:"text-xs text-destructive"},Un=n.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(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=n.computed(()=>o.label),i=n.computed(()=>r.visible??!0),l=Math.random().toString(36).slice(2,7),c=n.computed(()=>`app-textarea-${o.id||s.value||"field"}-${l}`),d=n.computed(()=>{const G=o.required,F=o["aria-required"];return G===""||G===!0||G==="true"||(F==="true"||F===!0)}),u=n.computed(()=>{const{label:G,class:F,id:q,required:Q,"aria-required":ue,..._e}=o;return _e}),f=n.computed(()=>{const G=o.maxlength;let F=Number.NaN;return typeof G=="number"?F=G:typeof G=="string"&&(F=Number.parseInt(G,10)),Number.isFinite(F)&&F>0?F:-1}),h=G=>f.value>0?G.slice(0,f.value):G,m=n.computed(()=>{const G=r.modelValue;return G==null||String(G).length===0}),p=n.computed(()=>r.clearable?r.hideClearWhenEmpty?!m.value:!0:!1),g=n.ref(String(r.modelValue??""));n.watch(()=>r.modelValue,G=>{const F=String(G??"");F!==g.value&&(g.value=F)});const y=n.ref(!1),x=n.ref(!1),_=G=>G.split(/(\s+)/).map(F=>{if(F.trim()==="")return F;const q=F.toLowerCase();return q.charAt(0).toUpperCase()+q.slice(1)}).join(""),C=G=>{const F=G.toLowerCase(),q=F.search(new RegExp("\\p{L}","u"));return q<0?F:F.slice(0,q)+F.charAt(q).toUpperCase()+F.slice(q+1)},w=G=>{switch(r.textCase){case"uppercase":return G.toUpperCase();case"lowercase":return G.toLowerCase();case"titlecase":return _(G);case"sentencecase":return C(G);case"none":default:return G}},E=n.computed(()=>{switch(r.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),B=G=>{if(!G)return null;const F=Array.isArray(G)?G.join(""):G;return F?new Set(F):null},k=n.computed(()=>B(r.allowChars)),b=(G,F)=>(G.lastIndex=0,G.test(F)),A=G=>{if(G===`
|
|
96
|
-
`)return r.valueType!=="number";if(r.valueType==="free")return!0;const
|
|
97
|
-
`,""),q=Number(F);return Number.isFinite(q)?q:null}return G},z=G=>{g.value=G,a("update:modelValue",M(G))},N=(G,F)=>{const q=h(F);x.value=!0,G.value=q,z(q),queueMicrotask(()=>x.value=!1)},v=(G,F)=>{const q=G.selectionStart??G.value.length,Q=G.selectionEnd??G.value.length;if(f.value>0){const ue=G.value.length-(Q-q),_e=f.value-ue;if(_e<=0)return;F=F.slice(0,_e)}G.setRangeText(F,q,Q,"end"),N(G,P(G.value))},T=G=>{var Q;if(!V||y.value||x.value||!((Q=G.inputType)!=null&&Q.startsWith("insert")))return;const F=G.data;if(F==null)return;const q=P(F);q!==F&&(G.preventDefault(),q.length>0&&v(V,q))},R=G=>{var Q;if(!V||y.value||x.value)return;const F=((Q=G.clipboardData)==null?void 0:Q.getData("text"))??"",q=P(F);q!==F&&(G.preventDefault(),q.length>0&&v(V,q))},H=async G=>{if(!V||y.value||x.value)return;const F=G.target,q=F.value??"",Q=P(q);if(Q===q){const ue=F.selectionStart??Q.length,_e=F.selectionEnd??Q.length;N(F,Q),await n.nextTick();try{F.setSelectionRange(ue,_e)}catch{}z(Q)}else{const ue=F.selectionStart??Q.length,_e=F.selectionEnd??Q.length;N(F,Q),await n.nextTick();try{F.setSelectionRange(ue,_e)}catch{}}},O=()=>y.value=!0,$=()=>{if(y.value=!1,!V)return;const G=V.value??"",F=P(G);F===G?z(F):N(V,F)};n.onMounted(()=>{if(V=document.getElementById(c.value),!V)return;V.addEventListener("beforeinput",T),V.addEventListener("paste",R),V.addEventListener("input",H),V.addEventListener("compositionstart",O),V.addEventListener("compositionend",$);const G=V.value??"",F=P(G);F===G?z(F):N(V,F)}),n.onBeforeUnmount(()=>{V&&(V.removeEventListener("beforeinput",T),V.removeEventListener("paste",R),V.removeEventListener("input",H),V.removeEventListener("compositionstart",O),V.removeEventListener("compositionend",$),V=null)});const Y=()=>{g.value="",V&&(V.value=""),a("update:modelValue",null),a("clear")},X=n.computed(()=>g.value.length),j=n.computed(()=>r.showCharCount?f.value>0:!1),ee=n.computed(()=>j.value&&X.value>0),ne=n.computed(()=>`${X.value} / ${f.value}`),fe=n.computed(()=>!!r.error),ye=n.computed(()=>{const G=o.rows,F=typeof G=="number"?G:Number.parseInt(String(G??""),10);return Number.isFinite(F)&&F>0?F:3}),he=n.computed(()=>({height:`${ye.value*24+16}px`}));return(G,F)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1 w-full",n.unref(o).class]),"aria-busy":r.skeleton},[r.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.value?(n.openBlock(),n.createElementBlock("div",v1)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:n.normalizeStyle(he.value)},null,4)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[s.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[n.createTextVNode(n.toDisplayString(s.value)+" ",1),d.value?(n.openBlock(),n.createElementBlock("span",O1,"*")):n.createCommentVNode("",!0)],8,T1)):n.createCommentVNode("",!0),n.createElementVNode("div",z1,[n.createElementVNode("textarea",n.mergeProps({id:c.value,value:g.value},u.value,{style:`text-transform: ${E.value}; padding-right: ${p.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-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 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",fe.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,F1),p.value?(n.openBlock(),n.createElementBlock("div",I1,[n.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:Y}," ✕ ")])):n.createCommentVNode("",!0),ee.value&&!fe.value?(n.openBlock(),n.createElementBlock("p",R1,n.toDisplayString(ne.value),1)):n.createCommentVNode("",!0)]),fe.value?(n.openBlock(),n.createElementBlock("p",L1,n.toDisplayString(r.error),1)):n.createCommentVNode("",!0)],64))],10,P1)),[[n.vShow,i.value]])}}),gd=n.defineComponent({__name:"Avatar",props:{class:{type:[Boolean,null,String,Object,Array]},size:{default:"sm"},shape:{default:"circle"}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ie.AvatarRoot),{class:n.normalizeClass(n.unref(we)(n.unref($1)({size:e.size,shape:e.shape}),t.class))},{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},8,["class"]))}}),bd=n.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ie.AvatarFallback),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),yd=n.defineComponent({__name:"AvatarImage",props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ie.AvatarImage),n.mergeProps(t,{class:"h-full w-full object-cover"}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),$1=eo("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"}}}),Ta=n.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=ze.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ie.Separator),n.mergeProps(n.unref(o),{class:n.unref(we)("shrink-0 bg-border",t.orientation==="horizontal"?"h-px w-full":"w-px h-full",t.class)}),null,16,["class"]))}}),W1={class:"bg-card text-card-foreground"},j1={class:"pb-6 px-3"},U1={key:0,class:"flex justify-center p-8"},H1={key:1,class:"p-8 text-center text-red-500"},q1={key:2,class:"relative"},G1={class:"space-y-6"},X1={class:"rounded-xl border bg-card text-card-foreground shadow"},Y1={class:"p-4"},K1={class:"flex items-center justify-between gap-3"},J1={class:"font-medium"},Q1={class:"text-xs text-muted-foreground"},Z1={class:"mt-1 text-sm text-muted-foreground"},eC={class:"text-foreground"},tC={class:"text-foreground"},nC={class:"mt-1 text-xs text-muted-foreground"},oC={key:0,class:"mt-3 flex items-center gap-2 text-sm"},aC={class:"flex items-center justify-between gap-3"},rC={class:"font-medium"},sC={class:"text-xs text-muted-foreground"},iC={class:"mt-2 text-sm text-muted-foreground"},lC={class:"flex flex-wrap items-center justify-between gap-3"},cC={class:"flex items-center gap-3"},dC={class:"leading-tight"},uC={class:"text-sm font-medium"},fC={class:"text-xs text-muted-foreground"},hC={class:"flex items-center gap-2"},mC={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},pC={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},gC=["src"],bC={class:"flex-1"},yC={class:"flex items-center justify-between gap-3"},xC={class:"font-medium"},kC={class:"text-xs text-muted-foreground"},wC={class:"mt-1 text-sm text-muted-foreground"},CC={class:"text-left sm:text-center"},_C={class:"text-xs text-muted-foreground"},BC={class:"text-left sm:text-center"},EC={class:"text-xs text-muted-foreground"},SC={class:"text-left sm:text-center"},AC={class:"text-xs text-muted-foreground"},VC={class:"flex items-center justify-between gap-3"},DC={class:"font-medium"},MC={class:"text-xs text-muted-foreground"},NC={class:"mt-2 text-sm text-muted-foreground"},PC={class:"mt-3 flex items-center gap-3"},vC={class:"text-sm font-medium"},TC={class:"flex items-start justify-between gap-3"},OC={class:"font-medium"},zC={class:"mt-3 grid gap-2 text-sm"},FC={class:"flex items-center justify-between gap-3"},IC={class:"flex items-center gap-2 text-muted-foreground"},RC={class:"font-medium"},LC={class:"flex items-center justify-between gap-3"},$C={class:"flex items-center gap-2 text-muted-foreground"},WC={class:"font-medium"},jC={class:"flex items-center justify-between gap-3"},UC={class:"flex items-center gap-2 text-muted-foreground"},HC={class:"font-medium"},qC={class:"flex items-center justify-between"},GC={class:"flex items-center gap-2"},XC={class:"flex items-start justify-between gap-3"},YC={class:"flex items-center gap-2"},KC={class:"font-medium"},JC={class:"mt-2 text-sm text-muted-foreground"},QC={key:0,class:"mt-1 text-sm text-muted-foreground"},ZC={class:"flex flex-wrap items-center justify-between gap-3"},e_={class:"flex items-center gap-2"},t_={class:"text-xs text-muted-foreground"},xd=n.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiMethod:{}},setup(e){const o=ze.useBreakpoints(ze.breakpointsTailwind).smaller("md");n.ref(!1);const a=e,r=n.ref(!1),s=n.ref(null),i=n.ref([]),l=n.computed(()=>i.value.length>0?i.value:a.items&&a.items.length>0?a.items:[]),c=async()=>{if(a.apiUrl){r.value=!0,s.value=null;try{const f=await fetch(a.apiUrl,{method:a.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{r.value=!1}}};n.onMounted(()=>{a.apiUrl&&c()}),n.watch(()=>a.apiUrl,()=>{a.apiUrl?c():i.value=[]});const d=f=>{switch(f){case"flight":return{Icon:te.PlaneIcon,Circle:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:te.ClockIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:te.ShoppingCartIcon,Circle:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:te.PencilIcon,Circle:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:te.ServerIcon,Circle:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:te.MapPinIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};default:return{Icon:te.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=n.resolveComponent("ShoppingCart"),p=n.resolveComponent("RefreshCcw"),g=n.resolveComponent("MapPin");return n.openBlock(),n.createElementBlock("div",W1,[h[8]||(h[8]=n.createElementVNode("div",{class:"flex flex-col space-y-1.5 py-6 px-3"},[n.createElementVNode("h3",{class:"leading-none tracking-tight text-lg font-medium"},"Timeline With Icons")],-1)),n.createElementVNode("div",j1,[r.value?(n.openBlock(),n.createElementBlock("div",U1,[...h[0]||(h[0]=[n.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):s.value?(n.openBlock(),n.createElementBlock("div",H1,n.toDisplayString(s.value),1)):(n.openBlock(),n.createElementBlock("div",q1,[h[7]||(h[7]=n.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),n.createElementVNode("div",G1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,(y,x)=>(n.openBlock(),n.createElementBlock("div",{key:x,class:"relative pl-14"},[n.createElementVNode("div",{class:n.normalizeClass(["absolute left-0 top-2 flex h-8 w-8 items-center justify-center rounded-full border",d(y.type).Circle])},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(d(y.type).Icon),{class:"h-4 w-4"}))],2),n.createElementVNode("div",X1,[n.createElementVNode("div",Y1,[y.type==="flight"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("div",K1,[n.createElementVNode("p",J1,n.toDisplayString(y.title),1),n.createElementVNode("p",Q1,n.toDisplayString(y.meta),1)]),n.createElementVNode("p",Z1,[n.createElementVNode("span",eC,n.toDisplayString(y.from),1),n.createVNode(n.unref(te.ArrowRight),{class:"mx-2 inline h-4 w-4"}),n.createElementVNode("span",tC,n.toDisplayString(y.to),1)]),n.createElementVNode("p",nC,n.toDisplayString(y.time),1),y.fileName?(n.openBlock(),n.createElementBlock("div",oC,[n.createVNode(n.unref(te.FileText),{class:"h-4 w-4 text-muted-foreground"}),n.createElementVNode("span",null,n.toDisplayString(y.fileName),1)])):n.createCommentVNode("",!0)],64)):y.type==="interview"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("div",aC,[n.createElementVNode("p",rC,n.toDisplayString(y.title),1),n.createElementVNode("p",sC,n.toDisplayString(y.meta),1)]),n.createElementVNode("p",iC,n.toDisplayString(y.desc),1),n.createVNode(n.unref(Ta),{class:"my-4"}),n.createElementVNode("div",lC,[n.createElementVNode("div",cC,[n.createVNode(n.unref(gd),{class:"h-10 w-10"},{default:n.withCtx(()=>[y.avatarUrl?(n.openBlock(),n.createBlock(n.unref(yd),{key:0,src:y.avatarUrl},null,8,["src"])):n.createCommentVNode("",!0),n.createVNode(n.unref(bd),null,{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(u(y.personName??"")),1)]),_:2},1024)]),_:2},1024),n.createElementVNode("div",dC,[n.createElementVNode("p",uC,n.toDisplayString(y.personName),1),n.createElementVNode("p",fC,n.toDisplayString(y.personRole),1)])]),n.createElementVNode("div",hC,[n.createVNode(n.unref(ut),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(te.MessageSquare),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(ut),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(te.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):y.type==="product"?(n.openBlock(),n.createElementBlock("div",mC,[n.createElementVNode("div",pC,[y.imgUrl?(n.openBlock(),n.createElementBlock("img",{key:0,src:y.imgUrl,class:"h-full w-full rounded-lg object-cover",alt:"product"},null,8,gC)):(n.openBlock(),n.createBlock(m,{key:1,class:"h-5 w-5 text-muted-foreground"}))]),n.createElementVNode("div",bC,[n.createElementVNode("div",yC,[n.createElementVNode("p",xC,n.toDisplayString(y.title),1),n.createElementVNode("p",kC,n.toDisplayString(y.meta),1)]),n.createElementVNode("p",wC,n.toDisplayString(y.desc),1),n.createElementVNode("div",{class:n.normalizeClass(["mt-4 grid gap-3",n.unref(o)?"grid-cols-1":"grid-cols-3"])},[n.createElementVNode("div",CC,[h[1]||(h[1]=n.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),n.createElementVNode("p",_C,n.toDisplayString(y.customer),1)]),n.createElementVNode("div",BC,[h[2]||(h[2]=n.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),n.createElementVNode("p",EC,n.toDisplayString(y.price),1)]),n.createElementVNode("div",SC,[h[3]||(h[3]=n.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),n.createElementVNode("p",AC,n.toDisplayString(y.qty),1)])],2)])])):y.type==="design"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createElementVNode("div",VC,[n.createElementVNode("p",DC,n.toDisplayString(y.title),1),n.createElementVNode("p",MC,n.toDisplayString(y.meta),1)]),n.createElementVNode("p",NC,n.toDisplayString(y.desc),1),n.createElementVNode("div",PC,[n.createVNode(n.unref(gd),{class:"h-10 w-10"},{default:n.withCtx(()=>[y.avatarUrl?(n.openBlock(),n.createBlock(n.unref(yd),{key:0,src:y.avatarUrl},null,8,["src"])):n.createCommentVNode("",!0),n.createVNode(n.unref(bd),null,{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(u(y.personName??"")),1)]),_:2},1024)]),_:2},1024),n.createElementVNode("p",vC,n.toDisplayString(y.personName),1)])],64)):y.type==="server"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:4},[n.createElementVNode("div",TC,[n.createElementVNode("p",OC,n.toDisplayString(y.title),1),n.createVNode(n.unref(Wn),{variant:"destructive",class:"h-6"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(y.chipText??""),1)]),_:2},1024)]),n.createElementVNode("div",zC,[n.createElementVNode("div",FC,[n.createElementVNode("div",IC,[n.createVNode(n.unref(te.Globe),{class:"h-4 w-4"}),h[4]||(h[4]=n.createElementVNode("span",null,"IP Address",-1))]),n.createElementVNode("span",RC,n.toDisplayString(y.ip),1)]),n.createElementVNode("div",LC,[n.createElementVNode("div",$C,[n.createVNode(n.unref(te.Cpu),{class:"h-4 w-4"}),h[5]||(h[5]=n.createElementVNode("span",null,"CPU",-1))]),n.createElementVNode("span",WC,n.toDisplayString(y.cpu),1)]),n.createElementVNode("div",jC,[n.createElementVNode("div",UC,[n.createVNode(n.unref(te.CpuIcon),{class:"h-4 w-4"}),h[6]||(h[6]=n.createElementVNode("span",null,"Memory",-1))]),n.createElementVNode("span",HC,n.toDisplayString(y.memory),1)])]),n.createVNode(n.unref(Ta),{class:"my-4"}),n.createElementVNode("div",qC,[n.createElementVNode("div",GC,[n.createVNode(n.unref(ut),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(te.Share2),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(ut),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(p,{class:"h-4 w-4"})]),_:1})])])],64)):y.type==="location"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:5},[n.createElementVNode("div",XC,[n.createElementVNode("div",YC,[n.createVNode(g,{class:"h-4 w-4 text-muted-foreground"}),n.createElementVNode("p",KC,n.toDisplayString(y.title),1)]),n.createVNode(n.unref(Wn),{variant:"destructive",class:"h-6"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(y.chipText),1)]),_:2},1024)]),n.createElementVNode("p",JC,n.toDisplayString(y.desc1),1),y.desc2?(n.openBlock(),n.createElementBlock("p",QC,n.toDisplayString(y.desc2),1)):n.createCommentVNode("",!0),n.createVNode(n.unref(Ta),{class:"my-4"}),n.createElementVNode("div",ZC,[n.createElementVNode("div",e_,[n.createVNode(n.unref(ut),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(te.Link),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(ut),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(te.MessageSquare),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(ut),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(te.User),{class:"h-4 w-4"})]),_:1})]),n.createElementVNode("p",t_,"Due date: "+n.toDisplayString(y.due),1)])],64)):n.createCommentVNode("",!0)])])]))),128))])]))])])}}}),n_={class:"dcode-upload-file"},o_={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"},a_={key:0,class:"text-xs text-gray-500 mt-1"},r_=["accept"],s_={key:1,class:"text-xs text-red-600 mt-1"},kd=n.defineComponent({name:"DCodeUploadFile",__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const o=t,a=r=>{var i;const s=(i=r.target.files)==null?void 0:i[0];s&&o("update:modelValue",s)};return(r,s)=>(n.openBlock(),n.createElementBlock("div",n_,[e.label?(n.openBlock(),n.createBlock(jn,{key:0,label:e.label},null,8,["label"])):n.createCommentVNode("",!0),n.createElementVNode("div",o_,[n.createVNode(n.unref(te.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=n.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[n.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),n.createTextVNode(" or drag and drop ")],-1)),e.accept?(n.openBlock(),n.createElementBlock("p",a_,n.toDisplayString(e.accept),1)):n.createCommentVNode("",!0),n.createElementVNode("input",{type:"file",class:"hidden",onChange:a,accept:e.accept},null,40,r_)]),e.errorMessage?(n.openBlock(),n.createElementBlock("p",s_,n.toDisplayString(e.errorMessage),1)):n.createCommentVNode("",!0)]))}}),i_=["onClick"],l_={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},c_={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},d_={key:1},u_={key:0,class:"text-white"},f_={key:1},h_={key:2},m_=["disabled","onClick"],p_={key:1,class:"mr-2 text-sm font-bold opacity-70"},g_={class:"whitespace-normal text-sm text-center leading-tight"},b_={class:"flex flex-col flex-1 min-w-0"},y_={class:"text-sm text-muted-foreground"},x_={class:"px-1"},k_=["disabled"],w_=["type"],C_=["disabled"],ks=xt(n.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(e,{emit:t}){const o=e,a=t,r=Je(),s=r==null?void 0:r.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const i=n.ref(o.defaultTab),l=n.computed({get(){var k;if(typeof o.modelValue=="string"){const b=(k=o.tabs)==null?void 0:k.findIndex(A=>A.key===o.modelValue);if(b!==void 0&&b>=0)return b}return(typeof o.modelValue=="number"?o.modelValue:void 0)??i.value},set(k){var b;if(i.value=k,typeof o.modelValue=="string"){const A=(b=o.tabs)==null?void 0:b[k];A?a("update:modelValue",A.key):a("update:modelValue",k)}else a("update:modelValue",k)}}),c=n.computed(()=>{var k;return((k=o.tabs)==null?void 0:k.length)??0}),d=n.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 f(k){return k?typeof k=="string"?Ct[k]||null:k:null}const h=n.reactive({});function m(k){return h[k.key]||(h[k.key]={loaded:!1,loading:!1,data:null,error:null}),h[k.key]}function p(){if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions}function g(k){const b=k.endpoint||{};return{apiModule:k.apiModule||b.apiModule,apiAction:k.apiAction||b.apiAction,apiUrl:b.apiUrl,apiMethod:b.apiMethod||"GET",apiParams:k.apiParams}}function y(k){if(o.isWizard||!o.allowTabClick||o.disabled)return!1;const b=o.tabs[k];return!(!b||b.disabled)}async function x(k){if(typeof k.tab.fetchData=="function"){const z=await k.tab.fetchData(),N=(z==null?void 0:z.data)??z;return(N==null?void 0:N.data)??N}const b=g(k.tab);if(!(b.apiModule&&b.apiAction||b.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const D=p();let P;if(b.apiUrl)P=await s("","",D,{_url:b.apiUrl,_method:b.apiMethod,_data:b.apiParams??void 0});else{const z={...D,...b.apiParams};P=await s(b.apiModule,b.apiAction,z)}const V=(P==null?void 0:P.data)??P;return(V==null?void 0:V.data)??V}async function _(k,{force:b=!1}={}){const A=u(k),D=o.tabs[A];if(!D)return;const P=m(D);if(!(o.cache&&P.loaded&&!b)&&!P.loading){P.loading=!0,P.error=null;try{const V=await x({tabIndex:A,tab:D});P.data=V,P.loaded=!0,a("loaded",{tabIndex:A,tab:D,data:V})}catch(V){const M=typeof(V==null?void 0:V.message)=="string"&&V.message||typeof V=="string"&&V||"Failed to load tab data.";P.error=M,a("error",{tabIndex:A,tab:D,message:M})}finally{P.loading=!1}}}function C(k){const b=u(k);y(b)&&b!==l.value&&(l.value=b)}function w(k=l.value){return _(k,{force:!0})}function E(){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 n.watch(()=>o.tabs,k=>{for(const b of k??[])m(b)},{immediate:!0}),n.watch(()=>l.value,async k=>{var A;const b=(A=o.tabs)==null?void 0:A[k];b&&a("change",{tabIndex:k,tab:b}),await _(k)},{immediate:!0}),n.watch(()=>o.autoFetchOnMount,async k=>{k&&await _(l.value)},{immediate:!0}),(k,b)=>{var A,D,P;return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["w-full rounded-lg border bg-card text-card-foreground shadow-sm",{"flex flex-row":e.isVertical}])},[n.createElementVNode("div",{class:n.normalizeClass(["flex flex-col space-y-1.5 p-6",{"w-64 border-r pr-0":e.isVertical,"pb-2":e.isWizard&&!e.isVertical}])},[n.createElementVNode("div",{class:n.normalizeClass({"mt-4":!e.isVertical||e.isWizard})},[e.isWizard?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["w-full relative flex overflow-visible rounded-lg",e.isVertical?"flex-col gap-2":""])},[e.isVertical?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(e.tabs,(V,M)=>(n.openBlock(),n.createElementBlock("div",{key:V.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[n.createElementVNode("div",{class:n.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-card",[M<l.value?"wizard-num-done":"",M===l.value?"wizard-num-active":M>l.value?"wizard-num-pending":""]])},[e.typeWizard==="icon"&&V.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(f(V.icon)),{key:0,class:"w-4 h-4"})):e.typeWizard==="number"||!V.icon&&e.typeWizard!=="none"?(n.openBlock(),n.createElementBlock("span",d_,[M<l.value?(n.openBlock(),n.createElementBlock("span",u_,"✓")):(n.openBlock(),n.createElementBlock("span",f_,n.toDisplayString(M+1),1))])):(n.openBlock(),n.createElementBlock("span",h_))],2),n.createElementVNode("span",{class:n.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",M===l.value?"wizard-text-active":"wizard-text-pending"])},n.toDisplayString(V.title),3)]))),128)):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(e.tabs,(V,M)=>(n.openBlock(),n.createElementBlock("div",{key:V.key,onClick:z=>C(M),style:n.normalizeStyle({zIndex:e.tabs.length-M}),class:"relative flex-1 group"},[n.createElementVNode("div",{class:n.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[M>0?"pl-8":"",M===l.value?"wizard-step-active":M<l.value?"wizard-step-done":"wizard-step-pending"]])},[e.typeWizard==="icon"&&V.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(f(V.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):e.typeWizard==="number"?(n.openBlock(),n.createElementBlock("span",l_,n.toDisplayString(M+1),1)):n.createCommentVNode("",!0),n.createElementVNode("span",c_,n.toDisplayString(V.title),1)],2),M<e.tabs.length-1?(n.openBlock(),n.createElementBlock("svg",{key:0,class:n.normalizeClass(["absolute top-0 -right-[15.5px] w-[16px] h-full transition-colors block z-10",[M===l.value?"wizard-svg-active":M<l.value?"wizard-svg-done":"wizard-svg-pending"]]),preserveAspectRatio:"none",viewBox:"0 0 16 48"},[...b[0]||(b[0]=[n.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):n.createCommentVNode("",!0)],12,i_))),128))],2)):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["flex w-full",e.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.tabs,(V,M)=>(n.openBlock(),n.createElementBlock("button",{key:V.key,type:"button",disabled:!y(M),onClick:z=>C(M),class:n.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",n.unref(we)("border-b border-r",!e.isVertical&&M===e.tabs.length-1&&"border-r-0",M===l.value?"wizard-btn-active":"wizard-btn-pending",!y(M)&&"opacity-60 cursor-not-allowed",e.isVertical?"w-full justify-start border-r-0":"flex-1")])},[e.typeWizard==="icon"&&V.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(f(V.icon)),{key:0,class:"h-4 w-4 shrink-0"})):e.typeWizard==="number"?(n.openBlock(),n.createElementBlock("span",p_,n.toDisplayString(M+1),1)):n.createCommentVNode("",!0),n.createElementVNode("span",g_,n.toDisplayString(V.title),1)],10,m_))),128))],2))],2)],2),e.isVertical?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(Ta),{key:0})),n.createElementVNode("div",b_,[n.createElementVNode("div",{class:n.normalizeClass(["p-6 flex-1 min-w-0",{"pl-6":e.isVertical}])},[d.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[(A=h[d.value.key])!=null&&A.loading?n.renderSlot(k.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[b[1]||(b[1]=n.createElementVNode("div",{class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground"},"Loading...",-1))],!0):n.renderSlot(k.$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:(P=h[d.value.key])==null?void 0:P.loaded,reload:w},()=>[n.createElementVNode("div",y_,[b[2]||(b[2]=n.createTextVNode(" Slot ",-1)),n.createElementVNode("code",x_,"tab-"+n.toDisplayString(d.value.key),1),b[3]||(b[3]=n.createTextVNode(" belum dibuat. ",-1))])],!0)],64)):n.createCommentVNode("",!0)],2),e.isWizard||e.showNavigation?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["flex items-center justify-between p-6 pt-0",{"pl-6":e.isVertical}])},[n.createElementVNode("button",{type:"button",onClick:E,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,k_),l.value<c.value-1?(n.openBlock(),n.createElementBlock("button",{key:0,type:e.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,w_)):(n.openBlock(),n.createElementBlock("button",{key:1,type:"submit",disabled:e.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"},[e.loading?(n.openBlock(),n.createBlock(n.unref(te.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(e.submitText),1)],8,C_))],2)):n.createCommentVNode("",!0)])],2)}}}),[["__scopeId","data-v-9379f062"]]),__={class:"permission-menu w-full space-y-4"},B_={class:"bg-white dark:bg-zinc-900 text-neutral-700 dark:text-neutral-100 p-4"},E_={class:"flex items-center justify-between"},S_={class:"flex items-center gap-3 flex-1"},A_=["onClick"],V_={key:1,class:"w-7"},D_={key:2,class:"flex-shrink-0"},M_={class:"text-lg font-semibold flex-1"},N_={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},P_={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},v_={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-2"},T_=["checked","disabled","onChange"],O_={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},z_={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},F_={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},I_={class:"bg-blue-500 dark:bg-primary-900 text-white p-3"},R_={class:"flex items-center justify-between"},L_={class:"flex items-center gap-3 flex-1"},$_={key:0,class:"flex-shrink-0"},W_={class:"text-base font-semibold flex-1"},j_={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},U_={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},H_=["checked","onChange"],q_={class:"text-xs font-medium"},G_={key:0,class:"p-3"},X_={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-2"},Y_=["checked","disabled","onChange"],K_={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},ws=xt(n.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(e,{expose:t,emit:o}){const{t:a}=Ht.useI18n(),r=e,s=o,i=n.computed(()=>r.menuList&&r.menuList.length>0?r.menuList:r.treeData||[]),l=n.ref(new Map),c=n.ref(new Set),d=(D=!0)=>{(V=>{V.forEach(M=>{M.permission.forEach(z=>{const N=`${M.id}-${z.id}-parent`,v=z.code==="VIEW"||z.name.toUpperCase()==="VIEW";l.value.has(N)||l.value.set(N,v||(D?M.checked??!1:!1))}),M.detail&&M.detail.length>0&&M.detail.forEach(z=>{z.permission.forEach(N=>{const v=`${z.id}-${N.id}-child`,T=N.code==="VIEW"||N.name.toUpperCase()==="VIEW";l.value.has(v)||l.value.set(v,T||(D?z.checked??!1:!1))})})})})(i.value)},u=()=>{console.log("[DCodePermissionMenu] initializeFromModelValue called. modelValue:",r.modelValue),l.value.clear(),d(!1),r.modelValue&&r.modelValue.length>0&&r.modelValue.forEach(D=>{const P=D.menuId,V=D.actionsIds;i.value.forEach(M=>{M.id===P&&V.forEach(z=>{const N=`${P}-${z}-parent`;l.value.set(N,!0)}),M.detail&&M.detail.length>0&&M.detail.forEach(z=>{z.id===P&&V.forEach(N=>{const v=`${P}-${N}-child`;l.value.set(v,!0)})})})})};u(),n.watch(()=>r.modelValue,()=>{u()},{deep:!0}),n.watch(()=>i.value.length,(D,P)=>{P===0&&D>0&&u()});const f=D=>D.detail&&D.detail.length>0,h=D=>{c.value.has(D)?c.value.delete(D):c.value.add(D)},m=D=>c.value.has(D),p=(D,P,V=!1)=>{const M=`${D}-${P}-${V?"child":"parent"}`;return l.value.get(M)??!1},g=()=>{const D=B();s("update:modelValue",D.permissions)},y=(D,P,V,M=!1)=>{const z=V.target.checked,N=`${D}-${P}-${M?"child":"parent"}`;l.value.set(N,z),s("permission-change",D,P,z,!M),g()},x=D=>D.permission.filter(_),_=D=>D.code==="VIEW"||D.name.toUpperCase()==="VIEW",C=(D,P,V)=>{const M=V.target.checked;P.permission.forEach(z=>{if(_(z)){const v=`${P.id}-${z.id}-child`;l.value.set(v,!0);return}const N=`${P.id}-${z.id}-child`;l.value.set(N,M)}),l.value=new Map(l.value),s("menu-check",P.id,M),g()},w=(D,P=!1)=>{const V=P?D.permission:x(D);return!V||V.length===0?!1:V.every(M=>{const z=`${D.id}-${M.id}-${P?"child":"parent"}`;return l.value.get(z)??!1})},E=()=>{const D={};return i.value.forEach(P=>{var V;D[P.id]={name:P.name,parentPermissions:P.permission.map(M=>({id:M.id,name:M.name,checked:p(P.id,M.id,!1)})),children:((V=P.detail)==null?void 0:V.map(M=>({id:M.id,name:M.name,permissions:M.permission.map(z=>({id:z.id,name:z.name,checked:p(M.id,z.id,!0)}))})))||[]}}),D},B=()=>{const D=[],P=(V,M=!1)=>{const z=[];V.permission.forEach(N=>{const v=`${V.id}-${N.id}-${M?"child":"parent"}`;(l.value.get(v)??!1)&&z.push(N.id)}),z.length>0&&D.push({menuId:V.id,actionsIds:z})};return i.value.forEach(V=>{P(V,!1),V.detail&&V.detail.length>0&&V.detail.forEach(M=>{P(M,!0)})}),{permissions:D}};return t({getCurrentStates:E,getPermissionsForDatabase:B,getAllPermissionsWithStatus:()=>{const D=[],P=(V,M=!1)=>{const z=V.permission.map(v=>{const T=`${V.id}-${v.id}-${M?"child":"parent"}`,R=l.value.get(T)??!1;return{id:v.id,name:v.name,checked:R}}),N=z.filter(v=>v.checked).map(v=>v.id);D.push({menuId:V.id,menuName:V.name,actionsIds:N,actions:z})};return i.value.forEach(V=>{P(V,!1),V.detail&&V.detail.length>0&&V.detail.forEach(M=>{P(M,!0)})}),{permissions:D}},permissionStates:l,expandAll:()=>{i.value.forEach(D=>{f(D)&&c.value.add(D.id)})},collapseAll:()=>{c.value.clear()}}),(D,P)=>(n.openBlock(),n.createElementBlock("div",__,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,V=>(n.openBlock(),n.createElementBlock("div",{key:V.id,class:n.normalizeClass(["dcode-card overflow-hidden",{"border-l-4 border-l-blue-500":f(V)}])},[n.createElementVNode("div",B_,[n.createElementVNode("div",E_,[n.createElementVNode("div",S_,[f(V)?(n.openBlock(),n.createElementBlock("button",{key:0,onClick:M=>h(V.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[m(V.id)?(n.openBlock(),n.createBlock(n.unref(te.ChevronDown),{key:0,class:"w-5 h-5"})):(n.openBlock(),n.createBlock(n.unref(te.ChevronRight),{key:1,class:"w-5 h-5"}))],8,A_)):(n.openBlock(),n.createElementBlock("div",V_)),e.showIcons&&V.icon?(n.openBlock(),n.createElementBlock("span",D_,[n.createElementVNode("i",{class:n.normalizeClass([V.icon,"text-2xl"])},null,2)])):n.createCommentVNode("",!0),n.createElementVNode("h3",M_,n.toDisplayString(V.name),1)])])]),V.permission&&V.permission.length>0&&!f(V)?(n.openBlock(),n.createElementBlock("div",N_,[n.createElementVNode("h4",P_,n.toDisplayString(n.unref(a)("common.permissions"))+": ",1),n.createElementVNode("div",v_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(x(V),M=>(n.openBlock(),n.createElementBlock("label",{key:M.id,class:"flex items-center gap-2 px-3 py-2 bg-white dark:bg-zinc-900 border border-gray-200 dark:border-neutral-700 rounded-lg cursor-pointer hover:border-blue-400 dark:hover:border-primary-500 hover:bg-blue-50 dark:hover:bg-zinc-800 transition-all group"},[n.createElementVNode("input",{type:"checkbox",checked:_(M)||p(V.id,M.id,!1),disabled:_(M),onChange:z=>y(V.id,M.id,z,!1),class:n.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",_(M)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,T_),n.createElementVNode("span",O_,n.toDisplayString(M.name),1)]))),128))])])):n.createCommentVNode("",!0),n.createVNode(n.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:n.withCtx(()=>[f(V)&&m(V.id)?(n.openBlock(),n.createElementBlock("div",z_,[n.createElementVNode("h4",F_,[P[0]||(P[0]=n.createElementVNode("span",{class:"w-1 h-4 bg-blue-500 rounded"},null,-1)),n.createTextVNode(" "+n.toDisplayString(n.unref(a)("common.subMenus")),1)]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(V.detail,M=>(n.openBlock(),n.createElementBlock("div",{key:M.id,class:"bg-white dark:bg-zinc-900 rounded-lg border border-gray-200 dark:border-neutral-700 overflow-hidden shadow-sm hover:shadow transition-shadow"},[n.createElementVNode("div",I_,[n.createElementVNode("div",R_,[n.createElementVNode("div",L_,[e.showIcons&&M.icon?(n.openBlock(),n.createElementBlock("span",$_,[n.createElementVNode("i",{class:n.normalizeClass([M.icon,"text-xl"])},null,2)])):n.createCommentVNode("",!0),n.createElementVNode("h5",W_,n.toDisplayString(M.name),1),M.path?(n.openBlock(),n.createElementBlock("span",j_,n.toDisplayString(M.path),1)):n.createCommentVNode("",!0),n.createElementVNode("label",U_,[n.createElementVNode("input",{type:"checkbox",checked:w(M,!0),onChange:z=>C(V,M,z),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,H_),n.createElementVNode("span",q_,n.toDisplayString(n.unref(a)("common.selectAll")),1)])])])]),M.permission&&M.permission.length>0?(n.openBlock(),n.createElementBlock("div",G_,[n.createElementVNode("div",X_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(M.permission,z=>(n.openBlock(),n.createElementBlock("label",{key:z.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"},[n.createElementVNode("input",{type:"checkbox",checked:_(z)||p(M.id,z.id,!0),disabled:_(z),onChange:N=>y(M.id,z.id,N,!0),class:n.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",_(z)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,Y_),n.createElementVNode("span",K_,n.toDisplayString(z.name),1)]))),128))])])):n.createCommentVNode("",!0)]))),128))])):n.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-e3cc2273"]]),J_={class:"space-y-4"},Q_={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},Z_={key:0,class:"text-danger-500"},eB={key:1,class:"flex items-center justify-center p-8 bg-white dark:bg-gray-800 rounded-lg shadow"},tB={class:"text-neutral-600 dark:text-neutral-400"},nB={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},oB={class:"text-neutral-500 dark:text-neutral-400"},aB={key:3,class:"space-y-3"},rB={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},sB={class:"flex items-center gap-3"},iB={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},lB={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},cB={class:"flex items-center gap-2 text-sm font-medium"},dB={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},uB={class:"p-4"},fB={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},hB={class:"ml-2 flex-1 min-w-0"},mB=["for"],pB={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},gB={key:4,class:"mt-1 text-xs text-danger-600"},Cs=n.defineComponent({__name:"DCodeTreePermissions",props:{modelValue:{},label:{},required:{type:Boolean},disabled:{type:Boolean},error:{},treeData:{}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,a=t,{t:r}=Ht.useI18n(),s=n.ref(!0),i=n.ref([]),l=n.ref({}),c=n.ref([]),d=n.ref({}),u=x=>{if(console.log(x),!x)return[];if(Array.isArray(x)&&x.length>0&&x[0].module&&Array.isArray(x[0].permissions))return x.map(_=>({menuId:_.menuId,module:_.module,label:_.label||_.module,permissions:_.permissions}));if(Array.isArray(x)&&x.length>0&&x[0].key){const _={};return x.forEach(C=>{const w=C.key,E=w&&w.includes(".")?w.split(".")[0]:"other";_[E]||(_[E]={menuId:0,module:E,label:E,permissions:[]}),_[E].permissions.push({id:C.id,key:C.key,label:C.label,description:C.description})}),Object.values(_)}if(Array.isArray(x)&&x.length>0&&x[0].id&&x[0].name&&Array.isArray(x[0].permission)){const _=[],C=(w,E="")=>{const B=E?`${E}.${w.name}`:w.name,k=B.toLowerCase().replace(/\s+/g,"_"),b=[];if(w.detail&&Array.isArray(w.detail)&&w.detail.forEach(A=>{b.push(A.id)}),w.permission&&w.permission.length>0){const A=w.permission.map(D=>({id:D.id,key:`${k}.${D.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${D.name} ${w.name}`,description:`Permission to ${D.name.toLowerCase()} ${w.name.toLowerCase()}`}));_.push({menuId:w.id,module:k,label:w.name,permissions:A,subMenuIds:b.length>0?b:void 0})}w.detail&&Array.isArray(w.detail)&&w.detail.forEach(A=>{C(A,B)})};return x.forEach(w=>C(w)),_}return x.data?u(x.data):[]},f=async()=>{s.value=!0;try{let x;o.treeData&&o.treeData.length>0?x=o.treeData:x=[];const _=u(x);i.value=_;const C={},w=[],E={};_.forEach(k=>{k.permissions.forEach(b=>{const A=typeof b.id=="string"?parseInt(b.id):b.id;E[A]=k.menuId})});const B=new Set;o.modelValue&&Array.isArray(o.modelValue)&&o.modelValue.forEach(k=>{w.push(k.menuId),k.actionsIds&&Array.isArray(k.actionsIds)&&k.actionsIds.forEach(b=>B.add(b))}),_.forEach(k=>k.permissions.forEach(b=>{const A=typeof b.id=="string"?parseInt(b.id):b.id;C[A]=B.has(A)})),l.value=C,c.value=w,d.value=E}catch{i.value=[]}finally{s.value=!1}},h=x=>x.permissions.filter(_=>{const C=typeof _.id=="string"?parseInt(_.id):_.id;return l.value[C]}).length,m=x=>x.permissions.every(_=>{const C=typeof _.id=="string"?parseInt(_.id):_.id;return l.value[C]}),p=x=>{const _=h(x);return _>0&&_<x.permissions.length},g=n.ref(!1),y=(x,_)=>{g.value=!0,x.permissions.map(E=>typeof E.id=="string"?parseInt(E.id):E.id),x.permissions.forEach(E=>{const B=typeof E.id=="string"?parseInt(E.id):E.id;l.value[B]=_});let C=o.modelValue?[...o.modelValue]:[],w=[x.menuId];x.subMenuIds&&x.subMenuIds.length>0&&(w=[...w,...x.subMenuIds],x.subMenuIds.forEach(E=>{const B=i.value.find(k=>k.menuId===E);B&&B.permissions.forEach(k=>{const b=typeof k.id=="string"?parseInt(k.id):k.id;l.value[b]=_})})),_?w.forEach(E=>{const B=i.value.find(k=>k.menuId===E);if(B){const k=B.permissions.map(A=>typeof A.id=="string"?parseInt(A.id):A.id),b=C.findIndex(A=>A.menuId===E);b!==-1?C[b]={menuId:E,actionsIds:k}:C.push({menuId:E,actionsIds:k})}}):C=C.filter(E=>!w.includes(E.menuId)),c.value=C.map(E=>E.menuId),console.log("Full Result:",JSON.stringify(C,null,2)),a("update:modelValue",C),setTimeout(()=>{g.value=!1},100)};return n.watch(()=>o.modelValue,x=>{if(!x)return;const _=new Set,C=[];x.forEach(w=>{C.push(w.menuId),w.actionsIds&&Array.isArray(w.actionsIds)&&w.actionsIds.forEach(E=>_.add(E))}),Object.keys(l.value).forEach(w=>{const E=parseInt(w);l.value[E]=_.has(E)}),c.value=C}),n.watch(()=>o.treeData,x=>{x&&x.length>0&&f()},{deep:!0}),n.watch(l,(x,_)=>{if(g.value)return;if(Object.keys(x).map(w=>parseInt(w)).filter(w=>x[w]!==(_==null?void 0:_[w])).length>0){let w=o.modelValue?[...o.modelValue]:[];const E={};Object.keys(x).forEach(B=>{const k=parseInt(B);if(x[k]){const b=d.value[k];console.log(`Permission ${k} belongs to Menu ${b}`),b!==void 0&&(E[b]||(E[b]=[]),E[b].push(k))}}),Object.keys(E).forEach(B=>{const k=parseInt(B),b=E[k],A=w.findIndex(D=>D.menuId===k);A!==-1?w[A]={menuId:k,actionsIds:b}:w.push({menuId:k,actionsIds:b})}),w=w.filter(B=>E[B.menuId]&&E[B.menuId].length>0),c.value=w.map(B=>B.menuId),console.log("Result:",JSON.stringify(w,null,2)),a("update:modelValue",w)}},{deep:!0}),n.onMounted(f),(x,_)=>(n.openBlock(),n.createElementBlock("div",J_,[e.label?(n.openBlock(),n.createElementBlock("label",Q_,[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",Z_,"*")):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),s.value?(n.openBlock(),n.createElementBlock("div",eB,[n.createVNode(n.unref(te.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),n.createElementVNode("span",tB,n.toDisplayString(n.unref(r)("common.loadingPermissions")),1)])):i.value.length===0?(n.openBlock(),n.createElementBlock("div",nB,[n.createElementVNode("p",oB,n.toDisplayString(n.unref(r)("common.noPermissions")),1)])):(n.openBlock(),n.createElementBlock("div",aB,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,C=>(n.openBlock(),n.createElementBlock("div",{key:C.module,class:"bg-white dark:bg-neutral-900 rounded-lg border border-neutral-200 dark:border-neutral-700 shadow-sm hover:shadow-md transition-shadow"},[n.createElementVNode("div",rB,[n.createElementVNode("div",sB,[n.createVNode(on,{modelValue:m(C),indeterminate:p(C),"onUpdate:modelValue":w=>y(C,!!w),disabled:e.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),n.createElementVNode("div",null,[n.createElementVNode("div",iB,n.toDisplayString(C.label||C.module),1),n.createElementVNode("div",lB,n.toDisplayString(h(C))+" "+n.toDisplayString(n.unref(r)("common.from"))+" "+n.toDisplayString(C.permissions.length)+" "+n.toDisplayString(n.unref(r)("common.selected")),1)])]),n.createElementVNode("div",cB,[n.createElementVNode("div",dB,n.toDisplayString(h(C))+"/"+n.toDisplayString(C.permissions.length),1)])]),n.createElementVNode("div",uB,[n.createElementVNode("div",fB,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(C.permissions,w=>(n.openBlock(),n.createElementBlock("div",{key:w.id,class:"flex items-start p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"},[n.createVNode(on,{modelValue:l.value[typeof w.id=="string"?parseInt(w.id):w.id],"onUpdate:modelValue":E=>l.value[typeof w.id=="string"?parseInt(w.id):w.id]=E,disabled:e.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),n.createElementVNode("div",hB,[n.createElementVNode("label",{for:`perm-${w.id}`,class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer block"},n.toDisplayString(w.label||w.key),9,mB),w.description?(n.openBlock(),n.createElementBlock("p",pB,n.toDisplayString(w.description),1)):n.createCommentVNode("",!0)])]))),128))])])]))),128))])),e.error?(n.openBlock(),n.createElementBlock("p",gB,n.toDisplayString(e.error),1)):n.createCommentVNode("",!0)]))}}),bB=(e,t="short",o="id-ID")=>{const a=typeof e=="string"?new Date(e):e,r=c=>String(c).padStart(2,"0"),s=c=>`${r(c.getHours())}:${r(c.getMinutes())}:${r(c.getSeconds())}`,l={id:"id-ID",en:"en-GB"}[o]||o;return t==="time"?s(a):t==="datetime"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(a):t==="long"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(a):new Intl.DateTimeFormat(l,{day:"2-digit",month:"short",year:"numeric"}).format(a)},yB=e=>new Promise((t,o)=>{const a=document.createElement("textarea");a.value=e,a.style.top="0",a.style.left="0",a.style.position="fixed",document.body.appendChild(a),a.focus(),a.select();try{document.execCommand("copy")?t():o(new Error("Copy command was unsuccessful"))}catch(r){o(r)}finally{document.body.removeChild(a)}}),xB=async e=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(e):yB(e),kB=n.defineComponent({__name:"Sheet",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const o=e,a=t,r=ie.useForwardPropsEmits(o,a);return(s,i)=>(n.openBlock(),n.createBlock(n.unref(ie.DialogRoot),n.normalizeProps(n.guardReactiveProps(n.unref(r))),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16))}}),wB=n.defineComponent({inheritAttrs:!1,__name:"SheetContent",props:{class:{type:[Boolean,null,String,Object,Array]},side:{},forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const o=e,a=t,r=ze.reactiveOmit(o,"class","side"),s=ie.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(ie.DialogPortal),null,{default:n.withCtx(()=>[n.createVNode(n.unref(ie.DialogOverlay),{class:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),n.createVNode(n.unref(ie.DialogContent),n.mergeProps({class:n.unref(we)(n.unref(AB)({side:e.side}),o.class)},{...n.unref(s),...i.$attrs}),{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default"),n.createVNode(n.unref(ie.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-secondary"},{default:n.withCtx(()=>[n.createVNode(n.unref(te.X),{class:"w-4 h-4"})]),_:1})]),_:3},16,["class"])]),_:3}))}}),CB=n.defineComponent({__name:"SheetDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=ze.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ie.DialogDescription),n.mergeProps({class:n.unref(we)("text-sm text-muted-foreground",t.class)},n.unref(o)),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_B=n.defineComponent({__name:"SheetFooter",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(we)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),BB=n.defineComponent({__name:"SheetHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(we)("flex flex-col gap-y-2 text-center sm:text-left",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),EB=n.defineComponent({__name:"SheetTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=ze.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ie.DialogTitle),n.mergeProps({class:n.unref(we)("text-lg font-medium text-foreground",t.class)},n.unref(o)),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),SB=n.defineComponent({__name:"SheetTrigger",props:{asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ie.DialogTrigger),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),AB=eo("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),VB={class:"flex-1 overflow-hidden"},DB=n.defineComponent({__name:"DataFilterSheet",props:{title:{default:"Filter Data"},description:{default:"Masukan parameter pencarian untuk memfilter data."}},setup(e){return(t,o)=>(n.openBlock(),n.createBlock(n.unref(kB),null,{default:n.withCtx(()=>[n.createVNode(n.unref(SB),{"as-child":""},{default:n.withCtx(()=>[n.renderSlot(t.$slots,"trigger",{},()=>[n.createVNode(n.unref(ut),{variant:"outline",class:"gap-2"},{default:n.withCtx(()=>[n.createVNode(n.unref(te.Search),{class:"w-4 h-4"}),o[0]||(o[0]=n.createElementVNode("span",null,"Pencarian",-1))]),_:1})])]),_:3}),n.createVNode(n.unref(wB),{class:"flex flex-col h-full"},{default:n.withCtx(()=>[n.createVNode(n.unref(BB),{class:"flex-shrink-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(EB),{class:"text-xl font-bold"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1}),n.createVNode(n.unref(CB),{class:"text-sm font-medium text-neutral-600 dark:text-neutral-400"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.description),1)]),_:1})]),_:1}),n.createElementVNode("div",VB,[n.renderSlot(t.$slots,"default")]),n.createVNode(n.unref(_B),{class:"flex-shrink-0"},{default:n.withCtx(()=>[n.renderSlot(t.$slots,"footer")]),_:3})]),_:3})]),_:3}))}}),MB={key:0},NB=["value","name"],wd=n.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const{locale:o}=Ht.useI18n(),a=e,r=t,s=n.ref(a.modelValue);n.watch(()=>a.modelValue,u=>{s.value=u});const i={DCodeTextField:va,DCodeAutoComplete:Lo,DCodeDatePicker:Sa,DCodeTextarea:Un,DCodeTextArea:Un,DCodeCheckbox:on,DCodeSwitch:Pa,DCodeOtpInput:Da,DCodeImageField:Va,DCodeSlider:Na},l=n.computed(()=>{const u=a.field.component;return i[u]||null}),c=n.computed(()=>{const u=a.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,r("update:modelValue",u)};return(u,f)=>e.field.isHidden?(n.openBlock(),n.createElementBlock("div",MB,[n.createElementVNode("input",{type:"hidden",value:s.value,name:e.field.model},null,8,NB)])):(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.value),n.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"]))}}),PB=n.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,a=t,r=ze.useVModel(o,"modelValue",a,{passive:!0,defaultValue:o.defaultValue});return(s,i)=>n.withDirectives((n.openBlock(),n.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>n.isRef(r)?r.value=l:null),class:n.normalizeClass(n.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)),[[n.vModelText,n.unref(r)]])}}),vB=n.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(e,{emit:t}){const o=e,a=t,r=ze.reactiveOmit(o,"class"),s=ie.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(ie.PaginationRoot),n.mergeProps({"data-slot":"pagination"},n.unref(s),{class:o.class}),{default:n.withCtx(c=>[n.renderSlot(i.$slots,"default",n.normalizeProps(n.guardReactiveProps(c)))]),_:3},16,["class"]))}}),TB=n.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=ze.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ie.PaginationList),n.mergeProps({"data-slot":"pagination-content"},n.unref(o),{class:n.unref(we)("flex flex-row items-center gap-1",t.class)}),{default:n.withCtx(s=>[n.renderSlot(a.$slots,"default",n.normalizeProps(n.guardReactiveProps(s)))]),_:3},16,["class"]))}}),OB=n.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=ze.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ie.PaginationEllipsis),n.mergeProps({"data-slot":"pagination-ellipsis"},n.unref(o),{class:n.unref(we)("flex size-9 items-center justify-center",t.class)}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default",{},()=>[n.createVNode(n.unref(te.MoreHorizontal),{class:"size-4"}),r[0]||(r[0]=n.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),zB=n.defineComponent({__name:"PaginationFirst",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=ze.reactiveOmit(t,"class","size"),a=ie.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ie.PaginationFirst),n.mergeProps({"data-slot":"pagination-first",class:n.unref(we)(n.unref(Nn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},n.unref(a)),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[n.createVNode(n.unref(te.ChevronLeftIcon)),s[0]||(s[0]=n.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),FB=n.defineComponent({__name:"PaginationItem",props:{value:{},asChild:{type:Boolean},as:{},size:{default:"icon"},class:{type:[Boolean,null,String,Object,Array]},isActive:{type:Boolean}},setup(e){const t=e,o=ze.reactiveOmit(t,"class","size","isActive");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ie.PaginationListItem),n.mergeProps({"data-slot":"pagination-item"},n.unref(o),{class:n.unref(we)(n.unref(Nn)({variant:"ghost",size:e.size}),e.isActive?"bg-[#0056a1] dark:bg-[#003d75] text-white hover:bg-[#0056a1]/90 dark:hover:bg-[#003d75]/90 hover:text-white":"",t.class)}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),IB=n.defineComponent({__name:"PaginationLast",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=ze.reactiveOmit(t,"class","size"),a=ie.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ie.PaginationLast),n.mergeProps({"data-slot":"pagination-last",class:n.unref(we)(n.unref(Nn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},n.unref(a)),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[s[0]||(s[0]=n.createElementVNode("span",{class:"hidden sm:block"},"Last",-1)),n.createVNode(n.unref(te.ChevronRightIcon))])]),_:3},16,["class"]))}}),RB=n.defineComponent({__name:"PaginationNext",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=ze.reactiveOmit(t,"class","size"),a=ie.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ie.PaginationNext),n.mergeProps({"data-slot":"pagination-next",class:n.unref(we)(n.unref(Nn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},n.unref(a)),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[s[0]||(s[0]=n.createElementVNode("span",{class:"hidden sm:block"},"Next",-1)),n.createVNode(n.unref(te.ChevronRightIcon))])]),_:3},16,["class"]))}}),LB=n.defineComponent({__name:"PaginationPrevious",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=ze.reactiveOmit(t,"class","size"),a=ie.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ie.PaginationPrev),n.mergeProps({"data-slot":"pagination-previous",class:n.unref(we)(n.unref(Nn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},n.unref(a)),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[n.createVNode(n.unref(te.ChevronLeftIcon)),s[0]||(s[0]=n.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),$B=n.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(e,{emit:t}){const o=e,a=t,r=ie.useForwardPropsEmits(o,a);return(s,i)=>(n.openBlock(),n.createBlock(n.unref(ie.SelectRoot),n.normalizeProps(n.guardReactiveProps(n.unref(r))),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16))}}),WB=n.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(e,{emit:t}){const o=e,a=t,r=ze.reactiveOmit(o,"class"),s=ie.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(ie.SelectPortal),null,{default:n.withCtx(()=>[n.createVNode(n.unref(ie.SelectContent),n.mergeProps({...n.unref(s),...i.$attrs},{class:n.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",e.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:n.withCtx(()=>[n.createVNode(n.unref(qB)),n.createVNode(n.unref(ie.SelectViewport),{class:n.normalizeClass(n.unref(we)("p-1",e.position==="popper"&&"h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]"))},{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},8,["class"]),n.createVNode(n.unref(HB))]),_:3},16,["class"])]),_:3}))}}),jB={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},UB=n.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=ze.reactiveOmit(t,"class"),a=ie.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ie.SelectItem),n.mergeProps(n.unref(a),{class:n.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",t.class)}),{default:n.withCtx(()=>[n.createElementVNode("span",jB,[n.createVNode(n.unref(ie.SelectItemIndicator),null,{default:n.withCtx(()=>[n.createVNode(n.unref(te.Check),{class:"h-4 w-4"})]),_:1})]),n.createVNode(n.unref(ie.SelectItemText),null,{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),HB=n.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=ze.reactiveOmit(t,"class"),a=ie.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ie.SelectScrollDownButton),n.mergeProps(n.unref(a),{class:n.unref(we)("flex cursor-default items-center justify-center py-1",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[n.createVNode(n.unref(te.ChevronDown))])]),_:3},16,["class"]))}}),qB=n.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=ze.reactiveOmit(t,"class"),a=ie.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ie.SelectScrollUpButton),n.mergeProps(n.unref(a),{class:n.unref(we)("flex cursor-default items-center justify-center py-1",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[n.createVNode(n.unref(te.ChevronUp))])]),_:3},16,["class"]))}}),GB=n.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=ze.reactiveOmit(t,"class"),a=ie.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ie.SelectTrigger),n.mergeProps(n.unref(a),{class:n.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",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default"),n.createVNode(n.unref(ie.SelectIcon),{"as-child":""},{default:n.withCtx(()=>[n.createVNode(n.unref(te.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),XB=n.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ie.SelectValue),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),So={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Hn={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},ot={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},YB={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},KB={dangerouslyHTMLString:!1,multiple:!0,position:So.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},JB={rtl:!1,newestOnTop:!1,toastClassName:""},Cd={...KB,...JB};ot.DEFAULT;var Se=(e=>(e[e.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",e[e.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",e.CSS_NAMESPACE="Toastify",e))(Se||{}),_s=(e=>(e.ENTRANCE_ANIMATION_END="d",e))(_s||{});const QB={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},ZB={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},e2={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},t2={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},_d="Toastify--animate Toastify__none-enter";function Bd(e,t=!1){var o;let a=QB;if(!e||typeof e=="string")switch(e){case"flip":a=t2;break;case"zoom":a=e2;break;case"slide":a=ZB;break}else a=e;if(t)a.enter=_d;else if(a.enter===_d){const r=(o=a.exit.split("__")[1])==null?void 0:o.split("-")[0];a.enter=`Toastify--animate Toastify__${r}-enter`}return a}function n2(e){return e.containerId||String(e.position)}const Oa="will-unmount";function o2(e=So.TOP_RIGHT){return!!document.querySelector(`.${Se.CSS_NAMESPACE}__toast-container--${e}`)}function a2(e=So.TOP_RIGHT){return`${Se.CSS_NAMESPACE}__toast-container--${e}`}function r2(e,t,o=!1){const a=[`${Se.CSS_NAMESPACE}__toast-container`,`${Se.CSS_NAMESPACE}__toast-container--${e}`,o?`${Se.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return Gn(t)?t({position:e,rtl:o,defaultClassName:a}):`${a} ${t||""}`}function s2(e){var t;const{position:o,containerClassName:a,rtl:r=!1,style:s={}}=e,i=Se.CSS_NAMESPACE,l=a2(o),c=document.querySelector(`.${i}`),d=document.querySelector(`.${l}`),u=!!d&&!((t=d.className)!=null&&t.includes(Oa)),f=c||document.createElement("div"),h=document.createElement("div");h.className=r2(o,a,r),h.dataset.testid=`${Se.CSS_NAMESPACE}__toast-container--${o}`,h.id=n2(e);for(const m in s)if(Object.prototype.hasOwnProperty.call(s,m)){const p=s[m];h.style[m]=p}return c||(f.className=Se.CSS_NAMESPACE,document.body.appendChild(f)),u||f.appendChild(h),h}function Bs(e){var t,o,a;const r=typeof e=="string"?e:((t=e.currentTarget)==null?void 0:t.id)||((o=e.target)==null?void 0:o.id),s=document.getElementById(r);s&&s.removeEventListener("animationend",Bs,!1);try{Ao[r].unmount(),(a=document.getElementById(r))==null||a.remove(),delete Ao[r],delete Ye[r]}catch{}}const Ao=n.reactive({});function i2(e,t){const o=document.getElementById(String(t));o&&(Ao[o.id]=e)}function Es(e,t=!0){const o=String(e);if(!Ao[o])return;const a=document.getElementById(o);a&&a.classList.add(Oa),t?(c2(e),a&&a.addEventListener("animationend",Bs,!1)):Bs(o),pt.items=pt.items.filter(r=>r.containerId!==e)}function l2(e){for(const t in Ao)Es(t,e);pt.items=[]}function Ed(e,t){const o=document.getElementById(e.toastId);if(o){let a=e;a={...a,...Bd(a.transition)};const r=a.appendPosition?`${a.exit}--${a.position}`:a.exit;o.className+=` ${r}`,t&&t(o)}}function c2(e){for(const t in Ye)if(t===e)for(const o of Ye[t]||[])Ed(o)}function d2(e){const t=qn().find(o=>o.toastId===e);return t==null?void 0:t.containerId}function Ss(e){return document.getElementById(e)}function u2(e){const t=Ss(e.containerId);return t&&t.classList.contains(Oa)}function Sd(e){var t;const o=n.isVNode(e.content)?n.toRaw(e.content.props):null;return o??n.toRaw((t=e.data)!=null?t:{})}function f2(e){return e?pt.items.filter(t=>t.containerId===e).length>0:pt.items.length>0}function h2(){if(pt.items.length>0){const e=pt.items.shift();za(e==null?void 0:e.toastContent,e==null?void 0:e.toastProps)}}const Ye=n.reactive({}),pt=n.reactive({items:[]});function qn(){const e=n.toRaw(Ye);return Object.values(e).reduce((t,o)=>[...t,...o],[])}function m2(e){return qn().find(t=>t.toastId===e)}function za(e,t={}){if(u2(t)){const o=Ss(t.containerId);o&&o.addEventListener("animationend",As.bind(null,e,t),!1)}else As(e,t)}function As(e,t={}){const o=Ss(t.containerId);o&&o.removeEventListener("animationend",As.bind(null,e,t),!1);const a=Ye[t.containerId]||[],r=a.length>0;if(!r&&!o2(t.position)){const s=s2(t),i=n.createApp(I2,t);t.useHandler&&t.useHandler(i),i.mount(s),i2(i,s.id)}r&&!t.updateId&&(t.position=a[0].position),n.nextTick(()=>{t.updateId?dt.update(t):dt.add(e,t)})}const dt={add(e,t){const{containerId:o=""}=t;o&&(Ye[o]=Ye[o]||[],Ye[o].find(a=>a.toastId===t.toastId)||setTimeout(()=>{var a,r;t.newestOnTop?(a=Ye[o])==null||a.unshift(t):(r=Ye[o])==null||r.push(t),t.onOpen&&t.onOpen(Sd(t))},t.delay||0))},remove(e){if(e){const t=d2(e);if(t){const o=Ye[t];let a=o.find(r=>r.toastId===e);Ye[t]=o.filter(r=>r.toastId!==e),!Ye[t].length&&!f2(t)&&Es(t,!1),h2(),n.nextTick(()=>{a!=null&&a.onClose&&(a.onClose(Sd(a)),a=void 0)})}}},update(e={}){const{containerId:t=""}=e;if(t&&e.updateId){Ye[t]=Ye[t]||[];const o=Ye[t].find(s=>s.toastId===e.toastId),a=(o==null?void 0:o.position)!==e.position||(o==null?void 0:o.transition)!==e.transition,r={...e,disabledEnterTransition:!a,updateId:void 0};dt.dismissForce(e==null?void 0:e.toastId),setTimeout(()=>{Te(r.content,r)},e.delay||0)}},clear(e,t=!0){e?Es(e,t):l2(t)},dismissCallback(e){var t;const o=(t=e.currentTarget)==null?void 0:t.id,a=document.getElementById(o);a&&(a.removeEventListener("animationend",dt.dismissCallback,!1),setTimeout(()=>{dt.remove(o)}))},dismiss(e){if(e){const t=qn();for(const o of t)if(o.toastId===e){Ed(o,a=>{a.addEventListener("animationend",dt.dismissCallback,!1)});break}}},dismissForce(e){if(e){const t=qn();for(const o of t)if(o.toastId===e){const a=document.getElementById(e);a&&(a.remove(),a.removeEventListener("animationend",dt.dismissCallback,!1),dt.remove(e));break}}}},p2=n.reactive({useHandler:void 0}),Ad=n.reactive({}),Fa=n.reactive({});function Vd(){return Math.random().toString(36).substring(2,9)}function g2(e){return typeof e=="number"&&!isNaN(e)}function Vs(e){return typeof e=="string"}function Gn(e){return typeof e=="function"}function Ia(...e){return n.mergeProps(...e)}function Ra(e){return typeof e=="object"&&(!!(e!=null&&e.render)||!!(e!=null&&e.setup)||typeof(e==null?void 0:e.type)=="object")}function b2(e={}){Ad[`${Se.CSS_NAMESPACE}-default-options`]=e}function Dd(){return Ad[`${Se.CSS_NAMESPACE}-default-options`]||Cd}function y2(){const e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||e?"dark":"light"}var La=(e=>(e[e.Enter=0]="Enter",e[e.Exit=1]="Exit",e))(La||{});const Md={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:So.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:Hn.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:ot.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}},x2={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:ot.DEFAULT},theme:{type:String,required:!1,default:Hn.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}},k2=n.defineComponent({name:"ProgressBar",props:x2,setup(e,{attrs:t}){const o=n.ref(),a=n.computed(()=>e.hide?"true":"false"),r=n.computed(()=>({...t.style||{},animationDuration:`${e.autoClose===!0?5e3:e.autoClose}ms`,animationPlayState:e.isRunning?"running":"paused",opacity:e.hide||e.autoClose===!1?0:1,transform:e.controlledProgress?`scaleX(${e.progress})`:"none"})),s=n.computed(()=>[`${Se.CSS_NAMESPACE}__progress-bar`,e.controlledProgress?`${Se.CSS_NAMESPACE}__progress-bar--controlled`:`${Se.CSS_NAMESPACE}__progress-bar--animated`,`${Se.CSS_NAMESPACE}__progress-bar-theme--${e.theme}`,`${Se.CSS_NAMESPACE}__progress-bar--${e.type}`,e.rtl?`${Se.CSS_NAMESPACE}__progress-bar--rtl`:null].filter(Boolean).join(" ")),i=n.computed(()=>`${s.value} ${(t==null?void 0:t.class)||""}`),l=()=>{o.value&&(o.value.onanimationend=null,o.value.ontransitionend=null)},c=()=>{e.isIn&&e.closeToast&&e.autoClose!==!1&&(e.closeToast(),l())},d=n.computed(()=>e.controlledProgress?null:c),u=n.computed(()=>e.controlledProgress?c:null);return n.watchEffect(()=>{o.value&&(l(),o.value.onanimationend=d.value,o.value.ontransitionend=u.value)}),()=>n.createVNode("div",{ref:o,role:"progressbar","aria-hidden":a.value,"aria-label":"notification timer",class:i.value,style:r.value},null)}}),w2=n.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:Hn.AUTO},type:{type:String,required:!1,default:Hn.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(e){return()=>n.createVNode("button",{class:`${Se.CSS_NAMESPACE}__close-button ${Se.CSS_NAMESPACE}__close-button--${e.theme}`,type:"button",onClick:t=>{t.stopPropagation(),e.closeToast&&e.closeToast(t)},"aria-label":e.ariaLabel},[n.createVNode("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},[n.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)])])}}),$a=({theme:e,type:t,path:o,...a})=>n.createVNode("svg",n.mergeProps({viewBox:"0 0 24 24",width:"100%",height:"100%",style:{fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`}},a),[n.createVNode("path",{d:o},null)]);function C2(e){return n.createVNode($a,n.mergeProps(e,{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 _2(e){return n.createVNode($a,n.mergeProps(e,{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 B2(e){return n.createVNode($a,n.mergeProps(e,{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 E2(e){return n.createVNode($a,n.mergeProps(e,{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 S2(){return n.createVNode("div",{class:`${Se.CSS_NAMESPACE}__spinner`},null)}const Wa={info:_2,warning:C2,success:B2,error:E2,spinner:S2},A2=e=>e in Wa;function V2({theme:e,type:t,isLoading:o,icon:a}){let r;const s=!!o||t==="loading",i={theme:e,type:t};if(s&&(a===void 0||typeof a=="boolean"))return Wa.spinner();if(a!==!1){if(Ra(a))r=n.toRaw(a);else if(Gn(a)){const l=a;i.type=s?"loading":t,r=l(i),r=!r&&s?Wa.spinner():r}else n.isVNode(a)?r=n.cloneVNode(a,i):Vs(a)||g2(a)?r=a:A2(t)&&(r=Wa[t](i));return r}}const D2=()=>{};function M2(e,t,o=Se.COLLAPSE_DURATION){const{scrollHeight:a,style:r}=e,s=o;requestAnimationFrame(()=>{r.minHeight="initial",r.height=a+"px",r.transition=`all ${s}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(t,s)})})}function N2(e){const t=n.ref(!1),o=n.ref(!1),a=n.ref(!1),r=n.ref(La.Enter),s=n.reactive({...e,appendPosition:e.appendPosition||!1,collapse:typeof e.collapse>"u"?!0:e.collapse,collapseDuration:e.collapseDuration||Se.COLLAPSE_DURATION}),i=s.done||D2,l=n.computed(()=>s.appendPosition?`${s.enter}--${s.position}`:s.enter),c=n.computed(()=>s.appendPosition?`${s.exit}--${s.position}`:s.exit),d=n.computed(()=>e.pauseOnHover?{onMouseenter:y,onMouseleave:g}:{});function u(){const _=l.value.split(" ");h().addEventListener(_s.ENTRANCE_ANIMATION_END,g,{once:!0});const C=E=>{const B=h();E.target===B&&(B.dispatchEvent(new Event(_s.ENTRANCE_ANIMATION_END)),B.removeEventListener("animationend",C),B.removeEventListener("animationcancel",C),r.value===La.Enter&&E.type!=="animationcancel"&&B.classList.remove(..._))},w=()=>{const E=h();E.classList.add(..._),E.addEventListener("animationend",C),E.addEventListener("animationcancel",C)};e.pauseOnFocusLoss&&m(),w()}function f(){if(!h())return;const _=()=>{const w=h();w.removeEventListener("animationend",_),s.collapse?M2(w,i,s.collapseDuration):i()},C=()=>{const w=h();r.value=La.Exit,w&&(w.className+=` ${c.value}`,w.addEventListener("animationend",_))};o.value||(a.value?_():setTimeout(C))}function h(){return e.toastRef.value}function m(){document.hasFocus()||y(),window.addEventListener("focus",g),window.addEventListener("blur",y)}function p(){window.removeEventListener("focus",g),window.removeEventListener("blur",y)}function g(){(!e.loading.value||e.isLoading===void 0)&&(t.value=!0)}function y(){t.value=!1}function x(_){_&&(_.stopPropagation(),_.preventDefault()),o.value=!1}return n.watchEffect(f),n.watchEffect(()=>{const _=qn();o.value=_.findIndex(C=>C.toastId===s.toastId)>-1}),n.watchEffect(()=>{e.isLoading!==void 0&&(e.loading.value?y():g())}),n.onMounted(u),n.onUnmounted(()=>{e.pauseOnFocusLoss&&p()}),{isIn:o,isRunning:t,hideToast:x,eventHandlers:d}}function P2(e){if(!e||typeof e!="object"||Array.isArray(e)||e.__v_isVNode)return!1;const t=e;return["title","content"].some(o=>o in t)}const v2=n.defineComponent({name:"ToastItem",inheritAttrs:!1,props:Md,setup(e){const t=n.ref(),o=n.computed(()=>!!e.isLoading),a=n.computed(()=>e.progress!==void 0&&e.progress!==null),r=n.computed(()=>V2(e)),s=n.computed(()=>[`${Se.CSS_NAMESPACE}__toast`,`${Se.CSS_NAMESPACE}__toast-theme--${e.theme}`,`${Se.CSS_NAMESPACE}__toast--${e.type}`,e.rtl?`${Se.CSS_NAMESPACE}__toast--rtl`:void 0,e.toastClassName||""].filter(Boolean).join(" ")),{isRunning:i,isIn:l,hideToast:c,eventHandlers:d}=N2({toastRef:t,loading:o,done:()=>{dt.remove(e.toastId)},...Bd(e.transition,e.disabledEnterTransition),...e});function u(){const f=e.content;if(P2(f)){const h=[];return f.title!==void 0&&h.push(n.createVNode("div",{"data-testid":"toast-text-title",class:`${Se.CSS_NAMESPACE}__toast-text-title`},[f.title])),f.content!==void 0&&h.push(n.createVNode("div",{"data-testid":"toast-text-content",class:`${Se.CSS_NAMESPACE}__toast-text-content`},[f.content])),n.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${Se.CSS_NAMESPACE}__toast-text`},[h])}return Ra(f)?n.h(n.toRaw(f),{toastProps:n.toRaw(e),closeToast:c,data:e.data,...e.expandCustomProps?e.contentProps:{contentProps:e.contentProps||{}}}):Gn(f)?f({toastProps:n.toRaw(e),closeToast:c,data:e.data}):e.dangerouslyHTMLString?n.h("div",{innerHTML:f}):f}return()=>n.createVNode("div",n.mergeProps({id:e.toastId,class:s.value,style:e.toastStyle||{},ref:t,"data-testid":`toast-item-${e.toastId}`,onClick:f=>{e.closeOnClick&&c(),e.onClick&&e.onClick(f)}},d.value),[n.createVNode("div",{role:e.role,"data-testid":"toast-body",class:`${Se.CSS_NAMESPACE}__toast-body ${e.bodyClassName||""}`},[r.value!=null&&n.createVNode("div",{"data-testid":`toast-icon-${e.type}`,class:[`${Se.CSS_NAMESPACE}__toast-icon`,e.isLoading?"":`${Se.CSS_NAMESPACE}--animate-icon ${Se.CSS_NAMESPACE}__zoom-enter`].join(" ")},[Ra(r.value)?n.h(n.toRaw(r.value),{theme:e.theme,type:e.type}):Gn(r.value)?r.value({theme:e.theme,type:e.type}):r.value]),n.createVNode("div",{"data-testid":"toast-content"},[u()])]),(e.closeButton===void 0||e.closeButton===!0)&&n.createVNode(w2,{theme:e.theme,closeToast:f=>{f.stopPropagation(),f.preventDefault(),c()}},null),Ra(e.closeButton)?n.h(n.toRaw(e.closeButton),{closeToast:c,type:e.type,theme:e.theme}):Gn(e.closeButton)?e.closeButton({closeToast:c,type:e.type,theme:e.theme}):null,n.createVNode(k2,{className:e.progressClassName,style:e.progressStyle,rtl:e.rtl,theme:e.theme,isIn:l.value,type:e.type,hide:e.hideProgressBar,isRunning:i.value,autoClose:e.autoClose,controlledProgress:a.value,progress:e.progress,closeToast:e.isLoading?void 0:c},null)])}}),ja="vue3-toastify:url-change";let Ua=0,Vo;function T2(){if(!(typeof window>"u")&&Fa.lastUrl!==window.location.href){Fa.lastUrl=window.location.href;const e=o=>typeof o.clearOnUrlChange=="boolean"?o.clearOnUrlChange:Dd().clearOnUrlChange!==!1,t=Object.values(Ye).reduce((o,a)=>(Array.isArray(a)&&o.push(...a),o),[]);for(const o of t)o.toastId&&e(o)&&dt.dismiss(o.toastId);pt.items=pt.items.filter(o=>!e(o.toastProps))}}function O2(){const{history:e}=window,t=e.pushState,o=e.replaceState;return e.pushState=function(...a){const r=t.apply(this,a);return window.dispatchEvent(new Event(ja)),r},e.replaceState=function(...a){const r=o.apply(this,a);return window.dispatchEvent(new Event(ja)),r},()=>{e.pushState=t,e.replaceState=o}}function z2(){if(typeof window>"u"||Vo)return;const e=O2(),t=()=>T2();window.addEventListener(ja,t),window.addEventListener("popstate",t),window.addEventListener("hashchange",t),Vo=()=>{e(),window.removeEventListener(ja,t),window.removeEventListener("popstate",t),window.removeEventListener("hashchange",t),Vo=void 0}}function F2(){Vo&&(Vo(),Fa.lastUrl="")}const I2=n.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:Md,setup(e){const t=n.computed(()=>e.containerId),o=n.computed(()=>Ye[t.value]||[]),a=n.computed(()=>o.value.filter(r=>r.position===e.position));return n.onMounted(()=>{typeof window<"u"&&(Ua+=1,z2())}),n.onUnmounted(()=>{typeof window<"u"&&Ua>0&&(Ua-=1,Ua===0&&F2())}),()=>n.createVNode(n.Fragment,null,[a.value.map(r=>{const{toastId:s=""}=r;return n.createVNode(v2,n.mergeProps({key:s},r),null)})])}});let Ds=!1;const Nd={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function Pd(){const e=[];return qn().forEach(t=>{const o=document.getElementById(t.containerId);o&&!o.classList.contains(Oa)&&e.push(t)}),e}function R2(e){const t=Pd().length,o=e??0;return o>0&&t+pt.items.length>=o}function L2(e){R2(e.limit)&&!e.updateId&&pt.items.push({toastId:e.toastId,containerId:e.containerId,toastContent:e.content,toastProps:e})}function sn(e,t,o={}){if(Ds)return;o=Ia(Dd(),{type:t},n.toRaw(o)),(!o.toastId||typeof o.toastId!="string"&&typeof o.toastId!="number")&&(o.toastId=Vd()),o={...o,...o.type==="loading"?Nd:{},content:e,containerId:o.containerId||String(o.position)};const a=Number(o==null?void 0:o.progress);return!isNaN(a)&&a<0&&(o.progress=0),a>1&&(o.progress=1),o.theme==="auto"&&(o.theme=y2()),L2(o),Fa.lastUrl=window.location.href,o.multiple?pt.items.length?o.updateId&&za(e,o):za(e,o):(Ds=!0,Te.clearAll(void 0,!1),setTimeout(()=>{za(e,o)},0),setTimeout(()=>{Ds=!1},390)),o.toastId}const Te=(e,t)=>sn(e,ot.DEFAULT,t);Te.info=(e,t)=>sn(e,ot.DEFAULT,{...t,type:ot.INFO}),Te.error=(e,t)=>sn(e,ot.DEFAULT,{...t,type:ot.ERROR}),Te.warning=(e,t)=>sn(e,ot.DEFAULT,{...t,type:ot.WARNING}),Te.warn=Te.warning,Te.success=(e,t)=>sn(e,ot.DEFAULT,{...t,type:ot.SUCCESS}),Te.loading=(e,t)=>sn(e,ot.DEFAULT,Ia(t,Nd)),Te.dark=(e,t)=>sn(e,ot.DEFAULT,Ia(t,{theme:Hn.DARK})),Te.remove=e=>{e?dt.dismiss(e):dt.clear()},Te.clearAll=(e,t)=>{n.nextTick(()=>{dt.clear(e,t)})},Te.isActive=e=>{let t=!1;return t=Pd().findIndex(o=>o.toastId===e)>-1,t},Te.update=(e,t={})=>{setTimeout(()=>{const o=m2(e);if(o){const a=n.toRaw(o),{content:r}=a,s={...a,...t,toastId:t.toastId||e,updateId:Vd()},i=s.render||r;delete s.render,sn(i,s.type,s)}},0)},Te.done=e=>{Te.update(e,{isLoading:!1,progress:1})},Te.promise=$2;function $2(e,{pending:t,error:o,success:a},r){var s,i,l;let c;const d={...r||{},autoClose:!1};t&&(c=Vs(t)?Te.loading(t,d):Te.loading(t.render,{...d,...t}));const u={autoClose:(s=r==null?void 0:r.autoClose)!=null?s:!0,closeOnClick:(i=r==null?void 0:r.closeOnClick)!=null?i:!0,closeButton:(l=r==null?void 0:r.autoClose)!=null?l:null,isLoading:void 0,draggable:null,delay:100},f=(m,p,g)=>{if(p==null){Te.remove(c);return}const y={type:m,...u,...r,data:g},x=Vs(p)?{render:p}:p;return c?Te.update(c,{...y,...x,isLoading:!1}):Te(x.render,{...y,...x,isLoading:!1}),g},h=Gn(e)?e():e;return h.then(m=>{f("success",a,m)}).catch(m=>{f("error",o,m)}),h}Te.POSITION=So,Te.THEME=Hn,Te.TYPE=ot,Te.TRANSITIONS=YB;const W2={install(e,t={}){p2.useHandler=t.useHandler||(()=>{}),j2(t)}};typeof window<"u"&&(window.Vue3Toastify=W2);function j2(e={}){const t=Ia(Cd,e);b2(t)}const U2={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:[]},H2={class:"dcode-card animate-slide-up"},q2={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"},G2={class:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4"},X2={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]"},Y2={class:"relative w-full sm:w-64"},K2={key:0,class:"relative"},J2={class:"flex flex-col h-full"},Q2={key:0,class:"flex-1 overflow-y-auto py-4"},Z2={class:"grid grid-cols-1 gap-4 px-1"},eE={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"},tE={class:"flex justify-end gap-2 w-full"},nE={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},oE={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},aE={class:"dcode-table w-full"},rE={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},sE=["onClick"],iE={key:0,class:"flex items-center justify-center w-full"},lE={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},cE={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},dE={key:0,class:"px-3 py-0.5"},uE={key:1},fE=["colspan"],hE={class:"flex flex-col items-center gap-2"},mE={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},pE={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},gE={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},bE={key:0,class:"flex items-center justify-center"},yE={key:0,class:"px-3 py-0.5 !text-center"},xE={key:0,class:"flex items-center justify-center gap-1.5"},kE={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},wE=["colspan"],CE={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"},_E={class:"flex items-center gap-4"},BE={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},EE={class:"text-neutral-900 dark:text-neutral-100 font-medium"},SE={class:"text-neutral-900 dark:text-neutral-100 font-medium"},AE={class:"text-neutral-900 dark:text-neutral-100 font-medium"},VE={class:"flex-shrink-0"},DE={class:"space-y-4"},ME={class:"text-gray-600 dark:text-gray-400"},NE={class:"grid grid-cols-1 gap-4 py-4 px-1"},PE={class:"flex items-end gap-2"},Do=n.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(e,{expose:t,emit:o}){var Hd,qd,Gd,Xd,Yd,Kd;const a=e,r=o,s=n.getCurrentInstance(),{apiUrl:i}=Je(),{locale:l}=Ht.useI18n();let c={query:{},params:{},path:""};try{const S=An.useRoute();S?c=S:(Gd=(qd=(Hd=s==null?void 0:s.appContext)==null?void 0:Hd.config)==null?void 0:qd.globalProperties)!=null&&Gd.$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=An.useRouter();S?d=S:(Kd=(Yd=(Xd=s==null?void 0:s.appContext)==null?void 0:Xd.config)==null?void 0:Yd.globalProperties)!=null&&Kd.$router&&(d=s.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const u=n.ref(""),f=n.ref(1),h=n.ref(a.perPage),m=n.ref({key:"",direction:"asc"}),p=n.ref([]),g=n.ref(!1),y=n.ref(0),x=n.ref({}),_=n.ref([]),C=n.ref(null),w=n.ref(!0),E=n.ref([]),B=n.ref([]),k=n.ref([]),b=n.ref(!1),A=n.ref(!1),D=n.ref({}),P=n.ref(null),V=n.ref(null),M=n.ref(null),z=n.ref([]),N=n.computed(()=>{if(U.value.length===0)return!1;const S=U.value.map(L=>{const J=G.value.find(W=>W.type==="CHECKBOX"),I=(J==null?void 0:J.keyCheckbox)||"id";return L[I]}).filter(L=>L!=null);return S.length===0?!1:S.every(L=>z.value.includes(L))}),v=n.computed(()=>{if(U.value.length===0)return!1;const S=G.value.find(W=>W.type==="CHECKBOX"),L=(S==null?void 0:S.keyCheckbox)||"id",J=U.value.map(W=>W[L]).filter(W=>W!=null),I=J.filter(W=>z.value.includes(W)).length;return I>0&&I<J.length}),T=S=>{const L=G.value.find(W=>W.type==="CHECKBOX"),J=(L==null?void 0:L.keyCheckbox)||"id",I=S[J];return I!==void 0&&z.value.includes(I)},R=S=>{const L=G.value.find(W=>W.type==="CHECKBOX"),J=(L==null?void 0:L.keyCheckbox)||"id",I=U.value.map(W=>W[J]).filter(W=>W!=null);if(S){const W=new Set([...z.value,...I]);z.value=Array.from(W)}else z.value=z.value.filter(W=>!I.includes(W))},H=(S,L)=>{const J=G.value.find(K=>K.type==="CHECKBOX"),I=(J==null?void 0:J.keyCheckbox)||"id",W=S[I];W!=null&&(L?z.value.includes(W)||z.value.push(W):z.value=z.value.filter(K=>K!==W))};n.watch(z,S=>{var J;r("update:selection",S);const L=N.value||S.length>1;(J=B.value)!=null&&J.length&&B.value.forEach(I=>{var W;(W=I.fieldActionGlobal)!=null&&W.length&&I.fieldActionGlobal.forEach(K=>{var Ee,je;const me=I.endpoint||((Ee=I.propsActionGlobal)==null?void 0:Ee.endpointPropAction)||I.propsActionGlobal,Ve=(je=me==null?void 0:me.keyParam)==null?void 0:je[0];(Ve&&K.model===Ve||!Ve&&/^(id|ids|idAuditTrail)/i.test(K.model))&&L&&K.model&&(D.value[K.model]=S)})})},{deep:!0});const O=S=>Array.from({length:S}).map((L,J)=>{const I={id:J+1,no:J+1};return G.value.forEach(W=>{W.key!=="no"&&W.key!=="action"&&W.type!=="ACTION"&&W.type!=="action"&&(W.type==="CHECKBOX"?I[W.keyCheckbox||"id"]=J+1:W.type==="BADGE"||W.type==="badge"||W.condition?I[W.key]=W.condition&&W.condition.length>0?W.condition[0].value:"Active":I[W.key]=`Data ${W.label} ${J+1}`)}),I}),$=S=>S&&typeof S=="string"&&S.trim()?S:void 0,Y=n.computed(()=>{var S,L,J,I;return $((L=(S=C.value)==null?void 0:S.endpoint)==null?void 0:L.apiModule)||$((I=(J=C.value)==null?void 0:J.endpointGlobal)==null?void 0:I.apiModule)||a.apiModule}),X=n.computed(()=>{var S,L,J,I;return $((L=(S=C.value)==null?void 0:S.endpoint)==null?void 0:L.apiAction)||$((I=(J=C.value)==null?void 0:J.endpointGlobal)==null?void 0:I.apiAction)||a.apiAction}),j=n.computed(()=>{var S,L,J,I;return $((L=(S=C.value)==null?void 0:S.endpoint)==null?void 0:L.apiMethod)||$((I=(J=C.value)==null?void 0:J.endpointGlobal)==null?void 0:I.apiMethod)||a.apiMethod||"POST"}),ee=n.computed(()=>{var S,L,J,I;return $((L=(S=C.value)==null?void 0:S.endpoint)==null?void 0:L.apiUrl)||$((I=(J=C.value)==null?void 0:J.endpointGlobal)==null?void 0:I.apiUrl)||a.apiUrl}),ne=n.computed(()=>a.permissionBase||""),fe=n.computed(()=>!k.value||k.value.length===0?[]:[...k.value].sort((S,L)=>(S.seq||0)-(L.seq||0))),ye=S=>{var K,me,Ve;const L=(S==null?void 0:S.column)||((K=S==null?void 0:S.props)==null?void 0:K.column)||((me=S==null?void 0:S.propsFieldGlobal)==null?void 0:me.column)||((Ve=S==null?void 0:S.propsFieldCustom)==null?void 0:Ve.column);if(!L)return"col-span-1";const J=L.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"}[J]||"col-span-1";return console.log(`[DEBUG] getColumnClass for ${S==null?void 0:S.model}: type=${L}, returned=${W}`),W},he=()=>{let S=null;if(a.tableConfig&&(S=a.tableConfig),S){C.value=S,S.headers&&(_.value=S.headers.map(I=>{var me,Ve,be,Ee,je,Re,Ie,vt,Sn,Qa;if(I.key==="action"||((me=I.custom)==null?void 0:me.type)==="ACTION"||((Ve=I.custom)==null?void 0:Ve.type)==="action"){const cn=((be=I.custom)==null?void 0:be.actionCustom)||((Ee=I.custom)==null?void 0:Ee.action);return cn&&(E.value=cn.map(Ut=>{const Xe=Ut.propsActionCustom||Ut.props||{},Za=Ut.propCustomMessage||{};return{permission:Ut.permission,label:l.value==="id"?Xe.labelID:Xe.labelEN,tooltip:l.value==="id"?Xe.tooltipID||Xe.labelID:Xe.tooltipEN||Xe.labelEN,icon:Xe.icon,variant:Xe.variant||"ghost",bgColor:Xe.bgColor,action:Xe.actionType||Xe.key,route:Xe.route,path:Xe.path,endpoint:Xe.endpointPropAction,requiredCondition:Ut.requiredCondition||!1,propCustomCondition:Ut.propCustomCondition||[],openDialog:Ut.openDialog||!1,fieldActionCustom:(Ut.fieldActionCustom||[]).map(er=>{const Ts=er.propsFieldCustom||er.propsFieldGlobal||er.props||{};return{...er,props:{...Ts,endpoint:Ts.endpointComponent||Ts.endpoint}}}),requireConfirm:Ut.requireConfirm||Xe.requireConfirm||!1,confirmTitle:l.value==="id"?Za.titleID||Xe.confirmTitleID||"Konfirmasi":Za.titleEN||Xe.confirmTitleEN||"Confirm",confirmMessage:l.value==="id"?Za.messageID||Xe.confirmMessageID||"Apakah Anda yakin?":Za.messageEN||Xe.confirmMessageEN||"Are you sure?"}})),null}let W;const K=((je=I.custom)==null?void 0:je.conditionBadge)||((Re=I.custom)==null?void 0:Re.condition);return(((Ie=I.custom)==null?void 0:Ie.type)==="BADGE"||((vt=I.custom)==null?void 0:vt.type)==="badge")&&K&&(W=K.map(cn=>({value:cn.value,label:l.value==="id"?cn.labelID:cn.labelEN,color:cn.color,variant:cn.variant}))),{key:I.key,label:l.value==="id"?I.labelID:I.labelEN,width:I.width,align:I.align,sortable:!0,type:(Sn=I.custom)==null?void 0:Sn.type,condition:W,keyCheckbox:(Qa=I.custom)==null?void 0:Qa.keyCheckbox}}).filter(I=>I!==null));const L=S.filters||S.filter;L&&Array.isArray(L)&&(k.value=L.map(I=>({...I,props:I.propsFilters||I.props||{}})),k.value.forEach(I=>{x.value[I.model]=""}));const J=S.actionGlobal||S.action;console.log("[DEBUG] loadConfig rawActions:",J),J&&Array.isArray(J)?(B.value=J.map(I=>{const W=I.propsActionGlobal||I.props||{};return{key:W.key,permission:I.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||I.endpoint,openDialog:I.openDialog||!1,fieldActionGlobal:(I.fieldActionGlobal||I.field||[]).map(K=>{const me=K.propsFieldGlobal||K.props||{};return{...K,props:{...me,endpoint:me.endpointComponent||me.endpoint}}})}}),console.log("[DEBUG] loadConfig headerActions set:",B.value)):console.log("[DEBUG] loadConfig no rawActions found"),S.pagination!==void 0&&(w.value=S.pagination)}};n.watch(()=>a.tableConfig,()=>{he()},{deep:!0,immediate:!0});const G=n.computed(()=>a.dynamicColumns||a.configKey||a.tableConfig?_.value:a.columns||[]),F=n.computed(()=>a.hasActions||E.value.length>0),q=n.computed(()=>Y.value||ee.value?g.value:a.loading),Q=n.computed(()=>!!Y.value||!!ee.value),ue=n.computed(()=>[]),_e=S=>{if(console.log("[DEBUG] hasAction called:",{actionCode:S,permissionChecker:!!a.permissionChecker,effectivePath:ne.value}),a.menuPermissions&&a.menuPermissions.length>0){const L=c.path,J=a.menuPermissions.find(I=>L.startsWith(I.path));if(J&&J.actions){const I=J.actions.find(W=>W.code===S.toUpperCase());return I?I.checked:!1}return!1}if(a.permissionChecker){const L=a.permissionChecker(ne.value,S);return console.log("[DEBUG] permissionChecker result:",L),L}return ue.value.some(L=>L.code===S)},Ce=(S,L)=>{if(!S.visibilityCondition)return!0;const{field:J,operator:I,value:W}=S.visibilityCondition,K=Ae(L,J);switch(I){case"equals":return K===W;case"notEquals":return K!==W;case"in":return Array.isArray(W)&&W.includes(K);case"notIn":return Array.isArray(W)&&!W.includes(K);case"greaterThan":return K>W;case"lessThan":return K<W;case"contains":return String(K).includes(String(W));default:return!0}},Oe=n.computed(()=>{if(console.log("[DEBUG] visibleHeaderActions:",{headerActions:B.value,ignorePermissions:a.ignorePermissions}),B.value.length===0)return B.value;const S=B.value.filter(L=>{if(a.ignorePermissions)return!0;if(!L.permission)return console.log("[DEBUG] Action no permission, showing:",L.label),!0;if(a.checkPermission){const I=a.checkPermission(L.permission);return console.log("[DEBUG] Parent checkPermission result:",I),I}if(a.permissions){const I=a.permissions.includes(L.permission);return console.log("[DEBUG] Parent permissions check result:",I),I}const J=_e(L.permission);return console.log("[DEBUG] Internal permission check:",{label:L.label,permission:L.permission,hasPerm:J}),J});return console.log("[DEBUG] Filtered header actions:",S.length),S}),Ke=n.computed(()=>E.value.length===0?E.value:E.value.filter(S=>a.ignorePermissions||!S.permission?!0:a.checkPermission?a.checkPermission(S.permission):a.permissions?a.permissions.includes(S.permission):_e(S.permission))),at=S=>Ke.value.filter(L=>Ce(L,S)),wt=(S,L)=>{var W,K;if(S.requiredCondition&&((W=S.propCustomCondition)==null?void 0:W.length)>0){const me=Ae(L,"status"),Ve=S.propCustomCondition.find(be=>be.value===me);if(Ve)return Ve.bgColor||S.bgColor||"primary"}if(!S.dynamicColor||!S.colorCondition)return S.bgColor||"primary";const J=Ae(L,S.colorCondition.field),I=(K=S.colorCondition.conditions)==null?void 0:K.find(me=>me.value===J);return(I==null?void 0:I.bgColor)||S.bgColor||"primary"},ln=S=>{const L=(S||"left").toLowerCase();return L==="center"?"justify-center":L==="right"?"justify-end":"justify-start"},Mo={ToggleLeft:te.ToggleLeft,SquarePen:te.SquarePen,Trash2:te.Trash2,Eye:te.Eye,CheckCircle:te.CheckCircle,Plus:te.Plus,Download:te.Download,RefreshCw:te.RefreshCw,Search:te.Search,SlidersHorizontal:te.SlidersHorizontal},No=S=>S?Ct[S]?Ct[S]:Mo[S]||null:null,U=n.computed(()=>a.dummyMode&&G.value.length>0&&p.value.length===0&&re.value.length===0?O(5):Q.value?p.value.map((S,L)=>({...S,no:(f.value-1)*h.value+L+1})):re.value),ae=n.computed(()=>Q.value?y.value:Z.value.length),pe=n.computed(()=>ae.value===0?0:(f.value-1)*h.value+1),ve=n.computed(()=>{const S=f.value*h.value;return S>ae.value?ae.value:S}),Ae=(S,L)=>{if(!(!S||!L))return L in S?S[L]:L.split(".").reduce((J,I)=>J&&J[I],S)},Z=n.computed(()=>{if(Q.value)return[];if(!u.value)return a.data;const S=u.value.toLowerCase();return a.data.filter(L=>G.value.some(J=>{const I=Ae(L,J.key);return I==null?!1:String(I).toLowerCase().includes(S)}))}),oe=n.computed(()=>Q.value?[]:m.value.key?[...Z.value].sort((L,J)=>{const I=Ae(L,m.value.key),W=Ae(J,m.value.key);if(I===W)return 0;let K=0;return typeof I=="number"&&typeof W=="number"?K=I-W:K=String(I).localeCompare(String(W)),m.value.direction==="asc"?K:-K}):Z.value),re=n.computed(()=>{if(Q.value)return[];const S=(f.value-1)*h.value,L=S+h.value;return oe.value.slice(S,L).map((J,I)=>({...J,no:S+I+1}))}),ge=n.computed(()=>Q.value?Object.values(x.value).some(S=>!!S):!!u.value),$e=[10,25,50,100],Pt=()=>{Q.value&&(x.value={...x.value,keyword:u.value},f.value=1,nt())};let qa;const zd=()=>{a.enableQuickSearch&&(clearTimeout(qa),qa=setTimeout(()=>{Pt()},500))};let Ga;const Fd=()=>{clearTimeout(Ga),Ga=setTimeout(()=>{Q.value&&nt()},1e3)};n.watch(u,()=>{a.enableQuickSearch&&Q.value&&zd()});const nt=async()=>{if(Q.value&&!(!Y.value&&!ee.value))try{g.value=!0;const S={page:f.value,perPage:h.value,...x.value,...a.apiParams};u.value&&(S.keyword=u.value),Object.keys(S).forEach(J=>{(S[J]===""||S[J]===null||S[J]===void 0)&&delete S[J]});let L;Y.value?L=await i(Y.value,X.value,S):ee.value&&(L=await i(ee.value,j.value,S)),Id(L)}catch(S){console.error("DataTable fetch error",S),g.value=!1}},Id=S=>{console.log("DataTable handleResponseData:",S),S&&(a.dynamicColumns&&S.columns&&Array.isArray(S.columns)&&(_.value=S.columns.map(L=>({key:L.key||L.field||L.name,label:L.label||L.header||L.name,width:L.width,align:L.align||"LEFT",sortable:L.sortable!==!1,type:L.type,condition:L.condition,format:L.format}))),S.data&&Array.isArray(S.data)?(p.value=S.data,S.totalData?y.value=S.totalData:S.maxPage?y.value=S.maxPage*h.value:y.value=S.data.length*(S.maxPage||1)):Array.isArray(S)?(p.value=S,y.value=S.length):S.users?(p.value=S.users,y.value=S.users.length):S.items&&Array.isArray(S.items)?(p.value=S.items,y.value=S.total||S.totalItems||S.items.length):S.list&&Array.isArray(S.list)?(p.value=S.list,y.value=S.total||S.list.length):S.rows&&Array.isArray(S.rows)?(p.value=S.rows,y.value=S.count||S.total||S.rows.length):S.result&&Array.isArray(S.result)?(p.value=S.result,y.value=S.total||S.count||S.result.length):(console.warn("DataTable: Unknown response format",S),p.value=[],y.value=0)),g.value=!1};n.onUnmounted(()=>{clearTimeout(qa),clearTimeout(Ga)});const Xa=()=>{Object.keys(x.value).forEach(S=>{x.value[S]=""}),u.value="",f.value=1,nt()},Rd=()=>{f.value=1,nt()},Ya=(S,L)=>{const J=Ae(S,L.key);let I={variant:"secondary",class:"",label:J};if(L.condition){const W=L.condition.find(K=>{const me=(Ve,be)=>typeof Ve=="string"&&typeof be=="string"?Ve.toLowerCase().trim()===be.toLowerCase().trim():Ve==be;return typeof J=="object"&&J!==null?me(K.value,J.code)||me(K.value,J.id):me(K.value,J)});if(W){if(W.variant&&(I.variant=W.variant),I.label=W.label||(typeof J=="object"?J.name||J.code:J),W.color){const K=W.color.toLowerCase(),me=I.variant==="outline",Ve={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"},be={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"},Ee={danger:"destructive",secondary:"secondary",primary:"default"};me?be[K]&&(I.class=be[K]):Ee[K]?I.variant=Ee[K]:Ve[K]&&(I.class=Ve[K])}}else I.label=typeof J=="object"?(J==null?void 0:J.name)||(J==null?void 0:J.code)||"-":J}else I.label=typeof J=="object"?(J==null?void 0:J.name)||(J==null?void 0:J.code)||"-":J;return I},Ld=S=>{m.value.key===S?m.value.direction=m.value.direction==="asc"?"desc":"asc":(m.value.key=S,m.value.direction="asc"),r("update:sort",m.value)},vs=S=>{S!==f.value&&(f.value=S,Q.value&&nt(),r("update:page",S))},$d=S=>{h.value=S,f.value=1,Q.value&&nt()},Wd=S=>{const L=Math.random()*15+75;if(S.width){const J=parseInt(String(S.width));return J<100?`${Math.floor(J*(Math.random()*.2+.7))}px`:`${L}%`}return`${L}%`},Ka=()=>{u.value="",x.value={},f.value=1,nt()},CS=S=>{var L;if(console.log("[DEBUG] handleHeaderAction called:",S),S.route){if(S.path){const J=S.route.startsWith("/")?S.route:"/"+S.route;sessionStorage.setItem(`layout_${J}`,S.path)}d==null||d.push(S.route)}else if(S.openDialog){V.value=S,M.value=null,D.value={};const J=S.fieldActionGlobal||S.field||[];J.length&&J.forEach(I=>{var me;const W=S.endpoint||((me=S.propsActionGlobal)==null?void 0:me.endpointPropAction)||S.propsActionGlobal,K=W!=null&&W.keyParam&&W.keyParam.length>0?W.keyParam[0]:null;K&&I.model===K||!K&&/^(id|ids|idAuditTrail)/i.test(I.model)?D.value[I.model]=z.value:D.value[I.model]||(D.value[I.model]="")}),A.value=!0}else r("action",{action:((L=S.propsActionCustom)==null?void 0:L.key)||S.key||"create",row:null,selection:z.value})},_S=async(S,L)=>{var J,I,W,K;if(S.requireConfirm){P.value={button:S,row:L},b.value=!0;return}if(S.openDialog){V.value=S,M.value=L,D.value={};const me=G.value.find(Ee=>Ee.type==="CHECKBOX"),Ve=(me==null?void 0:me.keyCheckbox)||"id";S.fieldActionCustom&&S.fieldActionCustom.forEach(Ee=>{/^(id|ids|idAuditTrail)/i.test(Ee.model)?D.value[Ee.model]=[L[Ve]]:S.action==="showToken"&&Ee.model==="token"?D.value[Ee.model]=L.token!==void 0?L.token:"":L[Ee.model]!==void 0?D.value[Ee.model]=L[Ee.model]:D.value[Ee.model]=""});const be=S.endpoint||((J=S.propsActionGlobal)==null?void 0:J.endpointPropAction)||((I=S.propsActionCustom)==null?void 0:I.endpointPropAction)||((W=S.props)==null?void 0:W.endpointPropAction);if(((K=be==null?void 0:be.apiMethod)==null?void 0:K.toUpperCase())==="GET"&&be.apiUrl){g.value=!0;const{apiUrl:Ee}=Je(),je={};be.keyParam&&Array.isArray(be.keyParam)&&be.keyParam.forEach((Re,Ie)=>{const vt=be.model&&Ie===0?be.model:Re;L[Re]!==void 0&&(je[vt]=L[Re])}),Object.keys(je).length===0&&L.id&&(je.id=L.id),Ee(be.apiUrl,"GET",je).then(Re=>{let Ie=Re;if(Re&&Re.data!==void 0?Ie=Re.data:Re&&Re.result!==void 0&&(Ie=Re.result),Ie!=null){if(typeof Ie=="string")D.value.hasOwnProperty("token")&&(D.value.token=Ie);else if(typeof Ie=="object"&&(Ie.item&&(Ie=Ie.item),Array.isArray(Ie)&&(Ie=Ie[0]||{}),Object.keys(Ie).forEach(vt=>{D.value[vt]=Ie[vt]}),!D.value.token)){const vt=Object.keys(Ie).find(Sn=>Sn.toLowerCase().includes("token"));if(vt)D.value.token=Ie[vt];else{const Sn=Object.values(Ie).filter(Qa=>typeof Qa=="string");Sn.length===1&&(D.value.token=Sn[0])}}}A.value=!0}).catch(Re=>{console.error("Fetch Data Failed",Re)}).finally(()=>{g.value=!1});return}A.value=!0;return}jd(S,L)},jd=(S,L)=>{if(S.route){if(S.path){const W=S.route.startsWith("/")?S.route:"/"+S.route;sessionStorage.setItem(`layout_${W}`,S.path)}let J=S.route;J.includes(":")?J=J.replaceAll(/:([a-zA-Z0-9_]+)/g,(W,K)=>L[K]||L.id||K):L.id&&(J=`${J.replace(/\/$/,"")}/${L.id}`);const I={};S.path&&(I.code=S.path),d==null||d.push({path:J,query:I})}else if(S.endpoint&&S.endpoint.apiUrl){g.value=!0;const{apiUrl:J}=Je(),I=S.endpoint.apiUrl,W=S.endpoint.apiMethod||"POST",K={};S.endpoint.keyParam&&Array.isArray(S.endpoint.keyParam)&&S.endpoint.keyParam.forEach((me,Ve)=>{const be=S.endpoint.model&&Ve===0?S.endpoint.model:me;L[me]!==void 0&&(K[be]=L[me])}),Object.keys(K).length===0&&L.id&&(K.id=L.id),J(I,W,K).then(()=>{nt(),r("action",{action:S.action||"success",row:L})}).catch(me=>{console.error("Action Failed",me)}).finally(()=>{g.value=!1})}else r("action",{action:S.action,row:L})},BS=()=>{P.value&&(jd(P.value.button,P.value.row),Ud())},ES=()=>{var S,L,J;if(V.value){const I=V.value,W=I.endpoint||((S=I.propsActionGlobal)==null?void 0:S.endpointPropAction)||I.propsActionGlobal;let K=(W==null?void 0:W.model)||(W!=null&&W.keyParam&&W.keyParam.length>0?W.keyParam[0]:null);if(!K){const Ee=(I.fieldActionGlobal||I.fieldActionCustom||I.field||[]).find(je=>/^(id|ids|idAuditTrail)/i.test(je.model));K=Ee?Ee.model:"ids"}let me=null,Ve=!1;if(M.value){const be=G.value.find(Re=>Re.type==="CHECKBOX"),Ee=(be==null?void 0:be.keyCheckbox)||"id",je=M.value[Ee];W!=null&&W.apiUrl&&(me={...D.value},me[K]||(me[K]=[je]),Ve=!0)}else W!=null&&W.apiUrl&&(me={...D.value},me[K]||(me[K]=z.value||[]),Ve=!0);if(Ve&&me&&(W!=null&&W.apiUrl)){if(((L=W==null?void 0:W.apiMethod)==null?void 0:L.toUpperCase())==="GET"){A.value=!1,M.value||(z.value=[]);return}const{apiUrl:be}=Je(),Ee=W.apiUrl,je=W.apiMethod||"POST";be(Ee,je,me).then(()=>{A.value=!1,M.value||(z.value=[]),nt(),r("action",{action:"success",row:null})}).catch(Re=>{console.error("Action Failed",Re)})}else if(M.value){const be=G.value.find(Ie=>Ie.type==="CHECKBOX"),Ee=(be==null?void 0:be.keyCheckbox)||"id",je=M.value[Ee],Re={...D.value};Re[K]||(Re[K]=[je]),r("action",{action:V.value.action,row:Re}),A.value=!1}else{const be={...D.value};be[K]||(be[K]=z.value);const Ee={action:((J=V.value.propsActionGlobal)==null?void 0:J.key)||V.value.key,row:be,selection:z.value};r("action",Ee),A.value=!1}}},SS=S=>{const L=D.value[S];L&&xB(String(L)).then(()=>{Te.success("Berhasil disalin!",{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(J=>{console.error("Failed to copy",J)})},Ud=()=>{b.value=!1,P.value=null},AS=n.computed(()=>P.value?P.value.button.confirmTitle||"Confirm":""),VS=n.computed(()=>P.value?P.value.button.confirmMessage||"Confirm":"");t({fetchData:nt,filters:x,resetFilters:Xa,handleRefresh:Ka});const Ja=n.ref(""),DS=S=>{if(!S)return"";const L=S.endpoint||S.endpointGlobal||{};return JSON.stringify({url:L.apiUrl||S.apiUrl,module:L.apiModule||S.apiModule,action:L.apiAction||S.apiAction,method:L.apiMethod||S.apiMethod,params:S.apiParams,socket:L.socket||S.socketEndpoint,socketParams:S.socketParams})};return n.watch(()=>a.tableConfig,()=>{if(a.tableConfig){he();const S=DS(a.tableConfig);S!==Ja.value&&(!Ja.value&&Q.value?(Ja.value=S,nt()):(Ja.value=S,Q.value&&Fd()))}},{deep:!0,immediate:!0}),n.watch(()=>a.apiModule,()=>{Q.value&&nt()}),n.watch(()=>a.apiParams,()=>{Q.value&&nt()},{deep:!0}),n.watch(()=>B.value,S=>{console.log("[DEBUG] headerActions changed:",S.length,"items");const L=Oe.value;console.log("[DEBUG] visibleHeaderActions evaluated:",L.length,"items")},{deep:!0}),n.onMounted(()=>{he(),Q.value&&(a.tableConfig||(g.value=!0,nt()))}),(S,L)=>{var J;return n.openBlock(),n.createElementBlock("div",H2,[n.createElementVNode("div",q2,[n.createElementVNode("div",G2,[e.nested?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",X2,[n.createElementVNode("div",Y2,[n.createVNode(n.unref(te.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),n.createVNode(n.unref(PB),{modelValue:u.value,"onUpdate:modelValue":L[0]||(L[0]=I=>u.value=I),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:n.withKeys(Pt,["enter"])},null,8,["modelValue"])]),k.value.length>0?(n.openBlock(),n.createElementBlock("div",K2,[n.createVNode(DB,null,{trigger:n.withCtx(()=>[n.createVNode(qe,{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:n.withCtx(()=>[n.createElementVNode("div",tE,[n.renderSlot(S.$slots,"filter-footer",{fetch:nt,reset:Xa})])]),default:n.withCtx(()=>[L[8]||(L[8]=n.createElementVNode("hr",{class:"border-neutral-200 dark:border-neutral-700"},null,-1)),n.createElementVNode("div",J2,[n.renderSlot(S.$slots,"filter-form",{filters:x.value},()=>[k.value.length>0?(n.openBlock(),n.createElementBlock("div",Q2,[n.createElementVNode("div",Z2,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(fe.value,(I,W)=>(n.openBlock(),n.createElementBlock("div",{key:W,class:n.normalizeClass(ye(I))},[n.createVNode(wd,{field:I,modelValue:x.value[I.model],"onUpdate:modelValue":K=>x.value[I.model]=K},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):n.createCommentVNode("",!0)]),k.value.length>0?(n.openBlock(),n.createElementBlock("div",eE,[n.createVNode(qe,{variant:"outline",text:"Reset",tooltip:"Reset",rounded:"md",icon:"RefreshCw",onClick:Xa,disabled:q.value},null,8,["disabled"]),n.createVNode(qe,{onClick:Rd,disabled:q.value,rounded:"md",text:"Search",tooltip:"Search",icon:"Search"},null,8,["disabled"])])):n.createCommentVNode("",!0)])]),_:3})])):n.createCommentVNode("",!0)])),n.createElementVNode("div",{class:n.normalizeClass(["flex items-center gap-2 flex-wrap",{"w-full justify-between":e.nested}])},[e.nested?(n.openBlock(),n.createElementBlock("span",nE)):n.createCommentVNode("",!0),e.nested?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(qe,{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:Ka,disabled:q.value},{icon:n.withCtx(()=>[n.createVNode(n.unref(te.RefreshCw),{class:n.normalizeClass(["w-3.5 h-3.5",{"animate-spin":q.value}])},null,8,["class"])]),_:1},8,["disabled"])),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Oe.value,(I,W)=>(n.openBlock(),n.createBlock(qe,{key:W,icon:I.icon,text:I.label,tooltip:I.tooltip,variant:I.variant,"bg-color":I.bgColor,"text-color":I.textColor,class:"gap-2 h-9 shadow-lg shadow-primary-500/20 border-none text-xs font-medium",onClick:K=>CS(I)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),n.renderSlot(S.$slots,"header-actions")],2)])]),n.createElementVNode("div",oE,[n.createElementVNode("table",aE,[n.createElementVNode("thead",rE,[n.createElementVNode("tr",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(G.value,I=>(n.openBlock(),n.createElementBlock("th",{key:I.key,class:n.normalizeClass([I.align?`text-${I.align.toLowerCase()}`:"",I.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:n.normalizeStyle(I.width?{width:I.width}:{}),onClick:W=>I.sortable&&Ld(I.key)},[I.type==="CHECKBOX"?(n.openBlock(),n.createElementBlock("div",iE,[n.createVNode(on,{"model-value":N.value,indeterminate:v.value,"onUpdate:modelValue":L[1]||(L[1]=W=>R(!!W)),onClick:L[2]||(L[2]=n.withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate"])])):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["flex items-center gap-2 w-full",ln(I.align)])},[n.createElementVNode("span",null,n.toDisplayString(I.label),1)],2))],14,sE))),128)),F.value?(n.openBlock(),n.createElementBlock("th",lE,[...L[9]||(L[9]=[n.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):n.createCommentVNode("",!0)])]),n.createElementVNode("tbody",cE,[q.value?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(h.value,I=>(n.openBlock(),n.createElementBlock("tr",{key:`skeleton-${I}`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(G.value,W=>{var K,me;return n.openBlock(),n.createElementBlock("td",{key:W.key,class:n.normalizeClass([W.align?`text-${W.align.toLowerCase()}`:"text-left","px-3 py-0.5"])},[n.createElementVNode("div",{class:n.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",((K=W.align)==null?void 0:K.toLowerCase())==="center"?"mx-auto":"",((me=W.align)==null?void 0:me.toLowerCase())==="right"?"ml-auto":""]]),style:n.normalizeStyle({width:["badge","BADGE"].includes(W.type??"")||W.condition?void 0:Wd(W),backgroundSize:"200% 100%"})},null,6)],2)}),128)),e.hasActions?(n.openBlock(),n.createElementBlock("td",dE,[...L[10]||(L[10]=[n.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[n.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse"}),n.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-75"}),n.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-150"})],-1)])])):n.createCommentVNode("",!0)]))),128)):U.value.length===0?(n.openBlock(),n.createElementBlock("tr",uE,[n.createElementVNode("td",{colspan:G.value.length+(F.value?1:0),class:"text-center py-16"},[n.createElementVNode("div",hE,[n.createVNode(n.unref(eu.Vue3Lottie),{animationData:n.unref(U2),height:200,width:200},null,8,["animationData"]),n.createElementVNode("div",null,[n.createElementVNode("p",mE,n.toDisplayString(ge.value?"No search results":"No data"),1),n.createElementVNode("p",pE,n.toDisplayString(ge.value?"Try changing keywords":"No data added"),1)])])],8,fE)])):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:2},n.renderList(U.value,(I,W)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:W},[n.createElementVNode("tr",gE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(G.value,K=>(n.openBlock(),n.createElementBlock("td",{key:K.key,class:n.normalizeClass([K.align?`text-${K.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[n.renderSlot(S.$slots,`cell-${K.key}`,{row:I,value:Ae(I,K.key)},()=>[K.type==="CHECKBOX"?(n.openBlock(),n.createElementBlock("div",bE,[n.createVNode(on,{"model-value":T(I),"onUpdate:modelValue":me=>H(I,!!me),onClick:L[3]||(L[3]=n.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):K.type==="badge"||K.type==="BADGE"||K.condition?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[K.align?`justify-${K.align.toLowerCase()}`:"justify-start"]])},[n.createVNode(n.unref(Wn),{variant:Ya(I,K).variant,class:n.normalizeClass([Ya(I,K).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(Ya(I,K).label),1)]),_:2},1032,["variant","class"])],2)):K.key==="no"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createTextVNode(n.toDisplayString((f.value-1)*h.value+W+1),1)],64)):K.type==="date"||K.type==="DATE"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createTextVNode(n.toDisplayString(Ae(I,K.key)?n.unref(bB)(Ae(I,K.key),"long"):"-"),1)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:4},[n.createTextVNode(n.toDisplayString(K.format?K.format(Ae(I,K.key)):Ae(I,K.key)),1)],64))])],2))),128)),F.value?(n.openBlock(),n.createElementBlock("td",yE,[n.renderSlot(S.$slots,"actions",{row:I,buttons:at(I),getButtonColor:wt,getIconComponent:No},()=>[at(I).length>0?(n.openBlock(),n.createElementBlock("div",xE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(at(I),(K,me)=>(n.openBlock(),n.createElementBlock("div",{key:me,class:"group relative"},[n.createVNode(qe,{tooltip:K.tooltip||K.label,icon:K.icon,size:"icon",rounded:K.rounded||"sm",borderStyle:K.borderStyle||"none",variant:K.variant||"ghost","bg-color":wt(K,I),onClick:Ve=>_S(K,I)},null,8,["tooltip","icon","rounded","borderStyle","variant","bg-color","onClick"])]))),128))])):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0)]),S.$slots["expanded-row"]?(n.openBlock(),n.createElementBlock("tr",kE,[n.createElementVNode("td",{colspan:G.value.length+(F.value?1:0),class:"px-0 py-0"},[n.renderSlot(S.$slots,"expanded-row",{row:I,index:W})],8,wE)])):n.createCommentVNode("",!0)],64))),128))])])]),!q.value&&U.value.length>0&&e.showPagination&&w.value?(n.openBlock(),n.createElementBlock("div",CE,[n.createElementVNode("div",_E,[n.createVNode(n.unref($B),{"model-value":String(h.value),"onUpdate:modelValue":L[4]||(L[4]=I=>$d(Number(I)))},{default:n.withCtx(()=>[n.createVNode(n.unref(GB),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:n.withCtx(()=>[n.createVNode(n.unref(XB),{placeholder:String(h.value)},null,8,["placeholder"])]),_:1}),n.createVNode(n.unref(WB),null,{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList($e,I=>n.createVNode(n.unref(UB),{key:I,value:String(I)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(I),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),L[15]||(L[15]=n.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),n.createElementVNode("span",BE,[L[11]||(L[11]=n.createTextVNode(" Showing ",-1)),n.createElementVNode("span",EE,n.toDisplayString(pe.value),1),L[12]||(L[12]=n.createTextVNode(" to ",-1)),n.createElementVNode("span",SE,n.toDisplayString(ve.value),1),L[13]||(L[13]=n.createTextVNode(" of ",-1)),n.createElementVNode("span",AE,n.toDisplayString(ae.value),1),L[14]||(L[14]=n.createTextVNode(" items ",-1))])]),n.createElementVNode("div",VE,[n.createVNode(n.unref(vB),{total:ae.value,"items-per-page":h.value,"sibling-count":1,"show-edges":"",page:f.value,"onUpdate:page":vs,class:"scale-90 origin-right"},{default:n.withCtx(()=>[n.createVNode(n.unref(TB),{class:"flex items-center gap-1"},{default:n.withCtx(({items:I})=>[n.createVNode(n.unref(zB),{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:n.withCtx(()=>[n.createVNode(n.unref(te.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(LB),{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:n.withCtx(()=>[n.createVNode(n.unref(te.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(I,(W,K)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[W.type==="page"?(n.openBlock(),n.createBlock(n.unref(FB),{key:K,value:W.value,"as-child":""},{default:n.withCtx(()=>[n.createVNode(n.unref(ut),{class:"w-8 h-8 p-0 text-sm",variant:W.value===f.value?"default":"outline",disabled:W.value===f.value,onClick:me=>vs(W.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(W.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(n.openBlock(),n.createBlock(n.unref(OB),{key:W.type,index:K},null,8,["index"]))],64))),256)),n.createVNode(n.unref(RB),{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:n.withCtx(()=>[n.createVNode(n.unref(te.ChevronRight),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(IB),{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:n.withCtx(()=>[n.createVNode(n.unref(te.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):n.createCommentVNode("",!0),n.createVNode(Eo,{modelValue:b.value,"onUpdate:modelValue":L[5]||(L[5]=I=>b.value=I),title:AS.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:n.withCtx(()=>[n.createVNode(qe,{variant:"outline",onClick:Ud,text:"Cancel"}),n.createVNode(qe,{variant:"default",onClick:BS,text:"Yes"})]),default:n.withCtx(()=>[n.createElementVNode("div",DE,[n.createElementVNode("p",ME,n.toDisplayString(VS.value),1)])]),_:1},8,["modelValue","title"]),n.createVNode(Eo,{modelValue:A.value,"onUpdate:modelValue":L[7]||(L[7]=I=>A.value=I),title:((J=V.value)==null?void 0:J.label)||"Action",icon:"AlertCircle","max-width":450},{actions:n.withCtx(()=>[n.createVNode(qe,{variant:"outline",onClick:L[6]||(L[6]=I=>A.value=!1),text:"Cancel"}),n.createVNode(qe,{variant:"default",onClick:ES,text:"Save"})]),default:n.withCtx(()=>{var I,W;return[n.createElementVNode("div",NE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(((I=V.value)==null?void 0:I.fieldActionCustom)||((W=V.value)==null?void 0:W.fieldActionGlobal)||[],(K,me)=>{var Ve,be,Ee;return n.openBlock(),n.createElementBlock(n.Fragment,{key:me},[K.isHidden?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(ye(K))},[n.createElementVNode("div",PE,[n.createVNode(wd,{class:"flex-1 w-full",field:K,modelValue:D.value[K.model],"onUpdate:modelValue":je=>D.value[K.model]=je},null,8,["field","modelValue","onUpdate:modelValue"]),K.isCopyable||(Ve=K.props)!=null&&Ve.isCopyable||((be=V.value)==null?void 0:be.action)==="showToken"||((Ee=V.value)==null?void 0:Ee.action)==="copyToken"?(n.openBlock(),n.createBlock(qe,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:"Salin",onClick:je=>SS(K.model)},null,8,["onClick"])):n.createCommentVNode("",!0)])],2))],64)}),128))])]}),_:1},8,["modelValue","title"])])}}});function vE(){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 TE={class:"flex flex-col gap-3 w-full"},OE={key:0,class:"col-span-full flex flex-col gap-2 p-3 bg-white dark:bg-slate-900 border border-dashed border-slate-200 dark:border-slate-800 rounded-lg opacity-70 pointer-events-none animate-pulse"},zE={class:"flex flex-col items-center justify-center gap-2 py-6 rounded-lg border border-dashed border-slate-300 dark:border-slate-700 bg-slate-50 dark:bg-slate-800 text-slate-400"},FE={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-slate-800/50 border border-slate-200 dark:border-slate-800 rounded-lg opacity-70"},IE={class:"text-sm font-medium text-slate-500"},RE={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"},LE={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},$E=["onClick"],WE=["for","onDrop"],jE={class:"text-xs text-slate-500 dark:text-slate-400"},UE={key:2,class:"text-xs text-slate-400"},HE=["id","disabled","accept","onChange"],qE=n.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"],setup(e,{emit:t}){const o=e,a=t,{t:r,locale:s}=Ht.useI18n(),i=n.computed(()=>{const x=o.endpoint;if(!(x!=null&&x.apiUrl))return null;let _=x.apiUrl;if(!_.startsWith("http")&&o.baseUrl){const C=o.baseUrl.replace(/\/$/,""),w=_.startsWith("/")?_:`/${_}`;_=`${C}${w}`}return _}),l=n.computed(()=>{const x=c.value.length;return x<=1?"grid-cols-1":x===2?"grid-cols-1 md:grid-cols-2":x===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":x===4?"grid-cols-1 md:grid-cols-2 lg:grid-cols-3":"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}),c=n.ref([]),d=n.ref([]),u=n.ref(new Set),f=n.ref(!0),h=async()=>{var x;if(f.value=!0,o.items!==void 0){c.value=o.items,f.value=!1;return}if(!((x=o.endpointReference)!=null&&x.apiUrl)){f.value=!1;return}try{const{apiUrl:_}=Je(),C=(o.endpointReference.apiMethod||"GET").toUpperCase()==="GET",w=await _(o.endpointReference.apiUrl,o.endpointReference.apiMethod||"GET",C?{page:1,perPage:100}:void 0);if(o.items!==void 0){f.value=!1;return}let E=(w==null?void 0:w.data)||w;Array.isArray(E)||(E=[E]),c.value=E}catch(_){console.error("Failed to fetch dynamic document list",_)}finally{f.value=!1}};n.onMounted(()=>{Array.isArray(o.modelValue)&&o.modelValue.length>0&&(d.value=structuredClone(n.toRaw(o.modelValue))),h()}),n.watch(()=>o.modelValue,x=>{Array.isArray(x)&&JSON.stringify(x)!==JSON.stringify(d.value)&&(d.value=structuredClone(n.toRaw(x)))},{deep:!0}),n.watch(()=>{var x;return(x=o.endpointReference)==null?void 0:x.apiUrl},(x,_)=>{x!==_&&h()}),n.watch(()=>{var x;return(x=o.endpointReference)==null?void 0:x.apiMethod},(x,_)=>{x!==_&&h()}),n.watch(()=>o.items,x=>{c.value=x??[],f.value=!1},{deep:!0,immediate:!0});const m=x=>{const _=x[o.itemValue]||x.id||x.typeDocument;return d.value.find(C=>C.typeDocument===_||C.idDocumentType===_||C[o.itemValue]===_)||null},p=async(x,_,C)=>{var k,b,A,D,P,V;const w=C.target,E=(k=w.files)==null?void 0:k[0];if(!E)return;const B=x[o.itemValue]||x.id||x.typeDocument;if(x[o.itemTitle]||x.name||x.filename,!i.value){const M=[...d.value],z=M.findIndex(v=>v.typeDocument===B||v.idDocumentType===B),N={id:null,filename:E.name,document:E.name,typeDocument:B};z>-1?M[z]={...M[z],...N}:M.push(N),d.value=M,a("update:modelValue",M);return}u.value.add(_);try{const{apiUrl:M}=Je(),z=new FormData;z.append("file",E),z.append("typeDocument",String(B));const N=await M(i.value,((b=o.endpoint)==null?void 0:b.apiMethod)||"POST",z),v=((A=N==null?void 0:N.data)==null?void 0:A.url)||((D=N==null?void 0:N.data)==null?void 0:D.document)||(N==null?void 0:N.url)||E.name,T=((P=N==null?void 0:N.data)==null?void 0:P.id)||(N==null?void 0:N.id)||null,R=((V=N==null?void 0:N.data)==null?void 0:V.filename)||(N==null?void 0:N.filename)||E.name,H=[...d.value],O=H.findIndex(Y=>Y.typeDocument===B||Y.idDocumentType===B),$={id:T,filename:R,document:v,typeDocument:B};O>-1?H[O]={...H[O],...$}:H.push($),d.value=H,a("update:modelValue",H)}catch(M){console.error("Upload failed",M)}finally{u.value.delete(_),w.value=""}},g=x=>{const _=x[o.itemValue]||x.id||x.typeDocument,C=d.value.filter(w=>w.typeDocument!==_&&w.idDocumentType!==_);d.value=C,a("update:modelValue",C)},y=(x,_,C)=>{var B,k;C.preventDefault();const w=(k=(B=C.dataTransfer)==null?void 0:B.files)==null?void 0:k[0];if(!w)return;p(x,_,{target:{files:[w],value:""}})};return(x,_)=>(n.openBlock(),n.createElementBlock("div",TE,[e.label||e.labelID||e.labelEN?(n.openBlock(),n.createBlock(jn,{key:0,text:e.label||(n.unref(s).toLowerCase().startsWith("en")?e.labelEN:e.labelID),class:"font-semibold text-sm text-slate-700 dark:text-slate-300",required:e.required},null,8,["text","required"])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["w-full grid gap-4",l.value])},[c.value.length===0&&f.value?(n.openBlock(),n.createElementBlock("div",OE,[n.createVNode(jn,{text:n.unref(r)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-slate-300"},null,8,["text"]),n.createElementVNode("div",zE,[n.createVNode(n.unref(te.Loader2),{class:"w-6 h-6 animate-spin"})])])):c.value.length===0&&!f.value?(n.openBlock(),n.createElementBlock("div",FE,[n.createVNode(n.unref(te.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),n.createElementVNode("span",IE,n.toDisplayString(n.unref(r)("dynamicUploadList.noDocsRequired")),1)])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,(C,w)=>{var E;return n.openBlock(),n.createElementBlock("div",{key:w,class:"flex flex-col gap-2 p-3 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg shadow-sm"},[n.createVNode(jn,{text:C[e.itemTitle]||C.name||C.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-slate-300"},null,8,["text"]),m(C)?(n.openBlock(),n.createElementBlock("div",RE,[n.createVNode(n.unref(te.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),n.createElementVNode("span",LE,n.toDisplayString(((E=m(C))==null?void 0:E.filename)||n.unref(r)("dynamicUploadList.fileUploaded")),1),e.disabled?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"text-red-400 hover:text-red-600 transition-colors",onClick:B=>g(C)},[n.createVNode(n.unref(te.X),{class:"w-4 h-4"})],8,$E))])):(n.openBlock(),n.createElementBlock("label",{key:1,for:`dyn-upload-input-${w}`,class:n.normalizeClass(["flex flex-col items-center justify-center gap-2 py-8 rounded-lg border-2 border-dashed transition-colors cursor-pointer",[e.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(w)?"pointer-events-none opacity-70":""]]),onDragover:_[0]||(_[0]=n.withModifiers(()=>{},["prevent"])),onDrop:B=>!e.disabled&&!u.value.has(w)&&y(C,w,B)},[u.value.has(w)?(n.openBlock(),n.createBlock(n.unref(te.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(n.openBlock(),n.createBlock(n.unref(te.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),n.createElementVNode("span",jE,n.toDisplayString(u.value.has(w)?n.unref(r)("dynamicUploadList.uploading"):n.unref(r)("dynamicUploadList.clickOrDrag")),1),e.typeFile?(n.openBlock(),n.createElementBlock("span",UE,n.toDisplayString(e.typeFile),1)):n.createCommentVNode("",!0),n.createElementVNode("input",{id:`dyn-upload-input-${w}`,type:"file",class:"sr-only",disabled:e.disabled||u.value.has(w),accept:e.typeFile,onChange:B=>p(C,w,B)},null,40,HE)],42,WE))])}),128))],2)]))}}),GE={key:0},XE=["value","name"],YE={key:2,class:"text-xs text-neutral-400 italic"},Ms=n.defineComponent({__name:"DynamicFormField",props:{field:{},modelValue:{default:null},formData:{default:()=>({})},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){let o=n.ref("en");try{o=Ht.useI18n().locale}catch{}const a=e,r=t,s=n.ref(a.modelValue);n.watch(()=>a.modelValue,u=>{s.value=u});const i={DCodeTextField:va,DCodeAutoComplete:Lo,DCodeDatePicker:Sa,DCodeTextarea:Un,DCodeTextArea:Un,DCodeCheckbox:on,DCodeSwitch:Pa,DCodeOtpInput:Da,DCodeImageField:Va,DCodeSlider:Na,DCodeRadio:ys,DCodeRadioCustom:xs,DCodeDynamicUploadList:qE,DCodeMultiSelect:bs,DCodeCurrencyField:ls,DCodePermissionMenu:ws,DCodeTreePermissions:Cs},l=n.computed(()=>{const u=a.field.component;return i[u]||null}),c=n.computed(()=>{const u=a.field.props||{},f={};if((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),f.required=a.required!==void 0?a.required:u.required??!1,["disabled","readonly","clearable","returnObject","itemTitle","itemValue","maxLength","minLength","maxValue","minValue","sizeFile","typeFile","treeData","menuList","enableParentControl","showIcons"].forEach(m=>{u[m]!==void 0&&u[m]!==null&&(f[m]=u[m])}),u.valueType&&(f.type=u.valueType),u.endpoint&&u.endpoint.apiUrl){const m={};Array.isArray(u.endpoint.keyParam)&&u.endpoint.keyParam.forEach(p=>{a.formData&&a.formData[p]!=null&&(m[p]=a.formData[p])}),f.endpoint={apiUrl:u.endpoint.apiUrl,apiMethod:u.endpoint.apiMethod||"GET"},Object.keys(m).length&&(f.apiParams=m)}return u.endpointReference&&u.endpointReference.apiUrl&&(f.endpointReference=u.endpointReference),f}),d=u=>{s.value=u,r("update:modelValue",u)};return(u,f)=>e.field.isHidden?(n.openBlock(),n.createElementBlock("div",GE,[n.createElementVNode("input",{type:"hidden",value:s.value,name:e.field.model},null,8,XE)])):l.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.value),n.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"])):(n.openBlock(),n.createElementBlock("div",YE," Unknown field: "+n.toDisplayString(e.field.component),1))}}),KE={class:"w-full space-y-6"},JE={key:0,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},QE={class:"flex items-center justify-between mb-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30"},ZE={key:0,class:"px-4 py-3"},eS={class:"text-sm font-semibold text-white"},tS={class:"px-4 py-3"},nS={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},oS={key:0,class:"px-4 py-2 bg-primary-700 dark:bg-primary-900 flex items-center justify-end gap-2"},aS={key:2,class:"w-full"},rS={class:"flex items-center gap-2 flex-wrap pt-4 border-t border-neutral-100 dark:border-neutral-800"},sS={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},iS=n.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["submit","cancel","action"],setup(e,{emit:t}){const o=e,a=t;let r=n.ref("en"),s=N=>N;try{const N=Ht.useI18n();r=N.locale,s=N.t}catch{}const i=n.ref(!1),l=n.reactive({}),c=n.reactive({});n.watch(()=>o.model,N=>{N&&Object.keys(N).forEach(v=>{l[v]=N[v]})},{immediate:!0,deep:!0}),n.watch(()=>o.schema,N=>{N!=null&&N.sections&&N.sections.forEach(v=>{var T;if(v.type==="TABLE"&&((T=v.propsTable)!=null&&T.modelDatatable)){const R=v.propsTable.modelDatatable;(!l[R]||!Array.isArray(l[R]))&&(l[R]=[])}else if(v.type==="WIZARD"){const R=f(v);c[R]===void 0&&(c[R]=0)}})},{immediate:!0});const d=N=>N?[...N].sort((v,T)=>(v.seq||0)-(T.seq||0)):[],u=(N,v)=>{l[N]=v},f=N=>{var v,T,R;return((v=N.propsForm)==null?void 0:v.key)||((T=N.propsTable)==null?void 0:T.key)||((R=N.propsWizard)==null?void 0:R.key)||N.id||"unknown-section"},h=N=>{var R;const v=((R=N.propsWizard)==null?void 0:R.propsSteps)||[],T=r.value==="en";return v.map((H,O)=>{var $,Y;return{key:H.key||`step-${O}`,title:T?H.titleEN:H.titleID,description:T?H.descriptionEN:H.descriptionID,icon:H.icon||void 0,fields:(($=H.sectionsWizard)==null?void 0:$.fields)||[],layoutColumns:((Y=H.sectionsWizard)==null?void 0:Y.layoutColumns)||1}})},m=(N,v)=>{if(N==null)return!0;if(typeof N!="object")return N;if("var"in N)return v[N.var]??null;if("=="in N){const[T,R]=N["=="].map(H=>m(H,v));return T==R}if("!="in N){const[T,R]=N["!="].map(H=>m(H,v));return T!=R}if(">"in N){const[T,R]=N[">"].map(H=>m(H,v));return T>R}if(">="in N){const[T,R]=N[">="].map(H=>m(H,v));return T>=R}if("<"in N){const[T,R]=N["<"].map(H=>m(H,v));return T<R}if("and"in N)return N.and.every(T=>m(T,v));if("or"in N)return N.or.some(T=>m(T,v));if("!"in N)return!m(N["!"],v);if("length"in N){const T=m(N.length,v);return T==null?0:typeof T=="string"||Array.isArray(T)?T.length:0}return!0},p=N=>{var T;const v=(T=N.logic)==null?void 0:T.visibleRule;return!v||Object.keys(v).length===0?!0:!!m(v,l)},g=N=>{var R,H;const v=((R=N.props)==null?void 0:R.required)??!1,T=(H=N.logic)==null?void 0:H.requiredRule;return!T||Object.keys(T).length===0?v:!!m(T,l)},y=async N=>{const v=N.propsActionGlobal;if(!v)return;const T=v.fieldMapping;let R={};T&&typeof T=="object"&&Object.keys(T).length>0?Object.keys(T).forEach(H=>{const O=T[H];l[H]!==void 0&&(R[O]=l[H])}):R={...l},a("action",v.key||"",N,R)},x=async()=>{i.value=!0;try{a("submit",{...l})}finally{i.value=!1}},_=()=>{a("cancel")},C=N=>N.permission?o.isEditMode?N.permission!=="CREATE":N.permission!=="UPDATE":!0,w=N=>{const v=N.modelDatatable;if(!v)return[];const T=l[v];return Array.isArray(T)?T:[]},E=n.ref(!1),B=n.ref(""),k=n.ref([]),b=n.reactive({}),A=n.ref(""),D=n.ref(null),P=n.ref(null),V=(N,v)=>{var R,H;A.value=N.modelDatatable||"",P.value=v,D.value=null;const T=v.fieldActionGlobal||[];k.value=T,B.value=((R=v.propsActionGlobal)==null?void 0:R.labelID)||((H=v.propsActionGlobal)==null?void 0:H.labelEN)||"Add Row",Object.keys(b).forEach(O=>delete b[O]),T.forEach(O=>{b[O.model]=null}),E.value=!0},M=(N,v)=>{var ee;const{action:T,row:R}=v;if(/delete|trash|remove/i.test(T)){const ne=N.modelDatatable;if(ne&&Array.isArray(l[ne])){const fe=l[ne].indexOf(R);if(fe!==-1)l[ne].splice(fe,1);else{const ye=JSON.stringify(R),he=l[ne].findIndex(G=>JSON.stringify(G)===ye);he!==-1&&l[ne].splice(he,1)}}return}const O=N.modelDatatable||"";A.value=O;const $=l[O],Y=Array.isArray($)?$.indexOf(R):-1;D.value=Y!==-1?Y:null;const X=N.actionTableGlobal||[],j=((ee=X[0])==null?void 0:ee.fieldActionGlobal)||[];k.value=j,B.value="Edit Row",P.value=X[0],Object.keys(b).forEach(ne=>delete b[ne]),j.forEach(ne=>{b[ne.model]=R[ne.model]??null}),E.value=!0},z=()=>{const N=A.value;if(!N)return;Array.isArray(l[N])||(l[N]=[]);const v={...b};D.value!==null?l[N].splice(D.value,1,v):l[N].push(v),E.value=!1};return(N,v)=>{var T,R,H;return n.openBlock(),n.createElementBlock("div",KE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList((T=e.schema)==null?void 0:T.sections,(O,$)=>{var Y,X;return n.openBlock(),n.createElementBlock(n.Fragment,{key:$},[O.type==="FORM"&&O.propsForm?(n.openBlock(),n.createElementBlock("div",JE,[n.createElementVNode("div",QE,[O.propsForm.titleID||O.propsForm.titleEN?(n.openBlock(),n.createElementBlock("div",ZE,[n.createElementVNode("h3",eS,n.toDisplayString(n.unref(r)==="id"?O.propsForm.titleID:O.propsForm.titleEN),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",tS,[n.createVNode(qe,{size:"sm",icon:"List",text:n.unref(s)("common.back"),variant:"outline",onClick:_},null,8,["text"])])]),n.createElementVNode("div",{class:n.normalizeClass(["p-4 grid gap-4",O.propsForm.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d(O.propsForm.fields),j=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:j.key},[p(j)?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass([j.column==="FULL"&&O.propsForm.layoutColumns>1?"md:col-span-2":"col-span-1"])},[n.createVNode(Ms,{field:j,"model-value":l[j.model],"form-data":l,required:g(j),"onUpdate:modelValue":ee=>u(j.model,ee)},null,8,["field","model-value","form-data","required","onUpdate:modelValue"])],2)):n.createCommentVNode("",!0)],64))),128))],2)])):O.type==="TABLE"&&O.propsTable?(n.openBlock(),n.createElementBlock("div",nS,[(Y=O.propsTable.actionTableGlobal)!=null&&Y.length?(n.openBlock(),n.createElementBlock("div",oS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(O.propsTable.actionTableGlobal,(j,ee)=>{var ne,fe;return n.openBlock(),n.createElementBlock(n.Fragment,{key:ee},[j.propsActionGlobal?(n.openBlock(),n.createBlock(qe,{key:0,icon:j.propsActionGlobal.icon,"bg-color":((ne=j.propsActionGlobal.bgColor)==null?void 0:ne.toLowerCase())||"primary",variant:((fe=j.propsActionGlobal.variant)==null?void 0:fe.toLowerCase())||"default",size:"sm",onClick:ye=>V(O.propsTable,j)},null,8,["icon","bg-color","variant","onClick"])):n.createCommentVNode("",!0)],64)}),128))])):n.createCommentVNode("",!0),n.createVNode(Do,{"table-config":O.propsTable,data:w(O.propsTable),nested:!0,"show-pagination":O.propsTable.pagination??!0,onAction:j=>M(O.propsTable,j)},null,8,["table-config","data","show-pagination","onAction"])])):O.type==="WIZARD"&&O.propsWizard?(n.openBlock(),n.createElementBlock("div",aS,[n.createVNode(ks,{tabs:h(O),modelValue:c[f(O)],"onUpdate:modelValue":j=>c[f(O)]=j,"is-vertical":O.propsWizard.isVertical,"is-wizard":O.propsWizard.isWizard,"type-wizard":((X=O.propsWizard.typeWizard)==null?void 0:X.toLowerCase())||"icon",loading:i.value},n.createSlots({_:2},[n.renderList(h(O),j=>({name:`tab-${j.key}`,fn:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["grid gap-4 mt-4",j.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d(j.fields),ee=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:ee.key},[p(ee)?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass([ee.column==="FULL"&&j.layoutColumns>1?"md:col-span-2":"col-span-1"])},[n.createVNode(Ms,{field:ee,"model-value":l[ee.model],"form-data":l,required:g(ee),"onUpdate:modelValue":ne=>u(ee.model,ne)},null,8,["field","model-value","form-data","required","onUpdate:modelValue"])],2)):n.createCommentVNode("",!0)],64))),128))],2)])}))]),1032,["tabs","modelValue","onUpdate:modelValue","is-vertical","is-wizard","type-wizard","loading"])])):n.createCommentVNode("",!0)],64)}),128)),n.createElementVNode("div",rS,[(H=(R=e.schema)==null?void 0:R.actionGlobal)!=null&&H.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(e.schema.actionGlobal,(O,$)=>{var Y,X;return n.openBlock(),n.createElementBlock(n.Fragment,{key:$},[O.propsActionGlobal&&C(O)?(n.openBlock(),n.createBlock(qe,{key:0,icon:O.propsActionGlobal.icon,text:n.unref(r)==="id"?O.propsActionGlobal.labelID:O.propsActionGlobal.labelEN,"bg-color":((Y=O.propsActionGlobal.bgColor)==null?void 0:Y.toLowerCase())||"primary",variant:((X=O.propsActionGlobal.variant)==null?void 0:X.toLowerCase())||"default",loading:i.value,onClick:j=>y(O)},null,8,["icon","text","bg-color","variant","loading","onClick"])):n.createCommentVNode("",!0)],64)}),128)):(n.openBlock(),n.createBlock(qe,{key:1,text:"Submit","bg-color":"primary",loading:i.value,onClick:x},null,8,["loading"]))]),n.createVNode(Eo,{modelValue:E.value,"onUpdate:modelValue":v[1]||(v[1]=O=>E.value=O),title:B.value,icon:"Plus","max-width":700},{actions:n.withCtx(()=>[n.createVNode(qe,{variant:"outline",text:"Cancel",onClick:v[0]||(v[0]=O=>E.value=!1)}),n.createVNode(qe,{text:"Save",onClick:z})]),default:n.withCtx(()=>[k.value.length?(n.openBlock(),n.createElementBlock("div",sS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(k.value,O=>(n.openBlock(),n.createElementBlock("div",{key:O.key,class:n.normalizeClass(O.column==="FULL"?"md:col-span-2":"col-span-1")},[n.createVNode(Ms,{field:O,"model-value":b[O.model],"form-data":b,"onUpdate:modelValue":$=>b[O.model]=$},null,8,["field","model-value","form-data","onUpdate:modelValue"])],2))),128))])):n.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}}}),lS={class:"w-full space-y-6 animate-pulse"},cS={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},dS=n.defineComponent({__name:"AutoLayoutSkeleton",setup(e){return(t,o)=>(n.openBlock(),n.createElementBlock("div",lS,[o[2]||(o[2]=n.createElementVNode("div",{class:"h-6 w-48 bg-neutral-200 dark:bg-neutral-700 rounded-md"},null,-1)),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(2,a=>n.createElementVNode("div",{key:a,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 overflow-hidden"},[o[1]||(o[1]=n.createElementVNode("div",{class:"px-4 py-3 bg-neutral-200 dark:bg-neutral-700"},[n.createElementVNode("div",{class:"h-4 w-32 bg-neutral-300 dark:bg-neutral-600 rounded"})],-1)),n.createElementVNode("div",cS,[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(6,r=>n.createElementVNode("div",{key:r,class:n.normalizeClass(r>4?"md:col-span-2":"col-span-1")},[...o[0]||(o[0]=[n.createElementVNode("div",{class:"h-3 w-24 bg-neutral-200 dark:bg-neutral-700 rounded mb-2"},null,-1),n.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]=n.createElementVNode("div",{class:"flex items-center gap-2"},[n.createElementVNode("div",{class:"h-9 w-24 bg-neutral-300 dark:bg-neutral-600 rounded-lg"}),n.createElementVNode("div",{class:"h-9 w-20 bg-neutral-200 dark:bg-neutral-700 rounded-lg"})],-1))]))}}),uS={class:"w-full"},fS={class:"relative mx-auto min-h-[37.5rem]"},hS={key:"content",class:"w-full"},mS={class:"mb-6"},pS={class:"text-neutral-500 dark:text-neutral-400"},gS={key:"skeleton",class:"w-full"},bS={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},Ns=xt(n.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},isEditMode:{type:Boolean}},emits:["submit-success","cancel","action-success"],setup(e,{emit:t}){var A,D,P,V,M,z,N,v;const o=e,a=t,r=(D=(A=n.getCurrentInstance())==null?void 0:A.appContext)==null?void 0:D.app;r&&!r._context.provides[Symbol.for("vue-router-route-location")]&&r.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let s={query:{},params:{},path:""};try{const T=An.useRoute();if(T&&Object.keys(T).length>0)s=T;else{const R=n.getCurrentInstance();(M=(V=(P=R==null?void 0:R.appContext)==null?void 0:P.config)==null?void 0:V.globalProperties)!=null&&M.$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:T=>{typeof window<"u"&&(typeof T=="string"?window.location.href=T:T&&T.path&&(window.location.href=T.path))},__isFallback:!0};try{const T=An.useRouter();if(T)i=T;else{const R=n.getCurrentInstance();(v=(N=(z=R==null?void 0:R.appContext)==null?void 0:z.config)==null?void 0:N.globalProperties)!=null&&v.$router&&(i=R.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=Je();let d;try{d=Ht.useI18n().locale}catch{d=n.ref("en")}const{setPageTitle:u}=vE(),f=n.computed(()=>o.isEditMode!==void 0?o.isEditMode:s.params&&"id"in s.params?!0:s.path?/\/edit\/[^\/]+$/.test(s.path):!1);n.watchEffect(()=>{console.log("isEditModeisEditMode",f.value)});const h=n.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const T=s.path.match(/\/edit\/([^\/]+)$/);return T?T[1]:null}),m=n.ref({}),p=n.ref(null),g=n.ref(!0),y=n.ref(!1),x="http://110.239.67.31:9101/api/auto-layout/form/form-dynamic?code=",_="http://110.239.67.31:9101/api/auto-layout/datatable/form-dynamic?code=",C=n.ref(o.layoutCode),w=n.computed(()=>{var H;if(!p.value)return"";const T=((H=d==null?void 0:d.value)==null?void 0:H.toLowerCase())||"en";return(T==="en"||T.startsWith("en-")?p.value.titleEN:p.value.titleID)||p.value.title||o.layoutCode});n.watch(w,T=>{T&&u(T)},{immediate:!0});const E=async()=>{var T,R,H,O,$,Y;g.value=!0;try{let X=o.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&(X=s.query.code||o.layoutCode);const j="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",ee=j?{Authorization:`Bearer ${j}`}:{},ne=`${x}${X}`;let fe=await l(ne,"GET",null,ee);if(!fe.status||!fe.data||Array.isArray(fe.data)&&fe.data.length===0)try{const ye=`${_}${X}`,he=await l(ye,"GET",null,ee);if(he.status){const G=Array.isArray(he.data)?he.data[0]:he.data;G&&G.code&&(X=G.code,C.value=X,fe=await l(`${x}${X}`,"GET",null,ee))}}catch(ye){console.warn("Failed to resolve layout code via datatable",ye)}if(fe.status){p.value=Array.isArray(fe.data)?fe.data[0]:fe.data;const ye={};if((T=p.value)!=null&&T.sections&&p.value.sections.forEach(he=>{((he.propsForm||he.props||{}).fields||he.fields||[]).forEach(q=>{var ue;const Q=q.model||((ue=q.props)==null?void 0:ue.model)||q.key;Q&&(ye[Q]=null)})}),m.value=ye,g.value=!1,f.value&&h.value){y.value=!0;try{const he=(O=(H=(R=p.value.sections)==null?void 0:R[0])==null?void 0:H.propsForm)==null?void 0:O.endpointForm,G=p.value.endpointForm,F=he||G;if(F!=null&&F.apiUrl){const q=F.apiUrl,Q=F.apiMethod||"GET",ue=F.keyParam||[],_e={};ue.length>0?ue.forEach(Oe=>{_e[Oe]=h.value}):_e.id=h.value;const Ce=await c(q,Q,_e);if(Ce.status){let Oe=Array.isArray(Ce.data)?Ce.data[0]:Ce.data;Ce.payload&&(Oe={...Oe,...Ce.payload}),m.value={...m.value,...Oe}}}else if(($=p.value.endpointGlobal)!=null&&$.apiUrl){const q=p.value.endpointGlobal.apiUrl,Q=p.value.endpointGlobal.apiMethod||"GET",ue={id:h.value},_e=await c(q,Q,ue);if(_e.status){const Ce=Array.isArray(_e.data)?_e.data[0]:_e.data;m.value={...m.value,...Ce}}}else{const q=((Y=p.value.endpoint)==null?void 0:Y.detailUrl)||`/api/${C.value}/detail/${h.value}`,Q=await l(q,"GET");if(Q.status){let ue=Array.isArray(Q.data)?Q.data[0]:Q.data;if(Q.payload){const Ce={...Q.payload};if(Object.keys(Ce).forEach(Oe=>{ue[Oe]!==void 0&&ue[Oe]!==null&&(Ce[Oe]=ue[Oe])}),!("id"in Ce)&&ue.id){const Oe=Object.keys(Ce).find(Ke=>Ke.startsWith("id")&&Ke.length>2&&!Ce[Ke]);Oe&&(Ce[Oe]=ue.id)}ue=Ce}const _e={...ue};Object.keys(m.value).forEach(Ce=>{if(_e[Ce]===void 0||_e[Ce]===null){if(Ce.toLowerCase().startsWith("id")&&Ce.length>2){const Ke=Ce.substring(2).toLowerCase(),at=Array.isArray(Q.data)?Q.data[0]:Q.data,wt=Object.keys(at).find(ln=>ln.toLowerCase()===Ke);wt&&at[wt]&&typeof at[wt]=="object"&&"id"in at[wt]&&(_e[Ce]=at[wt].id)}if(Ce==="idSupervisor"){const Ke=Array.isArray(Q.data)?Q.data[0]:Q.data;Ke.supervisorId&&(_e[Ce]=Ke.supervisorId)}}}),m.value={...m.value,..._e}}}}catch(he){console.error("Failed to fetch record data:",he)}finally{y.value=!1}}}}catch(X){console.error("Failed to load form layout:",X),g.value=!1}},B=async T=>{var R,H,O;try{const $=(O=(H=(R=p.value.sections)==null?void 0:R[0])==null?void 0:H.propsForm)==null?void 0:O.endpointForm,Y=p.value.endpointGlobal||p.value.endpoint,X=($==null?void 0:$.submitUrl)||(Y==null?void 0:Y.submitUrl)||`/api/generic/${o.layoutCode}`,j=($==null?void 0:$.submitMethod)||(Y==null?void 0:Y.submitMethod)||(f.value?"PUT":"POST"),ee={...T};f.value&&h.value&&!ee.id&&(ee.id=h.value),await l(X,j,ee),a("submit-success",ee),i.back()}catch($){console.error("Submit failed:",$)}},k=async(T,R,H)=>{if(T==="cancel"){b();return}const O=R.endpointPropAction||R.propsActionGlobal&&R.propsActionGlobal.endpointPropAction;if(O)try{g.value=!0;const $=H?{...H}:{...m.value};f.value&&R.model&&h.value&&($[R.model]=h.value);const Y=O.apiUrl,X=O.apiMethod||"POST";(await c(Y,X,$)).status&&(a("action-success",T,R,$),i.back())}catch($){console.error("Action failed:",$)}finally{g.value=!1}},b=()=>{a("cancel"),i.back()};return n.onMounted(()=>{E()}),n.onUnmounted(()=>{u("")}),(T,R)=>(n.openBlock(),n.createElementBlock("div",uS,[n.createElementVNode("div",fS,[n.createVNode(n.Transition,{name:"fade",mode:"out-in"},{default:n.withCtx(()=>[!g.value&&p.value?(n.openBlock(),n.createElementBlock("div",hS,[n.createElementVNode("div",mS,[n.createElementVNode("p",pS,n.toDisplayString(p.value.description),1)]),n.createVNode(iS,{schema:p.value,model:m.value,"is-edit-mode":f.value,loading:y.value,onSubmit:B,onCancel:b,onAction:k,class:"w-full"},null,8,["schema","model","is-edit-mode","loading"])])):g.value?(n.openBlock(),n.createElementBlock("div",gS,[n.createVNode(dS)])):(n.openBlock(),n.createElementBlock("div",bS," Failed to load form configuration for "+n.toDisplayString(o.layoutCode),1))]),_:1})])]))}}),[["__scopeId","data-v-5ba0fa8c"]]),yS={class:"h-full flex flex-col"},xS={key:1,class:"flex-1 flex items-center justify-center"},kS={key:2,class:"flex-1 flex items-center justify-center text-red-500"},Ps=n.defineComponent({name:"AutoLayoutDatatable",__name:"AutoLayoutDatatable",props:{layoutCode:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function}},emits:["action","navigate"],setup(e,{emit:t}){var _,C,w,E,B,k;const o=e,a=t,r=n.getCurrentInstance(),{apiUrl:s}=Je();let i={query:{},params:{},path:""};try{const b=An.useRoute();b?i=b:(w=(C=(_=r==null?void 0:r.appContext)==null?void 0:_.config)==null?void 0:C.globalProperties)!=null&&w.$route&&(i=r.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:b=>{typeof window<"u"&&(typeof b=="string"?window.location.href=b:b&&b.path&&(window.location.href=b.path))}};try{const b=An.useRouter();b?l=b:(k=(B=(E=r==null?void 0:r.appContext)==null?void 0:E.config)==null?void 0:B.globalProperties)!=null&&k.$router&&(l=r.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const c=n.inject("hasActionAccess",()=>!1),d=n.inject("userPermissions",null),u=n.ref(null),f=n.ref(!0),h=n.ref(null),m="http://110.239.67.31:9101/api/auto-layout/datatable/form-dynamic?code=",p=n.computed(()=>`${m}${o.layoutCode}`),g=async()=>{var b;f.value=!0;try{const A="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",D=A?{Authorization:`Bearer ${A}`}:{},P=await s(p.value,"GET",null,D);P.status&&(u.value=Array.isArray(P.data)?P.data[0]:P.data,console.log("[DEBUG] AutoLayoutDatatable config loaded:",u.value),console.log("[DEBUG] actionGlobal in config:",(b=u.value)==null?void 0:b.actionGlobal))}catch(A){console.error("Gagal Menampilkan Datatable:",A)}finally{f.value=!1}},y=b=>{b.action==="add"&&console.log("[AutoLayoutDatatable] Add action triggered"),console.log("Aksi:",b.action,b)},x=b=>{console.log("[DEBUG] AutoLayoutDatatable handleNavigate:",b);let A=b.route;if(A||(A=`/${((i==null?void 0:i.path)||"").split("/")[1]||"product"}/create`),A){const D=b.path?{code:b.path}:{};console.log("[DEBUG] Emitting navigate to parent:",{path:A,query:D}),a("navigate",{route:A,query:D})}else console.warn("[DEBUG] No route or path provided for navigation")};return n.onMounted(()=>{g()}),(b,A)=>(n.openBlock(),n.createElementBlock("div",yS,[!f.value&&u.value?(n.openBlock(),n.createBlock(Do,{key:0,ref_key:"dtRef",ref:h,"api-url":p.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||n.unref(d),"permission-checker":n.unref(c),checkPermission:o.checkPermission,onAction:y,onNavigate:x},{"header-actions":n.withCtx(()=>[...A[0]||(A[0]=[])]),_:1},8,["api-url","table-config","permission-base","dummy-mode","user-permissions","permission-checker","checkPermission"])):f.value?(n.openBlock(),n.createElementBlock("div",xS,[...A[1]||(A[1]=[n.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(n.openBlock(),n.createElementBlock("div",kS," Failed to load configuration for "+n.toDisplayString(o.layoutCode),1))]))}}),vd=n.defineCustomElement(Ns),Td=n.defineCustomElement(Ps);typeof customElements<"u"&&(customElements.get("micro-dynamic-form")||customElements.define("micro-dynamic-form",vd),customElements.get("micro-dynamic-datatable")||customElements.define("micro-dynamic-datatable",Td));const wS=[Lo,ri,qe,Ii,Xc,on,ls,Sa,Eo,ud,Aa,fd,hs,hd,ps,Va,gs,jn,bs,Da,md,pd,ys,xs,Na,Pa,va,Un,xd,kd,ks,ws,Cs,Do,Ns,Ps],Od={install(e,t={}){t&&Object.keys(t).length>0&&zs(t),wS.forEach(o=>{o.name&&e.component(o.name,o)})}};se.AutoLayoutDatatable=Ps,se.AutoLayoutForm=Ns,se.DCodeAutoComplete=Lo,se.DCodeButton=qe,se.DCodeCard=Ii,se.DCodeChart=Xc,se.DCodeCheckbox=on,se.DCodeCurrencyField=ls,se.DCodeDatePicker=Sa,se.DCodeDialog=Eo,se.DCodeDialogCloseBtn=ud,se.DCodeDropzone=Aa,se.DCodeFileField=fd,se.DCodeFileResult=hs,se.DCodeIconDropdown=hd,se.DCodeImageCropperDialog=ps,se.DCodeImageField=Va,se.DCodeImageResult=gs,se.DCodeInfiniteAutoComplete=ri,se.DCodeLabel=jn,se.DCodeMultiSelect=bs,se.DCodeOtpInput=Da,se.DCodePermissionMenu=ws,se.DCodeProgress=md,se.DCodeProgressBar=pd,se.DCodeRadio=ys,se.DCodeRadioCustom=xs,se.DCodeSlider=Na,se.DCodeSwitch=Pa,se.DCodeTextField=va,se.DCodeTextarea=Un,se.DCodeTimelineWithIcons=xd,se.DCodeTreePermissions=Cs,se.DCodeUploadFile=kd,se.DCodeWizard=ks,se.DataTable=Do,se.DataTableComponent=Do,se.DynamicUI=Od,se.MicroDynamicDatatable=Td,se.MicroDynamicForm=vd,se.cn=we,se.default=Od,se.setApiConfig=zs,Object.defineProperties(se,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
95
|
+
`});return(E,B)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-2 w-full",n.unref(o).class]),"aria-busy":!1},[d.value?(n.openBlock(),n.createBlock(n.unref(Ma),{key:0,for:c.value,class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(d.value)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",Qw,"*")):n.createCommentVNode("",!0)]),_:1},8,["for"])):n.createCommentVNode("",!0),n.createElementVNode("div",Zw,[e.showValue?(n.openBlock(),n.createElementBlock("div",e1,[n.createElementVNode("span",t1,n.toDisplayString(r.valuePrefix)+n.toDisplayString(e.min)+n.toDisplayString(r.valueSuffix),1),n.createElementVNode("span",n1,n.toDisplayString(m.value),1),n.createElementVNode("span",o1,n.toDisplayString(r.valuePrefix)+n.toDisplayString(e.max)+n.toDisplayString(r.valueSuffix),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",a1,[n.createElementVNode("div",{class:n.normalizeClass(["absolute top-1/2 -translate-y-1/2 w-full h-full bg-gray-200 rounded-lg pointer-events-none",[e.size==="sm"?"h-2":e.size==="md"?"h-2.5":"h-3"]])},[n.createElementVNode("div",{class:n.normalizeClass(["absolute top-0 left-0 h-full rounded-lg transition-all",[e.color==="blue"?"bg-blue-500":e.color==="green"?"bg-green-500":e.color==="red"?"bg-red-500":e.color==="yellow"?"bg-yellow-500":e.color==="purple"?"bg-purple-500":"bg-gray-500"]]),style:n.normalizeStyle({width:`${p.value}%`})},null,6)],2),n.createElementVNode("input",{id:c.value,ref_key:"sliderRef",ref:s,type:"range",value:e.modelValue,min:e.min,max:e.max,step:e.step,disabled:e.disabled,placeholder:e.placeholder,class:n.normalizeClass(f.value),onInput:b,onChange:g,onMousedown:x,onMouseup:_,onTouchstart:x,onTouchend:_},null,42,r1)]),e.marks.length>0?(n.openBlock(),n.createElementBlock("div",s1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.marks,k=>(n.openBlock(),n.createElementBlock("div",{key:k.value,class:"absolute flex flex-col items-center",style:n.normalizeStyle({left:`${C(k.value)}%`,transform:"translateX(-50%)"})},[B[0]||(B[0]=n.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),n.createElementVNode("span",i1,n.toDisplayString(k.label),1)],4))),128))])):n.createCommentVNode("",!0)]),l.value?(n.openBlock(),n.createElementBlock("div",l1,[B[1]||(B[1]=n.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[n.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)),n.createTextVNode(" "+n.toDisplayString(e.error),1)])):n.createCommentVNode("",!0),w.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent("style"),{key:2},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(w.value),1)]),_:1})):n.createCommentVNode("",!0)],2)),[[n.vShow,u.value]])}}),d1={class:"grid gap-3"},u1={key:0,class:"ml-1 text-destructive"},f1={class:"inline-flex items-center gap-3"},h1=["id","name","aria-checked","aria-label","disabled"],m1={key:0,class:"absolute inset-0 flex items-center justify-center"},p1={class:"relative z-10 flex items-center gap-2"},g1=["id","name","aria-checked","aria-label","disabled"],b1={key:0,class:"absolute inset-0 flex items-center justify-center"},y1={name:"DCodeSwitch"},Pa=n.defineComponent({...y1,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(e,{emit:t}){const o=e,a=t,r=n.computed({get:()=>o.modelValue,set:f=>{!o.disabled&&!o.loading&&(a("update:modelValue",f),a("change",f))}}),s=n.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=n.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=n.computed(()=>{switch(o.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=n.computed(()=>{if(o.disabled)return"bg-gray-300";if(!r.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=()=>{r.value=!r.value},u=n.computed(()=>r.value?o.tooltipActiveText:o.tooltipInactiveText);return(f,h)=>(n.openBlock(),n.createElementBlock("div",d1,[e.title?(n.openBlock(),n.createBlock(Ma,{key:0,class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",u1,"*")):n.createCommentVNode("",!0)]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",f1,[n.createVNode(n.unref(zi),null,{default:n.withCtx(()=>[e.showTooltip?(n.openBlock(),n.createBlock(n.unref(Ti),{key:0,"delay-duration":200},{default:n.withCtx(()=>[n.createVNode(n.unref(Fi),{"as-child":""},{default:n.withCtx(()=>[n.createElementVNode("button",{type:"button",id:e.id,name:e.name,"aria-checked":r.value?"true":"false","aria-label":e.label||"Toggle switch",disabled:e.disabled||e.loading,class:n.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":e.disabled,"cursor-wait":e.loading,"cursor-pointer":!e.disabled&&!e.loading}]),onClick:d},[n.createElementVNode("span",{class:n.normalizeClass([i.value,r.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"])},[e.loading?(n.openBlock(),n.createElementBlock("span",m1,[...h[0]||(h[0]=[n.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"},[n.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),n.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)])])):n.createCommentVNode("",!0),n.createVNode(n.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:n.withCtx(()=>[r.value&&!e.loading?(n.openBlock(),n.createBlock(n.unref(te.Check),{key:0,class:n.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!r.value&&!e.loading?(n.openBlock(),n.createBlock(n.unref(te.X),{key:1,class:n.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):n.createCommentVNode("",!0)]),_:1})],2)],10,h1)]),_:1}),n.createVNode(n.unref(Oi),{side:"top","side-offset":8,class:n.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",[r.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:n.withCtx(()=>[n.createElementVNode("span",p1,[n.createElementVNode("span",{class:n.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",r.value?"bg-green-200":"bg-gray-300"])},null,2),n.createTextVNode(" "+n.toDisplayString(u.value),1)])]),_:1},8,["class"])]),_:1})):(n.openBlock(),n.createElementBlock("button",{key:1,type:"button",id:e.id,name:e.name,"aria-checked":r.value?"true":"false","aria-label":e.label||"Toggle switch",disabled:e.disabled||e.loading,class:n.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":e.disabled,"cursor-wait":e.loading,"cursor-pointer":!e.disabled&&!e.loading}]),onClick:d},[n.createElementVNode("span",{class:n.normalizeClass([i.value,r.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"])},[e.loading?(n.openBlock(),n.createElementBlock("span",b1,[...h[1]||(h[1]=[n.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"},[n.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),n.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)])])):n.createCommentVNode("",!0),n.createVNode(n.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:n.withCtx(()=>[r.value&&!e.loading?(n.openBlock(),n.createBlock(n.unref(te.Check),{key:0,class:n.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!r.value&&!e.loading?(n.openBlock(),n.createBlock(n.unref(te.X),{key:1,class:n.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):n.createCommentVNode("",!0)]),_:1})],2)],10,g1))]),_:1})])]))}}),x1=["aria-busy"],k1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},w1={key:1,class:"flex justify-end"},C1=["for"],_1={key:0,class:"ml-1 text-destructive"},B1={class:"relative w-full group"},E1={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},S1={key:1},A1=["id","value","placeholder"],V1={key:1,class:"absolute inset-y-0 right-4 flex items-center"},D1={key:2,class:"absolute inset-y-0 right-4 flex items-center"},M1={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"},N1={key:1,class:"text-xs text-destructive"},va=n.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}},emits:["update:modelValue","clear"],setup(e,{emit:t}){const o=n.useAttrs(),a=n.computed(()=>{var O;return((O=l.valueType)==null?void 0:O.toLowerCase())==="password"||o.type==="password"}),r=n.ref(!1),s=()=>{r.value=!r.value},i=t,l=e,c=n.computed(()=>o.label);n.computed(()=>l.visible??!0);const d=Math.random().toString(36).slice(2,7),u=n.computed(()=>`app-text-field-${o.id||c.value||"field"}-${d}`),f=n.computed(()=>{const O=o.required,j=o["aria-required"];return O===""||O===!0||O==="true"||(j==="true"||j===!0)}),h=n.computed(()=>{const{label:O,class:j,id:Y,required:ie,"aria-required":ye,...ke}=o;return ke}),m=n.computed(()=>{var j,Y;const O={...h.value};return((j=l.valueType)==null?void 0:j.toLowerCase())==="number"&&(O.type="text",O.inputmode="numeric",O.pattern="[0-9]*"),((Y=l.valueType)==null?void 0:Y.toLowerCase())==="email"&&(O.type="email",O.inputmode="email"),a.value&&(O.type=r.value?"text":"password"),l.disabled&&(O.disabled=!0),O}),p=n.computed(()=>{const O=l.modelValue;return O==null||String(O).length===0}),b=n.computed(()=>l.clearable?l.hideClearWhenEmpty?!p.value:!0:!1),g=n.computed(()=>{switch(l.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),x=n.ref(String(l.modelValue??""));n.watch(()=>l.modelValue,O=>{const j=String(O??"");j!==x.value&&(x.value=j)});const _=n.ref(!1),C=n.ref(!1),w=O=>O.split(/(\s+)/).map(j=>{if(j.trim()==="")return j;const Y=j.toLowerCase();return Y.charAt(0).toUpperCase()+Y.slice(1)}).join(""),E=O=>{const j=O.toLowerCase(),Y=j.search(new RegExp("\\p{L}","u"));return Y<0?j:j.slice(0,Y)+j.charAt(Y).toUpperCase()+j.slice(Y+1)},B=O=>{switch(l.textCase){case"uppercase":return O.toUpperCase();case"lowercase":return O.toLowerCase();case"titlecase":return w(O);case"sentencecase":return E(O);case"none":default:return O}},k=O=>{if(!O)return null;const j=Array.isArray(O)?O.join(""):O;return j?new Set(j):null},y=n.computed(()=>k(l.allowChars)),A=(O,j)=>(O.lastIndex=0,O.test(j)),D=O=>{var Me;const j=(Me=l.valueType)==null?void 0:Me.toLowerCase();if(j==="free"||j==="email"||j==="password")return!0;const Y=O===" ",ie=/\d/.test(O),ye=new RegExp("\\p{L}","u").test(O),ke=new RegExp("\\p{N}","u").test(O);return j==="number"?ie:j==="letter"?ye||l.allowSpaces&&Y:j==="letternumber"?ye||ke||l.allowSpaces&&Y:!0},N=O=>{let j="";for(const Y of O){const ie=!!y.value&&y.value.has(Y);l.pattern&&!ie&&!A(l.pattern,Y)||!ie&&!D(Y)||(j+=Y)}return j},V=n.computed(()=>{const O=o.maxlength??o.maxLength;let j=Number.NaN;return typeof O=="number"?j=O:typeof O=="string"&&(j=Number.parseInt(O,10)),Number.isFinite(j)&&j>0?j:-1}),M=n.computed(()=>x.value.length),T=n.computed(()=>l.showCharCount?V.value>0:!1),U=O=>V.value>0?O.slice(0,V.value):O,L=O=>{const j=N(O),Y=l.applyTextCaseToValue?B(j):j;return U(Y)};let R=null;const P=O=>{var j;if(O==="")return null;if(((j=l.valueType)==null?void 0:j.toLowerCase())==="number"&&l.returnNumber){const Y=Number(O);return Number.isFinite(Y)?Y:null}return O},W=O=>{x.value=O,i("update:modelValue",P(O))},v=(O,j)=>{const Y=U(j);C.value=!0,O.value=Y,W(Y),queueMicrotask(()=>C.value=!1)},z=(O,j)=>{const Y=O.selectionStart??O.value.length,ie=O.selectionEnd??O.value.length;if(V.value>0){const ye=O.value.length-(ie-Y),ke=V.value-ye;if(ke<=0)return;j=j.slice(0,ke)}O.setRangeText(j,Y,ie,"end"),v(O,L(O.value))},H=O=>{var ie;if(!R||_.value||C.value||!((ie=O.inputType)!=null&&ie.startsWith("insert")))return;const j=O.data;if(j==null)return;const Y=L(j);Y!==j&&(O.preventDefault(),Y.length>0&&z(R,Y))},G=O=>{var ie;if(!R||_.value||C.value)return;const j=((ie=O.clipboardData)==null?void 0:ie.getData("text"))??"",Y=L(j);Y!==j&&(O.preventDefault(),Y.length>0&&z(R,Y))},K=O=>{if(!R||_.value||C.value)return;const j=O.target,Y=j.value??"",ie=L(Y);ie===Y?W(ie):v(j,ie)},X=()=>_.value=!0,oe=()=>{if(_.value=!1,!R)return;const O=R.value??"",j=L(O);j===O?W(j):v(R,j)};n.onMounted(()=>{if(R=document.getElementById(u.value),!R)return;R.addEventListener("beforeinput",H),R.addEventListener("paste",G),R.addEventListener("input",K),R.addEventListener("compositionstart",X),R.addEventListener("compositionend",oe);const O=R.value??"",j=L(O);j===O?W(j):v(R,j)}),n.onBeforeUnmount(()=>{R&&(R.removeEventListener("beforeinput",H),R.removeEventListener("paste",G),R.removeEventListener("input",K),R.removeEventListener("compositionstart",X),R.removeEventListener("compositionend",oe),R=null)});const he=()=>{x.value="",R&&(R.value=""),i("update:modelValue",null),i("clear")},ge=n.computed(()=>T.value&&M.value>0),se=n.computed(()=>`${M.value} / ${V.value}`),J=n.computed(()=>!!l.error);return(O,j)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1 w-full",n.unref(o).class]),"aria-busy":l.skeleton},[l.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[c.value?(n.openBlock(),n.createElementBlock("div",k1)):n.createCommentVNode("",!0),j[1]||(j[1]=n.createElementVNode("div",{class:"relative w-full"},[n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),T.value?(n.openBlock(),n.createElementBlock("div",w1,[...j[0]||(j[0]=[n.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[c.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:u.value,class:"text-sm font-medium"},[n.createTextVNode(n.toDisplayString(c.value)+" ",1),f.value?(n.openBlock(),n.createElementBlock("span",_1,"*")):n.createCommentVNode("",!0)],8,C1)):n.createCommentVNode("",!0),n.createElementVNode("div",B1,[l.icon||l.prependInner||O.$slots["prepend-inner"]?(n.openBlock(),n.createElementBlock("div",E1,[n.renderSlot(O.$slots,"prepend-inner",{},()=>[l.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.icon),{key:0,class:"h-4 w-4"})):l.prependInner?(n.openBlock(),n.createElementBlock("span",S1,n.toDisplayString(l.prependInner),1)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0),n.createElementVNode("input",n.mergeProps({id:u.value,value:x.value},m.value,{placeholder:l.placeholder,style:`text-transform: ${g.value}; padding-left: ${l.icon||l.prependInner||O.$slots["prepend-inner"]?"2.5rem":"0.75rem"} !important; padding-right: ${b.value||a.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-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 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",J.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,A1),a.value?(n.openBlock(),n.createElementBlock("div",V1,[n.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground",tabindex:"-1",onClick:s},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(r.value?n.unref(te.Eye):n.unref(te.EyeOff)),{class:"w-4 h-4"}))])])):n.createCommentVNode("",!0),b.value&&!a.value?(n.openBlock(),n.createElementBlock("div",D1,[n.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:he}," ✕ ")])):n.createCommentVNode("",!0),ge.value&&!J.value?(n.openBlock(),n.createElementBlock("p",M1,n.toDisplayString(se.value),1)):n.createCommentVNode("",!0)]),J.value?(n.openBlock(),n.createElementBlock("p",N1,n.toDisplayString(l.error),1)):n.createCommentVNode("",!0)],64))],10,x1)),[[n.vShow,e.visible]])}}),P1=["aria-busy"],v1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},T1=["for"],O1={key:0,class:"ml-1 text-destructive"},z1={class:"relative w-full group"},F1=["id","value"],I1={key:0,class:"absolute top-1 right-2"},R1={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"},L1={key:1,class:"text-xs text-destructive"},Un=n.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(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=n.computed(()=>o.label),i=n.computed(()=>r.visible??!0),l=Math.random().toString(36).slice(2,7),c=n.computed(()=>`app-textarea-${o.id||s.value||"field"}-${l}`),d=n.computed(()=>{const J=o.required,O=o["aria-required"];return J===""||J===!0||J==="true"||(O==="true"||O===!0)}),u=n.computed(()=>{const{label:J,class:O,id:j,required:Y,"aria-required":ie,...ye}=o;return ye}),f=n.computed(()=>{const J=o.maxlength;let O=Number.NaN;return typeof J=="number"?O=J:typeof J=="string"&&(O=Number.parseInt(J,10)),Number.isFinite(O)&&O>0?O:-1}),h=J=>f.value>0?J.slice(0,f.value):J,m=n.computed(()=>{const J=r.modelValue;return J==null||String(J).length===0}),p=n.computed(()=>r.clearable?r.hideClearWhenEmpty?!m.value:!0:!1),b=n.ref(String(r.modelValue??""));n.watch(()=>r.modelValue,J=>{const O=String(J??"");O!==b.value&&(b.value=O)});const g=n.ref(!1),x=n.ref(!1),_=J=>J.split(/(\s+)/).map(O=>{if(O.trim()==="")return O;const j=O.toLowerCase();return j.charAt(0).toUpperCase()+j.slice(1)}).join(""),C=J=>{const O=J.toLowerCase(),j=O.search(new RegExp("\\p{L}","u"));return j<0?O:O.slice(0,j)+O.charAt(j).toUpperCase()+O.slice(j+1)},w=J=>{switch(r.textCase){case"uppercase":return J.toUpperCase();case"lowercase":return J.toLowerCase();case"titlecase":return _(J);case"sentencecase":return C(J);case"none":default:return J}},E=n.computed(()=>{switch(r.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),B=J=>{if(!J)return null;const O=Array.isArray(J)?J.join(""):J;return O?new Set(O):null},k=n.computed(()=>B(r.allowChars)),y=(J,O)=>(J.lastIndex=0,J.test(O)),A=J=>{if(J===`
|
|
96
|
+
`)return r.valueType!=="number";if(r.valueType==="free")return!0;const O=J===" ",j=/\d/.test(J),Y=new RegExp("\\p{L}","u").test(J),ie=new RegExp("\\p{N}","u").test(J);return r.valueType==="number"?j:r.valueType==="letter"?Y||r.allowSpaces&&O:r.valueType==="letternumber"?Y||ie||r.allowSpaces&&O:!0},D=J=>{let O="";for(const j of J){const Y=!!k.value&&k.value.has(j);r.pattern&&!Y&&!y(r.pattern,j)||!Y&&!A(j)||(O+=j)}return O},N=J=>{const O=D(J),j=r.applyTextCaseToValue?w(O):O;return h(j)};let V=null;const M=J=>{if(J==="")return null;if(r.valueType==="number"&&r.returnNumber){const O=J.replaceAll(`
|
|
97
|
+
`,""),j=Number(O);return Number.isFinite(j)?j:null}return J},T=J=>{b.value=J,a("update:modelValue",M(J))},U=(J,O)=>{const j=h(O);x.value=!0,J.value=j,T(j),queueMicrotask(()=>x.value=!1)},L=(J,O)=>{const j=J.selectionStart??J.value.length,Y=J.selectionEnd??J.value.length;if(f.value>0){const ie=J.value.length-(Y-j),ye=f.value-ie;if(ye<=0)return;O=O.slice(0,ye)}J.setRangeText(O,j,Y,"end"),U(J,N(J.value))},R=J=>{var Y;if(!V||g.value||x.value||!((Y=J.inputType)!=null&&Y.startsWith("insert")))return;const O=J.data;if(O==null)return;const j=N(O);j!==O&&(J.preventDefault(),j.length>0&&L(V,j))},P=J=>{var Y;if(!V||g.value||x.value)return;const O=((Y=J.clipboardData)==null?void 0:Y.getData("text"))??"",j=N(O);j!==O&&(J.preventDefault(),j.length>0&&L(V,j))},W=async J=>{if(!V||g.value||x.value)return;const O=J.target,j=O.value??"",Y=N(j);if(Y===j){const ie=O.selectionStart??Y.length,ye=O.selectionEnd??Y.length;U(O,Y),await n.nextTick();try{O.setSelectionRange(ie,ye)}catch{}T(Y)}else{const ie=O.selectionStart??Y.length,ye=O.selectionEnd??Y.length;U(O,Y),await n.nextTick();try{O.setSelectionRange(ie,ye)}catch{}}},v=()=>g.value=!0,z=()=>{if(g.value=!1,!V)return;const J=V.value??"",O=N(J);O===J?T(O):U(V,O)};n.onMounted(()=>{if(V=document.getElementById(c.value),!V)return;V.addEventListener("beforeinput",R),V.addEventListener("paste",P),V.addEventListener("input",W),V.addEventListener("compositionstart",v),V.addEventListener("compositionend",z);const J=V.value??"",O=N(J);O===J?T(O):U(V,O)}),n.onBeforeUnmount(()=>{V&&(V.removeEventListener("beforeinput",R),V.removeEventListener("paste",P),V.removeEventListener("input",W),V.removeEventListener("compositionstart",v),V.removeEventListener("compositionend",z),V=null)});const H=()=>{b.value="",V&&(V.value=""),a("update:modelValue",null),a("clear")},G=n.computed(()=>b.value.length),K=n.computed(()=>r.showCharCount?f.value>0:!1),X=n.computed(()=>K.value&&G.value>0),oe=n.computed(()=>`${G.value} / ${f.value}`),he=n.computed(()=>!!r.error),ge=n.computed(()=>{const J=o.rows,O=typeof J=="number"?J:Number.parseInt(String(J??""),10);return Number.isFinite(O)&&O>0?O:3}),se=n.computed(()=>({height:`${ge.value*24+16}px`}));return(J,O)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1 w-full",n.unref(o).class]),"aria-busy":r.skeleton},[r.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.value?(n.openBlock(),n.createElementBlock("div",v1)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:n.normalizeStyle(se.value)},null,4)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[s.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[n.createTextVNode(n.toDisplayString(s.value)+" ",1),d.value?(n.openBlock(),n.createElementBlock("span",O1,"*")):n.createCommentVNode("",!0)],8,T1)):n.createCommentVNode("",!0),n.createElementVNode("div",z1,[n.createElementVNode("textarea",n.mergeProps({id:c.value,value:b.value},u.value,{style:`text-transform: ${E.value}; padding-right: ${p.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-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 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",he.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,F1),p.value?(n.openBlock(),n.createElementBlock("div",I1,[n.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:H}," ✕ ")])):n.createCommentVNode("",!0),X.value&&!he.value?(n.openBlock(),n.createElementBlock("p",R1,n.toDisplayString(oe.value),1)):n.createCommentVNode("",!0)]),he.value?(n.openBlock(),n.createElementBlock("p",L1,n.toDisplayString(r.error),1)):n.createCommentVNode("",!0)],64))],10,P1)),[[n.vShow,i.value]])}}),gd=n.defineComponent({__name:"Avatar",props:{class:{type:[Boolean,null,String,Object,Array]},size:{default:"sm"},shape:{default:"circle"}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ce.AvatarRoot),{class:n.normalizeClass(n.unref(_e)(n.unref($1)({size:e.size,shape:e.shape}),t.class))},{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},8,["class"]))}}),bd=n.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ce.AvatarFallback),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),yd=n.defineComponent({__name:"AvatarImage",props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ce.AvatarImage),n.mergeProps(t,{class:"h-full w-full object-cover"}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),$1=to("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"}}}),Ta=n.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ce.Separator),n.mergeProps(n.unref(o),{class:n.unref(_e)("shrink-0 bg-border",t.orientation==="horizontal"?"h-px w-full":"w-px h-full",t.class)}),null,16,["class"]))}}),W1={class:"bg-card text-card-foreground"},j1={class:"pb-6 px-3"},U1={key:0,class:"flex justify-center p-8"},H1={key:1,class:"p-8 text-center text-red-500"},q1={key:2,class:"relative"},G1={class:"space-y-6"},X1={class:"rounded-xl border bg-card text-card-foreground shadow"},Y1={class:"p-4"},K1={class:"flex items-center justify-between gap-3"},J1={class:"font-medium"},Q1={class:"text-xs text-muted-foreground"},Z1={class:"mt-1 text-sm text-muted-foreground"},eC={class:"text-foreground"},tC={class:"text-foreground"},nC={class:"mt-1 text-xs text-muted-foreground"},oC={key:0,class:"mt-3 flex items-center gap-2 text-sm"},aC={class:"flex items-center justify-between gap-3"},rC={class:"font-medium"},sC={class:"text-xs text-muted-foreground"},iC={class:"mt-2 text-sm text-muted-foreground"},lC={class:"flex flex-wrap items-center justify-between gap-3"},cC={class:"flex items-center gap-3"},dC={class:"leading-tight"},uC={class:"text-sm font-medium"},fC={class:"text-xs text-muted-foreground"},hC={class:"flex items-center gap-2"},mC={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},pC={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},gC=["src"],bC={class:"flex-1"},yC={class:"flex items-center justify-between gap-3"},xC={class:"font-medium"},kC={class:"text-xs text-muted-foreground"},wC={class:"mt-1 text-sm text-muted-foreground"},CC={class:"text-left sm:text-center"},_C={class:"text-xs text-muted-foreground"},BC={class:"text-left sm:text-center"},EC={class:"text-xs text-muted-foreground"},SC={class:"text-left sm:text-center"},AC={class:"text-xs text-muted-foreground"},VC={class:"flex items-center justify-between gap-3"},DC={class:"font-medium"},MC={class:"text-xs text-muted-foreground"},NC={class:"mt-2 text-sm text-muted-foreground"},PC={class:"mt-3 flex items-center gap-3"},vC={class:"text-sm font-medium"},TC={class:"flex items-start justify-between gap-3"},OC={class:"font-medium"},zC={class:"mt-3 grid gap-2 text-sm"},FC={class:"flex items-center justify-between gap-3"},IC={class:"flex items-center gap-2 text-muted-foreground"},RC={class:"font-medium"},LC={class:"flex items-center justify-between gap-3"},$C={class:"flex items-center gap-2 text-muted-foreground"},WC={class:"font-medium"},jC={class:"flex items-center justify-between gap-3"},UC={class:"flex items-center gap-2 text-muted-foreground"},HC={class:"font-medium"},qC={class:"flex items-center justify-between"},GC={class:"flex items-center gap-2"},XC={class:"flex items-start justify-between gap-3"},YC={class:"flex items-center gap-2"},KC={class:"font-medium"},JC={class:"mt-2 text-sm text-muted-foreground"},QC={key:0,class:"mt-1 text-sm text-muted-foreground"},ZC={class:"flex flex-wrap items-center justify-between gap-3"},e_={class:"flex items-center gap-2"},t_={class:"text-xs text-muted-foreground"},xd=n.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiMethod:{}},setup(e){const o=Fe.useBreakpoints(Fe.breakpointsTailwind).smaller("md");n.ref(!1);const a=e,r=n.ref(!1),s=n.ref(null),i=n.ref([]),l=n.computed(()=>i.value.length>0?i.value:a.items&&a.items.length>0?a.items:[]),c=async()=>{if(a.apiUrl){r.value=!0,s.value=null;try{const f=await fetch(a.apiUrl,{method:a.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{r.value=!1}}};n.onMounted(()=>{a.apiUrl&&c()}),n.watch(()=>a.apiUrl,()=>{a.apiUrl?c():i.value=[]});const d=f=>{switch(f){case"flight":return{Icon:te.PlaneIcon,Circle:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:te.ClockIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:te.ShoppingCartIcon,Circle:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:te.PencilIcon,Circle:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:te.ServerIcon,Circle:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:te.MapPinIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};default:return{Icon:te.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=n.resolveComponent("ShoppingCart"),p=n.resolveComponent("RefreshCcw"),b=n.resolveComponent("MapPin");return n.openBlock(),n.createElementBlock("div",W1,[h[8]||(h[8]=n.createElementVNode("div",{class:"flex flex-col space-y-1.5 py-6 px-3"},[n.createElementVNode("h3",{class:"leading-none tracking-tight text-lg font-medium"},"Timeline With Icons")],-1)),n.createElementVNode("div",j1,[r.value?(n.openBlock(),n.createElementBlock("div",U1,[...h[0]||(h[0]=[n.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):s.value?(n.openBlock(),n.createElementBlock("div",H1,n.toDisplayString(s.value),1)):(n.openBlock(),n.createElementBlock("div",q1,[h[7]||(h[7]=n.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),n.createElementVNode("div",G1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,(g,x)=>(n.openBlock(),n.createElementBlock("div",{key:x,class:"relative pl-14"},[n.createElementVNode("div",{class:n.normalizeClass(["absolute left-0 top-2 flex h-8 w-8 items-center justify-center rounded-full border",d(g.type).Circle])},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(d(g.type).Icon),{class:"h-4 w-4"}))],2),n.createElementVNode("div",X1,[n.createElementVNode("div",Y1,[g.type==="flight"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("div",K1,[n.createElementVNode("p",J1,n.toDisplayString(g.title),1),n.createElementVNode("p",Q1,n.toDisplayString(g.meta),1)]),n.createElementVNode("p",Z1,[n.createElementVNode("span",eC,n.toDisplayString(g.from),1),n.createVNode(n.unref(te.ArrowRight),{class:"mx-2 inline h-4 w-4"}),n.createElementVNode("span",tC,n.toDisplayString(g.to),1)]),n.createElementVNode("p",nC,n.toDisplayString(g.time),1),g.fileName?(n.openBlock(),n.createElementBlock("div",oC,[n.createVNode(n.unref(te.FileText),{class:"h-4 w-4 text-muted-foreground"}),n.createElementVNode("span",null,n.toDisplayString(g.fileName),1)])):n.createCommentVNode("",!0)],64)):g.type==="interview"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("div",aC,[n.createElementVNode("p",rC,n.toDisplayString(g.title),1),n.createElementVNode("p",sC,n.toDisplayString(g.meta),1)]),n.createElementVNode("p",iC,n.toDisplayString(g.desc),1),n.createVNode(n.unref(Ta),{class:"my-4"}),n.createElementVNode("div",lC,[n.createElementVNode("div",cC,[n.createVNode(n.unref(gd),{class:"h-10 w-10"},{default:n.withCtx(()=>[g.avatarUrl?(n.openBlock(),n.createBlock(n.unref(yd),{key:0,src:g.avatarUrl},null,8,["src"])):n.createCommentVNode("",!0),n.createVNode(n.unref(bd),null,{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(u(g.personName??"")),1)]),_:2},1024)]),_:2},1024),n.createElementVNode("div",dC,[n.createElementVNode("p",uC,n.toDisplayString(g.personName),1),n.createElementVNode("p",fC,n.toDisplayString(g.personRole),1)])]),n.createElementVNode("div",hC,[n.createVNode(n.unref(ut),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(te.MessageSquare),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(ut),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(te.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):g.type==="product"?(n.openBlock(),n.createElementBlock("div",mC,[n.createElementVNode("div",pC,[g.imgUrl?(n.openBlock(),n.createElementBlock("img",{key:0,src:g.imgUrl,class:"h-full w-full rounded-lg object-cover",alt:"product"},null,8,gC)):(n.openBlock(),n.createBlock(m,{key:1,class:"h-5 w-5 text-muted-foreground"}))]),n.createElementVNode("div",bC,[n.createElementVNode("div",yC,[n.createElementVNode("p",xC,n.toDisplayString(g.title),1),n.createElementVNode("p",kC,n.toDisplayString(g.meta),1)]),n.createElementVNode("p",wC,n.toDisplayString(g.desc),1),n.createElementVNode("div",{class:n.normalizeClass(["mt-4 grid gap-3",n.unref(o)?"grid-cols-1":"grid-cols-3"])},[n.createElementVNode("div",CC,[h[1]||(h[1]=n.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),n.createElementVNode("p",_C,n.toDisplayString(g.customer),1)]),n.createElementVNode("div",BC,[h[2]||(h[2]=n.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),n.createElementVNode("p",EC,n.toDisplayString(g.price),1)]),n.createElementVNode("div",SC,[h[3]||(h[3]=n.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),n.createElementVNode("p",AC,n.toDisplayString(g.qty),1)])],2)])])):g.type==="design"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createElementVNode("div",VC,[n.createElementVNode("p",DC,n.toDisplayString(g.title),1),n.createElementVNode("p",MC,n.toDisplayString(g.meta),1)]),n.createElementVNode("p",NC,n.toDisplayString(g.desc),1),n.createElementVNode("div",PC,[n.createVNode(n.unref(gd),{class:"h-10 w-10"},{default:n.withCtx(()=>[g.avatarUrl?(n.openBlock(),n.createBlock(n.unref(yd),{key:0,src:g.avatarUrl},null,8,["src"])):n.createCommentVNode("",!0),n.createVNode(n.unref(bd),null,{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(u(g.personName??"")),1)]),_:2},1024)]),_:2},1024),n.createElementVNode("p",vC,n.toDisplayString(g.personName),1)])],64)):g.type==="server"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:4},[n.createElementVNode("div",TC,[n.createElementVNode("p",OC,n.toDisplayString(g.title),1),n.createVNode(n.unref(Wn),{variant:"destructive",class:"h-6"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(g.chipText??""),1)]),_:2},1024)]),n.createElementVNode("div",zC,[n.createElementVNode("div",FC,[n.createElementVNode("div",IC,[n.createVNode(n.unref(te.Globe),{class:"h-4 w-4"}),h[4]||(h[4]=n.createElementVNode("span",null,"IP Address",-1))]),n.createElementVNode("span",RC,n.toDisplayString(g.ip),1)]),n.createElementVNode("div",LC,[n.createElementVNode("div",$C,[n.createVNode(n.unref(te.Cpu),{class:"h-4 w-4"}),h[5]||(h[5]=n.createElementVNode("span",null,"CPU",-1))]),n.createElementVNode("span",WC,n.toDisplayString(g.cpu),1)]),n.createElementVNode("div",jC,[n.createElementVNode("div",UC,[n.createVNode(n.unref(te.CpuIcon),{class:"h-4 w-4"}),h[6]||(h[6]=n.createElementVNode("span",null,"Memory",-1))]),n.createElementVNode("span",HC,n.toDisplayString(g.memory),1)])]),n.createVNode(n.unref(Ta),{class:"my-4"}),n.createElementVNode("div",qC,[n.createElementVNode("div",GC,[n.createVNode(n.unref(ut),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(te.Share2),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(ut),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(p,{class:"h-4 w-4"})]),_:1})])])],64)):g.type==="location"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:5},[n.createElementVNode("div",XC,[n.createElementVNode("div",YC,[n.createVNode(b,{class:"h-4 w-4 text-muted-foreground"}),n.createElementVNode("p",KC,n.toDisplayString(g.title),1)]),n.createVNode(n.unref(Wn),{variant:"destructive",class:"h-6"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(g.chipText),1)]),_:2},1024)]),n.createElementVNode("p",JC,n.toDisplayString(g.desc1),1),g.desc2?(n.openBlock(),n.createElementBlock("p",QC,n.toDisplayString(g.desc2),1)):n.createCommentVNode("",!0),n.createVNode(n.unref(Ta),{class:"my-4"}),n.createElementVNode("div",ZC,[n.createElementVNode("div",e_,[n.createVNode(n.unref(ut),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(te.Link),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(ut),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(te.MessageSquare),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(ut),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(te.User),{class:"h-4 w-4"})]),_:1})]),n.createElementVNode("p",t_,"Due date: "+n.toDisplayString(g.due),1)])],64)):n.createCommentVNode("",!0)])])]))),128))])]))])])}}}),n_={class:"dcode-upload-file"},o_={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"},a_={key:0,class:"text-xs text-gray-500 mt-1"},r_=["accept"],s_={key:1,class:"text-xs text-red-600 mt-1"},kd=n.defineComponent({name:"DCodeUploadFile",__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const o=t,a=r=>{var i;const s=(i=r.target.files)==null?void 0:i[0];s&&o("update:modelValue",s)};return(r,s)=>(n.openBlock(),n.createElementBlock("div",n_,[e.label?(n.openBlock(),n.createBlock(jn,{key:0,label:e.label},null,8,["label"])):n.createCommentVNode("",!0),n.createElementVNode("div",o_,[n.createVNode(n.unref(te.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=n.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[n.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),n.createTextVNode(" or drag and drop ")],-1)),e.accept?(n.openBlock(),n.createElementBlock("p",a_,n.toDisplayString(e.accept),1)):n.createCommentVNode("",!0),n.createElementVNode("input",{type:"file",class:"hidden",onChange:a,accept:e.accept},null,40,r_)]),e.errorMessage?(n.openBlock(),n.createElementBlock("p",s_,n.toDisplayString(e.errorMessage),1)):n.createCommentVNode("",!0)]))}}),i_=["onClick"],l_={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},c_={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},d_={key:1},u_={key:0,class:"text-white"},f_={key:1},h_={key:2},m_=["disabled","onClick"],p_={key:1,class:"mr-2 text-sm font-bold opacity-70"},g_={class:"whitespace-normal text-sm text-center leading-tight"},b_={class:"flex flex-col flex-1 min-w-0"},y_={class:"text-sm text-muted-foreground"},x_={class:"px-1"},k_=["disabled"],w_=["type"],C_=["disabled"],ks=xt(n.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(e,{emit:t}){const o=e,a=t,r=Je(),s=r==null?void 0:r.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const i=n.ref(o.defaultTab),l=n.computed({get(){var k;if(typeof o.modelValue=="string"){const y=(k=o.tabs)==null?void 0:k.findIndex(A=>A.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 A=(y=o.tabs)==null?void 0:y[k];A?a("update:modelValue",A.key):a("update:modelValue",k)}else a("update:modelValue",k)}}),c=n.computed(()=>{var k;return((k=o.tabs)==null?void 0:k.length)??0}),d=n.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 f(k){return k?typeof k=="string"?Ct[k]||null:k:null}const h=n.reactive({});function m(k){return h[k.key]||(h[k.key]={loaded:!1,loading:!1,data:null,error:null}),h[k.key]}function p(){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 g(k){if(o.isWizard||!o.allowTabClick||o.disabled)return!1;const y=o.tabs[k];return!(!y||y.disabled)}async function x(k){if(typeof k.tab.fetchData=="function"){const T=await k.tab.fetchData(),U=(T==null?void 0:T.data)??T;return(U==null?void 0:U.data)??U}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=p();let N;if(y.apiUrl)N=await s("","",D,{_url:y.apiUrl,_method:y.apiMethod,_data:y.apiParams??void 0});else{const T={...D,...y.apiParams};N=await s(y.apiModule,y.apiAction,T)}const V=(N==null?void 0:N.data)??N;return(V==null?void 0:V.data)??V}async function _(k,{force:y=!1}={}){const A=u(k),D=o.tabs[A];if(!D)return;const N=m(D);if(!(o.cache&&N.loaded&&!y)&&!N.loading){N.loading=!0,N.error=null;try{const V=await x({tabIndex:A,tab:D});N.data=V,N.loaded=!0,a("loaded",{tabIndex:A,tab:D,data:V})}catch(V){const M=typeof(V==null?void 0:V.message)=="string"&&V.message||typeof V=="string"&&V||"Failed to load tab data.";N.error=M,a("error",{tabIndex:A,tab:D,message:M})}finally{N.loading=!1}}}function C(k){const y=u(k);g(y)&&y!==l.value&&(l.value=y)}function w(k=l.value){return _(k,{force:!0})}function E(){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 n.watch(()=>o.tabs,k=>{for(const y of k??[])m(y)},{immediate:!0}),n.watch(()=>l.value,async k=>{var A;const y=(A=o.tabs)==null?void 0:A[k];y&&a("change",{tabIndex:k,tab:y}),await _(k)},{immediate:!0}),n.watch(()=>o.autoFetchOnMount,async k=>{k&&await _(l.value)},{immediate:!0}),(k,y)=>{var A,D,N;return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["w-full rounded-lg border bg-card text-card-foreground shadow-sm",{"flex flex-row":e.isVertical}])},[n.createElementVNode("div",{class:n.normalizeClass(["flex flex-col space-y-1.5 p-6",{"w-64 border-r pr-0":e.isVertical,"pb-2":e.isWizard&&!e.isVertical}])},[n.createElementVNode("div",{class:n.normalizeClass({"mt-4":!e.isVertical||e.isWizard})},[e.isWizard?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["w-full relative flex overflow-visible rounded-lg",e.isVertical?"flex-col gap-2":""])},[e.isVertical?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(e.tabs,(V,M)=>(n.openBlock(),n.createElementBlock("div",{key:V.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[n.createElementVNode("div",{class:n.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-card",[M<l.value?"wizard-num-done":"",M===l.value?"wizard-num-active":M>l.value?"wizard-num-pending":""]])},[e.typeWizard==="icon"&&V.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(f(V.icon)),{key:0,class:"w-4 h-4"})):e.typeWizard==="number"||!V.icon&&e.typeWizard!=="none"?(n.openBlock(),n.createElementBlock("span",d_,[M<l.value?(n.openBlock(),n.createElementBlock("span",u_,"✓")):(n.openBlock(),n.createElementBlock("span",f_,n.toDisplayString(M+1),1))])):(n.openBlock(),n.createElementBlock("span",h_))],2),n.createElementVNode("span",{class:n.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",M===l.value?"wizard-text-active":"wizard-text-pending"])},n.toDisplayString(V.title),3)]))),128)):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(e.tabs,(V,M)=>(n.openBlock(),n.createElementBlock("div",{key:V.key,onClick:T=>C(M),style:n.normalizeStyle({zIndex:e.tabs.length-M}),class:"relative flex-1 group"},[n.createElementVNode("div",{class:n.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[M>0?"pl-8":"",M===l.value?"wizard-step-active":M<l.value?"wizard-step-done":"wizard-step-pending"]])},[e.typeWizard==="icon"&&V.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(f(V.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):e.typeWizard==="number"?(n.openBlock(),n.createElementBlock("span",l_,n.toDisplayString(M+1),1)):n.createCommentVNode("",!0),n.createElementVNode("span",c_,n.toDisplayString(V.title),1)],2),M<e.tabs.length-1?(n.openBlock(),n.createElementBlock("svg",{key:0,class:n.normalizeClass(["absolute top-0 -right-[15.5px] w-[16px] h-full transition-colors block z-10",[M===l.value?"wizard-svg-active":M<l.value?"wizard-svg-done":"wizard-svg-pending"]]),preserveAspectRatio:"none",viewBox:"0 0 16 48"},[...y[0]||(y[0]=[n.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):n.createCommentVNode("",!0)],12,i_))),128))],2)):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["flex w-full",e.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.tabs,(V,M)=>(n.openBlock(),n.createElementBlock("button",{key:V.key,type:"button",disabled:!g(M),onClick:T=>C(M),class:n.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",n.unref(_e)("border-b border-r",!e.isVertical&&M===e.tabs.length-1&&"border-r-0",M===l.value?"wizard-btn-active":"wizard-btn-pending",!g(M)&&"opacity-60 cursor-not-allowed",e.isVertical?"w-full justify-start border-r-0":"flex-1")])},[e.typeWizard==="icon"&&V.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(f(V.icon)),{key:0,class:"h-4 w-4 shrink-0"})):e.typeWizard==="number"?(n.openBlock(),n.createElementBlock("span",p_,n.toDisplayString(M+1),1)):n.createCommentVNode("",!0),n.createElementVNode("span",g_,n.toDisplayString(V.title),1)],10,m_))),128))],2))],2)],2),e.isVertical?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(Ta),{key:0})),n.createElementVNode("div",b_,[n.createElementVNode("div",{class:n.normalizeClass(["p-6 flex-1 min-w-0",{"pl-6":e.isVertical}])},[d.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[(A=h[d.value.key])!=null&&A.loading?n.renderSlot(k.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[y[1]||(y[1]=n.createElementVNode("div",{class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground"},"Loading...",-1))],!0):n.renderSlot(k.$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:w},()=>[n.createElementVNode("div",y_,[y[2]||(y[2]=n.createTextVNode(" Slot ",-1)),n.createElementVNode("code",x_,"tab-"+n.toDisplayString(d.value.key),1),y[3]||(y[3]=n.createTextVNode(" belum dibuat. ",-1))])],!0)],64)):n.createCommentVNode("",!0)],2),e.isWizard||e.showNavigation?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["flex items-center justify-between p-6 pt-0",{"pl-6":e.isVertical}])},[n.createElementVNode("button",{type:"button",onClick:E,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,k_),l.value<c.value-1?(n.openBlock(),n.createElementBlock("button",{key:0,type:e.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,w_)):(n.openBlock(),n.createElementBlock("button",{key:1,type:"submit",disabled:e.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"},[e.loading?(n.openBlock(),n.createBlock(n.unref(te.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(e.submitText),1)],8,C_))],2)):n.createCommentVNode("",!0)])],2)}}}),[["__scopeId","data-v-9379f062"]]),__={class:"permission-menu w-full space-y-4"},B_={class:"bg-white dark:bg-zinc-900 text-neutral-700 dark:text-neutral-100 p-4"},E_={class:"flex items-center justify-between"},S_={class:"flex items-center gap-3 flex-1"},A_=["onClick"],V_={key:1,class:"w-7"},D_={key:2,class:"flex-shrink-0"},M_={class:"text-lg font-semibold flex-1"},N_={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},P_={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},v_={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-2"},T_=["checked","disabled","onChange"],O_={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},z_={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},F_={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},I_={class:"bg-blue-500 dark:bg-primary-900 text-white p-3"},R_={class:"flex items-center justify-between"},L_={class:"flex items-center gap-3 flex-1"},$_={key:0,class:"flex-shrink-0"},W_={class:"text-base font-semibold flex-1"},j_={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},U_={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},H_=["checked","onChange"],q_={class:"text-xs font-medium"},G_={key:0,class:"p-3"},X_={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-2"},Y_=["checked","disabled","onChange"],K_={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},ws=xt(n.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(e,{expose:t,emit:o}){const{t:a}=Ht.useI18n(),r=e,s=o,i=n.computed(()=>r.menuList&&r.menuList.length>0?r.menuList:r.treeData||[]),l=n.ref(new Map),c=n.ref(new Set),d=(D=!0)=>{(V=>{V.forEach(M=>{M.permission.forEach(T=>{const U=`${M.id}-${T.id}-parent`,L=T.code==="VIEW"||T.name.toUpperCase()==="VIEW";l.value.has(U)||l.value.set(U,L||(D?M.checked??!1:!1))}),M.detail&&M.detail.length>0&&M.detail.forEach(T=>{T.permission.forEach(U=>{const L=`${T.id}-${U.id}-child`,R=U.code==="VIEW"||U.name.toUpperCase()==="VIEW";l.value.has(L)||l.value.set(L,R||(D?T.checked??!1:!1))})})})})(i.value)},u=()=>{console.log("[DCodePermissionMenu] initializeFromModelValue called. modelValue:",r.modelValue),l.value.clear(),d(!1),r.modelValue&&r.modelValue.length>0&&r.modelValue.forEach(D=>{const N=D.menuId,V=D.actionsIds;i.value.forEach(M=>{M.id===N&&V.forEach(T=>{const U=`${N}-${T}-parent`;l.value.set(U,!0)}),M.detail&&M.detail.length>0&&M.detail.forEach(T=>{T.id===N&&V.forEach(U=>{const L=`${N}-${U}-child`;l.value.set(L,!0)})})})})};u(),n.watch(()=>r.modelValue,()=>{u()},{deep:!0}),n.watch(()=>i.value.length,(D,N)=>{N===0&&D>0&&u()});const f=D=>D.detail&&D.detail.length>0,h=D=>{c.value.has(D)?c.value.delete(D):c.value.add(D)},m=D=>c.value.has(D),p=(D,N,V=!1)=>{const M=`${D}-${N}-${V?"child":"parent"}`;return l.value.get(M)??!1},b=()=>{const D=B();s("update:modelValue",D.permissions)},g=(D,N,V,M=!1)=>{const T=V.target.checked,U=`${D}-${N}-${M?"child":"parent"}`;l.value.set(U,T),s("permission-change",D,N,T,!M),b()},x=D=>D.permission.filter(_),_=D=>D.code==="VIEW"||D.name.toUpperCase()==="VIEW",C=(D,N,V)=>{const M=V.target.checked;N.permission.forEach(T=>{if(_(T)){const L=`${N.id}-${T.id}-child`;l.value.set(L,!0);return}const U=`${N.id}-${T.id}-child`;l.value.set(U,M)}),l.value=new Map(l.value),s("menu-check",N.id,M),b()},w=(D,N=!1)=>{const V=N?D.permission:x(D);return!V||V.length===0?!1:V.every(M=>{const T=`${D.id}-${M.id}-${N?"child":"parent"}`;return l.value.get(T)??!1})},E=()=>{const D={};return i.value.forEach(N=>{var V;D[N.id]={name:N.name,parentPermissions:N.permission.map(M=>({id:M.id,name:M.name,checked:p(N.id,M.id,!1)})),children:((V=N.detail)==null?void 0:V.map(M=>({id:M.id,name:M.name,permissions:M.permission.map(T=>({id:T.id,name:T.name,checked:p(M.id,T.id,!0)}))})))||[]}}),D},B=()=>{const D=[],N=(V,M=!1)=>{const T=[];V.permission.forEach(U=>{const L=`${V.id}-${U.id}-${M?"child":"parent"}`;(l.value.get(L)??!1)&&T.push(U.id)}),T.length>0&&D.push({menuId:V.id,actionsIds:T})};return i.value.forEach(V=>{N(V,!1),V.detail&&V.detail.length>0&&V.detail.forEach(M=>{N(M,!0)})}),{permissions:D}};return t({getCurrentStates:E,getPermissionsForDatabase:B,getAllPermissionsWithStatus:()=>{const D=[],N=(V,M=!1)=>{const T=V.permission.map(L=>{const R=`${V.id}-${L.id}-${M?"child":"parent"}`,P=l.value.get(R)??!1;return{id:L.id,name:L.name,checked:P}}),U=T.filter(L=>L.checked).map(L=>L.id);D.push({menuId:V.id,menuName:V.name,actionsIds:U,actions:T})};return i.value.forEach(V=>{N(V,!1),V.detail&&V.detail.length>0&&V.detail.forEach(M=>{N(M,!0)})}),{permissions:D}},permissionStates:l,expandAll:()=>{i.value.forEach(D=>{f(D)&&c.value.add(D.id)})},collapseAll:()=>{c.value.clear()}}),(D,N)=>(n.openBlock(),n.createElementBlock("div",__,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,V=>(n.openBlock(),n.createElementBlock("div",{key:V.id,class:n.normalizeClass(["dcode-card overflow-hidden",{"border-l-4 border-l-blue-500":f(V)}])},[n.createElementVNode("div",B_,[n.createElementVNode("div",E_,[n.createElementVNode("div",S_,[f(V)?(n.openBlock(),n.createElementBlock("button",{key:0,onClick:M=>h(V.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[m(V.id)?(n.openBlock(),n.createBlock(n.unref(te.ChevronDown),{key:0,class:"w-5 h-5"})):(n.openBlock(),n.createBlock(n.unref(te.ChevronRight),{key:1,class:"w-5 h-5"}))],8,A_)):(n.openBlock(),n.createElementBlock("div",V_)),e.showIcons&&V.icon?(n.openBlock(),n.createElementBlock("span",D_,[n.createElementVNode("i",{class:n.normalizeClass([V.icon,"text-2xl"])},null,2)])):n.createCommentVNode("",!0),n.createElementVNode("h3",M_,n.toDisplayString(V.name),1)])])]),V.permission&&V.permission.length>0&&!f(V)?(n.openBlock(),n.createElementBlock("div",N_,[n.createElementVNode("h4",P_,n.toDisplayString(n.unref(a)("common.permissions"))+": ",1),n.createElementVNode("div",v_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(x(V),M=>(n.openBlock(),n.createElementBlock("label",{key:M.id,class:"flex items-center gap-2 px-3 py-2 bg-white dark:bg-zinc-900 border border-gray-200 dark:border-neutral-700 rounded-lg cursor-pointer hover:border-blue-400 dark:hover:border-primary-500 hover:bg-blue-50 dark:hover:bg-zinc-800 transition-all group"},[n.createElementVNode("input",{type:"checkbox",checked:_(M)||p(V.id,M.id,!1),disabled:_(M),onChange:T=>g(V.id,M.id,T,!1),class:n.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",_(M)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,T_),n.createElementVNode("span",O_,n.toDisplayString(M.name),1)]))),128))])])):n.createCommentVNode("",!0),n.createVNode(n.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:n.withCtx(()=>[f(V)&&m(V.id)?(n.openBlock(),n.createElementBlock("div",z_,[n.createElementVNode("h4",F_,[N[0]||(N[0]=n.createElementVNode("span",{class:"w-1 h-4 bg-blue-500 rounded"},null,-1)),n.createTextVNode(" "+n.toDisplayString(n.unref(a)("common.subMenus")),1)]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(V.detail,M=>(n.openBlock(),n.createElementBlock("div",{key:M.id,class:"bg-white dark:bg-zinc-900 rounded-lg border border-gray-200 dark:border-neutral-700 overflow-hidden shadow-sm hover:shadow transition-shadow"},[n.createElementVNode("div",I_,[n.createElementVNode("div",R_,[n.createElementVNode("div",L_,[e.showIcons&&M.icon?(n.openBlock(),n.createElementBlock("span",$_,[n.createElementVNode("i",{class:n.normalizeClass([M.icon,"text-xl"])},null,2)])):n.createCommentVNode("",!0),n.createElementVNode("h5",W_,n.toDisplayString(M.name),1),M.path?(n.openBlock(),n.createElementBlock("span",j_,n.toDisplayString(M.path),1)):n.createCommentVNode("",!0),n.createElementVNode("label",U_,[n.createElementVNode("input",{type:"checkbox",checked:w(M,!0),onChange:T=>C(V,M,T),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,H_),n.createElementVNode("span",q_,n.toDisplayString(n.unref(a)("common.selectAll")),1)])])])]),M.permission&&M.permission.length>0?(n.openBlock(),n.createElementBlock("div",G_,[n.createElementVNode("div",X_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(M.permission,T=>(n.openBlock(),n.createElementBlock("label",{key:T.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"},[n.createElementVNode("input",{type:"checkbox",checked:_(T)||p(M.id,T.id,!0),disabled:_(T),onChange:U=>g(M.id,T.id,U,!0),class:n.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",_(T)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,Y_),n.createElementVNode("span",K_,n.toDisplayString(T.name),1)]))),128))])])):n.createCommentVNode("",!0)]))),128))])):n.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-e3cc2273"]]),J_={class:"space-y-4"},Q_={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},Z_={key:0,class:"text-danger-500"},eB={key:1,class:"flex items-center justify-center p-8 bg-white dark:bg-gray-800 rounded-lg shadow"},tB={class:"text-neutral-600 dark:text-neutral-400"},nB={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},oB={class:"text-neutral-500 dark:text-neutral-400"},aB={key:3,class:"space-y-3"},rB={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},sB={class:"flex items-center gap-3"},iB={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},lB={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},cB={class:"flex items-center gap-2 text-sm font-medium"},dB={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},uB={class:"p-4"},fB={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},hB={class:"ml-2 flex-1 min-w-0"},mB=["for"],pB={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},gB={key:4,class:"mt-1 text-xs text-danger-600"},Cs=n.defineComponent({__name:"DCodeTreePermissions",props:{modelValue:{},label:{},required:{type:Boolean},disabled:{type:Boolean},error:{},treeData:{}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,a=t,{t:r}=Ht.useI18n(),s=n.ref(!0),i=n.ref([]),l=n.ref({}),c=n.ref([]),d=n.ref({}),u=x=>{if(console.log(x),!x)return[];if(Array.isArray(x)&&x.length>0&&x[0].module&&Array.isArray(x[0].permissions))return x.map(_=>({menuId:_.menuId,module:_.module,label:_.label||_.module,permissions:_.permissions}));if(Array.isArray(x)&&x.length>0&&x[0].key){const _={};return x.forEach(C=>{const w=C.key,E=w&&w.includes(".")?w.split(".")[0]:"other";_[E]||(_[E]={menuId:0,module:E,label:E,permissions:[]}),_[E].permissions.push({id:C.id,key:C.key,label:C.label,description:C.description})}),Object.values(_)}if(Array.isArray(x)&&x.length>0&&x[0].id&&x[0].name&&Array.isArray(x[0].permission)){const _=[],C=(w,E="")=>{const B=E?`${E}.${w.name}`:w.name,k=B.toLowerCase().replace(/\s+/g,"_"),y=[];if(w.detail&&Array.isArray(w.detail)&&w.detail.forEach(A=>{y.push(A.id)}),w.permission&&w.permission.length>0){const A=w.permission.map(D=>({id:D.id,key:`${k}.${D.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${D.name} ${w.name}`,description:`Permission to ${D.name.toLowerCase()} ${w.name.toLowerCase()}`}));_.push({menuId:w.id,module:k,label:w.name,permissions:A,subMenuIds:y.length>0?y:void 0})}w.detail&&Array.isArray(w.detail)&&w.detail.forEach(A=>{C(A,B)})};return x.forEach(w=>C(w)),_}return x.data?u(x.data):[]},f=async()=>{s.value=!0;try{let x;o.treeData&&o.treeData.length>0?x=o.treeData:x=[];const _=u(x);i.value=_;const C={},w=[],E={};_.forEach(k=>{k.permissions.forEach(y=>{const A=typeof y.id=="string"?parseInt(y.id):y.id;E[A]=k.menuId})});const B=new Set;o.modelValue&&Array.isArray(o.modelValue)&&o.modelValue.forEach(k=>{w.push(k.menuId),k.actionsIds&&Array.isArray(k.actionsIds)&&k.actionsIds.forEach(y=>B.add(y))}),_.forEach(k=>k.permissions.forEach(y=>{const A=typeof y.id=="string"?parseInt(y.id):y.id;C[A]=B.has(A)})),l.value=C,c.value=w,d.value=E}catch{i.value=[]}finally{s.value=!1}},h=x=>x.permissions.filter(_=>{const C=typeof _.id=="string"?parseInt(_.id):_.id;return l.value[C]}).length,m=x=>x.permissions.every(_=>{const C=typeof _.id=="string"?parseInt(_.id):_.id;return l.value[C]}),p=x=>{const _=h(x);return _>0&&_<x.permissions.length},b=n.ref(!1),g=(x,_)=>{b.value=!0,x.permissions.map(E=>typeof E.id=="string"?parseInt(E.id):E.id),x.permissions.forEach(E=>{const B=typeof E.id=="string"?parseInt(E.id):E.id;l.value[B]=_});let C=o.modelValue?[...o.modelValue]:[],w=[x.menuId];x.subMenuIds&&x.subMenuIds.length>0&&(w=[...w,...x.subMenuIds],x.subMenuIds.forEach(E=>{const B=i.value.find(k=>k.menuId===E);B&&B.permissions.forEach(k=>{const y=typeof k.id=="string"?parseInt(k.id):k.id;l.value[y]=_})})),_?w.forEach(E=>{const B=i.value.find(k=>k.menuId===E);if(B){const k=B.permissions.map(A=>typeof A.id=="string"?parseInt(A.id):A.id),y=C.findIndex(A=>A.menuId===E);y!==-1?C[y]={menuId:E,actionsIds:k}:C.push({menuId:E,actionsIds:k})}}):C=C.filter(E=>!w.includes(E.menuId)),c.value=C.map(E=>E.menuId),console.log("Full Result:",JSON.stringify(C,null,2)),a("update:modelValue",C),setTimeout(()=>{b.value=!1},100)};return n.watch(()=>o.modelValue,x=>{if(!x)return;const _=new Set,C=[];x.forEach(w=>{C.push(w.menuId),w.actionsIds&&Array.isArray(w.actionsIds)&&w.actionsIds.forEach(E=>_.add(E))}),Object.keys(l.value).forEach(w=>{const E=parseInt(w);l.value[E]=_.has(E)}),c.value=C}),n.watch(()=>o.treeData,x=>{x&&x.length>0&&f()},{deep:!0}),n.watch(l,(x,_)=>{if(b.value)return;if(Object.keys(x).map(w=>parseInt(w)).filter(w=>x[w]!==(_==null?void 0:_[w])).length>0){let w=o.modelValue?[...o.modelValue]:[];const E={};Object.keys(x).forEach(B=>{const k=parseInt(B);if(x[k]){const y=d.value[k];console.log(`Permission ${k} belongs to Menu ${y}`),y!==void 0&&(E[y]||(E[y]=[]),E[y].push(k))}}),Object.keys(E).forEach(B=>{const k=parseInt(B),y=E[k],A=w.findIndex(D=>D.menuId===k);A!==-1?w[A]={menuId:k,actionsIds:y}:w.push({menuId:k,actionsIds:y})}),w=w.filter(B=>E[B.menuId]&&E[B.menuId].length>0),c.value=w.map(B=>B.menuId),console.log("Result:",JSON.stringify(w,null,2)),a("update:modelValue",w)}},{deep:!0}),n.onMounted(f),(x,_)=>(n.openBlock(),n.createElementBlock("div",J_,[e.label?(n.openBlock(),n.createElementBlock("label",Q_,[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",Z_,"*")):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),s.value?(n.openBlock(),n.createElementBlock("div",eB,[n.createVNode(n.unref(te.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),n.createElementVNode("span",tB,n.toDisplayString(n.unref(r)("common.loadingPermissions")),1)])):i.value.length===0?(n.openBlock(),n.createElementBlock("div",nB,[n.createElementVNode("p",oB,n.toDisplayString(n.unref(r)("common.noPermissions")),1)])):(n.openBlock(),n.createElementBlock("div",aB,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,C=>(n.openBlock(),n.createElementBlock("div",{key:C.module,class:"bg-white dark:bg-neutral-900 rounded-lg border border-neutral-200 dark:border-neutral-700 shadow-sm hover:shadow-md transition-shadow"},[n.createElementVNode("div",rB,[n.createElementVNode("div",sB,[n.createVNode(on,{modelValue:m(C),indeterminate:p(C),"onUpdate:modelValue":w=>g(C,!!w),disabled:e.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),n.createElementVNode("div",null,[n.createElementVNode("div",iB,n.toDisplayString(C.label||C.module),1),n.createElementVNode("div",lB,n.toDisplayString(h(C))+" "+n.toDisplayString(n.unref(r)("common.from"))+" "+n.toDisplayString(C.permissions.length)+" "+n.toDisplayString(n.unref(r)("common.selected")),1)])]),n.createElementVNode("div",cB,[n.createElementVNode("div",dB,n.toDisplayString(h(C))+"/"+n.toDisplayString(C.permissions.length),1)])]),n.createElementVNode("div",uB,[n.createElementVNode("div",fB,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(C.permissions,w=>(n.openBlock(),n.createElementBlock("div",{key:w.id,class:"flex items-start p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"},[n.createVNode(on,{modelValue:l.value[typeof w.id=="string"?parseInt(w.id):w.id],"onUpdate:modelValue":E=>l.value[typeof w.id=="string"?parseInt(w.id):w.id]=E,disabled:e.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),n.createElementVNode("div",hB,[n.createElementVNode("label",{for:`perm-${w.id}`,class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer block"},n.toDisplayString(w.label||w.key),9,mB),w.description?(n.openBlock(),n.createElementBlock("p",pB,n.toDisplayString(w.description),1)):n.createCommentVNode("",!0)])]))),128))])])]))),128))])),e.error?(n.openBlock(),n.createElementBlock("p",gB,n.toDisplayString(e.error),1)):n.createCommentVNode("",!0)]))}}),bB=(e,t="short",o="id-ID")=>{const a=typeof e=="string"?new Date(e):e,r=c=>String(c).padStart(2,"0"),s=c=>`${r(c.getHours())}:${r(c.getMinutes())}:${r(c.getSeconds())}`,l={id:"id-ID",en:"en-GB"}[o]||o;return t==="time"?s(a):t==="datetime"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(a):t==="long"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(a):new Intl.DateTimeFormat(l,{day:"2-digit",month:"short",year:"numeric"}).format(a)},yB=e=>new Promise((t,o)=>{const a=document.createElement("textarea");a.value=e,a.style.top="0",a.style.left="0",a.style.position="fixed",document.body.appendChild(a),a.focus(),a.select();try{document.execCommand("copy")?t():o(new Error("Copy command was unsuccessful"))}catch(r){o(r)}finally{document.body.removeChild(a)}}),xB=async e=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(e):yB(e),kB=n.defineComponent({__name:"Sheet",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const o=e,a=t,r=ce.useForwardPropsEmits(o,a);return(s,i)=>(n.openBlock(),n.createBlock(n.unref(ce.DialogRoot),n.normalizeProps(n.guardReactiveProps(n.unref(r))),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16))}}),wB=n.defineComponent({inheritAttrs:!1,__name:"SheetContent",props:{class:{type:[Boolean,null,String,Object,Array]},side:{},forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const o=e,a=t,r=Fe.reactiveOmit(o,"class","side"),s=ce.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(ce.DialogPortal),null,{default:n.withCtx(()=>[n.createVNode(n.unref(ce.DialogOverlay),{class:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),n.createVNode(n.unref(ce.DialogContent),n.mergeProps({class:n.unref(_e)(n.unref(AB)({side:e.side}),o.class)},{...n.unref(s),...i.$attrs}),{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default"),n.createVNode(n.unref(ce.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-secondary"},{default:n.withCtx(()=>[n.createVNode(n.unref(te.X),{class:"w-4 h-4"})]),_:1})]),_:3},16,["class"])]),_:3}))}}),CB=n.defineComponent({__name:"SheetDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ce.DialogDescription),n.mergeProps({class:n.unref(_e)("text-sm text-muted-foreground",t.class)},n.unref(o)),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),_B=n.defineComponent({__name:"SheetFooter",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(_e)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),BB=n.defineComponent({__name:"SheetHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(_e)("flex flex-col gap-y-2 text-center sm:text-left",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),EB=n.defineComponent({__name:"SheetTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ce.DialogTitle),n.mergeProps({class:n.unref(_e)("text-lg font-medium text-foreground",t.class)},n.unref(o)),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),SB=n.defineComponent({__name:"SheetTrigger",props:{asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ce.DialogTrigger),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),AB=to("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),VB={class:"flex-1 overflow-hidden"},DB=n.defineComponent({__name:"DataFilterSheet",props:{title:{default:"Filter Data"},description:{default:"Masukan parameter pencarian untuk memfilter data."}},setup(e){return(t,o)=>(n.openBlock(),n.createBlock(n.unref(kB),null,{default:n.withCtx(()=>[n.createVNode(n.unref(SB),{"as-child":""},{default:n.withCtx(()=>[n.renderSlot(t.$slots,"trigger",{},()=>[n.createVNode(n.unref(ut),{variant:"outline",class:"gap-2"},{default:n.withCtx(()=>[n.createVNode(n.unref(te.Search),{class:"w-4 h-4"}),o[0]||(o[0]=n.createElementVNode("span",null,"Pencarian",-1))]),_:1})])]),_:3}),n.createVNode(n.unref(wB),{class:"flex flex-col h-full"},{default:n.withCtx(()=>[n.createVNode(n.unref(BB),{class:"flex-shrink-0"},{default:n.withCtx(()=>[n.createVNode(n.unref(EB),{class:"text-xl font-bold"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1}),n.createVNode(n.unref(CB),{class:"text-sm font-medium text-neutral-600 dark:text-neutral-400"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.description),1)]),_:1})]),_:1}),n.createElementVNode("div",VB,[n.renderSlot(t.$slots,"default")]),n.createVNode(n.unref(_B),{class:"flex-shrink-0"},{default:n.withCtx(()=>[n.renderSlot(t.$slots,"footer")]),_:3})]),_:3})]),_:3}))}}),MB={key:0},NB=["value","name"],wd=n.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const{locale:o}=Ht.useI18n(),a=e,r=t,s=n.ref(a.modelValue);n.watch(()=>a.modelValue,u=>{s.value=u});const i={DCodeTextField:va,DCodeAutoComplete:Lo,DCodeDatePicker:Sa,DCodeTextarea:Un,DCodeTextArea:Un,DCodeCheckbox:on,DCodeSwitch:Pa,DCodeOtpInput:Da,DCodeImageField:Va,DCodeSlider:Na},l=n.computed(()=>{const u=a.field.component;return i[u]||null}),c=n.computed(()=>{const u=a.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,r("update:modelValue",u)};return(u,f)=>e.field.isHidden?(n.openBlock(),n.createElementBlock("div",MB,[n.createElementVNode("input",{type:"hidden",value:s.value,name:e.field.model},null,8,NB)])):(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.value),n.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"]))}}),PB=n.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,a=t,r=Fe.useVModel(o,"modelValue",a,{passive:!0,defaultValue:o.defaultValue});return(s,i)=>n.withDirectives((n.openBlock(),n.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>n.isRef(r)?r.value=l:null),class:n.normalizeClass(n.unref(_e)("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)),[[n.vModelText,n.unref(r)]])}}),vB=n.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(e,{emit:t}){const o=e,a=t,r=Fe.reactiveOmit(o,"class"),s=ce.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(ce.PaginationRoot),n.mergeProps({"data-slot":"pagination"},n.unref(s),{class:o.class}),{default:n.withCtx(c=>[n.renderSlot(i.$slots,"default",n.normalizeProps(n.guardReactiveProps(c)))]),_:3},16,["class"]))}}),TB=n.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ce.PaginationList),n.mergeProps({"data-slot":"pagination-content"},n.unref(o),{class:n.unref(_e)("flex flex-row items-center gap-1",t.class)}),{default:n.withCtx(s=>[n.renderSlot(a.$slots,"default",n.normalizeProps(n.guardReactiveProps(s)))]),_:3},16,["class"]))}}),OB=n.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ce.PaginationEllipsis),n.mergeProps({"data-slot":"pagination-ellipsis"},n.unref(o),{class:n.unref(_e)("flex size-9 items-center justify-center",t.class)}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default",{},()=>[n.createVNode(n.unref(te.MoreHorizontal),{class:"size-4"}),r[0]||(r[0]=n.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),zB=n.defineComponent({__name:"PaginationFirst",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class","size"),a=ce.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ce.PaginationFirst),n.mergeProps({"data-slot":"pagination-first",class:n.unref(_e)(n.unref(Nn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},n.unref(a)),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[n.createVNode(n.unref(te.ChevronLeftIcon)),s[0]||(s[0]=n.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),FB=n.defineComponent({__name:"PaginationItem",props:{value:{},asChild:{type:Boolean},as:{},size:{default:"icon"},class:{type:[Boolean,null,String,Object,Array]},isActive:{type:Boolean}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class","size","isActive");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(ce.PaginationListItem),n.mergeProps({"data-slot":"pagination-item"},n.unref(o),{class:n.unref(_e)(n.unref(Nn)({variant:"ghost",size:e.size}),e.isActive?"bg-[#0056a1] dark:bg-[#003d75] text-white hover:bg-[#0056a1]/90 dark:hover:bg-[#003d75]/90 hover:text-white":"",t.class)}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),IB=n.defineComponent({__name:"PaginationLast",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class","size"),a=ce.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ce.PaginationLast),n.mergeProps({"data-slot":"pagination-last",class:n.unref(_e)(n.unref(Nn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},n.unref(a)),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[s[0]||(s[0]=n.createElementVNode("span",{class:"hidden sm:block"},"Last",-1)),n.createVNode(n.unref(te.ChevronRightIcon))])]),_:3},16,["class"]))}}),RB=n.defineComponent({__name:"PaginationNext",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class","size"),a=ce.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ce.PaginationNext),n.mergeProps({"data-slot":"pagination-next",class:n.unref(_e)(n.unref(Nn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},n.unref(a)),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[s[0]||(s[0]=n.createElementVNode("span",{class:"hidden sm:block"},"Next",-1)),n.createVNode(n.unref(te.ChevronRightIcon))])]),_:3},16,["class"]))}}),LB=n.defineComponent({__name:"PaginationPrevious",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class","size"),a=ce.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ce.PaginationPrev),n.mergeProps({"data-slot":"pagination-previous",class:n.unref(_e)(n.unref(Nn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},n.unref(a)),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[n.createVNode(n.unref(te.ChevronLeftIcon)),s[0]||(s[0]=n.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),$B=n.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(e,{emit:t}){const o=e,a=t,r=ce.useForwardPropsEmits(o,a);return(s,i)=>(n.openBlock(),n.createBlock(n.unref(ce.SelectRoot),n.normalizeProps(n.guardReactiveProps(n.unref(r))),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16))}}),WB=n.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(e,{emit:t}){const o=e,a=t,r=Fe.reactiveOmit(o,"class"),s=ce.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(ce.SelectPortal),null,{default:n.withCtx(()=>[n.createVNode(n.unref(ce.SelectContent),n.mergeProps({...n.unref(s),...i.$attrs},{class:n.unref(_e)("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",e.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:n.withCtx(()=>[n.createVNode(n.unref(qB)),n.createVNode(n.unref(ce.SelectViewport),{class:n.normalizeClass(n.unref(_e)("p-1",e.position==="popper"&&"h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]"))},{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},8,["class"]),n.createVNode(n.unref(HB))]),_:3},16,["class"])]),_:3}))}}),jB={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},UB=n.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class"),a=ce.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ce.SelectItem),n.mergeProps(n.unref(a),{class:n.unref(_e)("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",t.class)}),{default:n.withCtx(()=>[n.createElementVNode("span",jB,[n.createVNode(n.unref(ce.SelectItemIndicator),null,{default:n.withCtx(()=>[n.createVNode(n.unref(te.Check),{class:"h-4 w-4"})]),_:1})]),n.createVNode(n.unref(ce.SelectItemText),null,{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),HB=n.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class"),a=ce.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ce.SelectScrollDownButton),n.mergeProps(n.unref(a),{class:n.unref(_e)("flex cursor-default items-center justify-center py-1",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[n.createVNode(n.unref(te.ChevronDown))])]),_:3},16,["class"]))}}),qB=n.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class"),a=ce.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ce.SelectScrollUpButton),n.mergeProps(n.unref(a),{class:n.unref(_e)("flex cursor-default items-center justify-center py-1",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[n.createVNode(n.unref(te.ChevronUp))])]),_:3},16,["class"]))}}),GB=n.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=Fe.reactiveOmit(t,"class"),a=ce.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(ce.SelectTrigger),n.mergeProps(n.unref(a),{class:n.unref(_e)("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",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default"),n.createVNode(n.unref(ce.SelectIcon),{"as-child":""},{default:n.withCtx(()=>[n.createVNode(n.unref(te.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),XB=n.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(ce.SelectValue),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),Ao={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Hn={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},at={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},YB={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},KB={dangerouslyHTMLString:!1,multiple:!0,position:Ao.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},JB={rtl:!1,newestOnTop:!1,toastClassName:""},Cd={...KB,...JB};at.DEFAULT;var Se=(e=>(e[e.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",e[e.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",e.CSS_NAMESPACE="Toastify",e))(Se||{}),_s=(e=>(e.ENTRANCE_ANIMATION_END="d",e))(_s||{});const QB={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},ZB={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},e2={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},t2={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},_d="Toastify--animate Toastify__none-enter";function Bd(e,t=!1){var o;let a=QB;if(!e||typeof e=="string")switch(e){case"flip":a=t2;break;case"zoom":a=e2;break;case"slide":a=ZB;break}else a=e;if(t)a.enter=_d;else if(a.enter===_d){const r=(o=a.exit.split("__")[1])==null?void 0:o.split("-")[0];a.enter=`Toastify--animate Toastify__${r}-enter`}return a}function n2(e){return e.containerId||String(e.position)}const Oa="will-unmount";function o2(e=Ao.TOP_RIGHT){return!!document.querySelector(`.${Se.CSS_NAMESPACE}__toast-container--${e}`)}function a2(e=Ao.TOP_RIGHT){return`${Se.CSS_NAMESPACE}__toast-container--${e}`}function r2(e,t,o=!1){const a=[`${Se.CSS_NAMESPACE}__toast-container`,`${Se.CSS_NAMESPACE}__toast-container--${e}`,o?`${Se.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return Gn(t)?t({position:e,rtl:o,defaultClassName:a}):`${a} ${t||""}`}function s2(e){var t;const{position:o,containerClassName:a,rtl:r=!1,style:s={}}=e,i=Se.CSS_NAMESPACE,l=a2(o),c=document.querySelector(`.${i}`),d=document.querySelector(`.${l}`),u=!!d&&!((t=d.className)!=null&&t.includes(Oa)),f=c||document.createElement("div"),h=document.createElement("div");h.className=r2(o,a,r),h.dataset.testid=`${Se.CSS_NAMESPACE}__toast-container--${o}`,h.id=n2(e);for(const m in s)if(Object.prototype.hasOwnProperty.call(s,m)){const p=s[m];h.style[m]=p}return c||(f.className=Se.CSS_NAMESPACE,document.body.appendChild(f)),u||f.appendChild(h),h}function Bs(e){var t,o,a;const r=typeof e=="string"?e:((t=e.currentTarget)==null?void 0:t.id)||((o=e.target)==null?void 0:o.id),s=document.getElementById(r);s&&s.removeEventListener("animationend",Bs,!1);try{Vo[r].unmount(),(a=document.getElementById(r))==null||a.remove(),delete Vo[r],delete Ke[r]}catch{}}const Vo=n.reactive({});function i2(e,t){const o=document.getElementById(String(t));o&&(Vo[o.id]=e)}function Es(e,t=!0){const o=String(e);if(!Vo[o])return;const a=document.getElementById(o);a&&a.classList.add(Oa),t?(c2(e),a&&a.addEventListener("animationend",Bs,!1)):Bs(o),pt.items=pt.items.filter(r=>r.containerId!==e)}function l2(e){for(const t in Vo)Es(t,e);pt.items=[]}function Ed(e,t){const o=document.getElementById(e.toastId);if(o){let a=e;a={...a,...Bd(a.transition)};const r=a.appendPosition?`${a.exit}--${a.position}`:a.exit;o.className+=` ${r}`,t&&t(o)}}function c2(e){for(const t in Ke)if(t===e)for(const o of Ke[t]||[])Ed(o)}function d2(e){const t=qn().find(o=>o.toastId===e);return t==null?void 0:t.containerId}function Ss(e){return document.getElementById(e)}function u2(e){const t=Ss(e.containerId);return t&&t.classList.contains(Oa)}function Sd(e){var t;const o=n.isVNode(e.content)?n.toRaw(e.content.props):null;return o??n.toRaw((t=e.data)!=null?t:{})}function f2(e){return e?pt.items.filter(t=>t.containerId===e).length>0:pt.items.length>0}function h2(){if(pt.items.length>0){const e=pt.items.shift();za(e==null?void 0:e.toastContent,e==null?void 0:e.toastProps)}}const Ke=n.reactive({}),pt=n.reactive({items:[]});function qn(){const e=n.toRaw(Ke);return Object.values(e).reduce((t,o)=>[...t,...o],[])}function m2(e){return qn().find(t=>t.toastId===e)}function za(e,t={}){if(u2(t)){const o=Ss(t.containerId);o&&o.addEventListener("animationend",As.bind(null,e,t),!1)}else As(e,t)}function As(e,t={}){const o=Ss(t.containerId);o&&o.removeEventListener("animationend",As.bind(null,e,t),!1);const a=Ke[t.containerId]||[],r=a.length>0;if(!r&&!o2(t.position)){const s=s2(t),i=n.createApp(I2,t);t.useHandler&&t.useHandler(i),i.mount(s),i2(i,s.id)}r&&!t.updateId&&(t.position=a[0].position),n.nextTick(()=>{t.updateId?dt.update(t):dt.add(e,t)})}const dt={add(e,t){const{containerId:o=""}=t;o&&(Ke[o]=Ke[o]||[],Ke[o].find(a=>a.toastId===t.toastId)||setTimeout(()=>{var a,r;t.newestOnTop?(a=Ke[o])==null||a.unshift(t):(r=Ke[o])==null||r.push(t),t.onOpen&&t.onOpen(Sd(t))},t.delay||0))},remove(e){if(e){const t=d2(e);if(t){const o=Ke[t];let a=o.find(r=>r.toastId===e);Ke[t]=o.filter(r=>r.toastId!==e),!Ke[t].length&&!f2(t)&&Es(t,!1),h2(),n.nextTick(()=>{a!=null&&a.onClose&&(a.onClose(Sd(a)),a=void 0)})}}},update(e={}){const{containerId:t=""}=e;if(t&&e.updateId){Ke[t]=Ke[t]||[];const o=Ke[t].find(s=>s.toastId===e.toastId),a=(o==null?void 0:o.position)!==e.position||(o==null?void 0:o.transition)!==e.transition,r={...e,disabledEnterTransition:!a,updateId:void 0};dt.dismissForce(e==null?void 0:e.toastId),setTimeout(()=>{ze(r.content,r)},e.delay||0)}},clear(e,t=!0){e?Es(e,t):l2(t)},dismissCallback(e){var t;const o=(t=e.currentTarget)==null?void 0:t.id,a=document.getElementById(o);a&&(a.removeEventListener("animationend",dt.dismissCallback,!1),setTimeout(()=>{dt.remove(o)}))},dismiss(e){if(e){const t=qn();for(const o of t)if(o.toastId===e){Ed(o,a=>{a.addEventListener("animationend",dt.dismissCallback,!1)});break}}},dismissForce(e){if(e){const t=qn();for(const o of t)if(o.toastId===e){const a=document.getElementById(e);a&&(a.remove(),a.removeEventListener("animationend",dt.dismissCallback,!1),dt.remove(e));break}}}},p2=n.reactive({useHandler:void 0}),Ad=n.reactive({}),Fa=n.reactive({});function Vd(){return Math.random().toString(36).substring(2,9)}function g2(e){return typeof e=="number"&&!isNaN(e)}function Vs(e){return typeof e=="string"}function Gn(e){return typeof e=="function"}function Ia(...e){return n.mergeProps(...e)}function Ra(e){return typeof e=="object"&&(!!(e!=null&&e.render)||!!(e!=null&&e.setup)||typeof(e==null?void 0:e.type)=="object")}function b2(e={}){Ad[`${Se.CSS_NAMESPACE}-default-options`]=e}function Dd(){return Ad[`${Se.CSS_NAMESPACE}-default-options`]||Cd}function y2(){const e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||e?"dark":"light"}var La=(e=>(e[e.Enter=0]="Enter",e[e.Exit=1]="Exit",e))(La||{});const Md={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:Ao.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:Hn.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}},x2={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:Hn.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}},k2=n.defineComponent({name:"ProgressBar",props:x2,setup(e,{attrs:t}){const o=n.ref(),a=n.computed(()=>e.hide?"true":"false"),r=n.computed(()=>({...t.style||{},animationDuration:`${e.autoClose===!0?5e3:e.autoClose}ms`,animationPlayState:e.isRunning?"running":"paused",opacity:e.hide||e.autoClose===!1?0:1,transform:e.controlledProgress?`scaleX(${e.progress})`:"none"})),s=n.computed(()=>[`${Se.CSS_NAMESPACE}__progress-bar`,e.controlledProgress?`${Se.CSS_NAMESPACE}__progress-bar--controlled`:`${Se.CSS_NAMESPACE}__progress-bar--animated`,`${Se.CSS_NAMESPACE}__progress-bar-theme--${e.theme}`,`${Se.CSS_NAMESPACE}__progress-bar--${e.type}`,e.rtl?`${Se.CSS_NAMESPACE}__progress-bar--rtl`:null].filter(Boolean).join(" ")),i=n.computed(()=>`${s.value} ${(t==null?void 0:t.class)||""}`),l=()=>{o.value&&(o.value.onanimationend=null,o.value.ontransitionend=null)},c=()=>{e.isIn&&e.closeToast&&e.autoClose!==!1&&(e.closeToast(),l())},d=n.computed(()=>e.controlledProgress?null:c),u=n.computed(()=>e.controlledProgress?c:null);return n.watchEffect(()=>{o.value&&(l(),o.value.onanimationend=d.value,o.value.ontransitionend=u.value)}),()=>n.createVNode("div",{ref:o,role:"progressbar","aria-hidden":a.value,"aria-label":"notification timer",class:i.value,style:r.value},null)}}),w2=n.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:Hn.AUTO},type:{type:String,required:!1,default:Hn.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(e){return()=>n.createVNode("button",{class:`${Se.CSS_NAMESPACE}__close-button ${Se.CSS_NAMESPACE}__close-button--${e.theme}`,type:"button",onClick:t=>{t.stopPropagation(),e.closeToast&&e.closeToast(t)},"aria-label":e.ariaLabel},[n.createVNode("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},[n.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)])])}}),$a=({theme:e,type:t,path:o,...a})=>n.createVNode("svg",n.mergeProps({viewBox:"0 0 24 24",width:"100%",height:"100%",style:{fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`}},a),[n.createVNode("path",{d:o},null)]);function C2(e){return n.createVNode($a,n.mergeProps(e,{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 _2(e){return n.createVNode($a,n.mergeProps(e,{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 B2(e){return n.createVNode($a,n.mergeProps(e,{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 E2(e){return n.createVNode($a,n.mergeProps(e,{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 S2(){return n.createVNode("div",{class:`${Se.CSS_NAMESPACE}__spinner`},null)}const Wa={info:_2,warning:C2,success:B2,error:E2,spinner:S2},A2=e=>e in Wa;function V2({theme:e,type:t,isLoading:o,icon:a}){let r;const s=!!o||t==="loading",i={theme:e,type:t};if(s&&(a===void 0||typeof a=="boolean"))return Wa.spinner();if(a!==!1){if(Ra(a))r=n.toRaw(a);else if(Gn(a)){const l=a;i.type=s?"loading":t,r=l(i),r=!r&&s?Wa.spinner():r}else n.isVNode(a)?r=n.cloneVNode(a,i):Vs(a)||g2(a)?r=a:A2(t)&&(r=Wa[t](i));return r}}const D2=()=>{};function M2(e,t,o=Se.COLLAPSE_DURATION){const{scrollHeight:a,style:r}=e,s=o;requestAnimationFrame(()=>{r.minHeight="initial",r.height=a+"px",r.transition=`all ${s}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(t,s)})})}function N2(e){const t=n.ref(!1),o=n.ref(!1),a=n.ref(!1),r=n.ref(La.Enter),s=n.reactive({...e,appendPosition:e.appendPosition||!1,collapse:typeof e.collapse>"u"?!0:e.collapse,collapseDuration:e.collapseDuration||Se.COLLAPSE_DURATION}),i=s.done||D2,l=n.computed(()=>s.appendPosition?`${s.enter}--${s.position}`:s.enter),c=n.computed(()=>s.appendPosition?`${s.exit}--${s.position}`:s.exit),d=n.computed(()=>e.pauseOnHover?{onMouseenter:g,onMouseleave:b}:{});function u(){const _=l.value.split(" ");h().addEventListener(_s.ENTRANCE_ANIMATION_END,b,{once:!0});const C=E=>{const B=h();E.target===B&&(B.dispatchEvent(new Event(_s.ENTRANCE_ANIMATION_END)),B.removeEventListener("animationend",C),B.removeEventListener("animationcancel",C),r.value===La.Enter&&E.type!=="animationcancel"&&B.classList.remove(..._))},w=()=>{const E=h();E.classList.add(..._),E.addEventListener("animationend",C),E.addEventListener("animationcancel",C)};e.pauseOnFocusLoss&&m(),w()}function f(){if(!h())return;const _=()=>{const w=h();w.removeEventListener("animationend",_),s.collapse?M2(w,i,s.collapseDuration):i()},C=()=>{const w=h();r.value=La.Exit,w&&(w.className+=` ${c.value}`,w.addEventListener("animationend",_))};o.value||(a.value?_():setTimeout(C))}function h(){return e.toastRef.value}function m(){document.hasFocus()||g(),window.addEventListener("focus",b),window.addEventListener("blur",g)}function p(){window.removeEventListener("focus",b),window.removeEventListener("blur",g)}function b(){(!e.loading.value||e.isLoading===void 0)&&(t.value=!0)}function g(){t.value=!1}function x(_){_&&(_.stopPropagation(),_.preventDefault()),o.value=!1}return n.watchEffect(f),n.watchEffect(()=>{const _=qn();o.value=_.findIndex(C=>C.toastId===s.toastId)>-1}),n.watchEffect(()=>{e.isLoading!==void 0&&(e.loading.value?g():b())}),n.onMounted(u),n.onUnmounted(()=>{e.pauseOnFocusLoss&&p()}),{isIn:o,isRunning:t,hideToast:x,eventHandlers:d}}function P2(e){if(!e||typeof e!="object"||Array.isArray(e)||e.__v_isVNode)return!1;const t=e;return["title","content"].some(o=>o in t)}const v2=n.defineComponent({name:"ToastItem",inheritAttrs:!1,props:Md,setup(e){const t=n.ref(),o=n.computed(()=>!!e.isLoading),a=n.computed(()=>e.progress!==void 0&&e.progress!==null),r=n.computed(()=>V2(e)),s=n.computed(()=>[`${Se.CSS_NAMESPACE}__toast`,`${Se.CSS_NAMESPACE}__toast-theme--${e.theme}`,`${Se.CSS_NAMESPACE}__toast--${e.type}`,e.rtl?`${Se.CSS_NAMESPACE}__toast--rtl`:void 0,e.toastClassName||""].filter(Boolean).join(" ")),{isRunning:i,isIn:l,hideToast:c,eventHandlers:d}=N2({toastRef:t,loading:o,done:()=>{dt.remove(e.toastId)},...Bd(e.transition,e.disabledEnterTransition),...e});function u(){const f=e.content;if(P2(f)){const h=[];return f.title!==void 0&&h.push(n.createVNode("div",{"data-testid":"toast-text-title",class:`${Se.CSS_NAMESPACE}__toast-text-title`},[f.title])),f.content!==void 0&&h.push(n.createVNode("div",{"data-testid":"toast-text-content",class:`${Se.CSS_NAMESPACE}__toast-text-content`},[f.content])),n.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${Se.CSS_NAMESPACE}__toast-text`},[h])}return Ra(f)?n.h(n.toRaw(f),{toastProps:n.toRaw(e),closeToast:c,data:e.data,...e.expandCustomProps?e.contentProps:{contentProps:e.contentProps||{}}}):Gn(f)?f({toastProps:n.toRaw(e),closeToast:c,data:e.data}):e.dangerouslyHTMLString?n.h("div",{innerHTML:f}):f}return()=>n.createVNode("div",n.mergeProps({id:e.toastId,class:s.value,style:e.toastStyle||{},ref:t,"data-testid":`toast-item-${e.toastId}`,onClick:f=>{e.closeOnClick&&c(),e.onClick&&e.onClick(f)}},d.value),[n.createVNode("div",{role:e.role,"data-testid":"toast-body",class:`${Se.CSS_NAMESPACE}__toast-body ${e.bodyClassName||""}`},[r.value!=null&&n.createVNode("div",{"data-testid":`toast-icon-${e.type}`,class:[`${Se.CSS_NAMESPACE}__toast-icon`,e.isLoading?"":`${Se.CSS_NAMESPACE}--animate-icon ${Se.CSS_NAMESPACE}__zoom-enter`].join(" ")},[Ra(r.value)?n.h(n.toRaw(r.value),{theme:e.theme,type:e.type}):Gn(r.value)?r.value({theme:e.theme,type:e.type}):r.value]),n.createVNode("div",{"data-testid":"toast-content"},[u()])]),(e.closeButton===void 0||e.closeButton===!0)&&n.createVNode(w2,{theme:e.theme,closeToast:f=>{f.stopPropagation(),f.preventDefault(),c()}},null),Ra(e.closeButton)?n.h(n.toRaw(e.closeButton),{closeToast:c,type:e.type,theme:e.theme}):Gn(e.closeButton)?e.closeButton({closeToast:c,type:e.type,theme:e.theme}):null,n.createVNode(k2,{className:e.progressClassName,style:e.progressStyle,rtl:e.rtl,theme:e.theme,isIn:l.value,type:e.type,hide:e.hideProgressBar,isRunning:i.value,autoClose:e.autoClose,controlledProgress:a.value,progress:e.progress,closeToast:e.isLoading?void 0:c},null)])}}),ja="vue3-toastify:url-change";let Ua=0,Do;function T2(){if(!(typeof window>"u")&&Fa.lastUrl!==window.location.href){Fa.lastUrl=window.location.href;const e=o=>typeof o.clearOnUrlChange=="boolean"?o.clearOnUrlChange:Dd().clearOnUrlChange!==!1,t=Object.values(Ke).reduce((o,a)=>(Array.isArray(a)&&o.push(...a),o),[]);for(const o of t)o.toastId&&e(o)&&dt.dismiss(o.toastId);pt.items=pt.items.filter(o=>!e(o.toastProps))}}function O2(){const{history:e}=window,t=e.pushState,o=e.replaceState;return e.pushState=function(...a){const r=t.apply(this,a);return window.dispatchEvent(new Event(ja)),r},e.replaceState=function(...a){const r=o.apply(this,a);return window.dispatchEvent(new Event(ja)),r},()=>{e.pushState=t,e.replaceState=o}}function z2(){if(typeof window>"u"||Do)return;const e=O2(),t=()=>T2();window.addEventListener(ja,t),window.addEventListener("popstate",t),window.addEventListener("hashchange",t),Do=()=>{e(),window.removeEventListener(ja,t),window.removeEventListener("popstate",t),window.removeEventListener("hashchange",t),Do=void 0}}function F2(){Do&&(Do(),Fa.lastUrl="")}const I2=n.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:Md,setup(e){const t=n.computed(()=>e.containerId),o=n.computed(()=>Ke[t.value]||[]),a=n.computed(()=>o.value.filter(r=>r.position===e.position));return n.onMounted(()=>{typeof window<"u"&&(Ua+=1,z2())}),n.onUnmounted(()=>{typeof window<"u"&&Ua>0&&(Ua-=1,Ua===0&&F2())}),()=>n.createVNode(n.Fragment,null,[a.value.map(r=>{const{toastId:s=""}=r;return n.createVNode(v2,n.mergeProps({key:s},r),null)})])}});let Ds=!1;const Nd={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function Pd(){const e=[];return qn().forEach(t=>{const o=document.getElementById(t.containerId);o&&!o.classList.contains(Oa)&&e.push(t)}),e}function R2(e){const t=Pd().length,o=e??0;return o>0&&t+pt.items.length>=o}function L2(e){R2(e.limit)&&!e.updateId&&pt.items.push({toastId:e.toastId,containerId:e.containerId,toastContent:e.content,toastProps:e})}function sn(e,t,o={}){if(Ds)return;o=Ia(Dd(),{type:t},n.toRaw(o)),(!o.toastId||typeof o.toastId!="string"&&typeof o.toastId!="number")&&(o.toastId=Vd()),o={...o,...o.type==="loading"?Nd:{},content:e,containerId:o.containerId||String(o.position)};const a=Number(o==null?void 0:o.progress);return!isNaN(a)&&a<0&&(o.progress=0),a>1&&(o.progress=1),o.theme==="auto"&&(o.theme=y2()),L2(o),Fa.lastUrl=window.location.href,o.multiple?pt.items.length?o.updateId&&za(e,o):za(e,o):(Ds=!0,ze.clearAll(void 0,!1),setTimeout(()=>{za(e,o)},0),setTimeout(()=>{Ds=!1},390)),o.toastId}const ze=(e,t)=>sn(e,at.DEFAULT,t);ze.info=(e,t)=>sn(e,at.DEFAULT,{...t,type:at.INFO}),ze.error=(e,t)=>sn(e,at.DEFAULT,{...t,type:at.ERROR}),ze.warning=(e,t)=>sn(e,at.DEFAULT,{...t,type:at.WARNING}),ze.warn=ze.warning,ze.success=(e,t)=>sn(e,at.DEFAULT,{...t,type:at.SUCCESS}),ze.loading=(e,t)=>sn(e,at.DEFAULT,Ia(t,Nd)),ze.dark=(e,t)=>sn(e,at.DEFAULT,Ia(t,{theme:Hn.DARK})),ze.remove=e=>{e?dt.dismiss(e):dt.clear()},ze.clearAll=(e,t)=>{n.nextTick(()=>{dt.clear(e,t)})},ze.isActive=e=>{let t=!1;return t=Pd().findIndex(o=>o.toastId===e)>-1,t},ze.update=(e,t={})=>{setTimeout(()=>{const o=m2(e);if(o){const a=n.toRaw(o),{content:r}=a,s={...a,...t,toastId:t.toastId||e,updateId:Vd()},i=s.render||r;delete s.render,sn(i,s.type,s)}},0)},ze.done=e=>{ze.update(e,{isLoading:!1,progress:1})},ze.promise=$2;function $2(e,{pending:t,error:o,success:a},r){var s,i,l;let c;const d={...r||{},autoClose:!1};t&&(c=Vs(t)?ze.loading(t,d):ze.loading(t.render,{...d,...t}));const u={autoClose:(s=r==null?void 0:r.autoClose)!=null?s:!0,closeOnClick:(i=r==null?void 0:r.closeOnClick)!=null?i:!0,closeButton:(l=r==null?void 0:r.autoClose)!=null?l:null,isLoading:void 0,draggable:null,delay:100},f=(m,p,b)=>{if(p==null){ze.remove(c);return}const g={type:m,...u,...r,data:b},x=Vs(p)?{render:p}:p;return c?ze.update(c,{...g,...x,isLoading:!1}):ze(x.render,{...g,...x,isLoading:!1}),b},h=Gn(e)?e():e;return h.then(m=>{f("success",a,m)}).catch(m=>{f("error",o,m)}),h}ze.POSITION=Ao,ze.THEME=Hn,ze.TYPE=at,ze.TRANSITIONS=YB;const W2={install(e,t={}){p2.useHandler=t.useHandler||(()=>{}),j2(t)}};typeof window<"u"&&(window.Vue3Toastify=W2);function j2(e={}){const t=Ia(Cd,e);b2(t)}const U2={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:[]},H2={class:"dcode-card animate-slide-up"},q2={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"},G2={class:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4"},X2={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]"},Y2={class:"relative w-full sm:w-64"},K2={key:0,class:"relative"},J2={class:"flex flex-col h-full"},Q2={key:0,class:"flex-1 overflow-y-auto py-4"},Z2={class:"grid grid-cols-1 gap-4 px-1"},eE={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"},tE={class:"flex justify-end gap-2 w-full"},nE={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},oE={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},aE={class:"dcode-table w-full"},rE={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},sE=["onClick"],iE={key:0,class:"flex items-center justify-center w-full"},lE={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},cE={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},dE={key:0,class:"px-3 py-0.5"},uE={key:1},fE=["colspan"],hE={class:"flex flex-col items-center gap-2"},mE={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},pE={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},gE={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},bE={key:0,class:"flex items-center justify-center"},yE={key:0,class:"px-3 py-0.5 !text-center"},xE={key:0,class:"flex items-center justify-center gap-1.5"},kE={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},wE=["colspan"],CE={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"},_E={class:"flex items-center gap-4"},BE={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},EE={class:"text-neutral-900 dark:text-neutral-100 font-medium"},SE={class:"text-neutral-900 dark:text-neutral-100 font-medium"},AE={class:"text-neutral-900 dark:text-neutral-100 font-medium"},VE={class:"flex-shrink-0"},DE={class:"space-y-4"},ME={class:"text-gray-600 dark:text-gray-400"},NE={class:"grid grid-cols-1 gap-4 py-4 px-1"},PE={class:"flex items-end gap-2"},Xn=n.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(e,{expose:t,emit:o}){var Hd,qd,Gd,Xd,Yd,Kd;const a=e,r=o,s=n.getCurrentInstance(),{apiUrl:i}=Je(),{locale:l}=Ht.useI18n();let c={query:{},params:{},path:""};try{const S=An.useRoute();S?c=S:(Gd=(qd=(Hd=s==null?void 0:s.appContext)==null?void 0:Hd.config)==null?void 0:qd.globalProperties)!=null&&Gd.$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=An.useRouter();S?d=S:(Kd=(Yd=(Xd=s==null?void 0:s.appContext)==null?void 0:Xd.config)==null?void 0:Yd.globalProperties)!=null&&Kd.$router&&(d=s.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const u=n.ref(""),f=n.ref(1),h=n.ref(a.perPage),m=n.ref({key:"",direction:"asc"}),p=n.ref([]),b=n.ref(!1),g=n.ref(0),x=n.ref({}),_=n.ref([]),C=n.ref(null),w=n.ref(!0),E=n.ref([]),B=n.ref([]),k=n.ref([]),y=n.ref(!1),A=n.ref(!1),D=n.ref({}),N=n.ref(null),V=n.ref(null),M=n.ref(null),T=n.ref([]),U=n.computed(()=>{if(q.value.length===0)return!1;const S=q.value.map(I=>{const Z=J.value.find($=>$.type==="CHECKBOX"),F=(Z==null?void 0:Z.keyCheckbox)||"id";return I[F]}).filter(I=>I!=null);return S.length===0?!1:S.every(I=>T.value.includes(I))}),L=n.computed(()=>{if(q.value.length===0)return!1;const S=J.value.find($=>$.type==="CHECKBOX"),I=(S==null?void 0:S.keyCheckbox)||"id",Z=q.value.map($=>$[I]).filter($=>$!=null),F=Z.filter($=>T.value.includes($)).length;return F>0&&F<Z.length}),R=S=>{const I=J.value.find($=>$.type==="CHECKBOX"),Z=(I==null?void 0:I.keyCheckbox)||"id",F=S[Z];return F!==void 0&&T.value.includes(F)},P=S=>{const I=J.value.find($=>$.type==="CHECKBOX"),Z=(I==null?void 0:I.keyCheckbox)||"id",F=q.value.map($=>$[Z]).filter($=>$!=null);if(S){const $=new Set([...T.value,...F]);T.value=Array.from($)}else T.value=T.value.filter($=>!F.includes($))},W=(S,I)=>{const Z=J.value.find(Q=>Q.type==="CHECKBOX"),F=(Z==null?void 0:Z.keyCheckbox)||"id",$=S[F];$!=null&&(I?T.value.includes($)||T.value.push($):T.value=T.value.filter(Q=>Q!==$))};n.watch(T,S=>{var Z;r("update:selection",S);const I=U.value||S.length>1;(Z=B.value)!=null&&Z.length&&B.value.forEach(F=>{var $;($=F.fieldActionGlobal)!=null&&$.length&&F.fieldActionGlobal.forEach(Q=>{var Ee,Ue;const me=F.endpoint||((Ee=F.propsActionGlobal)==null?void 0:Ee.endpointPropAction)||F.propsActionGlobal,Ve=(Ue=me==null?void 0:me.keyParam)==null?void 0:Ue[0];(Ve&&Q.model===Ve||!Ve&&/^(id|ids|idAuditTrail)/i.test(Q.model))&&I&&Q.model&&(D.value[Q.model]=S)})})},{deep:!0});const v=S=>Array.from({length:S}).map((I,Z)=>{const F={id:Z+1,no:Z+1};return J.value.forEach($=>{$.key!=="no"&&$.key!=="action"&&$.type!=="ACTION"&&$.type!=="action"&&($.type==="CHECKBOX"?F[$.keyCheckbox||"id"]=Z+1:$.type==="BADGE"||$.type==="badge"||$.condition?F[$.key]=$.condition&&$.condition.length>0?$.condition[0].value:"Active":F[$.key]=`Data ${$.label} ${Z+1}`)}),F}),z=S=>S&&typeof S=="string"&&S.trim()?S:void 0,H=n.computed(()=>{var S,I,Z,F;return z((I=(S=C.value)==null?void 0:S.endpoint)==null?void 0:I.apiModule)||z((F=(Z=C.value)==null?void 0:Z.endpointGlobal)==null?void 0:F.apiModule)||a.apiModule}),G=n.computed(()=>{var S,I,Z,F;return z((I=(S=C.value)==null?void 0:S.endpoint)==null?void 0:I.apiAction)||z((F=(Z=C.value)==null?void 0:Z.endpointGlobal)==null?void 0:F.apiAction)||a.apiAction}),K=n.computed(()=>{var S,I,Z,F;return z((I=(S=C.value)==null?void 0:S.endpoint)==null?void 0:I.apiMethod)||z((F=(Z=C.value)==null?void 0:Z.endpointGlobal)==null?void 0:F.apiMethod)||a.apiMethod||"POST"}),X=n.computed(()=>{var S,I,Z,F;return z((I=(S=C.value)==null?void 0:S.endpoint)==null?void 0:I.apiUrl)||z((F=(Z=C.value)==null?void 0:Z.endpointGlobal)==null?void 0:F.apiUrl)||a.apiUrl}),oe=n.computed(()=>a.permissionBase||""),he=n.computed(()=>!k.value||k.value.length===0?[]:[...k.value].sort((S,I)=>(S.seq||0)-(I.seq||0))),ge=S=>{var Q,me,Ve;const I=(S==null?void 0:S.column)||((Q=S==null?void 0:S.props)==null?void 0:Q.column)||((me=S==null?void 0:S.propsFieldGlobal)==null?void 0:me.column)||((Ve=S==null?void 0:S.propsFieldCustom)==null?void 0:Ve.column);if(!I)return"col-span-1";const Z=I.toLowerCase(),$={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"}[Z]||"col-span-1";return console.log(`[DEBUG] getColumnClass for ${S==null?void 0:S.model}: type=${I}, returned=${$}`),$},se=()=>{let S=null;if(a.tableConfig&&(S=a.tableConfig),S){C.value=S,S.headers&&(_.value=S.headers.map(F=>{var me,Ve,xe,Ee,Ue,Le,Re,vt,Sn,Qa;if(F.key==="action"||((me=F.custom)==null?void 0:me.type)==="ACTION"||((Ve=F.custom)==null?void 0:Ve.type)==="action"){const cn=((xe=F.custom)==null?void 0:xe.actionCustom)||((Ee=F.custom)==null?void 0:Ee.action);return cn&&(E.value=cn.map(Ut=>{const Ye=Ut.propsActionCustom||Ut.props||{},Za=Ut.propCustomMessage||{};return{permission:Ut.permission,label:l.value==="id"?Ye.labelID:Ye.labelEN,tooltip:l.value==="id"?Ye.tooltipID||Ye.labelID:Ye.tooltipEN||Ye.labelEN,icon:Ye.icon,variant:Ye.variant||"ghost",bgColor:Ye.bgColor,action:Ye.actionType||Ye.key,route:Ye.route,path:Ye.path,endpoint:Ye.endpointPropAction,requiredCondition:Ut.requiredCondition||!1,propCustomCondition:Ut.propCustomCondition||[],openDialog:Ut.openDialog||!1,fieldActionCustom:(Ut.fieldActionCustom||[]).map(er=>{const Ts=er.propsFieldCustom||er.propsFieldGlobal||er.props||{};return{...er,props:{...Ts,endpoint:Ts.endpointComponent||Ts.endpoint}}}),requireConfirm:Ut.requireConfirm||Ye.requireConfirm||!1,confirmTitle:l.value==="id"?Za.titleID||Ye.confirmTitleID||"Konfirmasi":Za.titleEN||Ye.confirmTitleEN||"Confirm",confirmMessage:l.value==="id"?Za.messageID||Ye.confirmMessageID||"Apakah Anda yakin?":Za.messageEN||Ye.confirmMessageEN||"Are you sure?"}})),null}let $;const Q=((Ue=F.custom)==null?void 0:Ue.conditionBadge)||((Le=F.custom)==null?void 0:Le.condition);return(((Re=F.custom)==null?void 0:Re.type)==="BADGE"||((vt=F.custom)==null?void 0:vt.type)==="badge")&&Q&&($=Q.map(cn=>({value:cn.value,label:l.value==="id"?cn.labelID:cn.labelEN,color:cn.color,variant:cn.variant}))),{key:F.key,label:l.value==="id"?F.labelID:F.labelEN,width:F.width,align:F.align,sortable:!0,type:(Sn=F.custom)==null?void 0:Sn.type,condition:$,keyCheckbox:(Qa=F.custom)==null?void 0:Qa.keyCheckbox}}).filter(F=>F!==null));const I=S.filters||S.filter;I&&Array.isArray(I)&&(k.value=I.map(F=>({...F,props:F.propsFilters||F.props||{}})),k.value.forEach(F=>{x.value[F.model]=""}));const Z=S.actionGlobal||S.action;console.log("[DEBUG] loadConfig rawActions:",Z),Z&&Array.isArray(Z)?(B.value=Z.map(F=>{const $=F.propsActionGlobal||F.props||{};return{key:$.key,permission:F.permission,label:l.value==="id"?$.labelID||"Action":$.labelEN||"Action",tooltip:l.value==="id"?$.tooltipID||$.labelID:$.tooltipEN||$.labelEN,icon:$.icon,variant:$.variant||"default",bgColor:$.bgColor,textColor:$.textColor,route:$.route,path:$.path,endpoint:$.endpointPropAction||F.endpoint,openDialog:F.openDialog||!1,fieldActionGlobal:(F.fieldActionGlobal||F.field||[]).map(Q=>{const me=Q.propsFieldGlobal||Q.props||{};return{...Q,props:{...me,endpoint:me.endpointComponent||me.endpoint}}})}}),console.log("[DEBUG] loadConfig headerActions set:",B.value)):console.log("[DEBUG] loadConfig no rawActions found"),S.pagination!==void 0&&(w.value=S.pagination)}};n.watch(()=>a.tableConfig,()=>{se()},{deep:!0,immediate:!0});const J=n.computed(()=>a.dynamicColumns||a.configKey||a.tableConfig?_.value:a.columns||[]),O=n.computed(()=>a.hasActions||E.value.length>0),j=n.computed(()=>H.value||X.value?b.value:a.loading),Y=n.computed(()=>!!H.value||!!X.value),ie=n.computed(()=>[]),ye=S=>{if(console.log("[DEBUG] hasAction called:",{actionCode:S,permissionChecker:!!a.permissionChecker,effectivePath:oe.value}),a.menuPermissions&&a.menuPermissions.length>0){const I=c.path,Z=a.menuPermissions.find(F=>I.startsWith(F.path));if(Z&&Z.actions){const F=Z.actions.find($=>$.code===S.toUpperCase());return F?F.checked:!1}return!1}if(a.permissionChecker){const I=a.permissionChecker(oe.value,S);return console.log("[DEBUG] permissionChecker result:",I),I}return ie.value.some(I=>I.code===S)},ke=(S,I)=>{if(!S.visibilityCondition)return!0;const{field:Z,operator:F,value:$}=S.visibilityCondition,Q=Ae(I,Z);switch(F){case"equals":return Q===$;case"notEquals":return Q!==$;case"in":return Array.isArray($)&&$.includes(Q);case"notIn":return Array.isArray($)&&!$.includes(Q);case"greaterThan":return Q>$;case"lessThan":return Q<$;case"contains":return String(Q).includes(String($));default:return!0}},Me=n.computed(()=>{if(console.log("[DEBUG] visibleHeaderActions:",{headerActions:B.value,ignorePermissions:a.ignorePermissions}),B.value.length===0)return B.value;const S=B.value.filter(I=>{if(a.ignorePermissions)return!0;if(!I.permission)return console.log("[DEBUG] Action no permission, showing:",I.label),!0;if(a.checkPermission){const F=a.checkPermission(I.permission);return console.log("[DEBUG] Parent checkPermission result:",F),F}if(a.permissions){const F=a.permissions.includes(I.permission);return console.log("[DEBUG] Parent permissions check result:",F),F}const Z=ye(I.permission);return console.log("[DEBUG] Internal permission check:",{label:I.label,permission:I.permission,hasPerm:Z}),Z});return console.log("[DEBUG] Filtered header actions:",S.length),S}),Te=n.computed(()=>E.value.length===0?E.value:E.value.filter(S=>a.ignorePermissions||!S.permission?!0:a.checkPermission?a.checkPermission(S.permission):a.permissions?a.permissions.includes(S.permission):ye(S.permission))),Qe=S=>Te.value.filter(I=>ke(I,S)),wt=(S,I)=>{var $,Q;if(S.requiredCondition&&(($=S.propCustomCondition)==null?void 0:$.length)>0){const me=Ae(I,"status"),Ve=S.propCustomCondition.find(xe=>xe.value===me);if(Ve)return Ve.bgColor||S.bgColor||"primary"}if(!S.dynamicColor||!S.colorCondition)return S.bgColor||"primary";const Z=Ae(I,S.colorCondition.field),F=(Q=S.colorCondition.conditions)==null?void 0:Q.find(me=>me.value===Z);return(F==null?void 0:F.bgColor)||S.bgColor||"primary"},ln=S=>{const I=(S||"left").toLowerCase();return I==="center"?"justify-center":I==="right"?"justify-end":"justify-start"},Mo={ToggleLeft:te.ToggleLeft,SquarePen:te.SquarePen,Trash2:te.Trash2,Eye:te.Eye,CheckCircle:te.CheckCircle,Plus:te.Plus,Download:te.Download,RefreshCw:te.RefreshCw,Search:te.Search,SlidersHorizontal:te.SlidersHorizontal},No=S=>S?Ct[S]?Ct[S]:Mo[S]||null:null,q=n.computed(()=>a.dummyMode&&J.value.length>0&&p.value.length===0&&re.value.length===0?v(5):Y.value?p.value.map((S,I)=>({...S,no:(f.value-1)*h.value+I+1})):re.value),ae=n.computed(()=>Y.value?g.value:ee.value.length),pe=n.computed(()=>ae.value===0?0:(f.value-1)*h.value+1),Oe=n.computed(()=>{const S=f.value*h.value;return S>ae.value?ae.value:S}),Ae=(S,I)=>{if(!(!S||!I))return I in S?S[I]:I.split(".").reduce((Z,F)=>Z&&Z[F],S)},ee=n.computed(()=>{if(Y.value)return[];if(!u.value)return a.data;const S=u.value.toLowerCase();return a.data.filter(I=>J.value.some(Z=>{const F=Ae(I,Z.key);return F==null?!1:String(F).toLowerCase().includes(S)}))}),ne=n.computed(()=>Y.value?[]:m.value.key?[...ee.value].sort((I,Z)=>{const F=Ae(I,m.value.key),$=Ae(Z,m.value.key);if(F===$)return 0;let Q=0;return typeof F=="number"&&typeof $=="number"?Q=F-$:Q=String(F).localeCompare(String($)),m.value.direction==="asc"?Q:-Q}):ee.value),re=n.computed(()=>{if(Y.value)return[];const S=(f.value-1)*h.value,I=S+h.value;return ne.value.slice(S,I).map((Z,F)=>({...Z,no:S+F+1}))}),be=n.computed(()=>Y.value?Object.values(x.value).some(S=>!!S):!!u.value),We=[10,25,50,100],Pt=()=>{Y.value&&(x.value={...x.value,keyword:u.value},f.value=1,ot())};let qa;const zd=()=>{a.enableQuickSearch&&(clearTimeout(qa),qa=setTimeout(()=>{Pt()},500))};let Ga;const Fd=()=>{clearTimeout(Ga),Ga=setTimeout(()=>{Y.value&&ot()},1e3)};n.watch(u,()=>{a.enableQuickSearch&&Y.value&&zd()});const ot=async()=>{if(Y.value&&!(!H.value&&!X.value))try{b.value=!0;const S={page:f.value,perPage:h.value,...x.value,...a.apiParams};u.value&&(S.keyword=u.value),Object.keys(S).forEach(Z=>{(S[Z]===""||S[Z]===null||S[Z]===void 0)&&delete S[Z]});let I;H.value?I=await i(H.value,G.value,S):X.value&&(I=await i(X.value,K.value,S)),Id(I)}catch(S){console.error("DataTable fetch error",S),b.value=!1}},Id=S=>{console.log("DataTable handleResponseData:",S),S&&(a.dynamicColumns&&S.columns&&Array.isArray(S.columns)&&(_.value=S.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}))),S.data&&Array.isArray(S.data)?(p.value=S.data,S.totalData?g.value=S.totalData:S.maxPage?g.value=S.maxPage*h.value:g.value=S.data.length*(S.maxPage||1)):Array.isArray(S)?(p.value=S,g.value=S.length):S.users?(p.value=S.users,g.value=S.users.length):S.items&&Array.isArray(S.items)?(p.value=S.items,g.value=S.total||S.totalItems||S.items.length):S.list&&Array.isArray(S.list)?(p.value=S.list,g.value=S.total||S.list.length):S.rows&&Array.isArray(S.rows)?(p.value=S.rows,g.value=S.count||S.total||S.rows.length):S.result&&Array.isArray(S.result)?(p.value=S.result,g.value=S.total||S.count||S.result.length):(console.warn("DataTable: Unknown response format",S),p.value=[],g.value=0)),b.value=!1};n.onUnmounted(()=>{clearTimeout(qa),clearTimeout(Ga)});const Xa=()=>{Object.keys(x.value).forEach(S=>{x.value[S]=""}),u.value="",f.value=1,ot()},Rd=()=>{f.value=1,ot()},Ya=(S,I)=>{const Z=Ae(S,I.key);let F={variant:"secondary",class:"",label:Z};if(I.condition){const $=I.condition.find(Q=>{const me=(Ve,xe)=>typeof Ve=="string"&&typeof xe=="string"?Ve.toLowerCase().trim()===xe.toLowerCase().trim():Ve==xe;return typeof Z=="object"&&Z!==null?me(Q.value,Z.code)||me(Q.value,Z.id):me(Q.value,Z)});if($){if($.variant&&(F.variant=$.variant),F.label=$.label||(typeof Z=="object"?Z.name||Z.code:Z),$.color){const Q=$.color.toLowerCase(),me=F.variant==="outline",Ve={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"},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"},Ee={danger:"destructive",secondary:"secondary",primary:"default"};me?xe[Q]&&(F.class=xe[Q]):Ee[Q]?F.variant=Ee[Q]:Ve[Q]&&(F.class=Ve[Q])}}else F.label=typeof Z=="object"?(Z==null?void 0:Z.name)||(Z==null?void 0:Z.code)||"-":Z}else F.label=typeof Z=="object"?(Z==null?void 0:Z.name)||(Z==null?void 0:Z.code)||"-":Z;return F},Ld=S=>{m.value.key===S?m.value.direction=m.value.direction==="asc"?"desc":"asc":(m.value.key=S,m.value.direction="asc"),r("update:sort",m.value)},vs=S=>{S!==f.value&&(f.value=S,Y.value&&ot(),r("update:page",S))},$d=S=>{h.value=S,f.value=1,Y.value&&ot()},Wd=S=>{const I=Math.random()*15+75;if(S.width){const Z=parseInt(String(S.width));return Z<100?`${Math.floor(Z*(Math.random()*.2+.7))}px`:`${I}%`}return`${I}%`},Ka=()=>{u.value="",x.value={},f.value=1,ot()},BS=S=>{var I;if(console.log("[DEBUG] handleHeaderAction called:",S),S.route){if(S.path){const Z=S.route.startsWith("/")?S.route:"/"+S.route;sessionStorage.setItem(`layout_${Z}`,S.path)}d==null||d.push(S.route)}else if(S.openDialog){V.value=S,M.value=null,D.value={};const Z=S.fieldActionGlobal||S.field||[];Z.length&&Z.forEach(F=>{var me;const $=S.endpoint||((me=S.propsActionGlobal)==null?void 0:me.endpointPropAction)||S.propsActionGlobal,Q=$!=null&&$.keyParam&&$.keyParam.length>0?$.keyParam[0]:null;Q&&F.model===Q||!Q&&/^(id|ids|idAuditTrail)/i.test(F.model)?D.value[F.model]=T.value:D.value[F.model]||(D.value[F.model]="")}),A.value=!0}else r("action",{action:((I=S.propsActionCustom)==null?void 0:I.key)||S.key||"create",row:null,selection:T.value})},ES=async(S,I)=>{var Z,F,$,Q;if(S.requireConfirm){N.value={button:S,row:I},y.value=!0;return}if(S.openDialog){V.value=S,M.value=I,D.value={};const me=J.value.find(Ee=>Ee.type==="CHECKBOX"),Ve=(me==null?void 0:me.keyCheckbox)||"id";S.fieldActionCustom&&S.fieldActionCustom.forEach(Ee=>{/^(id|ids|idAuditTrail)/i.test(Ee.model)?D.value[Ee.model]=[I[Ve]]:S.action==="showToken"&&Ee.model==="token"?D.value[Ee.model]=I.token!==void 0?I.token:"":I[Ee.model]!==void 0?D.value[Ee.model]=I[Ee.model]:D.value[Ee.model]=""});const xe=S.endpoint||((Z=S.propsActionGlobal)==null?void 0:Z.endpointPropAction)||((F=S.propsActionCustom)==null?void 0:F.endpointPropAction)||(($=S.props)==null?void 0:$.endpointPropAction);if(((Q=xe==null?void 0:xe.apiMethod)==null?void 0:Q.toUpperCase())==="GET"&&xe.apiUrl){b.value=!0;const{apiUrl:Ee}=Je(),Ue={};xe.keyParam&&Array.isArray(xe.keyParam)&&xe.keyParam.forEach((Le,Re)=>{const vt=xe.model&&Re===0?xe.model:Le;I[Le]!==void 0&&(Ue[vt]=I[Le])}),Object.keys(Ue).length===0&&I.id&&(Ue.id=I.id),Ee(xe.apiUrl,"GET",Ue).then(Le=>{let Re=Le;if(Le&&Le.data!==void 0?Re=Le.data:Le&&Le.result!==void 0&&(Re=Le.result),Re!=null){if(typeof Re=="string")D.value.hasOwnProperty("token")&&(D.value.token=Re);else if(typeof Re=="object"&&(Re.item&&(Re=Re.item),Array.isArray(Re)&&(Re=Re[0]||{}),Object.keys(Re).forEach(vt=>{D.value[vt]=Re[vt]}),!D.value.token)){const vt=Object.keys(Re).find(Sn=>Sn.toLowerCase().includes("token"));if(vt)D.value.token=Re[vt];else{const Sn=Object.values(Re).filter(Qa=>typeof Qa=="string");Sn.length===1&&(D.value.token=Sn[0])}}}A.value=!0}).catch(Le=>{console.error("Fetch Data Failed",Le)}).finally(()=>{b.value=!1});return}A.value=!0;return}jd(S,I)},jd=(S,I)=>{if(S.route){if(S.path){const $=S.route.startsWith("/")?S.route:"/"+S.route;sessionStorage.setItem(`layout_${$}`,S.path)}let Z=S.route;Z.includes(":")?Z=Z.replaceAll(/:([a-zA-Z0-9_]+)/g,($,Q)=>I[Q]||I.id||Q):I.id&&(Z=`${Z.replace(/\/$/,"")}/${I.id}`);const F={};S.path&&(F.code=S.path),d==null||d.push({path:Z,query:F})}else if(S.endpoint&&S.endpoint.apiUrl){b.value=!0;const{apiUrl:Z}=Je(),F=S.endpoint.apiUrl,$=S.endpoint.apiMethod||"POST",Q={};S.endpoint.keyParam&&Array.isArray(S.endpoint.keyParam)&&S.endpoint.keyParam.forEach((me,Ve)=>{const xe=S.endpoint.model&&Ve===0?S.endpoint.model:me;I[me]!==void 0&&(Q[xe]=I[me])}),Object.keys(Q).length===0&&I.id&&(Q.id=I.id),Z(F,$,Q).then(()=>{ot(),r("action",{action:S.action||"success",row:I})}).catch(me=>{console.error("Action Failed",me)}).finally(()=>{b.value=!1})}else r("action",{action:S.action,row:I})},SS=()=>{N.value&&(jd(N.value.button,N.value.row),Ud())},AS=()=>{var S,I,Z;if(V.value){const F=V.value,$=F.endpoint||((S=F.propsActionGlobal)==null?void 0:S.endpointPropAction)||F.propsActionGlobal;let Q=($==null?void 0:$.model)||($!=null&&$.keyParam&&$.keyParam.length>0?$.keyParam[0]:null);if(!Q){const Ee=(F.fieldActionGlobal||F.fieldActionCustom||F.field||[]).find(Ue=>/^(id|ids|idAuditTrail)/i.test(Ue.model));Q=Ee?Ee.model:"ids"}let me=null,Ve=!1;if(M.value){const xe=J.value.find(Le=>Le.type==="CHECKBOX"),Ee=(xe==null?void 0:xe.keyCheckbox)||"id",Ue=M.value[Ee];$!=null&&$.apiUrl&&(me={...D.value},me[Q]||(me[Q]=[Ue]),Ve=!0)}else $!=null&&$.apiUrl&&(me={...D.value},me[Q]||(me[Q]=T.value||[]),Ve=!0);if(Ve&&me&&($!=null&&$.apiUrl)){if(((I=$==null?void 0:$.apiMethod)==null?void 0:I.toUpperCase())==="GET"){A.value=!1,M.value||(T.value=[]);return}const{apiUrl:xe}=Je(),Ee=$.apiUrl,Ue=$.apiMethod||"POST";xe(Ee,Ue,me).then(()=>{A.value=!1,M.value||(T.value=[]),ot(),r("action",{action:"success",row:null})}).catch(Le=>{console.error("Action Failed",Le)})}else if(M.value){const xe=J.value.find(Re=>Re.type==="CHECKBOX"),Ee=(xe==null?void 0:xe.keyCheckbox)||"id",Ue=M.value[Ee],Le={...D.value};Le[Q]||(Le[Q]=[Ue]),r("action",{action:V.value.action,row:Le}),A.value=!1}else{const xe={...D.value};xe[Q]||(xe[Q]=T.value);const Ee={action:((Z=V.value.propsActionGlobal)==null?void 0:Z.key)||V.value.key,row:xe,selection:T.value};r("action",Ee),A.value=!1}}},VS=S=>{const I=D.value[S];I&&xB(String(I)).then(()=>{ze.success("Berhasil disalin!",{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(Z=>{console.error("Failed to copy",Z)})},Ud=()=>{y.value=!1,N.value=null},DS=n.computed(()=>N.value?N.value.button.confirmTitle||"Confirm":""),MS=n.computed(()=>N.value?N.value.button.confirmMessage||"Confirm":"");t({fetchData:ot,filters:x,resetFilters:Xa,handleRefresh:Ka});const Ja=n.ref(""),NS=S=>{if(!S)return"";const I=S.endpoint||S.endpointGlobal||{};return JSON.stringify({url:I.apiUrl||S.apiUrl,module:I.apiModule||S.apiModule,action:I.apiAction||S.apiAction,method:I.apiMethod||S.apiMethod,params:S.apiParams,socket:I.socket||S.socketEndpoint,socketParams:S.socketParams})};return n.watch(()=>a.tableConfig,()=>{if(a.tableConfig){se();const S=NS(a.tableConfig);S!==Ja.value&&(!Ja.value&&Y.value?(Ja.value=S,ot()):(Ja.value=S,Y.value&&Fd()))}},{deep:!0,immediate:!0}),n.watch(()=>a.apiModule,()=>{Y.value&&ot()}),n.watch(()=>a.apiParams,()=>{Y.value&&ot()},{deep:!0}),n.watch(()=>B.value,S=>{console.log("[DEBUG] headerActions changed:",S.length,"items");const I=Me.value;console.log("[DEBUG] visibleHeaderActions evaluated:",I.length,"items")},{deep:!0}),n.onMounted(()=>{se(),Y.value&&(a.tableConfig||(b.value=!0,ot()))}),(S,I)=>{var Z;return n.openBlock(),n.createElementBlock("div",H2,[n.createElementVNode("div",q2,[n.createElementVNode("div",G2,[e.nested?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",X2,[n.createElementVNode("div",Y2,[n.createVNode(n.unref(te.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),n.createVNode(n.unref(PB),{modelValue:u.value,"onUpdate:modelValue":I[0]||(I[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:n.withKeys(Pt,["enter"])},null,8,["modelValue"])]),k.value.length>0?(n.openBlock(),n.createElementBlock("div",K2,[n.createVNode(DB,null,{trigger:n.withCtx(()=>[n.createVNode(Ge,{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:n.withCtx(()=>[n.createElementVNode("div",tE,[n.renderSlot(S.$slots,"filter-footer",{fetch:ot,reset:Xa})])]),default:n.withCtx(()=>[I[8]||(I[8]=n.createElementVNode("hr",{class:"border-neutral-200 dark:border-neutral-700"},null,-1)),n.createElementVNode("div",J2,[n.renderSlot(S.$slots,"filter-form",{filters:x.value},()=>[k.value.length>0?(n.openBlock(),n.createElementBlock("div",Q2,[n.createElementVNode("div",Z2,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(he.value,(F,$)=>(n.openBlock(),n.createElementBlock("div",{key:$,class:n.normalizeClass(ge(F))},[n.createVNode(wd,{field:F,modelValue:x.value[F.model],"onUpdate:modelValue":Q=>x.value[F.model]=Q},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):n.createCommentVNode("",!0)]),k.value.length>0?(n.openBlock(),n.createElementBlock("div",eE,[n.createVNode(Ge,{variant:"outline",text:"Reset",tooltip:"Reset",rounded:"md",icon:"RefreshCw",onClick:Xa,disabled:j.value},null,8,["disabled"]),n.createVNode(Ge,{onClick:Rd,disabled:j.value,rounded:"md",text:"Search",tooltip:"Search",icon:"Search"},null,8,["disabled"])])):n.createCommentVNode("",!0)])]),_:3})])):n.createCommentVNode("",!0)])),n.createElementVNode("div",{class:n.normalizeClass(["flex items-center gap-2 flex-wrap",{"w-full justify-between":e.nested}])},[e.nested?(n.openBlock(),n.createElementBlock("span",nE)):n.createCommentVNode("",!0),e.nested?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(Ge,{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:Ka,disabled:j.value},{icon:n.withCtx(()=>[n.createVNode(n.unref(te.RefreshCw),{class:n.normalizeClass(["w-3.5 h-3.5",{"animate-spin":j.value}])},null,8,["class"])]),_:1},8,["disabled"])),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Me.value,(F,$)=>(n.openBlock(),n.createBlock(Ge,{key:$,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:Q=>BS(F)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),n.renderSlot(S.$slots,"header-actions")],2)])]),n.createElementVNode("div",oE,[n.createElementVNode("table",aE,[n.createElementVNode("thead",rE,[n.createElementVNode("tr",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(J.value,F=>(n.openBlock(),n.createElementBlock("th",{key:F.key,class:n.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:n.normalizeStyle(F.width?{width:F.width}:{}),onClick:$=>F.sortable&&Ld(F.key)},[F.type==="CHECKBOX"?(n.openBlock(),n.createElementBlock("div",iE,[n.createVNode(on,{"model-value":U.value,indeterminate:L.value,"onUpdate:modelValue":I[1]||(I[1]=$=>P(!!$)),onClick:I[2]||(I[2]=n.withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate"])])):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["flex items-center gap-2 w-full",ln(F.align)])},[n.createElementVNode("span",null,n.toDisplayString(F.label),1)],2))],14,sE))),128)),O.value?(n.openBlock(),n.createElementBlock("th",lE,[...I[9]||(I[9]=[n.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):n.createCommentVNode("",!0)])]),n.createElementVNode("tbody",cE,[j.value?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(h.value,F=>(n.openBlock(),n.createElementBlock("tr",{key:`skeleton-${F}`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(J.value,$=>{var Q,me;return n.openBlock(),n.createElementBlock("td",{key:$.key,class:n.normalizeClass([$.align?`text-${$.align.toLowerCase()}`:"text-left","px-3 py-0.5"])},[n.createElementVNode("div",{class:n.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($.type??"")||$.condition?"h-5 rounded-full w-20":"h-4 rounded-md",((Q=$.align)==null?void 0:Q.toLowerCase())==="center"?"mx-auto":"",((me=$.align)==null?void 0:me.toLowerCase())==="right"?"ml-auto":""]]),style:n.normalizeStyle({width:["badge","BADGE"].includes($.type??"")||$.condition?void 0:Wd($),backgroundSize:"200% 100%"})},null,6)],2)}),128)),e.hasActions?(n.openBlock(),n.createElementBlock("td",dE,[...I[10]||(I[10]=[n.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[n.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse"}),n.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-75"}),n.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-150"})],-1)])])):n.createCommentVNode("",!0)]))),128)):q.value.length===0?(n.openBlock(),n.createElementBlock("tr",uE,[n.createElementVNode("td",{colspan:J.value.length+(O.value?1:0),class:"text-center py-16"},[n.createElementVNode("div",hE,[n.createVNode(n.unref(eu.Vue3Lottie),{animationData:n.unref(U2),height:200,width:200},null,8,["animationData"]),n.createElementVNode("div",null,[n.createElementVNode("p",mE,n.toDisplayString(be.value?"No search results":"No data"),1),n.createElementVNode("p",pE,n.toDisplayString(be.value?"Try changing keywords":"No data added"),1)])])],8,fE)])):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:2},n.renderList(q.value,(F,$)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:$},[n.createElementVNode("tr",gE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(J.value,Q=>(n.openBlock(),n.createElementBlock("td",{key:Q.key,class:n.normalizeClass([Q.align?`text-${Q.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[n.renderSlot(S.$slots,`cell-${Q.key}`,{row:F,value:Ae(F,Q.key)},()=>[Q.type==="CHECKBOX"?(n.openBlock(),n.createElementBlock("div",bE,[n.createVNode(on,{"model-value":R(F),"onUpdate:modelValue":me=>W(F,!!me),onClick:I[3]||(I[3]=n.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):Q.type==="badge"||Q.type==="BADGE"||Q.condition?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[Q.align?`justify-${Q.align.toLowerCase()}`:"justify-start"]])},[n.createVNode(n.unref(Wn),{variant:Ya(F,Q).variant,class:n.normalizeClass([Ya(F,Q).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(Ya(F,Q).label),1)]),_:2},1032,["variant","class"])],2)):Q.key==="no"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createTextVNode(n.toDisplayString((f.value-1)*h.value+$+1),1)],64)):Q.type==="date"||Q.type==="DATE"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createTextVNode(n.toDisplayString(Ae(F,Q.key)?n.unref(bB)(Ae(F,Q.key),"long"):"-"),1)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:4},[n.createTextVNode(n.toDisplayString(Q.format?Q.format(Ae(F,Q.key)):Ae(F,Q.key)),1)],64))])],2))),128)),O.value?(n.openBlock(),n.createElementBlock("td",yE,[n.renderSlot(S.$slots,"actions",{row:F,buttons:Qe(F),getButtonColor:wt,getIconComponent:No},()=>[Qe(F).length>0?(n.openBlock(),n.createElementBlock("div",xE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Qe(F),(Q,me)=>(n.openBlock(),n.createElementBlock("div",{key:me,class:"group relative"},[n.createVNode(Ge,{tooltip:Q.tooltip||Q.label,icon:Q.icon,size:"icon",rounded:Q.rounded||"sm",borderStyle:Q.borderStyle||"none",variant:Q.variant||"ghost","bg-color":wt(Q,F),onClick:Ve=>ES(Q,F)},null,8,["tooltip","icon","rounded","borderStyle","variant","bg-color","onClick"])]))),128))])):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0)]),S.$slots["expanded-row"]?(n.openBlock(),n.createElementBlock("tr",kE,[n.createElementVNode("td",{colspan:J.value.length+(O.value?1:0),class:"px-0 py-0"},[n.renderSlot(S.$slots,"expanded-row",{row:F,index:$})],8,wE)])):n.createCommentVNode("",!0)],64))),128))])])]),!j.value&&q.value.length>0&&e.showPagination&&w.value?(n.openBlock(),n.createElementBlock("div",CE,[n.createElementVNode("div",_E,[n.createVNode(n.unref($B),{"model-value":String(h.value),"onUpdate:modelValue":I[4]||(I[4]=F=>$d(Number(F)))},{default:n.withCtx(()=>[n.createVNode(n.unref(GB),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:n.withCtx(()=>[n.createVNode(n.unref(XB),{placeholder:String(h.value)},null,8,["placeholder"])]),_:1}),n.createVNode(n.unref(WB),null,{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(We,F=>n.createVNode(n.unref(UB),{key:F,value:String(F)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(F),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),I[15]||(I[15]=n.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),n.createElementVNode("span",BE,[I[11]||(I[11]=n.createTextVNode(" Showing ",-1)),n.createElementVNode("span",EE,n.toDisplayString(pe.value),1),I[12]||(I[12]=n.createTextVNode(" to ",-1)),n.createElementVNode("span",SE,n.toDisplayString(Oe.value),1),I[13]||(I[13]=n.createTextVNode(" of ",-1)),n.createElementVNode("span",AE,n.toDisplayString(ae.value),1),I[14]||(I[14]=n.createTextVNode(" items ",-1))])]),n.createElementVNode("div",VE,[n.createVNode(n.unref(vB),{total:ae.value,"items-per-page":h.value,"sibling-count":1,"show-edges":"",page:f.value,"onUpdate:page":vs,class:"scale-90 origin-right"},{default:n.withCtx(()=>[n.createVNode(n.unref(TB),{class:"flex items-center gap-1"},{default:n.withCtx(({items:F})=>[n.createVNode(n.unref(zB),{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:n.withCtx(()=>[n.createVNode(n.unref(te.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(LB),{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:n.withCtx(()=>[n.createVNode(n.unref(te.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(F,($,Q)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[$.type==="page"?(n.openBlock(),n.createBlock(n.unref(FB),{key:Q,value:$.value,"as-child":""},{default:n.withCtx(()=>[n.createVNode(n.unref(ut),{class:"w-8 h-8 p-0 text-sm",variant:$.value===f.value?"default":"outline",disabled:$.value===f.value,onClick:me=>vs($.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString($.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(n.openBlock(),n.createBlock(n.unref(OB),{key:$.type,index:Q},null,8,["index"]))],64))),256)),n.createVNode(n.unref(RB),{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:n.withCtx(()=>[n.createVNode(n.unref(te.ChevronRight),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(IB),{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:n.withCtx(()=>[n.createVNode(n.unref(te.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):n.createCommentVNode("",!0),n.createVNode(So,{modelValue:y.value,"onUpdate:modelValue":I[5]||(I[5]=F=>y.value=F),title:DS.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:n.withCtx(()=>[n.createVNode(Ge,{variant:"outline",onClick:Ud,text:"Cancel"}),n.createVNode(Ge,{variant:"default",onClick:SS,text:"Yes"})]),default:n.withCtx(()=>[n.createElementVNode("div",DE,[n.createElementVNode("p",ME,n.toDisplayString(MS.value),1)])]),_:1},8,["modelValue","title"]),n.createVNode(So,{modelValue:A.value,"onUpdate:modelValue":I[7]||(I[7]=F=>A.value=F),title:((Z=V.value)==null?void 0:Z.label)||"Action",icon:"AlertCircle","max-width":450},{actions:n.withCtx(()=>[n.createVNode(Ge,{variant:"outline",onClick:I[6]||(I[6]=F=>A.value=!1),text:"Cancel"}),n.createVNode(Ge,{variant:"default",onClick:AS,text:"Save"})]),default:n.withCtx(()=>{var F,$;return[n.createElementVNode("div",NE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(((F=V.value)==null?void 0:F.fieldActionCustom)||(($=V.value)==null?void 0:$.fieldActionGlobal)||[],(Q,me)=>{var Ve,xe,Ee;return n.openBlock(),n.createElementBlock(n.Fragment,{key:me},[Q.isHidden?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(ge(Q))},[n.createElementVNode("div",PE,[n.createVNode(wd,{class:"flex-1 w-full",field:Q,modelValue:D.value[Q.model],"onUpdate:modelValue":Ue=>D.value[Q.model]=Ue},null,8,["field","modelValue","onUpdate:modelValue"]),Q.isCopyable||(Ve=Q.props)!=null&&Ve.isCopyable||((xe=V.value)==null?void 0:xe.action)==="showToken"||((Ee=V.value)==null?void 0:Ee.action)==="copyToken"?(n.openBlock(),n.createBlock(Ge,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:"Salin",onClick:Ue=>VS(Q.model)},null,8,["onClick"])):n.createCommentVNode("",!0)])],2))],64)}),128))])]}),_:1},8,["modelValue","title"])])}}});function vE(){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 TE={class:"flex flex-col gap-3 w-full"},OE={key:0,class:"col-span-full flex flex-col gap-2 p-3 bg-white dark:bg-slate-900 border border-dashed border-slate-200 dark:border-slate-800 rounded-lg opacity-70 pointer-events-none animate-pulse"},zE={class:"flex flex-col items-center justify-center gap-2 py-6 rounded-lg border border-dashed border-slate-300 dark:border-slate-700 bg-slate-50 dark:bg-slate-800 text-slate-400"},FE={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-slate-800/50 border border-slate-200 dark:border-slate-800 rounded-lg opacity-70"},IE={class:"text-sm font-medium text-slate-500"},RE={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"},LE={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},$E=["onClick"],WE=["for","onDrop"],jE={class:"text-xs text-slate-500 dark:text-slate-400"},UE={key:2,class:"text-xs text-slate-400"},HE=["id","disabled","accept","onChange"],qE=n.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"],setup(e,{emit:t}){const o=e,a=t,{t:r,locale:s}=Ht.useI18n(),i=n.computed(()=>{const x=o.endpoint;if(!(x!=null&&x.apiUrl))return null;let _=x.apiUrl;if(!_.startsWith("http")&&o.baseUrl){const C=o.baseUrl.replace(/\/$/,""),w=_.startsWith("/")?_:`/${_}`;_=`${C}${w}`}return _}),l=n.computed(()=>{const x=c.value.length;return x<=1?"grid-cols-1":x===2?"grid-cols-1 md:grid-cols-2":x===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":x===4?"grid-cols-1 md:grid-cols-2 lg:grid-cols-3":"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}),c=n.ref([]),d=n.ref([]),u=n.ref(new Set),f=n.ref(!0),h=async()=>{var x;if(f.value=!0,o.items!==void 0){c.value=o.items,f.value=!1;return}if(!((x=o.endpointReference)!=null&&x.apiUrl)){f.value=!1;return}try{const{apiUrl:_}=Je(),C=(o.endpointReference.apiMethod||"GET").toUpperCase()==="GET",w=await _(o.endpointReference.apiUrl,o.endpointReference.apiMethod||"GET",C?{page:1,perPage:100}:void 0);if(o.items!==void 0){f.value=!1;return}let E=(w==null?void 0:w.data)||w;Array.isArray(E)||(E=[E]),c.value=E}catch(_){console.error("Failed to fetch dynamic document list",_)}finally{f.value=!1}};n.onMounted(()=>{Array.isArray(o.modelValue)&&o.modelValue.length>0&&(d.value=structuredClone(n.toRaw(o.modelValue))),h()}),n.watch(()=>o.modelValue,x=>{Array.isArray(x)&&JSON.stringify(x)!==JSON.stringify(d.value)&&(d.value=structuredClone(n.toRaw(x)))},{deep:!0}),n.watch(()=>{var x;return(x=o.endpointReference)==null?void 0:x.apiUrl},(x,_)=>{x!==_&&h()}),n.watch(()=>{var x;return(x=o.endpointReference)==null?void 0:x.apiMethod},(x,_)=>{x!==_&&h()}),n.watch(()=>o.items,x=>{c.value=x??[],f.value=!1},{deep:!0,immediate:!0});const m=x=>{const _=x[o.itemValue]||x.id||x.typeDocument;return d.value.find(C=>C.typeDocument===_||C.idDocumentType===_||C[o.itemValue]===_)||null},p=async(x,_,C)=>{var k,y,A,D,N,V;const w=C.target,E=(k=w.files)==null?void 0:k[0];if(!E)return;const B=x[o.itemValue]||x.id||x.typeDocument;if(x[o.itemTitle]||x.name||x.filename,!i.value){const M=[...d.value],T=M.findIndex(L=>L.typeDocument===B||L.idDocumentType===B),U={id:null,filename:E.name,document:E.name,typeDocument:B};T>-1?M[T]={...M[T],...U}:M.push(U),d.value=M,a("update:modelValue",M);return}u.value.add(_);try{const{apiUrl:M}=Je(),T=new FormData;T.append("file",E),T.append("typeDocument",String(B));const U=await M(i.value,((y=o.endpoint)==null?void 0:y.apiMethod)||"POST",T),L=((A=U==null?void 0:U.data)==null?void 0:A.url)||((D=U==null?void 0:U.data)==null?void 0:D.document)||(U==null?void 0:U.url)||E.name,R=((N=U==null?void 0:U.data)==null?void 0:N.id)||(U==null?void 0:U.id)||null,P=((V=U==null?void 0:U.data)==null?void 0:V.filename)||(U==null?void 0:U.filename)||E.name,W=[...d.value],v=W.findIndex(H=>H.typeDocument===B||H.idDocumentType===B),z={id:R,filename:P,document:L,typeDocument:B};v>-1?W[v]={...W[v],...z}:W.push(z),d.value=W,a("update:modelValue",W)}catch(M){console.error("Upload failed",M)}finally{u.value.delete(_),w.value=""}},b=x=>{const _=x[o.itemValue]||x.id||x.typeDocument,C=d.value.filter(w=>w.typeDocument!==_&&w.idDocumentType!==_);d.value=C,a("update:modelValue",C)},g=(x,_,C)=>{var B,k;C.preventDefault();const w=(k=(B=C.dataTransfer)==null?void 0:B.files)==null?void 0:k[0];if(!w)return;p(x,_,{target:{files:[w],value:""}})};return(x,_)=>(n.openBlock(),n.createElementBlock("div",TE,[e.label||e.labelID||e.labelEN?(n.openBlock(),n.createBlock(jn,{key:0,text:e.label||(n.unref(s).toLowerCase().startsWith("en")?e.labelEN:e.labelID),class:"font-semibold text-sm text-slate-700 dark:text-slate-300",required:e.required},null,8,["text","required"])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["w-full grid gap-4",l.value])},[c.value.length===0&&f.value?(n.openBlock(),n.createElementBlock("div",OE,[n.createVNode(jn,{text:n.unref(r)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-slate-300"},null,8,["text"]),n.createElementVNode("div",zE,[n.createVNode(n.unref(te.Loader2),{class:"w-6 h-6 animate-spin"})])])):c.value.length===0&&!f.value?(n.openBlock(),n.createElementBlock("div",FE,[n.createVNode(n.unref(te.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),n.createElementVNode("span",IE,n.toDisplayString(n.unref(r)("dynamicUploadList.noDocsRequired")),1)])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,(C,w)=>{var E;return n.openBlock(),n.createElementBlock("div",{key:w,class:"flex flex-col gap-2 p-3 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg shadow-sm"},[n.createVNode(jn,{text:C[e.itemTitle]||C.name||C.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-slate-300"},null,8,["text"]),m(C)?(n.openBlock(),n.createElementBlock("div",RE,[n.createVNode(n.unref(te.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),n.createElementVNode("span",LE,n.toDisplayString(((E=m(C))==null?void 0:E.filename)||n.unref(r)("dynamicUploadList.fileUploaded")),1),e.disabled?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"text-red-400 hover:text-red-600 transition-colors",onClick:B=>b(C)},[n.createVNode(n.unref(te.X),{class:"w-4 h-4"})],8,$E))])):(n.openBlock(),n.createElementBlock("label",{key:1,for:`dyn-upload-input-${w}`,class:n.normalizeClass(["flex flex-col items-center justify-center gap-2 py-8 rounded-lg border-2 border-dashed transition-colors cursor-pointer",[e.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(w)?"pointer-events-none opacity-70":""]]),onDragover:_[0]||(_[0]=n.withModifiers(()=>{},["prevent"])),onDrop:B=>!e.disabled&&!u.value.has(w)&&g(C,w,B)},[u.value.has(w)?(n.openBlock(),n.createBlock(n.unref(te.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(n.openBlock(),n.createBlock(n.unref(te.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),n.createElementVNode("span",jE,n.toDisplayString(u.value.has(w)?n.unref(r)("dynamicUploadList.uploading"):n.unref(r)("dynamicUploadList.clickOrDrag")),1),e.typeFile?(n.openBlock(),n.createElementBlock("span",UE,n.toDisplayString(e.typeFile),1)):n.createCommentVNode("",!0),n.createElementVNode("input",{id:`dyn-upload-input-${w}`,type:"file",class:"sr-only",disabled:e.disabled||u.value.has(w),accept:e.typeFile,onChange:B=>p(C,w,B)},null,40,HE)],42,WE))])}),128))],2)]))}}),GE={key:0},XE=["value","name"],YE={key:2,class:"text-xs text-neutral-400 italic"},Ms=n.defineComponent({__name:"DynamicFormField",props:{field:{},modelValue:{default:null},formData:{default:()=>({})},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){let o=n.ref("en");try{o=Ht.useI18n().locale}catch{}const a=e,r=t,s=n.ref(a.modelValue);n.watch(()=>a.modelValue,u=>{s.value=u});const i={DCodeTextField:va,DCodeAutoComplete:Lo,DCodeDatePicker:Sa,DCodeTextarea:Un,DCodeTextArea:Un,DCodeCheckbox:on,DCodeSwitch:Pa,DCodeOtpInput:Da,DCodeImageField:Va,DCodeSlider:Na,DCodeRadio:ys,DCodeRadioCustom:xs,DCodeDynamicUploadList:qE,DCodeMultiSelect:bs,DCodeCurrencyField:ls,DCodePermissionMenu:ws,DCodeTreePermissions:Cs},l=n.computed(()=>{const u=a.field.component;return i[u]||null}),c=n.computed(()=>{const u=a.field.props||{},f={};if((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),f.required=a.required!==void 0?a.required:u.required??!1,["disabled","readonly","clearable","returnObject","itemTitle","itemValue","maxLength","minLength","maxValue","minValue","sizeFile","typeFile","treeData","menuList","enableParentControl","showIcons"].forEach(m=>{u[m]!==void 0&&u[m]!==null&&(f[m]=u[m])}),u.valueType&&(f.type=u.valueType),u.endpoint&&u.endpoint.apiUrl){const m={};Array.isArray(u.endpoint.keyParam)&&u.endpoint.keyParam.forEach(p=>{a.formData&&a.formData[p]!=null&&(m[p]=a.formData[p])}),f.endpoint={apiUrl:u.endpoint.apiUrl,apiMethod:u.endpoint.apiMethod||"GET"},Object.keys(m).length&&(f.apiParams=m)}return u.endpointReference&&u.endpointReference.apiUrl&&(f.endpointReference=u.endpointReference),f}),d=u=>{s.value=u,r("update:modelValue",u)};return(u,f)=>e.field.isHidden?(n.openBlock(),n.createElementBlock("div",GE,[n.createElementVNode("input",{type:"hidden",value:s.value,name:e.field.model},null,8,XE)])):l.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.value),n.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"])):(n.openBlock(),n.createElementBlock("div",YE," Unknown field: "+n.toDisplayString(e.field.component),1))}}),KE={class:"w-full space-y-6"},JE={key:0,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},QE={class:"flex items-center justify-between mb-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30"},ZE={key:0,class:"px-4 py-3"},eS={class:"text-sm font-semibold text-white"},tS={class:"px-4 py-3"},nS={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},oS={key:0,class:"px-4 py-2 bg-primary-700 dark:bg-primary-900 flex items-center justify-end gap-2"},aS={key:2,class:"w-full"},rS={class:"space-y-6 mt-4"},sS={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},iS={key:2,class:"p-4 border border-dashed border-neutral-300 rounded-lg text-xs text-neutral-400"},lS={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},cS=n.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["submit","cancel","action"],setup(e,{emit:t}){const o=e,a=t;let r=n.ref("en"),s=P=>P;try{const P=Ht.useI18n();r=P.locale,s=P.t}catch{}const i=n.ref(!1),l=n.ref(null),c=n.computed(()=>o.schema||l.value),d=n.reactive({}),u=n.reactive({}),f=n.reactive({}),h=P=>{var W,v,z;return((W=P.propsForm)==null?void 0:W.key)||((v=P.propsTable)==null?void 0:v.key)||((z=P.propsWizard)==null?void 0:z.key)||P.id||"unknown-section"},m=P=>{var z;const W=((z=P.propsWizard)==null?void 0:z.propsSteps)||[],v=r.value==="en";return W.map((H,G)=>{let K=[];if(Array.isArray(H.sectionsWizard))K=H.sectionsWizard;else if(H.sectionsWizard&&typeof H.sectionsWizard=="object"){const X=H.sectionsWizard;K=[{type:X.type||(X.fields?"FORM":X.isDataTable?"TABLE":"UNKNOWN"),...X}]}return{key:H.key||`step-${G}`,title:v?H.titleEN:H.titleID,description:v?H.descriptionEN:H.descriptionID,icon:H.icon||void 0,sections:K}})},p=P=>P?[...P].sort((W,v)=>(W.seq||0)-(v.seq||0)):[],b=(P,W)=>{d[P]=W};n.watch(()=>o.model,P=>{P&&Object.keys(P).forEach(W=>{d[W]=P[W]})},{immediate:!0,deep:!0}),n.watch(()=>c.value,P=>{P!=null&&P.sections&&P.sections.forEach(W=>{var v,z,H;if(((v=W.type)==null?void 0:v.toUpperCase())==="TABLE"&&((z=W.propsTable)!=null&&z.modelDatatable)){const G=W.propsTable.modelDatatable;(!d[G]||!Array.isArray(d[G]))&&(d[G]=[])}else if(((H=W.type)==null?void 0:H.toUpperCase())==="WIZARD"){const G=h(W);u[G]===void 0&&(u[G]=0)}})},{immediate:!0});const g=(P,W)=>{if(P==null)return!0;if(typeof P!="object")return P;if("var"in P)return W[P.var]??null;if("=="in P){const[v,z]=P["=="].map(H=>g(H,W));return v==z}if("!="in P){const[v,z]=P["!="].map(H=>g(H,W));return v!=z}if(">"in P){const[v,z]=P[">"].map(H=>g(H,W));return v>z}if(">="in P){const[v,z]=P[">="].map(H=>g(H,W));return v>=z}if("<"in P){const[v,z]=P["<"].map(H=>g(H,W));return v<z}if("and"in P)return P.and.every(v=>g(v,W));if("or"in P)return P.or.some(v=>g(v,W));if("!"in P)return!g(P["!"],W);if("length"in P){const v=g(P.length,W);return v==null?0:typeof v=="string"||Array.isArray(v)?v.length:0}return!0},x=P=>{var v;const W=(v=P.logic)==null?void 0:v.visibleRule;return!W||Object.keys(W).length===0?!0:!!g(W,d)},_=P=>{var z,H;const W=((z=P.props)==null?void 0:z.required)??!1,v=(H=P.logic)==null?void 0:H.requiredRule;return!v||Object.keys(v).length===0?W:!!g(v,d)},C=async P=>{const W=P.propsActionGlobal;if(!W)return;const v=W.fieldMapping;let z={};v&&typeof v=="object"&&Object.keys(v).length>0?Object.keys(v).forEach(H=>{const G=v[H];d[H]!==void 0&&(z[G]=d[H])}):z={...d},a("action",W.key||"",P,z)},w=async()=>{i.value=!0;try{a("submit",{...d})}finally{i.value=!1}},E=()=>{a("cancel")},B=P=>P.permission?o.isEditMode?P.permission!=="CREATE":P.permission!=="UPDATE":!0,k=P=>{const W=P.modelDatatable;if(!W)return[];const v=d[W];return Array.isArray(v)?v:[]},y=n.ref(!1),A=n.ref(""),D=n.ref([]),N=n.reactive({}),V=n.ref(""),M=n.ref(null),T=n.ref(null),U=(P,W)=>{var z,H;V.value=P.modelDatatable||"",T.value=W,M.value=null;const v=W.fieldActionGlobal||[];D.value=v,A.value=((z=W.propsActionGlobal)==null?void 0:z.labelID)||((H=W.propsActionGlobal)==null?void 0:H.labelEN)||"Add Row",Object.keys(N).forEach(G=>delete N[G]),v.forEach(G=>{N[G.model]=null}),y.value=!0},L=(P,W)=>{var ge;const{action:v,row:z}=W;if(/delete|trash|remove/i.test(v)){const se=P.modelDatatable;if(se&&Array.isArray(d[se])){const J=d[se].indexOf(z);if(J!==-1)d[se].splice(J,1);else{const O=JSON.stringify(z),j=d[se].findIndex(Y=>JSON.stringify(Y)===O);j!==-1&&d[se].splice(j,1)}}return}const G=P.modelDatatable||"";V.value=G;const K=d[G],X=Array.isArray(K)?K.indexOf(z):-1;M.value=X!==-1?X:null;const oe=P.actionTableGlobal||[],he=((ge=oe[0])==null?void 0:ge.fieldActionGlobal)||[];D.value=he,A.value="Edit Row",T.value=oe[0],Object.keys(N).forEach(se=>delete N[se]),he.forEach(se=>{N[se.model]=z[se.model]??null}),y.value=!0},R=()=>{const P=V.value;if(!P)return;Array.isArray(d[P])||(d[P]=[]);const W={...N};M.value!==null?d[P].splice(M.value,1,W):d[P].push(W),y.value=!1};return(P,W)=>{var v,z,H,G,K;return n.openBlock(),n.createElementBlock("div",KE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList((v=c.value)==null?void 0:v.sections,(X,oe)=>{var he,ge,se,J,O;return n.openBlock(),n.createElementBlock(n.Fragment,{key:oe},[((he=X.type)==null?void 0:he.toUpperCase())==="FORM"&&X.propsForm?(n.openBlock(),n.createElementBlock("div",JE,[n.createElementVNode("div",QE,[X.propsForm.titleID||X.propsForm.titleEN?(n.openBlock(),n.createElementBlock("div",ZE,[n.createElementVNode("h3",eS,n.toDisplayString(n.unref(r)==="id"?X.propsForm.titleID:X.propsForm.titleEN),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",tS,[n.createVNode(Ge,{size:"sm",icon:"List",text:n.unref(s)("common.back"),variant:"outline",onClick:E},null,8,["text"])])]),n.createElementVNode("div",{class:n.normalizeClass(["p-4 grid gap-4",X.propsForm.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(p(X.propsForm.fields),j=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:j.key},[x(j)?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass([j.column==="FULL"&&X.propsForm.layoutColumns>1?"md:col-span-2":"col-span-1"])},[n.createVNode(Ms,{field:j,"model-value":d[j.model],"form-data":d,required:_(j),"onUpdate:modelValue":Y=>b(j.model,Y)},null,8,["field","model-value","form-data","required","onUpdate:modelValue"])],2)):n.createCommentVNode("",!0)],64))),128))],2)])):((ge=X.type)==null?void 0:ge.toUpperCase())==="TABLE"&&X.propsTable?(n.openBlock(),n.createElementBlock("div",nS,[(se=X.propsTable.actionTableGlobal)!=null&&se.length?(n.openBlock(),n.createElementBlock("div",oS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(X.propsTable.actionTableGlobal,(j,Y)=>{var ie,ye;return n.openBlock(),n.createElementBlock(n.Fragment,{key:Y},[j.propsActionGlobal?(n.openBlock(),n.createBlock(Ge,{key:0,icon:j.propsActionGlobal.icon,"bg-color":((ie=j.propsActionGlobal.bgColor)==null?void 0:ie.toLowerCase())||"primary",variant:((ye=j.propsActionGlobal.variant)==null?void 0:ye.toLowerCase())||"default",size:"sm",onClick:ke=>U(X.propsTable,j)},null,8,["icon","bg-color","variant","onClick"])):n.createCommentVNode("",!0)],64)}),128))])):n.createCommentVNode("",!0),n.createVNode(Xn,{"table-config":X.propsTable,data:k(X.propsTable),nested:!0,"show-pagination":X.propsTable.pagination??!0,onAction:j=>L(X.propsTable,j)},null,8,["table-config","data","show-pagination","onAction"])])):((J=X.type)==null?void 0:J.toUpperCase())==="WIZARD"&&X.propsWizard?(n.openBlock(),n.createElementBlock("div",aS,[n.createVNode(ks,{tabs:m(X),modelValue:u[h(X)],"onUpdate:modelValue":j=>u[h(X)]=j,"is-vertical":X.propsWizard.isVertical,"is-wizard":X.propsWizard.isWizard,"type-wizard":((O=X.propsWizard.typeWizard)==null?void 0:O.toLowerCase())||"icon",loading:i.value},n.createSlots({_:2},[n.renderList(m(X),j=>({name:`tab-${j.key}`,fn:n.withCtx(()=>[n.createElementVNode("div",rS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(j.sections,(Y,ie)=>{var ye,ke,Me;return n.openBlock(),n.createElementBlock(n.Fragment,{key:ie},[((ye=Y.type)==null?void 0:ye.toUpperCase())==="FORM"?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["grid gap-4",Y.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(p(Y.fields),Te=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:Te.key},[x(Te)?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass([Te.column==="FULL"&&Y.layoutColumns>1?"md:col-span-2":"col-span-1"])},[n.createVNode(Ms,{field:Te,"model-value":d[Te.model],"form-data":d,required:_(Te),"onUpdate:modelValue":Qe=>b(Te.model,Qe)},null,8,["field","model-value","form-data","required","onUpdate:modelValue"])],2)):n.createCommentVNode("",!0)],64))),128))],2)):((ke=Y.type)==null?void 0:ke.toUpperCase())==="TABLE"||Y.isDataTable?(n.openBlock(),n.createElementBlock("div",sS,[n.createVNode(Xn,{"table-config":Y.propsDataTableWizard||Y.propsTable,data:k(Y.propsDataTableWizard||Y.propsTable),nested:!0,"show-pagination":((Me=Y.propsDataTableWizard||Y.propsTable)==null?void 0:Me.pagination)??!0,onAction:Te=>L(Y.propsDataTableWizard||Y.propsTable,Te)},null,8,["table-config","data","show-pagination","onAction"])])):(n.openBlock(),n.createElementBlock("div",iS," Unknown section type: "+n.toDisplayString(Y.type),1))],64)}),128))])])}))]),1032,["tabs","modelValue","onUpdate:modelValue","is-vertical","is-wizard","type-wizard","loading"])])):n.createCommentVNode("",!0)],64)}),128)),f!=null&&f.global?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(((H=(z=c.value)==null?void 0:z.ui)==null?void 0:H.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 border-t border-neutral-100 dark:border-neutral-800")},[(K=(G=c.value)==null?void 0:G.actionGlobal)!=null&&K.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(c.value.actionGlobal,(X,oe)=>{var he,ge;return n.openBlock(),n.createElementBlock(n.Fragment,{key:oe},[X.propsActionGlobal&&B(X)?(n.openBlock(),n.createBlock(Ge,{key:0,icon:X.propsActionGlobal.icon,text:n.unref(r)==="id"?X.propsActionGlobal.labelID:X.propsActionGlobal.labelEN,"bg-color":((he=X.propsActionGlobal.bgColor)==null?void 0:he.toLowerCase())||"primary",variant:((ge=X.propsActionGlobal.variant)==null?void 0:ge.toLowerCase())||"default",loading:i.value,onClick:se=>C(X)},null,8,["icon","text","bg-color","variant","loading","onClick"])):n.createCommentVNode("",!0)],64)}),128)):(n.openBlock(),n.createBlock(Ge,{key:1,text:"Submit","bg-color":"primary",loading:i.value,onClick:w},null,8,["loading"]))],2)),n.createVNode(So,{modelValue:y.value,"onUpdate:modelValue":W[1]||(W[1]=X=>y.value=X),title:A.value,icon:"Plus","max-width":700},{actions:n.withCtx(()=>[n.createVNode(Ge,{variant:"outline",text:"Cancel",onClick:W[0]||(W[0]=X=>y.value=!1)}),n.createVNode(Ge,{text:"Save",onClick:R})]),default:n.withCtx(()=>[D.value.length?(n.openBlock(),n.createElementBlock("div",lS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(D.value,X=>(n.openBlock(),n.createElementBlock("div",{key:X.key,class:n.normalizeClass(X.column==="FULL"?"md:col-span-2":"col-span-1")},[n.createVNode(Ms,{field:X,"model-value":N[X.model],"form-data":N,"onUpdate:modelValue":oe=>N[X.model]=oe},null,8,["field","model-value","form-data","onUpdate:modelValue"])],2))),128))])):n.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}}}),dS={class:"w-full space-y-6 animate-pulse"},uS={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},fS=n.defineComponent({__name:"AutoLayoutSkeleton",setup(e){return(t,o)=>(n.openBlock(),n.createElementBlock("div",dS,[o[2]||(o[2]=n.createElementVNode("div",{class:"h-6 w-48 bg-neutral-200 dark:bg-neutral-700 rounded-md"},null,-1)),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(2,a=>n.createElementVNode("div",{key:a,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 overflow-hidden"},[o[1]||(o[1]=n.createElementVNode("div",{class:"px-4 py-3 bg-neutral-200 dark:bg-neutral-700"},[n.createElementVNode("div",{class:"h-4 w-32 bg-neutral-300 dark:bg-neutral-600 rounded"})],-1)),n.createElementVNode("div",uS,[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(6,r=>n.createElementVNode("div",{key:r,class:n.normalizeClass(r>4?"md:col-span-2":"col-span-1")},[...o[0]||(o[0]=[n.createElementVNode("div",{class:"h-3 w-24 bg-neutral-200 dark:bg-neutral-700 rounded mb-2"},null,-1),n.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]=n.createElementVNode("div",{class:"flex items-center gap-2"},[n.createElementVNode("div",{class:"h-9 w-24 bg-neutral-300 dark:bg-neutral-600 rounded-lg"}),n.createElementVNode("div",{class:"h-9 w-20 bg-neutral-200 dark:bg-neutral-700 rounded-lg"})],-1))]))}}),hS={class:"w-full"},mS={class:"relative mx-auto min-h-[37.5rem]"},pS={key:"content",class:"w-full"},gS={class:"mb-6"},bS={class:"text-neutral-500 dark:text-neutral-400"},yS={key:"skeleton",class:"w-full"},xS={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},Ns=xt(n.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},isEditMode:{type:Boolean}},emits:["submit-success","cancel","action-success"],setup(e,{emit:t}){var A,D,N,V,M,T,U,L;const o=e,a=t,r=(D=(A=n.getCurrentInstance())==null?void 0:A.appContext)==null?void 0:D.app;r&&!r._context.provides[Symbol.for("vue-router-route-location")]&&r.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let s={query:{},params:{},path:""};try{const R=An.useRoute();if(R&&Object.keys(R).length>0)s=R;else{const P=n.getCurrentInstance();(M=(V=(N=P==null?void 0:P.appContext)==null?void 0:N.config)==null?void 0:V.globalProperties)!=null&&M.$route&&(s=P.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:R=>{typeof window<"u"&&(typeof R=="string"?window.location.href=R:R&&R.path&&(window.location.href=R.path))},__isFallback:!0};try{const R=An.useRouter();if(R)i=R;else{const P=n.getCurrentInstance();(L=(U=(T=P==null?void 0:P.appContext)==null?void 0:T.config)==null?void 0:U.globalProperties)!=null&&L.$router&&(i=P.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=Je();let d;try{d=Ht.useI18n().locale}catch{d=n.ref("en")}const{setPageTitle:u}=vE(),f=n.computed(()=>o.isEditMode!==void 0?o.isEditMode:s.params&&"id"in s.params?!0:s.path?/\/edit\/[^\/]+$/.test(s.path):!1);n.watchEffect(()=>{console.log("isEditModeisEditMode",f.value)});const h=n.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const R=s.path.match(/\/edit\/([^\/]+)$/);return R?R[1]:null}),m=n.ref({}),p=n.ref(null),b=n.ref(!0),g=n.ref(!1),x="http://110.239.67.31:9101/api/auto-layout/form/form-dynamic?code=",_="http://110.239.67.31:9101/api/auto-layout/datatable/form-dynamic?code=",C=n.ref(o.layoutCode),w=n.computed(()=>{var W;if(!p.value)return"";const R=((W=d==null?void 0:d.value)==null?void 0:W.toLowerCase())||"en";return(R==="en"||R.startsWith("en-")?p.value.titleEN:p.value.titleID)||p.value.title||o.layoutCode});n.watch(w,R=>{R&&u(R)},{immediate:!0});const E=async()=>{var R,P,W,v,z,H;b.value=!0;try{let G=o.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&(G=s.query.code||o.layoutCode);const K="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",X=K?{Authorization:`Bearer ${K}`}:{},oe=`${x}${G}`;let he=await l(oe,"GET",null,X);if(!he.status||!he.data||Array.isArray(he.data)&&he.data.length===0)try{const ge=`${_}${G}`,se=await l(ge,"GET",null,X);if(se.status){const J=Array.isArray(se.data)?se.data[0]:se.data;J&&J.code&&(G=J.code,C.value=G,he=await l(`${x}${G}`,"GET",null,X))}}catch(ge){console.warn("Failed to resolve layout code via datatable",ge)}if(he.status){p.value=Array.isArray(he.data)?he.data[0]:he.data;const ge={};if((R=p.value)!=null&&R.sections&&p.value.sections.forEach(se=>{((se.propsForm||se.props||{}).fields||se.fields||[]).forEach(j=>{var ie;const Y=j.model||((ie=j.props)==null?void 0:ie.model)||j.key;Y&&(ge[Y]=null)})}),m.value=ge,b.value=!1,f.value&&h.value){g.value=!0;try{const se=(v=(W=(P=p.value.sections)==null?void 0:P[0])==null?void 0:W.propsForm)==null?void 0:v.endpointForm,J=p.value.endpointForm,O=se||J;if(O!=null&&O.apiUrl){const j=O.apiUrl,Y=O.apiMethod||"GET",ie=O.keyParam||[],ye={};ie.length>0?ie.forEach(Me=>{ye[Me]=h.value}):ye.id=h.value;const ke=await c(j,Y,ye);if(ke.status){let Me=Array.isArray(ke.data)?ke.data[0]:ke.data;ke.payload&&(Me={...Me,...ke.payload}),m.value={...m.value,...Me}}}else if((z=p.value.endpointGlobal)!=null&&z.apiUrl){const j=p.value.endpointGlobal.apiUrl,Y=p.value.endpointGlobal.apiMethod||"GET",ie={id:h.value},ye=await c(j,Y,ie);if(ye.status){const ke=Array.isArray(ye.data)?ye.data[0]:ye.data;m.value={...m.value,...ke}}}else{const j=((H=p.value.endpoint)==null?void 0:H.detailUrl)||`/api/${C.value}/detail/${h.value}`,Y=await l(j,"GET");if(Y.status){let ie=Array.isArray(Y.data)?Y.data[0]:Y.data;if(Y.payload){const ke={...Y.payload};if(Object.keys(ke).forEach(Me=>{ie[Me]!==void 0&&ie[Me]!==null&&(ke[Me]=ie[Me])}),!("id"in ke)&&ie.id){const Me=Object.keys(ke).find(Te=>Te.startsWith("id")&&Te.length>2&&!ke[Te]);Me&&(ke[Me]=ie.id)}ie=ke}const ye={...ie};Object.keys(m.value).forEach(ke=>{if(ye[ke]===void 0||ye[ke]===null){if(ke.toLowerCase().startsWith("id")&&ke.length>2){const Te=ke.substring(2).toLowerCase(),Qe=Array.isArray(Y.data)?Y.data[0]:Y.data,wt=Object.keys(Qe).find(ln=>ln.toLowerCase()===Te);wt&&Qe[wt]&&typeof Qe[wt]=="object"&&"id"in Qe[wt]&&(ye[ke]=Qe[wt].id)}if(ke==="idSupervisor"){const Te=Array.isArray(Y.data)?Y.data[0]:Y.data;Te.supervisorId&&(ye[ke]=Te.supervisorId)}}}),m.value={...m.value,...ye}}}}catch(se){console.error("Failed to fetch record data:",se)}finally{g.value=!1}}}}catch(G){console.error("Failed to load form layout:",G),b.value=!1}},B=async R=>{var P,W,v;try{const z=(v=(W=(P=p.value.sections)==null?void 0:P[0])==null?void 0:W.propsForm)==null?void 0:v.endpointForm,H=p.value.endpointGlobal||p.value.endpoint,G=(z==null?void 0:z.submitUrl)||(H==null?void 0:H.submitUrl)||`/api/generic/${o.layoutCode}`,K=(z==null?void 0:z.submitMethod)||(H==null?void 0:H.submitMethod)||(f.value?"PUT":"POST"),X={...R};f.value&&h.value&&!X.id&&(X.id=h.value),await l(G,K,X),a("submit-success",X),i.back()}catch(z){console.error("Submit failed:",z)}},k=async(R,P,W)=>{if(R==="cancel"){y();return}const v=P.endpointPropAction||P.propsActionGlobal&&P.propsActionGlobal.endpointPropAction;if(v)try{b.value=!0;const z=W?{...W}:{...m.value};f.value&&P.model&&h.value&&(z[P.model]=h.value);const H=v.apiUrl,G=v.apiMethod||"POST";(await c(H,G,z)).status&&(a("action-success",R,P,z),i.back())}catch(z){console.error("Action failed:",z)}finally{b.value=!1}},y=()=>{a("cancel"),i.back()};return n.onMounted(()=>{E()}),n.onUnmounted(()=>{u("")}),(R,P)=>(n.openBlock(),n.createElementBlock("div",hS,[n.createElementVNode("div",mS,[n.createVNode(n.Transition,{name:"fade",mode:"out-in"},{default:n.withCtx(()=>[!b.value&&p.value?(n.openBlock(),n.createElementBlock("div",pS,[n.createElementVNode("div",gS,[n.createElementVNode("p",bS,n.toDisplayString(p.value.description),1)]),n.createVNode(cS,{schema:p.value,model:m.value,"is-edit-mode":f.value,loading:g.value,onSubmit:B,onCancel:y,onAction:k,class:"w-full"},null,8,["schema","model","is-edit-mode","loading"])])):b.value?(n.openBlock(),n.createElementBlock("div",yS,[n.createVNode(fS)])):(n.openBlock(),n.createElementBlock("div",xS," Failed to load form configuration for "+n.toDisplayString(o.layoutCode),1))]),_:1})])]))}}),[["__scopeId","data-v-5ba0fa8c"]]),kS={class:"h-full flex flex-col"},wS={key:1,class:"flex-1 flex items-center justify-center"},CS={key:2,class:"flex-1 flex items-center justify-center text-red-500"},Ps=n.defineComponent({name:"AutoLayoutDatatable",__name:"AutoLayoutDatatable",props:{layoutCode:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function}},emits:["action","navigate"],setup(e,{emit:t}){var _,C,w,E,B,k;const o=e,a=t,r=n.getCurrentInstance(),{apiUrl:s}=Je();let i={query:{},params:{},path:""};try{const y=An.useRoute();y?i=y:(w=(C=(_=r==null?void 0:r.appContext)==null?void 0:_.config)==null?void 0:C.globalProperties)!=null&&w.$route&&(i=r.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:y=>{typeof window<"u"&&(typeof y=="string"?window.location.href=y:y&&y.path&&(window.location.href=y.path))}};try{const y=An.useRouter();y?l=y:(k=(B=(E=r==null?void 0:r.appContext)==null?void 0:E.config)==null?void 0:B.globalProperties)!=null&&k.$router&&(l=r.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const c=n.inject("hasActionAccess",()=>!1),d=n.inject("userPermissions",null),u=n.ref(null),f=n.ref(!0),h=n.ref(null),m="http://110.239.67.31:9101/api/auto-layout/datatable/form-dynamic?code=",p=n.computed(()=>`${m}${o.layoutCode}`),b=async()=>{var y;f.value=!0;try{const A="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",D=A?{Authorization:`Bearer ${A}`}:{},N=await s(p.value,"GET",null,D);N.status&&(u.value=Array.isArray(N.data)?N.data[0]:N.data,console.log("[DEBUG] AutoLayoutDatatable config loaded:",u.value),console.log("[DEBUG] actionGlobal in config:",(y=u.value)==null?void 0:y.actionGlobal))}catch(A){console.error("Gagal Menampilkan Datatable:",A)}finally{f.value=!1}},g=y=>{y.action==="add"&&console.log("[AutoLayoutDatatable] Add action triggered"),console.log("Aksi:",y.action,y)},x=y=>{console.log("[DEBUG] AutoLayoutDatatable handleNavigate:",y);let A=y.route;if(A||(A=`/${((i==null?void 0:i.path)||"").split("/")[1]||"product"}/create`),A){const D=y.path?{code:y.path}:{};console.log("[DEBUG] Emitting navigate to parent:",{path:A,query:D}),a("navigate",{route:A,query:D})}else console.warn("[DEBUG] No route or path provided for navigation")};return n.onMounted(()=>{b()}),(y,A)=>(n.openBlock(),n.createElementBlock("div",kS,[!f.value&&u.value?(n.openBlock(),n.createBlock(Xn,{key:0,ref_key:"dtRef",ref:h,"api-url":p.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||n.unref(d),"permission-checker":n.unref(c),checkPermission:o.checkPermission,onAction:g,onNavigate:x},{"header-actions":n.withCtx(()=>[...A[0]||(A[0]=[])]),_:1},8,["api-url","table-config","permission-base","dummy-mode","user-permissions","permission-checker","checkPermission"])):f.value?(n.openBlock(),n.createElementBlock("div",wS,[...A[1]||(A[1]=[n.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(n.openBlock(),n.createElementBlock("div",CS," Failed to load configuration for "+n.toDisplayString(o.layoutCode),1))]))}}),vd=n.defineCustomElement(Ns),Td=n.defineCustomElement(Ps);typeof customElements<"u"&&(customElements.get("micro-dynamic-form")||customElements.define("micro-dynamic-form",vd),customElements.get("micro-dynamic-datatable")||customElements.define("micro-dynamic-datatable",Td));const _S=[Lo,ri,Ge,Ii,Xc,on,ls,Sa,So,ud,Aa,fd,hs,hd,ps,Va,gs,jn,bs,Da,md,pd,ys,xs,Na,Pa,va,Un,xd,kd,ks,ws,Cs,Xn,Ns,Ps],Od={install(e,t={}){t&&Object.keys(t).length>0&&zs(t),_S.forEach(o=>{o.name&&e.component(o.name,o)})}};le.AutoLayoutDatatable=Ps,le.AutoLayoutForm=Ns,le.DCodeAutoComplete=Lo,le.DCodeButton=Ge,le.DCodeCard=Ii,le.DCodeChart=Xc,le.DCodeCheckbox=on,le.DCodeCurrencyField=ls,le.DCodeDatePicker=Sa,le.DCodeDialog=So,le.DCodeDialogCloseBtn=ud,le.DCodeDropzone=Aa,le.DCodeFileField=fd,le.DCodeFileResult=hs,le.DCodeIconDropdown=hd,le.DCodeImageCropperDialog=ps,le.DCodeImageField=Va,le.DCodeImageResult=gs,le.DCodeInfiniteAutoComplete=ri,le.DCodeLabel=jn,le.DCodeMultiSelect=bs,le.DCodeOtpInput=Da,le.DCodePermissionMenu=ws,le.DCodeProgress=md,le.DCodeProgressBar=pd,le.DCodeRadio=ys,le.DCodeRadioCustom=xs,le.DCodeSlider=Na,le.DCodeSwitch=Pa,le.DCodeTextField=va,le.DCodeTextarea=Un,le.DCodeTimelineWithIcons=xd,le.DCodeTreePermissions=Cs,le.DCodeUploadFile=kd,le.DCodeWizard=ks,le.DataTable=Xn,le.DataTableComponent=Xn,le.DynamicUI=Od,le.MicroDynamicDatatable=Td,le.MicroDynamicForm=vd,le.cn=_e,le.default=Od,le.setApiConfig=zs,Object.defineProperties(le,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|