forked from Simnation/Main
24 lines
317 KiB
JavaScript
24 lines
317 KiB
JavaScript
var Zc=Object.defineProperty;var Jc=(i,t,e)=>t in i?Zc(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var bo=(i,t,e)=>(Jc(i,typeof t!="symbol"?t+"":t,e),e);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function e(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=e(s);fetch(s.href,o)}})();function re(){}const Qo=i=>i;function tu(i,t){for(const e in t)i[e]=t[e];return i}function Na(i){return i()}function Er(){return Object.create(null)}function Ut(i){i.forEach(Na)}function Wn(i){return typeof i=="function"}function Ee(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}function eu(i){return Object.keys(i).length===0}function On(i,...t){if(i==null){for(const n of t)n(void 0);return re}const e=i.subscribe(...t);return e.unsubscribe?()=>e.unsubscribe():e}function qt(i){let t;return On(i,e=>t=e)(),t}function it(i,t,e){i.$$.on_destroy.push(On(t,e))}function iu(i,t,e,n){if(i){const s=Wa(i,t,e,n);return i[0](s)}}function Wa(i,t,e,n){return i[1]&&n?tu(e.ctx.slice(),i[1](n(t))):e.ctx}function nu(i,t,e,n){if(i[2]&&n){const s=i[2](n(e));if(t.dirty===void 0)return s;if(typeof s=="object"){const o=[],r=Math.max(t.dirty.length,s.length);for(let l=0;l<r;l+=1)o[l]=t.dirty[l]|s[l];return o}return t.dirty|s}return t.dirty}function su(i,t,e,n,s,o){if(s){const r=Wa(t,e,n,o);i.p(r,s)}}function ou(i){if(i.ctx.length>32){const t=[],e=i.ctx.length/32;for(let n=0;n<e;n++)t[n]=-1;return t}return-1}const ja=typeof window<"u";let Ha=ja?()=>window.performance.now():()=>Date.now(),Zo=ja?i=>requestAnimationFrame(i):re;const Ji=new Set;function Va(i){Ji.forEach(t=>{t.c(i)||(Ji.delete(t),t.f())}),Ji.size!==0&&Zo(Va)}function $a(i){let t;return Ji.size===0&&Zo(Va),{promise:new Promise(e=>{Ji.add(t={c:i,f:e})}),abort(){Ji.delete(t)}}}function u(i,t){i.appendChild(t)}function Ya(i){if(!i)return document;const t=i.getRootNode?i.getRootNode():i.ownerDocument;return t&&t.host?t:i.ownerDocument}function ru(i){const t=b("style");return t.textContent="/* empty */",lu(Ya(i),t),t.sheet}function lu(i,t){return u(i.head||i,t),t.sheet}function Q(i,t,e){i.insertBefore(t,e||null)}function G(i){i.parentNode&&i.parentNode.removeChild(i)}function Ss(i,t){for(let e=0;e<i.length;e+=1)i[e]&&i[e].d(t)}function b(i){return document.createElement(i)}function I(i){return document.createTextNode(i)}function x(){return I(" ")}function Ds(){return I("")}function tt(i,t,e,n){return i.addEventListener(t,e,n),()=>i.removeEventListener(t,e,n)}function h(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function Ua(i){let t;return{p(...e){t=e,t.forEach(n=>i.push(n))},r(){t.forEach(e=>i.splice(i.indexOf(e),1))}}}function ge(i){return i===""?null:+i}function au(i){return Array.from(i.childNodes)}function z(i,t){t=""+t,i.data!==t&&(i.data=t)}function Ft(i,t){i.value=t??""}function _o(i,t,e,n){e==null?i.style.removeProperty(t):i.style.setProperty(t,e,n?"important":"")}function Fr(i,t,e){for(let n=0;n<i.options.length;n+=1){const s=i.options[n];if(s.__value===t){s.selected=!0;return}}(!e||t!==void 0)&&(i.selectedIndex=-1)}function cu(i){const t=i.querySelector(":checked");return t&&t.__value}function uu(i,t,{bubbles:e=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:t,bubbles:e,cancelable:n})}const As=new Map;let Ps=0;function du(i){let t=5381,e=i.length;for(;e--;)t=(t<<5)-t^i.charCodeAt(e);return t>>>0}function fu(i,t){const e={stylesheet:ru(t),rules:{}};return As.set(i,e),e}function Xa(i,t,e,n,s,o,r,l=0){const a=16.666/n;let c=`{
|
|
`;for(let y=0;y<=1;y+=a){const v=t+(e-t)*o(y);c+=y*100+`%{${r(v,1-v)}}
|
|
`}const d=c+`100% {${r(e,1-e)}}
|
|
}`,f=`__svelte_${du(d)}_${l}`,p=Ya(i),{stylesheet:g,rules:m}=As.get(p)||fu(p,i);m[f]||(m[f]=!0,g.insertRule(`@keyframes ${f} ${d}`,g.cssRules.length));const _=i.style.animation||"";return i.style.animation=`${_?`${_}, `:""}${f} ${n}ms linear ${s}ms 1 both`,Ps+=1,f}function Eo(i,t){const e=(i.style.animation||"").split(", "),n=e.filter(t?o=>o.indexOf(t)<0:o=>o.indexOf("__svelte")===-1),s=e.length-n.length;s&&(i.style.animation=n.join(", "),Ps-=s,Ps||hu())}function hu(){Zo(()=>{Ps||(As.forEach(i=>{const{ownerNode:t}=i.stylesheet;t&&G(t)}),As.clear())})}let Rn;function Dn(i){Rn=i}function qa(){if(!Rn)throw new Error("Function called outside component initialization");return Rn}function Di(i){qa().$$.on_mount.push(i)}function pu(i){qa().$$.on_destroy.push(i)}const Zi=[],Fo=[];let tn=[];const Ir=[],gu=Promise.resolve();let Io=!1;function mu(){Io||(Io=!0,gu.then(Ka))}function Wt(i){tn.push(i)}const yo=new Set;let qi=0;function Ka(){if(qi!==0)return;const i=Rn;do{try{for(;qi<Zi.length;){const t=Zi[qi];qi++,Dn(t),bu(t.$$)}}catch(t){throw Zi.length=0,qi=0,t}for(Dn(null),Zi.length=0,qi=0;Fo.length;)Fo.pop()();for(let t=0;t<tn.length;t+=1){const e=tn[t];yo.has(e)||(yo.add(e),e())}tn.length=0}while(Zi.length);for(;Ir.length;)Ir.pop()();Io=!1,yo.clear(),Dn(i)}function bu(i){if(i.fragment!==null){i.update(),Ut(i.before_update);const t=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,t),i.after_update.forEach(Wt)}}function _u(i){const t=[],e=[];tn.forEach(n=>i.indexOf(n)===-1?t.push(n):e.push(n)),e.forEach(n=>n()),tn=t}let pn;function Ga(){return pn||(pn=Promise.resolve(),pn.then(()=>{pn=null})),pn}function Cs(i,t,e){i.dispatchEvent(uu(`${t?"intro":"outro"}${e}`))}const ks=new Set;let vi;function le(){vi={r:0,c:[],p:vi}}function ae(){vi.r||Ut(vi.c),vi=vi.p}function rt(i,t){i&&i.i&&(ks.delete(i),i.i(t))}function pt(i,t,e,n){if(i&&i.o){if(ks.has(i))return;ks.add(i),vi.c.push(()=>{ks.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}const Qa={duration:0};function ee(i,t,e){const n={direction:"in"};let s=t(i,e,n),o=!1,r,l,a=0;function c(){r&&Eo(i,r)}function d(){const{delay:p=0,duration:g=300,easing:m=Qo,tick:_=re,css:y}=s||Qa;y&&(r=Xa(i,0,1,g,p,m,y,a++)),_(0,1);const v=Ha()+p,w=v+g;l&&l.abort(),o=!0,Wt(()=>Cs(i,!0,"start")),l=$a(M=>{if(o){if(M>=w)return _(1,0),Cs(i,!0,"end"),c(),o=!1;if(M>=v){const k=m((M-v)/g);_(k,1-k)}}return o})}let f=!1;return{start(){f||(f=!0,Eo(i),Wn(s)?(s=s(n),Ga().then(d)):d())},invalidate(){f=!1},end(){o&&(c(),o=!1)}}}function be(i,t,e){const n={direction:"out"};let s=t(i,e,n),o=!0,r;const l=vi;l.r+=1;let a;function c(){const{delay:d=0,duration:f=300,easing:p=Qo,tick:g=re,css:m}=s||Qa;m&&(r=Xa(i,1,0,f,d,p,m));const _=Ha()+d,y=_+f;Wt(()=>Cs(i,!1,"start")),"inert"in i&&(a=i.inert,i.inert=!0),$a(v=>{if(o){if(v>=y)return g(0,1),Cs(i,!1,"end"),--l.r||Ut(l.c),!1;if(v>=_){const w=p((v-_)/f);g(1-w,w)}}return o})}return Wn(s)?Ga().then(()=>{s=s(n),c()}):c(),{end(d){d&&"inert"in i&&(i.inert=a),d&&s.tick&&s.tick(1,0),o&&(r&&Eo(i,r),o=!1)}}}function oe(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function yu(i,t){i.d(1),t.delete(i.key)}function jn(i,t){pt(i,1,1,()=>{t.delete(i.key)})}function an(i,t,e,n,s,o,r,l,a,c,d,f){let p=i.length,g=o.length,m=p;const _={};for(;m--;)_[i[m].key]=m;const y=[],v=new Map,w=new Map,M=[];for(m=g;m--;){const C=f(s,o,m),T=e(C);let E=r.get(T);E?n&&M.push(()=>E.p(C,t)):(E=c(T,C),E.c()),v.set(T,y[m]=E),T in _&&w.set(T,Math.abs(m-_[T]))}const k=new Set,S=new Set;function L(C){rt(C,1),C.m(l,d),r.set(C.key,C),d=C.first,g--}for(;p&&g;){const C=y[g-1],T=i[p-1],E=C.key,O=T.key;C===T?(d=C.first,p--,g--):v.has(O)?!r.has(E)||k.has(E)?L(C):S.has(O)?p--:w.get(E)>w.get(O)?(S.add(E),L(C)):(k.add(O),p--):(a(T,r),p--)}for(;p--;){const C=i[p];v.has(C.key)||a(C,r)}for(;g;)L(y[g-1]);return Ut(M),y}function oi(i){i&&i.c()}function ze(i,t,e){const{fragment:n,after_update:s}=i.$$;n&&n.m(t,e),Wt(()=>{const o=i.$$.on_mount.map(Na).filter(Wn);i.$$.on_destroy?i.$$.on_destroy.push(...o):Ut(o),i.$$.on_mount=[]}),s.forEach(Wt)}function Ne(i,t){const e=i.$$;e.fragment!==null&&(_u(e.after_update),Ut(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function vu(i,t){i.$$.dirty[0]===-1&&(Zi.push(i),mu(),i.$$.dirty.fill(0)),i.$$.dirty[t/31|0]|=1<<t%31}function We(i,t,e,n,s,o,r=null,l=[-1]){const a=Rn;Dn(i);const c=i.$$={fragment:null,ctx:[],props:o,update:re,not_equal:s,bound:Er(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(a?a.$$.context:[])),callbacks:Er(),dirty:l,skip_bound:!1,root:t.target||a.$$.root};r&&r(c.root);let d=!1;if(c.ctx=e?e(i,t.props||{},(f,p,...g)=>{const m=g.length?g[0]:p;return c.ctx&&s(c.ctx[f],c.ctx[f]=m)&&(!c.skip_bound&&c.bound[f]&&c.bound[f](m),d&&vu(i,f)),p}):[],c.update(),d=!0,Ut(c.before_update),c.fragment=n?n(c.ctx):!1,t.target){if(t.hydrate){const f=au(t.target);c.fragment&&c.fragment.l(f),f.forEach(G)}else c.fragment&&c.fragment.c();t.intro&&rt(i.$$.fragment),ze(i,t.target,t.anchor),Ka()}Dn(a)}class je{constructor(){bo(this,"$$");bo(this,"$$set")}$destroy(){Ne(this,1),this.$destroy=re}$on(t,e){if(!Wn(e))return re;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const s=n.indexOf(e);s!==-1&&n.splice(s,1)}}$set(t){this.$$set&&!eu(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const xu="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(xu);const xn=new Map,wu=i=>{const{action:t,data:e}=i.data,n=xn.get(t);n&&n.forEach(s=>s(e))};window.addEventListener("message",wu);function vo(i,t){const e=xn.get(i)||[];e.push(t),xn.set(i,e),pu(()=>{const n=xn.get(i)||[];xn.set(i,n.filter(s=>s!==t))})}async function Dt(i,t={}){const e={method:"post",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(t)},n=window.GetParentResourceName?window.GetParentResourceName():"nui-frame-app";return await(await fetch(`https://${n}/${i}`,e)).json()}const Ki=[];function ku(i,t){return{subscribe:ct(i,t).subscribe}}function ct(i,t=re){let e;const n=new Set;function s(l){if(Ee(i,l)&&(i=l,e)){const a=!Ki.length;for(const c of n)c[1](),Ki.push(c,i);if(a){for(let c=0;c<Ki.length;c+=2)Ki[c][0](Ki[c+1]);Ki.length=0}}}function o(l){s(l(i))}function r(l,a=re){const c=[l,a];return n.add(c),n.size===1&&(e=t(s,o)||re),l(i),()=>{n.delete(c),n.size===0&&e&&(e(),e=null)}}return{set:s,update:o,subscribe:r}}function Mu(i,t,e){const n=!Array.isArray(i),s=n?[i]:i;if(!s.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const o=t.length<2;return ku(e,(r,l)=>{let a=!1;const c=[];let d=0,f=re;const p=()=>{if(d)return;f();const m=t(n?c[0]:c,r,l);o?r(m):f=Wn(m)?m:re},g=s.map((m,_)=>On(m,y=>{c[_]=y,d&=~(1<<_),a&&p()},()=>{d|=1<<_}));return a=!0,p(),function(){Ut(g),f(),a=!1}})}const wn=ct(!1);function Za(i){const t=i-1;return t*t*t+1}function Tt(i){return--i*i*i*i*i+1}function Ws(i,{delay:t=0,duration:e=400,easing:n=Qo}={}){const s=+getComputedStyle(i).opacity;return{delay:t,duration:e,easing:n,css:o=>`opacity: ${o*s}`}}function He(i,{delay:t=0,duration:e=400,easing:n=Za,axis:s="y"}={}){const o=getComputedStyle(i),r=+o.opacity,l=s==="y"?"height":"width",a=parseFloat(o[l]),c=s==="y"?["top","bottom"]:["left","right"],d=c.map(v=>`${v[0].toUpperCase()}${v.slice(1)}`),f=parseFloat(o[`padding${d[0]}`]),p=parseFloat(o[`padding${d[1]}`]),g=parseFloat(o[`margin${d[0]}`]),m=parseFloat(o[`margin${d[1]}`]),_=parseFloat(o[`border${d[0]}Width`]),y=parseFloat(o[`border${d[1]}Width`]);return{delay:t,duration:e,easing:n,css:v=>`overflow: hidden;opacity: ${Math.min(v*20,1)*r};${l}: ${v*a}px;padding-${c[0]}: ${v*f}px;padding-${c[1]}: ${v*p}px;margin-${c[0]}: ${v*g}px;margin-${c[1]}: ${v*m}px;border-${c[0]}-width: ${v*_}px;border-${c[1]}-width: ${v*y}px;`}}function Kt(i,{delay:t=0,duration:e=400,easing:n=Za,start:s=0,opacity:o=0}={}){const r=getComputedStyle(i),l=+r.opacity,a=r.transform==="none"?"":r.transform,c=1-s,d=l*(1-o);return{delay:t,duration:e,easing:n,css:(f,p)=>`
|
|
transform: ${a} scale(${1-c*p});
|
|
opacity: ${l-d*p}
|
|
`}}const Bo=ct([]);let Br=0;function yt(i,t,e){Br+=1;const n={id:Br,message:i,title:t,icon:e};Bo.update(s=>[...s,n]),setTimeout(()=>{Bo.update(s=>s.filter(o=>o.id!==n.id))},2e3)}const Ze=ct(!0),Je=ct(!1),ti=ct(!1),ei=ct(!1),mi=ct(!1),bi=ct(!1),_i=ct(!1),en=ct(!1),fi=ct(500),ni=ct(1e4),Ai=ct({lang:"en",currency:"USD"}),Be=ct({atm:"ATM",cash:"Cash",bank_balance:"Bank Balance",deposit_amount:"Deposit Amount",withdraw_amount:"Withdraw Amount",submit:"Submit",close:"Close",overview:"Overview",bills:"Bills",history:"History",withdraw:"Withdraw",deposit:"Deposit",stats:"Stats",transactions:"Transactions",total:"Total",search_transactions:"Search transactions...",description:"Description",type:"Type",time_ago:"Time Ago",amount:"Amount",date:"Date",pay_invoice:"Pay Invoice",payment_completed:"Payment Completed",from:"From",delete_all_transactions:"Delete All Transactions",are_you_sure:"Are you sure?",delete_confirmation:"Are you sure you want to delete all your transactions? (Only do this if the menu lags!)",cancel:"Cancel",confirm:"Confirm",history_empty:"Your history is empty",all_history_deleted:"You have deleted all your history",error:"Error",success:"Success",new_cash:"New Cash",withdraw_success:"Withdrawal Successful",withdraw_error:"Your bank account does not have enough funds",withdraw_button:"WITHDRAW",new_bank:"New Bank Balance",current_cash:"Current Cash",deposit_success:"Deposit Successful",deposit_error:"You do not have enough cash",deposit_button:"DEPOSIT",total_balance:"Total Balance",quick_actions:"Quick Actions",transfer_money:"Transfer Money",easy_transfer:"Easily transfer money to people",transfer:"Transfer",pay_bills:"Pay Bills",pay_pending_bills:"Quickly pay your pending bills",pay:"Pay",withdraw_all_money:"Withdraw All Money",withdraw_all_from_account:"Withdraw all your money from your account",deposit_cash:"Deposit Cash",deposit_all_cash:"Deposit all your cash into your account",weekly_summary:"Weekly Summary",income:"Income",expenses:"Expenses",report:"Report",latest_transactions:"Latest Transactions",see_all:"SEE ALL",unpaid_bills:"Unpaid Invoices",no_unpaid_bills:"No unpaid invoices",confirm_pay_all_bills:"Are you sure you want to pay all your bills?",pay_all_bills:"Pay All Bills",pay_all_bills_success:"You have paid all your bills!",pay_all_bills_error:"You have no bills",payment_method:"Payment Method",phone_number:"Phone Number",id:"ID",id_or_phone_number:"ID or Phone Number",no_cash_on_you:"You have no cash on you",deposit_all_success:"All your cash has been deposited",no_money_on_account:"Your account is empty",withdraw_all_success:"You have withdrawn all your money from the account",invoices:"Invoices",statistics_reports:"Statistics and Reports",balance_trend:"Balance Trend",balance:"Balance",used:"Used",month:"Month",balance_dkk:"Balance",withdrawn:"You have withdrawn",deposited:"You have deposited",no_transactions:"No recent transactions",transactions_trend:"Transactions Trend",total_transactions:"Total Transactions",accounts:"Accounts",account_number_copied:"Account number copied to clipboard",new_user_to_account:"New user to account",server_id:"Server ID",add_user:"Add User",new_account_name:"New Account Name",new_name:"New Name",rename:"Rename",create_new_account:"Create New Account",account_holder:"Account Holder",initial_balance:"Initial Balance",create:"Create",delete_account:"Delete Account",are_you_sure_you_want_to_delete_this_account:"Are you sure you want to delete this account?",delete:"Delete",remove_user_from_account:"Remove User from Account",select_user:"Select User",remove:"Remove",withdraw_from_account:"Withdraw from Account",deposit_to_account:"Deposit to Account",removed_successfully:"removed Successfully",select_account_and_user:"Please select an account and a user",account_deleted_successfully:"Account deleted successfully",new_account_created_successfully:"New account created successfully",withdrew:"Withdrew",successfully:"Successfully",select_valid_account_and_amount:"Please select a valid account and amount",openBank:"Access Bank",openATM:"Access ATM",account_deletion_failed:"Account deletion failed",withdrawal_failed:"Withdrawal failed",deposit_failed:"Deposit failed",user_added_successfully:"added successfully",user_addition_failed:"Failed to add user",new_account_creation_failed:"Failed to create new account",account_renamed_successfully:"Account renamed successfully",account_rename_failed:"Account rename failed",rename_account:"Change name"}),zo=ct([]),Ls=ct([]);function zr(i,t,e){const n=i.slice();return n[26]=t[e],n}function Nr(i,t,e){const n=i.slice();return n[26]=t[e],n}function Wr(i){let t,e,n=i[2].withdraw+"",s,o,r=i[26].toLocaleString(i[3].lang,{style:"currency",currency:i[3].currency,minimumFractionDigits:0})+"",l,a,c;function d(){return i[16](i[26])}return{c(){t=b("button"),e=b("i"),s=I(n),o=x(),l=I(r),h(e,"class","fa-duotone fa-money-bill-wave text-lg"),h(t,"class","bg-blue-600/10 border border-blue-500 hover:bg-blue-800/50 text-white font-bold py-4 px-6 rounded-xl duration-500 cursor-pointer flex items-center justify-center gap-2")},m(f,p){Q(f,t,p),u(t,e),u(t,s),u(t,o),u(t,l),a||(c=tt(t,"click",d),a=!0)},p(f,p){i=f,p&4&&n!==(n=i[2].withdraw+"")&&z(s,n),p&136&&r!==(r=i[26].toLocaleString(i[3].lang,{style:"currency",currency:i[3].currency,minimumFractionDigits:0})+"")&&z(l,r)},d(f){f&&G(t),a=!1,c()}}}function jr(i){let t,e,n=i[2].deposit+"",s,o,r=i[26].toLocaleString(i[3].lang,{style:"currency",currency:i[3].currency,minimumFractionDigits:0})+"",l,a,c,d;function f(){return i[17](i[26])}return{c(){t=b("button"),e=b("i"),s=I(n),o=x(),l=I(r),a=x(),h(e,"class","fa-duotone fa-credit-card text-lg"),h(t,"class","bg-green-600/10 border border-green-500 hover:bg-green-800/50 text-white font-bold py-4 px-6 rounded-xl duration-500 cursor-pointer flex items-center justify-center gap-2")},m(p,g){Q(p,t,g),u(t,e),u(t,s),u(t,o),u(t,l),u(t,a),c||(d=tt(t,"click",f),c=!0)},p(p,g){i=p,g&4&&n!==(n=i[2].deposit+"")&&z(s,n),g&264&&r!==(r=i[26].toLocaleString(i[3].lang,{style:"currency",currency:i[3].currency,minimumFractionDigits:0})+"")&&z(l,r)},d(p){p&&G(t),c=!1,d()}}}function Su(i){let t,e,n,s,o,r=i[2].atm+"",l,a,c,d,f,p,g,m=i[2].cash+"",_,y,v,w=i[4].toLocaleString(i[3].lang,{style:"currency",currency:i[3].currency,minimumFractionDigits:0})+"",M,k,S,L,C,T=i[2].bank_balance+"",E,O,N,V=i[5].toLocaleString(i[3].lang,{style:"currency",currency:i[3].currency,minimumFractionDigits:0})+"",R,B,F,H,P,W,$,D,A,Y,X,K,Z=i[2].deposit_amount+"",J,st,et,vt,at,ut,U,j,lt=i[2].submit+"",kt,mt,Xt,jt,Jt,Et,gt,ft=i[2].withdraw_amount+"",Mt,Qt,dt,Ht,ue,de,De,Ae,ke=i[2].submit+"",_e,me,Pe,q,bt,Ct,_t,Zt,Lt,we=oe(i[7]),Ot=[];for(let nt=0;nt<we.length;nt+=1)Ot[nt]=Wr(Nr(i,we,nt));let ie=oe(i[8]),Vt=[];for(let nt=0;nt<ie.length;nt+=1)Vt[nt]=jr(zr(i,ie,nt));return{c(){t=b("div"),e=b("div"),n=b("div"),s=b("div"),o=b("i"),l=I(r),a=x(),c=b("div"),d=b("div"),f=b("div"),p=b("i"),g=x(),_=I(m),y=x(),v=b("div"),M=I(w),k=x(),S=b("div"),L=b("div"),C=b("i"),E=I(T),O=x(),N=b("div"),R=I(V),B=x(),F=b("div");for(let nt=0;nt<Ot.length;nt+=1)Ot[nt].c();H=x();for(let nt=0;nt<Vt.length;nt+=1)Vt[nt].c();W=x(),$=b("div"),D=b("div"),A=b("div"),Y=b("i"),X=x(),K=b("label"),J=I(Z),st=x(),et=b("input"),at=x(),ut=b("button"),U=b("i"),j=x(),kt=I(lt),mt=x(),Xt=b("div"),jt=b("div"),Jt=b("i"),Et=x(),gt=b("label"),Mt=I(ft),Qt=x(),dt=b("input"),ue=x(),de=b("button"),De=b("i"),Ae=x(),_e=I(ke),me=x(),Pe=b("div"),q=b("button"),q.innerHTML='<i class="fa-duotone fa-times-circle text-2xl"></i>',h(o,"class","fa-duotone fa-atm text-blue-200 mr-2"),h(s,"class","text-4xl font-bold text-center text-blue-200 mb-6"),h(p,"class","fa-duotone fa-money-bill-wave text-md mr-2"),h(f,"class","text-2xl font-semibold text-blue-100 mb-2"),h(v,"class","text-4xl font-bold text-blue-400"),h(d,"class","bg-gray-700 p-6 rounded-2xl shadow-lg flex flex-col items-center justify-center"),h(C,"class","fa-duotone fa-vault text-md mr-2"),h(L,"class","text-2xl font-semibold text-blue-100 mb-2"),h(N,"class","text-4xl font-bold text-blue-400"),h(S,"class","bg-gray-700 p-6 rounded-2xl shadow-lg flex flex-col items-center justify-center"),h(c,"class","grid grid-cols-2 gap-6 mb-8"),h(F,"class","grid"),h(F,"style",P=`grid-template-columns: repeat(${i[6]}, minmax(0, 1fr)); gap: 10px;`),h(Y,"class","fa-duotone fa-money-check-edit text-xl text-green-400 mr-2"),h(K,"for","Deposit"),h(K,"class","text-lg font-semibold text-white"),h(A,"class","flex items-center mb-2"),h(et,"type","number"),h(et,"id","Deposit"),h(et,"class","w-full bg-gray-800 text-white font-bold pl-4 pr-4 py-3 rounded-lg border border-green-200/10 focus:outline-none focus:border-green-400/50 transition-colors duration-500 placeholder-gray-500"),h(et,"placeholder",vt=i[2].deposit_amount),h(U,"class","fa-duotone fa-piggy-bank text-lg"),h(ut,"class","mt-2 w-full bg-green-600/10 border border-green-500 hover:bg-green-800/50 text-white font-bold py-2 px-4 rounded-xl duration-500 cursor-pointer flex items-center justify-center gap-2"),h(D,"class","bg-gray-700 p-4 rounded-xl shadow-lg"),h(Jt,"class","fa-duotone fa-money-check-edit text-xl text-blue-400 mr-2"),h(gt,"for","Withdraw"),h(gt,"class","text-lg font-semibold text-white"),h(jt,"class","flex items-center mb-2"),h(dt,"type","number"),h(dt,"id","Withdraw"),h(dt,"class","w-full bg-gray-800 font-bold text-white pl-4 pr-4 py-3 rounded-lg border border-blue-200/10 focus:outline-none focus:border-blue-400/50 transition-colors duration-500 placeholder-gray-500"),h(dt,"placeholder",Ht=i[2].withdraw_amount),h(De,"class","fa-duotone fa-money-bill-wave text-lg"),h(de,"class","mt-2 w-full bg-blue-600/10 border border-blue-500 hover:bg-blue-800/50 text-white font-bold py-2 px-4 rounded-xl duration-500 cursor-pointer flex items-center justify-center gap-2"),h(Xt,"class","bg-gray-700 p-4 rounded-xl shadow-lg"),h($,"class","grid grid-cols-2 gap-4 mt-4"),h(q,"class","text-blue-200/50 hover:text-blue-500/50 font-bold py-2 px-4 rounded-xl duration-500 cursor-pointer flex items-center justify-center gap-2 text-gray-300 py-4 transition-all duration-500 rounded-xl hover:text-blue-300 duration-500 hover:cursor-pointer hover:bg-gray-800/80"),h(Pe,"class","absolute top-4 right-4 transform -translate-x-1/2 text-white"),h(n,"class","h-auto w-[60%] bg-gray-800 rounded-3xl p-8 shadow-2xl relative border border-blue-200/10"),h(e,"class","absolute inset-0 flex items-center justify-center"),h(t,"class","absolute w-screen h-screen flex items-center justify-center")},m(nt,zt){Q(nt,t,zt),u(t,e),u(e,n),u(n,s),u(s,o),u(s,l),u(n,a),u(n,c),u(c,d),u(d,f),u(f,p),u(f,g),u(f,_),u(d,y),u(d,v),u(v,M),u(c,k),u(c,S),u(S,L),u(L,C),u(L,E),u(S,O),u(S,N),u(N,R),u(n,B),u(n,F);for(let ht=0;ht<Ot.length;ht+=1)Ot[ht]&&Ot[ht].m(F,null);u(F,H);for(let ht=0;ht<Vt.length;ht+=1)Vt[ht]&&Vt[ht].m(F,null);u(n,W),u(n,$),u($,D),u(D,A),u(A,Y),u(A,X),u(A,K),u(K,J),u(D,st),u(D,et),Ft(et,i[9]),u(D,at),u(D,ut),u(ut,U),u(ut,j),u(ut,kt),u($,mt),u($,Xt),u(Xt,jt),u(jt,Jt),u(jt,Et),u(jt,gt),u(gt,Mt),u(Xt,Qt),u(Xt,dt),Ft(dt,i[10]),u(Xt,ue),u(Xt,de),u(de,De),u(de,Ae),u(de,_e),u(n,me),u(n,Pe),u(Pe,q),_t=!0,Zt||(Lt=[tt(et,"input",i[18]),tt(ut,"click",i[19]),tt(dt,"input",i[20]),tt(de,"click",i[21]),tt(q,"click",i[22])],Zt=!0)},p(nt,[zt]){if((!_t||zt&4)&&r!==(r=nt[2].atm+"")&&z(l,r),(!_t||zt&4)&&m!==(m=nt[2].cash+"")&&z(_,m),(!_t||zt&24)&&w!==(w=nt[4].toLocaleString(nt[3].lang,{style:"currency",currency:nt[3].currency,minimumFractionDigits:0})+"")&&z(M,w),(!_t||zt&4)&&T!==(T=nt[2].bank_balance+"")&&z(E,T),(!_t||zt&40)&&V!==(V=nt[5].toLocaleString(nt[3].lang,{style:"currency",currency:nt[3].currency,minimumFractionDigits:0})+"")&&z(R,V),zt&16524){we=oe(nt[7]);let ht;for(ht=0;ht<we.length;ht+=1){const Me=Nr(nt,we,ht);Ot[ht]?Ot[ht].p(Me,zt):(Ot[ht]=Wr(Me),Ot[ht].c(),Ot[ht].m(F,H))}for(;ht<Ot.length;ht+=1)Ot[ht].d(1);Ot.length=we.length}if(zt&33036){ie=oe(nt[8]);let ht;for(ht=0;ht<ie.length;ht+=1){const Me=zr(nt,ie,ht);Vt[ht]?Vt[ht].p(Me,zt):(Vt[ht]=jr(Me),Vt[ht].c(),Vt[ht].m(F,null))}for(;ht<Vt.length;ht+=1)Vt[ht].d(1);Vt.length=ie.length}(!_t||zt&64&&P!==(P=`grid-template-columns: repeat(${nt[6]}, minmax(0, 1fr)); gap: 10px;`))&&h(F,"style",P),(!_t||zt&4)&&Z!==(Z=nt[2].deposit_amount+"")&&z(J,Z),(!_t||zt&4&&vt!==(vt=nt[2].deposit_amount))&&h(et,"placeholder",vt),zt&512&&ge(et.value)!==nt[9]&&Ft(et,nt[9]),(!_t||zt&4)&<!==(lt=nt[2].submit+"")&&z(kt,lt),(!_t||zt&4)&&ft!==(ft=nt[2].withdraw_amount+"")&&z(Mt,ft),(!_t||zt&4&&Ht!==(Ht=nt[2].withdraw_amount))&&h(dt,"placeholder",Ht),zt&1024&&ge(dt.value)!==nt[10]&&Ft(dt,nt[10]),(!_t||zt&4)&&ke!==(ke=nt[2].submit+"")&&z(_e,ke)},i(nt){_t||(nt&&Wt(()=>{_t&&(Ct&&Ct.end(1),bt=ee(e,Kt,{duration:1e3,easing:Tt}),bt.start())}),_t=!0)},o(nt){bt&&bt.invalidate(),nt&&(Ct=be(e,Kt,{duration:1e3,easing:Tt})),_t=!1},d(nt){nt&&G(t),Ss(Ot,nt),Ss(Vt,nt),nt&&Ct&&Ct.end(),Zt=!1,Ut(Lt)}}}function Du(i,t,e){let n,s,o,r,l,a,c,d,f=re,p=()=>(f(),f=On(v,P=>e(9,d=P)),v),g,m=re,_=()=>(m(),m=On(y,P=>e(10,g=P)),y);it(i,Be,P=>e(2,n=P)),it(i,Ai,P=>e(3,s=P)),it(i,fi,P=>e(4,o=P)),it(i,ni,P=>e(5,r=P)),i.$$.on_destroy.push(()=>f()),i.$$.on_destroy.push(()=>m());let y=ct(0);_();let v=ct(0);p();let w=ct([]);it(i,w,P=>e(7,a=P));let M=ct([]);it(i,M,P=>e(8,c=P));let k=ct(3);it(i,k,P=>e(6,l=P));async function S(){try{const P=await Dt("ps-banking:client:getAmountPresets",{}),W=JSON.parse(P);w.set(W.withdrawAmounts),M.set(W.depositAmounts),k.set(W.grid)}catch(P){console.error(P)}}async function L(){try{const P=await Dt("ps-banking:client:getMoneyTypes",{}),W=P.find(D=>D.name==="bank"),$=P.find(D=>D.name==="cash");W&&ni.set(W.amount),$&&fi.set($.amount)}catch(P){console.error(P)}}async function C(P){try{await Dt("ps-banking:client:ATMwithdraw",{amount:P})?(yt(`${n.withdrawn} ${P.toLocaleString(s.lang,{style:"currency",currency:s.currency,minimumFractionDigits:0})}`,n.payment_completed,"coins"),await L()):yt(n.no_money_on_account,n.error,"credit-card")}catch(W){console.error(W)}}async function T(P){try{await Dt("ps-banking:client:ATMdeposit",{amount:P})?(yt(`${n.deposited} ${P.toLocaleString(s.lang,{style:"currency",currency:s.currency,minimumFractionDigits:0})}`,n.payment_completed,"coins"),await L()):yt(n.no_cash_on_you,n.error,"credit-card")}catch(W){console.error(W)}}async function E(){try{const P=await Dt("ps-banking:client:getLocales",{});Be.set(P)}catch(P){console.error(P)}}Di(()=>{S(),E(),L();const P=W=>{qt(en)&&["Escape"].includes(W.code)&&(Dt("ps-banking:client:hideUI"),en.set(!1))};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)});const O=P=>{C(P)},N=P=>{T(P)};function V(){d=ge(this.value),v.set(d)}const R=()=>{T(qt(v))};function B(){g=ge(this.value),y.set(g)}const F=()=>{C(qt(y))},H=()=>{en.set(!1),Dt("ps-banking:client:hideUI")};return p(e(1,v=fi)),_(e(0,y=ni)),[y,v,n,s,o,r,l,a,c,d,g,w,M,k,C,T,O,N,V,R,B,F,H]}class Au extends je{constructor(t){super(),We(this,t,Du,Su,Ee,{})}}function Hr(i){let t;const e=i[3].default,n=iu(e,i,i[2],null);return{c(){n&&n.c()},m(s,o){n&&n.m(s,o),t=!0},p(s,o){n&&n.p&&(!t||o&4)&&su(n,e,s,s[2],t?nu(e,s[2],o,null):ou(s[2]),null)},i(s){t||(rt(n,s),t=!0)},o(s){pt(n,s),t=!1},d(s){n&&n.d(s)}}}function Vr(i){let t,e;return t=new Au({}),{c(){oi(t.$$.fragment)},m(n,s){ze(t,n,s),e=!0},i(n){e||(rt(t.$$.fragment,n),e=!0)},o(n){pt(t.$$.fragment,n),e=!1},d(n){Ne(t,n)}}}function Pu(i){let t,e,n,s=i[0]&&Hr(i),o=i[1]&&Vr();return{c(){t=b("main"),s&&s.c(),e=x(),o&&o.c()},m(r,l){Q(r,t,l),s&&s.m(t,null),u(t,e),o&&o.m(t,null),n=!0},p(r,[l]){r[0]?s?(s.p(r,l),l&1&&rt(s,1)):(s=Hr(r),s.c(),rt(s,1),s.m(t,e)):s&&(le(),pt(s,1,1,()=>{s=null}),ae()),r[1]?o?l&2&&rt(o,1):(o=Vr(),o.c(),rt(o,1),o.m(t,null)):o&&(le(),pt(o,1,1,()=>{o=null}),ae())},i(r){n||(rt(s),rt(o),n=!0)},o(r){pt(s),pt(o),n=!1},d(r){r&&G(t),s&&s.d(),o&&o.d()}}}function Cu(i,t,e){let n;it(i,en,l=>e(1,n=l));let{$$slots:s={},$$scope:o}=t,r;return vo("openATM",()=>{en.set(!0)}),wn.subscribe(l=>{e(0,r=l)}),vo("openBank",()=>{wn.set(!0)}),vo("hideGarageMenu",()=>{wn.set(!1)}),Di(()=>{const l=a=>{r&&["Escape"].includes(a.code)&&(Dt("ps-banking:client:hideUI"),wn.set(!1))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)}),i.$$set=l=>{"$$scope"in l&&e(2,o=l.$$scope)},[r,n,o,s]}class Lu extends je{constructor(t){super(),We(this,t,Cu,Pu,Ee,{})}}/*!
|
|
* Chart.js v3.9.1
|
|
* https://www.chartjs.org
|
|
* (c) 2022 Chart.js Contributors
|
|
* Released under the MIT License
|
|
*/function ri(){}const Tu=function(){let i=0;return function(){return i++}}();function Rt(i){return i===null||typeof i>"u"}function Yt(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function At(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}const se=i=>(typeof i=="number"||i instanceof Number)&&isFinite(+i);function Te(i,t){return se(i)?i:t}function xt(i,t){return typeof i>"u"?t:i}const Ou=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:i/t,Ja=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function $t(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function Bt(i,t,e,n){let s,o,r;if(Yt(i))if(o=i.length,n)for(s=o-1;s>=0;s--)t.call(e,i[s],s);else for(s=0;s<o;s++)t.call(e,i[s],s);else if(At(i))for(r=Object.keys(i),o=r.length,s=0;s<o;s++)t.call(e,i[r[s]],r[s])}function Ts(i,t){let e,n,s,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,n=i.length;e<n;++e)if(s=i[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Os(i){if(Yt(i))return i.map(Os);if(At(i)){const t=Object.create(null),e=Object.keys(i),n=e.length;let s=0;for(;s<n;++s)t[e[s]]=Os(i[e[s]]);return t}return i}function tc(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Ru(i,t,e,n){if(!tc(i))return;const s=t[i],o=e[i];At(s)&&At(o)?En(s,o,n):t[i]=Os(o)}function En(i,t,e){const n=Yt(t)?t:[t],s=n.length;if(!At(i))return i;e=e||{};const o=e.merger||Ru;for(let r=0;r<s;++r){if(t=n[r],!At(t))continue;const l=Object.keys(t);for(let a=0,c=l.length;a<c;++a)o(l[a],i,t,e)}return i}function An(i,t){return En(i,t,{merger:Eu})}function Eu(i,t,e){if(!tc(i))return;const n=t[i],s=e[i];At(n)&&At(s)?An(n,s):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=Os(s))}const $r={"":i=>i,x:i=>i.x,y:i=>i.y};function Mi(i,t){return($r[t]||($r[t]=Fu(t)))(i)}function Fu(i){const t=Iu(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function Iu(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function Jo(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Re=i=>typeof i<"u",Si=i=>typeof i=="function",Yr=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Bu(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const Gt=Math.PI,Nt=2*Gt,zu=Nt+Gt,Rs=Number.POSITIVE_INFINITY,Nu=Gt/180,te=Gt/2,gn=Gt/4,Ur=Gt*2/3,Oe=Math.log10,si=Math.sign;function Xr(i){const t=Math.round(i);i=Pn(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Oe(i))),n=i/e;return(n<=1?1:n<=2?2:n<=5?5:10)*e}function Wu(i){const t=[],e=Math.sqrt(i);let n;for(n=1;n<e;n++)i%n===0&&(t.push(n),t.push(i/n));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function sn(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Pn(i,t,e){return Math.abs(i-t)<e}function ju(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function ec(i,t,e){let n,s,o;for(n=0,s=i.length;n<s;n++)o=i[n][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Ie(i){return i*(Gt/180)}function tr(i){return i*(180/Gt)}function qr(i){if(!se(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function ic(i,t){const e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);let o=Math.atan2(n,e);return o<-.5*Gt&&(o+=Nt),{angle:o,distance:s}}function No(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function Hu(i,t){return(i-t+zu)%Nt-Gt}function Ce(i){return(i%Nt+Nt)%Nt}function Fn(i,t,e,n){const s=Ce(i),o=Ce(t),r=Ce(e),l=Ce(o-s),a=Ce(r-s),c=Ce(s-o),d=Ce(s-r);return s===o||s===r||n&&o===r||l>a&&c<d}function pe(i,t,e){return Math.max(t,Math.min(e,i))}function Vu(i){return pe(i,-32768,32767)}function ui(i,t,e,n=1e-6){return i>=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function er(i,t,e){e=e||(r=>i[r]<t);let n=i.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,e(o)?s=o:n=o;return{lo:s,hi:n}}const di=(i,t,e,n)=>er(i,e,n?s=>i[s][t]<=e:s=>i[s][t]<e),$u=(i,t,e)=>er(i,e,n=>i[n][t]>=e);function Yu(i,t,e){let n=0,s=i.length;for(;n<s&&i[n]<t;)n++;for(;s>n&&i[s-1]>e;)s--;return n>0||s<i.length?i.slice(n,s):i}const nc=["push","pop","shift","splice","unshift"];function Uu(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),nc.forEach(e=>{const n="_onData"+Jo(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return i._chartjs.listeners.forEach(l=>{typeof l[n]=="function"&&l[n](...o)}),r}})})}function Kr(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(nc.forEach(o=>{delete i[o]}),delete i._chartjs)}function sc(i){const t=new Set;let e,n;for(e=0,n=i.length;e<n;++e)t.add(i[e]);return t.size===n?i:Array.from(t)}const oc=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function rc(i,t,e){const n=e||(r=>Array.prototype.slice.call(r));let s=!1,o=[];return function(...r){o=n(r),s||(s=!0,oc.call(window,()=>{s=!1,i.apply(t,o)}))}}function Xu(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const ir=i=>i==="start"?"left":i==="end"?"right":"center",ye=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,qu=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function lc(i,t,e){const n=t.length;let s=0,o=n;if(i._sorted){const{iScale:r,_parsed:l}=i,a=r.axis,{min:c,max:d,minDefined:f,maxDefined:p}=r.getUserBounds();f&&(s=pe(Math.min(di(l,r.axis,c).lo,e?n:di(t,a,r.getPixelForValue(c)).lo),0,n-1)),p?o=pe(Math.max(di(l,r.axis,d,!0).hi+1,e?0:di(t,a,r.getPixelForValue(d),!0).hi+1),s,n)-s:o=n-s}return{start:s,count:o}}function ac(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),o}const ds=i=>i===0||i===1,Gr=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*Nt/e)),Qr=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*Nt/e)+1,Cn={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*te)+1,easeOutSine:i=>Math.sin(i*te),easeInOutSine:i=>-.5*(Math.cos(Gt*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>ds(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>ds(i)?i:Gr(i,.075,.3),easeOutElastic:i=>ds(i)?i:Qr(i,.075,.3),easeInOutElastic(i){return ds(i)?i:i<.5?.5*Gr(i*2,.1125,.45):.5+.5*Qr(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Cn.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Cn.easeInBounce(i*2)*.5:Cn.easeOutBounce(i*2-1)*.5+.5};/*!
|
|
* @kurkle/color v0.2.1
|
|
* https://github.com/kurkle/color#readme
|
|
* (c) 2022 Jukka Kurkela
|
|
* Released under the MIT License
|
|
*/function Hn(i){return i+.5|0}const xi=(i,t,e)=>Math.max(Math.min(i,e),t);function kn(i){return xi(Hn(i*2.55),0,255)}function ki(i){return xi(Hn(i*255),0,255)}function ci(i){return xi(Hn(i/2.55)/100,0,1)}function Zr(i){return xi(Hn(i*100),0,100)}const Le={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},Wo=[..."0123456789ABCDEF"],Ku=i=>Wo[i&15],Gu=i=>Wo[(i&240)>>4]+Wo[i&15],fs=i=>(i&240)>>4===(i&15),Qu=i=>fs(i.r)&&fs(i.g)&&fs(i.b)&&fs(i.a);function Zu(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&Le[i[1]]*17,g:255&Le[i[2]]*17,b:255&Le[i[3]]*17,a:t===5?Le[i[4]]*17:255}:(t===7||t===9)&&(e={r:Le[i[1]]<<4|Le[i[2]],g:Le[i[3]]<<4|Le[i[4]],b:Le[i[5]]<<4|Le[i[6]],a:t===9?Le[i[7]]<<4|Le[i[8]]:255})),e}const Ju=(i,t)=>i<255?t(i):"";function td(i){var t=Qu(i)?Ku:Gu;return i?"#"+t(i.r)+t(i.g)+t(i.b)+Ju(i.a,t):void 0}const ed=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function cc(i,t,e){const n=t*Math.min(e,1-e),s=(o,r=(o+i/30)%12)=>e-n*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function id(i,t,e){const n=(s,o=(s+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function nd(i,t,e){const n=cc(i,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function sd(i,t,e,n,s){return i===s?(t-e)/n+(t<e?6:0):t===s?(e-i)/n+2:(i-t)/n+4}function nr(i){const e=i.r/255,n=i.g/255,s=i.b/255,o=Math.max(e,n,s),r=Math.min(e,n,s),l=(o+r)/2;let a,c,d;return o!==r&&(d=o-r,c=l>.5?d/(2-o-r):d/(o+r),a=sd(e,n,s,d,o),a=a*60+.5),[a|0,c||0,l]}function sr(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(ki)}function or(i,t,e){return sr(cc,i,t,e)}function od(i,t,e){return sr(nd,i,t,e)}function rd(i,t,e){return sr(id,i,t,e)}function uc(i){return(i%360+360)%360}function ld(i){const t=ed.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?kn(+t[5]):ki(+t[5]));const s=uc(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?n=od(s,o,r):t[1]==="hsv"?n=rd(s,o,r):n=or(s,o,r),{r:n[0],g:n[1],b:n[2],a:e}}function ad(i,t){var e=nr(i);e[0]=uc(e[0]+t),e=or(e),i.r=e[0],i.g=e[1],i.b=e[2]}function cd(i){if(!i)return;const t=nr(i),e=t[0],n=Zr(t[1]),s=Zr(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${ci(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const Jr={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"},tl={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 ud(){const i={},t=Object.keys(tl),e=Object.keys(Jr);let n,s,o,r,l;for(n=0;n<t.length;n++){for(r=l=t[n],s=0;s<e.length;s++)o=e[s],l=l.replace(o,Jr[o]);o=parseInt(tl[r],16),i[l]=[o>>16&255,o>>8&255,o&255]}return i}let hs;function dd(i){hs||(hs=ud(),hs.transparent=[0,0,0,0]);const t=hs[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const fd=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function hd(i){const t=fd.exec(i);let e=255,n,s,o;if(t){if(t[7]!==n){const r=+t[7];e=t[8]?kn(r):xi(r*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?kn(n):xi(n,0,255)),s=255&(t[4]?kn(s):xi(s,0,255)),o=255&(t[6]?kn(o):xi(o,0,255)),{r:n,g:s,b:o,a:e}}}function pd(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${ci(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const xo=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Gi=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function gd(i,t,e){const n=Gi(ci(i.r)),s=Gi(ci(i.g)),o=Gi(ci(i.b));return{r:ki(xo(n+e*(Gi(ci(t.r))-n))),g:ki(xo(s+e*(Gi(ci(t.g))-s))),b:ki(xo(o+e*(Gi(ci(t.b))-o))),a:i.a+e*(t.a-i.a)}}function ps(i,t,e){if(i){let n=nr(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=or(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function dc(i,t){return i&&Object.assign(t||{},i)}function el(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=ki(i[3]))):(t=dc(i,{r:0,g:0,b:0,a:1}),t.a=ki(t.a)),t}function md(i){return i.charAt(0)==="r"?hd(i):ld(i)}class Es{constructor(t){if(t instanceof Es)return t;const e=typeof t;let n;e==="object"?n=el(t):e==="string"&&(n=Zu(t)||dd(t)||md(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=dc(this._rgb);return t&&(t.a=ci(t.a)),t}set rgb(t){this._rgb=el(t)}rgbString(){return this._valid?pd(this._rgb):void 0}hexString(){return this._valid?td(this._rgb):void 0}hslString(){return this._valid?cd(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,s=t.rgb;let o;const r=e===o?.5:e,l=2*r-1,a=n.a-s.a,c=((l*a===-1?l:(l+a)/(1+l*a))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=r*n.a+(1-r)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=gd(this._rgb,t._rgb,e)),this}clone(){return new Es(this.rgb)}alpha(t){return this._rgb.a=ki(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Hn(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.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 ps(this._rgb,2,t),this}darken(t){return ps(this._rgb,2,-t),this}saturate(t){return ps(this._rgb,1,t),this}desaturate(t){return ps(this._rgb,1,-t),this}rotate(t){return ad(this._rgb,t),this}}function fc(i){return new Es(i)}function hc(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function il(i){return hc(i)?i:fc(i)}function wo(i){return hc(i)?i:fc(i).saturate(.5).darken(.1).hexString()}const Ii=Object.create(null),jo=Object.create(null);function Ln(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;n<s;++n){const o=e[n];i=i[o]||(i[o]=Object.create(null))}return i}function ko(i,t,e){return typeof t=="string"?En(Ln(i,t),e):En(Ln(i,""),t)}class bd{constructor(t){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=e=>e.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=(e,n)=>wo(n.backgroundColor),this.hoverBorderColor=(e,n)=>wo(n.borderColor),this.hoverColor=(e,n)=>wo(n.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)}set(t,e){return ko(this,t,e)}get(t){return Ln(this,t)}describe(t,e){return ko(jo,t,e)}override(t,e){return ko(Ii,t,e)}route(t,e,n,s){const o=Ln(this,t),r=Ln(this,n),l="_"+e;Object.defineProperties(o,{[l]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const a=this[l],c=r[s];return At(a)?Object.assign({},c,a):xt(a,c)},set(a){this[l]=a}}})}}var Pt=new bd({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function _d(i){return!i||Rt(i.size)||Rt(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Fs(i,t,e,n,s){let o=t[s];return o||(o=t[s]=i.measureText(s).width,e.push(s)),o>n&&(n=o),n}function yd(i,t,e,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},o=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let r=0;const l=e.length;let a,c,d,f,p;for(a=0;a<l;a++)if(f=e[a],f!=null&&Yt(f)!==!0)r=Fs(i,s,o,r,f);else if(Yt(f))for(c=0,d=f.length;c<d;c++)p=f[c],p!=null&&!Yt(p)&&(r=Fs(i,s,o,r,p));i.restore();const g=o.length/2;if(g>e.length){for(a=0;a<g;a++)delete s[o[a]];o.splice(0,g)}return r}function Li(i,t,e){const n=i.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*n)/n+s}function nl(i,t){t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore()}function Ho(i,t,e,n){pc(i,t,e,n,null)}function pc(i,t,e,n,s){let o,r,l,a,c,d;const f=t.pointStyle,p=t.rotation,g=t.radius;let m=(p||0)*Nu;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,n),i.rotate(m),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(g)||g<=0)){switch(i.beginPath(),f){default:s?i.ellipse(e,n,s/2,g,0,0,Nt):i.arc(e,n,g,0,Nt),i.closePath();break;case"triangle":i.moveTo(e+Math.sin(m)*g,n-Math.cos(m)*g),m+=Ur,i.lineTo(e+Math.sin(m)*g,n-Math.cos(m)*g),m+=Ur,i.lineTo(e+Math.sin(m)*g,n-Math.cos(m)*g),i.closePath();break;case"rectRounded":c=g*.516,a=g-c,r=Math.cos(m+gn)*a,l=Math.sin(m+gn)*a,i.arc(e-r,n-l,c,m-Gt,m-te),i.arc(e+l,n-r,c,m-te,m),i.arc(e+r,n+l,c,m,m+te),i.arc(e-l,n+r,c,m+te,m+Gt),i.closePath();break;case"rect":if(!p){a=Math.SQRT1_2*g,d=s?s/2:a,i.rect(e-d,n-a,2*d,2*a);break}m+=gn;case"rectRot":r=Math.cos(m)*g,l=Math.sin(m)*g,i.moveTo(e-r,n-l),i.lineTo(e+l,n-r),i.lineTo(e+r,n+l),i.lineTo(e-l,n+r),i.closePath();break;case"crossRot":m+=gn;case"cross":r=Math.cos(m)*g,l=Math.sin(m)*g,i.moveTo(e-r,n-l),i.lineTo(e+r,n+l),i.moveTo(e+l,n-r),i.lineTo(e-l,n+r);break;case"star":r=Math.cos(m)*g,l=Math.sin(m)*g,i.moveTo(e-r,n-l),i.lineTo(e+r,n+l),i.moveTo(e+l,n-r),i.lineTo(e-l,n+r),m+=gn,r=Math.cos(m)*g,l=Math.sin(m)*g,i.moveTo(e-r,n-l),i.lineTo(e+r,n+l),i.moveTo(e+l,n-r),i.lineTo(e-l,n+r);break;case"line":r=s?s/2:Math.cos(m)*g,l=Math.sin(m)*g,i.moveTo(e-r,n-l),i.lineTo(e+r,n+l);break;case"dash":i.moveTo(e,n),i.lineTo(e+Math.cos(m)*g,n+Math.sin(m)*g);break}i.fill(),t.borderWidth>0&&i.stroke()}}function In(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function js(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function Hs(i){i.restore()}function vd(i,t,e,n,s){if(!t)return i.lineTo(e.x,e.y);if(s==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else s==="after"!=!!n?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function xd(i,t,e,n){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?e.cp2x:e.cp1x,n?e.cp2y:e.cp1y,e.x,e.y)}function Bi(i,t,e,n,s,o={}){const r=Yt(t)?t:[t],l=o.strokeWidth>0&&o.strokeColor!=="";let a,c;for(i.save(),i.font=s.string,wd(i,o),a=0;a<r.length;++a)c=r[a],l&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),Rt(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,n,o.maxWidth)),i.fillText(c,e,n,o.maxWidth),kd(i,e,n,c,o),n+=s.lineHeight;i.restore()}function wd(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),Rt(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function kd(i,t,e,n,s){if(s.strikethrough||s.underline){const o=i.measureText(n),r=t-o.actualBoundingBoxLeft,l=t+o.actualBoundingBoxRight,a=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,d=s.strikethrough?(a+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=s.decorationWidth||2,i.moveTo(r,d),i.lineTo(l,d),i.stroke()}}function Bn(i,t){const{x:e,y:n,w:s,h:o,radius:r}=t;i.arc(e+r.topLeft,n+r.topLeft,r.topLeft,-te,Gt,!0),i.lineTo(e,n+o-r.bottomLeft),i.arc(e+r.bottomLeft,n+o-r.bottomLeft,r.bottomLeft,Gt,te,!0),i.lineTo(e+s-r.bottomRight,n+o),i.arc(e+s-r.bottomRight,n+o-r.bottomRight,r.bottomRight,te,0,!0),i.lineTo(e+s,n+r.topRight),i.arc(e+s-r.topRight,n+r.topRight,r.topRight,0,-te,!0),i.lineTo(e+r.topLeft,n)}const Md=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Sd=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Dd(i,t){const e=(""+i).match(Md);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const Ad=i=>+i||0;function rr(i,t){const e={},n=At(t),s=n?Object.keys(t):t,o=At(i)?n?r=>xt(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of s)e[r]=Ad(o(r));return e}function gc(i){return rr(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Ei(i){return rr(i,["topLeft","topRight","bottomLeft","bottomRight"])}function xe(i){const t=gc(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ce(i,t){i=i||{},t=t||Pt.font;let e=xt(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=xt(i.style,t.style);n&&!(""+n).match(Sd)&&(console.warn('Invalid font style specified: "'+n+'"'),n="");const s={family:xt(i.family,t.family),lineHeight:Dd(xt(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:xt(i.weight,t.weight),string:""};return s.string=_d(s),s}function Mn(i,t,e,n){let s=!0,o,r,l;for(o=0,r=i.length;o<r;++o)if(l=i[o],l!==void 0&&(t!==void 0&&typeof l=="function"&&(l=l(t),s=!1),e!==void 0&&Yt(l)&&(l=l[e%l.length],s=!1),l!==void 0))return n&&!s&&(n.cacheable=!1),l}function Pd(i,t,e){const{min:n,max:s}=i,o=Ja(t,(s-n)/2),r=(l,a)=>e&&l===0?0:l+a;return{min:r(n,-Math.abs(o)),max:r(s,o)}}function Pi(i,t){return Object.assign(Object.create(i),t)}function lr(i,t=[""],e=i,n,s=()=>i[0]){Re(n)||(n=yc("_fallback",i));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:e,_fallback:n,_getTarget:s,override:r=>lr([r,...i],t,e,n)};return new Proxy(o,{deleteProperty(r,l){return delete r[l],delete r._keys,delete i[0][l],!0},get(r,l){return bc(r,l,()=>Id(l,t,i,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,l){return ol(r).includes(l)},ownKeys(r){return ol(r)},set(r,l,a){const c=r._storage||(r._storage=s());return r[l]=c[l]=a,delete r._keys,!0}})}function on(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:mc(i,n),setContext:o=>on(i,o,e,n),override:o=>on(i.override(o),t,e,n)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,l){return bc(o,r,()=>Ld(o,r,l))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,l){return i[r]=l,delete o[r],!0}})}function mc(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:Si(e)?e:()=>e,isIndexable:Si(n)?n:()=>n}}const Cd=(i,t)=>i?i+Jo(t):t,ar=(i,t)=>At(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function bc(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const n=e();return i[t]=n,n}function Ld(i,t,e){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=i;let l=n[t];return Si(l)&&r.isScriptable(t)&&(l=Td(t,l,i,e)),Yt(l)&&l.length&&(l=Od(t,l,i,r.isIndexable)),ar(t,l)&&(l=on(l,s,o&&o[t],r)),l}function Td(i,t,e,n){const{_proxy:s,_context:o,_subProxy:r,_stack:l}=e;if(l.has(i))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+i);return l.add(i),t=t(o,r||n),l.delete(i),ar(i,t)&&(t=cr(s._scopes,s,i,t)),t}function Od(i,t,e,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:l}=e;if(Re(o.index)&&n(i))t=t[o.index%t.length];else if(At(t[0])){const a=t,c=s._scopes.filter(d=>d!==a);t=[];for(const d of a){const f=cr(c,s,i,d);t.push(on(f,o,r&&r[i],l))}}return t}function _c(i,t,e){return Si(i)?i(t,e):i}const Rd=(i,t)=>i===!0?t:typeof i=="string"?Mi(t,i):void 0;function Ed(i,t,e,n,s){for(const o of t){const r=Rd(e,o);if(r){i.add(r);const l=_c(r._fallback,e,s);if(Re(l)&&l!==e&&l!==n)return l}else if(r===!1&&Re(n)&&e!==n)return null}return!1}function cr(i,t,e,n){const s=t._rootScopes,o=_c(t._fallback,e,n),r=[...i,...s],l=new Set;l.add(n);let a=sl(l,r,e,o||e,n);return a===null||Re(o)&&o!==e&&(a=sl(l,r,o,a,n),a===null)?!1:lr(Array.from(l),[""],s,o,()=>Fd(t,e,n))}function sl(i,t,e,n,s){for(;e;)e=Ed(i,t,e,n,s);return e}function Fd(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return Yt(s)&&At(e)?e:s}function Id(i,t,e,n){let s;for(const o of t)if(s=yc(Cd(o,i),e),Re(s))return ar(i,s)?cr(e,n,i,s):s}function yc(i,t){for(const e of t){if(!e)continue;const n=e[i];if(Re(n))return n}}function ol(i){let t=i._keys;return t||(t=i._keys=Bd(i._scopes)),t}function Bd(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function vc(i,t,e,n){const{iScale:s}=i,{key:o="r"}=this._parsing,r=new Array(n);let l,a,c,d;for(l=0,a=n;l<a;++l)c=l+e,d=t[c],r[l]={r:s.parse(Mi(d,o),c)};return r}const zd=Number.EPSILON||1e-14,rn=(i,t)=>t<i.length&&!i[t].skip&&i[t],xc=i=>i==="x"?"y":"x";function Nd(i,t,e,n){const s=i.skip?t:i,o=t,r=e.skip?t:e,l=No(o,s),a=No(r,o);let c=l/(l+a),d=a/(l+a);c=isNaN(c)?0:c,d=isNaN(d)?0:d;const f=n*c,p=n*d;return{previous:{x:o.x-f*(r.x-s.x),y:o.y-f*(r.y-s.y)},next:{x:o.x+p*(r.x-s.x),y:o.y+p*(r.y-s.y)}}}function Wd(i,t,e){const n=i.length;let s,o,r,l,a,c=rn(i,0);for(let d=0;d<n-1;++d)if(a=c,c=rn(i,d+1),!(!a||!c)){if(Pn(t[d],0,zd)){e[d]=e[d+1]=0;continue}s=e[d]/t[d],o=e[d+1]/t[d],l=Math.pow(s,2)+Math.pow(o,2),!(l<=9)&&(r=3/Math.sqrt(l),e[d]=s*r*t[d],e[d+1]=o*r*t[d])}}function jd(i,t,e="x"){const n=xc(e),s=i.length;let o,r,l,a=rn(i,0);for(let c=0;c<s;++c){if(r=l,l=a,a=rn(i,c+1),!l)continue;const d=l[e],f=l[n];r&&(o=(d-r[e])/3,l[`cp1${e}`]=d-o,l[`cp1${n}`]=f-o*t[c]),a&&(o=(a[e]-d)/3,l[`cp2${e}`]=d+o,l[`cp2${n}`]=f+o*t[c])}}function Hd(i,t="x"){const e=xc(t),n=i.length,s=Array(n).fill(0),o=Array(n);let r,l,a,c=rn(i,0);for(r=0;r<n;++r)if(l=a,a=c,c=rn(i,r+1),!!a){if(c){const d=c[t]-a[t];s[r]=d!==0?(c[e]-a[e])/d:0}o[r]=l?c?si(s[r-1])!==si(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Wd(i,s,o),jd(i,o,t)}function gs(i,t,e){return Math.max(Math.min(i,e),t)}function Vd(i,t){let e,n,s,o,r,l=In(i[0],t);for(e=0,n=i.length;e<n;++e)r=o,o=l,l=e<n-1&&In(i[e+1],t),o&&(s=i[e],r&&(s.cp1x=gs(s.cp1x,t.left,t.right),s.cp1y=gs(s.cp1y,t.top,t.bottom)),l&&(s.cp2x=gs(s.cp2x,t.left,t.right),s.cp2y=gs(s.cp2y,t.top,t.bottom)))}function $d(i,t,e,n,s){let o,r,l,a;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Hd(i,s);else{let c=n?i[i.length-1]:i[0];for(o=0,r=i.length;o<r;++o)l=i[o],a=Nd(c,l,i[Math.min(o+1,r-(n?0:1))%r],t.tension),l.cp1x=a.previous.x,l.cp1y=a.previous.y,l.cp2x=a.next.x,l.cp2y=a.next.y,c=l}t.capBezierPoints&&Vd(i,e)}function wc(){return typeof window<"u"&&typeof document<"u"}function ur(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Is(i,t,e){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*t.parentNode[e])):n=i,n}const Vs=i=>window.getComputedStyle(i,null);function Yd(i,t){return Vs(i).getPropertyValue(t)}const Ud=["top","right","bottom","left"];function Fi(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=Ud[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const Xd=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function qd(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n;let r=!1,l,a;if(Xd(s,o,i.target))l=s,a=o;else{const c=t.getBoundingClientRect();l=n.clientX-c.left,a=n.clientY-c.top,r=!0}return{x:l,y:a,box:r}}function Oi(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=Vs(e),o=s.boxSizing==="border-box",r=Fi(s,"padding"),l=Fi(s,"border","width"),{x:a,y:c,box:d}=qd(i,e),f=r.left+(d&&l.left),p=r.top+(d&&l.top);let{width:g,height:m}=t;return o&&(g-=r.width+l.width,m-=r.height+l.height),{x:Math.round((a-f)/g*e.width/n),y:Math.round((c-p)/m*e.height/n)}}function Kd(i,t,e){let n,s;if(t===void 0||e===void 0){const o=ur(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),l=Vs(o),a=Fi(l,"border","width"),c=Fi(l,"padding");t=r.width-c.width-a.width,e=r.height-c.height-a.height,n=Is(l.maxWidth,o,"clientWidth"),s=Is(l.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||Rs,maxHeight:s||Rs}}const Mo=i=>Math.round(i*10)/10;function Gd(i,t,e,n){const s=Vs(i),o=Fi(s,"margin"),r=Is(s.maxWidth,i,"clientWidth")||Rs,l=Is(s.maxHeight,i,"clientHeight")||Rs,a=Kd(i,t,e);let{width:c,height:d}=a;if(s.boxSizing==="content-box"){const f=Fi(s,"border","width"),p=Fi(s,"padding");c-=p.width+f.width,d-=p.height+f.height}return c=Math.max(0,c-o.width),d=Math.max(0,n?Math.floor(c/n):d-o.height),c=Mo(Math.min(c,r,a.maxWidth)),d=Mo(Math.min(d,l,a.maxHeight)),c&&!d&&(d=Mo(c/2)),{width:c,height:d}}function rl(i,t,e){const n=t||1,s=Math.floor(i.height*n),o=Math.floor(i.width*n);i.height=s/n,i.width=o/n;const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||r.height!==s||r.width!==o?(i.currentDevicePixelRatio=n,r.height=s,r.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const Qd=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return i}();function ll(i,t){const e=Yd(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Ri(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Zd(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Jd(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=Ri(i,s,e),l=Ri(s,o,e),a=Ri(o,t,e),c=Ri(r,l,e),d=Ri(l,a,e);return Ri(c,d,e)}const al=new Map;function tf(i,t){t=t||{};const e=i+JSON.stringify(t);let n=al.get(e);return n||(n=new Intl.NumberFormat(i,t),al.set(e,n)),n}function Vn(i,t,e){return tf(t,e).format(i)}const ef=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},nf=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function nn(i,t,e){return i?ef(t,e):nf()}function kc(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function Mc(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Sc(i){return i==="angle"?{between:Fn,compare:Hu,normalize:Ce}:{between:ui,compare:(t,e)=>t-e,normalize:t=>t}}function cl({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function sf(i,t,e){const{property:n,start:s,end:o}=e,{between:r,normalize:l}=Sc(n),a=t.length;let{start:c,end:d,loop:f}=i,p,g;if(f){for(c+=a,d+=a,p=0,g=a;p<g&&r(l(t[c%a][n]),s,o);++p)c--,d--;c%=a,d%=a}return d<c&&(d+=a),{start:c,end:d,loop:f,style:i.style}}function Dc(i,t,e){if(!e)return[i];const{property:n,start:s,end:o}=e,r=t.length,{compare:l,between:a,normalize:c}=Sc(n),{start:d,end:f,loop:p,style:g}=sf(i,t,e),m=[];let _=!1,y=null,v,w,M;const k=()=>a(s,M,v)&&l(s,M)!==0,S=()=>l(o,v)===0||a(o,M,v),L=()=>_||k(),C=()=>!_||S();for(let T=d,E=d;T<=f;++T)w=t[T%r],!w.skip&&(v=c(w[n]),v!==M&&(_=a(v,s,o),y===null&&L()&&(y=l(v,s)===0?T:E),y!==null&&C()&&(m.push(cl({start:y,end:T,loop:p,count:r,style:g})),y=null),E=T,M=v));return y!==null&&m.push(cl({start:y,end:f,loop:p,count:r,style:g})),m}function Ac(i,t){const e=[],n=i.segments;for(let s=0;s<n.length;s++){const o=Dc(n[s],i.points,t);o.length&&e.push(...o)}return e}function of(i,t,e,n){let s=0,o=t-1;if(e&&!n)for(;s<t&&!i[s].skip;)s++;for(;s<t&&i[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&i[o%t].skip;)o--;return o%=t,{start:s,end:o}}function rf(i,t,e,n){const s=i.length,o=[];let r=t,l=i[t],a;for(a=t+1;a<=e;++a){const c=i[a%s];c.skip||c.stop?l.skip||(n=!1,o.push({start:t%s,end:(a-1)%s,loop:n}),t=r=c.stop?a:null):(r=a,l.skip&&(t=a)),l=c}return r!==null&&o.push({start:t%s,end:r%s,loop:n}),o}function lf(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const o=!!i._loop,{start:r,end:l}=of(e,s,o,n);if(n===!0)return ul(i,[{start:r,end:l,loop:o}],e,t);const a=l<r?l+s:l,c=!!i._fullLoop&&r===0&&l===s-1;return ul(i,rf(e,r,a,c),e,t)}function ul(i,t,e,n){return!n||!n.setContext||!e?t:af(i,t,e,n)}function af(i,t,e,n){const s=i._chart.getContext(),o=dl(i.options),{_datasetIndex:r,options:{spanGaps:l}}=i,a=e.length,c=[];let d=o,f=t[0].start,p=f;function g(m,_,y,v){const w=l?-1:1;if(m!==_){for(m+=a;e[m%a].skip;)m-=w;for(;e[_%a].skip;)_+=w;m%a!==_%a&&(c.push({start:m%a,end:_%a,loop:y,style:v}),d=v,f=_%a)}}for(const m of t){f=l?f:m.start;let _=e[f%a],y;for(p=f+1;p<=m.end;p++){const v=e[p%a];y=dl(n.setContext(Pi(s,{type:"segment",p0:_,p1:v,p0DataIndex:(p-1)%a,p1DataIndex:p%a,datasetIndex:r}))),cf(y,d)&&g(f,p-1,m.loop,d),_=v,d=y}f<p-1&&g(f,p-1,m.loop,d)}return c}function dl(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function cf(i,t){return t&&JSON.stringify(i)!==JSON.stringify(t)}/*!
|
|
* Chart.js v3.9.1
|
|
* https://www.chartjs.org
|
|
* (c) 2022 Chart.js Contributors
|
|
* Released under the MIT License
|
|
*/class uf{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,s){const o=e.listeners[s],r=e.duration;o.forEach(l=>l({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(n-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=oc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const o=n.items;let r=o.length-1,l=!1,a;for(;r>=0;--r)a=o[r],a._active?(a._total>n.duration&&(n.duration=a._total),a.tick(t),l=!0):(o[r]=o[o.length-1],o.pop());l&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var li=new uf;const fl="transparent",df={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=il(i||fl),s=n.valid&&il(t||fl);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class ff{constructor(t,e,n,s){const o=e[n];s=Mn([t.to,s,o,t.from]);const r=Mn([t.from,o,s]);this._active=!0,this._fn=t.fn||df[t.type||typeof r],this._easing=Cn[t.easing]||Cn.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],o=n-this._start,r=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Mn([t.to,e,s,t.from]),this._from=Mn([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,o=this._from,r=this._loop,l=this._to;let a;if(this._active=o!==l&&(r||e<n),!this._active){this._target[s]=l,this._notify(!0);return}if(e<0){this._target[s]=o;return}a=e/n%2,a=r&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(o,l,a)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][e]()}}const hf=["x","y","borderWidth","radius","tension"],pf=["color","borderColor","backgroundColor"];Pt.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const gf=Object.keys(Pt.animation);Pt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:i=>i!=="onProgress"&&i!=="onComplete"&&i!=="fn"});Pt.set("animations",{colors:{type:"color",properties:pf},numbers:{type:"number",properties:hf}});Pt.describe("animations",{_fallback:"animation"});Pt.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:i=>i|0}}}});class Pc{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!At(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const s=t[n];if(!At(s))return;const o={};for(const r of gf)o[r]=s[r];(Yt(s.properties)&&s.properties||[n]).forEach(r=>{(r===n||!e.has(r))&&e.set(r,o)})})}_animateOptions(t,e){const n=e.options,s=bf(t,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&mf(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),l=Date.now();let a;for(a=r.length-1;a>=0;--a){const c=r[a];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const d=e[c];let f=o[c];const p=n.get(c);if(f)if(p&&f.active()){f.update(p,d,l);continue}else f.cancel();if(!p||!p.duration){t[c]=d;continue}o[c]=f=new ff(p,t,c,d),s.push(f)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return li.add(this._chart,n),!0}}function mf(i,t){const e=[],n=Object.keys(t);for(let s=0;s<n.length;s++){const o=i[n[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function bf(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function hl(i,t){const e=i&&i.options||{},n=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:n?o:s,end:n?s:o}}function _f(i,t,e){if(e===!1)return!1;const n=hl(i,e),s=hl(t,e);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function yf(i){let t,e,n,s;return At(i)?(t=i.top,e=i.right,n=i.bottom,s=i.left):t=e=n=s=i,{top:t,right:e,bottom:n,left:s,disabled:i===!1}}function Cc(i,t){const e=[],n=i._getSortedDatasetMetas(t);let s,o;for(s=0,o=n.length;s<o;++s)e.push(n[s].index);return e}function pl(i,t,e,n={}){const s=i.keys,o=n.mode==="single";let r,l,a,c;if(t!==null){for(r=0,l=s.length;r<l;++r){if(a=+s[r],a===e){if(n.all)continue;break}c=i.values[a],se(c)&&(o||t===0||si(t)===si(c))&&(t+=c)}return t}}function vf(i){const t=Object.keys(i),e=new Array(t.length);let n,s,o;for(n=0,s=t.length;n<s;++n)o=t[n],e[n]={x:o,y:i[o]};return e}function gl(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function xf(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function wf(i){const{min:t,max:e,minDefined:n,maxDefined:s}=i.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function kf(i,t,e){const n=i[t]||(i[t]={});return n[e]||(n[e]={})}function ml(i,t,e,n){for(const s of t.getMatchingVisibleMetas(n).reverse()){const o=i[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function bl(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:l}=n,a=o.axis,c=r.axis,d=xf(o,r,n),f=t.length;let p;for(let g=0;g<f;++g){const m=t[g],{[a]:_,[c]:y}=m,v=m._stacks||(m._stacks={});p=v[c]=kf(s,d,_),p[l]=y,p._top=ml(p,r,!0,n.type),p._bottom=ml(p,r,!1,n.type)}}function So(i,t){const e=i.scales;return Object.keys(e).filter(n=>e[n].axis===t).shift()}function Mf(i,t){return Pi(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Sf(i,t,e){return Pi(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function mn(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const o=s._stacks;if(!o||o[n]===void 0||o[n][e]===void 0)return;delete o[n][e]}}}const Do=i=>i==="reset"||i==="none",_l=(i,t)=>t?i:Object.assign({},i),Df=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Cc(e,!0),values:null};class Ve{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,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.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=gl(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&mn(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(f,p,g,m)=>f==="x"?p:f==="r"?m:g,o=e.xAxisID=xt(n.xAxisID,So(t,"x")),r=e.yAxisID=xt(n.yAxisID,So(t,"y")),l=e.rAxisID=xt(n.rAxisID,So(t,"r")),a=e.indexAxis,c=e.iAxisID=s(a,o,r,l),d=e.vAxisID=s(a,r,o,l);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(l),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(d)}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 e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Kr(this._data,this),t._stacked&&mn(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(At(e))this._data=vf(e);else if(n!==e){if(n){Kr(n,this);const s=this._cachedMeta;mn(s),s._parsed=[]}e&&Object.isExtensible(e)&&Uu(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=gl(e.vScale,e),e.stack!==n.stack&&(s=!0,mn(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&bl(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:r}=n,l=o.axis;let a=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],d,f,p;if(this._parsing===!1)n._parsed=s,n._sorted=!0,p=s;else{Yt(s[t])?p=this.parseArrayData(n,s,t,e):At(s[t])?p=this.parseObjectData(n,s,t,e):p=this.parsePrimitiveData(n,s,t,e);const g=()=>f[l]===null||c&&f[l]<c[l];for(d=0;d<e;++d)n._parsed[d+t]=f=p[d],a&&(g()&&(a=!1),c=f);n._sorted=a}r&&bl(this,p)}parsePrimitiveData(t,e,n,s){const{iScale:o,vScale:r}=t,l=o.axis,a=r.axis,c=o.getLabels(),d=o===r,f=new Array(s);let p,g,m;for(p=0,g=s;p<g;++p)m=p+n,f[p]={[l]:d||o.parse(c[m],m),[a]:r.parse(e[m],m)};return f}parseArrayData(t,e,n,s){const{xScale:o,yScale:r}=t,l=new Array(s);let a,c,d,f;for(a=0,c=s;a<c;++a)d=a+n,f=e[d],l[a]={x:o.parse(f[0],d),y:r.parse(f[1],d)};return l}parseObjectData(t,e,n,s){const{xScale:o,yScale:r}=t,{xAxisKey:l="x",yAxisKey:a="y"}=this._parsing,c=new Array(s);let d,f,p,g;for(d=0,f=s;d<f;++d)p=d+n,g=e[p],c[d]={x:o.parse(Mi(g,l),p),y:r.parse(Mi(g,a),p)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const s=this.chart,o=this._cachedMeta,r=e[t.axis],l={keys:Cc(s,!0),values:e._stacks[t.axis]};return pl(l,r,o.index,{mode:n})}updateRangeFromParsed(t,e,n,s){const o=n[e.axis];let r=o===null?NaN:o;const l=s&&n._stacks[e.axis];s&&l&&(s.values=l,r=pl(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,r=s.length,l=this._getOtherScale(t),a=Df(e,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:f}=wf(l);let p,g;function m(){g=s[p];const _=g[l.axis];return!se(g[t.axis])||d>_||f<_}for(p=0;p<r&&!(!m()&&(this.updateRangeFromParsed(c,t,g,a),o));++p);if(o){for(p=r-1;p>=0;--p)if(!m()){this.updateRangeFromParsed(c,t,g,a);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,o,r;for(s=0,o=e.length;s<o;++s)r=e[s][t.axis],se(r)&&n.push(r);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=yf(xt(this.options.clip,_f(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,s=n.data||[],o=e.chartArea,r=[],l=this._drawStart||0,a=this._drawCount||s.length-l,c=this.options.drawActiveElementsOnTop;let d;for(n.dataset&&n.dataset.draw(t,o,l,a),d=l;d<l+a;++d){const f=s[d];f.hidden||(f.active&&c?r.push(f):f.draw(t,o))}for(d=0;d<r.length;++d)r[d].draw(t,o)}getStyle(t,e){const n=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=Sf(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Mf(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=n,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const s=e==="active",o=this._cachedDataOpts,r=t+"-"+e,l=o[r],a=this.enableOptionSharing&&Re(n);if(l)return _l(l,a);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),f=s?[`${t}Hover`,"hover",t,""]:[t,""],p=c.getOptionScopes(this.getDataset(),d),g=Object.keys(Pt.elements[t]),m=()=>this.getContext(n,s),_=c.resolveNamedOptions(p,g,m,f);return _.$shared&&(_.$shared=a,o[r]=Object.freeze(_l(_,a))),_}_resolveAnimations(t,e,n){const s=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,l=o[r];if(l)return l;let a;if(s.options.animation!==!1){const d=this.chart.config,f=d.datasetAnimationScopeKeys(this._type,e),p=d.getOptionScopes(this.getDataset(),f);a=d.createResolver(p,this.getContext(t,n,e))}const c=new Pc(s,a&&a.animations);return a&&a._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Do(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(n),r=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,n),{sharedOptions:o,includeOptions:r}}updateElement(t,e,n,s){Do(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!Do(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"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 e=this._data,n=this._cachedMeta.data;for(const[l,a,c]of this._syncList)this[l](a,c);this._syncList=[];const s=n.length,o=e.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,n=!0){const s=this._cachedMeta,o=s.data,r=t+e;let l;const a=c=>{for(c.length+=e,l=c.length-1;l>=r;l--)c[l]=c[l-e]};for(a(o),l=t;l<r;++l)o[l]=new this.dataElementType;this._parsing&&a(s._parsed),this.parse(t,e),n&&this.updateElements(o,t,e,"reset")}updateElements(t,e,n,s){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const s=n._parsed.splice(t,e);n._stacked&&mn(n,s)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,s]=t;this[e](n,s)}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,e){e&&this._sync(["_removeElements",t,e]);const n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Ve.defaults={};Ve.prototype.datasetElementType=null;Ve.prototype.dataElementType=null;function Af(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let n=[];for(let s=0,o=e.length;s<o;s++)n=n.concat(e[s].controller.getAllParsedValues(i));i._cache.$bar=sc(n.sort((s,o)=>s-o))}return i._cache.$bar}function Pf(i){const t=i.iScale,e=Af(t,i.type);let n=t._length,s,o,r,l;const a=()=>{r===32767||r===-32768||(Re(l)&&(n=Math.min(n,Math.abs(r-l)||n)),l=r)};for(s=0,o=e.length;s<o;++s)r=t.getPixelForValue(e[s]),a();for(l=void 0,s=0,o=t.ticks.length;s<o;++s)r=t.getPixelForTick(s),a();return n}function Cf(i,t,e,n){const s=e.barThickness;let o,r;return Rt(s)?(o=t.min*e.categoryPercentage,r=e.barPercentage):(o=s*n,r=1),{chunk:o/n,ratio:r,start:t.pixels[i]-o/2}}function Lf(i,t,e,n){const s=t.pixels,o=s[i];let r=i>0?s[i-1]:null,l=i<s.length-1?s[i+1]:null;const a=e.categoryPercentage;r===null&&(r=o-(l===null?t.end-t.start:l-o)),l===null&&(l=o+o-r);const c=o-(o-Math.min(r,l))/2*a;return{chunk:Math.abs(l-r)/2*a/n,ratio:e.barPercentage,start:c}}function Tf(i,t,e,n){const s=e.parse(i[0],n),o=e.parse(i[1],n),r=Math.min(s,o),l=Math.max(s,o);let a=r,c=l;Math.abs(r)>Math.abs(l)&&(a=l,c=r),t[e.axis]=c,t._custom={barStart:a,barEnd:c,start:s,end:o,min:r,max:l}}function Lc(i,t,e,n){return Yt(i)?Tf(i,t,e,n):t[e.axis]=e.parse(i,n),t}function yl(i,t,e,n){const s=i.iScale,o=i.vScale,r=s.getLabels(),l=s===o,a=[];let c,d,f,p;for(c=e,d=e+n;c<d;++c)p=t[c],f={},f[s.axis]=l||s.parse(r[c],c),a.push(Lc(p,f,o,c));return a}function Ao(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function Of(i,t,e){return i!==0?si(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Rf(i){let t,e,n,s,o;return i.horizontal?(t=i.base>i.x,e="left",n="right"):(t=i.base<i.y,e="bottom",n="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:n,reverse:t,top:s,bottom:o}}function Ef(i,t,e,n){let s=t.borderSkipped;const o={};if(!s){i.borderSkipped=o;return}if(s===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:l,reverse:a,top:c,bottom:d}=Rf(i);s==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===n?s=c:(e._bottom||0)===n?s=d:(o[vl(d,r,l,a)]=!0,s=c)),o[vl(s,r,l,a)]=!0,i.borderSkipped=o}function vl(i,t,e,n){return n?(i=Ff(i,t,e),i=xl(i,e,t)):i=xl(i,t,e),i}function Ff(i,t,e){return i===t?e:i===e?t:i}function xl(i,t,e){return i==="start"?t:i==="end"?e:i}function If(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class $s extends Ve{parsePrimitiveData(t,e,n,s){return yl(t,e,n,s)}parseArrayData(t,e,n,s){return yl(t,e,n,s)}parseObjectData(t,e,n,s){const{iScale:o,vScale:r}=t,{xAxisKey:l="x",yAxisKey:a="y"}=this._parsing,c=o.axis==="x"?l:a,d=r.axis==="x"?l:a,f=[];let p,g,m,_;for(p=n,g=n+s;p<g;++p)_=e[p],m={},m[o.axis]=o.parse(Mi(_,c),p),f.push(Lc(Mi(_,d),m,r,p));return f}updateRangeFromParsed(t,e,n,s){super.updateRangeFromParsed(t,e,n,s);const o=n._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:s}=e,o=this.getParsed(t),r=o._custom,l=Ao(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,s){const o=s==="reset",{index:r,_cachedMeta:{vScale:l}}=this,a=l.getBasePixel(),c=l.isHorizontal(),d=this._getRuler(),{sharedOptions:f,includeOptions:p}=this._getSharedOptions(e,s);for(let g=e;g<e+n;g++){const m=this.getParsed(g),_=o||Rt(m[l.axis])?{base:a,head:a}:this._calculateBarValuePixels(g),y=this._calculateBarIndexPixels(g,d),v=(m._stacks||{})[l.axis],w={horizontal:c,base:_.base,enableBorderRadius:!v||Ao(m._custom)||r===v._top||r===v._bottom,x:c?_.head:y.center,y:c?y.center:_.head,height:c?y.size:Math.abs(_.size),width:c?Math.abs(_.size):y.size};p&&(w.options=f||this.resolveDataElementOptions(g,t[g].active?"active":s));const M=w.options||t[g].options;Ef(w,M,v,r),If(w,M,d.ratio),this.updateElement(t[g],g,w,s)}}_getStacks(t,e){const{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(a=>a.controller.options.grouped),o=n.options.stacked,r=[],l=a=>{const c=a.controller.getParsed(e),d=c&&c[a.vScale.axis];if(Rt(d)||isNaN(d))return!0};for(const a of s)if(!(e!==void 0&&l(a))&&((o===!1||r.indexOf(a.stack)===-1||o===void 0&&a.stack===void 0)&&r.push(a.stack),a.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const s=this._getStacks(t,n),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,s=[];let o,r;for(o=0,r=e.data.length;o<r;++o)s.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));const l=t.barThickness;return{min:l||Pf(e),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n},options:{base:s,minBarLength:o}}=this,r=s||0,l=this.getParsed(t),a=l._custom,c=Ao(a);let d=l[e.axis],f=0,p=n?this.applyStack(e,l,n):d,g,m;p!==d&&(f=p-d,p=d),c&&(d=a.barStart,p=a.barEnd-a.barStart,d!==0&&si(d)!==si(a.barEnd)&&(f=0),f+=d);const _=!Rt(s)&&!c?s:f;let y=e.getPixelForValue(_);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(f+p):g=y,m=g-y,Math.abs(m)<o){m=Of(m,e,r)*o,d===r&&(y-=m/2);const v=e.getPixelForDecimal(0),w=e.getPixelForDecimal(1),M=Math.min(v,w),k=Math.max(v,w);y=Math.max(Math.min(y,k),M),g=y+m}if(y===e.getPixelForValue(r)){const v=si(m)*e.getLineWidthForValue(r)/2;y+=v,m-=v}return{size:m,base:y,head:g,center:g+m/2}}_calculateBarIndexPixels(t,e){const n=e.scale,s=this.options,o=s.skipNull,r=xt(s.maxBarThickness,1/0);let l,a;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,d=s.barThickness==="flex"?Lf(t,e,s,c):Cf(t,e,s,c),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);l=d.start+d.chunk*f+d.chunk/2,a=Math.min(r,d.chunk*d.ratio)}else l=n.getPixelForValue(this.getParsed(t)[n.axis],t),a=Math.min(r,e.min*e.ratio);return{base:l-a/2,head:l+a/2,center:l,size:a}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,s=n.length;let o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&n[o].draw(this._ctx)}}$s.id="bar";$s.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};$s.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Ys extends Ve{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,s){const o=super.parsePrimitiveData(t,e,n,s);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+n).radius;return o}parseArrayData(t,e,n,s){const o=super.parseArrayData(t,e,n,s);for(let r=0;r<o.length;r++){const l=e[n+r];o[r]._custom=xt(l[2],this.resolveDataElementOptions(r+n).radius)}return o}parseObjectData(t,e,n,s){const o=super.parseObjectData(t,e,n,s);for(let r=0;r<o.length;r++){const l=e[n+r];o[r]._custom=xt(l&&l.r&&+l.r,this.resolveDataElementOptions(r+n).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:n,yScale:s}=e,o=this.getParsed(t),r=n.getLabelForValue(o.x),l=s.getLabelForValue(o.y),a=o._custom;return{label:e.label,value:"("+r+", "+l+(a?", "+a:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:r,vScale:l}=this._cachedMeta,{sharedOptions:a,includeOptions:c}=this._getSharedOptions(e,s),d=r.axis,f=l.axis;for(let p=e;p<e+n;p++){const g=t[p],m=!o&&this.getParsed(p),_={},y=_[d]=o?r.getPixelForDecimal(.5):r.getPixelForValue(m[d]),v=_[f]=o?l.getBasePixel():l.getPixelForValue(m[f]);_.skip=isNaN(y)||isNaN(v),c&&(_.options=a||this.resolveDataElementOptions(p,g.active?"active":s),o&&(_.options.radius=0)),this.updateElement(g,p,_,s)}}resolveDataElementOptions(t,e){const n=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return e!=="active"&&(s.radius=0),s.radius+=xt(n&&n._custom,o),s}}Ys.id="bubble";Ys.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};Ys.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function Bf(i,t,e){let n=1,s=1,o=0,r=0;if(t<Nt){const l=i,a=l+t,c=Math.cos(l),d=Math.sin(l),f=Math.cos(a),p=Math.sin(a),g=(M,k,S)=>Fn(M,l,a,!0)?1:Math.max(k,k*e,S,S*e),m=(M,k,S)=>Fn(M,l,a,!0)?-1:Math.min(k,k*e,S,S*e),_=g(0,c,f),y=g(te,d,p),v=m(Gt,c,f),w=m(Gt+te,d,p);n=(_-v)/2,s=(y-w)/2,o=-(_+v)/2,r=-(y+w)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}class cn extends Ve{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=a=>+n[a];if(At(n[t])){const{key:a="value"}=this._parsing;o=c=>+Mi(n[c],a)}let r,l;for(r=t,l=t+e;r<l;++r)s._parsed[r]=o(r)}}_getRotation(){return Ie(this.options.rotation-90)}_getCircumference(){return Ie(this.options.circumference)}_getRotationExtents(){let t=Nt,e=-Nt;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)){const s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,l=Math.max((Math.min(n.width,n.height)-r)/2,0),a=Math.min(Ou(this.options.cutout,l),1),c=this._getRingWeight(this.index),{circumference:d,rotation:f}=this._getRotationExtents(),{ratioX:p,ratioY:g,offsetX:m,offsetY:_}=Bf(f,d,a),y=(n.width-r)/p,v=(n.height-r)/g,w=Math.max(Math.min(y,v)/2,0),M=Ja(this.options.radius,w),k=Math.max(M*a,0),S=(M-k)/this._getVisibleDatasetWeightTotal();this.offsetX=m*M,this.offsetY=_*M,s.total=this.calculateTotal(),this.outerRadius=M-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const n=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/Nt)}updateElements(t,e,n,s){const o=s==="reset",r=this.chart,l=r.chartArea,c=r.options.animation,d=(l.left+l.right)/2,f=(l.top+l.bottom)/2,p=o&&c.animateScale,g=p?0:this.innerRadius,m=p?0:this.outerRadius,{sharedOptions:_,includeOptions:y}=this._getSharedOptions(e,s);let v=this._getRotation(),w;for(w=0;w<e;++w)v+=this._circumference(w,o);for(w=e;w<e+n;++w){const M=this._circumference(w,o),k=t[w],S={x:d+this.offsetX,y:f+this.offsetY,startAngle:v,endAngle:v+M,circumference:M,outerRadius:m,innerRadius:g};y&&(S.options=_||this.resolveDataElementOptions(w,k.active?"active":s)),v+=M,this.updateElement(k,w,S,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Nt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=Vn(e._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,o,r,l,a;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){r=n.getDatasetMeta(s),t=r.data,l=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)a=l.resolveDataElementOptions(s),a.borderAlign!=="inner"&&(e=Math.max(e,a.borderWidth||0,a.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,s=t.length;n<s;++n){const o=this.resolveDataElementOptions(n);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(xt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}cn.id="doughnut";cn.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"};cn.descriptors={_scriptable:i=>i!=="spacing",_indexable:i=>i!=="spacing"};cn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const t=i.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((n,s)=>{const r=i.getDatasetMeta(0).controller.getStyle(s);return{text:n,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(s),index:s}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){let t=i.label;const e=": "+i.formattedValue;return Yt(t)?(t=t.slice(),t[0]+=e):t+=e,t}}}}};class $n extends Ve{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:l,count:a}=lc(e,s,r);this._drawStart=l,this._drawCount=a,ac(e)&&(l=0,a=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!r,options:c},t),this.updateElements(s,l,a,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:r,vScale:l,_stacked:a,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:f}=this._getSharedOptions(e,s),p=r.axis,g=l.axis,{spanGaps:m,segment:_}=this.options,y=sn(m)?m:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||o||s==="none";let w=e>0&&this.getParsed(e-1);for(let M=e;M<e+n;++M){const k=t[M],S=this.getParsed(M),L=v?k:{},C=Rt(S[g]),T=L[p]=r.getPixelForValue(S[p],M),E=L[g]=o||C?l.getBasePixel():l.getPixelForValue(a?this.applyStack(l,S,a):S[g],M);L.skip=isNaN(T)||isNaN(E)||C,L.stop=M>0&&Math.abs(S[p]-w[p])>y,_&&(L.parsed=S,L.raw=c.data[M]),f&&(L.options=d||this.resolveDataElementOptions(M,k.active?"active":s)),v||this.updateElement(k,M,L,s),w=S}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}$n.id="line";$n.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};$n.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Us extends Ve{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=Vn(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,n,s){return vc.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),r=Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0),l=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,e,n,s){const o=s==="reset",r=this.chart,a=r.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,f=c.yCenter,p=c.getIndexAngle(0)-.5*Gt;let g=p,m;const _=360/this.countVisibleElements();for(m=0;m<e;++m)g+=this._computeAngle(m,s,_);for(m=e;m<e+n;m++){const y=t[m];let v=g,w=g+this._computeAngle(m,s,_),M=r.getDataVisibility(m)?c.getDistanceFromCenterForValue(this.getParsed(m).r):0;g=w,o&&(a.animateScale&&(M=0),a.animateRotate&&(v=w=p));const k={x:d,y:f,innerRadius:0,outerRadius:M,startAngle:v,endAngle:w,options:this.resolveDataElementOptions(m,y.active?"active":s)};this.updateElement(y,m,k,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?Ie(this.resolveDataElementOptions(t,e).angle||n):0}}Us.id="polarArea";Us.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Us.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const t=i.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((n,s)=>{const r=i.getDatasetMeta(0).controller.getStyle(s);return{text:n,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(s),index:s}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){return i.chart.data.labels[i.dataIndex]+": "+i.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class dr extends cn{}dr.id="pie";dr.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Xs extends Ve{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,s){return vc.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta,n=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(n.points=s,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const l={_loop:!0,_fullLoop:o.length===s.length,options:r};this.updateElement(n,void 0,l,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,n,s){const o=this._cachedMeta.rScale,r=s==="reset";for(let l=e;l<e+n;l++){const a=t[l],c=this.resolveDataElementOptions(l,a.active?"active":s),d=o.getPointPositionForValue(l,this.getParsed(l).r),f=r?o.xCenter:d.x,p=r?o.yCenter:d.y,g={x:f,y:p,angle:d.angle,skip:isNaN(f)||isNaN(p),options:c};this.updateElement(a,l,g,s)}}}Xs.id="radar";Xs.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};Xs.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class $e{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return sn(this.x)&&sn(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}}$e.defaults={};$e.defaultRoutes=void 0;const Tc={values(i){return Yt(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=zf(i,e)}const r=Oe(Math.abs(o)),l=Math.max(Math.min(-1*Math.floor(r),20),0),a={notation:s,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(a,this.options.ticks.format),Vn(i,n,a)},logarithmic(i,t,e){if(i===0)return"0";const n=i/Math.pow(10,Math.floor(Oe(i)));return n===1||n===2||n===5?Tc.numeric.call(this,i,t,e):""}};function zf(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var qs={formatters:Tc};Pt.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(i,t)=>t.lineWidth,tickColor:(i,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:qs.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});Pt.route("scale.ticks","color","","color");Pt.route("scale.grid","color","","borderColor");Pt.route("scale.grid","borderColor","","borderColor");Pt.route("scale.title","color","","color");Pt.describe("scale",{_fallback:!1,_scriptable:i=>!i.startsWith("before")&&!i.startsWith("after")&&i!=="callback"&&i!=="parser",_indexable:i=>i!=="borderDash"&&i!=="tickBorderDash"});Pt.describe("scales",{_fallback:"scale"});Pt.describe("scale.ticks",{_scriptable:i=>i!=="backdropPadding"&&i!=="callback",_indexable:i=>i!=="backdropPadding"});function Nf(i,t){const e=i.options.ticks,n=e.maxTicksLimit||Wf(i),s=e.major.enabled?Hf(t):[],o=s.length,r=s[0],l=s[o-1],a=[];if(o>n)return Vf(t,a,s,o/n),a;const c=jf(s,t,n);if(o>0){let d,f;const p=o>1?Math.round((l-r)/(o-1)):null;for(ms(t,a,c,Rt(p)?0:r-p,r),d=0,f=o-1;d<f;d++)ms(t,a,c,s[d],s[d+1]);return ms(t,a,c,l,Rt(p)?t.length:l+p),a}return ms(t,a,c),a}function Wf(i){const t=i.options.offset,e=i._tickSize(),n=i._length/e+(t?0:1),s=i._maxLength/e;return Math.floor(Math.min(n,s))}function jf(i,t,e){const n=$f(i),s=t.length/e;if(!n)return Math.max(s,1);const o=Wu(n);for(let r=0,l=o.length-1;r<l;r++){const a=o[r];if(a>s)return a}return Math.max(s,1)}function Hf(i){const t=[];let e,n;for(e=0,n=i.length;e<n;e++)i[e].major&&t.push(e);return t}function Vf(i,t,e,n){let s=0,o=e[0],r;for(n=Math.ceil(n),r=0;r<i.length;r++)r===o&&(t.push(i[r]),s++,o=e[s*n])}function ms(i,t,e,n,s){const o=xt(n,0),r=Math.min(xt(s,i.length),i.length);let l=0,a,c,d;for(e=Math.ceil(e),s&&(a=s-n,e=a/Math.floor(a/e)),d=o;d<0;)l++,d=Math.round(o+l*e);for(c=Math.max(o,0);c<r;c++)c===d&&(t.push(i[c]),l++,d=Math.round(o+l*e))}function $f(i){const t=i.length;let e,n;if(t<2)return!1;for(n=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==n)return!1;return n}const Yf=i=>i==="left"?"right":i==="right"?"left":i,wl=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e;function kl(i,t){const e=[],n=i.length/t,s=i.length;let o=0;for(;o<s;o+=n)e.push(i[Math.floor(o)]);return e}function Uf(i,t,e){const n=i.ticks.length,s=Math.min(t,n-1),o=i._startPixel,r=i._endPixel,l=1e-6;let a=i.getPixelForTick(s),c;if(!(e&&(n===1?c=Math.max(a-o,r-a):t===0?c=(i.getPixelForTick(1)-a)/2:c=(a-i.getPixelForTick(s-1))/2,a+=s<t?c:-c,a<o-l||a>r+l)))return a}function Xf(i,t){Bt(i,e=>{const n=e.gc,s=n.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[n[o]];n.splice(0,s)}})}function bn(i){return i.drawTicks?i.tickLength:0}function Ml(i,t){if(!i.display)return 0;const e=ce(i.font,t),n=xe(i.padding);return(Yt(i.text)?i.text.length:1)*e.lineHeight+n.height}function qf(i,t){return Pi(i,{scale:t,type:"scale"})}function Kf(i,t,e){return Pi(i,{tick:e,index:t,type:"tick"})}function Gf(i,t,e){let n=ir(i);return(e&&t!=="right"||!e&&t==="right")&&(n=Yf(n)),n}function Qf(i,t,e,n){const{top:s,left:o,bottom:r,right:l,chart:a}=i,{chartArea:c,scales:d}=a;let f=0,p,g,m;const _=r-s,y=l-o;if(i.isHorizontal()){if(g=ye(n,o,l),At(e)){const v=Object.keys(e)[0],w=e[v];m=d[v].getPixelForValue(w)+_-t}else e==="center"?m=(c.bottom+c.top)/2+_-t:m=wl(i,e,t);p=l-o}else{if(At(e)){const v=Object.keys(e)[0],w=e[v];g=d[v].getPixelForValue(w)-y+t}else e==="center"?g=(c.left+c.right)/2-y+t:g=wl(i,e,t);m=ye(n,r,s),f=e==="left"?-te:te}return{titleX:g,titleY:m,maxWidth:p,rotation:f}}class zi extends $e{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,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:s}=this;return t=Te(t,Number.POSITIVE_INFINITY),e=Te(e,Number.NEGATIVE_INFINITY),n=Te(n,Number.POSITIVE_INFINITY),s=Te(s,Number.NEGATIVE_INFINITY),{min:Te(t,n),max:Te(e,s),minDefined:se(t),maxDefined:se(e)}}getMinMax(t){let{min:e,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:e,max:n};const l=this.getMatchingVisibleMetas();for(let a=0,c=l.length;a<c;++a)r=l[a].controller.getMinMax(this,t),s||(e=Math.min(e,r.min)),o||(n=Math.max(n,r.max));return e=o&&e>n?n:e,n=s&&e>n?e:n,{min:Te(e,Te(n,e)),max:Te(n,Te(e,n))}}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||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){$t(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:o,ticks:r}=this.options,l=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Pd(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=l<this.ticks.length;this._convertTicksToLabels(a?kl(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Nf(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),a&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,n;this.isHorizontal()?(e=this.left,n=this.right):(e=this.top,n=this.bottom,t=!t),this._startPixel=e,this._endPixel=n,this._reversePixels=t,this._length=n-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){$t(this.options.afterUpdate,[this])}beforeSetDimensions(){$t(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(){$t(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),$t(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){$t(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n],o.label=$t(e.callback,[o.value,n,t],this)}afterTickToLabelConversion(){$t(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){$t(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=this.ticks.length,s=e.minRotation||0,o=e.maxRotation;let r=s,l,a,c;if(!this._isVisible()||!e.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const d=this._getLabelSizes(),f=d.widest.width,p=d.highest.height,g=pe(this.chart.width-f,0,this.maxWidth);l=t.offset?this.maxWidth/n:g/(n-1),f+6>l&&(l=g/(n-(t.offset?.5:1)),a=this.maxHeight-bn(t.grid)-e.padding-Ml(t.title,this.chart.options.font),c=Math.sqrt(f*f+p*p),r=tr(Math.min(Math.asin(pe((d.highest.height+6)/l,-1,1)),Math.asin(pe(a/c,-1,1))-Math.asin(pe(p/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){$t(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$t(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:o}}=this,r=this._isVisible(),l=this.isHorizontal();if(r){const a=Ml(s,e.options.font);if(l?(t.width=this.maxWidth,t.height=bn(o)+a):(t.height=this.maxHeight,t.width=bn(o)+a),n.display&&this.ticks.length){const{first:c,last:d,widest:f,highest:p}=this._getLabelSizes(),g=n.padding*2,m=Ie(this.labelRotation),_=Math.cos(m),y=Math.sin(m);if(l){const v=n.mirror?0:y*f.width+_*p.height;t.height=Math.min(this.maxHeight,t.height+v+g)}else{const v=n.mirror?0:_*f.width+y*p.height;t.width=Math.min(this.maxWidth,t.width+v+g)}this._calculatePadding(c,d,y,_)}}this._handleMargins(),l?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,s){const{ticks:{align:o,padding:r},position:l}=this.options,a=this.labelRotation!==0,c=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,g=0;a?c?(p=s*t.width,g=n*e.height):(p=n*t.height,g=s*e.width):o==="start"?g=e.width:o==="end"?p=t.width:o!=="inner"&&(p=t.width/2,g=e.width/2),this.paddingLeft=Math.max((p-d+r)*this.width/(this.width-d),0),this.paddingRight=Math.max((g-f+r)*this.width/(this.width-f),0)}else{let d=e.height/2,f=t.height/2;o==="start"?(d=0,f=t.height):o==="end"&&(d=e.height,f=0),this.paddingTop=d+r,this.paddingBottom=f+r}}_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(){$t(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,n;for(e=0,n=t.length;e<n;e++)Rt(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=kl(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length)}return t}_computeLabelSizes(t,e){const{ctx:n,_longestTextCache:s}=this,o=[],r=[];let l=0,a=0,c,d,f,p,g,m,_,y,v,w,M;for(c=0;c<e;++c){if(p=t[c].label,g=this._resolveTickFontOptions(c),n.font=m=g.string,_=s[m]=s[m]||{data:{},gc:[]},y=g.lineHeight,v=w=0,!Rt(p)&&!Yt(p))v=Fs(n,_.data,_.gc,v,p),w=y;else if(Yt(p))for(d=0,f=p.length;d<f;++d)M=p[d],!Rt(M)&&!Yt(M)&&(v=Fs(n,_.data,_.gc,v,M),w+=y);o.push(v),r.push(w),l=Math.max(v,l),a=Math.max(w,a)}Xf(s,e);const k=o.indexOf(l),S=r.indexOf(a),L=C=>({width:o[C]||0,height:r[C]||0});return{first:L(0),last:L(e-1),widest:L(k),highest:L(S),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Vu(this._alignToPixels?Li(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const n=e[t];return n.$context||(n.$context=Kf(this.getContext(),t,n))}return this.$context||(this.$context=qf(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Ie(this.labelRotation),n=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,l=o?o.widest.width+r:0,a=o?o.highest.height+r:0;return this.isHorizontal()?a*n>l*s?l/n:a/s:a*s<l*n?a/n:l/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:o,position:r}=s,l=o.offset,a=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=bn(o),p=[],g=o.setContext(this.getContext()),m=g.drawBorder?g.borderWidth:0,_=m/2,y=function(F){return Li(n,F,m)};let v,w,M,k,S,L,C,T,E,O,N,V;if(r==="top")v=y(this.bottom),L=this.bottom-f,T=v-_,O=y(t.top)+_,V=t.bottom;else if(r==="bottom")v=y(this.top),O=t.top,V=y(t.bottom)-_,L=v+_,T=this.top+f;else if(r==="left")v=y(this.right),S=this.right-f,C=v-_,E=y(t.left)+_,N=t.right;else if(r==="right")v=y(this.left),E=t.left,N=y(t.right)-_,S=v+_,C=this.left+f;else if(e==="x"){if(r==="center")v=y((t.top+t.bottom)/2+.5);else if(At(r)){const F=Object.keys(r)[0],H=r[F];v=y(this.chart.scales[F].getPixelForValue(H))}O=t.top,V=t.bottom,L=v+_,T=L+f}else if(e==="y"){if(r==="center")v=y((t.left+t.right)/2);else if(At(r)){const F=Object.keys(r)[0],H=r[F];v=y(this.chart.scales[F].getPixelForValue(H))}S=v-_,C=S-f,E=t.left,N=t.right}const R=xt(s.ticks.maxTicksLimit,d),B=Math.max(1,Math.ceil(d/R));for(w=0;w<d;w+=B){const F=o.setContext(this.getContext(w)),H=F.lineWidth,P=F.color,W=F.borderDash||[],$=F.borderDashOffset,D=F.tickWidth,A=F.tickColor,Y=F.tickBorderDash||[],X=F.tickBorderDashOffset;M=Uf(this,w,l),M!==void 0&&(k=Li(n,M,H),a?S=C=E=N=k:L=T=O=V=k,p.push({tx1:S,ty1:L,tx2:C,ty2:T,x1:E,y1:O,x2:N,y2:V,width:H,color:P,borderDash:W,borderDashOffset:$,tickWidth:D,tickColor:A,tickBorderDash:Y,tickBorderDashOffset:X}))}return this._ticksLength=d,this._borderValue=v,p}_computeLabelItems(t){const e=this.axis,n=this.options,{position:s,ticks:o}=n,r=this.isHorizontal(),l=this.ticks,{align:a,crossAlign:c,padding:d,mirror:f}=o,p=bn(n.grid),g=p+d,m=f?-d:g,_=-Ie(this.labelRotation),y=[];let v,w,M,k,S,L,C,T,E,O,N,V,R="middle";if(s==="top")L=this.bottom-m,C=this._getXAxisLabelAlignment();else if(s==="bottom")L=this.top+m,C=this._getXAxisLabelAlignment();else if(s==="left"){const F=this._getYAxisLabelAlignment(p);C=F.textAlign,S=F.x}else if(s==="right"){const F=this._getYAxisLabelAlignment(p);C=F.textAlign,S=F.x}else if(e==="x"){if(s==="center")L=(t.top+t.bottom)/2+g;else if(At(s)){const F=Object.keys(s)[0],H=s[F];L=this.chart.scales[F].getPixelForValue(H)+g}C=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")S=(t.left+t.right)/2-g;else if(At(s)){const F=Object.keys(s)[0],H=s[F];S=this.chart.scales[F].getPixelForValue(H)}C=this._getYAxisLabelAlignment(p).textAlign}e==="y"&&(a==="start"?R="top":a==="end"&&(R="bottom"));const B=this._getLabelSizes();for(v=0,w=l.length;v<w;++v){M=l[v],k=M.label;const F=o.setContext(this.getContext(v));T=this.getPixelForTick(v)+o.labelOffset,E=this._resolveTickFontOptions(v),O=E.lineHeight,N=Yt(k)?k.length:1;const H=N/2,P=F.color,W=F.textStrokeColor,$=F.textStrokeWidth;let D=C;r?(S=T,C==="inner"&&(v===w-1?D=this.options.reverse?"left":"right":v===0?D=this.options.reverse?"right":"left":D="center"),s==="top"?c==="near"||_!==0?V=-N*O+O/2:c==="center"?V=-B.highest.height/2-H*O+O:V=-B.highest.height+O/2:c==="near"||_!==0?V=O/2:c==="center"?V=B.highest.height/2-H*O:V=B.highest.height-N*O,f&&(V*=-1)):(L=T,V=(1-N)*O/2);let A;if(F.showLabelBackdrop){const Y=xe(F.backdropPadding),X=B.heights[v],K=B.widths[v];let Z=L+V-Y.top,J=S-Y.left;switch(R){case"middle":Z-=X/2;break;case"bottom":Z-=X;break}switch(C){case"center":J-=K/2;break;case"right":J-=K;break}A={left:J,top:Z,width:K+Y.width,height:X+Y.height,color:F.backdropColor}}y.push({rotation:_,label:k,font:E,color:P,strokeColor:W,strokeWidth:$,textOffset:V,textAlign:D,textBaseline:R,translation:[S,L],backdrop:A})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ie(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),l=t+o,a=r.widest.width;let c,d;return e==="left"?s?(d=this.right+o,n==="near"?c="left":n==="center"?(c="center",d+=a/2):(c="right",d+=a)):(d=this.right-l,n==="near"?c="right":n==="center"?(c="center",d-=a/2):(c="left",d=this.left)):e==="right"?s?(d=this.left+o,n==="near"?c="right":n==="center"?(c="center",d-=a/2):(c="left",d-=a)):(d=this.left+l,n==="near"?c="left":n==="center"?(c="center",d+=a/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:s,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const l=(a,c,d)=>{!d.width||!d.color||(n.save(),n.lineWidth=d.width,n.strokeStyle=d.color,n.setLineDash(d.borderDash||[]),n.lineDashOffset=d.borderDashOffset,n.beginPath(),n.moveTo(a.x,a.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(o=0,r=s.length;o<r;++o){const a=s[o];e.drawOnChartArea&&l({x:a.x1,y:a.y1},{x:a.x2,y:a.y2},a),e.drawTicks&&l({x:a.tx1,y:a.ty1},{x:a.tx2,y:a.ty2},{color:a.tickColor,width:a.tickWidth,borderDash:a.tickBorderDash,borderDashOffset:a.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{grid:n}}=this,s=n.setContext(this.getContext()),o=n.drawBorder?s.borderWidth:0;if(!o)return;const r=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let a,c,d,f;this.isHorizontal()?(a=Li(t,this.left,o)-o/2,c=Li(t,this.right,r)+r/2,d=f=l):(d=Li(t,this.top,o)-o/2,f=Li(t,this.bottom,r)+r/2,a=c=l),e.save(),e.lineWidth=s.borderWidth,e.strokeStyle=s.borderColor,e.beginPath(),e.moveTo(a,d),e.lineTo(c,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const n=this.ctx,s=this._computeLabelArea();s&&js(n,s);const o=this._labelItems||(this._labelItems=this._computeLabelItems(t));let r,l;for(r=0,l=o.length;r<l;++r){const a=o[r],c=a.font,d=a.label;a.backdrop&&(n.fillStyle=a.backdrop.color,n.fillRect(a.backdrop.left,a.backdrop.top,a.backdrop.width,a.backdrop.height));let f=a.textOffset;Bi(n,d,0,f,c,a)}s&&Hs(n)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:s}}=this;if(!n.display)return;const o=ce(n.font),r=xe(n.padding),l=n.align;let a=o.lineHeight/2;e==="bottom"||e==="center"||At(e)?(a+=r.bottom,Yt(n.text)&&(a+=o.lineHeight*(n.text.length-1))):a+=r.top;const{titleX:c,titleY:d,maxWidth:f,rotation:p}=Qf(this,a,e,l);Bi(t,n.text,0,0,o,{color:n.color,maxWidth:f,rotation:p,textAlign:Gf(l,e,s),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,n=xt(t.grid&&t.grid.z,-1);return!this._isVisible()||this.draw!==zi.prototype.draw?[{z:e,draw:s=>{this.draw(s)}}]:[{z:n,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:n+1,draw:()=>{this.drawBorder()}},{z:e,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let o,r;for(o=0,r=e.length;o<r;++o){const l=e[o];l[n]===this.id&&(!t||l.type===t)&&s.push(l)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return ce(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class bs{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let n;th(e)&&(n=this.register(e));const s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,Zf(t,r,n),this.override&&Pt.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,s=this.scope;n in e&&delete e[n],s&&n in Pt[s]&&(delete Pt[s][n],this.override&&delete Ii[n])}}function Zf(i,t,e){const n=En(Object.create(null),[e?Pt.get(e):{},Pt.get(t),i.defaults]);Pt.set(t,n),i.defaultRoutes&&Jf(t,i.defaultRoutes),i.descriptors&&Pt.describe(t,i.descriptors)}function Jf(i,t){Object.keys(t).forEach(e=>{const n=e.split("."),s=n.pop(),o=[i].concat(n).join("."),r=t[e].split("."),l=r.pop(),a=r.join(".");Pt.route(o,s,a,l)})}function th(i){return"id"in i&&"defaults"in i}class eh{constructor(){this.controllers=new bs(Ve,"datasets",!0),this.elements=new bs($e,"elements"),this.plugins=new bs(Object,"plugins"),this.scales=new bs(zi,"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,e,n){[...e].forEach(s=>{const o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):Bt(s,r=>{const l=n||this._getRegistryForType(r);this._exec(t,l,r)})})}_exec(t,e,n){const s=Jo(t);$t(n["before"+s],[],n),e[t](n),$t(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}}var ii=new eh;class Ks extends Ve{update(t){const e=this._cachedMeta,{data:n=[]}=e,s=this.chart._animationsDisabled;let{start:o,count:r}=lc(e,n,s);if(this._drawStart=o,this._drawCount=r,ac(e)&&(o=0,r=n.length),this.options.showLine){const{dataset:l,_dataset:a}=e;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!a._decimated,l.points=n;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(l,void 0,{animated:!s,options:c},t)}this.updateElements(n,o,r,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=ii.getElement("line")),super.addElements()}updateElements(t,e,n,s){const o=s==="reset",{iScale:r,vScale:l,_stacked:a,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(e,s),f=this.getSharedOptions(d),p=this.includeOptions(s,f),g=r.axis,m=l.axis,{spanGaps:_,segment:y}=this.options,v=sn(_)?_:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||s==="none";let M=e>0&&this.getParsed(e-1);for(let k=e;k<e+n;++k){const S=t[k],L=this.getParsed(k),C=w?S:{},T=Rt(L[m]),E=C[g]=r.getPixelForValue(L[g],k),O=C[m]=o||T?l.getBasePixel():l.getPixelForValue(a?this.applyStack(l,L,a):L[m],k);C.skip=isNaN(E)||isNaN(O)||T,C.stop=k>0&&Math.abs(L[g]-M[g])>v,y&&(C.parsed=L,C.raw=c.data[k]),p&&(C.options=f||this.resolveDataElementOptions(k,S.active?"active":s)),w||this.updateElement(S,k,C,s),M=L}this.updateSharedOptions(f,s,d)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let l=0;for(let a=e.length-1;a>=0;--a)l=Math.max(l,e[a].size(this.resolveDataElementOptions(a))/2);return l>0&&l}const n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!e.length)return s;const o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,r)/2}}Ks.id="scatter";Ks.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Ks.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(i){return"("+i.label+", "+i.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var ih=Object.freeze({__proto__:null,BarController:$s,BubbleController:Ys,DoughnutController:cn,LineController:$n,PolarAreaController:Us,PieController:dr,RadarController:Xs,ScatterController:Ks});function Ti(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Vo{constructor(t){this.options=t||{}}init(t){}formats(){return Ti()}parse(t,e){return Ti()}format(t,e){return Ti()}add(t,e,n){return Ti()}diff(t,e,n){return Ti()}startOf(t,e,n){return Ti()}endOf(t,e){return Ti()}}Vo.override=function(i){Object.assign(Vo.prototype,i)};var nh={_date:Vo};function sh(i,t,e,n){const{controller:s,data:o,_sorted:r}=i,l=s._cachedMeta.iScale;if(l&&t===l.axis&&t!=="r"&&r&&o.length){const a=l._reversePixels?$u:di;if(n){if(s._sharedOptions){const c=o[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){const f=a(o,t,e-d),p=a(o,t,e+d);return{lo:f.lo,hi:p.hi}}}}else return a(o,t,e)}return{lo:0,hi:o.length-1}}function Yn(i,t,e,n,s){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let l=0,a=o.length;l<a;++l){const{index:c,data:d}=o[l],{lo:f,hi:p}=sh(o[l],t,r,s);for(let g=f;g<=p;++g){const m=d[g];m.skip||n(m,c,g)}}}function oh(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(n,s){const o=t?Math.abs(n.x-s.x):0,r=e?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Po(i,t,e,n,s){const o=[];return!s&&!i.isPointInArea(t)||Yn(i,e,t,function(l,a,c){!s&&!In(l,i.chartArea,0)||l.inRange(t.x,t.y,n)&&o.push({element:l,datasetIndex:a,index:c})},!0),o}function rh(i,t,e,n){let s=[];function o(r,l,a){const{startAngle:c,endAngle:d}=r.getProps(["startAngle","endAngle"],n),{angle:f}=ic(r,{x:t.x,y:t.y});Fn(f,c,d)&&s.push({element:r,datasetIndex:l,index:a})}return Yn(i,e,t,o),s}function lh(i,t,e,n,s,o){let r=[];const l=oh(e);let a=Number.POSITIVE_INFINITY;function c(d,f,p){const g=d.inRange(t.x,t.y,s);if(n&&!g)return;const m=d.getCenterPoint(s);if(!(!!o||i.isPointInArea(m))&&!g)return;const y=l(t,m);y<a?(r=[{element:d,datasetIndex:f,index:p}],a=y):y===a&&r.push({element:d,datasetIndex:f,index:p})}return Yn(i,e,t,c),r}function Co(i,t,e,n,s,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!n?rh(i,t,e,s):lh(i,t,e,n,s,o)}function Sl(i,t,e,n,s){const o=[],r=e==="x"?"inXRange":"inYRange";let l=!1;return Yn(i,e,t,(a,c,d)=>{a[r](t[e],s)&&(o.push({element:a,datasetIndex:c,index:d}),l=l||a.inRange(t.x,t.y,s))}),n&&!l?[]:o}var ah={evaluateInteractionItems:Yn,modes:{index(i,t,e,n){const s=Oi(t,i),o=e.axis||"x",r=e.includeInvisible||!1,l=e.intersect?Po(i,s,o,n,r):Co(i,s,o,!1,n,r),a=[];return l.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const d=l[0].index,f=c.data[d];f&&!f.skip&&a.push({element:f,datasetIndex:c.index,index:d})}),a):[]},dataset(i,t,e,n){const s=Oi(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let l=e.intersect?Po(i,s,o,n,r):Co(i,s,o,!1,n,r);if(l.length>0){const a=l[0].datasetIndex,c=i.getDatasetMeta(a).data;l=[];for(let d=0;d<c.length;++d)l.push({element:c[d],datasetIndex:a,index:d})}return l},point(i,t,e,n){const s=Oi(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return Po(i,s,o,n,r)},nearest(i,t,e,n){const s=Oi(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return Co(i,s,o,e.intersect,n,r)},x(i,t,e,n){const s=Oi(t,i);return Sl(i,s,"x",e.intersect,n)},y(i,t,e,n){const s=Oi(t,i);return Sl(i,s,"y",e.intersect,n)}}};const Oc=["left","top","right","bottom"];function _n(i,t){return i.filter(e=>e.pos===t)}function Dl(i,t){return i.filter(e=>Oc.indexOf(e.pos)===-1&&e.box.axis===t)}function yn(i,t){return i.sort((e,n)=>{const s=t?n:e,o=t?e:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function ch(i){const t=[];let e,n,s,o,r,l;for(e=0,n=(i||[]).length;e<n;++e)s=i[e],{position:o,options:{stack:r,stackWeight:l=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:l});return t}function uh(i){const t={};for(const e of i){const{stack:n,pos:s,stackWeight:o}=e;if(!n||!Oc.includes(s))continue;const r=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function dh(i,t){const e=uh(i),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t;let o,r,l;for(o=0,r=i.length;o<r;++o){l=i[o];const{fullSize:a}=l.box,c=e[l.stack],d=c&&l.stackWeight/c.weight;l.horizontal?(l.width=d?d*n:a&&t.availableWidth,l.height=s):(l.width=n,l.height=d?d*s:a&&t.availableHeight)}return e}function fh(i){const t=ch(i),e=yn(t.filter(c=>c.box.fullSize),!0),n=yn(_n(t,"left"),!0),s=yn(_n(t,"right")),o=yn(_n(t,"top"),!0),r=yn(_n(t,"bottom")),l=Dl(t,"x"),a=Dl(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(a).concat(r).concat(l),chartArea:_n(t,"chartArea"),vertical:n.concat(s).concat(a),horizontal:o.concat(r).concat(l)}}function Al(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function Rc(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function hh(i,t,e,n){const{pos:s,box:o}=e,r=i.maxPadding;if(!At(s)){e.size&&(i[s]-=e.size);const f=n[e.stack]||{size:0,count:1};f.size=Math.max(f.size,e.horizontal?o.height:o.width),e.size=f.size/f.count,i[s]+=e.size}o.getPadding&&Rc(r,o.getPadding());const l=Math.max(0,t.outerWidth-Al(r,i,"left","right")),a=Math.max(0,t.outerHeight-Al(r,i,"top","bottom")),c=l!==i.w,d=a!==i.h;return i.w=l,i.h=a,e.horizontal?{same:c,other:d}:{same:d,other:c}}function ph(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function gh(i,t){const e=t.maxPadding;function n(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return n(i?["left","right"]:["top","bottom"])}function Sn(i,t,e,n){const s=[];let o,r,l,a,c,d;for(o=0,r=i.length,c=0;o<r;++o){l=i[o],a=l.box,a.update(l.width||t.w,l.height||t.h,gh(l.horizontal,t));const{same:f,other:p}=hh(t,e,l,n);c|=f&&s.length,d=d||p,a.fullSize||s.push(l)}return c&&Sn(s,t,e,n)||d}function _s(i,t,e,n,s){i.top=e,i.left=t,i.right=t+n,i.bottom=e+s,i.width=n,i.height=s}function Pl(i,t,e,n){const s=e.padding;let{x:o,y:r}=t;for(const l of i){const a=l.box,c=n[l.stack]||{count:1,placed:0,weight:1},d=l.stackWeight/c.weight||1;if(l.horizontal){const f=t.w*d,p=c.size||a.height;Re(c.start)&&(r=c.start),a.fullSize?_s(a,s.left,r,e.outerWidth-s.right-s.left,p):_s(a,t.left+c.placed,r,f,p),c.start=r,c.placed+=f,r=a.bottom}else{const f=t.h*d,p=c.size||a.width;Re(c.start)&&(o=c.start),a.fullSize?_s(a,o,s.top,p,e.outerHeight-s.bottom-s.top):_s(a,o,t.top+c.placed,p,f),c.start=o,c.placed+=f,o=a.right}}t.x=o,t.y=r}Pt.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var ve={addBox(i,t){i.boxes||(i.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(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,n){if(!i)return;const s=xe(i.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(e-s.height,0),l=fh(i.boxes),a=l.vertical,c=l.horizontal;Bt(i.boxes,_=>{typeof _.beforeLayout=="function"&&_.beforeLayout()});const d=a.reduce((_,y)=>y.box.options&&y.box.options.display===!1?_:_+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/d,hBoxMaxHeight:r/2}),p=Object.assign({},s);Rc(p,xe(n));const g=Object.assign({maxPadding:p,w:o,h:r,x:s.left,y:s.top},s),m=dh(a.concat(c),f);Sn(l.fullSize,g,f,m),Sn(a,g,f,m),Sn(c,g,f,m)&&Sn(a,g,f,m),ph(g),Pl(l.leftAndTop,g,f,m),g.x+=g.w,g.y+=g.h,Pl(l.rightAndBottom,g,f,m),i.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},Bt(l.chartArea,_=>{const y=_.box;Object.assign(y,i.chartArea),y.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Ec{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class mh extends Ec{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ms="$chartjs",bh={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Cl=i=>i===null||i==="";function _h(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[Ms]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Cl(s)){const o=ll(i,"width");o!==void 0&&(i.width=o)}if(Cl(n))if(i.style.height==="")i.height=i.width/(t||2);else{const o=ll(i,"height");o!==void 0&&(i.height=o)}return i}const Fc=Qd?{passive:!0}:!1;function yh(i,t,e){i.addEventListener(t,e,Fc)}function vh(i,t,e){i.canvas.removeEventListener(t,e,Fc)}function xh(i,t){const e=bh[i.type]||i.type,{x:n,y:s}=Oi(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function Bs(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function wh(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const l of o)r=r||Bs(l.addedNodes,n),r=r&&!Bs(l.removedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function kh(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const l of o)r=r||Bs(l.removedNodes,n),r=r&&!Bs(l.addedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const zn=new Map;let Ll=0;function Ic(){const i=window.devicePixelRatio;i!==Ll&&(Ll=i,zn.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Mh(i,t){zn.size||window.addEventListener("resize",Ic),zn.set(i,t)}function Sh(i){zn.delete(i),zn.size||window.removeEventListener("resize",Ic)}function Dh(i,t,e){const n=i.canvas,s=n&&ur(n);if(!s)return;const o=rc((l,a)=>{const c=s.clientWidth;e(l,a),c<s.clientWidth&&e()},window),r=new ResizeObserver(l=>{const a=l[0],c=a.contentRect.width,d=a.contentRect.height;c===0&&d===0||o(c,d)});return r.observe(s),Mh(i,o),r}function Lo(i,t,e){e&&e.disconnect(),t==="resize"&&Sh(i)}function Ah(i,t,e){const n=i.canvas,s=rc(o=>{i.ctx!==null&&e(xh(o,i))},i,o=>{const r=o[0];return[r,r.offsetX,r.offsetY]});return yh(n,t,s),s}class Ph extends Ec{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(_h(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Ms])return!1;const n=e[Ms].initial;["height","width"].forEach(o=>{const r=n[o];Rt(r)?e.removeAttribute(o):e.setAttribute(o,r)});const s=n.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[Ms],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),r={attach:wh,detach:kh,resize:Dh}[e]||Ah;s[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:Lo,detach:Lo,resize:Lo}[e]||vh)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return Gd(t,e,n,s)}isAttached(t){const e=ur(t);return!!(e&&e.isConnected)}}function Ch(i){return!wc()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?mh:Ph}class Lh{constructor(){this._init=[]}notify(t,e,n,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,e,n);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,n,s){s=s||{};for(const o of t){const r=o.plugin,l=r[n],a=[e,s,o.options];if($t(l,a,r)===!1&&s.cancelable)return!1}return!0}invalidate(){Rt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,s=xt(n.options&&n.options.plugins,{}),o=Th(n);return s===!1&&!e?[]:Rh(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,s=(o,r)=>o.filter(l=>!r.some(a=>l.plugin.id===a.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function Th(i){const t={},e=[],n=Object.keys(ii.plugins.items);for(let o=0;o<n.length;o++)e.push(ii.getPlugin(n[o]));const s=i.plugins||[];for(let o=0;o<s.length;o++){const r=s[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function Oh(i,t){return!t&&i===!1?null:i===!0?{}:i}function Rh(i,{plugins:t,localIds:e},n,s){const o=[],r=i.getContext();for(const l of t){const a=l.id,c=Oh(n[a],s);c!==null&&o.push({plugin:l,options:Eh(i.config,{plugin:l,local:e[a]},c,r)})}return o}function Eh(i,{plugin:t,local:e},n,s){const o=i.pluginScopeKeys(t),r=i.getOptionScopes(n,o);return e&&t.defaults&&r.push(t.defaults),i.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $o(i,t){const e=Pt.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Fh(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Ih(i,t){return i===t?"_index_":"_value_"}function Bh(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function Yo(i,t){return i==="x"||i==="y"?i:t.axis||Bh(t.position)||i.charAt(0).toLowerCase()}function zh(i,t){const e=Ii[i.type]||{scales:{}},n=t.scales||{},s=$o(i.type,t),o=Object.create(null),r=Object.create(null);return Object.keys(n).forEach(l=>{const a=n[l];if(!At(a))return console.error(`Invalid scale configuration for scale: ${l}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${l}`);const c=Yo(l,a),d=Ih(c,s),f=e.scales||{};o[c]=o[c]||l,r[l]=An(Object.create(null),[{axis:c},a,f[c],f[d]])}),i.data.datasets.forEach(l=>{const a=l.type||i.type,c=l.indexAxis||$o(a,t),f=(Ii[a]||{}).scales||{};Object.keys(f).forEach(p=>{const g=Fh(p,c),m=l[g+"AxisID"]||o[g]||g;r[m]=r[m]||Object.create(null),An(r[m],[{axis:g},n[m],f[p]])})}),Object.keys(r).forEach(l=>{const a=r[l];An(a,[Pt.scales[a.type],Pt.scale])}),r}function Bc(i){const t=i.options||(i.options={});t.plugins=xt(t.plugins,{}),t.scales=zh(i,t)}function zc(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Nh(i){return i=i||{},i.data=zc(i.data),Bc(i),i}const Tl=new Map,Nc=new Set;function ys(i,t){let e=Tl.get(i);return e||(e=t(),Tl.set(i,e),Nc.add(e)),e}const vn=(i,t,e)=>{const n=Mi(t,e);n!==void 0&&i.add(n)};class Wh{constructor(t){this._config=Nh(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=zc(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(),Bc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ys(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ys(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ys(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return ys(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:o}=this,r=this._cachedScopes(t,n),l=r.get(e);if(l)return l;const a=new Set;e.forEach(d=>{t&&(a.add(t),d.forEach(f=>vn(a,t,f))),d.forEach(f=>vn(a,s,f)),d.forEach(f=>vn(a,Ii[o]||{},f)),d.forEach(f=>vn(a,Pt,f)),d.forEach(f=>vn(a,jo,f))});const c=Array.from(a);return c.length===0&&c.push(Object.create(null)),Nc.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ii[e]||{},Pt.datasets[e]||{},{type:e},Pt,jo]}resolveNamedOptions(t,e,n,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:l}=Ol(this._resolverCache,t,s);let a=r;if(Hh(r,e)){o.$shared=!1,n=Si(n)?n():n;const c=this.createResolver(t,n,l);a=on(r,n,c)}for(const c of e)o[c]=a[c];return o}createResolver(t,e,n=[""],s){const{resolver:o}=Ol(this._resolverCache,t,n);return At(e)?on(o,e,void 0,s):o}}function Ol(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let o=n.get(s);return o||(o={resolver:lr(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},n.set(s,o)),o}const jh=i=>At(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||Si(i[e]),!1);function Hh(i,t){const{isScriptable:e,isIndexable:n}=mc(i);for(const s of t){const o=e(s),r=n(s),l=(r||o)&&i[s];if(o&&(Si(l)||jh(l))||r&&Yt(l))return!0}return!1}var Vh="3.9.1";const $h=["top","bottom","left","right","chartArea"];function Rl(i,t){return i==="top"||i==="bottom"||$h.indexOf(i)===-1&&t==="x"}function El(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function Fl(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),$t(e&&e.onComplete,[i],t)}function Yh(i){const t=i.chart,e=t.options.animation;$t(e&&e.onProgress,[i],t)}function Wc(i){return wc()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const zs={},jc=i=>{const t=Wc(i);return Object.values(zs).filter(e=>e.canvas===t).pop()};function Uh(i,t,e){const n=Object.keys(i);for(const s of n){const o=+s;if(o>=t){const r=i[s];delete i[s],(e>0||o>t)&&(i[o+e]=r)}}}function Xh(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}class ln{constructor(t,e){const n=this.config=new Wh(e),s=Wc(t),o=jc(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||Ch(s)),this.platform.updateConfig(n);const l=this.platform.acquireContext(s,r.aspectRatio),a=l&&l.canvas,c=a&&a.height,d=a&&a.width;if(this.id=Tu(),this.ctx=l,this.canvas=a,this.width=d,this.height=c,this._options=r,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 Lh,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Xu(f=>this.update(f),r.resizeDelay||0),this._dataChanges=[],zs[this.id]=this,!l||!a){console.error("Failed to create chart: can't acquire context from the given item");return}li.listen(this,"complete",Fl),li.listen(this,"progress",Yh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:o}=this;return Rt(t)?e&&o?o:s?n/s: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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return nl(this.canvas,this.ctx),this}stop(){return li.stop(this),this}resize(t,e){li.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),l=n.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,rl(this,l,!0)&&(this.notifyPlugins("resize",{size:r}),$t(n.onResize,[this,r],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Bt(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((r,l)=>(r[l]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const l=e[r],a=Yo(r,l),c=a==="r",d=a==="x";return{options:l,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),Bt(o,r=>{const l=r.options,a=l.id,c=Yo(a,l),d=xt(l.type,r.dtype);(l.position===void 0||Rl(l.position,c)!==Rl(r.dposition))&&(l.position=r.dposition),s[a]=!0;let f=null;if(a in n&&n[a].type===d)f=n[a];else{const p=ii.getScale(d);f=new p({id:a,type:d,ctx:this.ctx,chart:this}),n[f.id]=f}f.init(l,t)}),Bt(s,(r,l)=>{r||delete n[l]}),Bt(n,r=>{ve.configure(this,r,r.options),ve.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>e){for(let s=e;s<n;++s)this._destroyDatasetMeta(s);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(El("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n<s;n++){const o=e[n];let r=this.getDatasetMeta(n);const l=o.type||this.config.type;if(r.type&&r.type!==l&&(this._destroyDatasetMeta(n),r=this.getDatasetMeta(n)),r.type=l,r.indexAxis=o.indexAxis||$o(l,this.options),r.order=o.order||0,r.index=n,r.label=""+o.label,r.visible=this.isDatasetVisible(n),r.controller)r.controller.updateIndex(n),r.controller.linkScales();else{const a=ii.getController(l),{datasetElementType:c,dataElementType:d}=Pt.datasets[l];Object.assign(a.prototype,{dataElementType:ii.getElement(d),datasetElementType:c&&ii.getElement(c)}),r.controller=new a(this,n),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){Bt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,d=this.data.datasets.length;c<d;c++){const{controller:f}=this.getDatasetMeta(c),p=!s&&o.indexOf(f)===-1;f.buildOrUpdateElements(p),r=Math.max(+f.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),s||Bt(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(El("z","_idx"));const{_active:l,_lastEvent:a}=this;a?this._eventHandler(a,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Bt(this.scales,t=>{ve.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!Yr(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:o}of e){const r=n==="_removeElements"?-o:o;Uh(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=o=>new Set(t.filter(r=>r[0]===o).map((r,l)=>l+","+r.splice(1).join(","))),s=n(0);for(let o=1;o<e;o++)if(!Yr(s,n(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ve.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],Bt(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e<n;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,Si(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),s={meta:n,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(li.has(this)?this.attached&&!li.running(this)&&li.start(this):(this.draw(),Fl({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:n,height:s}=this._resizeBeforeDraw;this._resize(n,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let s,o;for(s=0,o=e.length;s<o;++s){const r=e[s];(!t||r.visible)&&n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n=t._clip,s=!n.disabled,o=this.chartArea,r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&js(e,{left:n.left===!1?0:o.left-n.left,right:n.right===!1?this.width:o.right+n.right,top:n.top===!1?0:o.top-n.top,bottom:n.bottom===!1?this.height:o.bottom+n.bottom}),t.controller.draw(),s&&Hs(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return In(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const o=ah.modes[e];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=Pi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Re(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),r.update(o,{visible:n}),this.update(l=>l.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),li.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),nl(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete zs[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,e=this.platform,n=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},s=(o,r,l)=>{o.offsetX=r,o.offsetY=l,this._eventHandler(o)};Bt(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(a,c)=>{e.addEventListener(this,a,c),t[a]=c},s=(a,c)=>{t[a]&&(e.removeEventListener(this,a,c),delete t[a])},o=(a,c)=>{this.canvas&&this.resize(a,c)};let r;const l=()=>{s("attach",l),this.attached=!0,this.resize(),n("resize",o),n("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",l)},e.isAttached(this.canvas)?l():r()}unbindEvents(){Bt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Bt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const s=n?"set":"remove";let o,r,l,a;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),l=0,a=t.length;l<a;++l){r=t[l];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:o,index:r})=>{const l=this.getDatasetMeta(o);if(!l)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:l.data[r],index:r}});!Ts(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}_updateHoverStyles(t,e,n){const s=this.options.hover,o=(a,c)=>a.filter(d=>!c.some(f=>d.datasetIndex===f.datasetIndex&&d.index===f.index)),r=o(e,t),l=n?t:o(t,e);r.length&&this.updateHoverStyle(r,s.mode,!1),l.length&&s.mode&&this.updateHoverStyle(l,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:o}=this,r=e,l=this._getActiveElements(t,s,n,r),a=Bu(t),c=Xh(t,this._lastEvent,n,a);n&&(this._lastEvent=null,$t(o.onHover,[t,l,this],this),a&&$t(o.onClick,[t,l,this],this));const d=!Ts(l,s);return(d||e)&&(this._active=l,this._updateHoverStyles(l,s,e)),this._lastEvent=c,d}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}const Il=()=>Bt(ln.instances,i=>i._plugins.invalidate()),yi=!0;Object.defineProperties(ln,{defaults:{enumerable:yi,value:Pt},instances:{enumerable:yi,value:zs},overrides:{enumerable:yi,value:Ii},registry:{enumerable:yi,value:ii},version:{enumerable:yi,value:Vh},getChart:{enumerable:yi,value:jc},register:{enumerable:yi,value:(...i)=>{ii.add(...i),Il()}},unregister:{enumerable:yi,value:(...i)=>{ii.remove(...i),Il()}}});function Hc(i,t,e){const{startAngle:n,pixelMargin:s,x:o,y:r,outerRadius:l,innerRadius:a}=t;let c=s/l;i.beginPath(),i.arc(o,r,l,n-c,e+c),a>s?(c=s/a,i.arc(o,r,a,e+c,n-c,!0)):i.arc(o,r,s,e+te,n-te),i.closePath(),i.clip()}function qh(i){return rr(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Kh(i,t,e,n){const s=qh(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,n*t/2),l=a=>{const c=(e-Math.min(o,a))*n/2;return pe(a,0,Math.min(o,c))};return{outerStart:l(s.outerStart),outerEnd:l(s.outerEnd),innerStart:pe(s.innerStart,0,r),innerEnd:pe(s.innerEnd,0,r)}}function Qi(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function Uo(i,t,e,n,s,o){const{x:r,y:l,startAngle:a,pixelMargin:c,innerRadius:d}=t,f=Math.max(t.outerRadius+n+e-c,0),p=d>0?d+n+e+c:0;let g=0;const m=s-a;if(n){const F=d>0?d-n:0,H=f>0?f-n:0,P=(F+H)/2,W=P!==0?m*P/(P+n):m;g=(m-W)/2}const _=Math.max(.001,m*f-e/Gt)/f,y=(m-_)/2,v=a+y+g,w=s-y-g,{outerStart:M,outerEnd:k,innerStart:S,innerEnd:L}=Kh(t,p,f,w-v),C=f-M,T=f-k,E=v+M/C,O=w-k/T,N=p+S,V=p+L,R=v+S/N,B=w-L/V;if(i.beginPath(),o){if(i.arc(r,l,f,E,O),k>0){const P=Qi(T,O,r,l);i.arc(P.x,P.y,k,O,w+te)}const F=Qi(V,w,r,l);if(i.lineTo(F.x,F.y),L>0){const P=Qi(V,B,r,l);i.arc(P.x,P.y,L,w+te,B+Math.PI)}if(i.arc(r,l,p,w-L/p,v+S/p,!0),S>0){const P=Qi(N,R,r,l);i.arc(P.x,P.y,S,R+Math.PI,v-te)}const H=Qi(C,v,r,l);if(i.lineTo(H.x,H.y),M>0){const P=Qi(C,E,r,l);i.arc(P.x,P.y,M,v-te,E)}}else{i.moveTo(r,l);const F=Math.cos(E)*f+r,H=Math.sin(E)*f+l;i.lineTo(F,H);const P=Math.cos(O)*f+r,W=Math.sin(O)*f+l;i.lineTo(P,W)}i.closePath()}function Gh(i,t,e,n,s){const{fullCircles:o,startAngle:r,circumference:l}=t;let a=t.endAngle;if(o){Uo(i,t,e,n,r+Nt,s);for(let c=0;c<o;++c)i.fill();isNaN(l)||(a=r+l%Nt,l%Nt===0&&(a+=Nt))}return Uo(i,t,e,n,a,s),i.fill(),a}function Qh(i,t,e){const{x:n,y:s,startAngle:o,pixelMargin:r,fullCircles:l}=t,a=Math.max(t.outerRadius-r,0),c=t.innerRadius+r;let d;for(e&&Hc(i,t,o+Nt),i.beginPath(),i.arc(n,s,c,o+Nt,o,!0),d=0;d<l;++d)i.stroke();for(i.beginPath(),i.arc(n,s,a,o,o+Nt),d=0;d<l;++d)i.stroke()}function Zh(i,t,e,n,s,o){const{options:r}=t,{borderWidth:l,borderJoinStyle:a}=r,c=r.borderAlign==="inner";l&&(c?(i.lineWidth=l*2,i.lineJoin=a||"round"):(i.lineWidth=l,i.lineJoin=a||"bevel"),t.fullCircles&&Qh(i,t,c),c&&Hc(i,t,s),Uo(i,t,e,n,s,o),i.stroke())}class Gs extends $e{constructor(t){super(),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,t&&Object.assign(this,t)}inRange(t,e,n){const s=this.getProps(["x","y"],n),{angle:o,distance:r}=ic(s,{x:t,y:e}),{startAngle:l,endAngle:a,innerRadius:c,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),p=this.options.spacing/2,m=xt(f,a-l)>=Nt||Fn(o,l,a),_=ui(r,c+p,d+p);return m&&_}getCenterPoint(t){const{x:e,y:n,startAngle:s,endAngle:o,innerRadius:r,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:a,spacing:c}=this.options,d=(s+o)/2,f=(r+l+c+a)/2;return{x:e+Math.cos(d)*f,y:n+Math.sin(d)*f}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,s=(e.offset||0)/2,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=n>Nt?Math.floor(n/Nt):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let l=0;if(s){l=s/2;const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*l,Math.sin(c)*l),this.circumference>=Gt&&(l=s)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const a=Gh(t,this,l,o,r);Zh(t,this,l,o,a,r),t.restore()}}Gs.id="arc";Gs.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Gs.defaultRoutes={backgroundColor:"backgroundColor"};function Vc(i,t,e=t){i.lineCap=xt(e.borderCapStyle,t.borderCapStyle),i.setLineDash(xt(e.borderDash,t.borderDash)),i.lineDashOffset=xt(e.borderDashOffset,t.borderDashOffset),i.lineJoin=xt(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=xt(e.borderWidth,t.borderWidth),i.strokeStyle=xt(e.borderColor,t.borderColor)}function Jh(i,t,e){i.lineTo(e.x,e.y)}function tp(i){return i.stepped?vd:i.tension||i.cubicInterpolationMode==="monotone"?xd:Jh}function $c(i,t,e={}){const n=i.length,{start:s=0,end:o=n-1}=e,{start:r,end:l}=t,a=Math.max(s,r),c=Math.min(o,l),d=s<r&&o<r||s>l&&o>l;return{count:n,start:a,loop:t.loop,ilen:c<a&&!d?n+c-a:c-a}}function ep(i,t,e,n){const{points:s,options:o}=t,{count:r,start:l,loop:a,ilen:c}=$c(s,e,n),d=tp(o);let{move:f=!0,reverse:p}=n||{},g,m,_;for(g=0;g<=c;++g)m=s[(l+(p?c-g:g))%r],!m.skip&&(f?(i.moveTo(m.x,m.y),f=!1):d(i,_,m,p,o.stepped),_=m);return a&&(m=s[(l+(p?c:0))%r],d(i,_,m,p,o.stepped)),!!a}function ip(i,t,e,n){const s=t.points,{count:o,start:r,ilen:l}=$c(s,e,n),{move:a=!0,reverse:c}=n||{};let d=0,f=0,p,g,m,_,y,v;const w=k=>(r+(c?l-k:k))%o,M=()=>{_!==y&&(i.lineTo(d,y),i.lineTo(d,_),i.lineTo(d,v))};for(a&&(g=s[w(0)],i.moveTo(g.x,g.y)),p=0;p<=l;++p){if(g=s[w(p)],g.skip)continue;const k=g.x,S=g.y,L=k|0;L===m?(S<_?_=S:S>y&&(y=S),d=(f*d+k)/++f):(M(),i.lineTo(k,S),m=L,f=0,_=y=S),v=S}M()}function Xo(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?ip:ep}function np(i){return i.stepped?Zd:i.tension||i.cubicInterpolationMode==="monotone"?Jd:Ri}function sp(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),Vc(i,t.options),i.stroke(s)}function op(i,t,e,n){const{segments:s,options:o}=t,r=Xo(t);for(const l of s)Vc(i,o,l.style),i.beginPath(),r(i,t,l,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const rp=typeof Path2D=="function";function lp(i,t,e,n){rp&&!t.options.segment?sp(i,t,e,n):op(i,t,e,n)}class hi extends $e{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,e){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;$d(this._points,n,t,s,e),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=lf(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],o=this.points,r=Ac(this,{property:e,start:s,end:s});if(!r.length)return;const l=[],a=np(n);let c,d;for(c=0,d=r.length;c<d;++c){const{start:f,end:p}=r[c],g=o[f],m=o[p];if(g===m){l.push(g);continue}const _=Math.abs((s-g[e])/(m[e]-g[e])),y=a(g,m,_,n.stepped);y[e]=t[e],l.push(y)}return l.length===1?l[0]:l}pathSegment(t,e,n){return Xo(this)(t,this,e,n)}path(t,e,n){const s=this.segments,o=Xo(this);let r=this._loop;e=e||0,n=n||this.points.length-e;for(const l of s)r&=o(t,this,l,{start:e,end:e+n-1});return!!r}draw(t,e,n,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),lp(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}hi.id="line";hi.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};hi.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};hi.descriptors={_scriptable:!0,_indexable:i=>i!=="borderDash"&&i!=="fill"};function Bl(i,t,e,n){const s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o)<s.radius+s.hitRadius}class Un extends $e{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const s=this.options,{x:o,y:r}=this.getProps(["x","y"],n);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Bl(this,t,"x",e)}inYRange(t,e){return Bl(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const n=e&&t.borderWidth||0;return(e+n)*2}draw(t,e){const n=this.options;this.skip||n.radius<.1||!In(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,Ho(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}Un.id="point";Un.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};Un.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function Yc(i,t){const{x:e,y:n,base:s,width:o,height:r}=i.getProps(["x","y","base","width","height"],t);let l,a,c,d,f;return i.horizontal?(f=r/2,l=Math.min(e,s),a=Math.max(e,s),c=n-f,d=n+f):(f=o/2,l=e-f,a=e+f,c=Math.min(n,s),d=Math.max(n,s)),{left:l,top:c,right:a,bottom:d}}function wi(i,t,e,n){return i?0:pe(t,e,n)}function ap(i,t,e){const n=i.options.borderWidth,s=i.borderSkipped,o=gc(n);return{t:wi(s.top,o.top,0,e),r:wi(s.right,o.right,0,t),b:wi(s.bottom,o.bottom,0,e),l:wi(s.left,o.left,0,t)}}function cp(i,t,e){const{enableBorderRadius:n}=i.getProps(["enableBorderRadius"]),s=i.options.borderRadius,o=Ei(s),r=Math.min(t,e),l=i.borderSkipped,a=n||At(s);return{topLeft:wi(!a||l.top||l.left,o.topLeft,0,r),topRight:wi(!a||l.top||l.right,o.topRight,0,r),bottomLeft:wi(!a||l.bottom||l.left,o.bottomLeft,0,r),bottomRight:wi(!a||l.bottom||l.right,o.bottomRight,0,r)}}function up(i){const t=Yc(i),e=t.right-t.left,n=t.bottom-t.top,s=ap(i,e/2,n/2),o=cp(i,e/2,n/2);return{outer:{x:t.left,y:t.top,w:e,h:n,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function To(i,t,e,n){const s=t===null,o=e===null,l=i&&!(s&&o)&&Yc(i,n);return l&&(s||ui(t,l.left,l.right))&&(o||ui(e,l.top,l.bottom))}function dp(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function fp(i,t){i.rect(t.x,t.y,t.w,t.h)}function Oo(i,t,e={}){const n=i.x!==e.x?-t:0,s=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-n,r=(i.y+i.h!==e.y+e.h?t:0)-s;return{x:i.x+n,y:i.y+s,w:i.w+o,h:i.h+r,radius:i.radius}}class Qs extends $e{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:e,options:{borderColor:n,backgroundColor:s}}=this,{inner:o,outer:r}=up(this),l=dp(r.radius)?Bn:fp;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),l(t,Oo(r,e,o)),t.clip(),l(t,Oo(o,-e,r)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),l(t,Oo(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,n){return To(this,t,e,n)}inXRange(t,e){return To(this,t,null,e)}inYRange(t,e){return To(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?n:(n+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}Qs.id="bar";Qs.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};Qs.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var hp=Object.freeze({__proto__:null,ArcElement:Gs,LineElement:hi,PointElement:Un,BarElement:Qs});function pp(i,t,e,n,s){const o=s.samples||n;if(o>=e)return i.slice(t,t+e);const r=[],l=(e-2)/(o-2);let a=0;const c=t+e-1;let d=t,f,p,g,m,_;for(r[a++]=i[d],f=0;f<o-2;f++){let y=0,v=0,w;const M=Math.floor((f+1)*l)+1+t,k=Math.min(Math.floor((f+2)*l)+1,e)+t,S=k-M;for(w=M;w<k;w++)y+=i[w].x,v+=i[w].y;y/=S,v/=S;const L=Math.floor(f*l)+1+t,C=Math.min(Math.floor((f+1)*l)+1,e)+t,{x:T,y:E}=i[d];for(g=m=-1,w=L;w<C;w++)m=.5*Math.abs((T-y)*(i[w].y-E)-(T-i[w].x)*(v-E)),m>g&&(g=m,p=i[w],_=w);r[a++]=p,d=_}return r[a++]=i[c],r}function gp(i,t,e,n){let s=0,o=0,r,l,a,c,d,f,p,g,m,_;const y=[],v=t+e-1,w=i[t].x,k=i[v].x-w;for(r=t;r<t+e;++r){l=i[r],a=(l.x-w)/k*n,c=l.y;const S=a|0;if(S===d)c<m?(m=c,f=r):c>_&&(_=c,p=r),s=(o*s+l.x)/++o;else{const L=r-1;if(!Rt(f)&&!Rt(p)){const C=Math.min(f,p),T=Math.max(f,p);C!==g&&C!==L&&y.push({...i[C],x:s}),T!==g&&T!==L&&y.push({...i[T],x:s})}r>0&&L!==g&&y.push(i[L]),y.push(l),d=S,o=0,m=_=c,f=p=g=r}}return y}function Uc(i){if(i._decimated){const t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{value:t})}}function zl(i){i.data.datasets.forEach(t=>{Uc(t)})}function mp(i,t){const e=t.length;let n=0,s;const{iScale:o}=i,{min:r,max:l,minDefined:a,maxDefined:c}=o.getUserBounds();return a&&(n=pe(di(t,o.axis,r).lo,0,e-1)),c?s=pe(di(t,o.axis,l).hi+1,n,e)-n:s=e-n,{start:n,count:s}}var bp={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){zl(i);return}const n=i.width;i.data.datasets.forEach((s,o)=>{const{_data:r,indexAxis:l}=s,a=i.getDatasetMeta(o),c=r||s.data;if(Mn([l,i.options.indexAxis])==="y"||!a.controller.supportsDecimation)return;const d=i.scales[a.xAxisID];if(d.type!=="linear"&&d.type!=="time"||i.options.parsing)return;let{start:f,count:p}=mp(a,c);const g=e.threshold||4*n;if(p<=g){Uc(s);return}Rt(r)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(_){this._data=_}}));let m;switch(e.algorithm){case"lttb":m=pp(c,f,p,n,e);break;case"min-max":m=gp(c,f,p,n);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=m})},destroy(i){zl(i)}};function _p(i,t,e){const n=i.segments,s=i.points,o=t.points,r=[];for(const l of n){let{start:a,end:c}=l;c=fr(a,c,s);const d=qo(e,s[a],s[c],l.loop);if(!t.segments){r.push({source:l,target:d,start:s[a],end:s[c]});continue}const f=Ac(t,d);for(const p of f){const g=qo(e,o[p.start],o[p.end],p.loop),m=Dc(l,s,g);for(const _ of m)r.push({source:_,target:p,start:{[e]:Nl(d,g,"start",Math.max)},end:{[e]:Nl(d,g,"end",Math.min)}})}}return r}function qo(i,t,e,n){if(n)return;let s=t[i],o=e[i];return i==="angle"&&(s=Ce(s),o=Ce(o)),{property:i,start:s,end:o}}function yp(i,t){const{x:e=null,y:n=null}=i||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:l})=>{l=fr(r,l,s);const a=s[r],c=s[l];n!==null?(o.push({x:a.x,y:n}),o.push({x:c.x,y:n})):e!==null&&(o.push({x:e,y:a.y}),o.push({x:e,y:c.y}))}),o}function fr(i,t,e){for(;t>i;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function Nl(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function Xc(i,t){let e=[],n=!1;return Yt(i)?(n=!0,e=i):e=yp(i,t),e.length?new hi({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function Wl(i){return i&&i.fill!==!1}function vp(i,t,e){let s=i[t].fill;const o=[t];let r;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!se(s))return s;if(r=i[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function xp(i,t,e){const n=Sp(i);if(At(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return se(s)&&Math.floor(s)===s?wp(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function wp(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function kp(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:At(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Mp(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:At(i)?n=i.value:n=t.getBaseValue(),n}function Sp(i){const t=i.options,e=t.fill;let n=xt(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function Dp(i){const{scale:t,index:e,line:n}=i,s=[],o=n.segments,r=n.points,l=Ap(t,e);l.push(Xc({x:null,y:t.bottom},n));for(let a=0;a<o.length;a++){const c=o[a];for(let d=c.start;d<=c.end;d++)Pp(s,r[d],l)}return new hi({points:s,options:{}})}function Ap(i,t){const e=[],n=i.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){const o=n[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Pp(i,t,e){const n=[];for(let s=0;s<e.length;s++){const o=e[s],{first:r,last:l,point:a}=Cp(o,t,"x");if(!(!a||r&&l)){if(r)n.unshift(a);else if(i.push(a),!l)break}}i.push(...n)}function Cp(i,t,e){const n=i.interpolate(t,e);if(!n)return{};const s=n[e],o=i.segments,r=i.points;let l=!1,a=!1;for(let c=0;c<o.length;c++){const d=o[c],f=r[d.start][e],p=r[d.end][e];if(ui(s,f,p)){l=s===f,a=s===p;break}}return{first:l,last:a,point:n}}class qc{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:s,y:o,radius:r}=this;return e=e||{start:0,end:Nt},t.arc(s,o,r,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o}}}function Lp(i){const{chart:t,fill:e,line:n}=i;if(se(e))return Tp(t,e);if(e==="stack")return Dp(i);if(e==="shape")return!0;const s=Op(i);return s instanceof qc?s:Xc(s,n)}function Tp(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function Op(i){return(i.scale||{}).getPointPositionForValue?Ep(i):Rp(i)}function Rp(i){const{scale:t={},fill:e}=i,n=kp(e,t);if(se(n)){const s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function Ep(i){const{scale:t,fill:e}=i,n=t.options,s=t.getLabels().length,o=n.reverse?t.max:t.min,r=Mp(e,t,o),l=[];if(n.grid.circular){const a=t.getPointPositionForValue(0,o);return new qc({x:a.x,y:a.y,radius:t.getDistanceFromCenterForValue(r)})}for(let a=0;a<s;++a)l.push(t.getPointPositionForValue(a,r));return l}function Ro(i,t,e){const n=Lp(t),{line:s,scale:o,axis:r}=t,l=s.options,a=l.fill,c=l.backgroundColor,{above:d=c,below:f=c}=a||{};n&&s.points.length&&(js(i,e),Fp(i,{line:s,target:n,above:d,below:f,area:e,scale:o,axis:r}),Hs(i))}function Fp(i,t){const{line:e,target:n,above:s,below:o,area:r,scale:l}=t,a=e._loop?"angle":t.axis;i.save(),a==="x"&&o!==s&&(jl(i,n,r.top),Hl(i,{line:e,target:n,color:s,scale:l,property:a}),i.restore(),i.save(),jl(i,n,r.bottom)),Hl(i,{line:e,target:n,color:o,scale:l,property:a}),i.restore()}function jl(i,t,e){const{segments:n,points:s}=t;let o=!0,r=!1;i.beginPath();for(const l of n){const{start:a,end:c}=l,d=s[a],f=s[fr(a,c,s)];o?(i.moveTo(d.x,d.y),o=!1):(i.lineTo(d.x,e),i.lineTo(d.x,d.y)),r=!!t.pathSegment(i,l,{move:r}),r?i.closePath():i.lineTo(f.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function Hl(i,t){const{line:e,target:n,property:s,color:o,scale:r}=t,l=_p(e,n,s);for(const{source:a,target:c,start:d,end:f}of l){const{style:{backgroundColor:p=o}={}}=a,g=n!==!0;i.save(),i.fillStyle=p,Ip(i,r,g&&qo(s,d,f)),i.beginPath();const m=!!e.pathSegment(i,a);let _;if(g){m?i.closePath():Vl(i,n,f,s);const y=!!n.pathSegment(i,c,{move:m,reverse:!0});_=m&&y,_||Vl(i,n,d,s)}i.closePath(),i.fill(_?"evenodd":"nonzero"),i.restore()}}function Ip(i,t,e){const{top:n,bottom:s}=t.chart.chartArea,{property:o,start:r,end:l}=e||{};o==="x"&&(i.beginPath(),i.rect(r,n,l-r,s-n),i.clip())}function Vl(i,t,e,n){const s=t.interpolate(e,n);s&&i.lineTo(s.x,s.y)}var Bp={id:"filler",afterDatasetsUpdate(i,t,e){const n=(i.data.datasets||[]).length,s=[];let o,r,l,a;for(r=0;r<n;++r)o=i.getDatasetMeta(r),l=o.dataset,a=null,l&&l.options&&l instanceof hi&&(a={visible:i.isDatasetVisible(r),index:r,fill:xp(l,r,n),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:l}),o.$filler=a,s.push(a);for(r=0;r<n;++r)a=s[r],!(!a||a.fill===!1)&&(a.fill=vp(s,r,e.propagate))},beforeDraw(i,t,e){const n=e.drawTime==="beforeDraw",s=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let r=s.length-1;r>=0;--r){const l=s[r].$filler;l&&(l.line.updateControlPoints(o,l.axis),n&&l.fill&&Ro(i.ctx,l,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const o=n[s].$filler;Wl(o)&&Ro(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const n=t.meta.$filler;!Wl(n)||e.drawTime!=="beforeDatasetDraw"||Ro(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const $l=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},zp=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Yl extends $e{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,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,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 e=$t(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,s=ce(n.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:l,itemHeight:a}=$l(n,o);let c,d;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(r,o,l,a)+10):(d=this.maxHeight,c=this._fitCols(r,o,l,a)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:o,maxWidth:r,options:{labels:{padding:l}}}=this,a=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+l;let f=t;o.textAlign="left",o.textBaseline="middle";let p=-1,g=-d;return this.legendItems.forEach((m,_)=>{const y=n+e/2+o.measureText(m.text).width;(_===0||c[c.length-1]+y+2*l>r)&&(f+=d,c[c.length-(_>0?0:1)]=0,g+=d,p++),a[_]={left:0,top:g,row:p,width:y,height:s},c[c.length-1]+=y+l}),f}_fitCols(t,e,n,s){const{ctx:o,maxHeight:r,options:{labels:{padding:l}}}=this,a=this.legendHitBoxes=[],c=this.columnSizes=[],d=r-t;let f=l,p=0,g=0,m=0,_=0;return this.legendItems.forEach((y,v)=>{const w=n+e/2+o.measureText(y.text).width;v>0&&g+s+2*l>d&&(f+=p+l,c.push({width:p,height:g}),m+=p+l,_++,p=g=0),a[v]={left:m,top:g,col:_,width:w,height:s},p=Math.max(p,w),g+=s+l}),f+=p,c.push({width:p,height:g}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,r=nn(o,this.left,this.width);if(this.isHorizontal()){let l=0,a=ye(n,this.left+s,this.right-this.lineWidths[l]);for(const c of e)l!==c.row&&(l=c.row,a=ye(n,this.left+s,this.right-this.lineWidths[l])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(a),c.width),a+=c.width+s}else{let l=0,a=ye(n,this.top+t+s,this.bottom-this.columnSizes[l].height);for(const c of e)c.col!==l&&(l=c.col,a=ye(n,this.top+t+s,this.bottom-this.columnSizes[l].height)),c.top=a,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),a+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;js(t,this),this._draw(),Hs(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:r}=t,l=Pt.color,a=nn(t.rtl,this.left,this.width),c=ce(r.font),{color:d,padding:f}=r,p=c.size,g=p/2;let m;this.drawTitle(),s.textAlign=a.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:_,boxHeight:y,itemHeight:v}=$l(r,p),w=function(C,T,E){if(isNaN(_)||_<=0||isNaN(y)||y<0)return;s.save();const O=xt(E.lineWidth,1);if(s.fillStyle=xt(E.fillStyle,l),s.lineCap=xt(E.lineCap,"butt"),s.lineDashOffset=xt(E.lineDashOffset,0),s.lineJoin=xt(E.lineJoin,"miter"),s.lineWidth=O,s.strokeStyle=xt(E.strokeStyle,l),s.setLineDash(xt(E.lineDash,[])),r.usePointStyle){const N={radius:y*Math.SQRT2/2,pointStyle:E.pointStyle,rotation:E.rotation,borderWidth:O},V=a.xPlus(C,_/2),R=T+g;pc(s,N,V,R,r.pointStyleWidth&&_)}else{const N=T+Math.max((p-y)/2,0),V=a.leftForLtr(C,_),R=Ei(E.borderRadius);s.beginPath(),Object.values(R).some(B=>B!==0)?Bn(s,{x:V,y:N,w:_,h:y,radius:R}):s.rect(V,N,_,y),s.fill(),O!==0&&s.stroke()}s.restore()},M=function(C,T,E){Bi(s,E.text,C,T+v/2,c,{strikethrough:E.hidden,textAlign:a.textAlign(E.textAlign)})},k=this.isHorizontal(),S=this._computeTitleHeight();k?m={x:ye(o,this.left+f,this.right-n[0]),y:this.top+f+S,line:0}:m={x:this.left+f,y:ye(o,this.top+S+f,this.bottom-e[0].height),line:0},kc(this.ctx,t.textDirection);const L=v+f;this.legendItems.forEach((C,T)=>{s.strokeStyle=C.fontColor||d,s.fillStyle=C.fontColor||d;const E=s.measureText(C.text).width,O=a.textAlign(C.textAlign||(C.textAlign=r.textAlign)),N=_+g+E;let V=m.x,R=m.y;a.setWidth(this.width),k?T>0&&V+N+f>this.right&&(R=m.y+=L,m.line++,V=m.x=ye(o,this.left+f,this.right-n[m.line])):T>0&&R+L>this.bottom&&(V=m.x=V+e[m.line].width+f,m.line++,R=m.y=ye(o,this.top+S+f,this.bottom-e[m.line].height));const B=a.x(V);w(B,R,C),V=qu(O,V+_+g,k?V+N:this.right,t.rtl),M(a.x(V),R,C),k?m.x+=N+f:m.y+=L}),Mc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=ce(e.font),s=xe(e.padding);if(!e.display)return;const o=nn(t.rtl,this.left,this.width),r=this.ctx,l=e.position,a=n.size/2,c=s.top+a;let d,f=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),d=this.top+c,f=ye(t.align,f,this.right-p);else{const m=this.columnSizes.reduce((_,y)=>Math.max(_,y.height),0);d=c+ye(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const g=ye(l,f,f+p);r.textAlign=o.textAlign(ir(l)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=n.string,Bi(r,e.text,g,d,n)}_computeTitleHeight(){const t=this.options.title,e=ce(t.font),n=xe(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(ui(t,this.left,this.right)&&ui(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],ui(t,s.left,s.left+s.width)&&ui(e,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){const e=this.options;if(!Np(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=zp(s,n);s&&!o&&$t(e.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&$t(e.onHover,[t,n,this],this)}else n&&$t(e.onClick,[t,n,this],this)}}function Np(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Wp={id:"legend",_element:Yl,start(i,t,e){const n=i.legend=new Yl({ctx:i.ctx,options:e,chart:i});ve.configure(i,n,e),ve.addBox(i,n)},stop(i){ve.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;ve.configure(i,n,e),n.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:s,color:o}}=i.legend.options;return i._getSortedDatasetMetas().map(r=>{const l=r.controller.getStyle(e?0:void 0),a=xe(l.borderWidth);return{text:t[r.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!r.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(a.width+a.height)/4,strokeStyle:l.borderColor,pointStyle:n||l.pointStyle,rotation:l.rotation,textAlign:s||l.textAlign,borderRadius:0,datasetIndex:r.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class hr extends $e{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,e){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=Yt(n.text)?n.text.length:1;this._padding=xe(n.padding);const o=s*ce(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:n,bottom:s,right:o,options:r}=this,l=r.align;let a=0,c,d,f;return this.isHorizontal()?(d=ye(l,n,o),f=e+t,c=o-n):(r.position==="left"?(d=n+t,f=ye(l,s,e),a=Gt*-.5):(d=o-t,f=ye(l,e,s),a=Gt*.5),c=s-e),{titleX:d,titleY:f,maxWidth:c,rotation:a}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=ce(e.font),o=n.lineHeight/2+this._padding.top,{titleX:r,titleY:l,maxWidth:a,rotation:c}=this._drawArgs(o);Bi(t,e.text,0,0,n,{color:e.color,maxWidth:a,rotation:c,textAlign:ir(e.align),textBaseline:"middle",translation:[r,l]})}}function jp(i,t){const e=new hr({ctx:i.ctx,options:t,chart:i});ve.configure(i,e,t),ve.addBox(i,e),i.titleBlock=e}var Kc={id:"title",_element:hr,start(i,t,e){jp(i,e)},stop(i){const t=i.titleBlock;ve.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;ve.configure(i,n,e),n.options=e},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 vs=new WeakMap;var Hp={id:"subtitle",start(i,t,e){const n=new hr({ctx:i.ctx,options:e,chart:i});ve.configure(i,n,e),ve.addBox(i,n),vs.set(i,n)},stop(i){ve.removeBox(i,vs.get(i)),vs.delete(i)},beforeUpdate(i,t,e){const n=vs.get(i);ve.configure(i,n,e),n.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Tn={average(i){if(!i.length)return!1;let t,e,n=0,s=0,o=0;for(t=0,e=i.length;t<e;++t){const r=i[t].element;if(r&&r.hasValue()){const l=r.tooltipPosition();n+=l.x,s+=l.y,++o}}return{x:n/o,y:s/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,r,l;for(o=0,r=i.length;o<r;++o){const a=i[o].element;if(a&&a.hasValue()){const c=a.getCenterPoint(),d=No(t,c);d<s&&(s=d,l=a)}}if(l){const a=l.tooltipPosition();e=a.x,n=a.y}return{x:e,y:n}}};function Qe(i,t){return t&&(Yt(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function ai(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
`)>-1?i.split(`
|
|
`):i}function Vp(i,t){const{element:e,datasetIndex:n,index:s}=t,o=i.getDatasetMeta(n).controller,{label:r,value:l}=o.getLabelAndValue(s);return{chart:i,label:r,parsed:o.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:l,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function Ul(i,t){const e=i.chart.ctx,{body:n,footer:s,title:o}=i,{boxWidth:r,boxHeight:l}=t,a=ce(t.bodyFont),c=ce(t.titleFont),d=ce(t.footerFont),f=o.length,p=s.length,g=n.length,m=xe(t.padding);let _=m.height,y=0,v=n.reduce((k,S)=>k+S.before.length+S.lines.length+S.after.length,0);if(v+=i.beforeBody.length+i.afterBody.length,f&&(_+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),v){const k=t.displayColors?Math.max(l,a.lineHeight):a.lineHeight;_+=g*k+(v-g)*a.lineHeight+(v-1)*t.bodySpacing}p&&(_+=t.footerMarginTop+p*d.lineHeight+(p-1)*t.footerSpacing);let w=0;const M=function(k){y=Math.max(y,e.measureText(k).width+w)};return e.save(),e.font=c.string,Bt(i.title,M),e.font=a.string,Bt(i.beforeBody.concat(i.afterBody),M),w=t.displayColors?r+2+t.boxPadding:0,Bt(n,k=>{Bt(k.before,M),Bt(k.lines,M),Bt(k.after,M)}),w=0,e.font=d.string,Bt(i.footer,M),e.restore(),y+=m.width,{width:y,height:_}}function $p(i,t){const{y:e,height:n}=t;return e<n/2?"top":e>i.height-n/2?"bottom":"center"}function Yp(i,t,e,n){const{x:s,width:o}=n,r=e.caretSize+e.caretPadding;if(i==="left"&&s+o+r>t.width||i==="right"&&s-o-r<0)return!0}function Up(i,t,e,n){const{x:s,width:o}=e,{width:r,chartArea:{left:l,right:a}}=i;let c="center";return n==="center"?c=s<=(l+a)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),Yp(c,i,t,e)&&(c="center"),c}function Xl(i,t,e){const n=e.yAlign||t.yAlign||$p(i,e);return{xAlign:e.xAlign||t.xAlign||Up(i,t,e,n),yAlign:n}}function Xp(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function qp(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function ql(i,t,e,n){const{caretSize:s,caretPadding:o,cornerRadius:r}=i,{xAlign:l,yAlign:a}=e,c=s+o,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:g}=Ei(r);let m=Xp(t,l);const _=qp(t,a,c);return a==="center"?l==="left"?m+=c:l==="right"&&(m-=c):l==="left"?m-=Math.max(d,p)+s:l==="right"&&(m+=Math.max(f,g)+s),{x:pe(m,0,n.width-t.width),y:pe(_,0,n.height-t.height)}}function xs(i,t,e){const n=xe(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function Kl(i){return Qe([],ai(i))}function Kp(i,t,e){return Pi(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Gl(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}class Ko extends $e{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||t._chart,this._chart=this.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 e=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,o=new Pc(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Kp(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=n.beforeTitle.apply(this,[t]),o=n.title.apply(this,[t]),r=n.afterTitle.apply(this,[t]);let l=[];return l=Qe(l,ai(s)),l=Qe(l,ai(o)),l=Qe(l,ai(r)),l}getBeforeBody(t,e){return Kl(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:n}=e,s=[];return Bt(t,o=>{const r={before:[],lines:[],after:[]},l=Gl(n,o);Qe(r.before,ai(l.beforeLabel.call(this,o))),Qe(r.lines,l.label.call(this,o)),Qe(r.after,ai(l.afterLabel.call(this,o))),s.push(r)}),s}getAfterBody(t,e){return Kl(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:n}=e,s=n.beforeFooter.apply(this,[t]),o=n.footer.apply(this,[t]),r=n.afterFooter.apply(this,[t]);let l=[];return l=Qe(l,ai(s)),l=Qe(l,ai(o)),l=Qe(l,ai(r)),l}_createItems(t){const e=this._active,n=this.chart.data,s=[],o=[],r=[];let l=[],a,c;for(a=0,c=e.length;a<c;++a)l.push(Vp(this.chart,e[a]));return t.filter&&(l=l.filter((d,f,p)=>t.filter(d,f,p,n))),t.itemSort&&(l=l.sort((d,f)=>t.itemSort(d,f,n))),Bt(l,d=>{const f=Gl(t.callbacks,d);s.push(f.labelColor.call(this,d)),o.push(f.labelPointStyle.call(this,d)),r.push(f.labelTextColor.call(this,d))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=l,l}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const l=Tn[n.position].call(this,s,this._eventPosition);r=this._createItems(n),this.title=this.getTitle(r,n),this.beforeBody=this.getBeforeBody(r,n),this.body=this.getBody(r,n),this.afterBody=this.getAfterBody(r,n),this.footer=this.getFooter(r,n);const a=this._size=Ul(this,n),c=Object.assign({},l,a),d=Xl(this.chart,n,c),f=ql(n,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:f.x,y:f.y,width:a.width,height:a.height,caretX:l.x,caretY:l.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const o=this.getCaretPosition(t,n,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:l}=n,{topLeft:a,topRight:c,bottomLeft:d,bottomRight:f}=Ei(l),{x:p,y:g}=t,{width:m,height:_}=e;let y,v,w,M,k,S;return o==="center"?(k=g+_/2,s==="left"?(y=p,v=y-r,M=k+r,S=k-r):(y=p+m,v=y+r,M=k-r,S=k+r),w=y):(s==="left"?v=p+Math.max(a,d)+r:s==="right"?v=p+m-Math.max(c,f)-r:v=this.caretX,o==="top"?(M=g,k=M-r,y=v-r,w=v+r):(M=g+_,k=M+r,y=v+r,w=v-r),S=M),{x1:y,x2:v,x3:w,y1:M,y2:k,y3:S}}drawTitle(t,e,n){const s=this.title,o=s.length;let r,l,a;if(o){const c=nn(n.rtl,this.x,this.width);for(t.x=xs(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",r=ce(n.titleFont),l=n.titleSpacing,e.fillStyle=n.titleColor,e.font=r.string,a=0;a<o;++a)e.fillText(s[a],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+l,a+1===o&&(t.y+=n.titleMarginBottom-l)}}_drawColorBox(t,e,n,s,o){const r=this.labelColors[n],l=this.labelPointStyles[n],{boxHeight:a,boxWidth:c,boxPadding:d}=o,f=ce(o.bodyFont),p=xs(this,"left",o),g=s.x(p),m=a<f.lineHeight?(f.lineHeight-a)/2:0,_=e.y+m;if(o.usePointStyle){const y={radius:Math.min(c,a)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},v=s.leftForLtr(g,c)+c/2,w=_+a/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ho(t,y,v,w),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Ho(t,y,v,w)}else{t.lineWidth=At(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const y=s.leftForLtr(g,c-d),v=s.leftForLtr(s.xPlus(g,1),c-d-2),w=Ei(r.borderRadius);Object.values(w).some(M=>M!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Bn(t,{x:y,y:_,w:c,h:a,radius:w}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Bn(t,{x:v,y:_+1,w:c-2,h:a-2,radius:w}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(y,_,c,a),t.strokeRect(y,_,c,a),t.fillStyle=r.backgroundColor,t.fillRect(v,_+1,c-2,a-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:l,boxHeight:a,boxWidth:c,boxPadding:d}=n,f=ce(n.bodyFont);let p=f.lineHeight,g=0;const m=nn(n.rtl,this.x,this.width),_=function(T){e.fillText(T,m.x(t.x+g),t.y+p/2),t.y+=p+o},y=m.textAlign(r);let v,w,M,k,S,L,C;for(e.textAlign=r,e.textBaseline="middle",e.font=f.string,t.x=xs(this,y,n),e.fillStyle=n.bodyColor,Bt(this.beforeBody,_),g=l&&y!=="right"?r==="center"?c/2+d:c+2+d:0,k=0,L=s.length;k<L;++k){for(v=s[k],w=this.labelTextColors[k],e.fillStyle=w,Bt(v.before,_),M=v.lines,l&&M.length&&(this._drawColorBox(e,t,k,m,n),p=Math.max(f.lineHeight,a)),S=0,C=M.length;S<C;++S)_(M[S]),p=f.lineHeight;Bt(v.after,_)}g=0,p=f.lineHeight,Bt(this.afterBody,_),t.y-=o}drawFooter(t,e,n){const s=this.footer,o=s.length;let r,l;if(o){const a=nn(n.rtl,this.x,this.width);for(t.x=xs(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=a.textAlign(n.footerAlign),e.textBaseline="middle",r=ce(n.footerFont),e.fillStyle=n.footerColor,e.font=r.string,l=0;l<o;++l)e.fillText(s[l],a.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n.footerSpacing}}drawBackground(t,e,n,s){const{xAlign:o,yAlign:r}=this,{x:l,y:a}=t,{width:c,height:d}=n,{topLeft:f,topRight:p,bottomLeft:g,bottomRight:m}=Ei(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(l+f,a),r==="top"&&this.drawCaret(t,e,n,s),e.lineTo(l+c-p,a),e.quadraticCurveTo(l+c,a,l+c,a+p),r==="center"&&o==="right"&&this.drawCaret(t,e,n,s),e.lineTo(l+c,a+d-m),e.quadraticCurveTo(l+c,a+d,l+c-m,a+d),r==="bottom"&&this.drawCaret(t,e,n,s),e.lineTo(l+g,a+d),e.quadraticCurveTo(l,a+d,l,a+d-g),r==="center"&&o==="left"&&this.drawCaret(t,e,n,s),e.lineTo(l,a+f),e.quadraticCurveTo(l,a,l+f,a),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){const r=Tn[t.position].call(this,this._active,this._eventPosition);if(!r)return;const l=this._size=Ul(this,t),a=Object.assign({},r,this._size),c=Xl(e,t,a),d=ql(t,a,c,e);(s._to!==d.x||o._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=l.width,this.height=l.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const r=xe(e.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&l&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,e),kc(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Mc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=t.map(({datasetIndex:l,index:a})=>{const c=this.chart.getDatasetMeta(l);if(!c)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:c.data[a],index:a}}),o=!Ts(n,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,n),l=this._positionChanged(r,t),a=e||!Ts(r,o)||l;return a&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),a}_getActiveElements(t,e,n,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e;const r=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:n,caretY:s,options:o}=this,r=Tn[o.position].call(this,t,e);return r!==!1&&(n!==r.x||s!==r.y)}}Ko.positioners=Tn;var Gc={id:"tooltip",_element:Ko,positioners:Tn,afterInit(i,t,e){e&&(i.tooltip=new Ko({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",e)===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,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:(i,t)=>t.bodyFont.size,boxWidth:(i,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:{beforeTitle:ri,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return e[t.dataIndex]}return""},afterTitle:ri,beforeBody:ri,beforeLabel:ri,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return Rt(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:ri,afterBody:ri,beforeFooter:ri,footer:ri,afterFooter:ri}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Gp=Object.freeze({__proto__:null,Decimation:bp,Filler:Bp,Legend:Wp,SubTitle:Hp,Title:Kc,Tooltip:Gc});const Qp=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Zp(i,t,e,n){const s=i.indexOf(t);if(s===-1)return Qp(i,t,e,n);const o=i.lastIndexOf(t);return s!==o?e:s}const Jp=(i,t)=>i===null?null:pe(Math.round(i),0,t);class Nn extends zi{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const n=this.getLabels();for(const{index:s,label:o}of e)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(Rt(t))return null;const n=this.getLabels();return e=isFinite(e)&&n[e]===t?e:Zp(n,t,xt(e,t),this._addedLabels),Jp(e,n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),e||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,s=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let r=t;r<=e;r++)s.push({value:r});return s}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]: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 e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Nn.id="category";Nn.defaults={ticks:{callback:Nn.prototype.getLabelForValue}};function tg(i,t){const e=[],{bounds:s,step:o,min:r,max:l,precision:a,count:c,maxTicks:d,maxDigits:f,includeBounds:p}=i,g=o||1,m=d-1,{min:_,max:y}=t,v=!Rt(r),w=!Rt(l),M=!Rt(c),k=(y-_)/(f+1);let S=Xr((y-_)/m/g)*g,L,C,T,E;if(S<1e-14&&!v&&!w)return[{value:_},{value:y}];E=Math.ceil(y/S)-Math.floor(_/S),E>m&&(S=Xr(E*S/m/g)*g),Rt(a)||(L=Math.pow(10,a),S=Math.ceil(S*L)/L),s==="ticks"?(C=Math.floor(_/S)*S,T=Math.ceil(y/S)*S):(C=_,T=y),v&&w&&o&&ju((l-r)/o,S/1e3)?(E=Math.round(Math.min((l-r)/S,d)),S=(l-r)/E,C=r,T=l):M?(C=v?r:C,T=w?l:T,E=c-1,S=(T-C)/E):(E=(T-C)/S,Pn(E,Math.round(E),S/1e3)?E=Math.round(E):E=Math.ceil(E));const O=Math.max(qr(S),qr(C));L=Math.pow(10,Rt(a)?O:a),C=Math.round(C*L)/L,T=Math.round(T*L)/L;let N=0;for(v&&(p&&C!==r?(e.push({value:r}),C<r&&N++,Pn(Math.round((C+N*S)*L)/L,r,Ql(r,k,i))&&N++):C<r&&N++);N<E;++N)e.push({value:Math.round((C+N*S)*L)/L});return w&&p&&T!==l?e.length&&Pn(e[e.length-1].value,l,Ql(l,k,i))?e[e.length-1].value=l:e.push({value:l}):(!w||T===l)&&e.push({value:T}),e}function Ql(i,t,{horizontal:e,minRotation:n}){const s=Ie(n),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class Ns extends zi{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,e){return Rt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:o}=this;const r=a=>s=e?s:a,l=a=>o=n?o:a;if(t){const a=si(s),c=si(o);a<0&&c<0?l(0):a>0&&c>0&&r(0)}if(s===o){let a=1;(o>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(a=Math.abs(o*.05)),l(o+a),t||r(s-a)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=tg(s,o);return t.bounds==="ticks"&&ec(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return Vn(t,this.chart.options.locale,this.options.ticks.format)}}class Zs extends Ns{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=se(t)?t:0,this.max=se(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=Ie(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Zs.id="linear";Zs.defaults={ticks:{callback:qs.formatters.numeric}};function Zl(i){return i/Math.pow(10,Math.floor(Oe(i)))===1}function eg(i,t){const e=Math.floor(Oe(t.max)),n=Math.ceil(t.max/Math.pow(10,e)),s=[];let o=Te(i.min,Math.pow(10,Math.floor(Oe(t.min)))),r=Math.floor(Oe(o)),l=Math.floor(o/Math.pow(10,r)),a=r<0?Math.pow(10,Math.abs(r)):1;do s.push({value:o,major:Zl(o)}),++l,l===10&&(l=1,++r,a=r>=0?1:a),o=Math.round(l*Math.pow(10,r)*a)/a;while(r<e||r===e&&l<n);const c=Te(i.max,o);return s.push({value:c,major:Zl(o)}),s}class pr extends zi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=Ns.prototype.parse.apply(this,[t,e]);if(n===0){this._zero=!0;return}return se(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=se(t)?Math.max(0,t):null,this.max=se(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,s=this.max;const o=a=>n=t?n:a,r=a=>s=e?s:a,l=(a,c)=>Math.pow(10,Math.floor(Oe(a))+c);n===s&&(n<=0?(o(1),r(10)):(o(l(n,-1)),r(l(s,1)))),n<=0&&o(l(s,-1)),s<=0&&r(l(n,1)),this._zero&&this.min!==this._suggestedMin&&n===l(this.min,0)&&o(l(n,-1)),this.min=n,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},n=eg(e,this);return t.bounds==="ticks"&&ec(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":Vn(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Oe(t),this._valueRange=Oe(this.max)-Oe(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Oe(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}pr.id="logarithmic";pr.defaults={ticks:{callback:qs.formatters.logarithmic,major:{enabled:!0}}};function Go(i){const t=i.ticks;if(t.display&&i.display){const e=xe(t.backdropPadding);return xt(t.font&&t.font.size,Pt.font.size)+e.height}return 0}function ig(i,t,e){return e=Yt(e)?e:[e],{w:yd(i,t.string,e),h:e.length*t.lineHeight}}function Jl(i,t,e,n,s){return i===n||i===s?{start:t-e/2,end:t+e/2}:i<n||i>s?{start:t-e,end:t}:{start:t,end:t+e}}function ng(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),n=[],s=[],o=i._pointLabels.length,r=i.options.pointLabels,l=r.centerPointLabels?Gt/o:0;for(let a=0;a<o;a++){const c=r.setContext(i.getPointLabelContext(a));s[a]=c.padding;const d=i.getPointPosition(a,i.drawingArea+s[a],l),f=ce(c.font),p=ig(i.ctx,f,i._pointLabels[a]);n[a]=p;const g=Ce(i.getIndexAngle(a)+l),m=Math.round(tr(g)),_=Jl(m,d.x,p.w,0,180),y=Jl(m,d.y,p.h,90,270);sg(e,t,g,_,y)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=og(i,n,s)}function sg(i,t,e,n,s){const o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e));let l=0,a=0;n.start<t.l?(l=(t.l-n.start)/o,i.l=Math.min(i.l,t.l-l)):n.end>t.r&&(l=(n.end-t.r)/o,i.r=Math.max(i.r,t.r+l)),s.start<t.t?(a=(t.t-s.start)/r,i.t=Math.min(i.t,t.t-a)):s.end>t.b&&(a=(s.end-t.b)/r,i.b=Math.max(i.b,t.b+a))}function og(i,t,e){const n=[],s=i._pointLabels.length,o=i.options,r=Go(o)/2,l=i.drawingArea,a=o.pointLabels.centerPointLabels?Gt/s:0;for(let c=0;c<s;c++){const d=i.getPointPosition(c,l+r+e[c],a),f=Math.round(tr(Ce(d.angle+te))),p=t[c],g=ag(d.y,p.h,f),m=rg(f),_=lg(d.x,p.w,m);n.push({x:d.x,y:g,textAlign:m,left:_,top:g,right:_+p.w,bottom:g+p.h})}return n}function rg(i){return i===0||i===180?"center":i<180?"left":"right"}function lg(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function ag(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function cg(i,t){const{ctx:e,options:{pointLabels:n}}=i;for(let s=t-1;s>=0;s--){const o=n.setContext(i.getPointLabelContext(s)),r=ce(o.font),{x:l,y:a,textAlign:c,left:d,top:f,right:p,bottom:g}=i._pointLabelItems[s],{backdropColor:m}=o;if(!Rt(m)){const _=Ei(o.borderRadius),y=xe(o.backdropPadding);e.fillStyle=m;const v=d-y.left,w=f-y.top,M=p-d+y.width,k=g-f+y.height;Object.values(_).some(S=>S!==0)?(e.beginPath(),Bn(e,{x:v,y:w,w:M,h:k,radius:_}),e.fill()):e.fillRect(v,w,M,k)}Bi(e,i._pointLabels[s],l,a+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}function Qc(i,t,e,n){const{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,Nt);else{let o=i.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<n;r++)o=i.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function ug(i,t,e,n){const s=i.ctx,o=t.circular,{color:r,lineWidth:l}=t;!o&&!n||!r||!l||e<0||(s.save(),s.strokeStyle=r,s.lineWidth=l,s.setLineDash(t.borderDash),s.lineDashOffset=t.borderDashOffset,s.beginPath(),Qc(i,e,o,n),s.closePath(),s.stroke(),s.restore())}function dg(i,t,e){return Pi(i,{label:e,index:t,type:"pointLabel"})}class Xn extends Ns{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=xe(Go(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=se(t)&&!isNaN(t)?t:0,this.max=se(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Go(this.options))}generateTickLabels(t){Ns.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,n)=>{const s=$t(this.options.pointLabels.callback,[e,n],this);return s||s===0?s:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?ng(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,s))}getIndexAngle(t){const e=Nt/(this._pointLabels.length||1),n=this.options.startAngle||0;return Ce(t*e+Ie(n))}getDistanceFromCenterForValue(t){if(Rt(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(Rt(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const n=e[t];return dg(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const s=this.getIndexAngle(t)-te+n;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:n,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),Qc(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:s}=e,o=this._pointLabels.length;let r,l,a;if(e.pointLabels.display&&cg(this,o),s.display&&this.ticks.forEach((c,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(c.value);const f=s.setContext(this.getContext(d-1));ug(this,f,l,o)}}),n.display){for(t.save(),r=o-1;r>=0;r--){const c=n.setContext(this.getPointLabelContext(r)),{color:d,lineWidth:f}=c;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),a=this.getPointPosition(r,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(a.x,a.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,a)=>{if(a===0&&!e.reverse)return;const c=n.setContext(this.getContext(a)),d=ce(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[a].value),c.showLabelBackdrop){t.font=d.string,r=t.measureText(l.label).width,t.fillStyle=c.backdropColor;const f=xe(c.backdropPadding);t.fillRect(-r/2-f.left,-o-d.size/2-f.top,r+f.width,d.size+f.height)}Bi(t,l.label,0,-o,d,{color:c.color})}),t.restore()}drawTitle(){}}Xn.id="radialLinear";Xn.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:qs.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(i){return i},padding:5,centerPointLabels:!1}};Xn.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Xn.descriptors={angleLines:{_fallback:"grid"}};const Js={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}},Se=Object.keys(Js);function fg(i,t){return i-t}function ta(i,t){if(Rt(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:o}=i._parseOpts;let r=t;return typeof n=="function"&&(r=n(r)),se(r)||(r=typeof n=="string"?e.parse(r,n):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(sn(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function ea(i,t,e,n){const s=Se.length;for(let o=Se.indexOf(i);o<s-1;++o){const r=Js[Se[o]],l=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(l*r.size))<=n)return Se[o]}return Se[s-1]}function hg(i,t,e,n,s){for(let o=Se.length-1;o>=Se.indexOf(e);o--){const r=Se[o];if(Js[r].common&&i._adapter.diff(s,n,r)>=t-1)return r}return Se[e?Se.indexOf(e):0]}function pg(i){for(let t=Se.indexOf(i)+1,e=Se.length;t<e;++t)if(Js[Se[t]].common)return Se[t]}function ia(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:n,hi:s}=er(e,t),o=e[n]>=t?e[n]:e[s];i[o]=!0}}function gg(i,t,e,n){const s=i._adapter,o=+s.startOf(t[0].value,n),r=t[t.length-1].value;let l,a;for(l=o;l<=r;l=+s.add(l,1,n))a=e[l],a>=0&&(t[a].major=!0);return t}function na(i,t,e){const n=[],s={},o=t.length;let r,l;for(r=0;r<o;++r)l=t[r],s[l]=r,n.push({value:l,major:!1});return o===0||!e?n:gg(i,n,s,e)}class qn extends zi{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,e){const n=t.time||(t.time={}),s=this._adapter=new nh._date(t.adapters.date);s.init(e),An(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:ta(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:s,max:o,minDefined:r,maxDefined:l}=this.getUserBounds();function a(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!l&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!l)&&(a(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&a(this.getMinMax(!1))),s=se(s)&&!isNaN(s)?s:+e.startOf(Date.now(),n),o=se(o)&&!isNaN(o)?o:+e.endOf(Date.now(),n)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,r=this.max,l=Yu(s,o,r);return this._unit=e.unit||(n.autoSkip?ea(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):hg(this,l.length,e.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:pg(this._unit),this.initOffsets(s),t.reverse&&l.reverse(),na(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t){let e=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=pe(e,0,r),n=pe(n,0,r),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,o=s.time,r=o.unit||ea(o.minUnit,e,n,this._getLabelCapacity(e)),l=xt(o.stepSize,1),a=r==="week"?o.isoWeekday:!1,c=sn(a)||a===!0,d={};let f=e,p,g;if(c&&(f=+t.startOf(f,"isoWeek",a)),f=+t.startOf(f,c?"day":r),t.diff(n,e,r)>1e5*l)throw new Error(e+" and "+n+" are too far apart with stepSize of "+l+" "+r);const m=s.ticks.source==="data"&&this.getDataTimestamps();for(p=f,g=0;p<n;p=+t.add(p,l,r),g++)ia(d,p,m);return(p===n||s.bounds==="ticks"||g===1)&&ia(d,p,m),Object.keys(d).sort((_,y)=>_-y).map(_=>+_)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,e,n,s){const o=this.options,r=o.time.displayFormats,l=this._unit,a=this._majorUnit,c=l&&r[l],d=a&&r[a],f=n[e],p=a&&d&&f&&f.major,g=this._adapter.format(t,s||(p?d:c)),m=o.ticks.callback;return m?$t(m,[g,e,n],this):g}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e<n;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,s=Ie(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),r=Math.sin(s),l=this._resolveTickFontOptions(0).size;return{w:n*o+l*r,h:n*r+l*o}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,s=n[e.unit]||n.millisecond,o=this._tickFormatFunction(t,0,na(this,[t],this._majorUnit),s),r=this._getLabelSize(o),l=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],e,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e<n;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const s=this.getLabels();for(e=0,n=s.length;e<n;++e)t.push(ta(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return sc(t.sort(fg))}}qn.id="time";qn.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function ws(i,t,e){let n=0,s=i.length-1,o,r,l,a;e?(t>=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=di(i,"pos",t)),{pos:o,time:l}=i[n],{pos:r,time:a}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=di(i,"time",t)),{time:o,pos:l}=i[n],{time:r,pos:a}=i[s]);const c=r-o;return c?l+(a-l)*(t-o)/c:l}class gr extends qn{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=ws(e,this.min),this._tableRange=ws(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],o=[];let r,l,a,c,d;for(r=0,l=t.length;r<l;++r)c=t[r],c>=e&&c<=n&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(r=0,l=s.length;r<l;++r)d=s[r+1],a=s[r-1],c=s[r],Math.round((d+a)/2)!==c&&o.push({time:c,pos:r/(l-1)});return o}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(ws(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return ws(this._table,n*this._tableRange+this._minPos,!0)}}gr.id="timeseries";gr.defaults=qn.defaults;var mg=Object.freeze({__proto__:null,CategoryScale:Nn,LinearScale:Zs,LogarithmicScale:pr,RadialLinearScale:Xn,TimeScale:qn,TimeSeriesScale:gr});const bg=[ih,hp,Gp,mg];ln.register(...bg);function sa(i,t,e){const n=i.slice();return n[46]=t[e],n}function oa(i,t,e){const n=i.slice();return n[46]=t[e],n}function _g(i){let t;return{c(){t=I("0")},m(e,n){Q(e,t,n)},p:re,d(e){e&&G(t)}}}function yg(i){let t=i[7].totalReceived.toLocaleString(i[6].lang,{style:"currency",currency:i[6].currency,minimumFractionDigits:0})+"",e;return{c(){e=I(t)},m(n,s){Q(n,e,s)},p(n,s){s[0]&192&&t!==(t=n[7].totalReceived.toLocaleString(n[6].lang,{style:"currency",currency:n[6].currency,minimumFractionDigits:0})+"")&&z(e,t)},d(n){n&&G(e)}}}function vg(i){let t;return{c(){t=I("0")},m(e,n){Q(e,t,n)},p:re,d(e){e&&G(t)}}}function xg(i){let t=i[7].totalUsed.toLocaleString(i[6].lang,{style:"currency",currency:i[6].currency,minimumFractionDigits:0})+"",e;return{c(){e=I(t)},m(n,s){Q(n,e,s)},p(n,s){s[0]&192&&t!==(t=n[7].totalUsed.toLocaleString(n[6].lang,{style:"currency",currency:n[6].currency,minimumFractionDigits:0})+"")&&z(e,t)},d(n){n&&G(e)}}}function wg(i){let t,e,n,s,o=i[5].no_transactions+"",r;return{c(){t=b("div"),e=b("i"),n=x(),s=b("p"),r=I(o),h(e,"class","fa-duotone fa-check-circle text-2xl mb-2"),h(t,"class","p-4 text-center text-blue-200")},m(l,a){Q(l,t,a),u(t,e),u(t,n),u(t,s),u(s,r)},p(l,a){a[0]&32&&o!==(o=l[5].no_transactions+"")&&z(r,o)},d(l){l&&G(t)}}}function kg(i){let t,e,n,s=i[5].see_all+"",o,r,l,a=oe(i[4].transactions.slice(0,5)),c=[];for(let d=0;d<a.length;d+=1)c[d]=ra(oa(i,a,d));return{c(){for(let d=0;d<c.length;d+=1)c[d].c();t=x(),e=b("div"),n=b("button"),o=I(s),h(n,"class","bg-blue-600/10 border border-blue-500 hover:bg-blue-800/50 text-white font-bold py-2 px-4 mt-4 duration-500 rounded-lg cursor-pointer"),h(e,"class","mt-6 flex justify-center")},m(d,f){for(let p=0;p<c.length;p+=1)c[p]&&c[p].m(d,f);Q(d,t,f),Q(d,e,f),u(e,n),u(n,o),r||(l=tt(n,"click",i[29]),r=!0)},p(d,f){if(f[0]&80){a=oe(d[4].transactions.slice(0,5));let p;for(p=0;p<a.length;p+=1){const g=oa(d,a,p);c[p]?c[p].p(g,f):(c[p]=ra(g),c[p].c(),c[p].m(t.parentNode,t))}for(;p<c.length;p+=1)c[p].d(1);c.length=a.length}f[0]&32&&s!==(s=d[5].see_all+"")&&z(o,s)},d(d){d&&(G(t),G(e)),Ss(c,d),r=!1,l()}}}function ra(i){let t,e,n,s=i[46].description+"",o,r,l,a=i[46].isIncome?"+":"-",c,d,f=i[46].amount.toLocaleString(i[6].lang,{style:"currency",currency:i[6].currency,minimumFractionDigits:0})+"",p,g,m,_;return{c(){t=b("div"),e=b("div"),n=b("span"),o=I(s),r=x(),l=b("p"),c=I(a),d=x(),p=I(f),m=x(),_=b("div"),h(n,"class","truncate"),h(l,"class",g=`text-md font-bold ${i[46].isIncome?"text-green-500":"text-red-500"}`),h(e,"class","flex justify-between"),h(_,"class","border-b border-gray-600"),h(t,"class","space-y-2")},m(y,v){Q(y,t,v),u(t,e),u(e,n),u(n,o),u(e,r),u(e,l),u(l,c),u(l,d),u(l,p),u(t,m),u(t,_)},p(y,v){v[0]&16&&s!==(s=y[46].description+"")&&z(o,s),v[0]&16&&a!==(a=y[46].isIncome?"+":"-")&&z(c,a),v[0]&80&&f!==(f=y[46].amount.toLocaleString(y[6].lang,{style:"currency",currency:y[6].currency,minimumFractionDigits:0})+"")&&z(p,f),v[0]&16&&g!==(g=`text-md font-bold ${y[46].isIncome?"text-green-500":"text-red-500"}`)&&h(l,"class",g)},d(y){y&&G(t)}}}function Mg(i){let t,e,n,s,o=i[5].no_unpaid_bills+"",r;return{c(){t=b("div"),e=b("i"),n=x(),s=b("p"),r=I(o),h(e,"class","fa-duotone fa-check-circle text-2xl mb-2"),h(t,"class","p-4 text-center text-blue-200")},m(l,a){Q(l,t,a),u(t,e),u(t,n),u(t,s),u(s,r)},p(l,a){a[0]&32&&o!==(o=l[5].no_unpaid_bills+"")&&z(r,o)},d(l){l&&G(t)}}}function Sg(i){let t=[],e=new Map,n,s,o,r,l=i[5].see_all+"",a,c,d,f=oe(i[8].slice(0,2));const p=g=>g[46].id;for(let g=0;g<f.length;g+=1){let m=sa(i,f,g),_=p(m);e.set(_,t[g]=aa(_,m))}return{c(){for(let g=0;g<t.length;g+=1)t[g].c();n=x(),s=b("div"),o=b("div"),r=b("button"),a=I(l),h(r,"class","bg-blue-600/10 border border-blue-500 hover:bg-blue-800/50 text-white font-bold py-2 px-4 duration-500 rounded-lg cursor-pointer"),h(o,"class","mt-[70px] flex justify-center"),h(s,"class","mb-4 space-y-2 text-center")},m(g,m){for(let _=0;_<t.length;_+=1)t[_]&&t[_].m(g,m);Q(g,n,m),Q(g,s,m),u(s,o),u(o,r),u(r,a),c||(d=tt(r,"click",i[30]),c=!0)},p(g,m){m[0]&320&&(f=oe(g[8].slice(0,2)),t=an(t,m,p,1,g,f,e,n.parentNode,yu,aa,n,sa)),m[0]&32&&l!==(l=g[5].see_all+"")&&z(a,l)},d(g){g&&(G(n),G(s));for(let m=0;m<t.length;m+=1)t[m].d(g);c=!1,d()}}}function la(i){let t,e,n,s,o=i[46].description+"",r,l,a=i[46].id+"",c,d,f,p,g=i[46].type+"",m,_,y,v,w=i[46].timeAgo+"",M,k,S,L,C=i[46].isIncome?"+":"-",T,E,O=i[46].amount.toLocaleString(i[6].lang,{style:"currency",currency:i[6].currency,minimumFractionDigits:0})+"",N,V,R,B,F,H=i[46].date+"",P,W,$;return{c(){t=b("div"),e=b("div"),n=b("div"),s=b("span"),r=I(o),l=I(" #"),c=I(a),d=x(),f=b("div"),p=b("span"),m=I(g),_=x(),y=b("div"),v=b("span"),M=I(w),k=x(),S=b("div"),L=b("span"),T=I(C),E=x(),N=I(O),R=x(),B=b("div"),F=b("div"),P=I(H),W=x(),$=b("div"),h(s,"class","font-semibold text-[#f1f5f9]"),h(n,"class","flex items-center"),h(p,"class","text-sm text-gray-400"),h(f,"class","flex items-center mt-1"),h(v,"class","text-xs text-gray-500"),h(y,"class","flex items-center mt-1"),h(e,"class","flex flex-col"),h(L,"class",V=`text-lg ${i[46].isIncome?"text-green-400":"text-red-400"}`),h(F,"class","text-sm text-gray-400"),h(B,"class","flex items-center mt-0"),h(S,"class","text-right flex flex-col items-end"),h(t,"class","p-2 rounded-lg flex justify-between items-center"),h($,"class","border-b border-gray-600")},m(D,A){Q(D,t,A),u(t,e),u(e,n),u(n,s),u(s,r),u(s,l),u(s,c),u(e,d),u(e,f),u(f,p),u(p,m),u(e,_),u(e,y),u(y,v),u(v,M),u(t,k),u(t,S),u(S,L),u(L,T),u(L,E),u(L,N),u(S,R),u(S,B),u(B,F),u(F,P),Q(D,W,A),Q(D,$,A)},p(D,A){A[0]&256&&o!==(o=D[46].description+"")&&z(r,o),A[0]&256&&a!==(a=D[46].id+"")&&z(c,a),A[0]&256&&g!==(g=D[46].type+"")&&z(m,g),A[0]&256&&w!==(w=D[46].timeAgo+"")&&z(M,w),A[0]&256&&C!==(C=D[46].isIncome?"+":"-")&&z(T,C),A[0]&320&&O!==(O=D[46].amount.toLocaleString(D[6].lang,{style:"currency",currency:D[6].currency,minimumFractionDigits:0})+"")&&z(N,O),A[0]&256&&V!==(V=`text-lg ${D[46].isIncome?"text-green-400":"text-red-400"}`)&&h(L,"class",V),A[0]&256&&H!==(H=D[46].date+"")&&z(P,H)},d(D){D&&(G(t),G(W),G($))}}}function aa(i,t){let e,n,s=!t[46].isPaid&&la(t);return{key:i,first:null,c(){e=Ds(),s&&s.c(),n=Ds(),this.first=e},m(o,r){Q(o,e,r),s&&s.m(o,r),Q(o,n,r)},p(o,r){t=o,t[46].isPaid?s&&(s.d(1),s=null):s?s.p(t,r):(s=la(t),s.c(),s.m(n.parentNode,n))},d(o){o&&(G(e),G(n)),s&&s.d(o)}}}function ca(i){let t,e,n,s,o,r,l=i[5].transfer_money+"",a,c,d,f,p=i[5].payment_method+"",g,m,_,y,v,w,M,k,S,L,C=i[5].id+"",T,E,O,N,V,R,B,F,H=i[5].amount+"",P,W,$,D,A,Y,X,K,Z,J,st=i[5].cancel+"",et,vt,at,ut,U=i[5].confirm+"",j,lt,kt,mt,Xt,jt,Jt,Et=i[2]&&ua(i),gt=(i[10].contactType==="phone"||i[10].contactType==="id")&&da(i);return Xt=Ua(i[32][0]),{c(){t=b("div"),e=b("div"),n=b("div"),s=b("i"),o=x(),r=b("h2"),a=I(l),c=x(),d=b("div"),f=b("p"),g=I(p),m=x(),_=b("div"),Et&&Et.c(),y=x(),v=b("label"),w=b("input"),M=x(),k=b("i"),S=x(),L=b("span"),T=I(C),E=x(),O=b("div"),O.innerHTML='<i class="fa-duotone fa-check-circle text-blue-400"></i>',N=x(),gt&>.c(),V=x(),R=b("div"),B=b("label"),F=b("i"),P=I(H),W=x(),$=b("div"),D=b("input"),A=x(),Y=b("i"),X=x(),K=b("div"),Z=b("button"),J=b("i"),et=I(st),vt=x(),at=b("button"),ut=b("i"),j=I(U),h(s,"class","fa-duotone fa-arrow-right-arrow-left text-3xl text-blue-400 mr-3"),h(r,"class","text-2xl text-blue-200 font-bold"),h(n,"class","flex items-center mb-4"),h(f,"class","capitalize font-semibold text-blue-200 mb-2"),h(w,"type","radio"),h(w,"name","payment"),w.__value="id",Ft(w,w.__value),h(w,"class","hidden peer"),h(k,"class","fa-duotone fa-id-badge text-lg text-blue-400 mr-3"),h(L,"class","text-white font-bold"),h(O,"class","ml-auto hidden peer-checked:block"),h(v,"class","flex items-center cursor-pointer bg-gray-700/50 rounded-lg p-3 border border-gray-600/20 hover:border-blue-400 transition duration-300"),h(_,"class","flex flex-col space-y-4"),h(d,"class","mb-6"),h(F,"class","fa-duotone fa-money-bill-wave text-blue-400 mr-2"),h(B,"class","block text-gray-400 mb-2"),h(D,"type","number"),h(D,"min","1"),h(D,"class","w-full p-3 bg-gray-700/50 text-white pr-10 border border-blue-200/10 rounded-lg focus:outline-none focus:border-blue-400/50 transition-colors duration-500"),h(Y,"class","fa-duotone fa-dollar-sign absolute top-1/2 right-3 transform -translate-y-1/2 text-gray-400"),h($,"class","relative"),h(R,"class","mb-6"),h(J,"class","fa-duotone fa-times-circle mr-2"),h(Z,"class","flex items-center bg-red-600 hover:bg-red-700 text-white py-2 px-4 rounded focus:outline-none"),h(ut,"class","fa-duotone fa-check-circle mr-2"),h(at,"class","flex items-center bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded focus:outline-none"),h(K,"class","flex justify-between items-center mt-6"),h(e,"class","p-8 bg-gray-800 rounded-lg shadow-lg w-96"),h(t,"class","fixed inset-0 flex items-center justify-center bg-black bg-opacity-50"),Xt.p(w)},m(ft,Mt){Q(ft,t,Mt),u(t,e),u(e,n),u(n,s),u(n,o),u(n,r),u(r,a),u(e,c),u(e,d),u(d,f),u(f,g),u(d,m),u(d,_),Et&&Et.m(_,null),u(_,y),u(_,v),u(v,w),w.checked=w.__value===i[10].contactType,u(v,M),u(v,k),u(v,S),u(v,L),u(L,T),u(v,E),u(v,O),u(e,N),gt&>.m(e,null),u(e,V),u(e,R),u(R,B),u(B,F),u(B,P),u(R,W),u(R,$),u($,D),Ft(D,i[10].amount),u($,A),u($,Y),u(e,X),u(e,K),u(K,Z),u(Z,J),u(Z,et),u(K,vt),u(K,at),u(at,ut),u(at,j),mt=!0,jt||(Jt=[tt(w,"change",i[33]),tt(D,"input",i[35]),tt(Z,"click",i[19]),tt(at,"click",i[36])],jt=!0)},p(ft,Mt){(!mt||Mt[0]&32)&&l!==(l=ft[5].transfer_money+"")&&z(a,l),(!mt||Mt[0]&32)&&p!==(p=ft[5].payment_method+"")&&z(g,p),ft[2]?Et?Et.p(ft,Mt):(Et=ua(ft),Et.c(),Et.m(_,y)):Et&&(Et.d(1),Et=null),Mt[0]&1024&&(w.checked=w.__value===ft[10].contactType),(!mt||Mt[0]&32)&&C!==(C=ft[5].id+"")&&z(T,C),ft[10].contactType==="phone"||ft[10].contactType==="id"?gt?gt.p(ft,Mt):(gt=da(ft),gt.c(),gt.m(e,V)):gt&&(gt.d(1),gt=null),(!mt||Mt[0]&32)&&H!==(H=ft[5].amount+"")&&z(P,H),Mt[0]&1024&&ge(D.value)!==ft[10].amount&&Ft(D,ft[10].amount),(!mt||Mt[0]&32)&&st!==(st=ft[5].cancel+"")&&z(et,st),(!mt||Mt[0]&32)&&U!==(U=ft[5].confirm+"")&&z(j,U)},i(ft){mt||(ft&&Wt(()=>{mt&&(kt&&kt.end(1),lt=ee(e,Kt,{duration:250,easing:Tt}),lt.start())}),mt=!0)},o(ft){lt&<.invalidate(),ft&&(kt=be(e,Kt,{duration:250,easing:Tt})),mt=!1},d(ft){ft&&G(t),Et&&Et.d(),gt&>.d(),ft&&kt&&kt.end(),Xt.r(),jt=!1,Ut(Jt)}}}function ua(i){let t,e,n,s,o,r,l=i[5].phone_number+"",a,c,d,f,p,g;return f=Ua(i[32][0]),{c(){t=b("label"),e=b("input"),n=x(),s=b("i"),o=x(),r=b("span"),a=I(l),c=x(),d=b("div"),d.innerHTML='<i class="fa-duotone fa-check-circle text-blue-400"></i>',h(e,"type","radio"),h(e,"name","payment"),e.__value="phone",Ft(e,e.__value),h(e,"class","hidden peer"),h(s,"class","fa-duotone fa-phone text-lg text-blue-400 mr-3"),h(r,"class","text-white font-bold"),h(d,"class","ml-auto hidden peer-checked:block"),h(t,"class","flex items-center cursor-pointer bg-gray-700/50 rounded-lg p-3 border border-gray-600/20 hover:border-blue-400 transition duration-300"),f.p(e)},m(m,_){Q(m,t,_),u(t,e),e.checked=e.__value===i[10].contactType,u(t,n),u(t,s),u(t,o),u(t,r),u(r,a),u(t,c),u(t,d),p||(g=tt(e,"change",i[31]),p=!0)},p(m,_){_[0]&1024&&(e.checked=e.__value===m[10].contactType),_[0]&32&&l!==(l=m[5].phone_number+"")&&z(a,l)},d(m){m&&G(t),f.r(),p=!1,g()}}}function da(i){let t,e,n,s,o,r,l,a,c,d,f;function p(_,y){return _[2]?Ag:Dg}let g=p(i),m=g(i);return{c(){t=b("div"),e=b("label"),n=b("i"),s=x(),m.c(),o=x(),r=b("div"),l=b("input"),a=x(),c=b("i"),h(n,"class","fa-duotone fa-id-card text-blue-400 mr-2"),h(e,"class","block text-gray-400 mb-2"),h(l,"type","number"),h(l,"min","1"),h(l,"class","w-full p-3 bg-gray-700/50 text-white pr-10 border border-blue-200/10 rounded-lg focus:outline-none focus:border-blue-400/50 transition-colors duration-500"),h(c,"class","fa-duotone fa-user absolute top-1/2 right-3 transform -translate-y-1/2 text-gray-400"),h(r,"class","relative"),h(t,"class","mb-6")},m(_,y){Q(_,t,y),u(t,e),u(e,n),u(e,s),m.m(e,null),u(t,o),u(t,r),u(r,l),Ft(l,i[10].idOrPhone),u(r,a),u(r,c),d||(f=tt(l,"input",i[34]),d=!0)},p(_,y){g===(g=p(_))&&m?m.p(_,y):(m.d(1),m=g(_),m&&(m.c(),m.m(e,null))),y[0]&1024&&ge(l.value)!==_[10].idOrPhone&&Ft(l,_[10].idOrPhone)},d(_){_&&G(t),m.d(),d=!1,f()}}}function Dg(i){let t=i[5].id+"",e;return{c(){e=I(t)},m(n,s){Q(n,e,s)},p(n,s){s[0]&32&&t!==(t=n[5].id+"")&&z(e,t)},d(n){n&&G(e)}}}function Ag(i){let t=i[5].id_or_phone_number+"",e;return{c(){e=I(t)},m(n,s){Q(n,e,s)},p(n,s){s[0]&32&&t!==(t=n[5].id_or_phone_number+"")&&z(e,t)},d(n){n&&G(e)}}}function fa(i){let t,e,n,s,o,r,l=i[5].are_you_sure+"",a,c,d,f=i[5].confirm_pay_all_bills+"",p,g,m,_,y,v=i[5].cancel+"",w,M,k,S,L=i[5].confirm+"",C,T,E,O,N,V;return{c(){t=b("div"),e=b("div"),n=b("div"),s=b("i"),o=x(),r=b("h2"),a=I(l),c=x(),d=b("p"),p=I(f),g=x(),m=b("div"),_=b("button"),y=b("i"),w=I(v),M=x(),k=b("button"),S=b("i"),C=I(L),h(s,"class","fa-duotone fa-question-circle text-3xl text-blue-400 mr-3"),h(r,"class","text-2xl text-blue-200 font-bold"),h(n,"class","flex items-center mb-4"),h(d,"class","text-gray-300 mb-6"),h(y,"class","fa-duotone fa-times-circle mr-2"),h(_,"class","flex items-center bg-red-600 hover:bg-red-700 text-white py-2 px-4 rounded focus:outline-none"),h(S,"class","fa-duotone fa-check-circle mr-2"),h(k,"class","flex items-center bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded focus:outline-none"),h(m,"class","flex justify-between items-center"),h(e,"class","bg-gray-700 p-8 rounded-lg shadow-lg w-96"),h(t,"class","fixed inset-0 flex items-center justify-center bg-black bg-opacity-50")},m(R,B){Q(R,t,B),u(t,e),u(e,n),u(n,s),u(n,o),u(n,r),u(r,a),u(e,c),u(e,d),u(d,p),u(e,g),u(e,m),u(m,_),u(_,y),u(_,w),u(m,M),u(m,k),u(k,S),u(k,C),O=!0,N||(V=[tt(_,"click",i[37]),tt(k,"click",i[38])],N=!0)},p(R,B){(!O||B[0]&32)&&l!==(l=R[5].are_you_sure+"")&&z(a,l),(!O||B[0]&32)&&f!==(f=R[5].confirm_pay_all_bills+"")&&z(p,f),(!O||B[0]&32)&&v!==(v=R[5].cancel+"")&&z(w,v),(!O||B[0]&32)&&L!==(L=R[5].confirm+"")&&z(C,L)},i(R){O||(R&&Wt(()=>{O&&(E&&E.end(1),T=ee(e,Kt,{duration:250,easing:Tt}),T.start())}),O=!0)},o(R){T&&T.invalidate(),R&&(E=be(e,Kt,{duration:250,easing:Tt})),O=!1},d(R){R&&G(t),R&&E&&E.end(),N=!1,Ut(V)}}}function Pg(i){let t,e,n,s,o=i[5].total_balance+"",r,l,a,c=i[1].toLocaleString(i[6].lang,{style:"currency",currency:i[6].currency,minimumFractionDigits:0})+"",d,f,p,g,m=i[5].quick_actions+"",_,y,v,w,M,k,S,L=i[5].transfer_money+"",C,T,E,O=i[5].easy_transfer+"",N,V,R,B=i[5].transfer+"",F,H,P,W,$,D,A=i[5].pay_bills+"",Y,X,K,Z=i[5].pay_pending_bills+"",J,st,et,vt=i[5].pay+"",at,ut,U,j,lt,kt,mt=i[5].withdraw_all_money+"",Xt,jt,Jt,Et=i[5].withdraw_all_from_account+"",gt,ft,Mt,Qt=i[5].withdraw+"",dt,Ht,ue,de,De,Ae,ke=i[5].deposit_cash+"",_e,me,Pe,q=i[5].deposit_all_cash+"",bt,Ct,_t,Zt=i[5].deposit+"",Lt,we,Ot,ie,Vt,nt,zt,ht,Me=i[5].weekly_summary+"",pi,gi,It,Ye,Ni,Ci=i[5].income+"",Fe,un,wt,ne,Ue,to,Kn=i[5].expenses+"",eo,mr,dn,br,Wi,ji,io,_r,no,Gn=i[5].report+"",so,yr,oo,ro,vr,Hi,Vi,$i,lo,xr,Qn,Zn=i[5].latest_transactions+"",ao,wr,Jn,ts,es=i[4].transactions.length+"",co,kr,fn,Mr,Yi,Ui,Xi,uo,Sr,is,ns=i[5].unpaid_bills+"",fo,Dr,ss,os,rs=i[8].length+"",ho,Ar,hn,po,Pr,go,mo,Cr;function Lr(ot,St){return ot[7].totalReceived!==void 0?yg:_g}let ls=Lr(i),Xe=ls(i);function Tr(ot,St){return ot[7].totalUsed!==void 0?xg:vg}let as=Tr(i),qe=as(i);function Or(ot,St){return ot[4].transactions.length>0?kg:wg}let cs=Or(i),Ke=cs(i);function Rr(ot,St){return ot[8].length>0?Sg:Mg}let us=Rr(i),Ge=us(i),fe=i[9]&&ca(i),he=i[11]&&fa(i);return{c(){t=b("div"),e=b("div"),n=b("div"),s=b("div"),r=I(o),l=x(),a=b("div"),d=I(c),f=x(),p=b("div"),g=b("div"),_=I(m),y=x(),v=b("div"),w=b("div"),M=b("i"),k=x(),S=b("div"),C=I(L),T=x(),E=b("div"),N=I(O),V=x(),R=b("button"),F=I(B),H=x(),P=b("div"),W=b("i"),$=x(),D=b("div"),Y=I(A),X=x(),K=b("div"),J=I(Z),st=x(),et=b("button"),at=I(vt),ut=x(),U=b("div"),j=b("i"),lt=x(),kt=b("div"),Xt=I(mt),jt=x(),Jt=b("div"),gt=I(Et),ft=x(),Mt=b("button"),dt=I(Qt),Ht=x(),ue=b("div"),de=b("i"),De=x(),Ae=b("div"),_e=I(ke),me=x(),Pe=b("div"),bt=I(q),Ct=x(),_t=b("button"),Lt=I(Zt),we=x(),Ot=b("div"),ie=b("div"),Vt=b("div"),nt=b("i"),zt=x(),ht=b("span"),pi=I(Me),gi=x(),It=b("div"),Ye=b("div"),Ni=b("span"),Fe=I(Ci),un=x(),wt=b("span"),Xe.c(),ne=x(),Ue=b("div"),to=b("span"),eo=I(Kn),mr=x(),dn=b("span"),qe.c(),br=x(),Wi=b("div"),ji=b("div"),io=b("i"),_r=x(),no=b("span"),so=I(Gn),yr=x(),oo=b("div"),ro=b("canvas"),vr=x(),Hi=b("div"),Vi=b("div"),$i=b("div"),lo=b("i"),xr=x(),Qn=b("span"),ao=I(Zn),wr=x(),Jn=b("div"),ts=b("span"),co=I(es),kr=x(),fn=b("div"),Ke.c(),Mr=x(),Yi=b("div"),Ui=b("div"),Xi=b("div"),uo=b("i"),Sr=x(),is=b("span"),fo=I(ns),Dr=x(),ss=b("div"),os=b("span"),ho=I(rs),Ar=x(),hn=b("div"),Ge.c(),Pr=x(),fe&&fe.c(),go=x(),he&&he.c(),h(s,"class","text-xl mb-4 text-blue-200"),h(a,"class","text-3xl font-bold mb-8 text-blue-300"),h(n,"class","mb-8"),h(g,"class","text-2xl mb-4 text-blue-200"),h(M,"class","fa-duotone fa-arrow-right-arrow-left text-4xl mb-2 text-blue-400"),h(S,"class","text-2xl font-bold mb-2 text-blue-200"),h(E,"class","text-sm mb-2 text-gray-400"),h(R,"class","bg-blue-600/10 border border-blue-500 hover:bg-blue-800/50 text-white font-bold py-2 px-4 mt-4 duration-500 rounded-lg cursor-pointer"),h(w,"class","flex flex-col items-center bg-gray-700 rounded-xl p-4 w-[280px]"),h(W,"class","fa-duotone fa-file-invoice-dollar text-4xl mb-2 text-blue-400"),h(D,"class","text-2xl font-bold mb-2 text-blue-200"),h(K,"class","text-sm mb-2 text-gray-400"),h(et,"class","relative -bottom-auto bg-blue-600/10 border border-blue-500 hover:bg-blue-800/50 text-white font-bold py-2 px-8 mt-4 duration-500 rounded-lg cursor-pointer"),h(P,"class","flex flex-col items-center bg-gray-700 rounded-xl p-4 w-[280px]"),h(j,"class","fa-duotone fa-credit-card text-4xl mb-2 text-blue-400"),h(kt,"class","text-2xl font-bold mb-2 text-blue-200"),h(Jt,"class","text-sm mb-2 text-gray-400"),h(Mt,"class","bg-blue-600/10 border border-blue-500 hover:bg-blue-800/50 text-white font-bold py-2 px-4 mt-4 duration-500 rounded-lg cursor-pointer"),h(U,"class","flex flex-col items-center bg-gray-700 rounded-xl p-4 w-[280px]"),h(de,"class","fa-duotone fa-piggy-bank text-4xl mb-2 text-blue-400"),h(Ae,"class","text-2xl font-bold mb-2 text-blue-200"),h(Pe,"class","text-sm mb-2 text-gray-400"),h(_t,"class","bg-blue-600/10 border border-blue-500 hover:bg-blue-800/50 text-white font-bold py-2 px-4 mt-4 duration-500 rounded-lg cursor-pointer"),h(ue,"class","flex flex-col items-center bg-gray-700 rounded-xl p-4 w-[280px]"),h(v,"class","flex space-x-4"),h(p,"class","mb-2"),h(nt,"class","fa-duotone fa-calendar-week text-2xl text-blue-400 mr-2"),h(ht,"class","text-blue-200 font-bold text-xl"),h(Vt,"class","flex items-center mb-4"),h(wt,"class","text-blue-400"),h(Ye,"class","flex justify-between border-b border-gray-600 pb-2"),h(dn,"class","text-red-400"),h(Ue,"class","flex justify-between border-b border-gray-600 pb-2"),h(io,"class","fa-duotone fa-chart-bar text-xl text-blue-400 mr-2"),h(ji,"class","flex items-center mb-2"),h(Wi,"class","mt-6"),h(It,"class","space-y-4 border border-dashed border-blue-400 rounded-lg p-4"),h(ie,"class","bg-gray-700 rounded-xl p-6 w-[380px] h-[400px] flex-none"),h(lo,"class","fa-duotone fa-file-invoice text-2xl text-blue-400 mr-2"),h(Qn,"class","text-blue-200 font-bold text-xl"),h($i,"class","flex items-center"),h(ts,"class","text-white text-sm"),h(Jn,"class","bg-gray-600 rounded-full px-2 py-1"),h(Vi,"class","flex justify-between items-center mb-4"),h(fn,"class","space-y-3 border border-dashed border-blue-400 rounded-lg p-4 h-[310px]"),h(Hi,"class","bg-gray-700 rounded-xl p-6 w-[380px] h-[400px] flex-none"),h(uo,"class","fa-duotone fa-file-exclamation text-xl text-blue-400 mr-2"),h(is,"class","text-blue-200 font-bold text-lg"),h(Xi,"class","flex items-center"),h(os,"class","text-white text-sm"),h(ss,"class","bg-gray-600 rounded-full px-2 py-1"),h(Ui,"class","flex justify-between items-center mb-2"),h(hn,"class","space-y-0 border border-dashed border-blue-400 p-1 rounded-lg overflow-auto mt-6 h-[310px]"),h(Yi,"class","bg-gray-700 rounded-xl p-4 w-[380px] h-[400px] flex-none"),h(Ot,"class","flex space-x-4 mt-4"),h(e,"class","absolute top-0 left-[240px] w-screen h-screen overflow-hidden p-6 text-white"),h(t,"class","absolute w-full h-full bg-gray-800")},m(ot,St){Q(ot,t,St),u(t,e),u(e,n),u(n,s),u(s,r),u(n,l),u(n,a),u(a,d),u(e,f),u(e,p),u(p,g),u(g,_),u(p,y),u(p,v),u(v,w),u(w,M),u(w,k),u(w,S),u(S,C),u(w,T),u(w,E),u(E,N),u(w,V),u(w,R),u(R,F),u(v,H),u(v,P),u(P,W),u(P,$),u(P,D),u(D,Y),u(P,X),u(P,K),u(K,J),u(P,st),u(P,et),u(et,at),u(v,ut),u(v,U),u(U,j),u(U,lt),u(U,kt),u(kt,Xt),u(U,jt),u(U,Jt),u(Jt,gt),u(U,ft),u(U,Mt),u(Mt,dt),u(v,Ht),u(v,ue),u(ue,de),u(ue,De),u(ue,Ae),u(Ae,_e),u(ue,me),u(ue,Pe),u(Pe,bt),u(ue,Ct),u(ue,_t),u(_t,Lt),u(e,we),u(e,Ot),u(Ot,ie),u(ie,Vt),u(Vt,nt),u(Vt,zt),u(Vt,ht),u(ht,pi),u(ie,gi),u(ie,It),u(It,Ye),u(Ye,Ni),u(Ni,Fe),u(Ye,un),u(Ye,wt),Xe.m(wt,null),u(It,ne),u(It,Ue),u(Ue,to),u(to,eo),u(Ue,mr),u(Ue,dn),qe.m(dn,null),u(It,br),u(It,Wi),u(Wi,ji),u(ji,io),u(ji,_r),u(ji,no),u(no,so),u(Wi,yr),u(Wi,oo),u(oo,ro),i[28](ro),u(Ot,vr),u(Ot,Hi),u(Hi,Vi),u(Vi,$i),u($i,lo),u($i,xr),u($i,Qn),u(Qn,ao),u(Vi,wr),u(Vi,Jn),u(Jn,ts),u(ts,co),u(Hi,kr),u(Hi,fn),Ke.m(fn,null),u(Ot,Mr),u(Ot,Yi),u(Yi,Ui),u(Ui,Xi),u(Xi,uo),u(Xi,Sr),u(Xi,is),u(is,fo),u(Ui,Dr),u(Ui,ss),u(ss,os),u(os,ho),u(Yi,Ar),u(Yi,hn),Ge.m(hn,null),u(t,Pr),fe&&fe.m(t,null),u(t,go),he&&he.m(t,null),mo||(Cr=[tt(R,"click",i[18]),tt(et,"click",i[25]),tt(Mt,"click",i[26]),tt(_t,"click",i[27])],mo=!0)},p(ot,St){St[0]&32&&o!==(o=ot[5].total_balance+"")&&z(r,o),St[0]&66&&c!==(c=ot[1].toLocaleString(ot[6].lang,{style:"currency",currency:ot[6].currency,minimumFractionDigits:0})+"")&&z(d,c),St[0]&32&&m!==(m=ot[5].quick_actions+"")&&z(_,m),St[0]&32&&L!==(L=ot[5].transfer_money+"")&&z(C,L),St[0]&32&&O!==(O=ot[5].easy_transfer+"")&&z(N,O),St[0]&32&&B!==(B=ot[5].transfer+"")&&z(F,B),St[0]&32&&A!==(A=ot[5].pay_bills+"")&&z(Y,A),St[0]&32&&Z!==(Z=ot[5].pay_pending_bills+"")&&z(J,Z),St[0]&32&&vt!==(vt=ot[5].pay+"")&&z(at,vt),St[0]&32&&mt!==(mt=ot[5].withdraw_all_money+"")&&z(Xt,mt),St[0]&32&&Et!==(Et=ot[5].withdraw_all_from_account+"")&&z(gt,Et),St[0]&32&&Qt!==(Qt=ot[5].withdraw+"")&&z(dt,Qt),St[0]&32&&ke!==(ke=ot[5].deposit_cash+"")&&z(_e,ke),St[0]&32&&q!==(q=ot[5].deposit_all_cash+"")&&z(bt,q),St[0]&32&&Zt!==(Zt=ot[5].deposit+"")&&z(Lt,Zt),St[0]&32&&Me!==(Me=ot[5].weekly_summary+"")&&z(pi,Me),St[0]&32&&Ci!==(Ci=ot[5].income+"")&&z(Fe,Ci),ls===(ls=Lr(ot))&&Xe?Xe.p(ot,St):(Xe.d(1),Xe=ls(ot),Xe&&(Xe.c(),Xe.m(wt,null))),St[0]&32&&Kn!==(Kn=ot[5].expenses+"")&&z(eo,Kn),as===(as=Tr(ot))&&qe?qe.p(ot,St):(qe.d(1),qe=as(ot),qe&&(qe.c(),qe.m(dn,null))),St[0]&32&&Gn!==(Gn=ot[5].report+"")&&z(so,Gn),St[0]&32&&Zn!==(Zn=ot[5].latest_transactions+"")&&z(ao,Zn),St[0]&16&&es!==(es=ot[4].transactions.length+"")&&z(co,es),cs===(cs=Or(ot))&&Ke?Ke.p(ot,St):(Ke.d(1),Ke=cs(ot),Ke&&(Ke.c(),Ke.m(fn,null))),St[0]&32&&ns!==(ns=ot[5].unpaid_bills+"")&&z(fo,ns),St[0]&256&&rs!==(rs=ot[8].length+"")&&z(ho,rs),us===(us=Rr(ot))&&Ge?Ge.p(ot,St):(Ge.d(1),Ge=us(ot),Ge&&(Ge.c(),Ge.m(hn,null))),ot[9]?fe?(fe.p(ot,St),St[0]&512&&rt(fe,1)):(fe=ca(ot),fe.c(),rt(fe,1),fe.m(t,go)):fe&&(le(),pt(fe,1,1,()=>{fe=null}),ae()),ot[11]?he?(he.p(ot,St),St[0]&2048&&rt(he,1)):(he=fa(ot),he.c(),rt(he,1),he.m(t,null)):he&&(le(),pt(he,1,1,()=>{he=null}),ae())},i(ot){ot&&(po||Wt(()=>{po=ee(e,He,{duration:1e3,easing:Tt}),po.start()})),rt(fe),rt(he)},o(ot){pt(fe),pt(he)},d(ot){ot&&G(t),Xe.d(),qe.d(),i[28](null),Ke.d(),Ge.d(),fe&&fe.d(),he&&he.d(),mo=!1,Ut(Cr)}}}function Cg(i,t,e){let n,s,o,r,l,a,c,d,f,p;it(i,Be,j=>e(5,n=j)),it(i,fi,j=>e(0,s=j)),it(i,ni,j=>e(1,o=j)),it(i,zo,j=>e(24,r=j)),it(i,Ai,j=>e(6,l=j));let g=Ls;it(i,g,j=>e(8,c=j));let m=!1,_=ct(!1);it(i,_,j=>e(11,p=j));let y=ct(!1);it(i,y,j=>e(9,d=j));let v=ct({idOrPhone:"",amount:0,confirm:!1,contactType:"none"});it(i,v,j=>e(10,f=j));let w=ct({totalReceived:0,totalUsed:0});it(i,w,j=>e(7,a=j));let M,k;async function S(){try{const j=await Dt("ps-banking:client:getWeeklySummary",{});j&&w.set(j)}catch(j){console.error(j)}}async function L(){try{const j=await Dt("ps-banking:client:getMoneyTypes",{}),lt=j.find(mt=>mt.name==="bank"),kt=j.find(mt=>mt.name==="cash");lt&&ni.set(lt.amount),kt&&fi.set(kt.amount)}catch(j){console.error(j)}}async function C(){await Dt("ps-banking:client:payAllBills",{})?(await O(),yt(n.pay_all_bills_success,n.payment_completed,"money-bill")):yt(n.pay_all_bills_error,n.error,"circle-exclamation")}function T(){y.set(!0)}function E(){y.set(!1),v.set({idOrPhone:"",amount:0,confirm:!1,contactType:"none"})}async function O(){try{const j=await Dt("ps-banking:client:getBills",{});Ls.set(j)}catch(j){console.error(j)}}async function N(){try{const j=await Dt("ps-banking:client:getHistory",{});zo.set(j)}catch(j){console.error(j)}}async function V(j,lt,kt){try{const mt=await Dt("ps-banking:client:transferMoney",{id:j,amount:lt,method:kt});mt.success?yt(mt.message,n.payment_completed,"user"):yt(mt.message,n.error,"user")}catch(mt){console.error(mt)}v.update(mt=>(mt.confirm=!0,mt)),y.set(!1),v.set({idOrPhone:"",amount:0,confirm:!1,contactType:"none"})}let R={balance:o,cash:s,transactions:r};async function B(){try{await Dt("ps-banking:client:ATMwithdraw",{amount:o})&&P()}catch(j){console.error(j)}}async function F(){try{await Dt("ps-banking:client:ATMdeposit",{amount:s})&&P()}catch(j){console.error(j)}}function H(){k&&e(23,M=new ln(k,{type:"bar",data:{labels:[n.income,n.expenses],datasets:[{label:n.weekly_summary,data:[0,0],backgroundColor:["#3b82f6","#ef4444"]}]},options:{responsive:!0,scales:{y:{beginAtZero:!0}}}}))}async function P(){await O(),await N(),await S(),await L()}async function W(){try{const j=await Dt("ps-banking:client:phoneOption",{});e(2,m=j)}catch(j){console.error(j)}}Di(async()=>{H(),P(),P(),W()});const $=[[]],D=()=>{_.set(!0)},A=()=>{o<=0?yt(n.no_money_on_account,n.error,"credit-card"):(yt(n.withdraw_all_success,n.success,"credit-card"),setTimeout(()=>{B()},200))},Y=()=>{s<=0?yt(n.no_cash_on_you,n.error,"coins"):(yt(n.deposit_all_success,n.success,"coins"),setTimeout(()=>{F()},200))};function X(j){Fo[j?"unshift":"push"](()=>{k=j,e(3,k)})}const K=()=>{Ze.set(!1),Je.set(!1),ti.set(!0),ei.set(!1)},Z=()=>{Ze.set(!1),Je.set(!0),ti.set(!1),ei.set(!1)};function J(){f.contactType=this.__value,v.set(f)}function st(){f.contactType=this.__value,v.set(f)}function et(){f.idOrPhone=ge(this.value),v.set(f)}function vt(){f.amount=ge(this.value),v.set(f)}const at=async()=>{V(f.idOrPhone,f.amount,f.contactType)},ut=()=>{_.set(!1)},U=async()=>{c.length>0?(await C(),_.set(!1)):(_.set(!1),yt(n.pay_all_bills_error,n.error,"circle-exclamation"))};return i.$$.update=()=>{i.$$.dirty[0]&16777219&&e(4,R={balance:o,cash:s,transactions:r}),i.$$.dirty[0]&8388608&&w.subscribe(j=>{M&&(e(23,M.data.datasets[0].data=[j.totalReceived,j.totalUsed],M),M.update())})},[s,o,m,k,R,n,l,a,c,d,f,p,g,_,y,v,w,C,T,E,V,B,F,M,r,D,A,Y,X,K,Z,J,$,st,et,vt,at,ut,U]}class Lg extends je{constructor(t){super(),We(this,t,Cg,Pg,Ee,{},null,[-1,-1])}}function ha(i,t,e){const n=i.slice();return n[10]=t[e],n}function pa(i){let t,e,n,s=i[3].pay_invoice+"",o,r,l;function a(){return i[9](i[10])}return{c(){t=b("button"),e=b("i"),n=x(),o=I(s),h(e,"class","fa-duotone fa-money-check-edit text-lg mr-2"),h(t,"class","bg-blue-600/10 border border-blue-500 hover:bg-blue-800/50 text-white font-bold py-2 px-4 rounded-lg flex items-center transition-colors duration-300")},m(c,d){Q(c,t,d),u(t,e),u(t,n),u(t,o),r||(l=tt(t,"click",a),r=!0)},p(c,d){i=c,d&8&&s!==(s=i[3].pay_invoice+"")&&z(o,s)},d(c){c&&G(t),r=!1,l()}}}function ga(i,t){let e,n,s,o,r,l,a=t[10].description+"",c,d,f=t[10].id+"",p,g,m,_,y,v,w=t[10].type+"",M,k,S,L,C,T,E=ma(t[10].date)+"",O,N,V,R,B,F,H=t[10].isIncome?"+":"-",P,W,$=t[10].amount.toLocaleString(t[4].lang,{style:"currency",currency:t[4].currency,minimumFractionDigits:0})+"",D,A,Y,X,K,Z,J=!t[10].isPaid&&pa(t);return{key:i,first:null,c(){e=b("div"),n=b("div"),s=b("div"),o=b("i"),r=x(),l=b("span"),c=I(a),d=I(" #"),p=I(f),g=x(),m=b("div"),_=b("i"),y=x(),v=b("span"),M=I(w),k=x(),S=b("div"),L=b("i"),C=x(),T=b("span"),O=I(E),N=x(),V=b("div"),R=b("span"),B=b("i"),F=x(),P=I(H),W=x(),D=I($),Y=x(),J&&J.c(),X=x(),h(o,"class","fa-duotone fa-file-invoice text-2xl text-[#f1f5f9]"),h(l,"class","font-semibold text-[#f1f5f9]"),h(s,"class","flex items-center space-x-2"),h(_,"class","fa-duotone fa-user text-sm text-gray-400"),h(v,"class","text-sm text-gray-400"),h(m,"class","flex items-center space-x-2"),h(L,"class","fa-duotone fa-clock text-xs text-gray-500"),h(T,"class","text-xs text-gray-500"),h(S,"class","flex items-center space-x-2"),h(n,"class","flex flex-col space-y-1"),h(B,"class","fa-duotone fa-coins text-lg text-gray-400 mr-2"),h(R,"class",A=`text-lg font-bold ${t[10].isIncome?"text-green-500":"text-red-500"}`),h(V,"class","text-right flex flex-col items-end space-y-1"),h(e,"class","p-4 bg-[#334155] rounded-lg flex justify-between items-center"),this.first=e},m(st,et){Q(st,e,et),u(e,n),u(n,s),u(s,o),u(s,r),u(s,l),u(l,c),u(l,d),u(l,p),u(n,g),u(n,m),u(m,_),u(m,y),u(m,v),u(v,M),u(n,k),u(n,S),u(S,L),u(S,C),u(S,T),u(T,O),u(e,N),u(e,V),u(V,R),u(R,B),u(R,F),u(R,P),u(R,W),u(R,D),u(V,Y),J&&J.m(V,null),u(e,X),Z=!0},p(st,et){t=st,(!Z||et&4)&&a!==(a=t[10].description+"")&&z(c,a),(!Z||et&4)&&f!==(f=t[10].id+"")&&z(p,f),(!Z||et&4)&&w!==(w=t[10].type+"")&&z(M,w),(!Z||et&4)&&E!==(E=ma(t[10].date)+"")&&z(O,E),(!Z||et&4)&&H!==(H=t[10].isIncome?"+":"-")&&z(P,H),(!Z||et&20)&&$!==($=t[10].amount.toLocaleString(t[4].lang,{style:"currency",currency:t[4].currency,minimumFractionDigits:0})+"")&&z(D,$),(!Z||et&4&&A!==(A=`text-lg font-bold ${t[10].isIncome?"text-green-500":"text-red-500"}`))&&h(R,"class",A),t[10].isPaid?J&&(J.d(1),J=null):J?J.p(t,et):(J=pa(t),J.c(),J.m(V,null))},i(st){Z||(K&&K.end(1),Z=!0)},o(st){st&&(K=be(e,He,{duration:1e3,easing:Tt})),Z=!1},d(st){st&&G(e),J&&J.d(),st&&K&&K.end()}}}function Tg(i){let t,e,n,s,o,r,l,a,c=i[3].bills+"",d,f,p,g,m,_,y=i[3].total+"",v,w,M,k=i[1].length+"",S,L,C,T,E,O,N,V,R,B=[],F=new Map,H,P,W,$,D=oe(i[2]);const A=Y=>Y[10].id;for(let Y=0;Y<D.length;Y+=1){let X=ha(i,D,Y),K=A(X);F.set(K,B[Y]=ga(K,X))}return{c(){t=b("div"),e=b("div"),n=b("div"),s=b("div"),o=b("div"),r=b("i"),l=x(),a=b("h2"),d=I(c),f=x(),p=b("div"),g=b("i"),m=x(),_=b("span"),v=I(y),w=x(),M=b("span"),S=I(k),L=x(),C=b("div"),T=b("i"),E=x(),O=b("input"),V=x(),R=b("div");for(let Y=0;Y<B.length;Y+=1)B[Y].c();h(r,"class","fa-duotone fa-list text-3xl text-blue-200 mr-3"),h(a,"class","text-3xl font-bold text-blue-200"),h(o,"class","flex items-center"),h(g,"class","fa-duotone fa-file-invoice-dollar text-gray-400 mr-2"),h(_,"class","text-sm text-gray-400 mr-2"),h(M,"class","text-lg font-semibold text-white"),h(p,"class","bg-[#334155] rounded-full px-3 py-1 flex items-center"),h(s,"class","flex justify-between items-center mb-6"),h(T,"class","fa-duotone fa-search absolute left-4 top-4 text-gray-400"),h(O,"type","text"),h(O,"class","w-full bg-gray-800 text-white pl-10 pr-4 py-3 rounded-lg border border-blue-200/10 focus:outline-none focus:border-blue-400/50 transition-colors duration-500 placeholder-gray-500"),h(O,"placeholder",N=i[3].search_transactions),h(C,"class","relative mb-6"),h(R,"class","space-y-6"),h(n,"class","bg-gray-800/50 p-8 rounded-lg shadow-lg border border-blue-200/5"),h(e,"class","absolute w-[90%] h-full p-6 overflow-auto left-[130px]"),h(t,"class","absolute w-full h-full bg-gray-800 text-white")},m(Y,X){Q(Y,t,X),u(t,e),u(e,n),u(n,s),u(s,o),u(o,r),u(o,l),u(o,a),u(a,d),u(s,f),u(s,p),u(p,g),u(p,m),u(p,_),u(_,v),u(p,w),u(p,M),u(M,S),u(n,L),u(n,C),u(C,T),u(C,E),u(C,O),Ft(O,i[0]),u(n,V),u(n,R);for(let K=0;K<B.length;K+=1)B[K]&&B[K].m(R,null);P=!0,W||($=tt(O,"input",i[8]),W=!0)},p(Y,[X]){(!P||X&8)&&c!==(c=Y[3].bills+"")&&z(d,c),(!P||X&8)&&y!==(y=Y[3].total+"")&&z(v,y),(!P||X&2)&&k!==(k=Y[1].length+"")&&z(S,k),(!P||X&8&&N!==(N=Y[3].search_transactions))&&h(O,"placeholder",N),X&1&&O.value!==Y[0]&&Ft(O,Y[0]),X&156&&(D=oe(Y[2]),le(),B=an(B,X,A,1,Y,D,F,R,jn,ga,null,ha),ae())},i(Y){if(!P){for(let X=0;X<D.length;X+=1)rt(B[X]);Y&&(H||Wt(()=>{H=ee(e,He,{duration:1e3,easing:Tt}),H.start()})),P=!0}},o(Y){for(let X=0;X<B.length;X+=1)pt(B[X]);P=!1},d(Y){Y&&G(t);for(let X=0;X<B.length;X+=1)B[X].d();W=!1,$()}}}function ma(i){const t={year:"numeric",month:"numeric",day:"numeric"};return new Date(i).toLocaleDateString(void 0,t)}function Og(i,t,e){let n,s,o,r,l;it(i,Be,g=>e(3,s=g)),it(i,Ai,g=>e(4,l=g));let a=Ls;it(i,a,g=>e(1,r=g));let c=ct("");it(i,c,g=>e(0,o=g));async function d(g){try{return await Dt("ps-banking:client:payBill",{id:g.id})?(yt(`${s.pay_invoice} #${g.id} ${s.from} ${g.type}`,s.payment_completed,"coins"),a.update(_=>{const y=_.findIndex(v=>g.id===v.id);return y!==-1&&_.splice(y,1),_}),!0):(yt(`${s.no_money_on_account}`,`${s.error}`,"coins"),!1)}catch(m){return console.error(m),!1}}Di(async()=>{try{const g=await Dt("ps-banking:client:getBills",{});Ls.set(g)}catch(g){console.error(g)}});function f(){o=this.value,c.set(o)}const p=g=>{d(g)};return i.$$.update=()=>{i.$$.dirty&3&&e(2,n=r.filter(g=>g.description.toLowerCase().includes(o.toLowerCase())||g.type.toLowerCase().includes(o.toLowerCase())))},[o,r,n,s,l,a,c,d,f,p]}class Rg extends je{constructor(t){super(),We(this,t,Og,Tg,Ee,{})}}function ba(i,t,e){const n=i.slice();return n[13]=t[e],n}function _a(i,t){let e,n,s,o,r,l,a,c,d,f,p,g=t[13].description+"",m,_,y=t[13].id+"",v,w,M,k,S,L,C=t[13].type+"",T,E,O,N,V,R,B=va(t[13].date)+"",F,H,P,W,$,D,A,Y=t[13].isIncome?"+":"-",X,K,Z=t[13].amount.toLocaleString(t[3].lang,{style:"currency",currency:t[3].currency,minimumFractionDigits:0})+"",J,st,et,vt,at;return{key:i,first:null,c(){e=b("div"),n=b("div"),s=b("div"),o=b("i"),l=x(),a=b("div"),c=b("div"),d=b("i"),f=x(),p=b("p"),m=I(g),_=I(" #"),v=I(y),w=x(),M=b("div"),k=b("i"),S=x(),L=b("p"),T=I(C),E=x(),O=b("div"),N=b("i"),V=x(),R=b("p"),F=I(B),H=x(),P=b("div"),W=b("div"),$=b("i"),D=x(),A=b("p"),X=I(Y),K=x(),J=I(Z),et=x(),h(o,"class",r=`fa-duotone ${t[13].isIncome?"fa-arrow-down-to-arc":"fa-arrow-up-from-arc"} text-xl mr-3 ${t[13].isIncome?"text-green-400":"text-red-400"}`),h(d,"class","fa-duotone fa-file-invoice text-lg text-gray-300 mr-2"),h(p,"class","text-lg font-bold"),h(c,"class","flex items-center"),h(k,"class","fa-duotone fa-exchange-alt text-sm text-gray-400 mr-2"),h(L,"class","text-sm text-gray-400"),h(M,"class","flex items-center"),h(N,"class","fa-duotone fa-clock text-xs text-gray-500 mr-2"),h(R,"class","text-xs text-gray-500"),h(O,"class","flex items-center"),h(s,"class","flex items-center"),h($,"class","fa-duotone fa-coins text-lg text-gray-400 mr-2"),h(A,"class",st=`text-lg font-bold ${t[13].isIncome?"text-green-500":"text-red-500"}`),h(W,"class","flex items-center"),h(P,"class","text-right"),h(n,"class","flex justify-between items-center"),h(e,"class","bg-[#334155] p-4 rounded-lg shadow-md transition duration-300 border border-blue-200/5"),this.first=e},m(ut,U){Q(ut,e,U),u(e,n),u(n,s),u(s,o),u(s,l),u(s,a),u(a,c),u(c,d),u(c,f),u(c,p),u(p,m),u(p,_),u(p,v),u(a,w),u(a,M),u(M,k),u(M,S),u(M,L),u(L,T),u(a,E),u(a,O),u(O,N),u(O,V),u(O,R),u(R,F),u(n,H),u(n,P),u(P,W),u(W,$),u(W,D),u(W,A),u(A,X),u(A,K),u(A,J),u(e,et),at=!0},p(ut,U){t=ut,(!at||U&2&&r!==(r=`fa-duotone ${t[13].isIncome?"fa-arrow-down-to-arc":"fa-arrow-up-from-arc"} text-xl mr-3 ${t[13].isIncome?"text-green-400":"text-red-400"}`))&&h(o,"class",r),(!at||U&2)&&g!==(g=t[13].description+"")&&z(m,g),(!at||U&2)&&y!==(y=t[13].id+"")&&z(v,y),(!at||U&2)&&C!==(C=t[13].type+"")&&z(T,C),(!at||U&2)&&B!==(B=va(t[13].date)+"")&&z(F,B),(!at||U&2)&&Y!==(Y=t[13].isIncome?"+":"-")&&z(X,Y),(!at||U&10)&&Z!==(Z=t[13].amount.toLocaleString(t[3].lang,{style:"currency",currency:t[3].currency,minimumFractionDigits:0})+"")&&z(J,Z),(!at||U&2&&st!==(st=`text-lg font-bold ${t[13].isIncome?"text-green-500":"text-red-500"}`))&&h(A,"class",st)},i(ut){at||(vt&&vt.end(1),at=!0)},o(ut){ut&&(vt=be(e,He,{duration:500})),at=!1},d(ut){ut&&G(e),ut&&vt&&vt.end()}}}function ya(i){let t,e,n,s,o,r,l=i[2].are_you_sure+"",a,c,d,f=i[2].delete_confirmation+"",p,g,m,_,y,v=i[2].cancel+"",w,M,k,S,L=i[2].confirm+"",C,T,E,O,N,V;return{c(){t=b("div"),e=b("div"),n=b("div"),s=b("i"),o=x(),r=b("h2"),a=I(l),c=x(),d=b("p"),p=I(f),g=x(),m=b("div"),_=b("button"),y=b("i"),w=I(v),M=x(),k=b("button"),S=b("i"),C=I(L),h(s,"class","fa-duotone fa-question-circle text-3xl text-blue-400 mr-3"),h(r,"class","text-2xl text-blue-200 font-bold"),h(n,"class","flex items-center mb-4"),h(d,"class","text-gray-300 mb-6"),h(y,"class","fa-duotone fa-times-circle mr-2"),h(_,"class","flex items-center bg-red-600 hover:bg-red-700 text-white py-2 px-4 rounded focus:outline-none"),h(S,"class","fa-duotone fa-check-circle mr-2"),h(k,"class","flex items-center bg-blue-600 hover:bg-blue-700 text-white py-2 px-4 rounded focus:outline-none"),h(m,"class","flex justify-between items-center"),h(e,"class","bg-gray-700 p-8 rounded-lg shadow-lg w-96"),h(t,"class","fixed inset-0 flex items-center justify-center bg-black bg-opacity-50")},m(R,B){Q(R,t,B),u(t,e),u(e,n),u(n,s),u(n,o),u(n,r),u(r,a),u(e,c),u(e,d),u(d,p),u(e,g),u(e,m),u(m,_),u(_,y),u(_,w),u(m,M),u(m,k),u(k,S),u(k,C),O=!0,N||(V=[tt(_,"click",i[12]),tt(k,"click",i[9])],N=!0)},p(R,B){(!O||B&4)&&l!==(l=R[2].are_you_sure+"")&&z(a,l),(!O||B&4)&&f!==(f=R[2].delete_confirmation+"")&&z(p,f),(!O||B&4)&&v!==(v=R[2].cancel+"")&&z(w,v),(!O||B&4)&&L!==(L=R[2].confirm+"")&&z(C,L)},i(R){O||(R&&Wt(()=>{O&&(E&&E.end(1),T=ee(e,Kt,{duration:250,easing:Tt}),T.start())}),O=!0)},o(R){T&&T.invalidate(),R&&(E=be(e,Kt,{duration:250,easing:Tt})),O=!1},d(R){R&&G(t),R&&E&&E.end(),N=!1,Ut(V)}}}function Eg(i){let t,e,n,s,o,r,l,a=i[2].history+"",c,d,f,p,g,m,_,y=i[2].total+"",v,w,M,k,S,L,C=i[1].length+"",T,E,O,N,V=i[2].delete_all_transactions+"",R,B,F,H,P,W,$,D,A,Y=[],X=new Map,K,Z,J,st,et,vt,at=oe(i[1]);const ut=j=>j[13].id;for(let j=0;j<at.length;j+=1){let lt=ba(i,at,j),kt=ut(lt);X.set(kt,Y[j]=_a(kt,lt))}let U=i[4]&&ya(i);return{c(){t=b("div"),e=b("div"),n=b("div"),s=b("div"),o=b("i"),r=x(),l=b("h2"),c=I(a),d=x(),f=b("div"),p=b("div"),g=b("i"),m=x(),_=b("span"),v=I(y),w=x(),M=b("div"),k=b("i"),S=x(),L=b("span"),T=I(C),E=x(),O=b("button"),N=b("i"),R=I(V),B=x(),F=b("div"),H=b("i"),P=x(),W=b("input"),D=x(),A=b("div");for(let j=0;j<Y.length;j+=1)Y[j].c();Z=x(),U&&U.c(),J=Ds(),h(o,"class","fa-duotone fa-list text-2xl text-blue-400 mr-3"),h(l,"class","text-2xl font-bold"),h(s,"class","flex items-center mb-4"),h(g,"class","fa-duotone fa-wallet text-xl text-gray-400 mr-2"),h(_,"class","text-gray-400"),h(p,"class","flex items-center"),h(k,"class","fa-duotone fa-receipt text-xl text-gray-400 mr-2"),h(L,"class","text-xl text-white font-semibold"),h(M,"class","absolute right-16 top-10"),h(N,"class","fa-duotone fa-trash-alt mr-2"),h(O,"class","bg-gray-700/50 text-blue-200 py-2 px-4 rounded-lg flex items-center hover:bg-gray-500/50 transition duration-500 border border-gray-500/20"),h(f,"class","flex justify-between items-center mb-4"),h(H,"class","fa-duotone fa-search absolute left-4 top-4 text-gray-400"),h(W,"type","text"),h(W,"class","w-full rounded bg-gray-700/50 text-white pl-10 pr-4 py-3 border border-blue-200/10 rounded-lg focus:outline-none focus:border-blue-400/50 transition-colors duration-500"),h(W,"placeholder",$=i[2].search_transactions),h(F,"class","relative mb-6"),h(A,"class","space-y-4"),h(n,"class","bg-gray-800/50 p-8 rounded-lg shadow-lg border border-blue-200/5"),h(e,"class","absolute w-[90%] h-full p-6 overflow-auto left-[130px] text-blue-200"),h(t,"class","absolute w-full h-full bg-gray-800")},m(j,lt){Q(j,t,lt),u(t,e),u(e,n),u(n,s),u(s,o),u(s,r),u(s,l),u(l,c),u(n,d),u(n,f),u(f,p),u(p,g),u(p,m),u(p,_),u(_,v),u(f,w),u(f,M),u(M,k),u(M,S),u(M,L),u(L,T),u(f,E),u(f,O),u(O,N),u(O,R),u(n,B),u(n,F),u(F,H),u(F,P),u(F,W),Ft(W,i[0]),u(n,D),u(n,A);for(let kt=0;kt<Y.length;kt+=1)Y[kt]&&Y[kt].m(A,null);Q(j,Z,lt),U&&U.m(j,lt),Q(j,J,lt),st=!0,et||(vt=[tt(O,"click",i[8]),tt(W,"input",i[11])],et=!0)},p(j,[lt]){(!st||lt&4)&&a!==(a=j[2].history+"")&&z(c,a),(!st||lt&4)&&y!==(y=j[2].total+"")&&z(v,y),(!st||lt&2)&&C!==(C=j[1].length+"")&&z(T,C),(!st||lt&4)&&V!==(V=j[2].delete_all_transactions+"")&&z(R,V),(!st||lt&4&&$!==($=j[2].search_transactions))&&h(W,"placeholder",$),lt&1&&W.value!==j[0]&&Ft(W,j[0]),lt&10&&(at=oe(j[1]),le(),Y=an(Y,lt,ut,1,j,at,X,A,jn,_a,null,ba),ae()),j[4]?U?(U.p(j,lt),lt&16&&rt(U,1)):(U=ya(j),U.c(),rt(U,1),U.m(J.parentNode,J)):U&&(le(),pt(U,1,1,()=>{U=null}),ae())},i(j){if(!st){for(let lt=0;lt<at.length;lt+=1)rt(Y[lt]);j&&(K||Wt(()=>{K=ee(e,He,{duration:1e3,easing:Tt}),K.start()})),rt(U),st=!0}},o(j){for(let lt=0;lt<Y.length;lt+=1)pt(Y[lt]);pt(U),st=!1},d(j){j&&(G(t),G(Z),G(J));for(let lt=0;lt<Y.length;lt+=1)Y[lt].d();U&&U.d(j),et=!1,Ut(vt)}}}function va(i){const t={year:"numeric",month:"numeric",day:"numeric"};return new Date(i).toLocaleDateString(void 0,t)}function Fg(i,t,e){let n,s,o,r,l,a;it(i,Be,y=>e(2,s=y)),it(i,Ai,y=>e(3,l=y));let c=zo;it(i,c,y=>e(10,o=y));let d=ct("");it(i,d,y=>e(0,r=y));let f=ct(!1);it(i,f,y=>e(4,a=y));function p(){f.set(!0)}async function g(){if(o.length===0)yt(s.history_empty,s.error,"file-invoice"),f.set(!1);else{c.set([]),f.set(!1),yt(s.all_history_deleted,s.success,"file-invoice");try{const y=await Dt("ps-banking:client:deleteHistory",{});c.set([])}catch(y){console.error(y)}}}Di(async()=>{try{const y=await Dt("ps-banking:client:getHistory",{});c.set(y)}catch(y){console.error(y)}});function m(){r=this.value,d.set(r)}const _=()=>f.set(!1);return i.$$.update=()=>{i.$$.dirty&1025&&e(1,n=o.filter(y=>y.description.toLowerCase().includes(r.toLowerCase())||y.type.toLowerCase().includes(r.toLowerCase())))},[r,n,s,l,a,c,d,f,p,g,o,m,_]}class Ig extends je{constructor(t){super(),We(this,t,Fg,Eg,Ee,{})}}function Bg(i){let t,e,n,s,o=i[3].withdraw+"",r,l,a,c,d=i[3].bank_balance+"",f,p,g,m,_,y=i[1].toLocaleString(i[4].lang,{style:"currency",currency:i[4].currency,minimumFractionDigits:0})+"",v,w,M,k,S=i[3].amount+"",L,C,T,E,O,N,V,R,B,F=i[3].new_bank+"",H,P,W,$,D,A=i[2].toLocaleString(i[4].lang,{style:"currency",currency:i[4].currency,minimumFractionDigits:0})+"",Y,X,K,Z,J,st=i[3].withdraw_button+"",et,vt,at,ut;return{c(){t=b("div"),e=b("div"),n=b("div"),s=b("h2"),r=I(o),l=x(),a=b("div"),c=b("label"),f=I(d),p=x(),g=b("div"),m=b("i"),_=x(),v=I(y),w=x(),M=b("div"),k=b("label"),L=I(S),C=x(),T=b("div"),E=b("i"),O=x(),N=b("input"),V=x(),R=b("div"),B=b("label"),H=I(F),P=x(),W=b("div"),$=b("i"),D=x(),Y=I(A),X=x(),K=b("button"),Z=b("i"),J=x(),et=I(st),h(s,"class","text-3xl font-bold mb-6"),h(c,"class","block text-blue-200 mb-1"),h(m,"class","fa-duotone fa-university text-gray-400 mr-2"),h(g,"class","flex items-center text-2xl font-semibold"),h(a,"class","mb-12"),h(k,"class","block text-blue-200 mb-1"),h(E,"class","fa-duotone fa-money-bill-wave absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"),h(N,"type","number"),h(N,"class","w-full rounded bg-gray-700/50 text-white pl-10 pr-4 py-3 border border-blue-200/10 rounded-lg focus:outline-none focus:border-blue-400/50 transition-colors duration-500"),h(T,"class","relative"),h(M,"class","mb-12"),h(B,"class","block text-blue-200 mb-1"),h($,"class","fa-duotone fa-coins text-gray-400 mr-2"),h(W,"class","flex items-center text-2xl font-semibold"),h(R,"class","mb-12"),h(Z,"class","fa-duotone fa-money-check-edit text-lg mr-2"),h(K,"class","w-full bg-blue-600/10 hover:bg-blue-700/10 text-white font-bold py-3 rounded transition duration-300 flex items-center justify-center border border-blue-500/50"),h(n,"class","bg-gray-800/50 p-8 rounded-lg shadow-lg border border-blue-200/5"),h(e,"class","absolute w-[90%] h-full p-6 overflow-auto left-[130px]"),h(t,"class","absolute w-full h-full bg-gray-800 text-white")},m(U,j){Q(U,t,j),u(t,e),u(e,n),u(n,s),u(s,r),u(n,l),u(n,a),u(a,c),u(c,f),u(a,p),u(a,g),u(g,m),u(g,_),u(g,v),u(n,w),u(n,M),u(M,k),u(k,L),u(M,C),u(M,T),u(T,E),u(T,O),u(T,N),Ft(N,i[0]),u(n,V),u(n,R),u(R,B),u(B,H),u(R,P),u(R,W),u(W,$),u(W,D),u(W,Y),u(n,X),u(n,K),u(K,Z),u(K,J),u(K,et),at||(ut=[tt(N,"input",i[7]),tt(K,"click",i[6])],at=!0)},p(U,[j]){j&8&&o!==(o=U[3].withdraw+"")&&z(r,o),j&8&&d!==(d=U[3].bank_balance+"")&&z(f,d),j&18&&y!==(y=U[1].toLocaleString(U[4].lang,{style:"currency",currency:U[4].currency,minimumFractionDigits:0})+"")&&z(v,y),j&8&&S!==(S=U[3].amount+"")&&z(L,S),j&1&&ge(N.value)!==U[0]&&Ft(N,U[0]),j&8&&F!==(F=U[3].new_bank+"")&&z(H,F),j&20&&A!==(A=U[2].toLocaleString(U[4].lang,{style:"currency",currency:U[4].currency,minimumFractionDigits:0})+"")&&z(Y,A),j&8&&st!==(st=U[3].withdraw_button+"")&&z(et,st)},i(U){U&&(vt||Wt(()=>{vt=ee(e,He,{duration:1e3,easing:Tt}),vt.start()}))},o:re,d(U){U&&G(t),at=!1,Ut(ut)}}}function zg(i,t,e){let n,s,o,r,l;it(i,Be,f=>e(3,o=f)),it(i,Ai,f=>e(4,r=f)),it(i,ni,f=>e(1,l=f));let a=ct(l);it(i,a,f=>e(0,s=f));async function c(){l<s?yt(`${o.withdraw_error} ${s.toLocaleString(r.lang,{style:"currency",currency:r.currency,minimumFractionDigits:0})}`,o.error,"coins"):(yt(`${o.withdraw_success} ${s.toLocaleString(r.lang,{style:"currency",currency:r.currency,minimumFractionDigits:0})}`,o.withdraw_success,"coins"),await Dt("ps-banking:client:ATMwithdraw",{amount:s}),fi.update(f=>f+s),ni.update(f=>f-s),a.set(0))}function d(){s=ge(this.value),a.set(s)}return i.$$.update=()=>{i.$$.dirty&3&&e(2,n=l-s)},[s,l,n,o,r,a,c,d]}class Ng extends je{constructor(t){super(),We(this,t,zg,Bg,Ee,{})}}function Wg(i){let t,e,n,s,o=i[3].deposit+"",r,l,a,c,d=i[3].current_cash+"",f,p,g,m,_,y=i[1].toLocaleString(i[4].lang,{style:"currency",currency:i[4].currency,minimumFractionDigits:0})+"",v,w,M,k,S=i[3].amount+"",L,C,T,E,O,N,V,R,B,F=i[3].new_cash+"",H,P,W,$,D,A=i[2].toLocaleString(i[4].lang,{style:"currency",currency:i[4].currency,minimumFractionDigits:0})+"",Y,X,K,Z,J,st=i[3].deposit_button+"",et,vt,at,ut;return{c(){t=b("div"),e=b("div"),n=b("div"),s=b("h2"),r=I(o),l=x(),a=b("div"),c=b("label"),f=I(d),p=x(),g=b("div"),m=b("i"),_=x(),v=I(y),w=x(),M=b("div"),k=b("label"),L=I(S),C=x(),T=b("div"),E=b("i"),O=x(),N=b("input"),V=x(),R=b("div"),B=b("label"),H=I(F),P=x(),W=b("div"),$=b("i"),D=x(),Y=I(A),X=x(),K=b("button"),Z=b("i"),J=x(),et=I(st),h(s,"class","text-3xl font-bold mb-6"),h(c,"class","block text-blue-200 mb-1"),h(m,"class","fa-duotone fa-wallet text-gray-400 mr-2"),h(g,"class","flex items-center text-2xl font-semibold"),h(a,"class","mb-12"),h(k,"class","block text-blue-200 mb-1"),h(E,"class","fa-duotone fa-money-bill-wave absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"),h(N,"type","number"),h(N,"class","w-full rounded bg-gray-700/50 text-white pl-10 pr-4 py-3 border border-blue-200/10 rounded-lg focus:outline-none focus:border-blue-400/50 transition-colors duration-500"),h(T,"class","relative"),h(M,"class","mb-12"),h(B,"class","block text-blue-200 mb-1"),h($,"class","fa-duotone fa-coins text-gray-400 mr-2"),h(W,"class","flex items-center text-2xl font-semibold"),h(R,"class","mb-12"),h(Z,"class","fa-duotone fa-money-check-edit text-lg mr-2"),h(K,"class","w-full bg-blue-600/10 hover:bg-blue-700/10 text-white font-bold py-3 rounded transition duration-300 flex items-center justify-center border border-blue-500/50"),h(n,"class","bg-gray-800/50 p-8 rounded-lg shadow-lg border border-blue-200/5"),h(e,"class","absolute w-[90%] h-full p-6 overflow-auto left-[130px]"),h(t,"class","absolute w-full h-full bg-gray-800 text-white")},m(U,j){Q(U,t,j),u(t,e),u(e,n),u(n,s),u(s,r),u(n,l),u(n,a),u(a,c),u(c,f),u(a,p),u(a,g),u(g,m),u(g,_),u(g,v),u(n,w),u(n,M),u(M,k),u(k,L),u(M,C),u(M,T),u(T,E),u(T,O),u(T,N),Ft(N,i[0]),u(n,V),u(n,R),u(R,B),u(B,H),u(R,P),u(R,W),u(W,$),u(W,D),u(W,Y),u(n,X),u(n,K),u(K,Z),u(K,J),u(K,et),at||(ut=[tt(N,"input",i[7]),tt(K,"click",i[6])],at=!0)},p(U,[j]){j&8&&o!==(o=U[3].deposit+"")&&z(r,o),j&8&&d!==(d=U[3].current_cash+"")&&z(f,d),j&18&&y!==(y=U[1].toLocaleString(U[4].lang,{style:"currency",currency:U[4].currency,minimumFractionDigits:0})+"")&&z(v,y),j&8&&S!==(S=U[3].amount+"")&&z(L,S),j&1&&ge(N.value)!==U[0]&&Ft(N,U[0]),j&8&&F!==(F=U[3].new_cash+"")&&z(H,F),j&20&&A!==(A=U[2].toLocaleString(U[4].lang,{style:"currency",currency:U[4].currency,minimumFractionDigits:0})+"")&&z(Y,A),j&8&&st!==(st=U[3].deposit_button+"")&&z(et,st)},i(U){U&&(vt||Wt(()=>{vt=ee(e,He,{duration:1e3,easing:Tt}),vt.start()}))},o:re,d(U){U&&G(t),at=!1,Ut(ut)}}}function jg(i,t,e){let n,s,o,r,l;it(i,Be,f=>e(3,o=f)),it(i,Ai,f=>e(4,r=f)),it(i,fi,f=>e(1,l=f));let a=ct(l);it(i,a,f=>e(0,s=f));async function c(){l<s?yt(`${o.deposit_error} ${s.toLocaleString(r.lang,{style:"currency",currency:r.currency,minimumFractionDigits:0})}`,o.error,"coins"):(yt(`${o.deposit_success} ${s.toLocaleString(r.lang,{style:"currency",currency:r.currency,minimumFractionDigits:0})} `,o.deposit_success,"coins"),await Dt("ps-banking:client:ATMdeposit",{amount:s}),fi.update(f=>f-s),ni.update(f=>f+s),a.set(0))}function d(){s=ge(this.value),a.set(s)}return i.$$.update=()=>{i.$$.dirty&3&&e(2,n=l-s)},[s,l,n,o,r,a,c,d]}class Hg extends je{constructor(t){super(),We(this,t,jg,Wg,Ee,{})}}function xa(i){let t=i[1].toLocaleString(i[2].lang,{style:"currency",currency:i[2].currency,minimumFractionDigits:0})+"",e;return{c(){e=I(t)},m(n,s){Q(n,e,s)},p(n,s){s&6&&t!==(t=n[1].toLocaleString(n[2].lang,{style:"currency",currency:n[2].currency,minimumFractionDigits:0})+"")&&z(e,t)},d(n){n&&G(e)}}}function Vg(i){let t;return{c(){t=I("0")},m(e,n){Q(e,t,n)},p:re,d(e){e&&G(t)}}}function $g(i){let t=i[4].toLocaleString(i[2].lang,{style:"currency",currency:i[2].currency,minimumFractionDigits:0})+"",e;return{c(){e=I(t)},m(n,s){Q(n,e,s)},p(n,s){s&20&&t!==(t=n[4].toLocaleString(n[2].lang,{style:"currency",currency:n[2].currency,minimumFractionDigits:0})+"")&&z(e,t)},d(n){n&&G(e)}}}function Yg(i){let t,e,n,s,o=i[0].statistics_reports+"",r,l,a,c,d,f,p,g=i[0].overview+"",m,_,y,v,w,M,k=i[0].total_balance+"",S,L,C,T,E,O,N,V=i[0].total_transactions+"",R,B,F,H,P,W,$,D,A,Y,X=i[0].amount+"",K,Z,J,st,et,vt,at,ut,U,j=i[0].transactions_trend+"",lt,kt,mt,Xt,jt,Jt,Et,gt=i[1]!==void 0&&xa(i);function ft(dt,Ht){return dt[4]!==void 0?$g:Vg}let Mt=ft(i),Qt=Mt(i);return{c(){t=b("div"),e=b("div"),n=b("div"),s=b("h2"),r=I(o),l=x(),a=b("div"),c=b("div"),d=b("i"),f=x(),p=b("h3"),m=I(g),_=x(),y=b("div"),v=b("i"),w=x(),M=b("span"),S=I(k),L=I(": "),gt&>.c(),C=x(),T=b("div"),E=b("div"),O=b("div"),N=b("h4"),R=I(V),B=x(),F=b("i"),H=x(),P=b("p"),W=I(i[3]),$=x(),D=b("div"),A=b("div"),Y=b("h4"),K=I(X),Z=x(),J=b("i"),st=x(),et=b("p"),Qt.c(),vt=x(),at=b("div"),ut=b("div"),U=b("h4"),lt=I(j),kt=x(),mt=b("i"),Xt=x(),jt=b("div"),jt.innerHTML='<canvas id="transactionChart"></canvas>',h(s,"class","text-3xl font-bold mb-6"),h(d,"class","fa-duotone fa-chart-line text-3xl text-blue-200 mr-3"),h(p,"class","text-2xl font-semibold text-blue-200"),h(c,"class","flex items-center"),h(v,"class","fa-duotone fa-wallet text-gray-400 mr-2"),h(M,"class","text-lg font-semibold text-white"),h(y,"class","bg-gray-500/40 rounded-xl px-3 py-1 flex items-center"),h(a,"class","flex justify-between items-center mb-6"),h(N,"class","text-xl font-semibold text-blue-200"),h(F,"class","fa-duotone fa-exchange-alt text-yellow-400 text-2xl"),h(O,"class","flex justify-between items-center mb-4"),h(P,"class","text-2xl font-bold"),h(E,"class","bg-gray-700 p-4 rounded-lg shadow"),h(Y,"class","text-xl font-semibold text-blue-200"),h(J,"class","fa-duotone fa-coins text-green-400 text-2xl"),h(A,"class","flex justify-between items-center mb-4"),h(et,"class","text-2xl font-bold"),h(D,"class","bg-gray-700 p-4 rounded-lg shadow"),h(T,"class","grid grid-cols-1 md:grid-cols-2 gap-6 mb-6"),h(U,"class","text-xl font-semibold text-blue-200"),h(mt,"class","fa-duotone fa-chart-line text-blue-400 text-2xl"),h(ut,"class","flex justify-between items-center mb-4"),h(jt,"class","relative w-[1000px] left-[15%]"),h(at,"class","bg-gray-700 p-4 rounded-lg shadow"),h(n,"class","bg-gray-700/20 rounded-lg shadow-md p-6"),h(e,"class","absolute w-[90%] h-full p-6 overflow-auto left-[130px]"),h(t,"class","absolute w-full h-full bg-gray-800 text-white")},m(dt,Ht){Q(dt,t,Ht),u(t,e),u(e,n),u(n,s),u(s,r),u(n,l),u(n,a),u(a,c),u(c,d),u(c,f),u(c,p),u(p,m),u(a,_),u(a,y),u(y,v),u(y,w),u(y,M),u(M,S),u(M,L),gt&>.m(M,null),u(n,C),u(n,T),u(T,E),u(E,O),u(O,N),u(N,R),u(O,B),u(O,F),u(E,H),u(E,P),u(P,W),u(T,$),u(T,D),u(D,A),u(A,Y),u(Y,K),u(A,Z),u(A,J),u(D,st),u(D,et),Qt.m(et,null),u(n,vt),u(n,at),u(at,ut),u(ut,U),u(U,lt),u(ut,kt),u(ut,mt),u(at,Xt),u(at,jt)},p(dt,[Ht]){Ht&1&&o!==(o=dt[0].statistics_reports+"")&&z(r,o),Ht&1&&g!==(g=dt[0].overview+"")&&z(m,g),Ht&1&&k!==(k=dt[0].total_balance+"")&&z(S,k),dt[1]!==void 0?gt?gt.p(dt,Ht):(gt=xa(dt),gt.c(),gt.m(M,null)):gt&&(gt.d(1),gt=null),Ht&1&&V!==(V=dt[0].total_transactions+"")&&z(R,V),Ht&8&&z(W,dt[3]),Ht&1&&X!==(X=dt[0].amount+"")&&z(K,X),Mt===(Mt=ft(dt))&&Qt?Qt.p(dt,Ht):(Qt.d(1),Qt=Mt(dt),Qt&&(Qt.c(),Qt.m(et,null))),Ht&1&&j!==(j=dt[0].transactions_trend+"")&&z(lt,j)},i(dt){dt&&(Jt||Wt(()=>{Jt=ee(jt,Kt,{duration:2500,easing:Tt}),Jt.start()})),dt&&(Et||Wt(()=>{Et=ee(e,He,{duration:1e3,easing:Tt}),Et.start()}))},o:re,d(dt){dt&&G(t),gt&>.d(),Qt.d()}}}function Ug(i,t,e){let n,s,o,r,l;it(i,Be,g=>e(0,n=g)),it(i,ni,g=>e(1,s=g)),it(i,Ai,g=>e(2,o=g));let a=ct(0);it(i,a,g=>e(3,r=g));let c=ct(0);it(i,c,g=>e(4,l=g));let d={Transactions:[],Dates:[]},f;async function p(){try{const g=await Dt("ps-banking:client:getTransactionStats",{});a.set(g.totalCount),c.set(g.totalAmount);const m=g.transactionData.map(y=>y.amount),_=g.transactionData.map(y=>new Date(y.date).toLocaleDateString());d.Transactions=m,d.Dates=_,f&&(f.data.labels=_,f.data.datasets[0].data=m,f.update())}catch(g){console.error("Error fetching transaction stats:",g)}}return ln.register($n,hi,Un,Zs,Kc,Nn,Gc),Di(()=>{p();const g=document.getElementById("transactionChart").getContext("2d");f=new ln(g,{type:"line",data:{labels:d.Dates,datasets:[{label:"Transactions",data:d.Transactions,borderColor:"rgba(59, 130, 246, 1)",backgroundColor:"rgba(59, 130, 246, 0.2)",fill:!0,tension:.5,pointStyle:"rectRounded",pointRadius:5,pointHoverRadius:7,borderWidth:2}]},options:{responsive:!0,plugins:{legend:{display:!0,position:"top",labels:{usePointStyle:!0,color:"white"}},tooltip:{backgroundColor:"rgba(0,0,0,0.7)",titleColor:"white",bodyColor:"white",cornerRadius:4,displayColors:!1}},scales:{x:{display:!0,title:{display:!0,text:n.date,color:"white"},ticks:{color:"white"},grid:{color:"rgba(255,255,255,0.1)"}},y:{display:!0,title:{display:!0,text:n.amount,color:"white"},ticks:{color:"white"},grid:{color:"rgba(255,255,255,0.1)"},suggestedMin:0,suggestedMax:d.Transactions.reduce((m,_)=>m+_,0)}}}})}),[n,s,o,r,l,a,c]}class Xg extends je{constructor(t){super(),We(this,t,Ug,Yg,Ee,{})}}function wa(i,t,e){const n=i.slice();return n[69]=t[e],n}function ka(i,t,e){const n=i.slice();return n[72]=t[e],n}function Ma(i){let t,e,n=i[72].owner.identifier===qt(i[16]).identifier,s,o,r,l,a,c;function d(){return i[41](i[72])}let f=n&&Sa(i);function p(){return i[45](i[72])}function g(){return i[46](i[72])}return{c(){t=b("button"),t.innerHTML='<i class="fa-duotone fa-pen"></i>',e=x(),f&&f.c(),s=x(),o=b("button"),o.innerHTML='<i class="fa-duotone fa-arrow-up"></i>',r=x(),l=b("button"),l.innerHTML='<i class="fa-duotone fa-arrow-down"></i>',h(t,"class","text-gray-400 hover:text-blue-300 duration-500"),h(o,"class","text-green-400 hover:text-green-300 duration-500"),h(l,"class","text-yellow-400 hover:text-yellow-300 duration-500")},m(m,_){Q(m,t,_),Q(m,e,_),f&&f.m(m,_),Q(m,s,_),Q(m,o,_),Q(m,r,_),Q(m,l,_),a||(c=[tt(t,"click",d),tt(o,"click",p),tt(l,"click",g)],a=!0)},p(m,_){i=m,_[0]&2&&(n=i[72].owner.identifier===qt(i[16]).identifier),n?f?f.p(i,_):(f=Sa(i),f.c(),f.m(s.parentNode,s)):f&&(f.d(1),f=null)},d(m){m&&(G(t),G(e),G(s),G(o),G(r),G(l)),f&&f.d(m),a=!1,Ut(c)}}}function Sa(i){let t,e,n,s,o,r,l;function a(){return i[42](i[72])}function c(){return i[43](i[72])}function d(){return i[44](i[72])}return{c(){t=b("button"),t.innerHTML='<i class="fa-duotone fa-user-plus"></i>',e=x(),n=b("button"),n.innerHTML='<i class="fa-duotone fa-user-minus"></i>',s=x(),o=b("button"),o.innerHTML='<i class="fa-duotone fa-trash"></i>',h(t,"class","text-gray-400 hover:text-blue-300 duration-500"),h(n,"class","text-gray-400 hover:text-blue-300 duration-500"),h(o,"class","text-red-400 hover:text-red-300 duration-500")},m(f,p){Q(f,t,p),Q(f,e,p),Q(f,n,p),Q(f,s,p),Q(f,o,p),r||(l=[tt(t,"click",a),tt(n,"click",c),tt(o,"click",d)],r=!0)},p(f,p){i=f},d(f){f&&(G(t),G(e),G(n),G(s),G(o)),r=!1,Ut(l)}}}function Da(i,t){let e,n,s,o=t[72].balance.toLocaleString(t[2].lang,{style:"currency",currency:t[2].currency,minimumFractionDigits:0})+"",r,l,a,c,d=t[72].id+"",f,p,g,m=t[72].cardNumber+"",_,y,v,w,M=t[72].owner.name+"",k,S,L=t[72].holder+"",C,T,E,O,N,V=t[72].owner.identifier===qt(t[16]).identifier||t[72].users.some(t[39]),R,B,F,H,P;function W(){return t[40](t[72])}let $=V&&Ma(t);return{key:i,first:null,c(){e=b("div"),n=b("div"),s=b("div"),r=I(o),l=x(),a=b("div"),c=I("#"),f=I(d),p=x(),g=b("div"),_=I(m),y=x(),v=b("div"),w=b("div"),k=I(M),S=I(" - "),C=I(L),T=x(),E=b("div"),O=b("button"),O.innerHTML='<i class="fa-duotone fa-copy"></i>',N=x(),$&&$.c(),R=x(),h(s,"class","text-2xl font-bold"),h(a,"class","text-sm font-semibold"),h(n,"class","flex justify-between items-center"),h(g,"class","text-xl mt-2"),h(w,"class","text-lg"),h(O,"class","text-gray-400 hover:text-blue-300 duration-500"),h(E,"class","flex space-x-2"),h(v,"class","flex justify-between items-center mt-4"),h(e,"class","py-8 px-8 w-auto h-auto rounded-2xl shadow-lg flex flex-col justify-between bg-[#1c2333] text-blue-400 relative"),this.first=e},m(D,A){Q(D,e,A),u(e,n),u(n,s),u(s,r),u(n,l),u(n,a),u(a,c),u(a,f),u(e,p),u(e,g),u(g,_),u(e,y),u(e,v),u(v,w),u(w,k),u(w,S),u(w,C),u(v,T),u(v,E),u(E,O),u(E,N),$&&$.m(E,null),u(e,R),F=!0,H||(P=tt(O,"click",W),H=!0)},p(D,A){t=D,(!F||A[0]&6)&&o!==(o=t[72].balance.toLocaleString(t[2].lang,{style:"currency",currency:t[2].currency,minimumFractionDigits:0})+"")&&z(r,o),(!F||A[0]&2)&&d!==(d=t[72].id+"")&&z(f,d),(!F||A[0]&2)&&m!==(m=t[72].cardNumber+"")&&z(_,m),(!F||A[0]&2)&&M!==(M=t[72].owner.name+"")&&z(k,M),(!F||A[0]&2)&&L!==(L=t[72].holder+"")&&z(C,L),A[0]&2&&(V=t[72].owner.identifier===qt(t[16]).identifier||t[72].users.some(t[39])),V?$?$.p(t,A):($=Ma(t),$.c(),$.m(E,null)):$&&($.d(1),$=null)},i(D){F||(B&&B.end(1),F=!0)},o(D){D&&(B=be(e,Ws,{duration:1e3,easing:Tt})),F=!1},d(D){D&&G(e),$&&$.d(),D&&B&&B.end(),H=!1,P()}}}function Aa(i){let t,e,n,s,o,r=i[0].new_user_to_account+"",l,a,c,d,f=i[0].server_id+"",p,g,m,_,y,v,w,M,k,S,L,C=i[0].cancel+"",T,E,O,N,V,R=i[0].add_user+"",B,F,H,P,W,$;return{c(){t=b("div"),e=b("div"),n=b("h2"),s=b("i"),o=x(),l=I(r),a=x(),c=b("div"),d=b("label"),p=I(f),g=x(),m=b("div"),_=b("input"),y=x(),v=b("i"),w=x(),M=b("div"),k=b("button"),S=b("i"),L=x(),T=I(C),E=x(),O=b("button"),N=b("i"),V=x(),B=I(R),h(s,"class","fa-duotone fa-exchange-alt mr-2"),h(n,"class","text-2xl font-bold text-blue-400 mb-4 flex items-center"),h(d,"class","block text-blue-400 mb-2"),h(d,"for","ServerID"),h(_,"type","number"),h(_,"id","ServerID"),h(_,"class","w-full bg-[#283040] text-white font-bold pl-4 pr-12 py-3 rounded-lg border border-blue-400 focus:outline-none focus:border-blue-600 transition-colors duration-500 placeholder-gray-500"),h(_,"placeholder","ID"),h(v,"class","fa-duotone fa-id-card absolute top-1/2 right-4 transform -translate-y-1/2 text-blue-400"),h(m,"class","relative"),h(c,"class","mb-4"),h(S,"class","fa-duotone fa-times-circle text-lg mr-2"),h(k,"class","bg-red-600 text-white py-2 px-4 rounded-lg flex items-center transition-colors duration-300"),h(N,"class","fa-duotone fa-check-circle text-lg mr-2"),h(O,"class","bg-blue-600 text-white py-2 px-4 rounded-lg flex items-center transition-colors duration-300"),h(M,"class","flex justify-center space-x-4"),h(e,"class","bg-[#1c2333] p-8 rounded-lg shadow-2xl w-96 relative"),h(t,"class","fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50")},m(D,A){Q(D,t,A),u(t,e),u(e,n),u(n,s),u(n,o),u(n,l),u(e,a),u(e,c),u(c,d),u(d,p),u(c,g),u(c,m),u(m,_),Ft(_,i[4]),u(m,y),u(m,v),u(e,w),u(e,M),u(M,k),u(k,S),u(k,L),u(k,T),u(M,E),u(M,O),u(O,N),u(O,V),u(O,B),P=!0,W||($=[tt(_,"input",i[48]),tt(k,"click",i[49]),tt(O,"click",i[50])],W=!0)},p(D,A){(!P||A[0]&1)&&r!==(r=D[0].new_user_to_account+"")&&z(l,r),(!P||A[0]&1)&&f!==(f=D[0].server_id+"")&&z(p,f),A[0]&16&&ge(_.value)!==D[4]&&Ft(_,D[4]),(!P||A[0]&1)&&C!==(C=D[0].cancel+"")&&z(T,C),(!P||A[0]&1)&&R!==(R=D[0].add_user+"")&&z(B,R)},i(D){P||(D&&Wt(()=>{P&&(H&&H.end(1),F=ee(e,Kt,{duration:250,easing:Tt}),F.start())}),P=!0)},o(D){F&&F.invalidate(),D&&(H=be(e,Kt,{duration:250,easing:Tt})),P=!1},d(D){D&&G(t),D&&H&&H.end(),W=!1,Ut($)}}}function Pa(i){let t,e,n,s,o,r=i[0].rename_account+"",l,a,c,d,f=i[0].new_account_name+"",p,g,m,_,y,v,w,M,k,S,L,C,T=i[0].cancel+"",E,O,N,V,R,B=i[0].rename+"",F,H,P,W,$,D;return{c(){t=b("div"),e=b("div"),n=b("h2"),s=b("i"),o=x(),l=I(r),a=x(),c=b("div"),d=b("label"),p=I(f),g=x(),m=b("div"),_=b("input"),v=x(),w=b("i"),M=x(),k=b("div"),S=b("button"),L=b("i"),C=x(),E=I(T),O=x(),N=b("button"),V=b("i"),R=x(),F=I(B),h(s,"class","fa-duotone fa-edit mr-2"),h(n,"class","text-2xl font-bold text-blue-400 mb-4 flex items-center"),h(d,"class","block text-blue-400 mb-2"),h(d,"for","AccountName"),h(_,"type","text"),h(_,"id","AccountName"),h(_,"class","w-full bg-[#283040] text-white font-bold pl-4 pr-12 py-3 rounded-lg border border-blue-400 focus:outline-none focus:border-blue-600 transition-colors duration-500 placeholder-gray-500"),h(_,"placeholder",y=i[0].new_name),h(w,"class","fa-duotone fa-pen-nib absolute top-1/2 right-4 transform -translate-y-1/2 text-blue-400"),h(m,"class","relative"),h(c,"class","mb-4"),h(L,"class","fa-duotone fa-times-circle text-lg mr-2"),h(S,"class","bg-red-600 text-white py-2 px-4 rounded-lg flex items-center transition-colors duration-300"),h(V,"class","fa-duotone fa-check-circle text-lg mr-2"),h(N,"class","bg-blue-600 text-white py-2 px-4 rounded-lg flex items-center transition-colors duration-300"),h(k,"class","flex justify-center space-x-4"),h(e,"class","bg-[#1c2333] p-8 rounded-lg shadow-2xl w-96 relative"),h(t,"class","fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50")},m(A,Y){Q(A,t,Y),u(t,e),u(e,n),u(n,s),u(n,o),u(n,l),u(e,a),u(e,c),u(c,d),u(d,p),u(c,g),u(c,m),u(m,_),Ft(_,i[6]),u(m,v),u(m,w),u(e,M),u(e,k),u(k,S),u(S,L),u(S,C),u(S,E),u(k,O),u(k,N),u(N,V),u(N,R),u(N,F),W=!0,$||(D=[tt(_,"input",i[51]),tt(S,"click",i[52]),tt(N,"click",i[53])],$=!0)},p(A,Y){(!W||Y[0]&1)&&r!==(r=A[0].rename_account+"")&&z(l,r),(!W||Y[0]&1)&&f!==(f=A[0].new_account_name+"")&&z(p,f),(!W||Y[0]&1&&y!==(y=A[0].new_name))&&h(_,"placeholder",y),Y[0]&64&&_.value!==A[6]&&Ft(_,A[6]),(!W||Y[0]&1)&&T!==(T=A[0].cancel+"")&&z(E,T),(!W||Y[0]&1)&&B!==(B=A[0].rename+"")&&z(F,B)},i(A){W||(A&&Wt(()=>{W&&(P&&P.end(1),H=ee(e,Kt,{duration:250,easing:Tt}),H.start())}),W=!0)},o(A){H&&H.invalidate(),A&&(P=be(e,Kt,{duration:250,easing:Tt})),W=!1},d(A){A&&G(t),A&&P&&P.end(),$=!1,Ut(D)}}}function Ca(i){let t,e,n,s,o,r=i[0].create_new_account+"",l,a,c,d,f=i[0].account_holder+"",p,g,m,_,y,v,w,M,k,S,L,C,T=i[0].cancel+"",E,O,N,V,R,B=i[0].create+"",F,H,P,W,$,D;return{c(){t=b("div"),e=b("div"),n=b("h2"),s=b("i"),o=x(),l=I(r),a=x(),c=b("div"),d=b("label"),p=I(f),g=x(),m=b("div"),_=b("input"),v=x(),w=b("i"),M=x(),k=b("div"),S=b("button"),L=b("i"),C=x(),E=I(T),O=x(),N=b("button"),V=b("i"),R=x(),F=I(B),h(s,"class","fa-duotone fa-plus mr-2"),h(n,"class","text-2xl font-bold text-blue-400 mb-4 flex items-center"),h(d,"class","block text-blue-400 mb-2"),h(d,"for","AccountHolder"),h(_,"type","text"),h(_,"id","AccountHolder"),h(_,"class","w-full bg-[#283040] text-white font-bold pl-4 pr-12 py-3 rounded-lg border border-blue-400 focus:outline-none focus:border-blue-600 transition-colors duration-500 placeholder-gray-500"),h(_,"placeholder",y=i[0].account_holder),h(w,"class","fa-duotone fa-user absolute top-1/2 right-4 transform -translate-y-1/2 text-blue-400"),h(m,"class","relative"),h(c,"class","mb-4"),h(L,"class","fa-duotone fa-times-circle text-lg mr-2"),h(S,"class","bg-red-600 text-white py-2 px-4 rounded-lg flex items-center transition-colors duration-300"),h(V,"class","fa-duotone fa-check-circle text-lg mr-2"),h(N,"class","bg-blue-600 text-white py-2 px-4 rounded-lg flex items-center transition-colors duration-300"),h(k,"class","flex justify-center space-x-4"),h(e,"class","bg-[#1c2333] p-8 rounded-lg shadow-2xl w-96 relative"),h(t,"class","fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50")},m(A,Y){Q(A,t,Y),u(t,e),u(e,n),u(n,s),u(n,o),u(n,l),u(e,a),u(e,c),u(c,d),u(d,p),u(c,g),u(c,m),u(m,_),Ft(_,i[8]),u(m,v),u(m,w),u(e,M),u(e,k),u(k,S),u(S,L),u(S,C),u(S,E),u(k,O),u(k,N),u(N,V),u(N,R),u(N,F),W=!0,$||(D=[tt(_,"input",i[54]),tt(S,"click",i[55]),tt(N,"click",i[36])],$=!0)},p(A,Y){(!W||Y[0]&1)&&r!==(r=A[0].create_new_account+"")&&z(l,r),(!W||Y[0]&1)&&f!==(f=A[0].account_holder+"")&&z(p,f),(!W||Y[0]&1&&y!==(y=A[0].account_holder))&&h(_,"placeholder",y),Y[0]&256&&_.value!==A[8]&&Ft(_,A[8]),(!W||Y[0]&1)&&T!==(T=A[0].cancel+"")&&z(E,T),(!W||Y[0]&1)&&B!==(B=A[0].create+"")&&z(F,B)},i(A){W||(A&&Wt(()=>{W&&(P&&P.end(1),H=ee(e,Kt,{duration:250,easing:Tt}),H.start())}),W=!0)},o(A){H&&H.invalidate(),A&&(P=be(e,Kt,{duration:250,easing:Tt})),W=!1},d(A){A&&G(t),A&&P&&P.end(),$=!1,Ut(D)}}}function La(i){let t,e,n,s,o,r=i[0].delete_account+"",l,a,c,d=i[0].are_you_sure_you_want_to_delete_this_account+"",f,p,g,m,_,y,v=i[0].cancel+"",w,M,k,S,L,C=i[0].delete+"",T,E,O,N,V,R;return{c(){t=b("div"),e=b("div"),n=b("h2"),s=b("i"),o=x(),l=I(r),a=x(),c=b("p"),f=I(d),p=x(),g=b("div"),m=b("button"),_=b("i"),y=x(),w=I(v),M=x(),k=b("button"),S=b("i"),L=x(),T=I(C),h(s,"class","fa-duotone fa-exclamation-triangle mr-2"),h(n,"class","text-2xl font-bold text-red-400 mb-4 flex items-center"),h(c,"class","text-blue-400 mb-4"),h(_,"class","fa-duotone fa-times-circle text-lg mr-2"),h(m,"class","bg-gray-600 text-white py-2 px-4 rounded-lg flex items-center transition-colors duration-300"),h(S,"class","fa-duotone fa-check-circle text-lg mr-2"),h(k,"class","bg-red-600 text-white py-2 px-4 rounded-lg flex items-center transition-colors duration-300"),h(g,"class","flex justify-center space-x-4"),h(e,"class","bg-[#1c2333] p-8 rounded-lg shadow-2xl w-96 relative"),h(t,"class","fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50")},m(B,F){Q(B,t,F),u(t,e),u(e,n),u(n,s),u(n,o),u(n,l),u(e,a),u(e,c),u(c,f),u(e,p),u(e,g),u(g,m),u(m,_),u(m,y),u(m,w),u(g,M),u(g,k),u(k,S),u(k,L),u(k,T),N=!0,V||(R=[tt(m,"click",i[56]),tt(k,"click",i[57])],V=!0)},p(B,F){(!N||F[0]&1)&&r!==(r=B[0].delete_account+"")&&z(l,r),(!N||F[0]&1)&&d!==(d=B[0].are_you_sure_you_want_to_delete_this_account+"")&&z(f,d),(!N||F[0]&1)&&v!==(v=B[0].cancel+"")&&z(w,v),(!N||F[0]&1)&&C!==(C=B[0].delete+"")&&z(T,C)},i(B){N||(B&&Wt(()=>{N&&(O&&O.end(1),E=ee(e,Kt,{duration:250,easing:Tt}),E.start())}),N=!0)},o(B){E&&E.invalidate(),B&&(O=be(e,Kt,{duration:250,easing:Tt})),N=!1},d(B){B&&G(t),B&&O&&O.end(),V=!1,Ut(R)}}}function Ta(i){var Y;let t,e,n,s,o,r=i[0].remove_user_from_account+"",l,a,c,d,f=i[0].select_user+"",p,g,m,_,y,v,w,M,k,S,L,C=i[0].cancel+"",T,E,O,N,V,R=i[0].remove+"",B,F,H,P,W,$,D=oe((Y=i[1].find(i[58]))==null?void 0:Y.users),A=[];for(let X=0;X<D.length;X+=1)A[X]=Oa(wa(i,D,X));return{c(){t=b("div"),e=b("div"),n=b("h2"),s=b("i"),o=x(),l=I(r),a=x(),c=b("div"),d=b("label"),p=I(f),g=x(),m=b("div"),_=b("select");for(let X=0;X<A.length;X+=1)A[X].c();y=x(),v=b("i"),w=x(),M=b("div"),k=b("button"),S=b("i"),L=x(),T=I(C),E=x(),O=b("button"),N=b("i"),V=x(),B=I(R),h(s,"class","fa-duotone fa-user-minus mr-2"),h(n,"class","text-2xl font-bold text-blue-400 mb-4 flex items-center"),h(d,"class","block text-blue-400 mb-2"),h(d,"for","UserSelect"),h(_,"id","UserSelect"),h(_,"class","w-full bg-[#283040] text-white font-bold pl-4 pr-12 py-3 rounded-lg border border-blue-400 focus:outline-none focus:border-blue-600 transition-colors duration-500 placeholder-gray-500 appearance-none"),_o(_,"background-image","none"),_o(_,"-moz-appearance","none"),_o(_,"-webkit-appearance","none"),i[11]===void 0&&Wt(()=>i[59].call(_)),h(v,"class","fa-duotone fa-user absolute top-1/2 right-4 transform -translate-y-1/2 text-blue-400"),h(m,"class","relative"),h(c,"class","mb-4"),h(S,"class","fa-duotone fa-times-circle text-lg mr-2"),h(k,"class","bg-gray-600 text-white py-2 px-4 rounded-lg flex items-center transition-colors duration-300"),h(N,"class","fa-duotone fa-check-circle text-lg mr-2"),h(O,"class","bg-red-600 text-white py-2 px-4 rounded-lg flex items-center transition-colors duration-300"),h(M,"class","flex justify-center space-x-4"),h(e,"class","bg-[#1c2333] p-8 rounded-lg shadow-2xl w-96 relative"),h(t,"class","fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50")},m(X,K){Q(X,t,K),u(t,e),u(e,n),u(n,s),u(n,o),u(n,l),u(e,a),u(e,c),u(c,d),u(d,p),u(c,g),u(c,m),u(m,_);for(let Z=0;Z<A.length;Z+=1)A[Z]&&A[Z].m(_,null);Fr(_,i[11],!0),u(m,y),u(m,v),u(e,w),u(e,M),u(M,k),u(k,S),u(k,L),u(k,T),u(M,E),u(M,O),u(O,N),u(O,V),u(O,B),P=!0,W||($=[tt(_,"change",i[59]),tt(k,"click",i[60]),tt(O,"click",i[34])],W=!0)},p(X,K){var Z;if((!P||K[0]&1)&&r!==(r=X[0].remove_user_from_account+"")&&z(l,r),(!P||K[0]&1)&&f!==(f=X[0].select_user+"")&&z(p,f),K[0]&4098){D=oe((Z=X[1].find(X[58]))==null?void 0:Z.users);let J;for(J=0;J<D.length;J+=1){const st=wa(X,D,J);A[J]?A[J].p(st,K):(A[J]=Oa(st),A[J].c(),A[J].m(_,null))}for(;J<A.length;J+=1)A[J].d(1);A.length=D.length}K[0]&6146&&Fr(_,X[11]),(!P||K[0]&1)&&C!==(C=X[0].cancel+"")&&z(T,C),(!P||K[0]&1)&&R!==(R=X[0].remove+"")&&z(B,R)},i(X){P||(X&&Wt(()=>{P&&(H&&H.end(1),F=ee(e,Kt,{duration:250,easing:Tt}),F.start())}),P=!0)},o(X){F&&F.invalidate(),X&&(H=be(e,Kt,{duration:250,easing:Tt})),P=!1},d(X){X&&G(t),Ss(A,X),X&&H&&H.end(),W=!1,Ut($)}}}function Oa(i){let t,e=i[69].name+"",n,s,o;return{c(){t=b("option"),n=I(e),s=x(),t.__value=o=i[69].identifier,Ft(t,t.__value),h(t,"class","bg-[#283040] text-white rounded-xl font-bold pl-4 pr-12 py-4 rounded-lg transition-colors duration-500 hover:bg-blue-300/20 hover:text-gray-200 border-b border-blue-200")},m(r,l){Q(r,t,l),u(t,n),u(t,s)},p(r,l){l[0]&4098&&e!==(e=r[69].name+"")&&z(n,e),l[0]&4098&&o!==(o=r[69].identifier)&&(t.__value=o,Ft(t,t.__value))},d(r){r&&G(t)}}}function Ra(i){let t,e,n,s,o,r=i[0].withdraw_from_account+"",l,a,c,d,f=i[0].withdraw_amount+"",p,g,m,_,y,v,w,M,k,S,L,C=i[0].cancel+"",T,E,O,N,V,R=i[0].withdraw+"",B,F,H,P,W,$;return{c(){t=b("div"),e=b("div"),n=b("h2"),s=b("i"),o=x(),l=I(r),a=x(),c=b("div"),d=b("label"),p=I(f),g=x(),m=b("div"),_=b("input"),y=x(),v=b("i"),w=x(),M=b("div"),k=b("button"),S=b("i"),L=x(),T=I(C),E=x(),O=b("button"),N=b("i"),V=x(),B=I(R),h(s,"class","fa-duotone fa-arrow-down mr-2"),h(n,"class","text-2xl font-bold text-yellow-400 mb-4 flex items-center"),h(d,"class","block text-yellow-400 mb-2"),h(d,"for","WithdrawAmount"),h(_,"type","number"),h(_,"id","WithdrawAmount"),h(_,"class","w-full bg-[#283040] text-white font-bold pl-4 pr-12 py-3 rounded-lg border border-yellow-400 focus:outline-none focus:border-yellow-600 transition-colors duration-500 placeholder-gray-500"),h(_,"placeholder","0"),h(v,"class","fa-duotone fa-dollar-sign absolute top-1/2 right-4 transform -translate-y-1/2 text-yellow-400"),h(m,"class","relative"),h(c,"class","mb-4"),h(S,"class","fa-duotone fa-times-circle text-lg mr-2"),h(k,"class","bg-gray-600 text-white py-2 px-4 rounded-lg flex items-center transition-colors duration-300"),h(N,"class","fa-duotone fa-check-circle text-lg mr-2"),h(O,"class","bg-yellow-600 text-white py-2 px-4 rounded-lg flex items-center transition-colors duration-300"),h(M,"class","flex justify-center space-x-4"),h(e,"class","bg-[#1c2333] p-8 rounded-lg shadow-2xl w-96 relative"),h(t,"class","fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50")},m(D,A){Q(D,t,A),u(t,e),u(e,n),u(n,s),u(n,o),u(n,l),u(e,a),u(e,c),u(c,d),u(d,p),u(c,g),u(c,m),u(m,_),Ft(_,i[14]),u(m,y),u(m,v),u(e,w),u(e,M),u(M,k),u(k,S),u(k,L),u(k,T),u(M,E),u(M,O),u(O,N),u(O,V),u(O,B),P=!0,W||($=[tt(_,"input",i[61]),tt(k,"click",i[62]),tt(O,"click",i[37])],W=!0)},p(D,A){(!P||A[0]&1)&&r!==(r=D[0].withdraw_from_account+"")&&z(l,r),(!P||A[0]&1)&&f!==(f=D[0].withdraw_amount+"")&&z(p,f),A[0]&16384&&ge(_.value)!==D[14]&&Ft(_,D[14]),(!P||A[0]&1)&&C!==(C=D[0].cancel+"")&&z(T,C),(!P||A[0]&1)&&R!==(R=D[0].withdraw+"")&&z(B,R)},i(D){P||(D&&Wt(()=>{P&&(H&&H.end(1),F=ee(e,Kt,{duration:250,easing:Tt}),F.start())}),P=!0)},o(D){F&&F.invalidate(),D&&(H=be(e,Kt,{duration:250,easing:Tt})),P=!1},d(D){D&&G(t),D&&H&&H.end(),W=!1,Ut($)}}}function Ea(i){let t,e,n,s,o,r=i[0].deposit_to_account+"",l,a,c,d,f=i[0].deposit_amount+"",p,g,m,_,y,v,w,M,k,S,L,C=i[0].cancel+"",T,E,O,N,V,R=i[0].deposit+"",B,F,H,P,W,$;return{c(){t=b("div"),e=b("div"),n=b("h2"),s=b("i"),o=x(),l=I(r),a=x(),c=b("div"),d=b("label"),p=I(f),g=x(),m=b("div"),_=b("input"),y=x(),v=b("i"),w=x(),M=b("div"),k=b("button"),S=b("i"),L=x(),T=I(C),E=x(),O=b("button"),N=b("i"),V=x(),B=I(R),h(s,"class","fa-duotone fa-arrow-up mr-2"),h(n,"class","text-2xl font-bold text-green-400 mb-4 flex items-center"),h(d,"class","block text-green-400 mb-2"),h(d,"for","DepositAmount"),h(_,"type","number"),h(_,"id","DepositAmount"),h(_,"class","w-full bg-[#283040] text-white font-bold pl-4 pr-12 py-3 rounded-lg border border-green-400 focus:outline-none focus:border-green-600 transition-colors duration-500 placeholder-gray-500"),h(_,"placeholder","0"),h(v,"class","fa-duotone fa-dollar-sign absolute top-1/2 right-4 transform -translate-y-1/2 text-green-400"),h(m,"class","relative"),h(c,"class","mb-4"),h(S,"class","fa-duotone fa-times-circle text-lg mr-2"),h(k,"class","bg-gray-600 text-white py-2 px-4 rounded-lg flex items-center transition-colors duration-300"),h(N,"class","fa-duotone fa-check-circle text-lg mr-2"),h(O,"class","bg-green-600 text-white py-2 px-4 rounded-lg flex items-center transition-colors duration-300"),h(M,"class","flex justify-center space-x-4"),h(e,"class","bg-[#1c2333] p-8 rounded-lg shadow-2xl w-96 relative"),h(t,"class","fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 z-50")},m(D,A){Q(D,t,A),u(t,e),u(e,n),u(n,s),u(n,o),u(n,l),u(e,a),u(e,c),u(c,d),u(d,p),u(c,g),u(c,m),u(m,_),Ft(_,i[14]),u(m,y),u(m,v),u(e,w),u(e,M),u(M,k),u(k,S),u(k,L),u(k,T),u(M,E),u(M,O),u(O,N),u(O,V),u(O,B),P=!0,W||($=[tt(_,"input",i[63]),tt(k,"click",i[64]),tt(O,"click",i[38])],W=!0)},p(D,A){(!P||A[0]&1)&&r!==(r=D[0].deposit_to_account+"")&&z(l,r),(!P||A[0]&1)&&f!==(f=D[0].deposit_amount+"")&&z(p,f),A[0]&16384&&ge(_.value)!==D[14]&&Ft(_,D[14]),(!P||A[0]&1)&&C!==(C=D[0].cancel+"")&&z(T,C),(!P||A[0]&1)&&R!==(R=D[0].deposit+"")&&z(B,R)},i(D){P||(D&&Wt(()=>{P&&(H&&H.end(1),F=ee(e,Kt,{duration:250,easing:Tt}),F.start())}),P=!0)},o(D){F&&F.invalidate(),D&&(H=be(e,Kt,{duration:250,easing:Tt})),P=!1},d(D){D&&G(t),D&&H&&H.end(),W=!1,Ut($)}}}function qg(i){let t,e,n,s,o,r,l=i[0].accounts+"",a,c,d,f=[],p=new Map,g,m,_,y,v,w,M,k,S,L,C,T,E,O,N=oe(i[1]);const V=D=>D[72].id;for(let D=0;D<N.length;D+=1){let A=ka(i,N,D),Y=V(A);p.set(Y,f[D]=Da(Y,A))}let R=i[3]&&Aa(i),B=i[5]&&Pa(i),F=i[7]&&Ca(i),H=i[9]&&La(i),P=i[10]&&Ta(i),W=i[13]&&Ra(i),$=i[15]&&Ea(i);return{c(){t=b("div"),e=b("div"),n=b("div"),s=b("div"),o=b("i"),r=x(),a=I(l),c=x(),d=b("div");for(let D=0;D<f.length;D+=1)f[D].c();g=x(),m=b("button"),m.innerHTML='<i class="fa-duotone fa-plus text-4xl text-gray-200"></i>',y=x(),R&&R.c(),v=x(),B&&B.c(),w=x(),F&&F.c(),M=x(),H&&H.c(),k=x(),P&&P.c(),S=x(),W&&W.c(),L=x(),$&&$.c(),C=Ds(),h(o,"class","fa-duotone fa-users text-3xl text-blue-200 mr-3"),h(s,"class","text-5xl font-extrabold text-left text-blue-400 mb-10"),h(d,"class","relative grid grid-cols-3 gap-y-10 gap-x-4 w-[90%]"),h(m,"class","bg-[#1c2333] mt-6 py-8 px-8 w-[250px] h-[200px] rounded-2xl shadow-lg flex items-center justify-center cursor-pointer border border-dashed border-blue-400 hover:border-blue-600 transition-all duration-500"),h(n,"class","bg-gray-700/10 p-8 rounded-xl shadow-lg border border-blue-200/5"),h(e,"class","absolute w-[90%] h-full p-6 overflow-auto left-[130px]"),h(t,"class","absolute w-full h-full bg-gray-800 text-white")},m(D,A){Q(D,t,A),u(t,e),u(e,n),u(n,s),u(s,o),u(s,r),u(s,a),u(n,c),u(n,d);for(let Y=0;Y<f.length;Y+=1)f[Y]&&f[Y].m(d,null);u(n,g),u(n,m),Q(D,y,A),R&&R.m(D,A),Q(D,v,A),B&&B.m(D,A),Q(D,w,A),F&&F.m(D,A),Q(D,M,A),H&&H.m(D,A),Q(D,k,A),P&&P.m(D,A),Q(D,S,A),W&&W.m(D,A),Q(D,L,A),$&&$.m(D,A),Q(D,C,A),T=!0,E||(O=tt(m,"click",i[47]),E=!0)},p(D,A){(!T||A[0]&1)&&l!==(l=D[0].accounts+"")&&z(a,l),A[0]&837615622|A[1]&2&&(N=oe(D[1]),le(),f=an(f,A,V,1,D,N,p,d,jn,Da,null,ka),ae()),D[3]?R?(R.p(D,A),A[0]&8&&rt(R,1)):(R=Aa(D),R.c(),rt(R,1),R.m(v.parentNode,v)):R&&(le(),pt(R,1,1,()=>{R=null}),ae()),D[5]?B?(B.p(D,A),A[0]&32&&rt(B,1)):(B=Pa(D),B.c(),rt(B,1),B.m(w.parentNode,w)):B&&(le(),pt(B,1,1,()=>{B=null}),ae()),D[7]?F?(F.p(D,A),A[0]&128&&rt(F,1)):(F=Ca(D),F.c(),rt(F,1),F.m(M.parentNode,M)):F&&(le(),pt(F,1,1,()=>{F=null}),ae()),D[9]?H?(H.p(D,A),A[0]&512&&rt(H,1)):(H=La(D),H.c(),rt(H,1),H.m(k.parentNode,k)):H&&(le(),pt(H,1,1,()=>{H=null}),ae()),D[10]?P?(P.p(D,A),A[0]&1024&&rt(P,1)):(P=Ta(D),P.c(),rt(P,1),P.m(S.parentNode,S)):P&&(le(),pt(P,1,1,()=>{P=null}),ae()),D[13]?W?(W.p(D,A),A[0]&8192&&rt(W,1)):(W=Ra(D),W.c(),rt(W,1),W.m(L.parentNode,L)):W&&(le(),pt(W,1,1,()=>{W=null}),ae()),D[15]?$?($.p(D,A),A[0]&32768&&rt($,1)):($=Ea(D),$.c(),rt($,1),$.m(C.parentNode,C)):$&&(le(),pt($,1,1,()=>{$=null}),ae())},i(D){if(!T){for(let A=0;A<N.length;A+=1)rt(f[A]);D&&(_||Wt(()=>{_=ee(e,He,{duration:1e3,easing:Tt}),_.start()})),rt(R),rt(B),rt(F),rt(H),rt(P),rt(W),rt($),T=!0}},o(D){for(let A=0;A<f.length;A+=1)pt(f[A]);pt(R),pt(B),pt(F),pt(H),pt(P),pt(W),pt($),T=!1},d(D){D&&(G(t),G(y),G(v),G(w),G(M),G(k),G(S),G(L),G(C));for(let A=0;A<f.length;A+=1)f[A].d();R&&R.d(D),B&&B.d(D),F&&F.d(D),H&&H.d(D),P&&P.d(D),W&&W.d(D),$&&$.d(D),E=!1,O()}}}function Kg(i){var t;return((t=i.match(/.{1,4}/g))==null?void 0:t.join(" "))||i}function Gg(i,t,e){let n,s,o,r,l,a,c,d,f,p,g,m,_,y,v,w;it(i,Be,q=>e(0,n=q)),it(i,Ai,q=>e(2,o=q));let M=ct({}),k=ct([]);it(i,k,q=>e(1,s=q)),Mu(k,q=>q.reduce((bt,Ct)=>bt+Ct.balance,0));let S=ct(!1);it(i,S,q=>e(3,r=q));let L=ct(!1);it(i,L,q=>e(5,a=q));let C=ct(!1);it(i,C,q=>e(7,d=q));let T=ct(!1);it(i,T,q=>e(9,p=q));let E=ct(!1);it(i,E,q=>e(10,g=q));let O=ct(!1);it(i,O,q=>e(13,y=q));let N=ct(!1);it(i,N,q=>e(15,w=q));let V=ct("");it(i,V,q=>e(4,l=q));let R=ct("");it(i,R,q=>e(6,c=q));let B=ct("");it(i,B,q=>e(8,f=q));let F=ct(0),H=ct(null);it(i,H,q=>e(12,_=q));let P=ct("");it(i,P,q=>e(11,m=q));let W=ct(0);it(i,W,q=>e(14,v=q));async function $(q){const bt=qt(R);if(bt)try{(await Dt("ps-banking:client:renameAccount",{id:q,newName:bt})).success?(k.update(_t=>_t.map(Zt=>Zt.id===q?{...Zt,holder:bt}:Zt)),R.set(""),L.set(!1),et(),yt(n.account_renamed_successfully,n.success,"check-circle")):yt(n.account_rename_failed,n.error,"exclamation-circle")}catch(Ct){console.error(Ct),yt(n.account_rename_failed,n.error,"exclamation-circle")}}async function D(q){const bt=qt(k).find(Ct=>Ct.id===q);bt&&(await Dt("ps-banking:client:copyAccountNumber",{accountNumber:bt.cardNumber}),yt(n.account_number_copied,n.success,"clipboard"))}async function A(q,bt){try{const Ct=await Dt("ps-banking:client:addUserToAccount",{accountId:q,userId:bt});Ct.success?(k.update(_t=>_t.map(Lt=>Lt.id===q?{...Lt,users:[...Lt.users,{name:Ct.userName,identifier:bt}]}:Lt)),yt(`${Ct.userName} ${n.user_added_successfully}`,n.success,"check-circle"),S.set(!1),V.set("0"),et()):yt(Ct.message,n.error,"exclamation-circle")}catch(Ct){console.error(Ct),yt(n.user_addition_failed,n.error,"exclamation-circle")}}async function Y(){const q=qt(H),bt=qt(P);if(q!==null&&bt)try{(await Dt("ps-banking:client:removeUserFromAccount",{accountId:q,user:bt})).success?(k.update(_t=>_t.map(Lt=>Lt.id===q?{...Lt,users:Lt.users.filter(we=>we.identifier!==bt)}:Lt)),yt(`${n.removed_successfully}`,n.success,"check-circle"),P.set(""),E.set(!1),et()):yt(n.user_removal_failed,n.error,"exclamation-circle")}catch(Ct){console.error(Ct),yt(n.user_removal_failed,n.error,"exclamation-circle")}else yt(n.select_account_and_user,n.error,"exclamation-circle")}async function X(q){(await Dt("ps-banking:client:deleteAccount",{accountId:q})).success?(k.update(Ct=>Ct.filter(_t=>_t.id!==q)),yt(n.account_deleted_successfully,n.success,"check-circle"),T.set(!1)):yt(n.account_deletion_failed,n.error,"exclamation-circle")}async function K(){const q=qt(B),bt=qt(F),Ct=Math.max(...qt(k).map(Ot=>Ot.id))+1,_t=Math.random().toString().slice(2,18),Zt=Kg(_t),Lt={id:Ct,balance:bt,holder:q,cardNumber:Zt,users:[],owner:{state:!0,name:qt(M).name,identifier:qt(M).identifier}};(await Dt("ps-banking:client:createNewAccount",{newAccount:Lt})).success?(k.update(Ot=>[...Ot,Lt]),B.set(""),F.set(0),C.set(!1),et(),yt(n.new_account_created_successfully,n.success,"check-circle")):yt(n.new_account_creation_failed,n.error,"exclamation-circle")}async function Z(){const q=qt(H),bt=qt(W);q!==null&&bt>0?(await Dt("ps-banking:client:withdrawFromAccount",{accountId:q,amount:bt})).success?(k.update(_t=>_t.map(Lt=>Lt.id===q&&Lt.balance>=bt?{...Lt,balance:Lt.balance-bt}:Lt)),yt(`${n.withdrew} ${bt} ${n.successfully}`,n.success,"check-circle"),W.set(0),O.set(!1)):yt(n.withdrawal_failed,n.error,"exclamation-circle"):yt(n.select_valid_account_and_amount,n.error,"exclamation-circle")}async function J(){const q=qt(H),bt=qt(W);q!==null&&bt>0?(await Dt("ps-banking:client:depositToAccount",{accountId:q,amount:bt})).success?(k.update(_t=>_t.map(Lt=>Lt.id===q?{...Lt,balance:Lt.balance+bt}:Lt)),yt(`${n.deposited} ${bt} ${n.successfully}`,n.success,"check-circle"),W.set(0),N.set(!1)):yt(n.deposit_failed,n.error,"exclamation-circle"):yt(n.select_valid_account_and_amount,n.error,"exclamation-circle")}async function st(){try{const q=await Dt("ps-banking:client:getUser",{});M.set(q)}catch(q){console.error(q)}}async function et(){try{const q=await Dt("ps-banking:client:getAccounts",{});k.set(q)}catch(q){console.error(q)}}Di(()=>{st(),et()});const vt=q=>q.identifier===qt(M).identifier,at=q=>D(q.id),ut=q=>L.set(q.id),U=q=>S.set(q.id),j=q=>{H.set(q.id),P.set(""),E.set(!0)},lt=q=>{H.set(q.id),T.set(!0)},kt=q=>{H.set(q.id),N.set(!0)},mt=q=>{H.set(q.id),O.set(!0)},Xt=()=>C.set(!0);function jt(){l=ge(this.value),V.set(l)}const Jt=()=>{S.set(!1),V.set(0)},Et=()=>A(qt(S),l);function gt(){c=this.value,R.set(c)}const ft=()=>L.set(!1),Mt=()=>$(qt(L));function Qt(){f=this.value,B.set(f)}const dt=()=>C.set(!1),Ht=()=>T.set(!1),ue=()=>X(qt(H)),de=q=>q.id===_;function De(){m=cu(this),P.set(m)}const Ae=()=>{E.set(!1),P.set("")};function ke(){v=ge(this.value),W.set(v)}const _e=()=>{O.set(!1),W.set(0)};function me(){v=ge(this.value),W.set(v)}return[n,s,o,r,l,a,c,d,f,p,g,m,_,y,v,w,M,k,S,L,C,T,E,O,N,V,R,B,H,P,W,$,D,A,Y,X,K,Z,J,vt,at,ut,U,j,lt,kt,mt,Xt,jt,Jt,Et,gt,ft,Mt,Qt,dt,Ht,ue,de,De,Ae,ke,_e,me,()=>{N.set(!1),W.set(0)}]}class Qg extends je{constructor(t){super(),We(this,t,Gg,qg,Ee,{},null,[-1,-1,-1])}}function Zg(i){let t,e;return t=new Qg({}),{c(){oi(t.$$.fragment)},m(n,s){ze(t,n,s),e=!0},i(n){e||(rt(t.$$.fragment,n),e=!0)},o(n){pt(t.$$.fragment,n),e=!1},d(n){Ne(t,n)}}}function Jg(i){let t,e;return t=new Xg({}),{c(){oi(t.$$.fragment)},m(n,s){ze(t,n,s),e=!0},i(n){e||(rt(t.$$.fragment,n),e=!0)},o(n){pt(t.$$.fragment,n),e=!1},d(n){Ne(t,n)}}}function tm(i){let t,e;return t=new Hg({}),{c(){oi(t.$$.fragment)},m(n,s){ze(t,n,s),e=!0},i(n){e||(rt(t.$$.fragment,n),e=!0)},o(n){pt(t.$$.fragment,n),e=!1},d(n){Ne(t,n)}}}function em(i){let t,e;return t=new Ng({}),{c(){oi(t.$$.fragment)},m(n,s){ze(t,n,s),e=!0},i(n){e||(rt(t.$$.fragment,n),e=!0)},o(n){pt(t.$$.fragment,n),e=!1},d(n){Ne(t,n)}}}function im(i){let t,e;return t=new Ig({}),{c(){oi(t.$$.fragment)},m(n,s){ze(t,n,s),e=!0},i(n){e||(rt(t.$$.fragment,n),e=!0)},o(n){pt(t.$$.fragment,n),e=!1},d(n){Ne(t,n)}}}function nm(i){let t,e;return t=new Rg({}),{c(){oi(t.$$.fragment)},m(n,s){ze(t,n,s),e=!0},i(n){e||(rt(t.$$.fragment,n),e=!0)},o(n){pt(t.$$.fragment,n),e=!1},d(n){Ne(t,n)}}}function sm(i){let t,e;return t=new Lg({}),{c(){oi(t.$$.fragment)},m(n,s){ze(t,n,s),e=!0},i(n){e||(rt(t.$$.fragment,n),e=!0)},o(n){pt(t.$$.fragment,n),e=!1},d(n){Ne(t,n)}}}function om(i){let t,e,n,s,o,r,l,a,c,d,f,p,g,m,_=i[7].overview+"",y,v,w,M,k,S,L,C,T,E=i[7].bills+"",O,N,V,R,B,F,H,P,W,$=i[7].history+"",D,A,Y,X,K,Z,J,st,et,vt=i[7].withdraw+"",at,ut,U,j,lt,kt,mt,Xt,jt,Jt=i[7].deposit+"",Et,gt,ft,Mt,Qt,dt,Ht,ue,de,De=i[7].stats+"",Ae,ke,_e,me,Pe,q,bt,Ct,_t,Zt=i[7].accounts+"",Lt,we,Ot,ie,Vt,nt,zt,ht=i[7].close+"",Me,pi,gi,It,Ye,Ni;const Ci=[sm,nm,im,em,tm,Jg,Zg],Fe=[];function un(wt,ne){return wt[0]?0:wt[1]?1:wt[2]?2:wt[3]?3:wt[4]?4:wt[5]?5:wt[6]?6:-1}return~(n=un(i))&&(s=Fe[n]=Ci[n](i)),{c(){t=b("div"),e=b("div"),s&&s.c(),o=x(),r=b("div"),l=b("div"),a=b("label"),c=b("input"),d=x(),f=b("span"),p=b("i"),g=x(),m=b("span"),y=I(_),v=x(),w=b("label"),M=b("input"),k=x(),S=b("span"),L=b("i"),C=x(),T=b("span"),O=I(E),N=x(),V=b("label"),R=b("input"),B=x(),F=b("span"),H=b("i"),P=x(),W=b("span"),D=I($),A=x(),Y=b("label"),X=b("input"),K=x(),Z=b("span"),J=b("i"),st=x(),et=b("span"),at=I(vt),ut=x(),U=b("label"),j=b("input"),lt=x(),kt=b("span"),mt=b("i"),Xt=x(),jt=b("span"),Et=I(Jt),gt=x(),ft=b("label"),Mt=b("input"),Qt=x(),dt=b("span"),Ht=b("i"),ue=x(),de=b("span"),Ae=I(De),ke=x(),_e=b("label"),me=b("input"),Pe=x(),q=b("span"),bt=b("i"),Ct=x(),_t=b("span"),Lt=I(Zt),we=x(),Ot=b("div"),ie=b("button"),Vt=b("i"),nt=x(),zt=b("span"),Me=I(ht),h(c,"type","radio"),h(c,"name","radio"),c.value="overview",h(c,"class","hidden peer"),c.checked=i[0],h(p,"class","fa-duotone fa-house text-3xl text-blue-300 mb-2"),h(m,"class","relative"),h(f,"class","w-[97%] relative flex flex-col items-center text-gray-300 py-4 peer-checked:shadow-md transition-all duration-500 rounded-xl peer-checked:text-blue-400 peer-checked:shadow-lg hover:text-blue-300 duration-500 peer-checked:bg-gray-600 hover:cursor-pointer hover:bg-gray-800/80"),h(a,"class","text-white font-bold p-0 rounded flex flex-col items-center uppercase w-[97%]"),h(M,"type","radio"),h(M,"name","radio"),M.value="send",h(M,"class","hidden peer"),M.checked=i[1],h(L,"class","fa-duotone fa-file-invoice text-3xl text-blue-300 mb-2"),h(T,"class","relative"),h(S,"class","w-[97%] relative flex flex-col items-center text-gray-300 py-4 peer-checked:shadow-md transition-all duration-500 rounded-xl peer-checked:text-blue-400 peer-checked:shadow-lg hover:text-blue-300 duration-500 peer-checked:bg-gray-600 hover:cursor-pointer hover:bg-gray-800/80"),h(w,"class","text-white font-bold p-0 rounded flex flex-col items-center uppercase w-[97%]"),h(R,"type","radio"),h(R,"name","radio"),R.value="history",h(R,"class","hidden peer"),R.checked=i[2],h(H,"class","fa-duotone fa-circle-dollar text-3xl text-blue-300 mb-2"),h(W,"class","relative"),h(F,"class","w-[97%] relative flex flex-col items-center text-gray-300 py-4 peer-checked:shadow-md transition-all duration-500 rounded-xl peer-checked:text-blue-400 peer-checked:shadow-lg hover:text-blue-300 duration-500 peer-checked:bg-gray-600 hover:cursor-pointer hover:bg-gray-800/80"),h(V,"class","text-white font-bold p-0 rounded flex flex-col items-center uppercase w-[97%]"),h(X,"type","radio"),h(X,"name","radio"),X.value="control",h(X,"class","hidden peer"),X.checked=i[3],h(J,"class","fa-duotone fa-minus text-3xl text-blue-300 mb-2"),h(et,"class","relative"),h(Z,"class","w-[97%] relative flex flex-col items-center text-gray-300 py-4 peer-checked:shadow-md transition-all duration-500 rounded-xl peer-checked:text-blue-400 peer-checked:shadow-lg hover:text-blue-300 duration-500 peer-checked:bg-gray-600 hover:cursor-pointer hover:bg-gray-800/80"),h(Y,"class","text-white font-bold p-0 rounded flex flex-col items-center uppercase w-[97%]"),h(j,"type","radio"),h(j,"name","radio"),j.value="control",h(j,"class","hidden peer"),j.checked=i[4],h(mt,"class","fa-duotone fa-plus text-3xl text-blue-300 mb-2"),h(jt,"class","relative"),h(kt,"class","w-[97%] relative flex flex-col items-center text-gray-300 py-4 peer-checked:shadow-md transition-all duration-500 rounded-xl peer-checked:text-blue-400 peer-checked:shadow-lg hover:text-blue-300 duration-500 peer-checked:bg-gray-600 hover:cursor-pointer hover:bg-gray-800/80"),h(U,"class","text-white font-bold p-0 rounded flex flex-col items-center uppercase w-[97%]"),h(Mt,"type","radio"),h(Mt,"name","radio"),Mt.value="control",h(Mt,"class","hidden peer"),Mt.checked=i[5],h(Ht,"class","fa-duotone fa-chart-simple text-3xl text-blue-300 mb-2"),h(de,"class","relative"),h(dt,"class","w-[97%] relative flex flex-col items-center text-gray-300 py-4 peer-checked:shadow-md transition-all duration-500 rounded-xl peer-checked:text-blue-400 peer-checked:shadow-lg hover:text-blue-300 duration-500 peer-checked:bg-gray-600 hover:cursor-pointer hover:bg-gray-800/80"),h(ft,"class","text-white font-bold p-0 rounded flex flex-col items-center uppercase w-[97%]"),h(me,"type","radio"),h(me,"name","radio"),me.value="control",h(me,"class","hidden peer"),me.checked=i[6],h(bt,"class","fa-duotone fa-users text-3xl text-blue-300 mb-2"),h(_t,"class","relative"),h(q,"class","w-[97%] relative flex flex-col items-center text-gray-300 py-4 peer-checked:shadow-md transition-all duration-500 rounded-xl peer-checked:text-blue-400 peer-checked:shadow-lg hover:text-blue-300 duration-500 peer-checked:bg-gray-600 hover:cursor-pointer hover:bg-gray-800/80"),h(_e,"class","text-white font-bold p-0 rounded flex flex-col items-center uppercase w-[97%]"),h(Vt,"class","fa-duotone fa-circle-xmark text-3xl text-blue-300 mb-2"),h(zt,"class","relative"),h(ie,"class","w-[95%] text-blue-200 font-bold uppercase p-5 rounded-lg hover:bg-gray-800/80 duration-500 h-[100px] flex flex-col items-center"),h(Ot,"class","relative -bottom-48 left-[.5px]"),h(l,"class","relative h-full w-full top-3 left-[2px] space-y-2"),h(r,"class","relative bg-gray-700/90 left-0 border border-gray-600/40 h-full w-28 flex flex-col items-center rounded-l-xl overflow-hidden"),h(e,"class","absolute w-[80%] h-[90%] rounded-xl overflow-hidden"),h(t,"class","h-screen w-screen flex flex-col items-center justify-center select-none overflow-hidden")},m(wt,ne){Q(wt,t,ne),u(t,e),~n&&Fe[n].m(e,null),u(e,o),u(e,r),u(r,l),u(l,a),u(a,c),u(a,d),u(a,f),u(f,p),u(f,g),u(f,m),u(m,y),u(l,v),u(l,w),u(w,M),u(w,k),u(w,S),u(S,L),u(S,C),u(S,T),u(T,O),u(l,N),u(l,V),u(V,R),u(V,B),u(V,F),u(F,H),u(F,P),u(F,W),u(W,D),u(l,A),u(l,Y),u(Y,X),u(Y,K),u(Y,Z),u(Z,J),u(Z,st),u(Z,et),u(et,at),u(l,ut),u(l,U),u(U,j),u(U,lt),u(U,kt),u(kt,mt),u(kt,Xt),u(kt,jt),u(jt,Et),u(l,gt),u(l,ft),u(ft,Mt),u(ft,Qt),u(ft,dt),u(dt,Ht),u(dt,ue),u(dt,de),u(de,Ae),u(l,ke),u(l,_e),u(_e,me),u(_e,Pe),u(_e,q),u(q,bt),u(q,Ct),u(q,_t),u(_t,Lt),u(l,we),u(l,Ot),u(Ot,ie),u(ie,Vt),u(ie,nt),u(ie,zt),u(zt,Me),It=!0,Ye||(Ni=[tt(c,"change",i[8]),tt(M,"change",i[9]),tt(R,"change",i[10]),tt(X,"change",i[11]),tt(j,"change",i[12]),tt(Mt,"change",i[13]),tt(me,"change",i[14]),tt(ie,"click",i[15])],Ye=!0)},p(wt,[ne]){let Ue=n;n=un(wt),n!==Ue&&(s&&(le(),pt(Fe[Ue],1,1,()=>{Fe[Ue]=null}),ae()),~n?(s=Fe[n],s||(s=Fe[n]=Ci[n](wt),s.c()),rt(s,1),s.m(e,o)):s=null),(!It||ne&1)&&(c.checked=wt[0]),(!It||ne&128)&&_!==(_=wt[7].overview+"")&&z(y,_),(!It||ne&2)&&(M.checked=wt[1]),(!It||ne&128)&&E!==(E=wt[7].bills+"")&&z(O,E),(!It||ne&4)&&(R.checked=wt[2]),(!It||ne&128)&&$!==($=wt[7].history+"")&&z(D,$),(!It||ne&8)&&(X.checked=wt[3]),(!It||ne&128)&&vt!==(vt=wt[7].withdraw+"")&&z(at,vt),(!It||ne&16)&&(j.checked=wt[4]),(!It||ne&128)&&Jt!==(Jt=wt[7].deposit+"")&&z(Et,Jt),(!It||ne&32)&&(Mt.checked=wt[5]),(!It||ne&128)&&De!==(De=wt[7].stats+"")&&z(Ae,De),(!It||ne&64)&&(me.checked=wt[6]),(!It||ne&128)&&Zt!==(Zt=wt[7].accounts+"")&&z(Lt,Zt),(!It||ne&128)&&ht!==(ht=wt[7].close+"")&&z(Me,ht)},i(wt){It||(rt(s),wt&&Wt(()=>{It&&(gi&&gi.end(1),pi=ee(e,Kt,{duration:1e3,easing:Tt}),pi.start())}),It=!0)},o(wt){pt(s),pi&&pi.invalidate(),wt&&(gi=be(e,Ws,{duration:1e3,easing:Tt})),It=!1},d(wt){wt&&G(t),~n&&Fe[n].d(),wt&&gi&&gi.end(),Ye=!1,Ut(Ni)}}}function rm(i,t,e){let n,s,o,r,l,a,c,d;it(i,Ze,k=>e(0,n=k)),it(i,Je,k=>e(1,s=k)),it(i,ti,k=>e(2,o=k)),it(i,ei,k=>e(3,r=k)),it(i,mi,k=>e(4,l=k)),it(i,bi,k=>e(5,a=k)),it(i,_i,k=>e(6,c=k)),it(i,Be,k=>e(7,d=k));async function f(){try{const k=await Dt("ps-banking:client:getMoneyTypes",{}),S=k.find(C=>C.name==="bank"),L=k.find(C=>C.name==="cash");S&&ni.set(S.amount),L&&fi.set(L.amount)}catch(k){console.error(k)}}return Di(async()=>{f();try{const k=await Dt("ps-banking:client:getLocales",{});Be.set(k)}catch(k){console.error(k)}}),[n,s,o,r,l,a,c,d,()=>{Ze.set(!0),Je.set(!1),ti.set(!1),ei.set(!1),mi.set(!1),bi.set(!1),_i.set(!1)},()=>{Ze.set(!1),Je.set(!0),ti.set(!1),ei.set(!1),mi.set(!1),bi.set(!1),_i.set(!1)},()=>{Ze.set(!1),Je.set(!1),ti.set(!0),ei.set(!1),mi.set(!1),bi.set(!1),_i.set(!1)},()=>{Ze.set(!1),Je.set(!1),ti.set(!1),ei.set(!0),mi.set(!1),bi.set(!1),_i.set(!1)},()=>{Ze.set(!1),Je.set(!1),ti.set(!1),ei.set(!1),mi.set(!0),bi.set(!1),_i.set(!1)},()=>{Ze.set(!1),Je.set(!1),ti.set(!1),ei.set(!1),mi.set(!1),bi.set(!0),_i.set(!1)},()=>{Ze.set(!1),Je.set(!1),ti.set(!1),ei.set(!1),mi.set(!1),bi.set(!1),_i.set(!0)},()=>{Dt("ps-banking:client:hideUI"),wn.set(!1)}]}class lm extends je{constructor(t){super(),We(this,t,rm,om,Ee,{})}}const am=()=>!window.invokeNative,cm=(i,t=1e3)=>{if(am())for(const e of i)setTimeout(()=>{window.dispatchEvent(new MessageEvent("message",{data:{action:e.action,data:e.data}}))},t)};function Fa(i,t,e){const n=i.slice();return n[2]=t[e],n}function Ia(i,t,e){const n=i.slice();return n[2]=t[e],n}function um(i){let t,e;return t=new lm({}),{c(){oi(t.$$.fragment)},m(n,s){ze(t,n,s),e=!0},i(n){e||(rt(t.$$.fragment,n),e=!0)},o(n){pt(t.$$.fragment,n),e=!1},d(n){Ne(t,n)}}}function dm(i){let t,e=[],n=new Map,s,o=oe(i[1]);const r=l=>l[2].id;for(let l=0;l<o.length;l+=1){let a=Fa(i,o,l),c=r(a);n.set(c,e[l]=Ba(c,a))}return{c(){t=b("div");for(let l=0;l<e.length;l+=1)e[l].c();h(t,"class","absolute bottom-24 right-[12%] grid grid-cols-1 gap-2 select-none")},m(l,a){Q(l,t,a);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);s=!0},p(l,a){a&2&&(o=oe(l[1]),le(),e=an(e,a,r,1,l,o,n,t,jn,Ba,null,Fa),ae())},i(l){if(!s){for(let a=0;a<o.length;a+=1)rt(e[a]);s=!0}},o(l){for(let a=0;a<e.length;a+=1)pt(e[a]);s=!1},d(l){l&&G(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function fm(i){let t,e=[],n=new Map,s,o=oe(i[1]);const r=l=>l[2].id;for(let l=0;l<o.length;l+=1){let a=Ia(i,o,l),c=r(a);n.set(c,e[l]=za(c,a))}return{c(){t=b("div");for(let l=0;l<e.length;l+=1)e[l].c();h(t,"class","absolute bottom-44 right-[22%] grid grid-cols-1 gap-2 select-none")},m(l,a){Q(l,t,a);for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(t,null);s=!0},p(l,a){a&2&&(o=oe(l[1]),le(),e=an(e,a,r,1,l,o,n,t,jn,za,null,Ia),ae())},i(l){if(!s){for(let a=0;a<o.length;a+=1)rt(e[a]);s=!0}},o(l){for(let a=0;a<e.length;a+=1)pt(e[a]);s=!1},d(l){l&&G(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Ba(i,t){let e,n,s,o,r,l,a=t[2].title+"",c,d,f,p=t[2].message+"",g,m,_,y,v;return{key:i,first:null,c(){e=b("div"),n=b("i"),o=x(),r=b("div"),l=b("p"),c=I(a),d=x(),f=b("p"),g=I(p),m=x(),h(n,"class",s="fa-duotone fa-"+t[2].icon+" text-2xl"),h(l,"class","font-bold"),h(e,"class","bg-gray-900 text-blue-200 py-3 px-6 rounded-lg shadow-xl flex items-center space-x-3 transform transition-transform duration-500 border border-gray-700/50"),this.first=e},m(w,M){Q(w,e,M),u(e,n),u(e,o),u(e,r),u(r,l),u(l,c),u(r,d),u(r,f),u(f,g),u(e,m),v=!0},p(w,M){t=w,(!v||M&2&&s!==(s="fa-duotone fa-"+t[2].icon+" text-2xl"))&&h(n,"class",s),(!v||M&2)&&a!==(a=t[2].title+"")&&z(c,a),(!v||M&2)&&p!==(p=t[2].message+"")&&z(g,p)},i(w){v||(w&&Wt(()=>{v&&(y&&y.end(1),_=ee(e,He,{duration:300}),_.start())}),v=!0)},o(w){_&&_.invalidate(),w&&(y=be(e,Ws,{duration:300})),v=!1},d(w){w&&G(e),w&&y&&y.end()}}}function za(i,t){let e,n,s,o,r,l,a=t[2].title+"",c,d,f,p=t[2].message+"",g,m,_,y,v;return{key:i,first:null,c(){e=b("div"),n=b("i"),o=x(),r=b("div"),l=b("p"),c=I(a),d=x(),f=b("p"),g=I(p),m=x(),h(n,"class",s="fa-duotone fa-"+t[2].icon+" text-2xl"),h(l,"class","font-bold"),h(e,"class","bg-gray-900 text-blue-200 py-3 px-6 rounded-lg shadow-xl flex items-center space-x-3 transform transition-transform duration-500 border border-gray-700/50"),this.first=e},m(w,M){Q(w,e,M),u(e,n),u(e,o),u(e,r),u(r,l),u(l,c),u(r,d),u(r,f),u(f,g),u(e,m),v=!0},p(w,M){t=w,(!v||M&2&&s!==(s="fa-duotone fa-"+t[2].icon+" text-2xl"))&&h(n,"class",s),(!v||M&2)&&a!==(a=t[2].title+"")&&z(c,a),(!v||M&2)&&p!==(p=t[2].message+"")&&z(g,p)},i(w){v||(w&&Wt(()=>{v&&(y&&y.end(1),_=ee(e,He,{duration:300}),_.start())}),v=!0)},o(w){_&&_.invalidate(),w&&(y=be(e,Ws,{duration:300})),v=!1},d(w){w&&G(e),w&&y&&y.end()}}}function hm(i){let t,e,n,s,o,r;e=new Lu({props:{$$slots:{default:[um]},$$scope:{ctx:i}}});const l=[fm,dm],a=[];function c(d,f){return d[0]?0:1}return s=c(i),o=a[s]=l[s](i),{c(){t=b("main"),oi(e.$$.fragment),n=x(),o.c()},m(d,f){Q(d,t,f),ze(e,t,null),u(t,n),a[s].m(t,null),r=!0},p(d,[f]){const p={};f&128&&(p.$$scope={dirty:f,ctx:d}),e.$set(p);let g=s;s=c(d),s===g?a[s].p(d,f):(le(),pt(a[g],1,1,()=>{a[g]=null}),ae(),o=a[s],o?o.p(d,f):(o=a[s]=l[s](d),o.c()),rt(o,1),o.m(t,null))},i(d){r||(rt(e.$$.fragment,d),rt(o),r=!0)},o(d){pt(e.$$.fragment,d),pt(o),r=!1},d(d){d&&G(t),Ne(e),a[s].d()}}}function pm(i,t,e){let n,s;return it(i,en,o=>e(0,n=o)),it(i,Bo,o=>e(1,s=o)),cm([{action:"openBank",data:!0}]),[n,s]}class gm extends je{constructor(t){super(),We(this,t,pm,hm,Ee,{})}}new gm({target:document.getElementById("app")});
|