Viewing File: /home/assersoft/public_html/audiogramnew/public/assets/index-CMfWEJt7.js
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(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 i(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var fL=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function n0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $m={exports:{}},Xf={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var z2;function m3(){if(z2)return Xf;z2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,s,o){var l=null;if(o!==void 0&&(l=""+o),s.key!==void 0&&(l=""+s.key),"key"in s){o={};for(var u in s)u!=="key"&&(o[u]=s[u])}else o=s;return s=o.ref,{$$typeof:e,type:i,key:l,ref:s!==void 0?s:null,props:o}}return Xf.Fragment=t,Xf.jsx=n,Xf.jsxs=n,Xf}var F2;function g3(){return F2||(F2=1,$m.exports=m3()),$m.exports}var L=g3(),Zm={exports:{}},qe={};/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var q2;function b3(){if(q2)return qe;q2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function x(Y){return Y===null||typeof Y!="object"?null:(Y=g&&Y[g]||Y["@@iterator"],typeof Y=="function"?Y:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,N={};function E(Y,gt,O){this.props=Y,this.context=gt,this.refs=N,this.updater=O||v}E.prototype.isReactComponent={},E.prototype.setState=function(Y,gt){if(typeof Y!="object"&&typeof Y!="function"&&Y!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Y,gt,"setState")},E.prototype.forceUpdate=function(Y){this.updater.enqueueForceUpdate(this,Y,"forceUpdate")};function j(){}j.prototype=E.prototype;function C(Y,gt,O){this.props=Y,this.context=gt,this.refs=N,this.updater=O||v}var z=C.prototype=new j;z.constructor=C,A(z,E.prototype),z.isPureReactComponent=!0;var Z=Array.isArray,I={H:null,A:null,T:null,S:null,V:null},st=Object.prototype.hasOwnProperty;function K(Y,gt,O,q,$,rt){return O=rt.ref,{$$typeof:e,type:Y,key:gt,ref:O!==void 0?O:null,props:rt}}function H(Y,gt){return K(Y.type,gt,void 0,void 0,void 0,Y.props)}function G(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===e}function Q(Y){var gt={"=":"=0",":":"=2"};return"$"+Y.replace(/[=:]/g,function(O){return gt[O]})}var D=/\/+/g;function R(Y,gt){return typeof Y=="object"&&Y!==null&&Y.key!=null?Q(""+Y.key):gt.toString(36)}function et(){}function nt(Y){switch(Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason;default:switch(typeof Y.status=="string"?Y.then(et,et):(Y.status="pending",Y.then(function(gt){Y.status==="pending"&&(Y.status="fulfilled",Y.value=gt)},function(gt){Y.status==="pending"&&(Y.status="rejected",Y.reason=gt)})),Y.status){case"fulfilled":return Y.value;case"rejected":throw Y.reason}}throw Y}function dt(Y,gt,O,q,$){var rt=typeof Y;(rt==="undefined"||rt==="boolean")&&(Y=null);var at=!1;if(Y===null)at=!0;else switch(rt){case"bigint":case"string":case"number":at=!0;break;case"object":switch(Y.$$typeof){case e:case t:at=!0;break;case m:return at=Y._init,dt(at(Y._payload),gt,O,q,$)}}if(at)return $=$(Y),at=q===""?"."+R(Y,0):q,Z($)?(O="",at!=null&&(O=at.replace(D,"$&/")+"/"),dt($,gt,O,"",function(Tt){return Tt})):$!=null&&(G($)&&($=H($,O+($.key==null||Y&&Y.key===$.key?"":(""+$.key).replace(D,"$&/")+"/")+at)),gt.push($)),1;at=0;var At=q===""?".":q+":";if(Z(Y))for(var St=0;St<Y.length;St++)q=Y[St],rt=At+R(q,St),at+=dt(q,gt,O,rt,$);else if(St=x(Y),typeof St=="function")for(Y=St.call(Y),St=0;!(q=Y.next()).done;)q=q.value,rt=At+R(q,St++),at+=dt(q,gt,O,rt,$);else if(rt==="object"){if(typeof Y.then=="function")return dt(nt(Y),gt,O,q,$);throw gt=String(Y),Error("Objects are not valid as a React child (found: "+(gt==="[object Object]"?"object with keys {"+Object.keys(Y).join(", ")+"}":gt)+"). If you meant to render a collection of children, use an array instead.")}return at}function W(Y,gt,O){if(Y==null)return Y;var q=[],$=0;return dt(Y,q,"","",function(rt){return gt.call(O,rt,$++)}),q}function lt(Y){if(Y._status===-1){var gt=Y._result;gt=gt(),gt.then(function(O){(Y._status===0||Y._status===-1)&&(Y._status=1,Y._result=O)},function(O){(Y._status===0||Y._status===-1)&&(Y._status=2,Y._result=O)}),Y._status===-1&&(Y._status=0,Y._result=gt)}if(Y._status===1)return Y._result.default;throw Y._result}var ut=typeof reportError=="function"?reportError:function(Y){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var gt=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof Y=="object"&&Y!==null&&typeof Y.message=="string"?String(Y.message):String(Y),error:Y});if(!window.dispatchEvent(gt))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",Y);return}console.error(Y)};function wt(){}return qe.Children={map:W,forEach:function(Y,gt,O){W(Y,function(){gt.apply(this,arguments)},O)},count:function(Y){var gt=0;return W(Y,function(){gt++}),gt},toArray:function(Y){return W(Y,function(gt){return gt})||[]},only:function(Y){if(!G(Y))throw Error("React.Children.only expected to receive a single React element child.");return Y}},qe.Component=E,qe.Fragment=n,qe.Profiler=s,qe.PureComponent=C,qe.StrictMode=i,qe.Suspense=f,qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,qe.__COMPILER_RUNTIME={__proto__:null,c:function(Y){return I.H.useMemoCache(Y)}},qe.cache=function(Y){return function(){return Y.apply(null,arguments)}},qe.cloneElement=function(Y,gt,O){if(Y==null)throw Error("The argument must be a React element, but you passed "+Y+".");var q=A({},Y.props),$=Y.key,rt=void 0;if(gt!=null)for(at in gt.ref!==void 0&&(rt=void 0),gt.key!==void 0&&($=""+gt.key),gt)!st.call(gt,at)||at==="key"||at==="__self"||at==="__source"||at==="ref"&>.ref===void 0||(q[at]=gt[at]);var at=arguments.length-2;if(at===1)q.children=O;else if(1<at){for(var At=Array(at),St=0;St<at;St++)At[St]=arguments[St+2];q.children=At}return K(Y.type,$,void 0,void 0,rt,q)},qe.createContext=function(Y){return Y={$$typeof:l,_currentValue:Y,_currentValue2:Y,_threadCount:0,Provider:null,Consumer:null},Y.Provider=Y,Y.Consumer={$$typeof:o,_context:Y},Y},qe.createElement=function(Y,gt,O){var q,$={},rt=null;if(gt!=null)for(q in gt.key!==void 0&&(rt=""+gt.key),gt)st.call(gt,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&($[q]=gt[q]);var at=arguments.length-2;if(at===1)$.children=O;else if(1<at){for(var At=Array(at),St=0;St<at;St++)At[St]=arguments[St+2];$.children=At}if(Y&&Y.defaultProps)for(q in at=Y.defaultProps,at)$[q]===void 0&&($[q]=at[q]);return K(Y,rt,void 0,void 0,null,$)},qe.createRef=function(){return{current:null}},qe.forwardRef=function(Y){return{$$typeof:u,render:Y}},qe.isValidElement=G,qe.lazy=function(Y){return{$$typeof:m,_payload:{_status:-1,_result:Y},_init:lt}},qe.memo=function(Y,gt){return{$$typeof:d,type:Y,compare:gt===void 0?null:gt}},qe.startTransition=function(Y){var gt=I.T,O={};I.T=O;try{var q=Y(),$=I.S;$!==null&&$(O,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then(wt,ut)}catch(rt){ut(rt)}finally{I.T=gt}},qe.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},qe.use=function(Y){return I.H.use(Y)},qe.useActionState=function(Y,gt,O){return I.H.useActionState(Y,gt,O)},qe.useCallback=function(Y,gt){return I.H.useCallback(Y,gt)},qe.useContext=function(Y){return I.H.useContext(Y)},qe.useDebugValue=function(){},qe.useDeferredValue=function(Y,gt){return I.H.useDeferredValue(Y,gt)},qe.useEffect=function(Y,gt,O){var q=I.H;if(typeof O=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return q.useEffect(Y,gt)},qe.useId=function(){return I.H.useId()},qe.useImperativeHandle=function(Y,gt,O){return I.H.useImperativeHandle(Y,gt,O)},qe.useInsertionEffect=function(Y,gt){return I.H.useInsertionEffect(Y,gt)},qe.useLayoutEffect=function(Y,gt){return I.H.useLayoutEffect(Y,gt)},qe.useMemo=function(Y,gt){return I.H.useMemo(Y,gt)},qe.useOptimistic=function(Y,gt){return I.H.useOptimistic(Y,gt)},qe.useReducer=function(Y,gt,O){return I.H.useReducer(Y,gt,O)},qe.useRef=function(Y){return I.H.useRef(Y)},qe.useState=function(Y){return I.H.useState(Y)},qe.useSyncExternalStore=function(Y,gt,O){return I.H.useSyncExternalStore(Y,gt,O)},qe.useTransition=function(){return I.H.useTransition()},qe.version="19.1.0",qe}var U2;function i0(){return U2||(U2=1,Zm.exports=b3()),Zm.exports}var ot=i0();const Jt=n0(ot);var Qm={exports:{}},Kf={},Jm={exports:{}},tg={};/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var I2;function y3(){return I2||(I2=1,function(e){function t(W,lt){var ut=W.length;W.push(lt);t:for(;0<ut;){var wt=ut-1>>>1,Y=W[wt];if(0<s(Y,lt))W[wt]=lt,W[ut]=Y,ut=wt;else break t}}function n(W){return W.length===0?null:W[0]}function i(W){if(W.length===0)return null;var lt=W[0],ut=W.pop();if(ut!==lt){W[0]=ut;t:for(var wt=0,Y=W.length,gt=Y>>>1;wt<gt;){var O=2*(wt+1)-1,q=W[O],$=O+1,rt=W[$];if(0>s(q,ut))$<Y&&0>s(rt,q)?(W[wt]=rt,W[$]=ut,wt=$):(W[wt]=q,W[O]=ut,wt=O);else if($<Y&&0>s(rt,ut))W[wt]=rt,W[$]=ut,wt=$;else break t}}return lt}function s(W,lt){var ut=W.sortIndex-lt.sortIndex;return ut!==0?ut:W.id-lt.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var f=[],d=[],m=1,g=null,x=3,v=!1,A=!1,N=!1,E=!1,j=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function Z(W){for(var lt=n(d);lt!==null;){if(lt.callback===null)i(d);else if(lt.startTime<=W)i(d),lt.sortIndex=lt.expirationTime,t(f,lt);else break;lt=n(d)}}function I(W){if(N=!1,Z(W),!A)if(n(f)!==null)A=!0,st||(st=!0,R());else{var lt=n(d);lt!==null&&dt(I,lt.startTime-W)}}var st=!1,K=-1,H=5,G=-1;function Q(){return E?!0:!(e.unstable_now()-G<H)}function D(){if(E=!1,st){var W=e.unstable_now();G=W;var lt=!0;try{t:{A=!1,N&&(N=!1,C(K),K=-1),v=!0;var ut=x;try{e:{for(Z(W),g=n(f);g!==null&&!(g.expirationTime>W&&Q());){var wt=g.callback;if(typeof wt=="function"){g.callback=null,x=g.priorityLevel;var Y=wt(g.expirationTime<=W);if(W=e.unstable_now(),typeof Y=="function"){g.callback=Y,Z(W),lt=!0;break e}g===n(f)&&i(f),Z(W)}else i(f);g=n(f)}if(g!==null)lt=!0;else{var gt=n(d);gt!==null&&dt(I,gt.startTime-W),lt=!1}}break t}finally{g=null,x=ut,v=!1}lt=void 0}}finally{lt?R():st=!1}}}var R;if(typeof z=="function")R=function(){z(D)};else if(typeof MessageChannel<"u"){var et=new MessageChannel,nt=et.port2;et.port1.onmessage=D,R=function(){nt.postMessage(null)}}else R=function(){j(D,0)};function dt(W,lt){K=j(function(){W(e.unstable_now())},lt)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(W){W.callback=null},e.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<W?Math.floor(1e3/W):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(W){switch(x){case 1:case 2:case 3:var lt=3;break;default:lt=x}var ut=x;x=lt;try{return W()}finally{x=ut}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(W,lt){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var ut=x;x=W;try{return lt()}finally{x=ut}},e.unstable_scheduleCallback=function(W,lt,ut){var wt=e.unstable_now();switch(typeof ut=="object"&&ut!==null?(ut=ut.delay,ut=typeof ut=="number"&&0<ut?wt+ut:wt):ut=wt,W){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=ut+Y,W={id:m++,callback:lt,priorityLevel:W,startTime:ut,expirationTime:Y,sortIndex:-1},ut>wt?(W.sortIndex=ut,t(d,W),n(f)===null&&W===n(d)&&(N?(C(K),K=-1):N=!0,dt(I,ut-wt))):(W.sortIndex=Y,t(f,W),A||v||(A=!0,st||(st=!0,R()))),W},e.unstable_shouldYield=Q,e.unstable_wrapCallback=function(W){var lt=x;return function(){var ut=x;x=lt;try{return W.apply(this,arguments)}finally{x=ut}}}}(tg)),tg}var H2;function v3(){return H2||(H2=1,Jm.exports=y3()),Jm.exports}var eg={exports:{}},ua={};/**
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var V2;function x3(){if(V2)return ua;V2=1;var e=i0();function t(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(f,d,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:f,containerInfo:d,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return ua.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,ua.createPortal=function(f,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return o(f,d,null,m)},ua.flushSync=function(f){var d=l.T,m=i.p;try{if(l.T=null,i.p=2,f)return f()}finally{l.T=d,i.p=m,i.d.f()}},ua.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,i.d.C(f,d))},ua.prefetchDNS=function(f){typeof f=="string"&&i.d.D(f)},ua.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var m=d.as,g=u(m,d.crossOrigin),x=typeof d.integrity=="string"?d.integrity:void 0,v=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?i.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:v}):m==="script"&&i.d.X(f,{crossOrigin:g,integrity:x,fetchPriority:v,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},ua.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=u(d.as,d.crossOrigin);i.d.M(f,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&i.d.M(f)},ua.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,g=u(m,d.crossOrigin);i.d.L(f,m,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},ua.preloadModule=function(f,d){if(typeof f=="string")if(d){var m=u(d.as,d.crossOrigin);i.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else i.d.m(f)},ua.requestFormReset=function(f){i.d.r(f)},ua.unstable_batchedUpdates=function(f,d){return f(d)},ua.useFormState=function(f,d,m){return l.H.useFormState(f,d,m)},ua.useFormStatus=function(){return l.H.useHostTransitionStatus()},ua.version="19.1.0",ua}var Y2;function oy(){if(Y2)return eg.exports;Y2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),eg.exports=x3(),eg.exports}/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var G2;function w3(){if(G2)return Kf;G2=1;var e=v3(),t=i0(),n=oy();function i(a){var r="https://react.dev/errors/"+a;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)r+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+a+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function o(a){var r=a,c=a;if(a.alternate)for(;r.return;)r=r.return;else{a=r;do r=a,(r.flags&4098)!==0&&(c=r.return),a=r.return;while(a)}return r.tag===3?c:null}function l(a){if(a.tag===13){var r=a.memoizedState;if(r===null&&(a=a.alternate,a!==null&&(r=a.memoizedState)),r!==null)return r.dehydrated}return null}function u(a){if(o(a)!==a)throw Error(i(188))}function f(a){var r=a.alternate;if(!r){if(r=o(a),r===null)throw Error(i(188));return r!==a?null:a}for(var c=a,h=r;;){var b=c.return;if(b===null)break;var w=b.alternate;if(w===null){if(h=b.return,h!==null){c=h;continue}break}if(b.child===w.child){for(w=b.child;w;){if(w===c)return u(b),a;if(w===h)return u(b),r;w=w.sibling}throw Error(i(188))}if(c.return!==h.return)c=b,h=w;else{for(var M=!1,V=b.child;V;){if(V===c){M=!0,c=b,h=w;break}if(V===h){M=!0,h=b,c=w;break}V=V.sibling}if(!M){for(V=w.child;V;){if(V===c){M=!0,c=w,h=b;break}if(V===h){M=!0,h=w,c=b;break}V=V.sibling}if(!M)throw Error(i(189))}}if(c.alternate!==h)throw Error(i(190))}if(c.tag!==3)throw Error(i(188));return c.stateNode.current===c?a:r}function d(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a;for(a=a.child;a!==null;){if(r=d(a),r!==null)return r;a=a.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),j=Symbol.for("react.provider"),C=Symbol.for("react.consumer"),z=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),st=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),Q=Symbol.for("react.memo_cache_sentinel"),D=Symbol.iterator;function R(a){return a===null||typeof a!="object"?null:(a=D&&a[D]||a["@@iterator"],typeof a=="function"?a:null)}var et=Symbol.for("react.client.reference");function nt(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===et?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case A:return"Fragment";case E:return"Profiler";case N:return"StrictMode";case I:return"Suspense";case st:return"SuspenseList";case G:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case v:return"Portal";case z:return(a.displayName||"Context")+".Provider";case C:return(a._context.displayName||"Context")+".Consumer";case Z:var r=a.render;return a=a.displayName,a||(a=r.displayName||r.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case K:return r=a.displayName||null,r!==null?r:nt(a.type)||"Memo";case H:r=a._payload,a=a._init;try{return nt(a(r))}catch{}}return null}var dt=Array.isArray,W=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,lt=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ut={pending:!1,data:null,method:null,action:null},wt=[],Y=-1;function gt(a){return{current:a}}function O(a){0>Y||(a.current=wt[Y],wt[Y]=null,Y--)}function q(a,r){Y++,wt[Y]=a.current,a.current=r}var $=gt(null),rt=gt(null),at=gt(null),At=gt(null);function St(a,r){switch(q(at,r),q(rt,a),q($,null),r.nodeType){case 9:case 11:a=(a=r.documentElement)&&(a=a.namespaceURI)?h2(a):0;break;default:if(a=r.tagName,r=r.namespaceURI)r=h2(r),a=d2(r,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}O($),q($,a)}function Tt(){O($),O(rt),O(at)}function Zt(a){a.memoizedState!==null&&q(At,a);var r=$.current,c=d2(r,a.type);r!==c&&(q(rt,a),q($,c))}function Qt(a){rt.current===a&&(O($),O(rt)),At.current===a&&(O(At),Hf._currentValue=ut)}var ne=Object.prototype.hasOwnProperty,ie=e.unstable_scheduleCallback,ye=e.unstable_cancelCallback,Bt=e.unstable_shouldYield,ct=e.unstable_requestPaint,me=e.unstable_now,he=e.unstable_getCurrentPriorityLevel,Xt=e.unstable_ImmediatePriority,J=e.unstable_UserBlockingPriority,ht=e.unstable_NormalPriority,mt=e.unstable_LowPriority,Pt=e.unstable_IdlePriority,qt=e.log,Ft=e.unstable_setDisableYieldValue,Kt=null,re=null;function fe(a){if(typeof qt=="function"&&Ft(a),re&&typeof re.setStrictMode=="function")try{re.setStrictMode(Kt,a)}catch{}}var oe=Math.clz32?Math.clz32:En,Se=Math.log,ee=Math.LN2;function En(a){return a>>>=0,a===0?32:31-(Se(a)/ee|0)|0}var Pe=256,ei=4194304;function Ue(a){var r=a&42;if(r!==0)return r;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Qe(a,r,c){var h=a.pendingLanes;if(h===0)return 0;var b=0,w=a.suspendedLanes,M=a.pingedLanes;a=a.warmLanes;var V=h&134217727;return V!==0?(h=V&~w,h!==0?b=Ue(h):(M&=V,M!==0?b=Ue(M):c||(c=V&~a,c!==0&&(b=Ue(c))))):(V=h&~w,V!==0?b=Ue(V):M!==0?b=Ue(M):c||(c=h&~a,c!==0&&(b=Ue(c)))),b===0?0:r!==0&&r!==b&&(r&w)===0&&(w=b&-b,c=r&-r,w>=c||w===32&&(c&4194048)!==0)?r:b}function vi(a,r){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&r)===0}function He(a,r){switch(a){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ji(){var a=Pe;return Pe<<=1,(Pe&4194048)===0&&(Pe=256),a}function jn(){var a=ei;return ei<<=1,(ei&62914560)===0&&(ei=4194304),a}function Wi(a){for(var r=[],c=0;31>c;c++)r.push(a);return r}function ki(a,r){a.pendingLanes|=r,r!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Tn(a,r,c,h,b,w){var M=a.pendingLanes;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=c,a.entangledLanes&=c,a.errorRecoveryDisabledLanes&=c,a.shellSuspendCounter=0;var V=a.entanglements,ft=a.expirationTimes,Ot=a.hiddenUpdates;for(c=M&~c;0<c;){var It=31-oe(c),Wt=1<<It;V[It]=0,ft[It]=-1;var Mt=Ot[It];if(Mt!==null)for(Ot[It]=null,It=0;It<Mt.length;It++){var Dt=Mt[It];Dt!==null&&(Dt.lane&=-536870913)}c&=~Wt}h!==0&&te(a,h,0),w!==0&&b===0&&a.tag!==0&&(a.suspendedLanes|=w&~(M&~r))}function te(a,r,c){a.pendingLanes|=r,a.suspendedLanes&=~r;var h=31-oe(r);a.entangledLanes|=r,a.entanglements[h]=a.entanglements[h]|1073741824|c&4194090}function _e(a,r){var c=a.entangledLanes|=r;for(a=a.entanglements;c;){var h=31-oe(c),b=1<<h;b&r|a[h]&r&&(a[h]|=r),c&=~b}}function Sn(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Je(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Pi(){var a=lt.p;return a!==0?a:(a=window.event,a===void 0?32:M2(a.type))}function dn(a,r){var c=lt.p;try{return lt.p=a,r()}finally{lt.p=c}}var ue=Math.random().toString(36).slice(2),sn="__reactFiber$"+ue,We="__reactProps$"+ue,rn="__reactContainer$"+ue,Dn="__reactEvents$"+ue,pn="__reactListeners$"+ue,ea="__reactHandles$"+ue,ao="__reactResources$"+ue,va="__reactMarker$"+ue;function xa(a){delete a[sn],delete a[We],delete a[Dn],delete a[pn],delete a[ea]}function Bi(a){var r=a[sn];if(r)return r;for(var c=a.parentNode;c;){if(r=c[rn]||c[sn]){if(c=r.alternate,r.child!==null||c!==null&&c.child!==null)for(a=b2(a);a!==null;){if(c=a[sn])return c;a=b2(a)}return r}a=c,c=a.parentNode}return null}function zi(a){if(a=a[sn]||a[rn]){var r=a.tag;if(r===5||r===6||r===13||r===26||r===27||r===3)return a}return null}function na(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a.stateNode;throw Error(i(33))}function Ti(a){var r=a[ao];return r||(r=a[ao]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function gn(a){a[va]=!0}var pr=new Set,so={};function Ta(a,r){Wa(a,r),Wa(a+"Capture",r)}function Wa(a,r){for(so[a]=r,a=0;a<r.length;a++)pr.add(r[a])}var Go=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Gl={},Gc={};function af(a){return ne.call(Gc,a)?!0:ne.call(Gl,a)?!1:Go.test(a)?Gc[a]=!0:(Gl[a]=!0,!1)}function Os(a,r,c){if(af(r))if(c===null)a.removeAttribute(r);else{switch(typeof c){case"undefined":case"function":case"symbol":a.removeAttribute(r);return;case"boolean":var h=r.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){a.removeAttribute(r);return}}a.setAttribute(r,""+c)}}function ro(a,r,c){if(c===null)a.removeAttribute(r);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(r);return}a.setAttribute(r,""+c)}}function Xa(a,r,c,h){if(h===null)a.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(c);return}a.setAttributeNS(r,c,""+h)}}var oo,Wc;function Ms(a){if(oo===void 0)try{throw Error()}catch(c){var r=c.stack.trim().match(/\n( *(at )?)/);oo=r&&r[1]||"",Wc=-1<c.stack.indexOf(`
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
`+oo+a+Wc}var Wl=!1;function mr(a,r){if(!a||Wl)return"";Wl=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(r){var Wt=function(){throw Error()};if(Object.defineProperty(Wt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Wt,[])}catch(Dt){var Mt=Dt}Reflect.construct(a,[],Wt)}else{try{Wt.call()}catch(Dt){Mt=Dt}a.call(Wt.prototype)}}else{try{throw Error()}catch(Dt){Mt=Dt}(Wt=a())&&typeof Wt.catch=="function"&&Wt.catch(function(){})}}catch(Dt){if(Dt&&Mt&&typeof Dt.stack=="string")return[Dt.stack,Mt.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=h.DetermineComponentFrameRoot(),M=w[0],V=w[1];if(M&&V){var ft=M.split(`
`),Ot=V.split(`
`);for(b=h=0;h<ft.length&&!ft[h].includes("DetermineComponentFrameRoot");)h++;for(;b<Ot.length&&!Ot[b].includes("DetermineComponentFrameRoot");)b++;if(h===ft.length||b===Ot.length)for(h=ft.length-1,b=Ot.length-1;1<=h&&0<=b&&ft[h]!==Ot[b];)b--;for(;1<=h&&0<=b;h--,b--)if(ft[h]!==Ot[b]){if(h!==1||b!==1)do if(h--,b--,0>b||ft[h]!==Ot[b]){var It=`
`+ft[h].replace(" at new "," at ");return a.displayName&&It.includes("<anonymous>")&&(It=It.replace("<anonymous>",a.displayName)),It}while(1<=h&&0<=b);break}}}finally{Wl=!1,Error.prepareStackTrace=c}return(c=a?a.displayName||a.name:"")?Ms(c):""}function sf(a){switch(a.tag){case 26:case 27:case 5:return Ms(a.type);case 16:return Ms("Lazy");case 13:return Ms("Suspense");case 19:return Ms("SuspenseList");case 0:case 15:return mr(a.type,!1);case 11:return mr(a.type.render,!1);case 1:return mr(a.type,!0);case 31:return Ms("Activity");default:return""}}function In(a){try{var r="";do r+=sf(a),a=a.return;while(a);return r}catch(c){return`
Error generating stack: `+c.message+`
`+c.stack}}function Xi(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Xl(a){var r=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Xc(a){var r=Xl(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,r),h=""+a[r];if(!a.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var b=c.get,w=c.set;return Object.defineProperty(a,r,{configurable:!0,get:function(){return b.call(this)},set:function(M){h=""+M,w.call(this,M)}}),Object.defineProperty(a,r,{enumerable:c.enumerable}),{getValue:function(){return h},setValue:function(M){h=""+M},stopTracking:function(){a._valueTracker=null,delete a[r]}}}}function gr(a){a._valueTracker||(a._valueTracker=Xc(a))}function Kc(a){if(!a)return!1;var r=a._valueTracker;if(!r)return!0;var c=r.getValue(),h="";return a&&(h=Xl(a)?a.checked?"true":"false":a.value),a=h,a!==c?(r.setValue(a),!0):!1}function ia(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var Wo=/[\n"\\]/g;function Cn(a){return a.replace(Wo,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function lo(a,r,c,h,b,w,M,V){a.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?a.type=M:a.removeAttribute("type"),r!=null?M==="number"?(r===0&&a.value===""||a.value!=r)&&(a.value=""+Xi(r)):a.value!==""+Xi(r)&&(a.value=""+Xi(r)):M!=="submit"&&M!=="reset"||a.removeAttribute("value"),r!=null?$l(a,M,Xi(r)):c!=null?$l(a,M,Xi(c)):h!=null&&a.removeAttribute("value"),b==null&&w!=null&&(a.defaultChecked=!!w),b!=null&&(a.checked=b&&typeof b!="function"&&typeof b!="symbol"),V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?a.name=""+Xi(V):a.removeAttribute("name")}function Kl(a,r,c,h,b,w,M,V){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(a.type=w),r!=null||c!=null){if(!(w!=="submit"&&w!=="reset"||r!=null))return;c=c!=null?""+Xi(c):"",r=r!=null?""+Xi(r):c,V||r===a.value||(a.value=r),a.defaultValue=r}h=h??b,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=V?a.checked:!!h,a.defaultChecked=!!h,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(a.name=M)}function $l(a,r,c){r==="number"&&ia(a.ownerDocument)===a||a.defaultValue===""+c||(a.defaultValue=""+c)}function Ds(a,r,c,h){if(a=a.options,r){r={};for(var b=0;b<c.length;b++)r["$"+c[b]]=!0;for(c=0;c<a.length;c++)b=r.hasOwnProperty("$"+a[c].value),a[c].selected!==b&&(a[c].selected=b),b&&h&&(a[c].defaultSelected=!0)}else{for(c=""+Xi(c),r=null,b=0;b<a.length;b++){if(a[b].value===c){a[b].selected=!0,h&&(a[b].defaultSelected=!0);return}r!==null||a[b].disabled||(r=a[b])}r!==null&&(r.selected=!0)}}function $c(a,r,c){if(r!=null&&(r=""+Xi(r),r!==a.value&&(a.value=r),c==null)){a.defaultValue!==r&&(a.defaultValue=r);return}a.defaultValue=c!=null?""+Xi(c):""}function Zl(a,r,c,h){if(r==null){if(h!=null){if(c!=null)throw Error(i(92));if(dt(h)){if(1<h.length)throw Error(i(93));h=h[0]}c=h}c==null&&(c=""),r=c}c=Xi(r),a.defaultValue=c,h=a.textContent,h===c&&h!==""&&h!==null&&(a.value=h)}function br(a,r){if(r){var c=a.firstChild;if(c&&c===a.lastChild&&c.nodeType===3){c.nodeValue=r;return}}a.textContent=r}var Ql=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Zc(a,r,c){var h=r.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?h?a.setProperty(r,""):r==="float"?a.cssFloat="":a[r]="":h?a.setProperty(r,c):typeof c!="number"||c===0||Ql.has(r)?r==="float"?a.cssFloat=c:a[r]=(""+c).trim():a[r]=c+"px"}function Qc(a,r,c){if(r!=null&&typeof r!="object")throw Error(i(62));if(a=a.style,c!=null){for(var h in c)!c.hasOwnProperty(h)||r!=null&&r.hasOwnProperty(h)||(h.indexOf("--")===0?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="");for(var b in r)h=r[b],r.hasOwnProperty(b)&&c[b]!==h&&Zc(a,b,h)}else for(var w in r)r.hasOwnProperty(w)&&Zc(a,w,r[w])}function Jl(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Rs=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Xo=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ks(a){return Xo.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}var Ko=null;function xi(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var yr=null,Ps=null;function Te(a){var r=zi(a);if(r&&(a=r.stateNode)){var c=a[We]||null;t:switch(a=r.stateNode,r.type){case"input":if(lo(a,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),r=c.name,c.type==="radio"&&r!=null){for(c=a;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Cn(""+r)+'"][type="radio"]'),r=0;r<c.length;r++){var h=c[r];if(h!==a&&h.form===a.form){var b=h[We]||null;if(!b)throw Error(i(90));lo(h,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(r=0;r<c.length;r++)h=c[r],h.form===a.form&&Kc(h)}break t;case"textarea":$c(a,c.value,c.defaultValue);break t;case"select":r=c.value,r!=null&&Ds(a,!!c.multiple,r,!1)}}}var tc=!1;function Jc(a,r,c){if(tc)return a(r,c);tc=!0;try{var h=a(r);return h}finally{if(tc=!1,(yr!==null||Ps!==null)&&(hd(),yr&&(r=yr,a=Ps,Ps=yr=null,Te(r),a)))for(r=0;r<a.length;r++)Te(a[r])}}function aa(a,r){var c=a.stateNode;if(c===null)return null;var h=c[We]||null;if(h===null)return null;c=h[r];t:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(a=a.type,h=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!h;break t;default:a=!1}if(a)return null;if(c&&typeof c!="function")throw Error(i(231,r,typeof c));return c}var Ca=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$o=!1;if(Ca)try{var fs={};Object.defineProperty(fs,"passive",{get:function(){$o=!0}}),window.addEventListener("test",fs,fs),window.removeEventListener("test",fs,fs)}catch{$o=!1}var Oa=null,ec=null,Zo=null;function tu(){if(Zo)return Zo;var a,r=ec,c=r.length,h,b="value"in Oa?Oa.value:Oa.textContent,w=b.length;for(a=0;a<c&&r[a]===b[a];a++);var M=c-a;for(h=1;h<=M&&r[c-h]===b[w-h];h++);return Zo=b.slice(a,1<h?1-h:void 0)}function vr(a){var r=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&r===13&&(a=13)):a=r,a===10&&(a=13),32<=a||a===13?a:0}function hs(){return!0}function Bs(){return!1}function Fi(a){function r(c,h,b,w,M){this._reactName=c,this._targetInst=b,this.type=h,this.nativeEvent=w,this.target=M,this.currentTarget=null;for(var V in a)a.hasOwnProperty(V)&&(c=a[V],this[V]=c?c(w):w[V]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?hs:Bs,this.isPropagationStopped=Bs,this}return m(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=hs)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=hs)},persist:function(){},isPersistent:hs}),r}var wa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xr=Fi(wa),ds=m({},wa,{view:0,detail:0}),eu=Fi(ds),Qo,Jo,wr,_a=m({},ds,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:il,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==wr&&(wr&&a.type==="mousemove"?(Qo=a.screenX-wr.screenX,Jo=a.screenY-wr.screenY):Jo=Qo=0,wr=a),Qo)},movementY:function(a){return"movementY"in a?a.movementY:Jo}}),ps=Fi(_a),rf=m({},_a,{dataTransfer:0}),_r=Fi(rf),Ka=m({},ds,{relatedTarget:0}),co=Fi(Ka),uo=m({},wa,{animationName:0,elapsedTime:0,pseudoElement:0}),of=Fi(uo),tl=m({},wa,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),lf=Fi(tl),nc=m({},wa,{data:0}),el=Fi(nc),nu={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nl={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ic={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ac(a){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(a):(a=ic[a])?!!r[a]:!1}function il(){return ac}var cf=m({},ds,{key:function(a){if(a.key){var r=nu[a.key]||a.key;if(r!=="Unidentified")return r}return a.type==="keypress"?(a=vr(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?nl[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:il,charCode:function(a){return a.type==="keypress"?vr(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?vr(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),al=Fi(cf),fo=m({},_a,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sl=Fi(fo),Sr=m({},ds,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:il}),sc=Fi(Sr),_=m({},wa,{propertyName:0,elapsedTime:0,pseudoElement:0}),P=Fi(_),it=m({},_a,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),pt=Fi(it),Lt=m({},wa,{newState:0,oldState:0}),zt=Fi(Lt),$t=[9,13,27,32],le=Ca&&"CompositionEvent"in window,ge=null;Ca&&"documentMode"in document&&(ge=document.documentMode);var Re=Ca&&"TextEvent"in window&&!ge,Oe=Ca&&(!le||ge&&8<ge&&11>=ge),Xe=" ",Rn=!1;function zn(a,r){switch(a){case"keyup":return $t.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kn(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var $n=!1;function wi(a,r){switch(a){case"compositionend":return Kn(r);case"keypress":return r.which!==32?null:(Rn=!0,Xe);case"textInput":return a=r.data,a===Xe&&Rn?null:a;default:return null}}function $a(a,r){if($n)return a==="compositionend"||!le&&zn(a,r)?(a=tu(),Zo=ec=Oa=null,$n=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Oe&&r.locale!=="ko"?null:r.data;default:return null}}var Sa={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Za(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r==="input"?!!Sa[a.type]:r==="textarea"}function rc(a,r,c,h){yr?Ps?Ps.push(h):Ps=[h]:yr=h,r=yd(r,"onChange"),0<r.length&&(c=new xr("onChange","change",null,c,h),a.push({event:c,listeners:r}))}var zs=null,Fs=null;function rl(a){o2(a,0)}function Nr(a){var r=na(a);if(Kc(r))return a}function ol(a,r){if(a==="change")return r}var ho=!1;if(Ca){var li;if(Ca){var Ar="oninput"in document;if(!Ar){var po=document.createElement("div");po.setAttribute("oninput","return;"),Ar=typeof po.oninput=="function"}li=Ar}else li=!1;ho=li&&(!document.documentMode||9<document.documentMode)}function mo(){zs&&(zs.detachEvent("onpropertychange",ll),Fs=zs=null)}function ll(a){if(a.propertyName==="value"&&Nr(Fs)){var r=[];rc(r,Fs,a,xi(a)),Jc(rl,r)}}function sa(a,r,c){a==="focusin"?(mo(),zs=r,Fs=c,zs.attachEvent("onpropertychange",ll)):a==="focusout"&&mo()}function uf(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Nr(Fs)}function oc(a,r){if(a==="click")return Nr(r)}function iu(a,r){if(a==="input"||a==="change")return Nr(r)}function Ma(a,r){return a===r&&(a!==0||1/a===1/r)||a!==a&&r!==r}var _i=typeof Object.is=="function"?Object.is:Ma;function Lr(a,r){if(_i(a,r))return!0;if(typeof a!="object"||a===null||typeof r!="object"||r===null)return!1;var c=Object.keys(a),h=Object.keys(r);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var b=c[h];if(!ne.call(r,b)||!_i(a[b],r[b]))return!1}return!0}function lc(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function qs(a,r){var c=lc(a);a=0;for(var h;c;){if(c.nodeType===3){if(h=a+c.textContent.length,a<=r&&h>=r)return{node:c,offset:r-a};a=h}t:{for(;c;){if(c.nextSibling){c=c.nextSibling;break t}c=c.parentNode}c=void 0}c=lc(c)}}function Er(a,r){return a&&r?a===r?!0:a&&a.nodeType===3?!1:r&&r.nodeType===3?Er(a,r.parentNode):"contains"in a?a.contains(r):a.compareDocumentPosition?!!(a.compareDocumentPosition(r)&16):!1:!1}function Ki(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var r=ia(a.document);r instanceof a.HTMLIFrameElement;){try{var c=typeof r.contentWindow.location.href=="string"}catch{c=!1}if(c)a=r.contentWindow;else break;r=ia(a.document)}return r}function Ci(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r&&(r==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||r==="textarea"||a.contentEditable==="true")}var jr=Ca&&"documentMode"in document&&11>=document.documentMode,ra=null,Qa=null,ms=null,Ja=!1;function Hn(a,r,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Ja||ra==null||ra!==ia(h)||(h=ra,"selectionStart"in h&&Ci(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),ms&&Lr(ms,h)||(ms=h,h=yd(Qa,"onSelect"),0<h.length&&(r=new xr("onSelect","select",null,r,c),a.push({event:r,listeners:h}),r.target=ra)))}function ts(a,r){var c={};return c[a.toLowerCase()]=r.toLowerCase(),c["Webkit"+a]="webkit"+r,c["Moz"+a]="moz"+r,c}var ni={animationend:ts("Animation","AnimationEnd"),animationiteration:ts("Animation","AnimationIteration"),animationstart:ts("Animation","AnimationStart"),transitionrun:ts("Transition","TransitionRun"),transitionstart:ts("Transition","TransitionStart"),transitioncancel:ts("Transition","TransitionCancel"),transitionend:ts("Transition","TransitionEnd")},oa={},go={};Ca&&(go=document.createElement("div").style,"AnimationEvent"in window||(delete ni.animationend.animation,delete ni.animationiteration.animation,delete ni.animationstart.animation),"TransitionEvent"in window||delete ni.transitionend.transition);function gs(a){if(oa[a])return oa[a];if(!ni[a])return a;var r=ni[a],c;for(c in r)if(r.hasOwnProperty(c)&&c in go)return oa[a]=r[c];return a}var cl=gs("animationend"),Tr=gs("animationiteration"),Cr=gs("animationstart"),Or=gs("transitionrun"),bo=gs("transitionstart"),ul=gs("transitioncancel"),Mr=gs("transitionend"),Us=new Map,yo="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");yo.push("scrollEnd");function Vn(a,r){Us.set(a,r),Ta(r,[a])}var Na=new WeakMap;function Ve(a,r){if(typeof a=="object"&&a!==null){var c=Na.get(a);return c!==void 0?c:(r={value:a,source:r,stack:In(r)},Na.set(a,r),r)}return{value:a,source:r,stack:In(r)}}var Ye=[],Nn=0,Zn=0;function Da(){for(var a=Nn,r=Zn=Nn=0;r<a;){var c=Ye[r];Ye[r++]=null;var h=Ye[r];Ye[r++]=null;var b=Ye[r];Ye[r++]=null;var w=Ye[r];if(Ye[r++]=null,h!==null&&b!==null){var M=h.pending;M===null?b.next=b:(b.next=M.next,M.next=b),h.pending=b}w!==0&&au(c,b,w)}}function Dr(a,r,c,h){Ye[Nn++]=a,Ye[Nn++]=r,Ye[Nn++]=c,Ye[Nn++]=h,Zn|=h,a.lanes|=h,a=a.alternate,a!==null&&(a.lanes|=h)}function Rr(a,r,c,h){return Dr(a,r,c,h),vo(a)}function Is(a,r){return Dr(a,null,null,r),vo(a)}function au(a,r,c){a.lanes|=c;var h=a.alternate;h!==null&&(h.lanes|=c);for(var b=!1,w=a.return;w!==null;)w.childLanes|=c,h=w.alternate,h!==null&&(h.childLanes|=c),w.tag===22&&(a=w.stateNode,a===null||a._visibility&1||(b=!0)),a=w,w=w.return;return a.tag===3?(w=a.stateNode,b&&r!==null&&(b=31-oe(c),a=w.hiddenUpdates,h=a[b],h===null?a[b]=[r]:h.push(r),r.lane=c|536870912),w):null}function vo(a){if(50<kf)throw kf=0,xm=null,Error(i(185));for(var r=a.return;r!==null;)a=r,r=a.return;return a.tag===3?a.stateNode:null}var Si={};function Ra(a,r,c,h){this.tag=a,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qi(a,r,c,h){return new Ra(a,r,c,h)}function fl(a){return a=a.prototype,!(!a||!a.isReactComponent)}function bs(a,r){var c=a.alternate;return c===null?(c=qi(a.tag,r,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=r,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=a.flags&65011712,c.childLanes=a.childLanes,c.lanes=a.lanes,c.child=a.child,c.memoizedProps=a.memoizedProps,c.memoizedState=a.memoizedState,c.updateQueue=a.updateQueue,r=a.dependencies,c.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},c.sibling=a.sibling,c.index=a.index,c.ref=a.ref,c.refCleanup=a.refCleanup,c}function cc(a,r){a.flags&=65011714;var c=a.alternate;return c===null?(a.childLanes=0,a.lanes=r,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,r=c.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a}function xo(a,r,c,h,b,w){var M=0;if(h=a,typeof a=="function")fl(a)&&(M=1);else if(typeof a=="string")M=n3(a,c,$.current)?26:a==="html"||a==="head"||a==="body"?27:5;else t:switch(a){case G:return a=qi(31,c,r,b),a.elementType=G,a.lanes=w,a;case A:return Hs(c.children,b,w,r);case N:M=8,b|=24;break;case E:return a=qi(12,c,r,b|2),a.elementType=E,a.lanes=w,a;case I:return a=qi(13,c,r,b),a.elementType=I,a.lanes=w,a;case st:return a=qi(19,c,r,b),a.elementType=st,a.lanes=w,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case j:case z:M=10;break t;case C:M=9;break t;case Z:M=11;break t;case K:M=14;break t;case H:M=16,h=null;break t}M=29,c=Error(i(130,a===null?"null":typeof a,"")),h=null}return r=qi(M,c,r,b),r.elementType=a,r.type=h,r.lanes=w,r}function Hs(a,r,c,h){return a=qi(7,a,h,r),a.lanes=c,a}function su(a,r,c){return a=qi(6,a,null,r),a.lanes=c,a}function uc(a,r,c){return r=qi(4,a.children!==null?a.children:[],a.key,r),r.lanes=c,r.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},r}var kr=[],Vs=0,hl=null,ru=0,ka=[],Aa=0,wo=null,Ys=1,Gs="";function _o(a,r){kr[Vs++]=ru,kr[Vs++]=hl,hl=a,ru=r}function Ph(a,r,c){ka[Aa++]=Ys,ka[Aa++]=Gs,ka[Aa++]=wo,wo=a;var h=Ys;a=Gs;var b=32-oe(h)-1;h&=~(1<<b),c+=1;var w=32-oe(r)+b;if(30<w){var M=b-b%5;w=(h&(1<<M)-1).toString(32),h>>=M,b-=M,Ys=1<<32-oe(r)+b|c<<b|h,Gs=w+a}else Ys=1<<w|c<<b|h,Gs=a}function fc(a){a.return!==null&&(_o(a,1),Ph(a,1,0))}function hc(a){for(;a===hl;)hl=kr[--Vs],kr[Vs]=null,ru=kr[--Vs],kr[Vs]=null;for(;a===wo;)wo=ka[--Aa],ka[Aa]=null,Gs=ka[--Aa],ka[Aa]=null,Ys=ka[--Aa],ka[Aa]=null}var ci=null,Yn=null,on=!1,Pr=null,ys=!1,ff=Error(i(519));function So(a){var r=Error(i(418,""));throw dl(Ve(r,a)),ff}function Bh(a){var r=a.stateNode,c=a.type,h=a.memoizedProps;switch(r[sn]=a,r[We]=h,c){case"dialog":$e("cancel",r),$e("close",r);break;case"iframe":case"object":case"embed":$e("load",r);break;case"video":case"audio":for(c=0;c<Bf.length;c++)$e(Bf[c],r);break;case"source":$e("error",r);break;case"img":case"image":case"link":$e("error",r),$e("load",r);break;case"details":$e("toggle",r);break;case"input":$e("invalid",r),Kl(r,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0),gr(r);break;case"select":$e("invalid",r);break;case"textarea":$e("invalid",r),Zl(r,h.value,h.defaultValue,h.children),gr(r)}c=h.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||r.textContent===""+c||h.suppressHydrationWarning===!0||f2(r.textContent,c)?(h.popover!=null&&($e("beforetoggle",r),$e("toggle",r)),h.onScroll!=null&&$e("scroll",r),h.onScrollEnd!=null&&$e("scrollend",r),h.onClick!=null&&(r.onclick=vd),r=!0):r=!1,r||So(a)}function Ws(a){for(ci=a.return;ci;)switch(ci.tag){case 5:case 13:ys=!1;return;case 27:case 3:ys=!0;return;default:ci=ci.return}}function $i(a){if(a!==ci)return!1;if(!on)return Ws(a),on=!0,!1;var r=a.tag,c;if((c=r!==3&&r!==27)&&((c=r===5)&&(c=a.type,c=!(c!=="form"&&c!=="button")||Pm(a.type,a.memoizedProps)),c=!c),c&&Yn&&So(a),Ws(a),r===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));t:{for(a=a.nextSibling,r=0;a;){if(a.nodeType===8)if(c=a.data,c==="/$"){if(r===0){Yn=er(a.nextSibling);break t}r--}else c!=="$"&&c!=="$!"&&c!=="$?"||r++;a=a.nextSibling}Yn=null}}else r===27?(r=Yn,Cl(a.type)?(a=qm,qm=null,Yn=a):Yn=r):Yn=ci?er(a.stateNode.nextSibling):null;return!0}function La(){Yn=ci=null,on=!1}function zh(){var a=Pr;return a!==null&&(za===null?za=a:za.push.apply(za,a),Pr=null),a}function dl(a){Pr===null?Pr=[a]:Pr.push(a)}var vs=gt(null),Ni=null,Xs=null;function Br(a,r,c){q(vs,r._currentValue),r._currentValue=c}function xs(a){a._currentValue=vs.current,O(vs)}function ou(a,r,c){for(;a!==null;){var h=a.alternate;if((a.childLanes&r)!==r?(a.childLanes|=r,h!==null&&(h.childLanes|=r)):h!==null&&(h.childLanes&r)!==r&&(h.childLanes|=r),a===c)break;a=a.return}}function lu(a,r,c,h){var b=a.child;for(b!==null&&(b.return=a);b!==null;){var w=b.dependencies;if(w!==null){var M=b.child;w=w.firstContext;t:for(;w!==null;){var V=w;w=b;for(var ft=0;ft<r.length;ft++)if(V.context===r[ft]){w.lanes|=c,V=w.alternate,V!==null&&(V.lanes|=c),ou(w.return,c,a),h||(M=null);break t}w=V.next}}else if(b.tag===18){if(M=b.return,M===null)throw Error(i(341));M.lanes|=c,w=M.alternate,w!==null&&(w.lanes|=c),ou(M,c,a),M=null}else M=b.child;if(M!==null)M.return=b;else for(M=b;M!==null;){if(M===a){M=null;break}if(b=M.sibling,b!==null){b.return=M.return,M=b;break}M=M.return}b=M}}function pl(a,r,c,h){a=null;for(var b=r,w=!1;b!==null;){if(!w){if((b.flags&524288)!==0)w=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var M=b.alternate;if(M===null)throw Error(i(387));if(M=M.memoizedProps,M!==null){var V=b.type;_i(b.pendingProps.value,M.value)||(a!==null?a.push(V):a=[V])}}else if(b===At.current){if(M=b.alternate,M===null)throw Error(i(387));M.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(a!==null?a.push(Hf):a=[Hf])}b=b.return}a!==null&&lu(r,a,c,h),r.flags|=262144}function cu(a){for(a=a.firstContext;a!==null;){if(!_i(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function ws(a){Ni=a,Xs=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function ui(a){return uu(Ni,a)}function zr(a,r){return Ni===null&&ws(a),uu(a,r)}function uu(a,r){var c=r._currentValue;if(r={context:r,memoizedValue:c,next:null},Xs===null){if(a===null)throw Error(i(308));Xs=r,a.dependencies={lanes:0,firstContext:r},a.flags|=524288}else Xs=Xs.next=r;return c}var Yp=typeof AbortController<"u"?AbortController:function(){var a=[],r=this.signal={aborted:!1,addEventListener:function(c,h){a.push(h)}};this.abort=function(){r.aborted=!0,a.forEach(function(c){return c()})}},Fh=e.unstable_scheduleCallback,Gp=e.unstable_NormalPriority,fi={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function hf(){return{controller:new Yp,data:new Map,refCount:0}}function dc(a){a.refCount--,a.refCount===0&&Fh(Gp,function(){a.controller.abort()})}var pc=null,df=0,No=0,Ks=null;function Wp(a,r){if(pc===null){var c=pc=[];df=0,No=Em(),Ks={status:"pending",value:void 0,then:function(h){c.push(h)}}}return df++,r.then(qh,qh),r}function qh(){if(--df===0&&pc!==null){Ks!==null&&(Ks.status="fulfilled");var a=pc;pc=null,No=0,Ks=null;for(var r=0;r<a.length;r++)(0,a[r])()}}function Uh(a,r){var c=[],h={status:"pending",value:null,reason:null,then:function(b){c.push(b)}};return a.then(function(){h.status="fulfilled",h.value=r;for(var b=0;b<c.length;b++)(0,c[b])(r)},function(b){for(h.status="rejected",h.reason=b,b=0;b<c.length;b++)(0,c[b])(void 0)}),h}var p=W.S;W.S=function(a,r){typeof r=="object"&&r!==null&&typeof r.then=="function"&&Wp(a,r),p!==null&&p(a,r)};var y=gt(null);function S(){var a=y.current;return a!==null?a:Pn.pooledCache}function T(a,r){r===null?q(y,y.current):q(y,r.pool)}function k(){var a=S();return a===null?null:{parent:fi._currentValue,pool:a}}var B=Error(i(460)),F=Error(i(474)),U=Error(i(542)),X={then:function(){}};function tt(a){return a=a.status,a==="fulfilled"||a==="rejected"}function bt(){}function Ct(a,r,c){switch(c=a[c],c===void 0?a.push(r):c!==r&&(r.then(bt,bt),r=c),r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,Yt(a),a;default:if(typeof r.status=="string")r.then(bt,bt);else{if(a=Pn,a!==null&&100<a.shellSuspendCounter)throw Error(i(482));a=r,a.status="pending",a.then(function(h){if(r.status==="pending"){var b=r;b.status="fulfilled",b.value=h}},function(h){if(r.status==="pending"){var b=r;b.status="rejected",b.reason=h}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,Yt(a),a}throw Et=r,B}}var Et=null;function _t(){if(Et===null)throw Error(i(459));var a=Et;return Et=null,a}function Yt(a){if(a===B||a===U)throw Error(i(483))}var Rt=!1;function yt(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xt(a,r){a=a.updateQueue,r.updateQueue===a&&(r.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Ut(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Gt(a,r,c){var h=a.updateQueue;if(h===null)return null;if(h=h.shared,(yn&2)!==0){var b=h.pending;return b===null?r.next=r:(r.next=b.next,b.next=r),h.pending=r,r=vo(a),au(a,null,c),r}return Dr(a,h,r,c),vo(a)}function Ht(a,r,c){if(r=r.updateQueue,r!==null&&(r=r.shared,(c&4194048)!==0)){var h=r.lanes;h&=a.pendingLanes,c|=h,r.lanes=c,_e(a,c)}}function ce(a,r){var c=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var b=null,w=null;if(c=c.firstBaseUpdate,c!==null){do{var M={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};w===null?b=w=M:w=w.next=M,c=c.next}while(c!==null);w===null?b=w=r:w=w.next=r}else b=w=r;c={baseState:h.baseState,firstBaseUpdate:b,lastBaseUpdate:w,shared:h.shared,callbacks:h.callbacks},a.updateQueue=c;return}a=c.lastBaseUpdate,a===null?c.firstBaseUpdate=r:a.next=r,c.lastBaseUpdate=r}var ae=!1;function ve(){if(ae){var a=Ks;if(a!==null)throw a}}function se(a,r,c,h){ae=!1;var b=a.updateQueue;Rt=!1;var w=b.firstBaseUpdate,M=b.lastBaseUpdate,V=b.shared.pending;if(V!==null){b.shared.pending=null;var ft=V,Ot=ft.next;ft.next=null,M===null?w=Ot:M.next=Ot,M=ft;var It=a.alternate;It!==null&&(It=It.updateQueue,V=It.lastBaseUpdate,V!==M&&(V===null?It.firstBaseUpdate=Ot:V.next=Ot,It.lastBaseUpdate=ft))}if(w!==null){var Wt=b.baseState;M=0,It=Ot=ft=null,V=w;do{var Mt=V.lane&-536870913,Dt=Mt!==V.lane;if(Dt?(an&Mt)===Mt:(h&Mt)===Mt){Mt!==0&&Mt===No&&(ae=!0),It!==null&&(It=It.next={lane:0,tag:V.tag,payload:V.payload,callback:null,next:null});t:{var Ce=a,Ne=V;Mt=r;var Ln=c;switch(Ne.tag){case 1:if(Ce=Ne.payload,typeof Ce=="function"){Wt=Ce.call(Ln,Wt,Mt);break t}Wt=Ce;break t;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Ne.payload,Mt=typeof Ce=="function"?Ce.call(Ln,Wt,Mt):Ce,Mt==null)break t;Wt=m({},Wt,Mt);break t;case 2:Rt=!0}}Mt=V.callback,Mt!==null&&(a.flags|=64,Dt&&(a.flags|=8192),Dt=b.callbacks,Dt===null?b.callbacks=[Mt]:Dt.push(Mt))}else Dt={lane:Mt,tag:V.tag,payload:V.payload,callback:V.callback,next:null},It===null?(Ot=It=Dt,ft=Wt):It=It.next=Dt,M|=Mt;if(V=V.next,V===null){if(V=b.shared.pending,V===null)break;Dt=V,V=Dt.next,Dt.next=null,b.lastBaseUpdate=Dt,b.shared.pending=null}}while(!0);It===null&&(ft=Wt),b.baseState=ft,b.firstBaseUpdate=Ot,b.lastBaseUpdate=It,w===null&&(b.shared.lanes=0),Ll|=M,a.lanes=M,a.memoizedState=Wt}}function en(a,r){if(typeof a!="function")throw Error(i(191,a));a.call(r)}function ln(a,r){var c=a.callbacks;if(c!==null)for(a.callbacks=null,a=0;a<c.length;a++)en(c[a],r)}var Ie=gt(null),Fe=gt(0);function mn(a,r){a=Ro,q(Fe,a),q(Ie,r),Ro=a|r.baseLanes}function cn(){q(Fe,Ro),q(Ie,Ie.current)}function Me(){Ro=Fe.current,O(Ie),O(Fe)}var bn=0,we=null,Ee=null,tn=null,nn=!1,Ai=!1,hi=!1,Qn=0,Jn=0,ii=null,Pa=0;function un(){throw Error(i(321))}function ai(a,r){if(r===null)return!1;for(var c=0;c<r.length&&c<a.length;c++)if(!_i(a[c],r[c]))return!1;return!0}function es(a,r,c,h,b,w){return bn=w,we=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,W.H=a===null||a.memoizedState===null?Y0:G0,hi=!1,w=c(h,b),hi=!1,Ai&&(w=Ao(r,c,h,b)),Fr(a),w}function Fr(a){W.H=Jh;var r=Ee!==null&&Ee.next!==null;if(bn=0,tn=Ee=we=null,nn=!1,Jn=0,ii=null,r)throw Error(i(300));a===null||Ui||(a=a.dependencies,a!==null&&cu(a)&&(Ui=!0))}function Ao(a,r,c,h){we=a;var b=0;do{if(Ai&&(ii=null),Jn=0,Ai=!1,25<=b)throw Error(i(301));if(b+=1,tn=Ee=null,a.updateQueue!=null){var w=a.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}W.H=dx,w=r(c,h)}while(Ai);return w}function qr(){var a=W.H,r=a.useState()[0];return r=typeof r.then=="function"?Ur(r):r,a=a.useState()[0],(Ee!==null?Ee.memoizedState:null)!==a&&(we.flags|=1024),r}function kn(){var a=Qn!==0;return Qn=0,a}function mc(a,r,c){r.updateQueue=a.updateQueue,r.flags&=-2053,a.lanes&=~c}function fu(a){if(nn){for(a=a.memoizedState;a!==null;){var r=a.queue;r!==null&&(r.pending=null),a=a.next}nn=!1}bn=0,tn=Ee=we=null,Ai=!1,Jn=Qn=0,ii=null}function Zi(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?we.memoizedState=tn=a:tn=tn.next=a,tn}function Fn(){if(Ee===null){var a=we.alternate;a=a!==null?a.memoizedState:null}else a=Ee.next;var r=tn===null?we.memoizedState:tn.next;if(r!==null)tn=r,Ee=a;else{if(a===null)throw we.alternate===null?Error(i(467)):Error(i(310));Ee=a,a={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},tn===null?we.memoizedState=tn=a:tn=tn.next=a}return tn}function Lo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ur(a){var r=Jn;return Jn+=1,ii===null&&(ii=[]),a=Ct(ii,a,r),r=we,(tn===null?r.memoizedState:tn.next)===null&&(r=r.alternate,W.H=r===null||r.memoizedState===null?Y0:G0),a}function la(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Ur(a);if(a.$$typeof===z)return ui(a)}throw Error(i(438,String(a)))}function Ir(a){var r=null,c=we.updateQueue;if(c!==null&&(r=c.memoCache),r==null){var h=we.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(r={data:h.data.map(function(b){return b.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),c===null&&(c=Lo(),we.updateQueue=c),c.memoCache=r,c=r.data[r.index],c===void 0)for(c=r.data[r.index]=Array(a),h=0;h<a;h++)c[h]=Q;return r.index++,c}function ca(a,r){return typeof r=="function"?r(a):r}function gc(a){var r=Fn();return ml(r,Ee,a)}function ml(a,r,c){var h=a.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=c;var b=a.baseQueue,w=h.pending;if(w!==null){if(b!==null){var M=b.next;b.next=w.next,w.next=M}r.baseQueue=b=w,h.pending=null}if(w=a.baseState,b===null)a.memoizedState=w;else{r=b.next;var V=M=null,ft=null,Ot=r,It=!1;do{var Wt=Ot.lane&-536870913;if(Wt!==Ot.lane?(an&Wt)===Wt:(bn&Wt)===Wt){var Mt=Ot.revertLane;if(Mt===0)ft!==null&&(ft=ft.next={lane:0,revertLane:0,action:Ot.action,hasEagerState:Ot.hasEagerState,eagerState:Ot.eagerState,next:null}),Wt===No&&(It=!0);else if((bn&Mt)===Mt){Ot=Ot.next,Mt===No&&(It=!0);continue}else Wt={lane:0,revertLane:Ot.revertLane,action:Ot.action,hasEagerState:Ot.hasEagerState,eagerState:Ot.eagerState,next:null},ft===null?(V=ft=Wt,M=w):ft=ft.next=Wt,we.lanes|=Mt,Ll|=Mt;Wt=Ot.action,hi&&c(w,Wt),w=Ot.hasEagerState?Ot.eagerState:c(w,Wt)}else Mt={lane:Wt,revertLane:Ot.revertLane,action:Ot.action,hasEagerState:Ot.hasEagerState,eagerState:Ot.eagerState,next:null},ft===null?(V=ft=Mt,M=w):ft=ft.next=Mt,we.lanes|=Wt,Ll|=Wt;Ot=Ot.next}while(Ot!==null&&Ot!==r);if(ft===null?M=w:ft.next=V,!_i(w,a.memoizedState)&&(Ui=!0,It&&(c=Ks,c!==null)))throw c;a.memoizedState=w,a.baseState=M,a.baseQueue=ft,h.lastRenderedState=w}return b===null&&(h.lanes=0),[a.memoizedState,h.dispatch]}function hu(a){var r=Fn(),c=r.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=a;var h=c.dispatch,b=c.pending,w=r.memoizedState;if(b!==null){c.pending=null;var M=b=b.next;do w=a(w,M.action),M=M.next;while(M!==b);_i(w,r.memoizedState)||(Ui=!0),r.memoizedState=w,r.baseQueue===null&&(r.baseState=w),c.lastRenderedState=w}return[w,h]}function bc(a,r,c){var h=we,b=Fn(),w=on;if(w){if(c===void 0)throw Error(i(407));c=c()}else c=r();var M=!_i((Ee||b).memoizedState,c);M&&(b.memoizedState=c,Ui=!0),b=b.queue;var V=gl.bind(null,h,b,a);if(vl(2048,8,V,[a]),b.getSnapshot!==r||M||tn!==null&&tn.memoizedState.tag&1){if(h.flags|=2048,Zs(9,wc(),yc.bind(null,h,b,c,r),null),Pn===null)throw Error(i(349));w||(bn&124)!==0||du(h,r,c)}return c}function du(a,r,c){a.flags|=16384,a={getSnapshot:r,value:c},r=we.updateQueue,r===null?(r=Lo(),we.updateQueue=r,r.stores=[a]):(c=r.stores,c===null?r.stores=[a]:c.push(a))}function yc(a,r,c,h){r.value=c,r.getSnapshot=h,Ih(r)&&Hh(a)}function gl(a,r,c){return c(function(){Ih(r)&&Hh(a)})}function Ih(a){var r=a.getSnapshot;a=a.value;try{var c=r();return!_i(a,c)}catch{return!0}}function Hh(a){var r=Is(a,2);r!==null&&os(r,a,2)}function vc(a){var r=Zi();if(typeof a=="function"){var c=a;if(a=c(),hi){fe(!0);try{c()}finally{fe(!1)}}}return r.memoizedState=r.baseState=a,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:a},r}function $s(a,r,c,h){return a.baseState=c,ml(a,Ee,typeof h=="function"?h:ca)}function Xp(a,r,c,h,b){if(Qh(a))throw Error(i(485));if(a=r.action,a!==null){var w={payload:b,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){w.listeners.push(M)}};W.T!==null?c(!0):w.isTransition=!1,h(w),c=r.pending,c===null?(w.next=r.pending=w,Vh(r,w)):(w.next=c.next,r.pending=c.next=w)}}function Vh(a,r){var c=r.action,h=r.payload,b=a.state;if(r.isTransition){var w=W.T,M={};W.T=M;try{var V=c(b,h),ft=W.S;ft!==null&&ft(M,V),Yh(a,r,V)}catch(Ot){bl(a,r,Ot)}finally{W.T=w}}else try{w=c(b,h),Yh(a,r,w)}catch(Ot){bl(a,r,Ot)}}function Yh(a,r,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(h){pf(a,r,h)},function(h){return bl(a,r,h)}):pf(a,r,c)}function pf(a,r,c){r.status="fulfilled",r.value=c,mf(r),a.state=c,r=a.pending,r!==null&&(c=r.next,c===r?a.pending=null:(c=c.next,r.next=c,Vh(a,c)))}function bl(a,r,c){var h=a.pending;if(a.pending=null,h!==null){h=h.next;do r.status="rejected",r.reason=c,mf(r),r=r.next;while(r!==h)}a.action=null}function mf(a){a=a.listeners;for(var r=0;r<a.length;r++)(0,a[r])()}function gf(a,r){return r}function xc(a,r){if(on){var c=Pn.formState;if(c!==null){t:{var h=we;if(on){if(Yn){e:{for(var b=Yn,w=ys;b.nodeType!==8;){if(!w){b=null;break e}if(b=er(b.nextSibling),b===null){b=null;break e}}w=b.data,b=w==="F!"||w==="F"?b:null}if(b){Yn=er(b.nextSibling),h=b.data==="F!";break t}}So(h)}h=!1}h&&(r=c[0])}}return c=Zi(),c.memoizedState=c.baseState=r,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gf,lastRenderedState:r},c.queue=h,c=I0.bind(null,we,h),h.dispatch=c,h=vc(!1),w=Kp.bind(null,we,!1,h.queue),h=Zi(),b={state:r,dispatch:null,action:a,pending:null},h.queue=b,c=Xp.bind(null,we,b,w,c),b.dispatch=c,h.memoizedState=a,[r,c,!1]}function pu(a){var r=Fn();return yl(r,Ee,a)}function yl(a,r,c){if(r=ml(a,r,gf)[0],a=gc(ca)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var h=Ur(r)}catch(M){throw M===B?U:M}else h=r;r=Fn();var b=r.queue,w=b.dispatch;return c!==r.memoizedState&&(we.flags|=2048,Zs(9,wc(),Gh.bind(null,b,c),null)),[h,w,a]}function Gh(a,r){a.action=r}function Wh(a){var r=Fn(),c=Ee;if(c!==null)return yl(r,c,a);Fn(),r=r.memoizedState,c=Fn();var h=c.queue.dispatch;return c.memoizedState=a,[r,h,!1]}function Zs(a,r,c,h){return a={tag:a,create:c,deps:h,inst:r,next:null},r=we.updateQueue,r===null&&(r=Lo(),we.updateQueue=r),c=r.lastEffect,c===null?r.lastEffect=a.next=a:(h=c.next,c.next=a,a.next=h,r.lastEffect=a),a}function wc(){return{destroy:void 0,resource:void 0}}function mu(){return Fn().memoizedState}function ns(a,r,c,h){var b=Zi();h=h===void 0?null:h,we.flags|=a,b.memoizedState=Zs(1|r,wc(),c,h)}function vl(a,r,c,h){var b=Fn();h=h===void 0?null:h;var w=b.memoizedState.inst;Ee!==null&&h!==null&&ai(h,Ee.memoizedState.deps)?b.memoizedState=Zs(r,w,c,h):(we.flags|=a,b.memoizedState=Zs(1|r,w,c,h))}function bf(a,r){ns(8390656,8,a,r)}function Xh(a,r){vl(2048,8,a,r)}function yf(a,r){return vl(4,2,a,r)}function Eo(a,r){return vl(4,4,a,r)}function Kh(a,r){if(typeof r=="function"){a=a();var c=r(a);return function(){typeof c=="function"?c():r(null)}}if(r!=null)return a=a(),r.current=a,function(){r.current=null}}function vf(a,r,c){c=c!=null?c.concat([a]):null,vl(4,4,Kh.bind(null,r,a),c)}function xf(){}function wf(a,r){var c=Fn();r=r===void 0?null:r;var h=c.memoizedState;return r!==null&&ai(r,h[1])?h[0]:(c.memoizedState=[a,r],a)}function $h(a,r){var c=Fn();r=r===void 0?null:r;var h=c.memoizedState;if(r!==null&&ai(r,h[1]))return h[0];if(h=a(),hi){fe(!0);try{a()}finally{fe(!1)}}return c.memoizedState=[h,r],h}function jo(a,r,c){return c===void 0||(bn&1073741824)!==0?a.memoizedState=r:(a.memoizedState=c,a=z1(),we.lanes|=a,Ll|=a,c)}function gu(a,r,c,h){return _i(c,r)?c:Ie.current!==null?(a=jo(a,c,h),_i(a,r)||(Ui=!0),a):(bn&42)===0?(Ui=!0,a.memoizedState=c):(a=z1(),we.lanes|=a,Ll|=a,r)}function _c(a,r,c,h,b){var w=lt.p;lt.p=w!==0&&8>w?w:8;var M=W.T,V={};W.T=V,Kp(a,!1,r,c);try{var ft=b(),Ot=W.S;if(Ot!==null&&Ot(V,ft),ft!==null&&typeof ft=="object"&&typeof ft.then=="function"){var It=Uh(ft,h);Af(a,r,It,rs(a))}else Af(a,r,h,rs(a))}catch(Wt){Af(a,r,{then:function(){},status:"rejected",reason:Wt},rs())}finally{lt.p=w,W.T=M}}function Qs(){}function _s(a,r,c,h){if(a.tag!==5)throw Error(i(476));var b=Js(a).queue;_c(a,b,r,ut,c===null?Qs:function(){return Sc(a),c(h)})}function Js(a){var r=a.memoizedState;if(r!==null)return r;r={memoizedState:ut,baseState:ut,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:ut},next:null};var c={};return r.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:c},next:null},a.memoizedState=r,a=a.alternate,a!==null&&(a.memoizedState=r),r}function Sc(a){var r=Js(a).next.queue;Af(a,r,{},rs())}function Nc(){return ui(Hf)}function _f(){return Fn().memoizedState}function Zh(){return Fn().memoizedState}function Sf(a){for(var r=a.return;r!==null;){switch(r.tag){case 24:case 3:var c=rs();a=Ut(c);var h=Gt(r,a,c);h!==null&&(os(h,r,c),Ht(h,r,c)),r={cache:hf()},a.payload=r;return}r=r.return}}function Nf(a,r,c){var h=rs();c={lane:h,revertLane:0,action:c,hasEagerState:!1,eagerState:null,next:null},Qh(a)?H0(r,c):(c=Rr(a,r,c,h),c!==null&&(os(c,a,h),V0(c,r,h)))}function I0(a,r,c){var h=rs();Af(a,r,c,h)}function Af(a,r,c,h){var b={lane:h,revertLane:0,action:c,hasEagerState:!1,eagerState:null,next:null};if(Qh(a))H0(r,b);else{var w=a.alternate;if(a.lanes===0&&(w===null||w.lanes===0)&&(w=r.lastRenderedReducer,w!==null))try{var M=r.lastRenderedState,V=w(M,c);if(b.hasEagerState=!0,b.eagerState=V,_i(V,M))return Dr(a,r,b,0),Pn===null&&Da(),!1}catch{}finally{}if(c=Rr(a,r,b,h),c!==null)return os(c,a,h),V0(c,r,h),!0}return!1}function Kp(a,r,c,h){if(h={lane:2,revertLane:Em(),action:h,hasEagerState:!1,eagerState:null,next:null},Qh(a)){if(r)throw Error(i(479))}else r=Rr(a,c,h,2),r!==null&&os(r,a,2)}function Qh(a){var r=a.alternate;return a===we||r!==null&&r===we}function H0(a,r){Ai=nn=!0;var c=a.pending;c===null?r.next=r:(r.next=c.next,c.next=r),a.pending=r}function V0(a,r,c){if((c&4194048)!==0){var h=r.lanes;h&=a.pendingLanes,c|=h,r.lanes=c,_e(a,c)}}var Jh={readContext:ui,use:la,useCallback:un,useContext:un,useEffect:un,useImperativeHandle:un,useLayoutEffect:un,useInsertionEffect:un,useMemo:un,useReducer:un,useRef:un,useState:un,useDebugValue:un,useDeferredValue:un,useTransition:un,useSyncExternalStore:un,useId:un,useHostTransitionStatus:un,useFormState:un,useActionState:un,useOptimistic:un,useMemoCache:un,useCacheRefresh:un},Y0={readContext:ui,use:la,useCallback:function(a,r){return Zi().memoizedState=[a,r===void 0?null:r],a},useContext:ui,useEffect:bf,useImperativeHandle:function(a,r,c){c=c!=null?c.concat([a]):null,ns(4194308,4,Kh.bind(null,r,a),c)},useLayoutEffect:function(a,r){return ns(4194308,4,a,r)},useInsertionEffect:function(a,r){ns(4,2,a,r)},useMemo:function(a,r){var c=Zi();r=r===void 0?null:r;var h=a();if(hi){fe(!0);try{a()}finally{fe(!1)}}return c.memoizedState=[h,r],h},useReducer:function(a,r,c){var h=Zi();if(c!==void 0){var b=c(r);if(hi){fe(!0);try{c(r)}finally{fe(!1)}}}else b=r;return h.memoizedState=h.baseState=b,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b},h.queue=a,a=a.dispatch=Nf.bind(null,we,a),[h.memoizedState,a]},useRef:function(a){var r=Zi();return a={current:a},r.memoizedState=a},useState:function(a){a=vc(a);var r=a.queue,c=I0.bind(null,we,r);return r.dispatch=c,[a.memoizedState,c]},useDebugValue:xf,useDeferredValue:function(a,r){var c=Zi();return jo(c,a,r)},useTransition:function(){var a=vc(!1);return a=_c.bind(null,we,a.queue,!0,!1),Zi().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,r,c){var h=we,b=Zi();if(on){if(c===void 0)throw Error(i(407));c=c()}else{if(c=r(),Pn===null)throw Error(i(349));(an&124)!==0||du(h,r,c)}b.memoizedState=c;var w={value:c,getSnapshot:r};return b.queue=w,bf(gl.bind(null,h,w,a),[a]),h.flags|=2048,Zs(9,wc(),yc.bind(null,h,w,c,r),null),c},useId:function(){var a=Zi(),r=Pn.identifierPrefix;if(on){var c=Gs,h=Ys;c=(h&~(1<<32-oe(h)-1)).toString(32)+c,r="«"+r+"R"+c,c=Qn++,0<c&&(r+="H"+c.toString(32)),r+="»"}else c=Pa++,r="«"+r+"r"+c.toString(32)+"»";return a.memoizedState=r},useHostTransitionStatus:Nc,useFormState:xc,useActionState:xc,useOptimistic:function(a){var r=Zi();r.memoizedState=r.baseState=a;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=c,r=Kp.bind(null,we,!0,c),c.dispatch=r,[a,r]},useMemoCache:Ir,useCacheRefresh:function(){return Zi().memoizedState=Sf.bind(null,we)}},G0={readContext:ui,use:la,useCallback:wf,useContext:ui,useEffect:Xh,useImperativeHandle:vf,useInsertionEffect:yf,useLayoutEffect:Eo,useMemo:$h,useReducer:gc,useRef:mu,useState:function(){return gc(ca)},useDebugValue:xf,useDeferredValue:function(a,r){var c=Fn();return gu(c,Ee.memoizedState,a,r)},useTransition:function(){var a=gc(ca)[0],r=Fn().memoizedState;return[typeof a=="boolean"?a:Ur(a),r]},useSyncExternalStore:bc,useId:_f,useHostTransitionStatus:Nc,useFormState:pu,useActionState:pu,useOptimistic:function(a,r){var c=Fn();return $s(c,Ee,a,r)},useMemoCache:Ir,useCacheRefresh:Zh},dx={readContext:ui,use:la,useCallback:wf,useContext:ui,useEffect:Xh,useImperativeHandle:vf,useInsertionEffect:yf,useLayoutEffect:Eo,useMemo:$h,useReducer:hu,useRef:mu,useState:function(){return hu(ca)},useDebugValue:xf,useDeferredValue:function(a,r){var c=Fn();return Ee===null?jo(c,a,r):gu(c,Ee.memoizedState,a,r)},useTransition:function(){var a=hu(ca)[0],r=Fn().memoizedState;return[typeof a=="boolean"?a:Ur(a),r]},useSyncExternalStore:bc,useId:_f,useHostTransitionStatus:Nc,useFormState:Wh,useActionState:Wh,useOptimistic:function(a,r){var c=Fn();return Ee!==null?$s(c,Ee,a,r):(c.baseState=a,[a,c.queue.dispatch])},useMemoCache:Ir,useCacheRefresh:Zh},bu=null,Lf=0;function td(a){var r=Lf;return Lf+=1,bu===null&&(bu=[]),Ct(bu,a,r)}function Ef(a,r){r=r.props.ref,a.ref=r!==void 0?r:null}function ed(a,r){throw r.$$typeof===g?Error(i(525)):(a=Object.prototype.toString.call(r),Error(i(31,a==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":a)))}function W0(a){var r=a._init;return r(a._payload)}function X0(a){function r(Nt,vt){if(a){var jt=Nt.deletions;jt===null?(Nt.deletions=[vt],Nt.flags|=16):jt.push(vt)}}function c(Nt,vt){if(!a)return null;for(;vt!==null;)r(Nt,vt),vt=vt.sibling;return null}function h(Nt){for(var vt=new Map;Nt!==null;)Nt.key!==null?vt.set(Nt.key,Nt):vt.set(Nt.index,Nt),Nt=Nt.sibling;return vt}function b(Nt,vt){return Nt=bs(Nt,vt),Nt.index=0,Nt.sibling=null,Nt}function w(Nt,vt,jt){return Nt.index=jt,a?(jt=Nt.alternate,jt!==null?(jt=jt.index,jt<vt?(Nt.flags|=67108866,vt):jt):(Nt.flags|=67108866,vt)):(Nt.flags|=1048576,vt)}function M(Nt){return a&&Nt.alternate===null&&(Nt.flags|=67108866),Nt}function V(Nt,vt,jt,Vt){return vt===null||vt.tag!==6?(vt=su(jt,Nt.mode,Vt),vt.return=Nt,vt):(vt=b(vt,jt),vt.return=Nt,vt)}function ft(Nt,vt,jt,Vt){var de=jt.type;return de===A?It(Nt,vt,jt.props.children,Vt,jt.key):vt!==null&&(vt.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===H&&W0(de)===vt.type)?(vt=b(vt,jt.props),Ef(vt,jt),vt.return=Nt,vt):(vt=xo(jt.type,jt.key,jt.props,null,Nt.mode,Vt),Ef(vt,jt),vt.return=Nt,vt)}function Ot(Nt,vt,jt,Vt){return vt===null||vt.tag!==4||vt.stateNode.containerInfo!==jt.containerInfo||vt.stateNode.implementation!==jt.implementation?(vt=uc(jt,Nt.mode,Vt),vt.return=Nt,vt):(vt=b(vt,jt.children||[]),vt.return=Nt,vt)}function It(Nt,vt,jt,Vt,de){return vt===null||vt.tag!==7?(vt=Hs(jt,Nt.mode,Vt,de),vt.return=Nt,vt):(vt=b(vt,jt),vt.return=Nt,vt)}function Wt(Nt,vt,jt){if(typeof vt=="string"&&vt!==""||typeof vt=="number"||typeof vt=="bigint")return vt=su(""+vt,Nt.mode,jt),vt.return=Nt,vt;if(typeof vt=="object"&&vt!==null){switch(vt.$$typeof){case x:return jt=xo(vt.type,vt.key,vt.props,null,Nt.mode,jt),Ef(jt,vt),jt.return=Nt,jt;case v:return vt=uc(vt,Nt.mode,jt),vt.return=Nt,vt;case H:var Vt=vt._init;return vt=Vt(vt._payload),Wt(Nt,vt,jt)}if(dt(vt)||R(vt))return vt=Hs(vt,Nt.mode,jt,null),vt.return=Nt,vt;if(typeof vt.then=="function")return Wt(Nt,td(vt),jt);if(vt.$$typeof===z)return Wt(Nt,zr(Nt,vt),jt);ed(Nt,vt)}return null}function Mt(Nt,vt,jt,Vt){var de=vt!==null?vt.key:null;if(typeof jt=="string"&&jt!==""||typeof jt=="number"||typeof jt=="bigint")return de!==null?null:V(Nt,vt,""+jt,Vt);if(typeof jt=="object"&&jt!==null){switch(jt.$$typeof){case x:return jt.key===de?ft(Nt,vt,jt,Vt):null;case v:return jt.key===de?Ot(Nt,vt,jt,Vt):null;case H:return de=jt._init,jt=de(jt._payload),Mt(Nt,vt,jt,Vt)}if(dt(jt)||R(jt))return de!==null?null:It(Nt,vt,jt,Vt,null);if(typeof jt.then=="function")return Mt(Nt,vt,td(jt),Vt);if(jt.$$typeof===z)return Mt(Nt,vt,zr(Nt,jt),Vt);ed(Nt,jt)}return null}function Dt(Nt,vt,jt,Vt,de){if(typeof Vt=="string"&&Vt!==""||typeof Vt=="number"||typeof Vt=="bigint")return Nt=Nt.get(jt)||null,V(vt,Nt,""+Vt,de);if(typeof Vt=="object"&&Vt!==null){switch(Vt.$$typeof){case x:return Nt=Nt.get(Vt.key===null?jt:Vt.key)||null,ft(vt,Nt,Vt,de);case v:return Nt=Nt.get(Vt.key===null?jt:Vt.key)||null,Ot(vt,Nt,Vt,de);case H:var Ge=Vt._init;return Vt=Ge(Vt._payload),Dt(Nt,vt,jt,Vt,de)}if(dt(Vt)||R(Vt))return Nt=Nt.get(jt)||null,It(vt,Nt,Vt,de,null);if(typeof Vt.then=="function")return Dt(Nt,vt,jt,td(Vt),de);if(Vt.$$typeof===z)return Dt(Nt,vt,jt,zr(vt,Vt),de);ed(vt,Vt)}return null}function Ce(Nt,vt,jt,Vt){for(var de=null,Ge=null,xe=vt,Le=vt=0,Hi=null;xe!==null&&Le<jt.length;Le++){xe.index>Le?(Hi=xe,xe=null):Hi=xe.sibling;var fn=Mt(Nt,xe,jt[Le],Vt);if(fn===null){xe===null&&(xe=Hi);break}a&&xe&&fn.alternate===null&&r(Nt,xe),vt=w(fn,vt,Le),Ge===null?de=fn:Ge.sibling=fn,Ge=fn,xe=Hi}if(Le===jt.length)return c(Nt,xe),on&&_o(Nt,Le),de;if(xe===null){for(;Le<jt.length;Le++)xe=Wt(Nt,jt[Le],Vt),xe!==null&&(vt=w(xe,vt,Le),Ge===null?de=xe:Ge.sibling=xe,Ge=xe);return on&&_o(Nt,Le),de}for(xe=h(xe);Le<jt.length;Le++)Hi=Dt(xe,Nt,Le,jt[Le],Vt),Hi!==null&&(a&&Hi.alternate!==null&&xe.delete(Hi.key===null?Le:Hi.key),vt=w(Hi,vt,Le),Ge===null?de=Hi:Ge.sibling=Hi,Ge=Hi);return a&&xe.forEach(function(kl){return r(Nt,kl)}),on&&_o(Nt,Le),de}function Ne(Nt,vt,jt,Vt){if(jt==null)throw Error(i(151));for(var de=null,Ge=null,xe=vt,Le=vt=0,Hi=null,fn=jt.next();xe!==null&&!fn.done;Le++,fn=jt.next()){xe.index>Le?(Hi=xe,xe=null):Hi=xe.sibling;var kl=Mt(Nt,xe,fn.value,Vt);if(kl===null){xe===null&&(xe=Hi);break}a&&xe&&kl.alternate===null&&r(Nt,xe),vt=w(kl,vt,Le),Ge===null?de=kl:Ge.sibling=kl,Ge=kl,xe=Hi}if(fn.done)return c(Nt,xe),on&&_o(Nt,Le),de;if(xe===null){for(;!fn.done;Le++,fn=jt.next())fn=Wt(Nt,fn.value,Vt),fn!==null&&(vt=w(fn,vt,Le),Ge===null?de=fn:Ge.sibling=fn,Ge=fn);return on&&_o(Nt,Le),de}for(xe=h(xe);!fn.done;Le++,fn=jt.next())fn=Dt(xe,Nt,Le,fn.value,Vt),fn!==null&&(a&&fn.alternate!==null&&xe.delete(fn.key===null?Le:fn.key),vt=w(fn,vt,Le),Ge===null?de=fn:Ge.sibling=fn,Ge=fn);return a&&xe.forEach(function(p3){return r(Nt,p3)}),on&&_o(Nt,Le),de}function Ln(Nt,vt,jt,Vt){if(typeof jt=="object"&&jt!==null&&jt.type===A&&jt.key===null&&(jt=jt.props.children),typeof jt=="object"&&jt!==null){switch(jt.$$typeof){case x:t:{for(var de=jt.key;vt!==null;){if(vt.key===de){if(de=jt.type,de===A){if(vt.tag===7){c(Nt,vt.sibling),Vt=b(vt,jt.props.children),Vt.return=Nt,Nt=Vt;break t}}else if(vt.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===H&&W0(de)===vt.type){c(Nt,vt.sibling),Vt=b(vt,jt.props),Ef(Vt,jt),Vt.return=Nt,Nt=Vt;break t}c(Nt,vt);break}else r(Nt,vt);vt=vt.sibling}jt.type===A?(Vt=Hs(jt.props.children,Nt.mode,Vt,jt.key),Vt.return=Nt,Nt=Vt):(Vt=xo(jt.type,jt.key,jt.props,null,Nt.mode,Vt),Ef(Vt,jt),Vt.return=Nt,Nt=Vt)}return M(Nt);case v:t:{for(de=jt.key;vt!==null;){if(vt.key===de)if(vt.tag===4&&vt.stateNode.containerInfo===jt.containerInfo&&vt.stateNode.implementation===jt.implementation){c(Nt,vt.sibling),Vt=b(vt,jt.children||[]),Vt.return=Nt,Nt=Vt;break t}else{c(Nt,vt);break}else r(Nt,vt);vt=vt.sibling}Vt=uc(jt,Nt.mode,Vt),Vt.return=Nt,Nt=Vt}return M(Nt);case H:return de=jt._init,jt=de(jt._payload),Ln(Nt,vt,jt,Vt)}if(dt(jt))return Ce(Nt,vt,jt,Vt);if(R(jt)){if(de=R(jt),typeof de!="function")throw Error(i(150));return jt=de.call(jt),Ne(Nt,vt,jt,Vt)}if(typeof jt.then=="function")return Ln(Nt,vt,td(jt),Vt);if(jt.$$typeof===z)return Ln(Nt,vt,zr(Nt,jt),Vt);ed(Nt,jt)}return typeof jt=="string"&&jt!==""||typeof jt=="number"||typeof jt=="bigint"?(jt=""+jt,vt!==null&&vt.tag===6?(c(Nt,vt.sibling),Vt=b(vt,jt),Vt.return=Nt,Nt=Vt):(c(Nt,vt),Vt=su(jt,Nt.mode,Vt),Vt.return=Nt,Nt=Vt),M(Nt)):c(Nt,vt)}return function(Nt,vt,jt,Vt){try{Lf=0;var de=Ln(Nt,vt,jt,Vt);return bu=null,de}catch(xe){if(xe===B||xe===U)throw xe;var Ge=qi(29,xe,null,Nt.mode);return Ge.lanes=Vt,Ge.return=Nt,Ge}finally{}}}var yu=X0(!0),K0=X0(!1),Ss=gt(null),Hr=null;function xl(a){var r=a.alternate;q(Oi,Oi.current&1),q(Ss,a),Hr===null&&(r===null||Ie.current!==null||r.memoizedState!==null)&&(Hr=a)}function $0(a){if(a.tag===22){if(q(Oi,Oi.current),q(Ss,a),Hr===null){var r=a.alternate;r!==null&&r.memoizedState!==null&&(Hr=a)}}else wl()}function wl(){q(Oi,Oi.current),q(Ss,Ss.current)}function To(a){O(Ss),Hr===a&&(Hr=null),O(Oi)}var Oi=gt(0);function nd(a){for(var r=a;r!==null;){if(r.tag===13){var c=r.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||c.data==="$?"||Fm(c)))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}function $p(a,r,c,h){r=a.memoizedState,c=c(h,r),c=c==null?r:m({},r,c),a.memoizedState=c,a.lanes===0&&(a.updateQueue.baseState=c)}var Zp={enqueueSetState:function(a,r,c){a=a._reactInternals;var h=rs(),b=Ut(h);b.payload=r,c!=null&&(b.callback=c),r=Gt(a,b,h),r!==null&&(os(r,a,h),Ht(r,a,h))},enqueueReplaceState:function(a,r,c){a=a._reactInternals;var h=rs(),b=Ut(h);b.tag=1,b.payload=r,c!=null&&(b.callback=c),r=Gt(a,b,h),r!==null&&(os(r,a,h),Ht(r,a,h))},enqueueForceUpdate:function(a,r){a=a._reactInternals;var c=rs(),h=Ut(c);h.tag=2,r!=null&&(h.callback=r),r=Gt(a,h,c),r!==null&&(os(r,a,c),Ht(r,a,c))}};function Z0(a,r,c,h,b,w,M){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(h,w,M):r.prototype&&r.prototype.isPureReactComponent?!Lr(c,h)||!Lr(b,w):!0}function Q0(a,r,c,h){a=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(c,h),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(c,h),r.state!==a&&Zp.enqueueReplaceState(r,r.state,null)}function Ac(a,r){var c=r;if("ref"in r){c={};for(var h in r)h!=="ref"&&(c[h]=r[h])}if(a=a.defaultProps){c===r&&(c=m({},c));for(var b in a)c[b]===void 0&&(c[b]=a[b])}return c}var id=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)};function J0(a){id(a)}function t1(a){console.error(a)}function e1(a){id(a)}function ad(a,r){try{var c=a.onUncaughtError;c(r.value,{componentStack:r.stack})}catch(h){setTimeout(function(){throw h})}}function n1(a,r,c){try{var h=a.onCaughtError;h(c.value,{componentStack:c.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Qp(a,r,c){return c=Ut(c),c.tag=3,c.payload={element:null},c.callback=function(){ad(a,r)},c}function i1(a){return a=Ut(a),a.tag=3,a}function a1(a,r,c,h){var b=c.type.getDerivedStateFromError;if(typeof b=="function"){var w=h.value;a.payload=function(){return b(w)},a.callback=function(){n1(r,c,h)}}var M=c.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(a.callback=function(){n1(r,c,h),typeof b!="function"&&(El===null?El=new Set([this]):El.add(this));var V=h.stack;this.componentDidCatch(h.value,{componentStack:V!==null?V:""})})}function px(a,r,c,h,b){if(c.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(r=c.alternate,r!==null&&pl(r,c,b,!0),c=Ss.current,c!==null){switch(c.tag){case 13:return Hr===null?_m():c.alternate===null&&si===0&&(si=3),c.flags&=-257,c.flags|=65536,c.lanes=b,h===X?c.flags|=16384:(r=c.updateQueue,r===null?c.updateQueue=new Set([h]):r.add(h),Nm(a,h,b)),!1;case 22:return c.flags|=65536,h===X?c.flags|=16384:(r=c.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([h])},c.updateQueue=r):(c=r.retryQueue,c===null?r.retryQueue=new Set([h]):c.add(h)),Nm(a,h,b)),!1}throw Error(i(435,c.tag))}return Nm(a,h,b),_m(),!1}if(on)return r=Ss.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=b,h!==ff&&(a=Error(i(422),{cause:h}),dl(Ve(a,c)))):(h!==ff&&(r=Error(i(423),{cause:h}),dl(Ve(r,c))),a=a.current.alternate,a.flags|=65536,b&=-b,a.lanes|=b,h=Ve(h,c),b=Qp(a.stateNode,h,b),ce(a,b),si!==4&&(si=2)),!1;var w=Error(i(520),{cause:h});if(w=Ve(w,c),Rf===null?Rf=[w]:Rf.push(w),si!==4&&(si=2),r===null)return!0;h=Ve(h,c),c=r;do{switch(c.tag){case 3:return c.flags|=65536,a=b&-b,c.lanes|=a,a=Qp(c.stateNode,h,a),ce(c,a),!1;case 1:if(r=c.type,w=c.stateNode,(c.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(El===null||!El.has(w))))return c.flags|=65536,b&=-b,c.lanes|=b,b=i1(b),a1(b,a,c,h),ce(c,b),!1}c=c.return}while(c!==null);return!1}var s1=Error(i(461)),Ui=!1;function Qi(a,r,c,h){r.child=a===null?K0(r,null,c,h):yu(r,a.child,c,h)}function r1(a,r,c,h,b){c=c.render;var w=r.ref;if("ref"in h){var M={};for(var V in h)V!=="ref"&&(M[V]=h[V])}else M=h;return ws(r),h=es(a,r,c,M,w,b),V=kn(),a!==null&&!Ui?(mc(a,r,b),Co(a,r,b)):(on&&V&&fc(r),r.flags|=1,Qi(a,r,h,b),r.child)}function o1(a,r,c,h,b){if(a===null){var w=c.type;return typeof w=="function"&&!fl(w)&&w.defaultProps===void 0&&c.compare===null?(r.tag=15,r.type=w,l1(a,r,w,h,b)):(a=xo(c.type,null,h,r,r.mode,b),a.ref=r.ref,a.return=r,r.child=a)}if(w=a.child,!rm(a,b)){var M=w.memoizedProps;if(c=c.compare,c=c!==null?c:Lr,c(M,h)&&a.ref===r.ref)return Co(a,r,b)}return r.flags|=1,a=bs(w,h),a.ref=r.ref,a.return=r,r.child=a}function l1(a,r,c,h,b){if(a!==null){var w=a.memoizedProps;if(Lr(w,h)&&a.ref===r.ref)if(Ui=!1,r.pendingProps=h=w,rm(a,b))(a.flags&131072)!==0&&(Ui=!0);else return r.lanes=a.lanes,Co(a,r,b)}return Jp(a,r,c,h,b)}function c1(a,r,c){var h=r.pendingProps,b=h.children,w=a!==null?a.memoizedState:null;if(h.mode==="hidden"){if((r.flags&128)!==0){if(h=w!==null?w.baseLanes|c:c,a!==null){for(b=r.child=a.child,w=0;b!==null;)w=w|b.lanes|b.childLanes,b=b.sibling;r.childLanes=w&~h}else r.childLanes=0,r.child=null;return u1(a,r,h,c)}if((c&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},a!==null&&T(r,w!==null?w.cachePool:null),w!==null?mn(r,w):cn(),$0(r);else return r.lanes=r.childLanes=536870912,u1(a,r,w!==null?w.baseLanes|c:c,c)}else w!==null?(T(r,w.cachePool),mn(r,w),wl(),r.memoizedState=null):(a!==null&&T(r,null),cn(),wl());return Qi(a,r,b,c),r.child}function u1(a,r,c,h){var b=S();return b=b===null?null:{parent:fi._currentValue,pool:b},r.memoizedState={baseLanes:c,cachePool:b},a!==null&&T(r,null),cn(),$0(r),a!==null&&pl(a,r,h,!0),null}function sd(a,r){var c=r.ref;if(c===null)a!==null&&a.ref!==null&&(r.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(i(284));(a===null||a.ref!==c)&&(r.flags|=4194816)}}function Jp(a,r,c,h,b){return ws(r),c=es(a,r,c,h,void 0,b),h=kn(),a!==null&&!Ui?(mc(a,r,b),Co(a,r,b)):(on&&h&&fc(r),r.flags|=1,Qi(a,r,c,b),r.child)}function f1(a,r,c,h,b,w){return ws(r),r.updateQueue=null,c=Ao(r,h,c,b),Fr(a),h=kn(),a!==null&&!Ui?(mc(a,r,w),Co(a,r,w)):(on&&h&&fc(r),r.flags|=1,Qi(a,r,c,w),r.child)}function h1(a,r,c,h,b){if(ws(r),r.stateNode===null){var w=Si,M=c.contextType;typeof M=="object"&&M!==null&&(w=ui(M)),w=new c(h,w),r.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Zp,r.stateNode=w,w._reactInternals=r,w=r.stateNode,w.props=h,w.state=r.memoizedState,w.refs={},yt(r),M=c.contextType,w.context=typeof M=="object"&&M!==null?ui(M):Si,w.state=r.memoizedState,M=c.getDerivedStateFromProps,typeof M=="function"&&($p(r,c,M,h),w.state=r.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(M=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),M!==w.state&&Zp.enqueueReplaceState(w,w.state,null),se(r,h,w,b),ve(),w.state=r.memoizedState),typeof w.componentDidMount=="function"&&(r.flags|=4194308),h=!0}else if(a===null){w=r.stateNode;var V=r.memoizedProps,ft=Ac(c,V);w.props=ft;var Ot=w.context,It=c.contextType;M=Si,typeof It=="object"&&It!==null&&(M=ui(It));var Wt=c.getDerivedStateFromProps;It=typeof Wt=="function"||typeof w.getSnapshotBeforeUpdate=="function",V=r.pendingProps!==V,It||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(V||Ot!==M)&&Q0(r,w,h,M),Rt=!1;var Mt=r.memoizedState;w.state=Mt,se(r,h,w,b),ve(),Ot=r.memoizedState,V||Mt!==Ot||Rt?(typeof Wt=="function"&&($p(r,c,Wt,h),Ot=r.memoizedState),(ft=Rt||Z0(r,c,ft,h,Mt,Ot,M))?(It||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(r.flags|=4194308)):(typeof w.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=h,r.memoizedState=Ot),w.props=h,w.state=Ot,w.context=M,h=ft):(typeof w.componentDidMount=="function"&&(r.flags|=4194308),h=!1)}else{w=r.stateNode,xt(a,r),M=r.memoizedProps,It=Ac(c,M),w.props=It,Wt=r.pendingProps,Mt=w.context,Ot=c.contextType,ft=Si,typeof Ot=="object"&&Ot!==null&&(ft=ui(Ot)),V=c.getDerivedStateFromProps,(Ot=typeof V=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(M!==Wt||Mt!==ft)&&Q0(r,w,h,ft),Rt=!1,Mt=r.memoizedState,w.state=Mt,se(r,h,w,b),ve();var Dt=r.memoizedState;M!==Wt||Mt!==Dt||Rt||a!==null&&a.dependencies!==null&&cu(a.dependencies)?(typeof V=="function"&&($p(r,c,V,h),Dt=r.memoizedState),(It=Rt||Z0(r,c,It,h,Mt,Dt,ft)||a!==null&&a.dependencies!==null&&cu(a.dependencies))?(Ot||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(h,Dt,ft),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(h,Dt,ft)),typeof w.componentDidUpdate=="function"&&(r.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof w.componentDidUpdate!="function"||M===a.memoizedProps&&Mt===a.memoizedState||(r.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||M===a.memoizedProps&&Mt===a.memoizedState||(r.flags|=1024),r.memoizedProps=h,r.memoizedState=Dt),w.props=h,w.state=Dt,w.context=ft,h=It):(typeof w.componentDidUpdate!="function"||M===a.memoizedProps&&Mt===a.memoizedState||(r.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||M===a.memoizedProps&&Mt===a.memoizedState||(r.flags|=1024),h=!1)}return w=h,sd(a,r),h=(r.flags&128)!==0,w||h?(w=r.stateNode,c=h&&typeof c.getDerivedStateFromError!="function"?null:w.render(),r.flags|=1,a!==null&&h?(r.child=yu(r,a.child,null,b),r.child=yu(r,null,c,b)):Qi(a,r,c,b),r.memoizedState=w.state,a=r.child):a=Co(a,r,b),a}function d1(a,r,c,h){return La(),r.flags|=256,Qi(a,r,c,h),r.child}var tm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function em(a){return{baseLanes:a,cachePool:k()}}function nm(a,r,c){return a=a!==null?a.childLanes&~c:0,r&&(a|=Ns),a}function p1(a,r,c){var h=r.pendingProps,b=!1,w=(r.flags&128)!==0,M;if((M=w)||(M=a!==null&&a.memoizedState===null?!1:(Oi.current&2)!==0),M&&(b=!0,r.flags&=-129),M=(r.flags&32)!==0,r.flags&=-33,a===null){if(on){if(b?xl(r):wl(),on){var V=Yn,ft;if(ft=V){t:{for(ft=V,V=ys;ft.nodeType!==8;){if(!V){V=null;break t}if(ft=er(ft.nextSibling),ft===null){V=null;break t}}V=ft}V!==null?(r.memoizedState={dehydrated:V,treeContext:wo!==null?{id:Ys,overflow:Gs}:null,retryLane:536870912,hydrationErrors:null},ft=qi(18,null,null,0),ft.stateNode=V,ft.return=r,r.child=ft,ci=r,Yn=null,ft=!0):ft=!1}ft||So(r)}if(V=r.memoizedState,V!==null&&(V=V.dehydrated,V!==null))return Fm(V)?r.lanes=32:r.lanes=536870912,null;To(r)}return V=h.children,h=h.fallback,b?(wl(),b=r.mode,V=rd({mode:"hidden",children:V},b),h=Hs(h,b,c,null),V.return=r,h.return=r,V.sibling=h,r.child=V,b=r.child,b.memoizedState=em(c),b.childLanes=nm(a,M,c),r.memoizedState=tm,h):(xl(r),im(r,V))}if(ft=a.memoizedState,ft!==null&&(V=ft.dehydrated,V!==null)){if(w)r.flags&256?(xl(r),r.flags&=-257,r=am(a,r,c)):r.memoizedState!==null?(wl(),r.child=a.child,r.flags|=128,r=null):(wl(),b=h.fallback,V=r.mode,h=rd({mode:"visible",children:h.children},V),b=Hs(b,V,c,null),b.flags|=2,h.return=r,b.return=r,h.sibling=b,r.child=h,yu(r,a.child,null,c),h=r.child,h.memoizedState=em(c),h.childLanes=nm(a,M,c),r.memoizedState=tm,r=b);else if(xl(r),Fm(V)){if(M=V.nextSibling&&V.nextSibling.dataset,M)var Ot=M.dgst;M=Ot,h=Error(i(419)),h.stack="",h.digest=M,dl({value:h,source:null,stack:null}),r=am(a,r,c)}else if(Ui||pl(a,r,c,!1),M=(c&a.childLanes)!==0,Ui||M){if(M=Pn,M!==null&&(h=c&-c,h=(h&42)!==0?1:Sn(h),h=(h&(M.suspendedLanes|c))!==0?0:h,h!==0&&h!==ft.retryLane))throw ft.retryLane=h,Is(a,h),os(M,a,h),s1;V.data==="$?"||_m(),r=am(a,r,c)}else V.data==="$?"?(r.flags|=192,r.child=a.child,r=null):(a=ft.treeContext,Yn=er(V.nextSibling),ci=r,on=!0,Pr=null,ys=!1,a!==null&&(ka[Aa++]=Ys,ka[Aa++]=Gs,ka[Aa++]=wo,Ys=a.id,Gs=a.overflow,wo=r),r=im(r,h.children),r.flags|=4096);return r}return b?(wl(),b=h.fallback,V=r.mode,ft=a.child,Ot=ft.sibling,h=bs(ft,{mode:"hidden",children:h.children}),h.subtreeFlags=ft.subtreeFlags&65011712,Ot!==null?b=bs(Ot,b):(b=Hs(b,V,c,null),b.flags|=2),b.return=r,h.return=r,h.sibling=b,r.child=h,h=b,b=r.child,V=a.child.memoizedState,V===null?V=em(c):(ft=V.cachePool,ft!==null?(Ot=fi._currentValue,ft=ft.parent!==Ot?{parent:Ot,pool:Ot}:ft):ft=k(),V={baseLanes:V.baseLanes|c,cachePool:ft}),b.memoizedState=V,b.childLanes=nm(a,M,c),r.memoizedState=tm,h):(xl(r),c=a.child,a=c.sibling,c=bs(c,{mode:"visible",children:h.children}),c.return=r,c.sibling=null,a!==null&&(M=r.deletions,M===null?(r.deletions=[a],r.flags|=16):M.push(a)),r.child=c,r.memoizedState=null,c)}function im(a,r){return r=rd({mode:"visible",children:r},a.mode),r.return=a,a.child=r}function rd(a,r){return a=qi(22,a,null,r),a.lanes=0,a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},a}function am(a,r,c){return yu(r,a.child,null,c),a=im(r,r.pendingProps.children),a.flags|=2,r.memoizedState=null,a}function m1(a,r,c){a.lanes|=r;var h=a.alternate;h!==null&&(h.lanes|=r),ou(a.return,r,c)}function sm(a,r,c,h,b){var w=a.memoizedState;w===null?a.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:b}:(w.isBackwards=r,w.rendering=null,w.renderingStartTime=0,w.last=h,w.tail=c,w.tailMode=b)}function g1(a,r,c){var h=r.pendingProps,b=h.revealOrder,w=h.tail;if(Qi(a,r,h.children,c),h=Oi.current,(h&2)!==0)h=h&1|2,r.flags|=128;else{if(a!==null&&(a.flags&128)!==0)t:for(a=r.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&m1(a,c,r);else if(a.tag===19)m1(a,c,r);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break t;for(;a.sibling===null;){if(a.return===null||a.return===r)break t;a=a.return}a.sibling.return=a.return,a=a.sibling}h&=1}switch(q(Oi,h),b){case"forwards":for(c=r.child,b=null;c!==null;)a=c.alternate,a!==null&&nd(a)===null&&(b=c),c=c.sibling;c=b,c===null?(b=r.child,r.child=null):(b=c.sibling,c.sibling=null),sm(r,!1,b,c,w);break;case"backwards":for(c=null,b=r.child,r.child=null;b!==null;){if(a=b.alternate,a!==null&&nd(a)===null){r.child=b;break}a=b.sibling,b.sibling=c,c=b,b=a}sm(r,!0,c,null,w);break;case"together":sm(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Co(a,r,c){if(a!==null&&(r.dependencies=a.dependencies),Ll|=r.lanes,(c&r.childLanes)===0)if(a!==null){if(pl(a,r,c,!1),(c&r.childLanes)===0)return null}else return null;if(a!==null&&r.child!==a.child)throw Error(i(153));if(r.child!==null){for(a=r.child,c=bs(a,a.pendingProps),r.child=c,c.return=r;a.sibling!==null;)a=a.sibling,c=c.sibling=bs(a,a.pendingProps),c.return=r;c.sibling=null}return r.child}function rm(a,r){return(a.lanes&r)!==0?!0:(a=a.dependencies,!!(a!==null&&cu(a)))}function mx(a,r,c){switch(r.tag){case 3:St(r,r.stateNode.containerInfo),Br(r,fi,a.memoizedState.cache),La();break;case 27:case 5:Zt(r);break;case 4:St(r,r.stateNode.containerInfo);break;case 10:Br(r,r.type,r.memoizedProps.value);break;case 13:var h=r.memoizedState;if(h!==null)return h.dehydrated!==null?(xl(r),r.flags|=128,null):(c&r.child.childLanes)!==0?p1(a,r,c):(xl(r),a=Co(a,r,c),a!==null?a.sibling:null);xl(r);break;case 19:var b=(a.flags&128)!==0;if(h=(c&r.childLanes)!==0,h||(pl(a,r,c,!1),h=(c&r.childLanes)!==0),b){if(h)return g1(a,r,c);r.flags|=128}if(b=r.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),q(Oi,Oi.current),h)break;return null;case 22:case 23:return r.lanes=0,c1(a,r,c);case 24:Br(r,fi,a.memoizedState.cache)}return Co(a,r,c)}function b1(a,r,c){if(a!==null)if(a.memoizedProps!==r.pendingProps)Ui=!0;else{if(!rm(a,c)&&(r.flags&128)===0)return Ui=!1,mx(a,r,c);Ui=(a.flags&131072)!==0}else Ui=!1,on&&(r.flags&1048576)!==0&&Ph(r,ru,r.index);switch(r.lanes=0,r.tag){case 16:t:{a=r.pendingProps;var h=r.elementType,b=h._init;if(h=b(h._payload),r.type=h,typeof h=="function")fl(h)?(a=Ac(h,a),r.tag=1,r=h1(null,r,h,a,c)):(r.tag=0,r=Jp(null,r,h,a,c));else{if(h!=null){if(b=h.$$typeof,b===Z){r.tag=11,r=r1(null,r,h,a,c);break t}else if(b===K){r.tag=14,r=o1(null,r,h,a,c);break t}}throw r=nt(h)||h,Error(i(306,r,""))}}return r;case 0:return Jp(a,r,r.type,r.pendingProps,c);case 1:return h=r.type,b=Ac(h,r.pendingProps),h1(a,r,h,b,c);case 3:t:{if(St(r,r.stateNode.containerInfo),a===null)throw Error(i(387));h=r.pendingProps;var w=r.memoizedState;b=w.element,xt(a,r),se(r,h,null,c);var M=r.memoizedState;if(h=M.cache,Br(r,fi,h),h!==w.cache&&lu(r,[fi],c,!0),ve(),h=M.element,w.isDehydrated)if(w={element:h,isDehydrated:!1,cache:M.cache},r.updateQueue.baseState=w,r.memoizedState=w,r.flags&256){r=d1(a,r,h,c);break t}else if(h!==b){b=Ve(Error(i(424)),r),dl(b),r=d1(a,r,h,c);break t}else{switch(a=r.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(Yn=er(a.firstChild),ci=r,on=!0,Pr=null,ys=!0,c=K0(r,null,h,c),r.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(La(),h===b){r=Co(a,r,c);break t}Qi(a,r,h,c)}r=r.child}return r;case 26:return sd(a,r),a===null?(c=w2(r.type,null,r.pendingProps,null))?r.memoizedState=c:on||(c=r.type,a=r.pendingProps,h=xd(at.current).createElement(c),h[sn]=r,h[We]=a,ta(h,c,a),gn(h),r.stateNode=h):r.memoizedState=w2(r.type,a.memoizedProps,r.pendingProps,a.memoizedState),null;case 27:return Zt(r),a===null&&on&&(h=r.stateNode=y2(r.type,r.pendingProps,at.current),ci=r,ys=!0,b=Yn,Cl(r.type)?(qm=b,Yn=er(h.firstChild)):Yn=b),Qi(a,r,r.pendingProps.children,c),sd(a,r),a===null&&(r.flags|=4194304),r.child;case 5:return a===null&&on&&((b=h=Yn)&&(h=Hx(h,r.type,r.pendingProps,ys),h!==null?(r.stateNode=h,ci=r,Yn=er(h.firstChild),ys=!1,b=!0):b=!1),b||So(r)),Zt(r),b=r.type,w=r.pendingProps,M=a!==null?a.memoizedProps:null,h=w.children,Pm(b,w)?h=null:M!==null&&Pm(b,M)&&(r.flags|=32),r.memoizedState!==null&&(b=es(a,r,qr,null,null,c),Hf._currentValue=b),sd(a,r),Qi(a,r,h,c),r.child;case 6:return a===null&&on&&((a=c=Yn)&&(c=Vx(c,r.pendingProps,ys),c!==null?(r.stateNode=c,ci=r,Yn=null,a=!0):a=!1),a||So(r)),null;case 13:return p1(a,r,c);case 4:return St(r,r.stateNode.containerInfo),h=r.pendingProps,a===null?r.child=yu(r,null,h,c):Qi(a,r,h,c),r.child;case 11:return r1(a,r,r.type,r.pendingProps,c);case 7:return Qi(a,r,r.pendingProps,c),r.child;case 8:return Qi(a,r,r.pendingProps.children,c),r.child;case 12:return Qi(a,r,r.pendingProps.children,c),r.child;case 10:return h=r.pendingProps,Br(r,r.type,h.value),Qi(a,r,h.children,c),r.child;case 9:return b=r.type._context,h=r.pendingProps.children,ws(r),b=ui(b),h=h(b),r.flags|=1,Qi(a,r,h,c),r.child;case 14:return o1(a,r,r.type,r.pendingProps,c);case 15:return l1(a,r,r.type,r.pendingProps,c);case 19:return g1(a,r,c);case 31:return h=r.pendingProps,c=r.mode,h={mode:h.mode,children:h.children},a===null?(c=rd(h,c),c.ref=r.ref,r.child=c,c.return=r,r=c):(c=bs(a.child,h),c.ref=r.ref,r.child=c,c.return=r,r=c),r;case 22:return c1(a,r,c);case 24:return ws(r),h=ui(fi),a===null?(b=S(),b===null&&(b=Pn,w=hf(),b.pooledCache=w,w.refCount++,w!==null&&(b.pooledCacheLanes|=c),b=w),r.memoizedState={parent:h,cache:b},yt(r),Br(r,fi,b)):((a.lanes&c)!==0&&(xt(a,r),se(r,null,null,c),ve()),b=a.memoizedState,w=r.memoizedState,b.parent!==h?(b={parent:h,cache:h},r.memoizedState=b,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=b),Br(r,fi,h)):(h=w.cache,Br(r,fi,h),h!==b.cache&&lu(r,[fi],c,!0))),Qi(a,r,r.pendingProps.children,c),r.child;case 29:throw r.pendingProps}throw Error(i(156,r.tag))}function Oo(a){a.flags|=4}function y1(a,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!L2(r)){if(r=Ss.current,r!==null&&((an&4194048)===an?Hr!==null:(an&62914560)!==an&&(an&536870912)===0||r!==Hr))throw Et=X,F;a.flags|=8192}}function od(a,r){r!==null&&(a.flags|=4),a.flags&16384&&(r=a.tag!==22?jn():536870912,a.lanes|=r,_u|=r)}function jf(a,r){if(!on)switch(a.tailMode){case"hidden":r=a.tail;for(var c=null;r!==null;)r.alternate!==null&&(c=r),r=r.sibling;c===null?a.tail=null:c.sibling=null;break;case"collapsed":c=a.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?r||a.tail===null?a.tail=null:a.tail.sibling=null:h.sibling=null}}function ti(a){var r=a.alternate!==null&&a.alternate.child===a.child,c=0,h=0;if(r)for(var b=a.child;b!==null;)c|=b.lanes|b.childLanes,h|=b.subtreeFlags&65011712,h|=b.flags&65011712,b.return=a,b=b.sibling;else for(b=a.child;b!==null;)c|=b.lanes|b.childLanes,h|=b.subtreeFlags,h|=b.flags,b.return=a,b=b.sibling;return a.subtreeFlags|=h,a.childLanes=c,r}function gx(a,r,c){var h=r.pendingProps;switch(hc(r),r.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ti(r),null;case 1:return ti(r),null;case 3:return c=r.stateNode,h=null,a!==null&&(h=a.memoizedState.cache),r.memoizedState.cache!==h&&(r.flags|=2048),xs(fi),Tt(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(a===null||a.child===null)&&($i(r)?Oo(r):a===null||a.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,zh())),ti(r),null;case 26:return c=r.memoizedState,a===null?(Oo(r),c!==null?(ti(r),y1(r,c)):(ti(r),r.flags&=-16777217)):c?c!==a.memoizedState?(Oo(r),ti(r),y1(r,c)):(ti(r),r.flags&=-16777217):(a.memoizedProps!==h&&Oo(r),ti(r),r.flags&=-16777217),null;case 27:Qt(r),c=at.current;var b=r.type;if(a!==null&&r.stateNode!=null)a.memoizedProps!==h&&Oo(r);else{if(!h){if(r.stateNode===null)throw Error(i(166));return ti(r),null}a=$.current,$i(r)?Bh(r):(a=y2(b,h,c),r.stateNode=a,Oo(r))}return ti(r),null;case 5:if(Qt(r),c=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==h&&Oo(r);else{if(!h){if(r.stateNode===null)throw Error(i(166));return ti(r),null}if(a=$.current,$i(r))Bh(r);else{switch(b=xd(at.current),a){case 1:a=b.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:a=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":a=b.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":a=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":a=b.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof h.is=="string"?b.createElement("select",{is:h.is}):b.createElement("select"),h.multiple?a.multiple=!0:h.size&&(a.size=h.size);break;default:a=typeof h.is=="string"?b.createElement(c,{is:h.is}):b.createElement(c)}}a[sn]=r,a[We]=h;t:for(b=r.child;b!==null;){if(b.tag===5||b.tag===6)a.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===r)break t;for(;b.sibling===null;){if(b.return===null||b.return===r)break t;b=b.return}b.sibling.return=b.return,b=b.sibling}r.stateNode=a;t:switch(ta(a,c,h),c){case"button":case"input":case"select":case"textarea":a=!!h.autoFocus;break t;case"img":a=!0;break t;default:a=!1}a&&Oo(r)}}return ti(r),r.flags&=-16777217,null;case 6:if(a&&r.stateNode!=null)a.memoizedProps!==h&&Oo(r);else{if(typeof h!="string"&&r.stateNode===null)throw Error(i(166));if(a=at.current,$i(r)){if(a=r.stateNode,c=r.memoizedProps,h=null,b=ci,b!==null)switch(b.tag){case 27:case 5:h=b.memoizedProps}a[sn]=r,a=!!(a.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||f2(a.nodeValue,c)),a||So(r)}else a=xd(a).createTextNode(h),a[sn]=r,r.stateNode=a}return ti(r),null;case 13:if(h=r.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(b=$i(r),h!==null&&h.dehydrated!==null){if(a===null){if(!b)throw Error(i(318));if(b=r.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(i(317));b[sn]=r}else La(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;ti(r),b=!1}else b=zh(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=b),b=!0;if(!b)return r.flags&256?(To(r),r):(To(r),null)}if(To(r),(r.flags&128)!==0)return r.lanes=c,r;if(c=h!==null,a=a!==null&&a.memoizedState!==null,c){h=r.child,b=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(b=h.alternate.memoizedState.cachePool.pool);var w=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(w=h.memoizedState.cachePool.pool),w!==b&&(h.flags|=2048)}return c!==a&&c&&(r.child.flags|=8192),od(r,r.updateQueue),ti(r),null;case 4:return Tt(),a===null&&Om(r.stateNode.containerInfo),ti(r),null;case 10:return xs(r.type),ti(r),null;case 19:if(O(Oi),b=r.memoizedState,b===null)return ti(r),null;if(h=(r.flags&128)!==0,w=b.rendering,w===null)if(h)jf(b,!1);else{if(si!==0||a!==null&&(a.flags&128)!==0)for(a=r.child;a!==null;){if(w=nd(a),w!==null){for(r.flags|=128,jf(b,!1),a=w.updateQueue,r.updateQueue=a,od(r,a),r.subtreeFlags=0,a=c,c=r.child;c!==null;)cc(c,a),c=c.sibling;return q(Oi,Oi.current&1|2),r.child}a=a.sibling}b.tail!==null&&me()>ud&&(r.flags|=128,h=!0,jf(b,!1),r.lanes=4194304)}else{if(!h)if(a=nd(w),a!==null){if(r.flags|=128,h=!0,a=a.updateQueue,r.updateQueue=a,od(r,a),jf(b,!0),b.tail===null&&b.tailMode==="hidden"&&!w.alternate&&!on)return ti(r),null}else 2*me()-b.renderingStartTime>ud&&c!==536870912&&(r.flags|=128,h=!0,jf(b,!1),r.lanes=4194304);b.isBackwards?(w.sibling=r.child,r.child=w):(a=b.last,a!==null?a.sibling=w:r.child=w,b.last=w)}return b.tail!==null?(r=b.tail,b.rendering=r,b.tail=r.sibling,b.renderingStartTime=me(),r.sibling=null,a=Oi.current,q(Oi,h?a&1|2:a&1),r):(ti(r),null);case 22:case 23:return To(r),Me(),h=r.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(r.flags|=8192):h&&(r.flags|=8192),h?(c&536870912)!==0&&(r.flags&128)===0&&(ti(r),r.subtreeFlags&6&&(r.flags|=8192)):ti(r),c=r.updateQueue,c!==null&&od(r,c.retryQueue),c=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),h=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(h=r.memoizedState.cachePool.pool),h!==c&&(r.flags|=2048),a!==null&&O(y),null;case 24:return c=null,a!==null&&(c=a.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),xs(fi),ti(r),null;case 25:return null;case 30:return null}throw Error(i(156,r.tag))}function bx(a,r){switch(hc(r),r.tag){case 1:return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 3:return xs(fi),Tt(),a=r.flags,(a&65536)!==0&&(a&128)===0?(r.flags=a&-65537|128,r):null;case 26:case 27:case 5:return Qt(r),null;case 13:if(To(r),a=r.memoizedState,a!==null&&a.dehydrated!==null){if(r.alternate===null)throw Error(i(340));La()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 19:return O(Oi),null;case 4:return Tt(),null;case 10:return xs(r.type),null;case 22:case 23:return To(r),Me(),a!==null&&O(y),a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 24:return xs(fi),null;case 25:return null;default:return null}}function v1(a,r){switch(hc(r),r.tag){case 3:xs(fi),Tt();break;case 26:case 27:case 5:Qt(r);break;case 4:Tt();break;case 13:To(r);break;case 19:O(Oi);break;case 10:xs(r.type);break;case 22:case 23:To(r),Me(),a!==null&&O(y);break;case 24:xs(fi)}}function Tf(a,r){try{var c=r.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var b=h.next;c=b;do{if((c.tag&a)===a){h=void 0;var w=c.create,M=c.inst;h=w(),M.destroy=h}c=c.next}while(c!==b)}}catch(V){On(r,r.return,V)}}function _l(a,r,c){try{var h=r.updateQueue,b=h!==null?h.lastEffect:null;if(b!==null){var w=b.next;h=w;do{if((h.tag&a)===a){var M=h.inst,V=M.destroy;if(V!==void 0){M.destroy=void 0,b=r;var ft=c,Ot=V;try{Ot()}catch(It){On(b,ft,It)}}}h=h.next}while(h!==w)}}catch(It){On(r,r.return,It)}}function x1(a){var r=a.updateQueue;if(r!==null){var c=a.stateNode;try{ln(r,c)}catch(h){On(a,a.return,h)}}}function w1(a,r,c){c.props=Ac(a.type,a.memoizedProps),c.state=a.memoizedState;try{c.componentWillUnmount()}catch(h){On(a,r,h)}}function Cf(a,r){try{var c=a.ref;if(c!==null){switch(a.tag){case 26:case 27:case 5:var h=a.stateNode;break;case 30:h=a.stateNode;break;default:h=a.stateNode}typeof c=="function"?a.refCleanup=c(h):c.current=h}}catch(b){On(a,r,b)}}function Vr(a,r){var c=a.ref,h=a.refCleanup;if(c!==null)if(typeof h=="function")try{h()}catch(b){On(a,r,b)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(b){On(a,r,b)}else c.current=null}function _1(a){var r=a.type,c=a.memoizedProps,h=a.stateNode;try{t:switch(r){case"button":case"input":case"select":case"textarea":c.autoFocus&&h.focus();break t;case"img":c.src?h.src=c.src:c.srcSet&&(h.srcset=c.srcSet)}}catch(b){On(a,a.return,b)}}function om(a,r,c){try{var h=a.stateNode;zx(h,a.type,c,r),h[We]=r}catch(b){On(a,a.return,b)}}function S1(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Cl(a.type)||a.tag===4}function lm(a){t:for(;;){for(;a.sibling===null;){if(a.return===null||S1(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Cl(a.type)||a.flags&2||a.child===null||a.tag===4)continue t;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function cm(a,r,c){var h=a.tag;if(h===5||h===6)a=a.stateNode,r?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(a,r):(r=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,r.appendChild(a),c=c._reactRootContainer,c!=null||r.onclick!==null||(r.onclick=vd));else if(h!==4&&(h===27&&Cl(a.type)&&(c=a.stateNode,r=null),a=a.child,a!==null))for(cm(a,r,c),a=a.sibling;a!==null;)cm(a,r,c),a=a.sibling}function ld(a,r,c){var h=a.tag;if(h===5||h===6)a=a.stateNode,r?c.insertBefore(a,r):c.appendChild(a);else if(h!==4&&(h===27&&Cl(a.type)&&(c=a.stateNode),a=a.child,a!==null))for(ld(a,r,c),a=a.sibling;a!==null;)ld(a,r,c),a=a.sibling}function N1(a){var r=a.stateNode,c=a.memoizedProps;try{for(var h=a.type,b=r.attributes;b.length;)r.removeAttributeNode(b[0]);ta(r,h,c),r[sn]=a,r[We]=c}catch(w){On(a,a.return,w)}}var Mo=!1,di=!1,um=!1,A1=typeof WeakSet=="function"?WeakSet:Set,Ii=null;function yx(a,r){if(a=a.containerInfo,Rm=Ld,a=Ki(a),Ci(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else t:{c=(c=a.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var b=h.anchorOffset,w=h.focusNode;h=h.focusOffset;try{c.nodeType,w.nodeType}catch{c=null;break t}var M=0,V=-1,ft=-1,Ot=0,It=0,Wt=a,Mt=null;e:for(;;){for(var Dt;Wt!==c||b!==0&&Wt.nodeType!==3||(V=M+b),Wt!==w||h!==0&&Wt.nodeType!==3||(ft=M+h),Wt.nodeType===3&&(M+=Wt.nodeValue.length),(Dt=Wt.firstChild)!==null;)Mt=Wt,Wt=Dt;for(;;){if(Wt===a)break e;if(Mt===c&&++Ot===b&&(V=M),Mt===w&&++It===h&&(ft=M),(Dt=Wt.nextSibling)!==null)break;Wt=Mt,Mt=Wt.parentNode}Wt=Dt}c=V===-1||ft===-1?null:{start:V,end:ft}}else c=null}c=c||{start:0,end:0}}else c=null;for(km={focusedElem:a,selectionRange:c},Ld=!1,Ii=r;Ii!==null;)if(r=Ii,a=r.child,(r.subtreeFlags&1024)!==0&&a!==null)a.return=r,Ii=a;else for(;Ii!==null;){switch(r=Ii,w=r.alternate,a=r.flags,r.tag){case 0:break;case 11:case 15:break;case 1:if((a&1024)!==0&&w!==null){a=void 0,c=r,b=w.memoizedProps,w=w.memoizedState,h=c.stateNode;try{var Ce=Ac(c.type,b,c.elementType===c.type);a=h.getSnapshotBeforeUpdate(Ce,w),h.__reactInternalSnapshotBeforeUpdate=a}catch(Ne){On(c,c.return,Ne)}}break;case 3:if((a&1024)!==0){if(a=r.stateNode.containerInfo,c=a.nodeType,c===9)zm(a);else if(c===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":zm(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(i(163))}if(a=r.sibling,a!==null){a.return=r.return,Ii=a;break}Ii=r.return}}function L1(a,r,c){var h=c.flags;switch(c.tag){case 0:case 11:case 15:Sl(a,c),h&4&&Tf(5,c);break;case 1:if(Sl(a,c),h&4)if(a=c.stateNode,r===null)try{a.componentDidMount()}catch(M){On(c,c.return,M)}else{var b=Ac(c.type,r.memoizedProps);r=r.memoizedState;try{a.componentDidUpdate(b,r,a.__reactInternalSnapshotBeforeUpdate)}catch(M){On(c,c.return,M)}}h&64&&x1(c),h&512&&Cf(c,c.return);break;case 3:if(Sl(a,c),h&64&&(a=c.updateQueue,a!==null)){if(r=null,c.child!==null)switch(c.child.tag){case 27:case 5:r=c.child.stateNode;break;case 1:r=c.child.stateNode}try{ln(a,r)}catch(M){On(c,c.return,M)}}break;case 27:r===null&&h&4&&N1(c);case 26:case 5:Sl(a,c),r===null&&h&4&&_1(c),h&512&&Cf(c,c.return);break;case 12:Sl(a,c);break;case 13:Sl(a,c),h&4&&T1(a,c),h&64&&(a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(c=Ex.bind(null,c),Yx(a,c))));break;case 22:if(h=c.memoizedState!==null||Mo,!h){r=r!==null&&r.memoizedState!==null||di,b=Mo;var w=di;Mo=h,(di=r)&&!w?Nl(a,c,(c.subtreeFlags&8772)!==0):Sl(a,c),Mo=b,di=w}break;case 30:break;default:Sl(a,c)}}function E1(a){var r=a.alternate;r!==null&&(a.alternate=null,E1(r)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(r=a.stateNode,r!==null&&xa(r)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Gn=null,Ba=!1;function Do(a,r,c){for(c=c.child;c!==null;)j1(a,r,c),c=c.sibling}function j1(a,r,c){if(re&&typeof re.onCommitFiberUnmount=="function")try{re.onCommitFiberUnmount(Kt,c)}catch{}switch(c.tag){case 26:di||Vr(c,r),Do(a,r,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:di||Vr(c,r);var h=Gn,b=Ba;Cl(c.type)&&(Gn=c.stateNode,Ba=!1),Do(a,r,c),Ff(c.stateNode),Gn=h,Ba=b;break;case 5:di||Vr(c,r);case 6:if(h=Gn,b=Ba,Gn=null,Do(a,r,c),Gn=h,Ba=b,Gn!==null)if(Ba)try{(Gn.nodeType===9?Gn.body:Gn.nodeName==="HTML"?Gn.ownerDocument.body:Gn).removeChild(c.stateNode)}catch(w){On(c,r,w)}else try{Gn.removeChild(c.stateNode)}catch(w){On(c,r,w)}break;case 18:Gn!==null&&(Ba?(a=Gn,g2(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,c.stateNode),Wf(a)):g2(Gn,c.stateNode));break;case 4:h=Gn,b=Ba,Gn=c.stateNode.containerInfo,Ba=!0,Do(a,r,c),Gn=h,Ba=b;break;case 0:case 11:case 14:case 15:di||_l(2,c,r),di||_l(4,c,r),Do(a,r,c);break;case 1:di||(Vr(c,r),h=c.stateNode,typeof h.componentWillUnmount=="function"&&w1(c,r,h)),Do(a,r,c);break;case 21:Do(a,r,c);break;case 22:di=(h=di)||c.memoizedState!==null,Do(a,r,c),di=h;break;default:Do(a,r,c)}}function T1(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Wf(a)}catch(c){On(r,r.return,c)}}function vx(a){switch(a.tag){case 13:case 19:var r=a.stateNode;return r===null&&(r=a.stateNode=new A1),r;case 22:return a=a.stateNode,r=a._retryCache,r===null&&(r=a._retryCache=new A1),r;default:throw Error(i(435,a.tag))}}function fm(a,r){var c=vx(a);r.forEach(function(h){var b=jx.bind(null,a,h);c.has(h)||(c.add(h),h.then(b,b))})}function is(a,r){var c=r.deletions;if(c!==null)for(var h=0;h<c.length;h++){var b=c[h],w=a,M=r,V=M;t:for(;V!==null;){switch(V.tag){case 27:if(Cl(V.type)){Gn=V.stateNode,Ba=!1;break t}break;case 5:Gn=V.stateNode,Ba=!1;break t;case 3:case 4:Gn=V.stateNode.containerInfo,Ba=!0;break t}V=V.return}if(Gn===null)throw Error(i(160));j1(w,M,b),Gn=null,Ba=!1,w=b.alternate,w!==null&&(w.return=null),b.return=null}if(r.subtreeFlags&13878)for(r=r.child;r!==null;)C1(r,a),r=r.sibling}var tr=null;function C1(a,r){var c=a.alternate,h=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:is(r,a),as(a),h&4&&(_l(3,a,a.return),Tf(3,a),_l(5,a,a.return));break;case 1:is(r,a),as(a),h&512&&(di||c===null||Vr(c,c.return)),h&64&&Mo&&(a=a.updateQueue,a!==null&&(h=a.callbacks,h!==null&&(c=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=c===null?h:c.concat(h))));break;case 26:var b=tr;if(is(r,a),as(a),h&512&&(di||c===null||Vr(c,c.return)),h&4){var w=c!==null?c.memoizedState:null;if(h=a.memoizedState,c===null)if(h===null)if(a.stateNode===null){t:{h=a.type,c=a.memoizedProps,b=b.ownerDocument||b;e:switch(h){case"title":w=b.getElementsByTagName("title")[0],(!w||w[va]||w[sn]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=b.createElement(h),b.head.insertBefore(w,b.querySelector("head > title"))),ta(w,h,c),w[sn]=a,gn(w),h=w;break t;case"link":var M=N2("link","href",b).get(h+(c.href||""));if(M){for(var V=0;V<M.length;V++)if(w=M[V],w.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&w.getAttribute("rel")===(c.rel==null?null:c.rel)&&w.getAttribute("title")===(c.title==null?null:c.title)&&w.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){M.splice(V,1);break e}}w=b.createElement(h),ta(w,h,c),b.head.appendChild(w);break;case"meta":if(M=N2("meta","content",b).get(h+(c.content||""))){for(V=0;V<M.length;V++)if(w=M[V],w.getAttribute("content")===(c.content==null?null:""+c.content)&&w.getAttribute("name")===(c.name==null?null:c.name)&&w.getAttribute("property")===(c.property==null?null:c.property)&&w.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&w.getAttribute("charset")===(c.charSet==null?null:c.charSet)){M.splice(V,1);break e}}w=b.createElement(h),ta(w,h,c),b.head.appendChild(w);break;default:throw Error(i(468,h))}w[sn]=a,gn(w),h=w}a.stateNode=h}else A2(b,a.type,a.stateNode);else a.stateNode=S2(b,h,a.memoizedProps);else w!==h?(w===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):w.count--,h===null?A2(b,a.type,a.stateNode):S2(b,h,a.memoizedProps)):h===null&&a.stateNode!==null&&om(a,a.memoizedProps,c.memoizedProps)}break;case 27:is(r,a),as(a),h&512&&(di||c===null||Vr(c,c.return)),c!==null&&h&4&&om(a,a.memoizedProps,c.memoizedProps);break;case 5:if(is(r,a),as(a),h&512&&(di||c===null||Vr(c,c.return)),a.flags&32){b=a.stateNode;try{br(b,"")}catch(Dt){On(a,a.return,Dt)}}h&4&&a.stateNode!=null&&(b=a.memoizedProps,om(a,b,c!==null?c.memoizedProps:b)),h&1024&&(um=!0);break;case 6:if(is(r,a),as(a),h&4){if(a.stateNode===null)throw Error(i(162));h=a.memoizedProps,c=a.stateNode;try{c.nodeValue=h}catch(Dt){On(a,a.return,Dt)}}break;case 3:if(Sd=null,b=tr,tr=wd(r.containerInfo),is(r,a),tr=b,as(a),h&4&&c!==null&&c.memoizedState.isDehydrated)try{Wf(r.containerInfo)}catch(Dt){On(a,a.return,Dt)}um&&(um=!1,O1(a));break;case 4:h=tr,tr=wd(a.stateNode.containerInfo),is(r,a),as(a),tr=h;break;case 12:is(r,a),as(a);break;case 13:is(r,a),as(a),a.child.flags&8192&&a.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(bm=me()),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,fm(a,h)));break;case 22:b=a.memoizedState!==null;var ft=c!==null&&c.memoizedState!==null,Ot=Mo,It=di;if(Mo=Ot||b,di=It||ft,is(r,a),di=It,Mo=Ot,as(a),h&8192)t:for(r=a.stateNode,r._visibility=b?r._visibility&-2:r._visibility|1,b&&(c===null||ft||Mo||di||Lc(a)),c=null,r=a;;){if(r.tag===5||r.tag===26){if(c===null){ft=c=r;try{if(w=ft.stateNode,b)M=w.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{V=ft.stateNode;var Wt=ft.memoizedProps.style,Mt=Wt!=null&&Wt.hasOwnProperty("display")?Wt.display:null;V.style.display=Mt==null||typeof Mt=="boolean"?"":(""+Mt).trim()}}catch(Dt){On(ft,ft.return,Dt)}}}else if(r.tag===6){if(c===null){ft=r;try{ft.stateNode.nodeValue=b?"":ft.memoizedProps}catch(Dt){On(ft,ft.return,Dt)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===a)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break t;for(;r.sibling===null;){if(r.return===null||r.return===a)break t;c===r&&(c=null),r=r.return}c===r&&(c=null),r.sibling.return=r.return,r=r.sibling}h&4&&(h=a.updateQueue,h!==null&&(c=h.retryQueue,c!==null&&(h.retryQueue=null,fm(a,c))));break;case 19:is(r,a),as(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,fm(a,h)));break;case 30:break;case 21:break;default:is(r,a),as(a)}}function as(a){var r=a.flags;if(r&2){try{for(var c,h=a.return;h!==null;){if(S1(h)){c=h;break}h=h.return}if(c==null)throw Error(i(160));switch(c.tag){case 27:var b=c.stateNode,w=lm(a);ld(a,w,b);break;case 5:var M=c.stateNode;c.flags&32&&(br(M,""),c.flags&=-33);var V=lm(a);ld(a,V,M);break;case 3:case 4:var ft=c.stateNode.containerInfo,Ot=lm(a);cm(a,Ot,ft);break;default:throw Error(i(161))}}catch(It){On(a,a.return,It)}a.flags&=-3}r&4096&&(a.flags&=-4097)}function O1(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var r=a;O1(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),a=a.sibling}}function Sl(a,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)L1(a,r.alternate,r),r=r.sibling}function Lc(a){for(a=a.child;a!==null;){var r=a;switch(r.tag){case 0:case 11:case 14:case 15:_l(4,r,r.return),Lc(r);break;case 1:Vr(r,r.return);var c=r.stateNode;typeof c.componentWillUnmount=="function"&&w1(r,r.return,c),Lc(r);break;case 27:Ff(r.stateNode);case 26:case 5:Vr(r,r.return),Lc(r);break;case 22:r.memoizedState===null&&Lc(r);break;case 30:Lc(r);break;default:Lc(r)}a=a.sibling}}function Nl(a,r,c){for(c=c&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var h=r.alternate,b=a,w=r,M=w.flags;switch(w.tag){case 0:case 11:case 15:Nl(b,w,c),Tf(4,w);break;case 1:if(Nl(b,w,c),h=w,b=h.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(Ot){On(h,h.return,Ot)}if(h=w,b=h.updateQueue,b!==null){var V=h.stateNode;try{var ft=b.shared.hiddenCallbacks;if(ft!==null)for(b.shared.hiddenCallbacks=null,b=0;b<ft.length;b++)en(ft[b],V)}catch(Ot){On(h,h.return,Ot)}}c&&M&64&&x1(w),Cf(w,w.return);break;case 27:N1(w);case 26:case 5:Nl(b,w,c),c&&h===null&&M&4&&_1(w),Cf(w,w.return);break;case 12:Nl(b,w,c);break;case 13:Nl(b,w,c),c&&M&4&&T1(b,w);break;case 22:w.memoizedState===null&&Nl(b,w,c),Cf(w,w.return);break;case 30:break;default:Nl(b,w,c)}r=r.sibling}}function hm(a,r){var c=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==c&&(a!=null&&a.refCount++,c!=null&&dc(c))}function dm(a,r){a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&dc(a))}function Yr(a,r,c,h){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)M1(a,r,c,h),r=r.sibling}function M1(a,r,c,h){var b=r.flags;switch(r.tag){case 0:case 11:case 15:Yr(a,r,c,h),b&2048&&Tf(9,r);break;case 1:Yr(a,r,c,h);break;case 3:Yr(a,r,c,h),b&2048&&(a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&dc(a)));break;case 12:if(b&2048){Yr(a,r,c,h),a=r.stateNode;try{var w=r.memoizedProps,M=w.id,V=w.onPostCommit;typeof V=="function"&&V(M,r.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(ft){On(r,r.return,ft)}}else Yr(a,r,c,h);break;case 13:Yr(a,r,c,h);break;case 23:break;case 22:w=r.stateNode,M=r.alternate,r.memoizedState!==null?w._visibility&2?Yr(a,r,c,h):Of(a,r):w._visibility&2?Yr(a,r,c,h):(w._visibility|=2,vu(a,r,c,h,(r.subtreeFlags&10256)!==0)),b&2048&&hm(M,r);break;case 24:Yr(a,r,c,h),b&2048&&dm(r.alternate,r);break;default:Yr(a,r,c,h)}}function vu(a,r,c,h,b){for(b=b&&(r.subtreeFlags&10256)!==0,r=r.child;r!==null;){var w=a,M=r,V=c,ft=h,Ot=M.flags;switch(M.tag){case 0:case 11:case 15:vu(w,M,V,ft,b),Tf(8,M);break;case 23:break;case 22:var It=M.stateNode;M.memoizedState!==null?It._visibility&2?vu(w,M,V,ft,b):Of(w,M):(It._visibility|=2,vu(w,M,V,ft,b)),b&&Ot&2048&&hm(M.alternate,M);break;case 24:vu(w,M,V,ft,b),b&&Ot&2048&&dm(M.alternate,M);break;default:vu(w,M,V,ft,b)}r=r.sibling}}function Of(a,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var c=a,h=r,b=h.flags;switch(h.tag){case 22:Of(c,h),b&2048&&hm(h.alternate,h);break;case 24:Of(c,h),b&2048&&dm(h.alternate,h);break;default:Of(c,h)}r=r.sibling}}var Mf=8192;function xu(a){if(a.subtreeFlags&Mf)for(a=a.child;a!==null;)D1(a),a=a.sibling}function D1(a){switch(a.tag){case 26:xu(a),a.flags&Mf&&a.memoizedState!==null&&a3(tr,a.memoizedState,a.memoizedProps);break;case 5:xu(a);break;case 3:case 4:var r=tr;tr=wd(a.stateNode.containerInfo),xu(a),tr=r;break;case 22:a.memoizedState===null&&(r=a.alternate,r!==null&&r.memoizedState!==null?(r=Mf,Mf=16777216,xu(a),Mf=r):xu(a));break;default:xu(a)}}function R1(a){var r=a.alternate;if(r!==null&&(a=r.child,a!==null)){r.child=null;do r=a.sibling,a.sibling=null,a=r;while(a!==null)}}function Df(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var c=0;c<r.length;c++){var h=r[c];Ii=h,P1(h,a)}R1(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)k1(a),a=a.sibling}function k1(a){switch(a.tag){case 0:case 11:case 15:Df(a),a.flags&2048&&_l(9,a,a.return);break;case 3:Df(a);break;case 12:Df(a);break;case 22:var r=a.stateNode;a.memoizedState!==null&&r._visibility&2&&(a.return===null||a.return.tag!==13)?(r._visibility&=-3,cd(a)):Df(a);break;default:Df(a)}}function cd(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var c=0;c<r.length;c++){var h=r[c];Ii=h,P1(h,a)}R1(a)}for(a=a.child;a!==null;){switch(r=a,r.tag){case 0:case 11:case 15:_l(8,r,r.return),cd(r);break;case 22:c=r.stateNode,c._visibility&2&&(c._visibility&=-3,cd(r));break;default:cd(r)}a=a.sibling}}function P1(a,r){for(;Ii!==null;){var c=Ii;switch(c.tag){case 0:case 11:case 15:_l(8,c,r);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var h=c.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:dc(c.memoizedState.cache)}if(h=c.child,h!==null)h.return=c,Ii=h;else t:for(c=a;Ii!==null;){h=Ii;var b=h.sibling,w=h.return;if(E1(h),h===c){Ii=null;break t}if(b!==null){b.return=w,Ii=b;break t}Ii=w}}}var xx={getCacheForType:function(a){var r=ui(fi),c=r.data.get(a);return c===void 0&&(c=a(),r.data.set(a,c)),c}},wx=typeof WeakMap=="function"?WeakMap:Map,yn=0,Pn=null,Ke=null,an=0,vn=0,ss=null,Al=!1,wu=!1,pm=!1,Ro=0,si=0,Ll=0,Ec=0,mm=0,Ns=0,_u=0,Rf=null,za=null,gm=!1,bm=0,ud=1/0,fd=null,El=null,Ji=0,jl=null,Su=null,Nu=0,ym=0,vm=null,B1=null,kf=0,xm=null;function rs(){if((yn&2)!==0&&an!==0)return an&-an;if(W.T!==null){var a=No;return a!==0?a:Em()}return Pi()}function z1(){Ns===0&&(Ns=(an&536870912)===0||on?ji():536870912);var a=Ss.current;return a!==null&&(a.flags|=32),Ns}function os(a,r,c){(a===Pn&&(vn===2||vn===9)||a.cancelPendingCommit!==null)&&(Au(a,0),Tl(a,an,Ns,!1)),ki(a,c),((yn&2)===0||a!==Pn)&&(a===Pn&&((yn&2)===0&&(Ec|=c),si===4&&Tl(a,an,Ns,!1)),Gr(a))}function F1(a,r,c){if((yn&6)!==0)throw Error(i(327));var h=!c&&(r&124)===0&&(r&a.expiredLanes)===0||vi(a,r),b=h?Nx(a,r):Sm(a,r,!0),w=h;do{if(b===0){wu&&!h&&Tl(a,r,0,!1);break}else{if(c=a.current.alternate,w&&!_x(c)){b=Sm(a,r,!1),w=!1;continue}if(b===2){if(w=r,a.errorRecoveryDisabledLanes&w)var M=0;else M=a.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){r=M;t:{var V=a;b=Rf;var ft=V.current.memoizedState.isDehydrated;if(ft&&(Au(V,M).flags|=256),M=Sm(V,M,!1),M!==2){if(pm&&!ft){V.errorRecoveryDisabledLanes|=w,Ec|=w,b=4;break t}w=za,za=b,w!==null&&(za===null?za=w:za.push.apply(za,w))}b=M}if(w=!1,b!==2)continue}}if(b===1){Au(a,0),Tl(a,r,0,!0);break}t:{switch(h=a,w=b,w){case 0:case 1:throw Error(i(345));case 4:if((r&4194048)!==r)break;case 6:Tl(h,r,Ns,!Al);break t;case 2:za=null;break;case 3:case 5:break;default:throw Error(i(329))}if((r&62914560)===r&&(b=bm+300-me(),10<b)){if(Tl(h,r,Ns,!Al),Qe(h,0,!0)!==0)break t;h.timeoutHandle=p2(q1.bind(null,h,c,za,fd,gm,r,Ns,Ec,_u,Al,w,2,-0,0),b);break t}q1(h,c,za,fd,gm,r,Ns,Ec,_u,Al,w,0,-0,0)}}break}while(!0);Gr(a)}function q1(a,r,c,h,b,w,M,V,ft,Ot,It,Wt,Mt,Dt){if(a.timeoutHandle=-1,Wt=r.subtreeFlags,(Wt&8192||(Wt&16785408)===16785408)&&(If={stylesheets:null,count:0,unsuspend:i3},D1(r),Wt=s3(),Wt!==null)){a.cancelPendingCommit=Wt(W1.bind(null,a,r,w,c,h,b,M,V,ft,It,1,Mt,Dt)),Tl(a,w,M,!Ot);return}W1(a,r,w,c,h,b,M,V,ft)}function _x(a){for(var r=a;;){var c=r.tag;if((c===0||c===11||c===15)&&r.flags&16384&&(c=r.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var h=0;h<c.length;h++){var b=c[h],w=b.getSnapshot;b=b.value;try{if(!_i(w(),b))return!1}catch{return!1}}if(c=r.child,r.subtreeFlags&16384&&c!==null)c.return=r,r=c;else{if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Tl(a,r,c,h){r&=~mm,r&=~Ec,a.suspendedLanes|=r,a.pingedLanes&=~r,h&&(a.warmLanes|=r),h=a.expirationTimes;for(var b=r;0<b;){var w=31-oe(b),M=1<<w;h[w]=-1,b&=~M}c!==0&&te(a,c,r)}function hd(){return(yn&6)===0?(Pf(0),!1):!0}function wm(){if(Ke!==null){if(vn===0)var a=Ke.return;else a=Ke,Xs=Ni=null,fu(a),bu=null,Lf=0,a=Ke;for(;a!==null;)v1(a.alternate,a),a=a.return;Ke=null}}function Au(a,r){var c=a.timeoutHandle;c!==-1&&(a.timeoutHandle=-1,qx(c)),c=a.cancelPendingCommit,c!==null&&(a.cancelPendingCommit=null,c()),wm(),Pn=a,Ke=c=bs(a.current,null),an=r,vn=0,ss=null,Al=!1,wu=vi(a,r),pm=!1,_u=Ns=mm=Ec=Ll=si=0,za=Rf=null,gm=!1,(r&8)!==0&&(r|=r&32);var h=a.entangledLanes;if(h!==0)for(a=a.entanglements,h&=r;0<h;){var b=31-oe(h),w=1<<b;r|=a[b],h&=~w}return Ro=r,Da(),c}function U1(a,r){we=null,W.H=Jh,r===B||r===U?(r=_t(),vn=3):r===F?(r=_t(),vn=4):vn=r===s1?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,ss=r,Ke===null&&(si=1,ad(a,Ve(r,a.current)))}function I1(){var a=W.H;return W.H=Jh,a===null?Jh:a}function H1(){var a=W.A;return W.A=xx,a}function _m(){si=4,Al||(an&4194048)!==an&&Ss.current!==null||(wu=!0),(Ll&134217727)===0&&(Ec&134217727)===0||Pn===null||Tl(Pn,an,Ns,!1)}function Sm(a,r,c){var h=yn;yn|=2;var b=I1(),w=H1();(Pn!==a||an!==r)&&(fd=null,Au(a,r)),r=!1;var M=si;t:do try{if(vn!==0&&Ke!==null){var V=Ke,ft=ss;switch(vn){case 8:wm(),M=6;break t;case 3:case 2:case 9:case 6:Ss.current===null&&(r=!0);var Ot=vn;if(vn=0,ss=null,Lu(a,V,ft,Ot),c&&wu){M=0;break t}break;default:Ot=vn,vn=0,ss=null,Lu(a,V,ft,Ot)}}Sx(),M=si;break}catch(It){U1(a,It)}while(!0);return r&&a.shellSuspendCounter++,Xs=Ni=null,yn=h,W.H=b,W.A=w,Ke===null&&(Pn=null,an=0,Da()),M}function Sx(){for(;Ke!==null;)V1(Ke)}function Nx(a,r){var c=yn;yn|=2;var h=I1(),b=H1();Pn!==a||an!==r?(fd=null,ud=me()+500,Au(a,r)):wu=vi(a,r);t:do try{if(vn!==0&&Ke!==null){r=Ke;var w=ss;e:switch(vn){case 1:vn=0,ss=null,Lu(a,r,w,1);break;case 2:case 9:if(tt(w)){vn=0,ss=null,Y1(r);break}r=function(){vn!==2&&vn!==9||Pn!==a||(vn=7),Gr(a)},w.then(r,r);break t;case 3:vn=7;break t;case 4:vn=5;break t;case 7:tt(w)?(vn=0,ss=null,Y1(r)):(vn=0,ss=null,Lu(a,r,w,7));break;case 5:var M=null;switch(Ke.tag){case 26:M=Ke.memoizedState;case 5:case 27:var V=Ke;if(!M||L2(M)){vn=0,ss=null;var ft=V.sibling;if(ft!==null)Ke=ft;else{var Ot=V.return;Ot!==null?(Ke=Ot,dd(Ot)):Ke=null}break e}}vn=0,ss=null,Lu(a,r,w,5);break;case 6:vn=0,ss=null,Lu(a,r,w,6);break;case 8:wm(),si=6;break t;default:throw Error(i(462))}}Ax();break}catch(It){U1(a,It)}while(!0);return Xs=Ni=null,W.H=h,W.A=b,yn=c,Ke!==null?0:(Pn=null,an=0,Da(),si)}function Ax(){for(;Ke!==null&&!Bt();)V1(Ke)}function V1(a){var r=b1(a.alternate,a,Ro);a.memoizedProps=a.pendingProps,r===null?dd(a):Ke=r}function Y1(a){var r=a,c=r.alternate;switch(r.tag){case 15:case 0:r=f1(c,r,r.pendingProps,r.type,void 0,an);break;case 11:r=f1(c,r,r.pendingProps,r.type.render,r.ref,an);break;case 5:fu(r);default:v1(c,r),r=Ke=cc(r,Ro),r=b1(c,r,Ro)}a.memoizedProps=a.pendingProps,r===null?dd(a):Ke=r}function Lu(a,r,c,h){Xs=Ni=null,fu(r),bu=null,Lf=0;var b=r.return;try{if(px(a,b,r,c,an)){si=1,ad(a,Ve(c,a.current)),Ke=null;return}}catch(w){if(b!==null)throw Ke=b,w;si=1,ad(a,Ve(c,a.current)),Ke=null;return}r.flags&32768?(on||h===1?a=!0:wu||(an&536870912)!==0?a=!1:(Al=a=!0,(h===2||h===9||h===3||h===6)&&(h=Ss.current,h!==null&&h.tag===13&&(h.flags|=16384))),G1(r,a)):dd(r)}function dd(a){var r=a;do{if((r.flags&32768)!==0){G1(r,Al);return}a=r.return;var c=gx(r.alternate,r,Ro);if(c!==null){Ke=c;return}if(r=r.sibling,r!==null){Ke=r;return}Ke=r=a}while(r!==null);si===0&&(si=5)}function G1(a,r){do{var c=bx(a.alternate,a);if(c!==null){c.flags&=32767,Ke=c;return}if(c=a.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!r&&(a=a.sibling,a!==null)){Ke=a;return}Ke=a=c}while(a!==null);si=6,Ke=null}function W1(a,r,c,h,b,w,M,V,ft){a.cancelPendingCommit=null;do pd();while(Ji!==0);if((yn&6)!==0)throw Error(i(327));if(r!==null){if(r===a.current)throw Error(i(177));if(w=r.lanes|r.childLanes,w|=Zn,Tn(a,c,w,M,V,ft),a===Pn&&(Ke=Pn=null,an=0),Su=r,jl=a,Nu=c,ym=w,vm=b,B1=h,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,Tx(ht,function(){return Q1(),null})):(a.callbackNode=null,a.callbackPriority=0),h=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||h){h=W.T,W.T=null,b=lt.p,lt.p=2,M=yn,yn|=4;try{yx(a,r,c)}finally{yn=M,lt.p=b,W.T=h}}Ji=1,X1(),K1(),$1()}}function X1(){if(Ji===1){Ji=0;var a=jl,r=Su,c=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||c){c=W.T,W.T=null;var h=lt.p;lt.p=2;var b=yn;yn|=4;try{C1(r,a);var w=km,M=Ki(a.containerInfo),V=w.focusedElem,ft=w.selectionRange;if(M!==V&&V&&V.ownerDocument&&Er(V.ownerDocument.documentElement,V)){if(ft!==null&&Ci(V)){var Ot=ft.start,It=ft.end;if(It===void 0&&(It=Ot),"selectionStart"in V)V.selectionStart=Ot,V.selectionEnd=Math.min(It,V.value.length);else{var Wt=V.ownerDocument||document,Mt=Wt&&Wt.defaultView||window;if(Mt.getSelection){var Dt=Mt.getSelection(),Ce=V.textContent.length,Ne=Math.min(ft.start,Ce),Ln=ft.end===void 0?Ne:Math.min(ft.end,Ce);!Dt.extend&&Ne>Ln&&(M=Ln,Ln=Ne,Ne=M);var Nt=qs(V,Ne),vt=qs(V,Ln);if(Nt&&vt&&(Dt.rangeCount!==1||Dt.anchorNode!==Nt.node||Dt.anchorOffset!==Nt.offset||Dt.focusNode!==vt.node||Dt.focusOffset!==vt.offset)){var jt=Wt.createRange();jt.setStart(Nt.node,Nt.offset),Dt.removeAllRanges(),Ne>Ln?(Dt.addRange(jt),Dt.extend(vt.node,vt.offset)):(jt.setEnd(vt.node,vt.offset),Dt.addRange(jt))}}}}for(Wt=[],Dt=V;Dt=Dt.parentNode;)Dt.nodeType===1&&Wt.push({element:Dt,left:Dt.scrollLeft,top:Dt.scrollTop});for(typeof V.focus=="function"&&V.focus(),V=0;V<Wt.length;V++){var Vt=Wt[V];Vt.element.scrollLeft=Vt.left,Vt.element.scrollTop=Vt.top}}Ld=!!Rm,km=Rm=null}finally{yn=b,lt.p=h,W.T=c}}a.current=r,Ji=2}}function K1(){if(Ji===2){Ji=0;var a=jl,r=Su,c=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||c){c=W.T,W.T=null;var h=lt.p;lt.p=2;var b=yn;yn|=4;try{L1(a,r.alternate,r)}finally{yn=b,lt.p=h,W.T=c}}Ji=3}}function $1(){if(Ji===4||Ji===3){Ji=0,ct();var a=jl,r=Su,c=Nu,h=B1;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Ji=5:(Ji=0,Su=jl=null,Z1(a,a.pendingLanes));var b=a.pendingLanes;if(b===0&&(El=null),Je(c),r=r.stateNode,re&&typeof re.onCommitFiberRoot=="function")try{re.onCommitFiberRoot(Kt,r,void 0,(r.current.flags&128)===128)}catch{}if(h!==null){r=W.T,b=lt.p,lt.p=2,W.T=null;try{for(var w=a.onRecoverableError,M=0;M<h.length;M++){var V=h[M];w(V.value,{componentStack:V.stack})}}finally{W.T=r,lt.p=b}}(Nu&3)!==0&&pd(),Gr(a),b=a.pendingLanes,(c&4194090)!==0&&(b&42)!==0?a===xm?kf++:(kf=0,xm=a):kf=0,Pf(0)}}function Z1(a,r){(a.pooledCacheLanes&=r)===0&&(r=a.pooledCache,r!=null&&(a.pooledCache=null,dc(r)))}function pd(a){return X1(),K1(),$1(),Q1()}function Q1(){if(Ji!==5)return!1;var a=jl,r=ym;ym=0;var c=Je(Nu),h=W.T,b=lt.p;try{lt.p=32>c?32:c,W.T=null,c=vm,vm=null;var w=jl,M=Nu;if(Ji=0,Su=jl=null,Nu=0,(yn&6)!==0)throw Error(i(331));var V=yn;if(yn|=4,k1(w.current),M1(w,w.current,M,c),yn=V,Pf(0,!1),re&&typeof re.onPostCommitFiberRoot=="function")try{re.onPostCommitFiberRoot(Kt,w)}catch{}return!0}finally{lt.p=b,W.T=h,Z1(a,r)}}function J1(a,r,c){r=Ve(c,r),r=Qp(a.stateNode,r,2),a=Gt(a,r,2),a!==null&&(ki(a,2),Gr(a))}function On(a,r,c){if(a.tag===3)J1(a,a,c);else for(;r!==null;){if(r.tag===3){J1(r,a,c);break}else if(r.tag===1){var h=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(El===null||!El.has(h))){a=Ve(c,a),c=i1(2),h=Gt(r,c,2),h!==null&&(a1(c,h,r,a),ki(h,2),Gr(h));break}}r=r.return}}function Nm(a,r,c){var h=a.pingCache;if(h===null){h=a.pingCache=new wx;var b=new Set;h.set(r,b)}else b=h.get(r),b===void 0&&(b=new Set,h.set(r,b));b.has(c)||(pm=!0,b.add(c),a=Lx.bind(null,a,r,c),r.then(a,a))}function Lx(a,r,c){var h=a.pingCache;h!==null&&h.delete(r),a.pingedLanes|=a.suspendedLanes&c,a.warmLanes&=~c,Pn===a&&(an&c)===c&&(si===4||si===3&&(an&62914560)===an&&300>me()-bm?(yn&2)===0&&Au(a,0):mm|=c,_u===an&&(_u=0)),Gr(a)}function t2(a,r){r===0&&(r=jn()),a=Is(a,r),a!==null&&(ki(a,r),Gr(a))}function Ex(a){var r=a.memoizedState,c=0;r!==null&&(c=r.retryLane),t2(a,c)}function jx(a,r){var c=0;switch(a.tag){case 13:var h=a.stateNode,b=a.memoizedState;b!==null&&(c=b.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(i(314))}h!==null&&h.delete(r),t2(a,c)}function Tx(a,r){return ie(a,r)}var md=null,Eu=null,Am=!1,gd=!1,Lm=!1,jc=0;function Gr(a){a!==Eu&&a.next===null&&(Eu===null?md=Eu=a:Eu=Eu.next=a),gd=!0,Am||(Am=!0,Ox())}function Pf(a,r){if(!Lm&&gd){Lm=!0;do for(var c=!1,h=md;h!==null;){if(a!==0){var b=h.pendingLanes;if(b===0)var w=0;else{var M=h.suspendedLanes,V=h.pingedLanes;w=(1<<31-oe(42|a)+1)-1,w&=b&~(M&~V),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(c=!0,a2(h,w))}else w=an,w=Qe(h,h===Pn?w:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(w&3)===0||vi(h,w)||(c=!0,a2(h,w));h=h.next}while(c);Lm=!1}}function Cx(){e2()}function e2(){gd=Am=!1;var a=0;jc!==0&&(Fx()&&(a=jc),jc=0);for(var r=me(),c=null,h=md;h!==null;){var b=h.next,w=n2(h,r);w===0?(h.next=null,c===null?md=b:c.next=b,b===null&&(Eu=c)):(c=h,(a!==0||(w&3)!==0)&&(gd=!0)),h=b}Pf(a)}function n2(a,r){for(var c=a.suspendedLanes,h=a.pingedLanes,b=a.expirationTimes,w=a.pendingLanes&-62914561;0<w;){var M=31-oe(w),V=1<<M,ft=b[M];ft===-1?((V&c)===0||(V&h)!==0)&&(b[M]=He(V,r)):ft<=r&&(a.expiredLanes|=V),w&=~V}if(r=Pn,c=an,c=Qe(a,a===r?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h=a.callbackNode,c===0||a===r&&(vn===2||vn===9)||a.cancelPendingCommit!==null)return h!==null&&h!==null&&ye(h),a.callbackNode=null,a.callbackPriority=0;if((c&3)===0||vi(a,c)){if(r=c&-c,r===a.callbackPriority)return r;switch(h!==null&&ye(h),Je(c)){case 2:case 8:c=J;break;case 32:c=ht;break;case 268435456:c=Pt;break;default:c=ht}return h=i2.bind(null,a),c=ie(c,h),a.callbackPriority=r,a.callbackNode=c,r}return h!==null&&h!==null&&ye(h),a.callbackPriority=2,a.callbackNode=null,2}function i2(a,r){if(Ji!==0&&Ji!==5)return a.callbackNode=null,a.callbackPriority=0,null;var c=a.callbackNode;if(pd()&&a.callbackNode!==c)return null;var h=an;return h=Qe(a,a===Pn?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h===0?null:(F1(a,h,r),n2(a,me()),a.callbackNode!=null&&a.callbackNode===c?i2.bind(null,a):null)}function a2(a,r){if(pd())return null;F1(a,r,!0)}function Ox(){Ux(function(){(yn&6)!==0?ie(Xt,Cx):e2()})}function Em(){return jc===0&&(jc=ji()),jc}function s2(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:ks(""+a)}function r2(a,r){var c=r.ownerDocument.createElement("input");return c.name=r.name,c.value=r.value,a.id&&c.setAttribute("form",a.id),r.parentNode.insertBefore(c,r),a=new FormData(a),c.parentNode.removeChild(c),a}function Mx(a,r,c,h,b){if(r==="submit"&&c&&c.stateNode===b){var w=s2((b[We]||null).action),M=h.submitter;M&&(r=(r=M[We]||null)?s2(r.formAction):M.getAttribute("formAction"),r!==null&&(w=r,M=null));var V=new xr("action","action",null,h,b);a.push({event:V,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(jc!==0){var ft=M?r2(b,M):new FormData(b);_s(c,{pending:!0,data:ft,method:b.method,action:w},null,ft)}}else typeof w=="function"&&(V.preventDefault(),ft=M?r2(b,M):new FormData(b),_s(c,{pending:!0,data:ft,method:b.method,action:w},w,ft))},currentTarget:b}]})}}for(var jm=0;jm<yo.length;jm++){var Tm=yo[jm],Dx=Tm.toLowerCase(),Rx=Tm[0].toUpperCase()+Tm.slice(1);Vn(Dx,"on"+Rx)}Vn(cl,"onAnimationEnd"),Vn(Tr,"onAnimationIteration"),Vn(Cr,"onAnimationStart"),Vn("dblclick","onDoubleClick"),Vn("focusin","onFocus"),Vn("focusout","onBlur"),Vn(Or,"onTransitionRun"),Vn(bo,"onTransitionStart"),Vn(ul,"onTransitionCancel"),Vn(Mr,"onTransitionEnd"),Wa("onMouseEnter",["mouseout","mouseover"]),Wa("onMouseLeave",["mouseout","mouseover"]),Wa("onPointerEnter",["pointerout","pointerover"]),Wa("onPointerLeave",["pointerout","pointerover"]),Ta("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ta("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ta("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ta("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ta("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ta("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bf="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),kx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bf));function o2(a,r){r=(r&4)!==0;for(var c=0;c<a.length;c++){var h=a[c],b=h.event;h=h.listeners;t:{var w=void 0;if(r)for(var M=h.length-1;0<=M;M--){var V=h[M],ft=V.instance,Ot=V.currentTarget;if(V=V.listener,ft!==w&&b.isPropagationStopped())break t;w=V,b.currentTarget=Ot;try{w(b)}catch(It){id(It)}b.currentTarget=null,w=ft}else for(M=0;M<h.length;M++){if(V=h[M],ft=V.instance,Ot=V.currentTarget,V=V.listener,ft!==w&&b.isPropagationStopped())break t;w=V,b.currentTarget=Ot;try{w(b)}catch(It){id(It)}b.currentTarget=null,w=ft}}}}function $e(a,r){var c=r[Dn];c===void 0&&(c=r[Dn]=new Set);var h=a+"__bubble";c.has(h)||(l2(r,a,2,!1),c.add(h))}function Cm(a,r,c){var h=0;r&&(h|=4),l2(c,a,h,r)}var bd="_reactListening"+Math.random().toString(36).slice(2);function Om(a){if(!a[bd]){a[bd]=!0,pr.forEach(function(c){c!=="selectionchange"&&(kx.has(c)||Cm(c,!1,a),Cm(c,!0,a))});var r=a.nodeType===9?a:a.ownerDocument;r===null||r[bd]||(r[bd]=!0,Cm("selectionchange",!1,r))}}function l2(a,r,c,h){switch(M2(r)){case 2:var b=l3;break;case 8:b=c3;break;default:b=Ym}c=b.bind(null,r,c,a),b=void 0,!$o||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(b=!0),h?b!==void 0?a.addEventListener(r,c,{capture:!0,passive:b}):a.addEventListener(r,c,!0):b!==void 0?a.addEventListener(r,c,{passive:b}):a.addEventListener(r,c,!1)}function Mm(a,r,c,h,b){var w=h;if((r&1)===0&&(r&2)===0&&h!==null)t:for(;;){if(h===null)return;var M=h.tag;if(M===3||M===4){var V=h.stateNode.containerInfo;if(V===b)break;if(M===4)for(M=h.return;M!==null;){var ft=M.tag;if((ft===3||ft===4)&&M.stateNode.containerInfo===b)return;M=M.return}for(;V!==null;){if(M=Bi(V),M===null)return;if(ft=M.tag,ft===5||ft===6||ft===26||ft===27){h=w=M;continue t}V=V.parentNode}}h=h.return}Jc(function(){var Ot=w,It=xi(c),Wt=[];t:{var Mt=Us.get(a);if(Mt!==void 0){var Dt=xr,Ce=a;switch(a){case"keypress":if(vr(c)===0)break t;case"keydown":case"keyup":Dt=al;break;case"focusin":Ce="focus",Dt=co;break;case"focusout":Ce="blur",Dt=co;break;case"beforeblur":case"afterblur":Dt=co;break;case"click":if(c.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Dt=ps;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Dt=_r;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Dt=sc;break;case cl:case Tr:case Cr:Dt=of;break;case Mr:Dt=P;break;case"scroll":case"scrollend":Dt=eu;break;case"wheel":Dt=pt;break;case"copy":case"cut":case"paste":Dt=lf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Dt=sl;break;case"toggle":case"beforetoggle":Dt=zt}var Ne=(r&4)!==0,Ln=!Ne&&(a==="scroll"||a==="scrollend"),Nt=Ne?Mt!==null?Mt+"Capture":null:Mt;Ne=[];for(var vt=Ot,jt;vt!==null;){var Vt=vt;if(jt=Vt.stateNode,Vt=Vt.tag,Vt!==5&&Vt!==26&&Vt!==27||jt===null||Nt===null||(Vt=aa(vt,Nt),Vt!=null&&Ne.push(zf(vt,Vt,jt))),Ln)break;vt=vt.return}0<Ne.length&&(Mt=new Dt(Mt,Ce,null,c,It),Wt.push({event:Mt,listeners:Ne}))}}if((r&7)===0){t:{if(Mt=a==="mouseover"||a==="pointerover",Dt=a==="mouseout"||a==="pointerout",Mt&&c!==Ko&&(Ce=c.relatedTarget||c.fromElement)&&(Bi(Ce)||Ce[rn]))break t;if((Dt||Mt)&&(Mt=It.window===It?It:(Mt=It.ownerDocument)?Mt.defaultView||Mt.parentWindow:window,Dt?(Ce=c.relatedTarget||c.toElement,Dt=Ot,Ce=Ce?Bi(Ce):null,Ce!==null&&(Ln=o(Ce),Ne=Ce.tag,Ce!==Ln||Ne!==5&&Ne!==27&&Ne!==6)&&(Ce=null)):(Dt=null,Ce=Ot),Dt!==Ce)){if(Ne=ps,Vt="onMouseLeave",Nt="onMouseEnter",vt="mouse",(a==="pointerout"||a==="pointerover")&&(Ne=sl,Vt="onPointerLeave",Nt="onPointerEnter",vt="pointer"),Ln=Dt==null?Mt:na(Dt),jt=Ce==null?Mt:na(Ce),Mt=new Ne(Vt,vt+"leave",Dt,c,It),Mt.target=Ln,Mt.relatedTarget=jt,Vt=null,Bi(It)===Ot&&(Ne=new Ne(Nt,vt+"enter",Ce,c,It),Ne.target=jt,Ne.relatedTarget=Ln,Vt=Ne),Ln=Vt,Dt&&Ce)e:{for(Ne=Dt,Nt=Ce,vt=0,jt=Ne;jt;jt=ju(jt))vt++;for(jt=0,Vt=Nt;Vt;Vt=ju(Vt))jt++;for(;0<vt-jt;)Ne=ju(Ne),vt--;for(;0<jt-vt;)Nt=ju(Nt),jt--;for(;vt--;){if(Ne===Nt||Nt!==null&&Ne===Nt.alternate)break e;Ne=ju(Ne),Nt=ju(Nt)}Ne=null}else Ne=null;Dt!==null&&c2(Wt,Mt,Dt,Ne,!1),Ce!==null&&Ln!==null&&c2(Wt,Ln,Ce,Ne,!0)}}t:{if(Mt=Ot?na(Ot):window,Dt=Mt.nodeName&&Mt.nodeName.toLowerCase(),Dt==="select"||Dt==="input"&&Mt.type==="file")var de=ol;else if(Za(Mt))if(ho)de=iu;else{de=uf;var Ge=sa}else Dt=Mt.nodeName,!Dt||Dt.toLowerCase()!=="input"||Mt.type!=="checkbox"&&Mt.type!=="radio"?Ot&&Jl(Ot.elementType)&&(de=ol):de=oc;if(de&&(de=de(a,Ot))){rc(Wt,de,c,It);break t}Ge&&Ge(a,Mt,Ot),a==="focusout"&&Ot&&Mt.type==="number"&&Ot.memoizedProps.value!=null&&$l(Mt,"number",Mt.value)}switch(Ge=Ot?na(Ot):window,a){case"focusin":(Za(Ge)||Ge.contentEditable==="true")&&(ra=Ge,Qa=Ot,ms=null);break;case"focusout":ms=Qa=ra=null;break;case"mousedown":Ja=!0;break;case"contextmenu":case"mouseup":case"dragend":Ja=!1,Hn(Wt,c,It);break;case"selectionchange":if(jr)break;case"keydown":case"keyup":Hn(Wt,c,It)}var xe;if(le)t:{switch(a){case"compositionstart":var Le="onCompositionStart";break t;case"compositionend":Le="onCompositionEnd";break t;case"compositionupdate":Le="onCompositionUpdate";break t}Le=void 0}else $n?zn(a,c)&&(Le="onCompositionEnd"):a==="keydown"&&c.keyCode===229&&(Le="onCompositionStart");Le&&(Oe&&c.locale!=="ko"&&($n||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&$n&&(xe=tu()):(Oa=It,ec="value"in Oa?Oa.value:Oa.textContent,$n=!0)),Ge=yd(Ot,Le),0<Ge.length&&(Le=new el(Le,a,null,c,It),Wt.push({event:Le,listeners:Ge}),xe?Le.data=xe:(xe=Kn(c),xe!==null&&(Le.data=xe)))),(xe=Re?wi(a,c):$a(a,c))&&(Le=yd(Ot,"onBeforeInput"),0<Le.length&&(Ge=new el("onBeforeInput","beforeinput",null,c,It),Wt.push({event:Ge,listeners:Le}),Ge.data=xe)),Mx(Wt,a,Ot,c,It)}o2(Wt,r)})}function zf(a,r,c){return{instance:a,listener:r,currentTarget:c}}function yd(a,r){for(var c=r+"Capture",h=[];a!==null;){var b=a,w=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||w===null||(b=aa(a,c),b!=null&&h.unshift(zf(a,b,w)),b=aa(a,r),b!=null&&h.push(zf(a,b,w))),a.tag===3)return h;a=a.return}return[]}function ju(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function c2(a,r,c,h,b){for(var w=r._reactName,M=[];c!==null&&c!==h;){var V=c,ft=V.alternate,Ot=V.stateNode;if(V=V.tag,ft!==null&&ft===h)break;V!==5&&V!==26&&V!==27||Ot===null||(ft=Ot,b?(Ot=aa(c,w),Ot!=null&&M.unshift(zf(c,Ot,ft))):b||(Ot=aa(c,w),Ot!=null&&M.push(zf(c,Ot,ft)))),c=c.return}M.length!==0&&a.push({event:r,listeners:M})}var Px=/\r\n?/g,Bx=/\u0000|\uFFFD/g;function u2(a){return(typeof a=="string"?a:""+a).replace(Px,`
`).replace(Bx,"")}function f2(a,r){return r=u2(r),u2(a)===r}function vd(){}function An(a,r,c,h,b,w){switch(c){case"children":typeof h=="string"?r==="body"||r==="textarea"&&h===""||br(a,h):(typeof h=="number"||typeof h=="bigint")&&r!=="body"&&br(a,""+h);break;case"className":ro(a,"class",h);break;case"tabIndex":ro(a,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":ro(a,c,h);break;case"style":Qc(a,h,w);break;case"data":if(r!=="object"){ro(a,"data",h);break}case"src":case"href":if(h===""&&(r!=="a"||c!=="href")){a.removeAttribute(c);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(c);break}h=ks(""+h),a.setAttribute(c,h);break;case"action":case"formAction":if(typeof h=="function"){a.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(c==="formAction"?(r!=="input"&&An(a,r,"name",b.name,b,null),An(a,r,"formEncType",b.formEncType,b,null),An(a,r,"formMethod",b.formMethod,b,null),An(a,r,"formTarget",b.formTarget,b,null)):(An(a,r,"encType",b.encType,b,null),An(a,r,"method",b.method,b,null),An(a,r,"target",b.target,b,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(c);break}h=ks(""+h),a.setAttribute(c,h);break;case"onClick":h!=null&&(a.onclick=vd);break;case"onScroll":h!=null&&$e("scroll",a);break;case"onScrollEnd":h!=null&&$e("scrollend",a);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(c=h.__html,c!=null){if(b.children!=null)throw Error(i(60));a.innerHTML=c}}break;case"multiple":a.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":a.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){a.removeAttribute("xlink:href");break}c=ks(""+h),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(c,""+h):a.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(c,""):a.removeAttribute(c);break;case"capture":case"download":h===!0?a.setAttribute(c,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(c,h):a.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?a.setAttribute(c,h):a.removeAttribute(c);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?a.removeAttribute(c):a.setAttribute(c,h);break;case"popover":$e("beforetoggle",a),$e("toggle",a),Os(a,"popover",h);break;case"xlinkActuate":Xa(a,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Xa(a,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Xa(a,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Xa(a,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Xa(a,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Xa(a,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Xa(a,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Xa(a,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Xa(a,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Os(a,"is",h);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=Rs.get(c)||c,Os(a,c,h))}}function Dm(a,r,c,h,b,w){switch(c){case"style":Qc(a,h,w);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(c=h.__html,c!=null){if(b.children!=null)throw Error(i(60));a.innerHTML=c}}break;case"children":typeof h=="string"?br(a,h):(typeof h=="number"||typeof h=="bigint")&&br(a,""+h);break;case"onScroll":h!=null&&$e("scroll",a);break;case"onScrollEnd":h!=null&&$e("scrollend",a);break;case"onClick":h!=null&&(a.onclick=vd);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!so.hasOwnProperty(c))t:{if(c[0]==="o"&&c[1]==="n"&&(b=c.endsWith("Capture"),r=c.slice(2,b?c.length-7:void 0),w=a[We]||null,w=w!=null?w[c]:null,typeof w=="function"&&a.removeEventListener(r,w,b),typeof h=="function")){typeof w!="function"&&w!==null&&(c in a?a[c]=null:a.hasAttribute(c)&&a.removeAttribute(c)),a.addEventListener(r,h,b);break t}c in a?a[c]=h:h===!0?a.setAttribute(c,""):Os(a,c,h)}}}function ta(a,r,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":$e("error",a),$e("load",a);var h=!1,b=!1,w;for(w in c)if(c.hasOwnProperty(w)){var M=c[w];if(M!=null)switch(w){case"src":h=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:An(a,r,w,M,c,null)}}b&&An(a,r,"srcSet",c.srcSet,c,null),h&&An(a,r,"src",c.src,c,null);return;case"input":$e("invalid",a);var V=w=M=b=null,ft=null,Ot=null;for(h in c)if(c.hasOwnProperty(h)){var It=c[h];if(It!=null)switch(h){case"name":b=It;break;case"type":M=It;break;case"checked":ft=It;break;case"defaultChecked":Ot=It;break;case"value":w=It;break;case"defaultValue":V=It;break;case"children":case"dangerouslySetInnerHTML":if(It!=null)throw Error(i(137,r));break;default:An(a,r,h,It,c,null)}}Kl(a,w,V,ft,Ot,M,b,!1),gr(a);return;case"select":$e("invalid",a),h=M=w=null;for(b in c)if(c.hasOwnProperty(b)&&(V=c[b],V!=null))switch(b){case"value":w=V;break;case"defaultValue":M=V;break;case"multiple":h=V;default:An(a,r,b,V,c,null)}r=w,c=M,a.multiple=!!h,r!=null?Ds(a,!!h,r,!1):c!=null&&Ds(a,!!h,c,!0);return;case"textarea":$e("invalid",a),w=b=h=null;for(M in c)if(c.hasOwnProperty(M)&&(V=c[M],V!=null))switch(M){case"value":h=V;break;case"defaultValue":b=V;break;case"children":w=V;break;case"dangerouslySetInnerHTML":if(V!=null)throw Error(i(91));break;default:An(a,r,M,V,c,null)}Zl(a,h,b,w),gr(a);return;case"option":for(ft in c)if(c.hasOwnProperty(ft)&&(h=c[ft],h!=null))switch(ft){case"selected":a.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:An(a,r,ft,h,c,null)}return;case"dialog":$e("beforetoggle",a),$e("toggle",a),$e("cancel",a),$e("close",a);break;case"iframe":case"object":$e("load",a);break;case"video":case"audio":for(h=0;h<Bf.length;h++)$e(Bf[h],a);break;case"image":$e("error",a),$e("load",a);break;case"details":$e("toggle",a);break;case"embed":case"source":case"link":$e("error",a),$e("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Ot in c)if(c.hasOwnProperty(Ot)&&(h=c[Ot],h!=null))switch(Ot){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:An(a,r,Ot,h,c,null)}return;default:if(Jl(r)){for(It in c)c.hasOwnProperty(It)&&(h=c[It],h!==void 0&&Dm(a,r,It,h,c,void 0));return}}for(V in c)c.hasOwnProperty(V)&&(h=c[V],h!=null&&An(a,r,V,h,c,null))}function zx(a,r,c,h){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,w=null,M=null,V=null,ft=null,Ot=null,It=null;for(Dt in c){var Wt=c[Dt];if(c.hasOwnProperty(Dt)&&Wt!=null)switch(Dt){case"checked":break;case"value":break;case"defaultValue":ft=Wt;default:h.hasOwnProperty(Dt)||An(a,r,Dt,null,h,Wt)}}for(var Mt in h){var Dt=h[Mt];if(Wt=c[Mt],h.hasOwnProperty(Mt)&&(Dt!=null||Wt!=null))switch(Mt){case"type":w=Dt;break;case"name":b=Dt;break;case"checked":Ot=Dt;break;case"defaultChecked":It=Dt;break;case"value":M=Dt;break;case"defaultValue":V=Dt;break;case"children":case"dangerouslySetInnerHTML":if(Dt!=null)throw Error(i(137,r));break;default:Dt!==Wt&&An(a,r,Mt,Dt,h,Wt)}}lo(a,M,V,ft,Ot,It,w,b);return;case"select":Dt=M=V=Mt=null;for(w in c)if(ft=c[w],c.hasOwnProperty(w)&&ft!=null)switch(w){case"value":break;case"multiple":Dt=ft;default:h.hasOwnProperty(w)||An(a,r,w,null,h,ft)}for(b in h)if(w=h[b],ft=c[b],h.hasOwnProperty(b)&&(w!=null||ft!=null))switch(b){case"value":Mt=w;break;case"defaultValue":V=w;break;case"multiple":M=w;default:w!==ft&&An(a,r,b,w,h,ft)}r=V,c=M,h=Dt,Mt!=null?Ds(a,!!c,Mt,!1):!!h!=!!c&&(r!=null?Ds(a,!!c,r,!0):Ds(a,!!c,c?[]:"",!1));return;case"textarea":Dt=Mt=null;for(V in c)if(b=c[V],c.hasOwnProperty(V)&&b!=null&&!h.hasOwnProperty(V))switch(V){case"value":break;case"children":break;default:An(a,r,V,null,h,b)}for(M in h)if(b=h[M],w=c[M],h.hasOwnProperty(M)&&(b!=null||w!=null))switch(M){case"value":Mt=b;break;case"defaultValue":Dt=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(i(91));break;default:b!==w&&An(a,r,M,b,h,w)}$c(a,Mt,Dt);return;case"option":for(var Ce in c)if(Mt=c[Ce],c.hasOwnProperty(Ce)&&Mt!=null&&!h.hasOwnProperty(Ce))switch(Ce){case"selected":a.selected=!1;break;default:An(a,r,Ce,null,h,Mt)}for(ft in h)if(Mt=h[ft],Dt=c[ft],h.hasOwnProperty(ft)&&Mt!==Dt&&(Mt!=null||Dt!=null))switch(ft){case"selected":a.selected=Mt&&typeof Mt!="function"&&typeof Mt!="symbol";break;default:An(a,r,ft,Mt,h,Dt)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ne in c)Mt=c[Ne],c.hasOwnProperty(Ne)&&Mt!=null&&!h.hasOwnProperty(Ne)&&An(a,r,Ne,null,h,Mt);for(Ot in h)if(Mt=h[Ot],Dt=c[Ot],h.hasOwnProperty(Ot)&&Mt!==Dt&&(Mt!=null||Dt!=null))switch(Ot){case"children":case"dangerouslySetInnerHTML":if(Mt!=null)throw Error(i(137,r));break;default:An(a,r,Ot,Mt,h,Dt)}return;default:if(Jl(r)){for(var Ln in c)Mt=c[Ln],c.hasOwnProperty(Ln)&&Mt!==void 0&&!h.hasOwnProperty(Ln)&&Dm(a,r,Ln,void 0,h,Mt);for(It in h)Mt=h[It],Dt=c[It],!h.hasOwnProperty(It)||Mt===Dt||Mt===void 0&&Dt===void 0||Dm(a,r,It,Mt,h,Dt);return}}for(var Nt in c)Mt=c[Nt],c.hasOwnProperty(Nt)&&Mt!=null&&!h.hasOwnProperty(Nt)&&An(a,r,Nt,null,h,Mt);for(Wt in h)Mt=h[Wt],Dt=c[Wt],!h.hasOwnProperty(Wt)||Mt===Dt||Mt==null&&Dt==null||An(a,r,Wt,Mt,h,Dt)}var Rm=null,km=null;function xd(a){return a.nodeType===9?a:a.ownerDocument}function h2(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function d2(a,r){if(a===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&r==="foreignObject"?0:a}function Pm(a,r){return a==="textarea"||a==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Bm=null;function Fx(){var a=window.event;return a&&a.type==="popstate"?a===Bm?!1:(Bm=a,!0):(Bm=null,!1)}var p2=typeof setTimeout=="function"?setTimeout:void 0,qx=typeof clearTimeout=="function"?clearTimeout:void 0,m2=typeof Promise=="function"?Promise:void 0,Ux=typeof queueMicrotask=="function"?queueMicrotask:typeof m2<"u"?function(a){return m2.resolve(null).then(a).catch(Ix)}:p2;function Ix(a){setTimeout(function(){throw a})}function Cl(a){return a==="head"}function g2(a,r){var c=r,h=0,b=0;do{var w=c.nextSibling;if(a.removeChild(c),w&&w.nodeType===8)if(c=w.data,c==="/$"){if(0<h&&8>h){c=h;var M=a.ownerDocument;if(c&1&&Ff(M.documentElement),c&2&&Ff(M.body),c&4)for(c=M.head,Ff(c),M=c.firstChild;M;){var V=M.nextSibling,ft=M.nodeName;M[va]||ft==="SCRIPT"||ft==="STYLE"||ft==="LINK"&&M.rel.toLowerCase()==="stylesheet"||c.removeChild(M),M=V}}if(b===0){a.removeChild(w),Wf(r);return}b--}else c==="$"||c==="$?"||c==="$!"?b++:h=c.charCodeAt(0)-48;else h=0;c=w}while(c);Wf(r)}function zm(a){var r=a.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var c=r;switch(r=r.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":zm(c),xa(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}a.removeChild(c)}}function Hx(a,r,c,h){for(;a.nodeType===1;){var b=c;if(a.nodeName.toLowerCase()!==r.toLowerCase()){if(!h&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(h){if(!a[va])switch(r){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(w=a.getAttribute("rel"),w==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(w!==b.rel||a.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||a.getAttribute("title")!==(b.title==null?null:b.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(w=a.getAttribute("src"),(w!==(b.src==null?null:b.src)||a.getAttribute("type")!==(b.type==null?null:b.type)||a.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&w&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(r==="input"&&a.type==="hidden"){var w=b.name==null?null:""+b.name;if(b.type==="hidden"&&a.getAttribute("name")===w)return a}else return a;if(a=er(a.nextSibling),a===null)break}return null}function Vx(a,r,c){if(r==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!c||(a=er(a.nextSibling),a===null))return null;return a}function Fm(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState==="complete"}function Yx(a,r){var c=a.ownerDocument;if(a.data!=="$?"||c.readyState==="complete")r();else{var h=function(){r(),c.removeEventListener("DOMContentLoaded",h)};c.addEventListener("DOMContentLoaded",h),a._reactRetry=h}}function er(a){for(;a!=null;a=a.nextSibling){var r=a.nodeType;if(r===1||r===3)break;if(r===8){if(r=a.data,r==="$"||r==="$!"||r==="$?"||r==="F!"||r==="F")break;if(r==="/$")return null}}return a}var qm=null;function b2(a){a=a.previousSibling;for(var r=0;a;){if(a.nodeType===8){var c=a.data;if(c==="$"||c==="$!"||c==="$?"){if(r===0)return a;r--}else c==="/$"&&r++}a=a.previousSibling}return null}function y2(a,r,c){switch(r=xd(c),a){case"html":if(a=r.documentElement,!a)throw Error(i(452));return a;case"head":if(a=r.head,!a)throw Error(i(453));return a;case"body":if(a=r.body,!a)throw Error(i(454));return a;default:throw Error(i(451))}}function Ff(a){for(var r=a.attributes;r.length;)a.removeAttributeNode(r[0]);xa(a)}var As=new Map,v2=new Set;function wd(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var ko=lt.d;lt.d={f:Gx,r:Wx,D:Xx,C:Kx,L:$x,m:Zx,X:Jx,S:Qx,M:t3};function Gx(){var a=ko.f(),r=hd();return a||r}function Wx(a){var r=zi(a);r!==null&&r.tag===5&&r.type==="form"?Sc(r):ko.r(a)}var Tu=typeof document>"u"?null:document;function x2(a,r,c){var h=Tu;if(h&&typeof r=="string"&&r){var b=Cn(r);b='link[rel="'+a+'"][href="'+b+'"]',typeof c=="string"&&(b+='[crossorigin="'+c+'"]'),v2.has(b)||(v2.add(b),a={rel:a,crossOrigin:c,href:r},h.querySelector(b)===null&&(r=h.createElement("link"),ta(r,"link",a),gn(r),h.head.appendChild(r)))}}function Xx(a){ko.D(a),x2("dns-prefetch",a,null)}function Kx(a,r){ko.C(a,r),x2("preconnect",a,r)}function $x(a,r,c){ko.L(a,r,c);var h=Tu;if(h&&a&&r){var b='link[rel="preload"][as="'+Cn(r)+'"]';r==="image"&&c&&c.imageSrcSet?(b+='[imagesrcset="'+Cn(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(b+='[imagesizes="'+Cn(c.imageSizes)+'"]')):b+='[href="'+Cn(a)+'"]';var w=b;switch(r){case"style":w=Cu(a);break;case"script":w=Ou(a)}As.has(w)||(a=m({rel:"preload",href:r==="image"&&c&&c.imageSrcSet?void 0:a,as:r},c),As.set(w,a),h.querySelector(b)!==null||r==="style"&&h.querySelector(qf(w))||r==="script"&&h.querySelector(Uf(w))||(r=h.createElement("link"),ta(r,"link",a),gn(r),h.head.appendChild(r)))}}function Zx(a,r){ko.m(a,r);var c=Tu;if(c&&a){var h=r&&typeof r.as=="string"?r.as:"script",b='link[rel="modulepreload"][as="'+Cn(h)+'"][href="'+Cn(a)+'"]',w=b;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Ou(a)}if(!As.has(w)&&(a=m({rel:"modulepreload",href:a},r),As.set(w,a),c.querySelector(b)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Uf(w)))return}h=c.createElement("link"),ta(h,"link",a),gn(h),c.head.appendChild(h)}}}function Qx(a,r,c){ko.S(a,r,c);var h=Tu;if(h&&a){var b=Ti(h).hoistableStyles,w=Cu(a);r=r||"default";var M=b.get(w);if(!M){var V={loading:0,preload:null};if(M=h.querySelector(qf(w)))V.loading=5;else{a=m({rel:"stylesheet",href:a,"data-precedence":r},c),(c=As.get(w))&&Um(a,c);var ft=M=h.createElement("link");gn(ft),ta(ft,"link",a),ft._p=new Promise(function(Ot,It){ft.onload=Ot,ft.onerror=It}),ft.addEventListener("load",function(){V.loading|=1}),ft.addEventListener("error",function(){V.loading|=2}),V.loading|=4,_d(M,r,h)}M={type:"stylesheet",instance:M,count:1,state:V},b.set(w,M)}}}function Jx(a,r){ko.X(a,r);var c=Tu;if(c&&a){var h=Ti(c).hoistableScripts,b=Ou(a),w=h.get(b);w||(w=c.querySelector(Uf(b)),w||(a=m({src:a,async:!0},r),(r=As.get(b))&&Im(a,r),w=c.createElement("script"),gn(w),ta(w,"link",a),c.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(b,w))}}function t3(a,r){ko.M(a,r);var c=Tu;if(c&&a){var h=Ti(c).hoistableScripts,b=Ou(a),w=h.get(b);w||(w=c.querySelector(Uf(b)),w||(a=m({src:a,async:!0,type:"module"},r),(r=As.get(b))&&Im(a,r),w=c.createElement("script"),gn(w),ta(w,"link",a),c.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(b,w))}}function w2(a,r,c,h){var b=(b=at.current)?wd(b):null;if(!b)throw Error(i(446));switch(a){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(r=Cu(c.href),c=Ti(b).hoistableStyles,h=c.get(r),h||(h={type:"style",instance:null,count:0,state:null},c.set(r,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){a=Cu(c.href);var w=Ti(b).hoistableStyles,M=w.get(a);if(M||(b=b.ownerDocument||b,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(a,M),(w=b.querySelector(qf(a)))&&!w._p&&(M.instance=w,M.state.loading=5),As.has(a)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},As.set(a,c),w||e3(b,a,c,M.state))),r&&h===null)throw Error(i(528,""));return M}if(r&&h!==null)throw Error(i(529,""));return null;case"script":return r=c.async,c=c.src,typeof c=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Ou(c),c=Ti(b).hoistableScripts,h=c.get(r),h||(h={type:"script",instance:null,count:0,state:null},c.set(r,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,a))}}function Cu(a){return'href="'+Cn(a)+'"'}function qf(a){return'link[rel="stylesheet"]['+a+"]"}function _2(a){return m({},a,{"data-precedence":a.precedence,precedence:null})}function e3(a,r,c,h){a.querySelector('link[rel="preload"][as="style"]['+r+"]")?h.loading=1:(r=a.createElement("link"),h.preload=r,r.addEventListener("load",function(){return h.loading|=1}),r.addEventListener("error",function(){return h.loading|=2}),ta(r,"link",c),gn(r),a.head.appendChild(r))}function Ou(a){return'[src="'+Cn(a)+'"]'}function Uf(a){return"script[async]"+a}function S2(a,r,c){if(r.count++,r.instance===null)switch(r.type){case"style":var h=a.querySelector('style[data-href~="'+Cn(c.href)+'"]');if(h)return r.instance=h,gn(h),h;var b=m({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),gn(h),ta(h,"style",b),_d(h,c.precedence,a),r.instance=h;case"stylesheet":b=Cu(c.href);var w=a.querySelector(qf(b));if(w)return r.state.loading|=4,r.instance=w,gn(w),w;h=_2(c),(b=As.get(b))&&Um(h,b),w=(a.ownerDocument||a).createElement("link"),gn(w);var M=w;return M._p=new Promise(function(V,ft){M.onload=V,M.onerror=ft}),ta(w,"link",h),r.state.loading|=4,_d(w,c.precedence,a),r.instance=w;case"script":return w=Ou(c.src),(b=a.querySelector(Uf(w)))?(r.instance=b,gn(b),b):(h=c,(b=As.get(w))&&(h=m({},c),Im(h,b)),a=a.ownerDocument||a,b=a.createElement("script"),gn(b),ta(b,"link",h),a.head.appendChild(b),r.instance=b);case"void":return null;default:throw Error(i(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(h=r.instance,r.state.loading|=4,_d(h,c.precedence,a));return r.instance}function _d(a,r,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=h.length?h[h.length-1]:null,w=b,M=0;M<h.length;M++){var V=h[M];if(V.dataset.precedence===r)w=V;else if(w!==b)break}w?w.parentNode.insertBefore(a,w.nextSibling):(r=c.nodeType===9?c.head:c,r.insertBefore(a,r.firstChild))}function Um(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.title==null&&(a.title=r.title)}function Im(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.integrity==null&&(a.integrity=r.integrity)}var Sd=null;function N2(a,r,c){if(Sd===null){var h=new Map,b=Sd=new Map;b.set(c,h)}else b=Sd,h=b.get(c),h||(h=new Map,b.set(c,h));if(h.has(a))return h;for(h.set(a,null),c=c.getElementsByTagName(a),b=0;b<c.length;b++){var w=c[b];if(!(w[va]||w[sn]||a==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var M=w.getAttribute(r)||"";M=a+M;var V=h.get(M);V?V.push(w):h.set(M,[w])}}return h}function A2(a,r,c){a=a.ownerDocument||a,a.head.insertBefore(c,r==="title"?a.querySelector("head > title"):null)}function n3(a,r,c){if(c===1||r.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return a=r.disabled,typeof r.precedence=="string"&&a==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function L2(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}var If=null;function i3(){}function a3(a,r,c){if(If===null)throw Error(i(475));var h=If;if(r.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var b=Cu(c.href),w=a.querySelector(qf(b));if(w){a=w._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(h.count++,h=Nd.bind(h),a.then(h,h)),r.state.loading|=4,r.instance=w,gn(w);return}w=a.ownerDocument||a,c=_2(c),(b=As.get(b))&&Um(c,b),w=w.createElement("link"),gn(w);var M=w;M._p=new Promise(function(V,ft){M.onload=V,M.onerror=ft}),ta(w,"link",c),r.instance=w}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(r,a),(a=r.state.preload)&&(r.state.loading&3)===0&&(h.count++,r=Nd.bind(h),a.addEventListener("load",r),a.addEventListener("error",r))}}function s3(){if(If===null)throw Error(i(475));var a=If;return a.stylesheets&&a.count===0&&Hm(a,a.stylesheets),0<a.count?function(r){var c=setTimeout(function(){if(a.stylesheets&&Hm(a,a.stylesheets),a.unsuspend){var h=a.unsuspend;a.unsuspend=null,h()}},6e4);return a.unsuspend=r,function(){a.unsuspend=null,clearTimeout(c)}}:null}function Nd(){if(this.count--,this.count===0){if(this.stylesheets)Hm(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Ad=null;function Hm(a,r){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Ad=new Map,r.forEach(r3,a),Ad=null,Nd.call(a))}function r3(a,r){if(!(r.state.loading&4)){var c=Ad.get(a);if(c)var h=c.get(null);else{c=new Map,Ad.set(a,c);for(var b=a.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<b.length;w++){var M=b[w];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(c.set(M.dataset.precedence,M),h=M)}h&&c.set(null,h)}b=r.instance,M=b.getAttribute("data-precedence"),w=c.get(M)||h,w===h&&c.set(null,b),c.set(M,b),this.count++,h=Nd.bind(this),b.addEventListener("load",h),b.addEventListener("error",h),w?w.parentNode.insertBefore(b,w.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(b,a.firstChild)),r.state.loading|=4}}var Hf={$$typeof:z,Provider:null,Consumer:null,_currentValue:ut,_currentValue2:ut,_threadCount:0};function o3(a,r,c,h,b,w,M,V){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Wi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wi(0),this.hiddenUpdates=Wi(null),this.identifierPrefix=h,this.onUncaughtError=b,this.onCaughtError=w,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function E2(a,r,c,h,b,w,M,V,ft,Ot,It,Wt){return a=new o3(a,r,c,M,V,ft,Ot,Wt),r=1,w===!0&&(r|=24),w=qi(3,null,null,r),a.current=w,w.stateNode=a,r=hf(),r.refCount++,a.pooledCache=r,r.refCount++,w.memoizedState={element:h,isDehydrated:c,cache:r},yt(w),a}function j2(a){return a?(a=Si,a):Si}function T2(a,r,c,h,b,w){b=j2(b),h.context===null?h.context=b:h.pendingContext=b,h=Ut(r),h.payload={element:c},w=w===void 0?null:w,w!==null&&(h.callback=w),c=Gt(a,h,r),c!==null&&(os(c,a,r),Ht(c,a,r))}function C2(a,r){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var c=a.retryLane;a.retryLane=c!==0&&c<r?c:r}}function Vm(a,r){C2(a,r),(a=a.alternate)&&C2(a,r)}function O2(a){if(a.tag===13){var r=Is(a,67108864);r!==null&&os(r,a,67108864),Vm(a,67108864)}}var Ld=!0;function l3(a,r,c,h){var b=W.T;W.T=null;var w=lt.p;try{lt.p=2,Ym(a,r,c,h)}finally{lt.p=w,W.T=b}}function c3(a,r,c,h){var b=W.T;W.T=null;var w=lt.p;try{lt.p=8,Ym(a,r,c,h)}finally{lt.p=w,W.T=b}}function Ym(a,r,c,h){if(Ld){var b=Gm(h);if(b===null)Mm(a,r,h,Ed,c),D2(a,h);else if(f3(b,a,r,c,h))h.stopPropagation();else if(D2(a,h),r&4&&-1<u3.indexOf(a)){for(;b!==null;){var w=zi(b);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var M=Ue(w.pendingLanes);if(M!==0){var V=w;for(V.pendingLanes|=2,V.entangledLanes|=2;M;){var ft=1<<31-oe(M);V.entanglements[1]|=ft,M&=~ft}Gr(w),(yn&6)===0&&(ud=me()+500,Pf(0))}}break;case 13:V=Is(w,2),V!==null&&os(V,w,2),hd(),Vm(w,2)}if(w=Gm(h),w===null&&Mm(a,r,h,Ed,c),w===b)break;b=w}b!==null&&h.stopPropagation()}else Mm(a,r,h,null,c)}}function Gm(a){return a=xi(a),Wm(a)}var Ed=null;function Wm(a){if(Ed=null,a=Bi(a),a!==null){var r=o(a);if(r===null)a=null;else{var c=r.tag;if(c===13){if(a=l(r),a!==null)return a;a=null}else if(c===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;a=null}else r!==a&&(a=null)}}return Ed=a,null}function M2(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(he()){case Xt:return 2;case J:return 8;case ht:case mt:return 32;case Pt:return 268435456;default:return 32}default:return 32}}var Xm=!1,Ol=null,Ml=null,Dl=null,Vf=new Map,Yf=new Map,Rl=[],u3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function D2(a,r){switch(a){case"focusin":case"focusout":Ol=null;break;case"dragenter":case"dragleave":Ml=null;break;case"mouseover":case"mouseout":Dl=null;break;case"pointerover":case"pointerout":Vf.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yf.delete(r.pointerId)}}function Gf(a,r,c,h,b,w){return a===null||a.nativeEvent!==w?(a={blockedOn:r,domEventName:c,eventSystemFlags:h,nativeEvent:w,targetContainers:[b]},r!==null&&(r=zi(r),r!==null&&O2(r)),a):(a.eventSystemFlags|=h,r=a.targetContainers,b!==null&&r.indexOf(b)===-1&&r.push(b),a)}function f3(a,r,c,h,b){switch(r){case"focusin":return Ol=Gf(Ol,a,r,c,h,b),!0;case"dragenter":return Ml=Gf(Ml,a,r,c,h,b),!0;case"mouseover":return Dl=Gf(Dl,a,r,c,h,b),!0;case"pointerover":var w=b.pointerId;return Vf.set(w,Gf(Vf.get(w)||null,a,r,c,h,b)),!0;case"gotpointercapture":return w=b.pointerId,Yf.set(w,Gf(Yf.get(w)||null,a,r,c,h,b)),!0}return!1}function R2(a){var r=Bi(a.target);if(r!==null){var c=o(r);if(c!==null){if(r=c.tag,r===13){if(r=l(c),r!==null){a.blockedOn=r,dn(a.priority,function(){if(c.tag===13){var h=rs();h=Sn(h);var b=Is(c,h);b!==null&&os(b,c,h),Vm(c,h)}});return}}else if(r===3&&c.stateNode.current.memoizedState.isDehydrated){a.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}a.blockedOn=null}function jd(a){if(a.blockedOn!==null)return!1;for(var r=a.targetContainers;0<r.length;){var c=Gm(a.nativeEvent);if(c===null){c=a.nativeEvent;var h=new c.constructor(c.type,c);Ko=h,c.target.dispatchEvent(h),Ko=null}else return r=zi(c),r!==null&&O2(r),a.blockedOn=c,!1;r.shift()}return!0}function k2(a,r,c){jd(a)&&c.delete(r)}function h3(){Xm=!1,Ol!==null&&jd(Ol)&&(Ol=null),Ml!==null&&jd(Ml)&&(Ml=null),Dl!==null&&jd(Dl)&&(Dl=null),Vf.forEach(k2),Yf.forEach(k2)}function Td(a,r){a.blockedOn===r&&(a.blockedOn=null,Xm||(Xm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,h3)))}var Cd=null;function P2(a){Cd!==a&&(Cd=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Cd===a&&(Cd=null);for(var r=0;r<a.length;r+=3){var c=a[r],h=a[r+1],b=a[r+2];if(typeof h!="function"){if(Wm(h||c)===null)continue;break}var w=zi(c);w!==null&&(a.splice(r,3),r-=3,_s(w,{pending:!0,data:b,method:c.method,action:h},h,b))}}))}function Wf(a){function r(ft){return Td(ft,a)}Ol!==null&&Td(Ol,a),Ml!==null&&Td(Ml,a),Dl!==null&&Td(Dl,a),Vf.forEach(r),Yf.forEach(r);for(var c=0;c<Rl.length;c++){var h=Rl[c];h.blockedOn===a&&(h.blockedOn=null)}for(;0<Rl.length&&(c=Rl[0],c.blockedOn===null);)R2(c),c.blockedOn===null&&Rl.shift();if(c=(a.ownerDocument||a).$$reactFormReplay,c!=null)for(h=0;h<c.length;h+=3){var b=c[h],w=c[h+1],M=b[We]||null;if(typeof w=="function")M||P2(c);else if(M){var V=null;if(w&&w.hasAttribute("formAction")){if(b=w,M=w[We]||null)V=M.formAction;else if(Wm(b)!==null)continue}else V=M.action;typeof V=="function"?c[h+1]=V:(c.splice(h,3),h-=3),P2(c)}}}function Km(a){this._internalRoot=a}Od.prototype.render=Km.prototype.render=function(a){var r=this._internalRoot;if(r===null)throw Error(i(409));var c=r.current,h=rs();T2(c,h,a,r,null,null)},Od.prototype.unmount=Km.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var r=a.containerInfo;T2(a.current,2,null,a,null,null),hd(),r[rn]=null}};function Od(a){this._internalRoot=a}Od.prototype.unstable_scheduleHydration=function(a){if(a){var r=Pi();a={blockedOn:null,target:a,priority:r};for(var c=0;c<Rl.length&&r!==0&&r<Rl[c].priority;c++);Rl.splice(c,0,a),c===0&&R2(a)}};var B2=t.version;if(B2!=="19.1.0")throw Error(i(527,B2,"19.1.0"));lt.findDOMNode=function(a){var r=a._reactInternals;if(r===void 0)throw typeof a.render=="function"?Error(i(188)):(a=Object.keys(a).join(","),Error(i(268,a)));return a=f(r),a=a!==null?d(a):null,a=a===null?null:a.stateNode,a};var d3={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Md=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Md.isDisabled&&Md.supportsFiber)try{Kt=Md.inject(d3),re=Md}catch{}}return Kf.createRoot=function(a,r){if(!s(a))throw Error(i(299));var c=!1,h="",b=J0,w=t1,M=e1,V=null;return r!=null&&(r.unstable_strictMode===!0&&(c=!0),r.identifierPrefix!==void 0&&(h=r.identifierPrefix),r.onUncaughtError!==void 0&&(b=r.onUncaughtError),r.onCaughtError!==void 0&&(w=r.onCaughtError),r.onRecoverableError!==void 0&&(M=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(V=r.unstable_transitionCallbacks)),r=E2(a,1,!1,null,null,c,h,b,w,M,V,null),a[rn]=r.current,Om(a),new Km(r)},Kf.hydrateRoot=function(a,r,c){if(!s(a))throw Error(i(299));var h=!1,b="",w=J0,M=t1,V=e1,ft=null,Ot=null;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(b=c.identifierPrefix),c.onUncaughtError!==void 0&&(w=c.onUncaughtError),c.onCaughtError!==void 0&&(M=c.onCaughtError),c.onRecoverableError!==void 0&&(V=c.onRecoverableError),c.unstable_transitionCallbacks!==void 0&&(ft=c.unstable_transitionCallbacks),c.formState!==void 0&&(Ot=c.formState)),r=E2(a,1,!0,r,c??null,h,b,w,M,V,ft,Ot),r.context=j2(null),c=r.current,h=rs(),h=Sn(h),b=Ut(h),b.callback=null,Gt(c,b,h),c=h,r.current.lanes=c,ki(r,c),Gr(r),a[rn]=r.current,Om(a),new Od(r)},Kf.version="19.1.0",Kf}var W2;function _3(){if(W2)return Qm.exports;W2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Qm.exports=w3(),Qm.exports}var S3=_3();/**
* react-router v7.7.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/var X2="popstate";function N3(e={}){function t(i,s){let{pathname:o,search:l,hash:u}=i.location;return Lg("",{pathname:o,search:l,hash:u},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(i,s){return typeof s=="string"?s:vh(s)}return L3(t,n,null,e)}function Xn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function cr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function A3(){return Math.random().toString(36).substring(2,10)}function K2(e,t){return{usr:e.state,key:e.key,idx:t}}function Lg(e,t,n=null,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ku(t):t,state:n,key:t&&t.key||i||A3()}}function vh({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ku(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let i=e.indexOf("?");i>=0&&(t.search=e.substring(i),e=e.substring(0,i)),e&&(t.pathname=e)}return t}function L3(e,t,n,i={}){let{window:s=document.defaultView,v5Compat:o=!1}=i,l=s.history,u="POP",f=null,d=m();d==null&&(d=0,l.replaceState({...l.state,idx:d},""));function m(){return(l.state||{idx:null}).idx}function g(){u="POP";let E=m(),j=E==null?null:E-d;d=E,f&&f({action:u,location:N.location,delta:j})}function x(E,j){u="PUSH";let C=Lg(N.location,E,j);d=m()+1;let z=K2(C,d),Z=N.createHref(C);try{l.pushState(z,"",Z)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;s.location.assign(Z)}o&&f&&f({action:u,location:N.location,delta:1})}function v(E,j){u="REPLACE";let C=Lg(N.location,E,j);d=m();let z=K2(C,d),Z=N.createHref(C);l.replaceState(z,"",Z),o&&f&&f({action:u,location:N.location,delta:0})}function A(E){return E3(E)}let N={get action(){return u},get location(){return e(s,l)},listen(E){if(f)throw new Error("A history only accepts one active listener");return s.addEventListener(X2,g),f=E,()=>{s.removeEventListener(X2,g),f=null}},createHref(E){return t(s,E)},createURL:A,encodeLocation(E){let j=A(E);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:x,replace:v,go(E){return l.go(E)}};return N}function E3(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Xn(n,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:vh(e);return i=i.replace(/ $/,"%20"),!t&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function ly(e,t,n="/"){return j3(e,t,n,!1)}function j3(e,t,n,i){let s=typeof t=="string"?Ku(t):t,o=Vo(s.pathname||"/",n);if(o==null)return null;let l=cy(e);T3(l);let u=null;for(let f=0;u==null&&f<l.length;++f){let d=q3(o);u=z3(l[f],d,i)}return u}function cy(e,t=[],n=[],i=""){let s=(o,l,u)=>{let f={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};f.relativePath.startsWith("/")&&(Xn(f.relativePath.startsWith(i),`Absolute route path "${f.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(i.length));let d=Ho([i,f.relativePath]),m=n.concat(f);o.children&&o.children.length>0&&(Xn(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),cy(o.children,t,m,d)),!(o.path==null&&!o.index)&&t.push({path:d,score:P3(d,o.index),routesMeta:m})};return e.forEach((o,l)=>{if(o.path===""||!o.path?.includes("?"))s(o,l);else for(let u of uy(o.path))s(o,l,u)}),t}function uy(e){let t=e.split("/");if(t.length===0)return[];let[n,...i]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(i.length===0)return s?[o,""]:[o];let l=uy(i.join("/")),u=[];return u.push(...l.map(f=>f===""?o:[o,f].join("/"))),s&&u.push(...l),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function T3(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:B3(t.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var C3=/^:[\w-]+$/,O3=3,M3=2,D3=1,R3=10,k3=-2,$2=e=>e==="*";function P3(e,t){let n=e.split("/"),i=n.length;return n.some($2)&&(i+=k3),t&&(i+=M3),n.filter(s=>!$2(s)).reduce((s,o)=>s+(C3.test(o)?O3:o===""?D3:R3),i)}function B3(e,t){return e.length===t.length&&e.slice(0,-1).every((i,s)=>i===t[s])?e[e.length-1]-t[t.length-1]:0}function z3(e,t,n=!1){let{routesMeta:i}=e,s={},o="/",l=[];for(let u=0;u<i.length;++u){let f=i[u],d=u===i.length-1,m=o==="/"?t:t.slice(o.length)||"/",g=hp({path:f.relativePath,caseSensitive:f.caseSensitive,end:d},m),x=f.route;if(!g&&d&&n&&!i[i.length-1].route.index&&(g=hp({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(s,g.params),l.push({params:s,pathname:Ho([o,g.pathname]),pathnameBase:V3(Ho([o,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(o=Ho([o,g.pathnameBase]))}return l}function hp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,i]=F3(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],l=o.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:i.reduce((d,{paramName:m,isOptional:g},x)=>{if(m==="*"){let A=u[x]||"";l=o.slice(0,o.length-A.length).replace(/(.)\/+$/,"$1")}const v=u[x];return g&&!v?d[m]=void 0:d[m]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:l,pattern:e}}function F3(e,t=!1,n=!0){cr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let i=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,f)=>(i.push({paramName:u,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(i.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),i]}function q3(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return cr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Vo(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,i=e.charAt(n);return i&&i!=="/"?null:e.slice(n)||"/"}function U3(e,t="/"){let{pathname:n,search:i="",hash:s=""}=typeof e=="string"?Ku(e):e;return{pathname:n?n.startsWith("/")?n:I3(n,t):t,search:Y3(i),hash:G3(s)}}function I3(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function ng(e,t,n,i){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function H3(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function a0(e){let t=H3(e);return t.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase)}function s0(e,t,n,i=!1){let s;typeof e=="string"?s=Ku(e):(s={...e},Xn(!s.pathname||!s.pathname.includes("?"),ng("?","pathname","search",s)),Xn(!s.pathname||!s.pathname.includes("#"),ng("#","pathname","hash",s)),Xn(!s.search||!s.search.includes("#"),ng("#","search","hash",s)));let o=e===""||s.pathname==="",l=o?"/":s.pathname,u;if(l==null)u=n;else{let g=t.length-1;if(!i&&l.startsWith("..")){let x=l.split("/");for(;x[0]==="..";)x.shift(),g-=1;s.pathname=x.join("/")}u=g>=0?t[g]:"/"}let f=U3(s,u),d=l&&l!=="/"&&l.endsWith("/"),m=(o||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(d||m)&&(f.pathname+="/"),f}var Ho=e=>e.join("/").replace(/\/\/+/g,"/"),V3=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Y3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,G3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function W3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var fy=["POST","PUT","PATCH","DELETE"];new Set(fy);var X3=["GET",...fy];new Set(X3);var $u=ot.createContext(null);$u.displayName="DataRouter";var jp=ot.createContext(null);jp.displayName="DataRouterState";ot.createContext(!1);var hy=ot.createContext({isTransitioning:!1});hy.displayName="ViewTransition";var K3=ot.createContext(new Map);K3.displayName="Fetchers";var $3=ot.createContext(null);$3.displayName="Await";var ur=ot.createContext(null);ur.displayName="Navigation";var Ch=ot.createContext(null);Ch.displayName="Location";var Cs=ot.createContext({outlet:null,matches:[],isDataRoute:!1});Cs.displayName="Route";var r0=ot.createContext(null);r0.displayName="RouteError";function Z3(e,{relative:t}={}){Xn(Zu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=ot.useContext(ur),{hash:s,pathname:o,search:l}=Oh(e,{relative:t}),u=o;return n!=="/"&&(u=o==="/"?n:Ho([n,o])),i.createHref({pathname:u,search:l,hash:s})}function Zu(){return ot.useContext(Ch)!=null}function Yo(){return Xn(Zu(),"useLocation() may be used only in the context of a <Router> component."),ot.useContext(Ch).location}var dy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function py(e){ot.useContext(ur).static||ot.useLayoutEffect(e)}function Ri(){let{isDataRoute:e}=ot.useContext(Cs);return e?hw():Q3()}function Q3(){Xn(Zu(),"useNavigate() may be used only in the context of a <Router> component.");let e=ot.useContext($u),{basename:t,navigator:n}=ot.useContext(ur),{matches:i}=ot.useContext(Cs),{pathname:s}=Yo(),o=JSON.stringify(a0(i)),l=ot.useRef(!1);return py(()=>{l.current=!0}),ot.useCallback((f,d={})=>{if(cr(l.current,dy),!l.current)return;if(typeof f=="number"){n.go(f);return}let m=s0(f,JSON.parse(o),s,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:Ho([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,o,s,e])}var J3=ot.createContext(null);function tw(e){let t=ot.useContext(Cs).outlet;return t&&ot.createElement(J3.Provider,{value:e},t)}function Qu(){let{matches:e}=ot.useContext(Cs),t=e[e.length-1];return t?t.params:{}}function Oh(e,{relative:t}={}){let{matches:n}=ot.useContext(Cs),{pathname:i}=Yo(),s=JSON.stringify(a0(n));return ot.useMemo(()=>s0(e,JSON.parse(s),i,t==="path"),[e,s,i,t])}function ew(e,t){return my(e,t)}function my(e,t,n,i){Xn(Zu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=ot.useContext(ur),{matches:o}=ot.useContext(Cs),l=o[o.length-1],u=l?l.params:{},f=l?l.pathname:"/",d=l?l.pathnameBase:"/",m=l&&l.route;{let j=m&&m.path||"";gy(f,!m||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${j}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
Please change the parent <Route path="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let g=Yo(),x;if(t){let j=typeof t=="string"?Ku(t):t;Xn(d==="/"||j.pathname?.startsWith(d),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${j.pathname}" was given in the \`location\` prop.`),x=j}else x=g;let v=x.pathname||"/",A=v;if(d!=="/"){let j=d.replace(/^\//,"").split("/");A="/"+v.replace(/^\//,"").split("/").slice(j.length).join("/")}let N=ly(e,{pathname:A});cr(m||N!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),cr(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=rw(N&&N.map(j=>Object.assign({},j,{params:Object.assign({},u,j.params),pathname:Ho([d,s.encodeLocation?s.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?d:Ho([d,s.encodeLocation?s.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),o,n,i);return t&&E?ot.createElement(Ch.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...x},navigationType:"POP"}},E):E}function nw(){let e=fw(),t=W3(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:i},o={padding:"2px 4px",backgroundColor:i},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=ot.createElement(ot.Fragment,null,ot.createElement("p",null,"💿 Hey developer 👋"),ot.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",ot.createElement("code",{style:o},"ErrorBoundary")," or"," ",ot.createElement("code",{style:o},"errorElement")," prop on your route.")),ot.createElement(ot.Fragment,null,ot.createElement("h2",null,"Unexpected Application Error!"),ot.createElement("h3",{style:{fontStyle:"italic"}},t),n?ot.createElement("pre",{style:s},n):null,l)}var iw=ot.createElement(nw,null),aw=class extends ot.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?ot.createElement(Cs.Provider,{value:this.props.routeContext},ot.createElement(r0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function sw({routeContext:e,match:t,children:n}){let i=ot.useContext($u);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),ot.createElement(Cs.Provider,{value:e},n)}function rw(e,t=[],n=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,o=n?.errors;if(o!=null){let f=s.findIndex(d=>d.route.id&&o?.[d.route.id]!==void 0);Xn(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,f+1))}let l=!1,u=-1;if(n)for(let f=0;f<s.length;f++){let d=s[f];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=f),d.route.id){let{loaderData:m,errors:g}=n,x=d.route.loader&&!m.hasOwnProperty(d.route.id)&&(!g||g[d.route.id]===void 0);if(d.route.lazy||x){l=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((f,d,m)=>{let g,x=!1,v=null,A=null;n&&(g=o&&d.route.id?o[d.route.id]:void 0,v=d.route.errorElement||iw,l&&(u<0&&m===0?(gy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,A=null):u===m&&(x=!0,A=d.route.hydrateFallbackElement||null)));let N=t.concat(s.slice(0,m+1)),E=()=>{let j;return g?j=v:x?j=A:d.route.Component?j=ot.createElement(d.route.Component,null):d.route.element?j=d.route.element:j=f,ot.createElement(sw,{match:d,routeContext:{outlet:f,matches:N,isDataRoute:n!=null},children:j})};return n&&(d.route.ErrorBoundary||d.route.errorElement||m===0)?ot.createElement(aw,{location:n.location,revalidation:n.revalidation,component:v,error:g,children:E(),routeContext:{outlet:null,matches:N,isDataRoute:!0}}):E()},null)}function o0(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ow(e){let t=ot.useContext($u);return Xn(t,o0(e)),t}function lw(e){let t=ot.useContext(jp);return Xn(t,o0(e)),t}function cw(e){let t=ot.useContext(Cs);return Xn(t,o0(e)),t}function l0(e){let t=cw(e),n=t.matches[t.matches.length-1];return Xn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function uw(){return l0("useRouteId")}function fw(){let e=ot.useContext(r0),t=lw("useRouteError"),n=l0("useRouteError");return e!==void 0?e:t.errors?.[n]}function hw(){let{router:e}=ow("useNavigate"),t=l0("useNavigate"),n=ot.useRef(!1);return py(()=>{n.current=!0}),ot.useCallback(async(s,o={})=>{cr(n.current,dy),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var Z2={};function gy(e,t,n){!t&&!Z2[e]&&(Z2[e]=!0,cr(!1,n))}ot.memo(dw);function dw({routes:e,future:t,state:n}){return my(e,void 0,n,t)}function pw({to:e,replace:t,state:n,relative:i}){Xn(Zu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=ot.useContext(ur);cr(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=ot.useContext(Cs),{pathname:l}=Yo(),u=Ri(),f=s0(e,a0(o),l,i==="path"),d=JSON.stringify(f);return ot.useEffect(()=>{u(JSON.parse(d),{replace:t,state:n,relative:i})},[u,d,i,t,n]),null}function mw(e){return tw(e.context)}function Mi(e){Xn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function gw({basename:e="/",children:t=null,location:n,navigationType:i="POP",navigator:s,static:o=!1}){Xn(!Zu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),u=ot.useMemo(()=>({basename:l,navigator:s,static:o,future:{}}),[l,s,o]);typeof n=="string"&&(n=Ku(n));let{pathname:f="/",search:d="",hash:m="",state:g=null,key:x="default"}=n,v=ot.useMemo(()=>{let A=Vo(f,l);return A==null?null:{location:{pathname:A,search:d,hash:m,state:g,key:x},navigationType:i}},[l,f,d,m,g,x,i]);return cr(v!=null,`<Router basename="${l}"> is not able to match the URL "${f}${d}${m}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:ot.createElement(ur.Provider,{value:u},ot.createElement(Ch.Provider,{children:t,value:v}))}function bw({children:e,location:t}){return ew(Eg(e),t)}function Eg(e,t=[]){let n=[];return ot.Children.forEach(e,(i,s)=>{if(!ot.isValidElement(i))return;let o=[...t,s];if(i.type===ot.Fragment){n.push.apply(n,Eg(i.props.children,o));return}Xn(i.type===Mi,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Xn(!i.props.index||!i.props.children,"An index route cannot have child routes.");let l={id:i.props.id||o.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(l.children=Eg(i.props.children,o)),n.push(l)}),n}var Jd="get",tp="application/x-www-form-urlencoded";function Tp(e){return e!=null&&typeof e.tagName=="string"}function yw(e){return Tp(e)&&e.tagName.toLowerCase()==="button"}function vw(e){return Tp(e)&&e.tagName.toLowerCase()==="form"}function xw(e){return Tp(e)&&e.tagName.toLowerCase()==="input"}function ww(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function _w(e,t){return e.button===0&&(!t||t==="_self")&&!ww(e)}var Dd=null;function Sw(){if(Dd===null)try{new FormData(document.createElement("form"),0),Dd=!1}catch{Dd=!0}return Dd}var Nw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ig(e){return e!=null&&!Nw.has(e)?(cr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${tp}"`),null):e}function Aw(e,t){let n,i,s,o,l;if(vw(e)){let u=e.getAttribute("action");i=u?Vo(u,t):null,n=e.getAttribute("method")||Jd,s=ig(e.getAttribute("enctype"))||tp,o=new FormData(e)}else if(yw(e)||xw(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||u.getAttribute("action");if(i=f?Vo(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Jd,s=ig(e.getAttribute("formenctype"))||ig(u.getAttribute("enctype"))||tp,o=new FormData(u,e),!Sw()){let{name:d,type:m,value:g}=e;if(m==="image"){let x=d?`${d}.`:"";o.append(`${x}x`,"0"),o.append(`${x}y`,"0")}else d&&o.append(d,g)}}else{if(Tp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Jd,i=null,s=tp,l=e}return o&&s==="text/plain"&&(l=o,o=void 0),{action:i,method:n.toLowerCase(),encType:s,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function c0(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Lw(e,t,n){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return i.pathname==="/"?i.pathname=`_root.${n}`:t&&Vo(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${n}`,i}async function Ew(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function jw(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Tw(e,t,n){let i=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let l=await Ew(o,n);return l.links?l.links():[]}return[]}));return Dw(i.flat(1).filter(jw).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Q2(e,t,n,i,s,o){let l=(f,d)=>n[d]?f.route.id!==n[d].route.id:!0,u=(f,d)=>n[d].pathname!==f.pathname||n[d].route.path?.endsWith("*")&&n[d].params["*"]!==f.params["*"];return o==="assets"?t.filter((f,d)=>l(f,d)||u(f,d)):o==="data"?t.filter((f,d)=>{let m=i.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(l(f,d)||u(f,d))return!0;if(f.route.shouldRevalidate){let g=f.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function Cw(e,t,{includeHydrateFallback:n}={}){return Ow(e.map(i=>{let s=t.routes[i.route.id];if(!s)return[];let o=[s.module];return s.clientActionModule&&(o=o.concat(s.clientActionModule)),s.clientLoaderModule&&(o=o.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(o=o.concat(s.hydrateFallbackModule)),s.imports&&(o=o.concat(s.imports)),o}).flat(1))}function Ow(e){return[...new Set(e)]}function Mw(e){let t={},n=Object.keys(e).sort();for(let i of n)t[i]=e[i];return t}function Dw(e,t){let n=new Set;return new Set(t),e.reduce((i,s)=>{let o=JSON.stringify(Mw(s));return n.has(o)||(n.add(o),i.push({key:o,link:s})),i},[])}function by(){let e=ot.useContext($u);return c0(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Rw(){let e=ot.useContext(jp);return c0(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var u0=ot.createContext(void 0);u0.displayName="FrameworkContext";function yy(){let e=ot.useContext(u0);return c0(e,"You must render this element inside a <HydratedRouter> element"),e}function kw(e,t){let n=ot.useContext(u0),[i,s]=ot.useState(!1),[o,l]=ot.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:d,onMouseLeave:m,onTouchStart:g}=t,x=ot.useRef(null);ot.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let N=j=>{j.forEach(C=>{l(C.isIntersecting)})},E=new IntersectionObserver(N,{threshold:.5});return x.current&&E.observe(x.current),()=>{E.disconnect()}}},[e]),ot.useEffect(()=>{if(i){let N=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(N)}}},[i]);let v=()=>{s(!0)},A=()=>{s(!1),l(!1)};return n?e!=="intent"?[o,x,{}]:[o,x,{onFocus:$f(u,v),onBlur:$f(f,A),onMouseEnter:$f(d,v),onMouseLeave:$f(m,A),onTouchStart:$f(g,v)}]:[!1,x,{}]}function $f(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Pw({page:e,...t}){let{router:n}=by(),i=ot.useMemo(()=>ly(n.routes,e,n.basename),[n.routes,e,n.basename]);return i?ot.createElement(zw,{page:e,matches:i,...t}):null}function Bw(e){let{manifest:t,routeModules:n}=yy(),[i,s]=ot.useState([]);return ot.useEffect(()=>{let o=!1;return Tw(e,t,n).then(l=>{o||s(l)}),()=>{o=!0}},[e,t,n]),i}function zw({page:e,matches:t,...n}){let i=Yo(),{manifest:s,routeModules:o}=yy(),{basename:l}=by(),{loaderData:u,matches:f}=Rw(),d=ot.useMemo(()=>Q2(e,t,f,s,i,"data"),[e,t,f,s,i]),m=ot.useMemo(()=>Q2(e,t,f,s,i,"assets"),[e,t,f,s,i]),g=ot.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let A=new Set,N=!1;if(t.forEach(j=>{let C=s.routes[j.route.id];!C||!C.hasLoader||(!d.some(z=>z.route.id===j.route.id)&&j.route.id in u&&o[j.route.id]?.shouldRevalidate||C.hasClientLoader?N=!0:A.add(j.route.id))}),A.size===0)return[];let E=Lw(e,l,"data");return N&&A.size>0&&E.searchParams.set("_routes",t.filter(j=>A.has(j.route.id)).map(j=>j.route.id).join(",")),[E.pathname+E.search]},[l,u,i,s,d,t,e,o]),x=ot.useMemo(()=>Cw(m,s),[m,s]),v=Bw(m);return ot.createElement(ot.Fragment,null,g.map(A=>ot.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...n})),x.map(A=>ot.createElement("link",{key:A,rel:"modulepreload",href:A,...n})),v.map(({key:A,link:N})=>ot.createElement("link",{key:A,...N})))}function Fw(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var vy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{vy&&(window.__reactRouterVersion="7.7.0")}catch{}function qw({basename:e,children:t,window:n}){let i=ot.useRef();i.current==null&&(i.current=N3({window:n,v5Compat:!0}));let s=i.current,[o,l]=ot.useState({action:s.action,location:s.location}),u=ot.useCallback(f=>{ot.startTransition(()=>l(f))},[l]);return ot.useLayoutEffect(()=>s.listen(u),[s,u]),ot.createElement(gw,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}var xy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,us=ot.forwardRef(function({onClick:t,discover:n="render",prefetch:i="none",relative:s,reloadDocument:o,replace:l,state:u,target:f,to:d,preventScrollReset:m,viewTransition:g,...x},v){let{basename:A}=ot.useContext(ur),N=typeof d=="string"&&xy.test(d),E,j=!1;if(typeof d=="string"&&N&&(E=d,vy))try{let G=new URL(window.location.href),Q=d.startsWith("//")?new URL(G.protocol+d):new URL(d),D=Vo(Q.pathname,A);Q.origin===G.origin&&D!=null?d=D+Q.search+Q.hash:j=!0}catch{cr(!1,`<Link to="${d}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let C=Z3(d,{relative:s}),[z,Z,I]=kw(i,x),st=Vw(d,{replace:l,state:u,target:f,preventScrollReset:m,relative:s,viewTransition:g});function K(G){t&&t(G),G.defaultPrevented||st(G)}let H=ot.createElement("a",{...x,...I,href:E||C,onClick:j||o?t:K,ref:Fw(v,Z),target:f,"data-discover":!N&&n==="render"?"true":void 0});return z&&!N?ot.createElement(ot.Fragment,null,H,ot.createElement(Pw,{page:C})):H});us.displayName="Link";var Uw=ot.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:i="",end:s=!1,style:o,to:l,viewTransition:u,children:f,...d},m){let g=Oh(l,{relative:d.relative}),x=Yo(),v=ot.useContext(jp),{navigator:A,basename:N}=ot.useContext(ur),E=v!=null&&Kw(g)&&u===!0,j=A.encodeLocation?A.encodeLocation(g).pathname:g.pathname,C=x.pathname,z=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(C=C.toLowerCase(),z=z?z.toLowerCase():null,j=j.toLowerCase()),z&&N&&(z=Vo(z,N)||z);const Z=j!=="/"&&j.endsWith("/")?j.length-1:j.length;let I=C===j||!s&&C.startsWith(j)&&C.charAt(Z)==="/",st=z!=null&&(z===j||!s&&z.startsWith(j)&&z.charAt(j.length)==="/"),K={isActive:I,isPending:st,isTransitioning:E},H=I?t:void 0,G;typeof i=="function"?G=i(K):G=[i,I?"active":null,st?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let Q=typeof o=="function"?o(K):o;return ot.createElement(us,{...d,"aria-current":H,className:G,ref:m,style:Q,to:l,viewTransition:u},typeof f=="function"?f(K):f)});Uw.displayName="NavLink";var Iw=ot.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:i,replace:s,state:o,method:l=Jd,action:u,onSubmit:f,relative:d,preventScrollReset:m,viewTransition:g,...x},v)=>{let A=Ww(),N=Xw(u,{relative:d}),E=l.toLowerCase()==="get"?"get":"post",j=typeof u=="string"&&xy.test(u),C=z=>{if(f&&f(z),z.defaultPrevented)return;z.preventDefault();let Z=z.nativeEvent.submitter,I=Z?.getAttribute("formmethod")||l;A(Z||z.currentTarget,{fetcherKey:t,method:I,navigate:n,replace:s,state:o,relative:d,preventScrollReset:m,viewTransition:g})};return ot.createElement("form",{ref:v,method:E,action:N,onSubmit:i?f:C,...x,"data-discover":!j&&e==="render"?"true":void 0})});Iw.displayName="Form";function Hw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wy(e){let t=ot.useContext($u);return Xn(t,Hw(e)),t}function Vw(e,{target:t,replace:n,state:i,preventScrollReset:s,relative:o,viewTransition:l}={}){let u=Ri(),f=Yo(),d=Oh(e,{relative:o});return ot.useCallback(m=>{if(_w(m,t)){m.preventDefault();let g=n!==void 0?n:vh(f)===vh(d);u(e,{replace:g,state:i,preventScrollReset:s,relative:o,viewTransition:l})}},[f,u,d,n,i,t,e,s,o,l])}var Yw=0,Gw=()=>`__${String(++Yw)}__`;function Ww(){let{router:e}=wy("useSubmit"),{basename:t}=ot.useContext(ur),n=uw();return ot.useCallback(async(i,s={})=>{let{action:o,method:l,encType:u,formData:f,body:d}=Aw(i,t);if(s.navigate===!1){let m=s.fetcherKey||Gw();await e.fetch(m,n,s.action||o,{preventScrollReset:s.preventScrollReset,formData:f,body:d,formMethod:s.method||l,formEncType:s.encType||u,flushSync:s.flushSync})}else await e.navigate(s.action||o,{preventScrollReset:s.preventScrollReset,formData:f,body:d,formMethod:s.method||l,formEncType:s.encType||u,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function Xw(e,{relative:t}={}){let{basename:n}=ot.useContext(ur),i=ot.useContext(Cs);Xn(i,"useFormAction must be used inside a RouteContext");let[s]=i.matches.slice(-1),o={...Oh(e||".",{relative:t})},l=Yo();if(e==null){o.search=l.search;let u=new URLSearchParams(o.search),f=u.getAll("index");if(f.some(m=>m==="")){u.delete("index"),f.filter(g=>g).forEach(g=>u.append("index",g));let m=u.toString();o.search=m?`?${m}`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Ho([n,o.pathname])),vh(o)}function Kw(e,t={}){let n=ot.useContext(hy);Xn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=wy("useViewTransitionState"),s=Oh(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Vo(n.currentLocation.pathname,i)||n.currentLocation.pathname,l=Vo(n.nextLocation.pathname,i)||n.nextLocation.pathname;return hp(s.pathname,l)!=null||hp(s.pathname,o)!=null}var $w=oy();const Zw=n0($w),Ya=ot.createContext();function Qw(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Jw=e=>{switch(e){case"success":return n4;case"info":return a4;case"warning":return i4;case"error":return s4;default:return null}},t4=Array(12).fill(0),e4=({visible:e,className:t})=>Jt.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Jt.createElement("div",{className:"sonner-spinner"},t4.map((n,i)=>Jt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),n4=Jt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Jt.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),i4=Jt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Jt.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),a4=Jt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Jt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),s4=Jt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Jt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),r4=Jt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Jt.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Jt.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),o4=()=>{const[e,t]=Jt.useState(document.hidden);return Jt.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let jg=1;class l4{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:i,...s}=t,o=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:jg++,l=this.toasts.find(f=>f.id===o),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(f=>f.id===o?(this.publish({...f,...t,id:o,title:i}),{...f,...t,id:o,dismissible:u,title:i}):f):this.addToast({title:i,...s,dismissible:u,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(i=>i({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let i;n.loading!==void 0&&(i=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=i!==void 0,l;const u=s.then(async d=>{if(l=["resolve",d],Jt.isValidElement(d))o=!1,this.create({id:i,type:"default",message:d});else if(u4(d)&&!d.ok){o=!1;const g=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,x=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,A=typeof g=="object"&&!Jt.isValidElement(g)?g:{message:g};this.create({id:i,type:"error",description:x,...A})}else if(d instanceof Error){o=!1;const g=typeof n.error=="function"?await n.error(d):n.error,x=typeof n.description=="function"?await n.description(d):n.description,A=typeof g=="object"&&!Jt.isValidElement(g)?g:{message:g};this.create({id:i,type:"error",description:x,...A})}else if(n.success!==void 0){o=!1;const g=typeof n.success=="function"?await n.success(d):n.success,x=typeof n.description=="function"?await n.description(d):n.description,A=typeof g=="object"&&!Jt.isValidElement(g)?g:{message:g};this.create({id:i,type:"success",description:x,...A})}}).catch(async d=>{if(l=["reject",d],n.error!==void 0){o=!1;const m=typeof n.error=="function"?await n.error(d):n.error,g=typeof n.description=="function"?await n.description(d):n.description,v=typeof m=="object"&&!Jt.isValidElement(m)?m:{message:m};this.create({id:i,type:"error",description:g,...v})}}).finally(()=>{o&&(this.dismiss(i),i=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((d,m)=>u.then(()=>l[0]==="reject"?m(l[1]):d(l[1])).catch(m));return typeof i!="string"&&typeof i!="number"?{unwrap:f}:Object.assign(i,{unwrap:f})},this.custom=(t,n)=>{const i=n?.id||jg++;return this.create({jsx:t(i),id:i,...n}),i},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ua=new l4,c4=(e,t)=>{const n=t?.id||jg++;return Ua.addToast({title:e,...t,id:n}),n},u4=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",f4=c4,h4=()=>Ua.toasts,d4=()=>Ua.getActiveToasts(),Be=Object.assign(f4,{success:Ua.success,info:Ua.info,warning:Ua.warning,error:Ua.error,custom:Ua.custom,message:Ua.message,promise:Ua.promise,dismiss:Ua.dismiss,loading:Ua.loading},{getHistory:h4,getToasts:d4});Qw("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Rd(e){return e.label!==void 0}const p4=3,m4="24px",g4="16px",J2=4e3,b4=356,y4=14,v4=45,x4=200;function Wr(...e){return e.filter(Boolean).join(" ")}function w4(e){const[t,n]=e.split("-"),i=[];return t&&i.push(t),n&&i.push(n),i}const _4=e=>{var t,n,i,s,o,l,u,f,d;const{invert:m,toast:g,unstyled:x,interacting:v,setHeights:A,visibleToasts:N,heights:E,index:j,toasts:C,expanded:z,removeToast:Z,defaultRichColors:I,closeButton:st,style:K,cancelButtonStyle:H,actionButtonStyle:G,className:Q="",descriptionClassName:D="",duration:R,position:et,gap:nt,expandByDefault:dt,classNames:W,icons:lt,closeButtonAriaLabel:ut="Close toast"}=e,[wt,Y]=Jt.useState(null),[gt,O]=Jt.useState(null),[q,$]=Jt.useState(!1),[rt,at]=Jt.useState(!1),[At,St]=Jt.useState(!1),[Tt,Zt]=Jt.useState(!1),[Qt,ne]=Jt.useState(!1),[ie,ye]=Jt.useState(0),[Bt,ct]=Jt.useState(0),me=Jt.useRef(g.duration||R||J2),he=Jt.useRef(null),Xt=Jt.useRef(null),J=j===0,ht=j+1<=N,mt=g.type,Pt=g.dismissible!==!1,qt=g.className||"",Ft=g.descriptionClassName||"",Kt=Jt.useMemo(()=>E.findIndex(te=>te.toastId===g.id)||0,[E,g.id]),re=Jt.useMemo(()=>{var te;return(te=g.closeButton)!=null?te:st},[g.closeButton,st]),fe=Jt.useMemo(()=>g.duration||R||J2,[g.duration,R]),oe=Jt.useRef(0),Se=Jt.useRef(0),ee=Jt.useRef(0),En=Jt.useRef(null),[Pe,ei]=et.split("-"),Ue=Jt.useMemo(()=>E.reduce((te,_e,Sn)=>Sn>=Kt?te:te+_e.height,0),[E,Kt]),Qe=o4(),vi=g.invert||m,He=mt==="loading";Se.current=Jt.useMemo(()=>Kt*nt+Ue,[Kt,Ue]),Jt.useEffect(()=>{me.current=fe},[fe]),Jt.useEffect(()=>{$(!0)},[]),Jt.useEffect(()=>{const te=Xt.current;if(te){const _e=te.getBoundingClientRect().height;return ct(_e),A(Sn=>[{toastId:g.id,height:_e,position:g.position},...Sn]),()=>A(Sn=>Sn.filter(Je=>Je.toastId!==g.id))}},[A,g.id]),Jt.useLayoutEffect(()=>{if(!q)return;const te=Xt.current,_e=te.style.height;te.style.height="auto";const Sn=te.getBoundingClientRect().height;te.style.height=_e,ct(Sn),A(Je=>Je.find(dn=>dn.toastId===g.id)?Je.map(dn=>dn.toastId===g.id?{...dn,height:Sn}:dn):[{toastId:g.id,height:Sn,position:g.position},...Je])},[q,g.title,g.description,A,g.id,g.jsx,g.action,g.cancel]);const ji=Jt.useCallback(()=>{at(!0),ye(Se.current),A(te=>te.filter(_e=>_e.toastId!==g.id)),setTimeout(()=>{Z(g)},x4)},[g,Z,A,Se]);Jt.useEffect(()=>{if(g.promise&&mt==="loading"||g.duration===1/0||g.type==="loading")return;let te;return z||v||Qe?(()=>{if(ee.current<oe.current){const Je=new Date().getTime()-oe.current;me.current=me.current-Je}ee.current=new Date().getTime()})():(()=>{me.current!==1/0&&(oe.current=new Date().getTime(),te=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),ji()},me.current))})(),()=>clearTimeout(te)},[z,v,g,mt,Qe,ji]),Jt.useEffect(()=>{g.delete&&(ji(),g.onDismiss==null||g.onDismiss.call(g,g))},[ji,g.delete]);function jn(){var te;if(lt?.loading){var _e;return Jt.createElement("div",{className:Wr(W?.loader,g==null||(_e=g.classNames)==null?void 0:_e.loader,"sonner-loader"),"data-visible":mt==="loading"},lt.loading)}return Jt.createElement(e4,{className:Wr(W?.loader,g==null||(te=g.classNames)==null?void 0:te.loader),visible:mt==="loading"})}const Wi=g.icon||lt?.[mt]||Jw(mt);var ki,Tn;return Jt.createElement("li",{tabIndex:0,ref:Xt,className:Wr(Q,qt,W?.toast,g==null||(t=g.classNames)==null?void 0:t.toast,W?.default,W?.[mt],g==null||(n=g.classNames)==null?void 0:n[mt]),"data-sonner-toast":"","data-rich-colors":(ki=g.richColors)!=null?ki:I,"data-styled":!(g.jsx||g.unstyled||x),"data-mounted":q,"data-promise":!!g.promise,"data-swiped":Qt,"data-removed":rt,"data-visible":ht,"data-y-position":Pe,"data-x-position":ei,"data-index":j,"data-front":J,"data-swiping":At,"data-dismissible":Pt,"data-type":mt,"data-invert":vi,"data-swipe-out":Tt,"data-swipe-direction":gt,"data-expanded":!!(z||dt&&q),style:{"--index":j,"--toasts-before":j,"--z-index":C.length-j,"--offset":`${rt?ie:Se.current}px`,"--initial-height":dt?"auto":`${Bt}px`,...K,...g.style},onDragEnd:()=>{St(!1),Y(null),En.current=null},onPointerDown:te=>{te.button!==2&&(He||!Pt||(he.current=new Date,ye(Se.current),te.target.setPointerCapture(te.pointerId),te.target.tagName!=="BUTTON"&&(St(!0),En.current={x:te.clientX,y:te.clientY})))},onPointerUp:()=>{var te,_e,Sn;if(Tt||!Pt)return;En.current=null;const Je=Number(((te=Xt.current)==null?void 0:te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Pi=Number(((_e=Xt.current)==null?void 0:_e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),dn=new Date().getTime()-((Sn=he.current)==null?void 0:Sn.getTime()),ue=wt==="x"?Je:Pi,sn=Math.abs(ue)/dn;if(Math.abs(ue)>=v4||sn>.11){ye(Se.current),g.onDismiss==null||g.onDismiss.call(g,g),O(wt==="x"?Je>0?"right":"left":Pi>0?"down":"up"),ji(),Zt(!0);return}else{var We,rn;(We=Xt.current)==null||We.style.setProperty("--swipe-amount-x","0px"),(rn=Xt.current)==null||rn.style.setProperty("--swipe-amount-y","0px")}ne(!1),St(!1),Y(null)},onPointerMove:te=>{var _e,Sn,Je;if(!En.current||!Pt||((_e=window.getSelection())==null?void 0:_e.toString().length)>0)return;const dn=te.clientY-En.current.y,ue=te.clientX-En.current.x;var sn;const We=(sn=e.swipeDirections)!=null?sn:w4(et);!wt&&(Math.abs(ue)>1||Math.abs(dn)>1)&&Y(Math.abs(ue)>Math.abs(dn)?"x":"y");let rn={x:0,y:0};const Dn=pn=>1/(1.5+Math.abs(pn)/20);if(wt==="y"){if(We.includes("top")||We.includes("bottom"))if(We.includes("top")&&dn<0||We.includes("bottom")&&dn>0)rn.y=dn;else{const pn=dn*Dn(dn);rn.y=Math.abs(pn)<Math.abs(dn)?pn:dn}}else if(wt==="x"&&(We.includes("left")||We.includes("right")))if(We.includes("left")&&ue<0||We.includes("right")&&ue>0)rn.x=ue;else{const pn=ue*Dn(ue);rn.x=Math.abs(pn)<Math.abs(ue)?pn:ue}(Math.abs(rn.x)>0||Math.abs(rn.y)>0)&&ne(!0),(Sn=Xt.current)==null||Sn.style.setProperty("--swipe-amount-x",`${rn.x}px`),(Je=Xt.current)==null||Je.style.setProperty("--swipe-amount-y",`${rn.y}px`)}},re&&!g.jsx&&mt!=="loading"?Jt.createElement("button",{"aria-label":ut,"data-disabled":He,"data-close-button":!0,onClick:He||!Pt?()=>{}:()=>{ji(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Wr(W?.closeButton,g==null||(i=g.classNames)==null?void 0:i.closeButton)},(Tn=lt?.close)!=null?Tn:r4):null,(mt||g.icon||g.promise)&&g.icon!==null&&(lt?.[mt]!==null||g.icon)?Jt.createElement("div",{"data-icon":"",className:Wr(W?.icon,g==null||(s=g.classNames)==null?void 0:s.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||jn():null,g.type!=="loading"?Wi:null):null,Jt.createElement("div",{"data-content":"",className:Wr(W?.content,g==null||(o=g.classNames)==null?void 0:o.content)},Jt.createElement("div",{"data-title":"",className:Wr(W?.title,g==null||(l=g.classNames)==null?void 0:l.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?Jt.createElement("div",{"data-description":"",className:Wr(D,Ft,W?.description,g==null||(u=g.classNames)==null?void 0:u.description)},typeof g.description=="function"?g.description():g.description):null),Jt.isValidElement(g.cancel)?g.cancel:g.cancel&&Rd(g.cancel)?Jt.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||H,onClick:te=>{Rd(g.cancel)&&Pt&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,te),ji())},className:Wr(W?.cancelButton,g==null||(f=g.classNames)==null?void 0:f.cancelButton)},g.cancel.label):null,Jt.isValidElement(g.action)?g.action:g.action&&Rd(g.action)?Jt.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||G,onClick:te=>{Rd(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,te),!te.defaultPrevented&&ji())},className:Wr(W?.actionButton,g==null||(d=g.classNames)==null?void 0:d.actionButton)},g.action.label):null)};function t5(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function S4(e,t){const n={};return[e,t].forEach((i,s)=>{const o=s===1,l=o?"--mobile-offset":"--offset",u=o?g4:m4;function f(d){["top","right","bottom","left"].forEach(m=>{n[`${l}-${m}`]=typeof d=="number"?`${d}px`:d})}typeof i=="number"||typeof i=="string"?f(i):typeof i=="object"?["top","right","bottom","left"].forEach(d=>{i[d]===void 0?n[`${l}-${d}`]=u:n[`${l}-${d}`]=typeof i[d]=="number"?`${i[d]}px`:i[d]}):f(u)}),n}const N4=Jt.forwardRef(function(t,n){const{invert:i,position:s="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:u,className:f,offset:d,mobileOffset:m,theme:g="light",richColors:x,duration:v,style:A,visibleToasts:N=p4,toastOptions:E,dir:j=t5(),gap:C=y4,icons:z,containerAriaLabel:Z="Notifications"}=t,[I,st]=Jt.useState([]),K=Jt.useMemo(()=>Array.from(new Set([s].concat(I.filter(gt=>gt.position).map(gt=>gt.position)))),[I,s]),[H,G]=Jt.useState([]),[Q,D]=Jt.useState(!1),[R,et]=Jt.useState(!1),[nt,dt]=Jt.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=Jt.useRef(null),lt=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),ut=Jt.useRef(null),wt=Jt.useRef(!1),Y=Jt.useCallback(gt=>{st(O=>{var q;return(q=O.find($=>$.id===gt.id))!=null&&q.delete||Ua.dismiss(gt.id),O.filter(({id:$})=>$!==gt.id)})},[]);return Jt.useEffect(()=>Ua.subscribe(gt=>{if(gt.dismiss){requestAnimationFrame(()=>{st(O=>O.map(q=>q.id===gt.id?{...q,delete:!0}:q))});return}setTimeout(()=>{Zw.flushSync(()=>{st(O=>{const q=O.findIndex($=>$.id===gt.id);return q!==-1?[...O.slice(0,q),{...O[q],...gt},...O.slice(q+1)]:[gt,...O]})})})}),[I]),Jt.useEffect(()=>{if(g!=="system"){dt(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?dt("dark"):dt("light")),typeof window>"u")return;const gt=window.matchMedia("(prefers-color-scheme: dark)");try{gt.addEventListener("change",({matches:O})=>{dt(O?"dark":"light")})}catch{gt.addListener(({matches:q})=>{try{dt(q?"dark":"light")}catch($){console.error($)}})}},[g]),Jt.useEffect(()=>{I.length<=1&&D(!1)},[I]),Jt.useEffect(()=>{const gt=O=>{var q;if(o.every(at=>O[at]||O.code===at)){var rt;D(!0),(rt=W.current)==null||rt.focus()}O.code==="Escape"&&(document.activeElement===W.current||(q=W.current)!=null&&q.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",gt),()=>document.removeEventListener("keydown",gt)},[o]),Jt.useEffect(()=>{if(W.current)return()=>{ut.current&&(ut.current.focus({preventScroll:!0}),ut.current=null,wt.current=!1)}},[W.current]),Jt.createElement("section",{ref:n,"aria-label":`${Z} ${lt}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},K.map((gt,O)=>{var q;const[$,rt]=gt.split("-");return I.length?Jt.createElement("ol",{key:gt,dir:j==="auto"?t5():j,tabIndex:-1,ref:W,className:f,"data-sonner-toaster":!0,"data-sonner-theme":nt,"data-y-position":$,"data-x-position":rt,style:{"--front-toast-height":`${((q=H[0])==null?void 0:q.height)||0}px`,"--width":`${b4}px`,"--gap":`${C}px`,...A,...S4(d,m)},onBlur:at=>{wt.current&&!at.currentTarget.contains(at.relatedTarget)&&(wt.current=!1,ut.current&&(ut.current.focus({preventScroll:!0}),ut.current=null))},onFocus:at=>{at.target instanceof HTMLElement&&at.target.dataset.dismissible==="false"||wt.current||(wt.current=!0,ut.current=at.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{R||D(!1)},onDragEnd:()=>D(!1),onPointerDown:at=>{at.target instanceof HTMLElement&&at.target.dataset.dismissible==="false"||et(!0)},onPointerUp:()=>et(!1)},I.filter(at=>!at.position&&O===0||at.position===gt).map((at,At)=>{var St,Tt;return Jt.createElement(_4,{key:at.id,icons:z,index:At,toast:at,defaultRichColors:x,duration:(St=E?.duration)!=null?St:v,className:E?.className,descriptionClassName:E?.descriptionClassName,invert:i,visibleToasts:N,closeButton:(Tt=E?.closeButton)!=null?Tt:u,interacting:R,position:gt,style:E?.style,unstyled:E?.unstyled,classNames:E?.classNames,cancelButtonStyle:E?.cancelButtonStyle,actionButtonStyle:E?.actionButtonStyle,closeButtonAriaLabel:E?.closeButtonAriaLabel,removeToast:Y,toasts:I.filter(Zt=>Zt.position==at.position),heights:H.filter(Zt=>Zt.position==at.position),setHeights:G,expandByDefault:l,gap:C,expanded:Q,swipeDirections:t.swipeDirections})})):null}))});function _y(e,t){return function(){return e.apply(t,arguments)}}const{toString:A4}=Object.prototype,{getPrototypeOf:f0}=Object,{iterator:Cp,toStringTag:Sy}=Symbol,Op=(e=>t=>{const n=A4.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),fr=e=>(e=e.toLowerCase(),t=>Op(t)===e),Mp=e=>t=>typeof t===e,{isArray:Ju}=Array,xh=Mp("undefined");function L4(e){return e!==null&&!xh(e)&&e.constructor!==null&&!xh(e.constructor)&&Ha(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ny=fr("ArrayBuffer");function E4(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ny(e.buffer),t}const j4=Mp("string"),Ha=Mp("function"),Ay=Mp("number"),Dp=e=>e!==null&&typeof e=="object",T4=e=>e===!0||e===!1,ep=e=>{if(Op(e)!=="object")return!1;const t=f0(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Sy in e)&&!(Cp in e)},C4=fr("Date"),O4=fr("File"),M4=fr("Blob"),D4=fr("FileList"),R4=e=>Dp(e)&&Ha(e.pipe),k4=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ha(e.append)&&((t=Op(e))==="formdata"||t==="object"&&Ha(e.toString)&&e.toString()==="[object FormData]"))},P4=fr("URLSearchParams"),[B4,z4,F4,q4]=["ReadableStream","Request","Response","Headers"].map(fr),U4=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Mh(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,s;if(typeof e!="object"&&(e=[e]),Ju(e))for(i=0,s=e.length;i<s;i++)t.call(null,e[i],i,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),l=o.length;let u;for(i=0;i<l;i++)u=o[i],t.call(null,e[u],u,e)}}function Ly(e,t){t=t.toLowerCase();const n=Object.keys(e);let i=n.length,s;for(;i-- >0;)if(s=n[i],t===s.toLowerCase())return s;return null}const Pc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ey=e=>!xh(e)&&e!==Pc;function Tg(){const{caseless:e}=Ey(this)&&this||{},t={},n=(i,s)=>{const o=e&&Ly(t,s)||s;ep(t[o])&&ep(i)?t[o]=Tg(t[o],i):ep(i)?t[o]=Tg({},i):Ju(i)?t[o]=i.slice():t[o]=i};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&Mh(arguments[i],n);return t}const I4=(e,t,n,{allOwnKeys:i}={})=>(Mh(t,(s,o)=>{n&&Ha(s)?e[o]=_y(s,n):e[o]=s},{allOwnKeys:i}),e),H4=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),V4=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Y4=(e,t,n,i)=>{let s,o,l;const u={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)l=s[o],(!i||i(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&f0(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},G4=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return i!==-1&&i===n},W4=e=>{if(!e)return null;if(Ju(e))return e;let t=e.length;if(!Ay(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},X4=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&f0(Uint8Array)),K4=(e,t)=>{const i=(e&&e[Cp]).call(e);let s;for(;(s=i.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},$4=(e,t)=>{let n;const i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},Z4=fr("HTMLFormElement"),Q4=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,s){return i.toUpperCase()+s}),e5=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),J4=fr("RegExp"),jy=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};Mh(n,(s,o)=>{let l;(l=t(s,o,e))!==!1&&(i[o]=l||s)}),Object.defineProperties(e,i)},t_=e=>{jy(e,(t,n)=>{if(Ha(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=e[n];if(Ha(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},e_=(e,t)=>{const n={},i=s=>{s.forEach(o=>{n[o]=!0})};return Ju(e)?i(e):i(String(e).split(t)),n},n_=()=>{},i_=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function a_(e){return!!(e&&Ha(e.append)&&e[Sy]==="FormData"&&e[Cp])}const s_=e=>{const t=new Array(10),n=(i,s)=>{if(Dp(i)){if(t.indexOf(i)>=0)return;if(!("toJSON"in i)){t[s]=i;const o=Ju(i)?[]:{};return Mh(i,(l,u)=>{const f=n(l,s+1);!xh(f)&&(o[u]=f)}),t[s]=void 0,o}}return i};return n(e,0)},r_=fr("AsyncFunction"),o_=e=>e&&(Dp(e)||Ha(e))&&Ha(e.then)&&Ha(e.catch),Ty=((e,t)=>e?setImmediate:t?((n,i)=>(Pc.addEventListener("message",({source:s,data:o})=>{s===Pc&&o===n&&i.length&&i.shift()()},!1),s=>{i.push(s),Pc.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ha(Pc.postMessage)),l_=typeof queueMicrotask<"u"?queueMicrotask.bind(Pc):typeof process<"u"&&process.nextTick||Ty,c_=e=>e!=null&&Ha(e[Cp]),kt={isArray:Ju,isArrayBuffer:Ny,isBuffer:L4,isFormData:k4,isArrayBufferView:E4,isString:j4,isNumber:Ay,isBoolean:T4,isObject:Dp,isPlainObject:ep,isReadableStream:B4,isRequest:z4,isResponse:F4,isHeaders:q4,isUndefined:xh,isDate:C4,isFile:O4,isBlob:M4,isRegExp:J4,isFunction:Ha,isStream:R4,isURLSearchParams:P4,isTypedArray:X4,isFileList:D4,forEach:Mh,merge:Tg,extend:I4,trim:U4,stripBOM:H4,inherits:V4,toFlatObject:Y4,kindOf:Op,kindOfTest:fr,endsWith:G4,toArray:W4,forEachEntry:K4,matchAll:$4,isHTMLForm:Z4,hasOwnProperty:e5,hasOwnProp:e5,reduceDescriptors:jy,freezeMethods:t_,toObjectSet:e_,toCamelCase:Q4,noop:n_,toFiniteNumber:i_,findKey:Ly,global:Pc,isContextDefined:Ey,isSpecCompliantForm:a_,toJSONObject:s_,isAsyncFn:r_,isThenable:o_,setImmediate:Ty,asap:l_,isIterable:c_};function ze(e,t,n,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),s&&(this.response=s,this.status=s.status?s.status:null)}kt.inherits(ze,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:kt.toJSONObject(this.config),code:this.code,status:this.status}}});const Cy=ze.prototype,Oy={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Oy[e]={value:e}});Object.defineProperties(ze,Oy);Object.defineProperty(Cy,"isAxiosError",{value:!0});ze.from=(e,t,n,i,s,o)=>{const l=Object.create(Cy);return kt.toFlatObject(e,l,function(f){return f!==Error.prototype},u=>u!=="isAxiosError"),ze.call(l,e.message,t,n,i,s),l.cause=e,l.name=e.name,o&&Object.assign(l,o),l};const u_=null;function Cg(e){return kt.isPlainObject(e)||kt.isArray(e)}function My(e){return kt.endsWith(e,"[]")?e.slice(0,-2):e}function n5(e,t,n){return e?e.concat(t).map(function(s,o){return s=My(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function f_(e){return kt.isArray(e)&&!e.some(Cg)}const h_=kt.toFlatObject(kt,{},null,function(t){return/^is[A-Z]/.test(t)});function Rp(e,t,n){if(!kt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=kt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(N,E){return!kt.isUndefined(E[N])});const i=n.metaTokens,s=n.visitor||m,o=n.dots,l=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&kt.isSpecCompliantForm(t);if(!kt.isFunction(s))throw new TypeError("visitor must be a function");function d(A){if(A===null)return"";if(kt.isDate(A))return A.toISOString();if(kt.isBoolean(A))return A.toString();if(!f&&kt.isBlob(A))throw new ze("Blob is not supported. Use a Buffer instead.");return kt.isArrayBuffer(A)||kt.isTypedArray(A)?f&&typeof Blob=="function"?new Blob([A]):Buffer.from(A):A}function m(A,N,E){let j=A;if(A&&!E&&typeof A=="object"){if(kt.endsWith(N,"{}"))N=i?N:N.slice(0,-2),A=JSON.stringify(A);else if(kt.isArray(A)&&f_(A)||(kt.isFileList(A)||kt.endsWith(N,"[]"))&&(j=kt.toArray(A)))return N=My(N),j.forEach(function(z,Z){!(kt.isUndefined(z)||z===null)&&t.append(l===!0?n5([N],Z,o):l===null?N:N+"[]",d(z))}),!1}return Cg(A)?!0:(t.append(n5(E,N,o),d(A)),!1)}const g=[],x=Object.assign(h_,{defaultVisitor:m,convertValue:d,isVisitable:Cg});function v(A,N){if(!kt.isUndefined(A)){if(g.indexOf(A)!==-1)throw Error("Circular reference detected in "+N.join("."));g.push(A),kt.forEach(A,function(j,C){(!(kt.isUndefined(j)||j===null)&&s.call(t,j,kt.isString(C)?C.trim():C,N,x))===!0&&v(j,N?N.concat(C):[C])}),g.pop()}}if(!kt.isObject(e))throw new TypeError("data must be an object");return v(e),t}function i5(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function h0(e,t){this._pairs=[],e&&Rp(e,this,t)}const Dy=h0.prototype;Dy.append=function(t,n){this._pairs.push([t,n])};Dy.toString=function(t){const n=t?function(i){return t.call(this,i,i5)}:i5;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function d_(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ry(e,t,n){if(!t)return e;const i=n&&n.encode||d_;kt.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=kt.isURLSearchParams(t)?t.toString():new h0(t,n).toString(i),o){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class a5{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){kt.forEach(this.handlers,function(i){i!==null&&t(i)})}}const ky={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},p_=typeof URLSearchParams<"u"?URLSearchParams:h0,m_=typeof FormData<"u"?FormData:null,g_=typeof Blob<"u"?Blob:null,b_={isBrowser:!0,classes:{URLSearchParams:p_,FormData:m_,Blob:g_},protocols:["http","https","file","blob","url","data"]},d0=typeof window<"u"&&typeof document<"u",Og=typeof navigator=="object"&&navigator||void 0,y_=d0&&(!Og||["ReactNative","NativeScript","NS"].indexOf(Og.product)<0),v_=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",x_=d0&&window.location.href||"http://localhost",w_=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:d0,hasStandardBrowserEnv:y_,hasStandardBrowserWebWorkerEnv:v_,navigator:Og,origin:x_},Symbol.toStringTag,{value:"Module"})),ga={...w_,...b_};function __(e,t){return Rp(e,new ga.classes.URLSearchParams,Object.assign({visitor:function(n,i,s,o){return ga.isNode&&kt.isBuffer(n)?(this.append(i,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function S_(e){return kt.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function N_(e){const t={},n=Object.keys(e);let i;const s=n.length;let o;for(i=0;i<s;i++)o=n[i],t[o]=e[o];return t}function Py(e){function t(n,i,s,o){let l=n[o++];if(l==="__proto__")return!0;const u=Number.isFinite(+l),f=o>=n.length;return l=!l&&kt.isArray(s)?s.length:l,f?(kt.hasOwnProp(s,l)?s[l]=[s[l],i]:s[l]=i,!u):((!s[l]||!kt.isObject(s[l]))&&(s[l]=[]),t(n,i,s[l],o)&&kt.isArray(s[l])&&(s[l]=N_(s[l])),!u)}if(kt.isFormData(e)&&kt.isFunction(e.entries)){const n={};return kt.forEachEntry(e,(i,s)=>{t(S_(i),s,n,0)}),n}return null}function A_(e,t,n){if(kt.isString(e))try{return(t||JSON.parse)(e),kt.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}const Dh={transitional:ky,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const i=n.getContentType()||"",s=i.indexOf("application/json")>-1,o=kt.isObject(t);if(o&&kt.isHTMLForm(t)&&(t=new FormData(t)),kt.isFormData(t))return s?JSON.stringify(Py(t)):t;if(kt.isArrayBuffer(t)||kt.isBuffer(t)||kt.isStream(t)||kt.isFile(t)||kt.isBlob(t)||kt.isReadableStream(t))return t;if(kt.isArrayBufferView(t))return t.buffer;if(kt.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return __(t,this.formSerializer).toString();if((u=kt.isFileList(t))||i.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Rp(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),A_(t)):t}],transformResponse:[function(t){const n=this.transitional||Dh.transitional,i=n&&n.forcedJSONParsing,s=this.responseType==="json";if(kt.isResponse(t)||kt.isReadableStream(t))return t;if(t&&kt.isString(t)&&(i&&!this.responseType||s)){const l=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(u){if(l)throw u.name==="SyntaxError"?ze.from(u,ze.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ga.classes.FormData,Blob:ga.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};kt.forEach(["delete","get","head","post","put","patch"],e=>{Dh.headers[e]={}});const L_=kt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),E_=e=>{const t={};let n,i,s;return e&&e.split(`
`).forEach(function(l){s=l.indexOf(":"),n=l.substring(0,s).trim().toLowerCase(),i=l.substring(s+1).trim(),!(!n||t[n]&&L_[n])&&(n==="set-cookie"?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t},s5=Symbol("internals");function Zf(e){return e&&String(e).trim().toLowerCase()}function np(e){return e===!1||e==null?e:kt.isArray(e)?e.map(np):String(e)}function j_(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}const T_=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ag(e,t,n,i,s){if(kt.isFunction(i))return i.call(this,t,n);if(s&&(t=n),!!kt.isString(t)){if(kt.isString(i))return t.indexOf(i)!==-1;if(kt.isRegExp(i))return i.test(t)}}function C_(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function O_(e,t){const n=kt.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(s,o,l){return this[i].call(this,t,s,o,l)},configurable:!0})})}let Va=class{constructor(t){t&&this.set(t)}set(t,n,i){const s=this;function o(u,f,d){const m=Zf(f);if(!m)throw new Error("header name must be a non-empty string");const g=kt.findKey(s,m);(!g||s[g]===void 0||d===!0||d===void 0&&s[g]!==!1)&&(s[g||f]=np(u))}const l=(u,f)=>kt.forEach(u,(d,m)=>o(d,m,f));if(kt.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(kt.isString(t)&&(t=t.trim())&&!T_(t))l(E_(t),n);else if(kt.isObject(t)&&kt.isIterable(t)){let u={},f,d;for(const m of t){if(!kt.isArray(m))throw TypeError("Object iterator must return a key-value pair");u[d=m[0]]=(f=u[d])?kt.isArray(f)?[...f,m[1]]:[f,m[1]]:m[1]}l(u,n)}else t!=null&&o(n,t,i);return this}get(t,n){if(t=Zf(t),t){const i=kt.findKey(this,t);if(i){const s=this[i];if(!n)return s;if(n===!0)return j_(s);if(kt.isFunction(n))return n.call(this,s,i);if(kt.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Zf(t),t){const i=kt.findKey(this,t);return!!(i&&this[i]!==void 0&&(!n||ag(this,this[i],i,n)))}return!1}delete(t,n){const i=this;let s=!1;function o(l){if(l=Zf(l),l){const u=kt.findKey(i,l);u&&(!n||ag(i,i[u],u,n))&&(delete i[u],s=!0)}}return kt.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let i=n.length,s=!1;for(;i--;){const o=n[i];(!t||ag(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,i={};return kt.forEach(this,(s,o)=>{const l=kt.findKey(i,o);if(l){n[l]=np(s),delete n[o];return}const u=t?C_(o):String(o).trim();u!==o&&delete n[o],n[u]=np(s),i[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return kt.forEach(this,(i,s)=>{i!=null&&i!==!1&&(n[s]=t&&kt.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const i=new this(t);return n.forEach(s=>i.set(s)),i}static accessor(t){const i=(this[s5]=this[s5]={accessors:{}}).accessors,s=this.prototype;function o(l){const u=Zf(l);i[u]||(O_(s,l),i[u]=!0)}return kt.isArray(t)?t.forEach(o):o(t),this}};Va.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);kt.reduceDescriptors(Va.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}});kt.freezeMethods(Va);function sg(e,t){const n=this||Dh,i=t||n,s=Va.from(i.headers);let o=i.data;return kt.forEach(e,function(u){o=u.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function By(e){return!!(e&&e.__CANCEL__)}function tf(e,t,n){ze.call(this,e??"canceled",ze.ERR_CANCELED,t,n),this.name="CanceledError"}kt.inherits(tf,ze,{__CANCEL__:!0});function zy(e,t,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new ze("Request failed with status code "+n.status,[ze.ERR_BAD_REQUEST,ze.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function M_(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function D_(e,t){e=e||10;const n=new Array(e),i=new Array(e);let s=0,o=0,l;return t=t!==void 0?t:1e3,function(f){const d=Date.now(),m=i[o];l||(l=d),n[s]=f,i[s]=d;let g=o,x=0;for(;g!==s;)x+=n[g++],g=g%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),d-l<t)return;const v=m&&d-m;return v?Math.round(x*1e3/v):void 0}}function R_(e,t){let n=0,i=1e3/t,s,o;const l=(d,m=Date.now())=>{n=m,s=null,o&&(clearTimeout(o),o=null),e.apply(null,d)};return[(...d)=>{const m=Date.now(),g=m-n;g>=i?l(d,m):(s=d,o||(o=setTimeout(()=>{o=null,l(s)},i-g)))},()=>s&&l(s)]}const dp=(e,t,n=3)=>{let i=0;const s=D_(50,250);return R_(o=>{const l=o.loaded,u=o.lengthComputable?o.total:void 0,f=l-i,d=s(f),m=l<=u;i=l;const g={loaded:l,total:u,progress:u?l/u:void 0,bytes:f,rate:d||void 0,estimated:d&&u&&m?(u-l)/d:void 0,event:o,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},r5=(e,t)=>{const n=e!=null;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},o5=e=>(...t)=>kt.asap(()=>e(...t)),k_=ga.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ga.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ga.origin),ga.navigator&&/(msie|trident)/i.test(ga.navigator.userAgent)):()=>!0,P_=ga.hasStandardBrowserEnv?{write(e,t,n,i,s,o){const l=[e+"="+encodeURIComponent(t)];kt.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),kt.isString(i)&&l.push("path="+i),kt.isString(s)&&l.push("domain="+s),o===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function B_(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function z_(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Fy(e,t,n){let i=!B_(t);return e&&(i||n==!1)?z_(e,t):t}const l5=e=>e instanceof Va?{...e}:e;function Ic(e,t){t=t||{};const n={};function i(d,m,g,x){return kt.isPlainObject(d)&&kt.isPlainObject(m)?kt.merge.call({caseless:x},d,m):kt.isPlainObject(m)?kt.merge({},m):kt.isArray(m)?m.slice():m}function s(d,m,g,x){if(kt.isUndefined(m)){if(!kt.isUndefined(d))return i(void 0,d,g,x)}else return i(d,m,g,x)}function o(d,m){if(!kt.isUndefined(m))return i(void 0,m)}function l(d,m){if(kt.isUndefined(m)){if(!kt.isUndefined(d))return i(void 0,d)}else return i(void 0,m)}function u(d,m,g){if(g in t)return i(d,m);if(g in e)return i(void 0,d)}const f={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(d,m,g)=>s(l5(d),l5(m),g,!0)};return kt.forEach(Object.keys(Object.assign({},e,t)),function(m){const g=f[m]||s,x=g(e[m],t[m],m);kt.isUndefined(x)&&g!==u||(n[m]=x)}),n}const qy=e=>{const t=Ic({},e);let{data:n,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:o,headers:l,auth:u}=t;t.headers=l=Va.from(l),t.url=Ry(Fy(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(kt.isFormData(n)){if(ga.hasStandardBrowserEnv||ga.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if((f=l.getContentType())!==!1){const[d,...m]=f?f.split(";").map(g=>g.trim()).filter(Boolean):[];l.setContentType([d||"multipart/form-data",...m].join("; "))}}if(ga.hasStandardBrowserEnv&&(i&&kt.isFunction(i)&&(i=i(t)),i||i!==!1&&k_(t.url))){const d=s&&o&&P_.read(o);d&&l.set(s,d)}return t},F_=typeof XMLHttpRequest<"u",q_=F_&&function(e){return new Promise(function(n,i){const s=qy(e);let o=s.data;const l=Va.from(s.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:d}=s,m,g,x,v,A;function N(){v&&v(),A&&A(),s.cancelToken&&s.cancelToken.unsubscribe(m),s.signal&&s.signal.removeEventListener("abort",m)}let E=new XMLHttpRequest;E.open(s.method.toUpperCase(),s.url,!0),E.timeout=s.timeout;function j(){if(!E)return;const z=Va.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),I={data:!u||u==="text"||u==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:z,config:e,request:E};zy(function(K){n(K),N()},function(K){i(K),N()},I),E=null}"onloadend"in E?E.onloadend=j:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(j)},E.onabort=function(){E&&(i(new ze("Request aborted",ze.ECONNABORTED,e,E)),E=null)},E.onerror=function(){i(new ze("Network Error",ze.ERR_NETWORK,e,E)),E=null},E.ontimeout=function(){let Z=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const I=s.transitional||ky;s.timeoutErrorMessage&&(Z=s.timeoutErrorMessage),i(new ze(Z,I.clarifyTimeoutError?ze.ETIMEDOUT:ze.ECONNABORTED,e,E)),E=null},o===void 0&&l.setContentType(null),"setRequestHeader"in E&&kt.forEach(l.toJSON(),function(Z,I){E.setRequestHeader(I,Z)}),kt.isUndefined(s.withCredentials)||(E.withCredentials=!!s.withCredentials),u&&u!=="json"&&(E.responseType=s.responseType),d&&([x,A]=dp(d,!0),E.addEventListener("progress",x)),f&&E.upload&&([g,v]=dp(f),E.upload.addEventListener("progress",g),E.upload.addEventListener("loadend",v)),(s.cancelToken||s.signal)&&(m=z=>{E&&(i(!z||z.type?new tf(null,e,E):z),E.abort(),E=null)},s.cancelToken&&s.cancelToken.subscribe(m),s.signal&&(s.signal.aborted?m():s.signal.addEventListener("abort",m)));const C=M_(s.url);if(C&&ga.protocols.indexOf(C)===-1){i(new ze("Unsupported protocol "+C+":",ze.ERR_BAD_REQUEST,e));return}E.send(o||null)})},U_=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let i=new AbortController,s;const o=function(d){if(!s){s=!0,u();const m=d instanceof Error?d:this.reason;i.abort(m instanceof ze?m:new tf(m instanceof Error?m.message:m))}};let l=t&&setTimeout(()=>{l=null,o(new ze(`timeout ${t} of ms exceeded`,ze.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(o):d.removeEventListener("abort",o)}),e=null)};e.forEach(d=>d.addEventListener("abort",o));const{signal:f}=i;return f.unsubscribe=()=>kt.asap(u),f}},I_=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let i=0,s;for(;i<n;)s=i+t,yield e.slice(i,s),i=s},H_=async function*(e,t){for await(const n of V_(e))yield*I_(n,t)},V_=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:i}=await t.read();if(n)break;yield i}}finally{await t.cancel()}},c5=(e,t,n,i)=>{const s=H_(e,t);let o=0,l,u=f=>{l||(l=!0,i&&i(f))};return new ReadableStream({async pull(f){try{const{done:d,value:m}=await s.next();if(d){u(),f.close();return}let g=m.byteLength;if(n){let x=o+=g;n(x)}f.enqueue(new Uint8Array(m))}catch(d){throw u(d),d}},cancel(f){return u(f),s.return()}},{highWaterMark:2})},kp=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Uy=kp&&typeof ReadableStream=="function",Y_=kp&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Iy=(e,...t)=>{try{return!!e(...t)}catch{return!1}},G_=Uy&&Iy(()=>{let e=!1;const t=new Request(ga.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),u5=64*1024,Mg=Uy&&Iy(()=>kt.isReadableStream(new Response("").body)),pp={stream:Mg&&(e=>e.body)};kp&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!pp[t]&&(pp[t]=kt.isFunction(e[t])?n=>n[t]():(n,i)=>{throw new ze(`Response type '${t}' is not supported`,ze.ERR_NOT_SUPPORT,i)})})})(new Response);const W_=async e=>{if(e==null)return 0;if(kt.isBlob(e))return e.size;if(kt.isSpecCompliantForm(e))return(await new Request(ga.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(kt.isArrayBufferView(e)||kt.isArrayBuffer(e))return e.byteLength;if(kt.isURLSearchParams(e)&&(e=e+""),kt.isString(e))return(await Y_(e)).byteLength},X_=async(e,t)=>{const n=kt.toFiniteNumber(e.getContentLength());return n??W_(t)},K_=kp&&(async e=>{let{url:t,method:n,data:i,signal:s,cancelToken:o,timeout:l,onDownloadProgress:u,onUploadProgress:f,responseType:d,headers:m,withCredentials:g="same-origin",fetchOptions:x}=qy(e);d=d?(d+"").toLowerCase():"text";let v=U_([s,o&&o.toAbortSignal()],l),A;const N=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let E;try{if(f&&G_&&n!=="get"&&n!=="head"&&(E=await X_(m,i))!==0){let I=new Request(t,{method:"POST",body:i,duplex:"half"}),st;if(kt.isFormData(i)&&(st=I.headers.get("content-type"))&&m.setContentType(st),I.body){const[K,H]=r5(E,dp(o5(f)));i=c5(I.body,u5,K,H)}}kt.isString(g)||(g=g?"include":"omit");const j="credentials"in Request.prototype;A=new Request(t,{...x,signal:v,method:n.toUpperCase(),headers:m.normalize().toJSON(),body:i,duplex:"half",credentials:j?g:void 0});let C=await fetch(A,x);const z=Mg&&(d==="stream"||d==="response");if(Mg&&(u||z&&N)){const I={};["status","statusText","headers"].forEach(G=>{I[G]=C[G]});const st=kt.toFiniteNumber(C.headers.get("content-length")),[K,H]=u&&r5(st,dp(o5(u),!0))||[];C=new Response(c5(C.body,u5,K,()=>{H&&H(),N&&N()}),I)}d=d||"text";let Z=await pp[kt.findKey(pp,d)||"text"](C,e);return!z&&N&&N(),await new Promise((I,st)=>{zy(I,st,{data:Z,headers:Va.from(C.headers),status:C.status,statusText:C.statusText,config:e,request:A})})}catch(j){throw N&&N(),j&&j.name==="TypeError"&&/Load failed|fetch/i.test(j.message)?Object.assign(new ze("Network Error",ze.ERR_NETWORK,e,A),{cause:j.cause||j}):ze.from(j,j&&j.code,e,A)}}),Dg={http:u_,xhr:q_,fetch:K_};kt.forEach(Dg,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const f5=e=>`- ${e}`,$_=e=>kt.isFunction(e)||e===null||e===!1,Hy={getAdapter:e=>{e=kt.isArray(e)?e:[e];const{length:t}=e;let n,i;const s={};for(let o=0;o<t;o++){n=e[o];let l;if(i=n,!$_(n)&&(i=Dg[(l=String(n)).toLowerCase()],i===void 0))throw new ze(`Unknown adapter '${l}'`);if(i)break;s[l||"#"+o]=i}if(!i){const o=Object.entries(s).map(([u,f])=>`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let l=t?o.length>1?`since :
`+o.map(f5).join(`
`):" "+f5(o[0]):"as no adapter specified";throw new ze("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return i},adapters:Dg};function rg(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new tf(null,e)}function h5(e){return rg(e),e.headers=Va.from(e.headers),e.data=sg.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Hy.getAdapter(e.adapter||Dh.adapter)(e).then(function(i){return rg(e),i.data=sg.call(e,e.transformResponse,i),i.headers=Va.from(i.headers),i},function(i){return By(i)||(rg(e),i&&i.response&&(i.response.data=sg.call(e,e.transformResponse,i.response),i.response.headers=Va.from(i.response.headers))),Promise.reject(i)})}const Vy="1.10.0",Pp={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Pp[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});const d5={};Pp.transitional=function(t,n,i){function s(o,l){return"[Axios v"+Vy+"] Transitional option '"+o+"'"+l+(i?". "+i:"")}return(o,l,u)=>{if(t===!1)throw new ze(s(l," has been removed"+(n?" in "+n:"")),ze.ERR_DEPRECATED);return n&&!d5[l]&&(d5[l]=!0,console.warn(s(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,l,u):!0}};Pp.spelling=function(t){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};function Z_(e,t,n){if(typeof e!="object")throw new ze("options must be an object",ze.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let s=i.length;for(;s-- >0;){const o=i[s],l=t[o];if(l){const u=e[o],f=u===void 0||l(u,o,e);if(f!==!0)throw new ze("option "+o+" must be "+f,ze.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ze("Unknown option "+o,ze.ERR_BAD_OPTION)}}const ip={assertOptions:Z_,validators:Pp},Xr=ip.validators;let Fc=class{constructor(t){this.defaults=t||{},this.interceptors={request:new a5,response:new a5}}async request(t,n){try{return await this._request(t,n)}catch(i){if(i instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{i.stack?o&&!String(i.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(i.stack+=`
`+o):i.stack=o}catch{}}throw i}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ic(this.defaults,n);const{transitional:i,paramsSerializer:s,headers:o}=n;i!==void 0&&ip.assertOptions(i,{silentJSONParsing:Xr.transitional(Xr.boolean),forcedJSONParsing:Xr.transitional(Xr.boolean),clarifyTimeoutError:Xr.transitional(Xr.boolean)},!1),s!=null&&(kt.isFunction(s)?n.paramsSerializer={serialize:s}:ip.assertOptions(s,{encode:Xr.function,serialize:Xr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ip.assertOptions(n,{baseUrl:Xr.spelling("baseURL"),withXsrfToken:Xr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=o&&kt.merge(o.common,o[n.method]);o&&kt.forEach(["delete","get","head","post","put","patch","common"],A=>{delete o[A]}),n.headers=Va.concat(l,o);const u=[];let f=!0;this.interceptors.request.forEach(function(N){typeof N.runWhen=="function"&&N.runWhen(n)===!1||(f=f&&N.synchronous,u.unshift(N.fulfilled,N.rejected))});const d=[];this.interceptors.response.forEach(function(N){d.push(N.fulfilled,N.rejected)});let m,g=0,x;if(!f){const A=[h5.bind(this),void 0];for(A.unshift.apply(A,u),A.push.apply(A,d),x=A.length,m=Promise.resolve(n);g<x;)m=m.then(A[g++],A[g++]);return m}x=u.length;let v=n;for(g=0;g<x;){const A=u[g++],N=u[g++];try{v=A(v)}catch(E){N.call(this,E);break}}try{m=h5.call(this,v)}catch(A){return Promise.reject(A)}for(g=0,x=d.length;g<x;)m=m.then(d[g++],d[g++]);return m}getUri(t){t=Ic(this.defaults,t);const n=Fy(t.baseURL,t.url,t.allowAbsoluteUrls);return Ry(n,t.params,t.paramsSerializer)}};kt.forEach(["delete","get","head","options"],function(t){Fc.prototype[t]=function(n,i){return this.request(Ic(i||{},{method:t,url:n,data:(i||{}).data}))}});kt.forEach(["post","put","patch"],function(t){function n(i){return function(o,l,u){return this.request(Ic(u||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:l}))}}Fc.prototype[t]=n(),Fc.prototype[t+"Form"]=n(!0)});let Q_=class Yy{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const i=this;this.promise.then(s=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](s);i._listeners=null}),this.promise.then=s=>{let o;const l=new Promise(u=>{i.subscribe(u),o=u}).then(s);return l.cancel=function(){i.unsubscribe(o)},l},t(function(o,l,u){i.reason||(i.reason=new tf(o,l,u),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=i=>{t.abort(i)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Yy(function(s){t=s}),cancel:t}}};function J_(e){return function(n){return e.apply(null,n)}}function tS(e){return kt.isObject(e)&&e.isAxiosError===!0}const Rg={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Rg).forEach(([e,t])=>{Rg[t]=e});function Gy(e){const t=new Fc(e),n=_y(Fc.prototype.request,t);return kt.extend(n,Fc.prototype,t,{allOwnKeys:!0}),kt.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Gy(Ic(e,s))},n}const De=Gy(Dh);De.Axios=Fc;De.CanceledError=tf;De.CancelToken=Q_;De.isCancel=By;De.VERSION=Vy;De.toFormData=Rp;De.AxiosError=ze;De.Cancel=De.CanceledError;De.all=function(t){return Promise.all(t)};De.spread=J_;De.isAxiosError=tS;De.mergeConfig=Ic;De.AxiosHeaders=Va;De.formToJSON=e=>Py(kt.isHTMLForm(e)?new FormData(e):e);De.getAdapter=Hy.getAdapter;De.HttpStatusCode=Rg;De.default=De;const{Axios:pL,AxiosError:mL,CanceledError:gL,isCancel:bL,CancelToken:yL,VERSION:vL,all:xL,Cancel:wL,isAxiosError:_L,spread:SL,toFormData:NL,AxiosHeaders:AL,HttpStatusCode:LL,formToJSON:EL,getAdapter:jL,mergeConfig:TL}=De;function ls({children:e}){const t=Ri(),n=ot.useContext(Ya),{setAuthData:i}=n,s=async()=>{try{await De.get("/api/auth/status",{withCredentials:!0})}catch(o){i({clinicId:null,clinicName:null,user:null,username:null,usertype:null,isLoggedIn:!1}),t("/login"),Be.error(o?.response?.data?.message||o.message)}};return ot.useEffect(()=>{s()},[]),e}var ap={exports:{}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
* @license MIT */var eS=ap.exports,p5;function nS(){return p5||(p5=1,function(e,t){(function(n,i){e.exports=i()})(eS,function(){var n={};n.version="0.2.0";var i=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};n.configure=function(A){var N,E;for(N in A)E=A[N],E!==void 0&&A.hasOwnProperty(N)&&(i[N]=E);return this},n.status=null,n.set=function(A){var N=n.isStarted();A=s(A,i.minimum,1),n.status=A===1?null:A;var E=n.render(!N),j=E.querySelector(i.barSelector),C=i.speed,z=i.easing;return E.offsetWidth,u(function(Z){i.positionUsing===""&&(i.positionUsing=n.getPositioningCSS()),f(j,l(A,C,z)),A===1?(f(E,{transition:"none",opacity:1}),E.offsetWidth,setTimeout(function(){f(E,{transition:"all "+C+"ms linear",opacity:0}),setTimeout(function(){n.remove(),Z()},C)},C)):setTimeout(Z,C)}),this},n.isStarted=function(){return typeof n.status=="number"},n.start=function(){n.status||n.set(0);var A=function(){setTimeout(function(){n.status&&(n.trickle(),A())},i.trickleSpeed)};return i.trickle&&A(),this},n.done=function(A){return!A&&!n.status?this:n.inc(.3+.5*Math.random()).set(1)},n.inc=function(A){var N=n.status;return N?(typeof A!="number"&&(A=(1-N)*s(Math.random()*N,.1,.95)),N=s(N+A,0,.994),n.set(N)):n.start()},n.trickle=function(){return n.inc(Math.random()*i.trickleRate)},function(){var A=0,N=0;n.promise=function(E){return!E||E.state()==="resolved"?this:(N===0&&n.start(),A++,N++,E.always(function(){N--,N===0?(A=0,n.done()):n.set((A-N)/A)}),this)}}(),n.render=function(A){if(n.isRendered())return document.getElementById("nprogress");m(document.documentElement,"nprogress-busy");var N=document.createElement("div");N.id="nprogress",N.innerHTML=i.template;var E=N.querySelector(i.barSelector),j=A?"-100":o(n.status||0),C=document.querySelector(i.parent),z;return f(E,{transition:"all 0 linear",transform:"translate3d("+j+"%,0,0)"}),i.showSpinner||(z=N.querySelector(i.spinnerSelector),z&&v(z)),C!=document.body&&m(C,"nprogress-custom-parent"),C.appendChild(N),N},n.remove=function(){g(document.documentElement,"nprogress-busy"),g(document.querySelector(i.parent),"nprogress-custom-parent");var A=document.getElementById("nprogress");A&&v(A)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var A=document.body.style,N="WebkitTransform"in A?"Webkit":"MozTransform"in A?"Moz":"msTransform"in A?"ms":"OTransform"in A?"O":"";return N+"Perspective"in A?"translate3d":N+"Transform"in A?"translate":"margin"};function s(A,N,E){return A<N?N:A>E?E:A}function o(A){return(-1+A)*100}function l(A,N,E){var j;return i.positionUsing==="translate3d"?j={transform:"translate3d("+o(A)+"%,0,0)"}:i.positionUsing==="translate"?j={transform:"translate("+o(A)+"%,0)"}:j={"margin-left":o(A)+"%"},j.transition="all "+N+"ms "+E,j}var u=function(){var A=[];function N(){var E=A.shift();E&&E(N)}return function(E){A.push(E),A.length==1&&N()}}(),f=function(){var A=["Webkit","O","Moz","ms"],N={};function E(Z){return Z.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(I,st){return st.toUpperCase()})}function j(Z){var I=document.body.style;if(Z in I)return Z;for(var st=A.length,K=Z.charAt(0).toUpperCase()+Z.slice(1),H;st--;)if(H=A[st]+K,H in I)return H;return Z}function C(Z){return Z=E(Z),N[Z]||(N[Z]=j(Z))}function z(Z,I,st){I=C(I),Z.style[I]=st}return function(Z,I){var st=arguments,K,H;if(st.length==2)for(K in I)H=I[K],H!==void 0&&I.hasOwnProperty(K)&&z(Z,K,H);else z(Z,st[1],st[2])}}();function d(A,N){var E=typeof A=="string"?A:x(A);return E.indexOf(" "+N+" ")>=0}function m(A,N){var E=x(A),j=E+N;d(E,N)||(A.className=j.substring(1))}function g(A,N){var E=x(A),j;d(A,N)&&(j=E.replace(" "+N+" "," "),A.className=j.substring(1,j.length-1))}function x(A){return(" "+(A.className||"")+" ").replace(/\s+/gi," ")}function v(A){A&&A.parentNode&&A.parentNode.removeChild(A)}return n})}(ap)),ap.exports}var iS=nS();const m5=n0(iS);function aS(){const e=Yo();return ot.useEffect(()=>{m5.start();const t=setTimeout(()=>{m5.done()},300);return()=>clearTimeout(t)},[e.pathname]),null}const sS="/logo.png",rS=[{title:"Dashboard",icon:"🏠",link:"/dashboard"},{title:"Patients",icon:"👤",subItems:[{title:"All Patients",link:"/dashboard/patients"},{title:"Add Patient",link:"/dashboard/add-patient"}]},{title:"Users",icon:"👥",subItems:[{title:"All Users",link:"/dashboard/users"},{title:"Add User",link:"/dashboard/add-user"}]}];function oS({children:e}){const t=Ri(),{setAuthData:n}=ot.useContext(Ya),i=async()=>{try{await De.post("/api/auth/logout"),n({clinicId:null,clinicName:null,user:null,username:null,usertype:null,isLoggedIn:!1}),Be.success("Logout successful!"),t("/login")}catch{Be.error("Logout failed. Please try again.")}};return L.jsxs("div",{className:"drawer lg:drawer-open",children:[L.jsx("input",{id:"sidebar-drawer",type:"checkbox",className:"drawer-toggle"}),L.jsxs("div",{className:"drawer-content flex flex-col p-4 overflow-auto",children:[L.jsx("label",{htmlFor:"sidebar-drawer",className:"btn btn-ghost drawer-button lg:hidden fixed top-4 right-4 z-50",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:L.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 6h16M4 12h16M4 18h16"})})}),e]}),L.jsxs("div",{className:"drawer-side",children:[L.jsx("label",{htmlFor:"sidebar-drawer",className:"drawer-overlay"}),L.jsx("div",{className:"menu p-4 w-64 h-full overflow-auto sidebar-scroll bg-base-200 text-base-content flex flex-col",children:L.jsxs("div",{className:"flex-1 flex flex-col",children:[L.jsx("div",{className:"my-4 text-center",children:L.jsx("img",{id:"logo",src:sS,alt:"Logo",className:"w-full h-16 mx-auto mb-2"})}),L.jsxs("div",{className:"flex-1 overflow-auto flex flex-col gap-2",children:[rS.map((s,o)=>s.subItems&&s.subItems.length>0?L.jsxs("div",{className:"collapse bg-base-100 border border-base-300",children:[L.jsx("input",{type:"checkbox",name:"my-accordion",defaultChecked:o===0}),L.jsxs("div",{className:"collapse-title px-4 py-2 font-semibold flex items-center gap-2",children:[L.jsx("span",{children:s.icon}),L.jsx("span",{children:s.title})]}),L.jsx("div",{className:"collapse-content text-sm",children:s.subItems.map((l,u)=>L.jsx(us,{to:l.link,className:"block px-4 py-1 hover:bg-base-300 rounded",children:l.title},u))})]},o):L.jsxs(us,{to:s?.link??"#",className:"flex items-center gap-2 px-4 py-2 font-semibold bg-base-100 border border-base-300 rounded-lg hover:bg-base-300",children:[L.jsx("span",{children:s.icon}),L.jsx("span",{children:s.title})]},o)),L.jsxs(us,{to:"#",onClick:()=>{window.confirm("Are you sure you want to logout?")&&i()},className:"flex items-center gap-2 px-4 py-2 font-semibold bg-base-100 border border-base-300 rounded-lg hover:bg-base-300",children:[L.jsx("span",{children:"🚪"}),L.jsx("span",{children:"Logout"})]})]}),L.jsx("div",{className:"mt-4 text-sm text-center text-gray-500",children:L.jsxs("p",{children:["Developed by"," ",L.jsx("span",{className:"font-semibold text-gray-700",children:"Assersoft"})]})})]})})]})]})}function lS(){return L.jsx("div",{className:"min-h-screen flex",children:L.jsx(oS,{children:L.jsx(mw,{})})})}var Rh=e=>e.type==="checkbox",Bc=e=>e instanceof Date,Ea=e=>e==null;const Wy=e=>typeof e=="object";var yi=e=>!Ea(e)&&!Array.isArray(e)&&Wy(e)&&!Bc(e),cS=e=>yi(e)&&e.target?Rh(e.target)?e.target.checked:e.target.value:e,uS=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,fS=(e,t)=>e.has(uS(t)),hS=e=>{const t=e.constructor&&e.constructor.prototype;return yi(t)&&t.hasOwnProperty("isPrototypeOf")},p0=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Vi(e){let t;const n=Array.isArray(e),i=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(p0&&(e instanceof Blob||i))&&(n||yi(e)))if(t=n?[]:{},!n&&!hS(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=Vi(e[s]));else return e;return t}var Bp=e=>/^\w*$/.test(e),Ei=e=>e===void 0,m0=e=>Array.isArray(e)?e.filter(Boolean):[],g0=e=>m0(e.replace(/["|']|\]/g,"").split(/\.|\[/)),be=(e,t,n)=>{if(!t||!yi(e))return n;const i=(Bp(t)?[t]:g0(t)).reduce((s,o)=>Ea(s)?s:s[o],e);return Ei(i)||i===e?Ei(e[t])?n:e[t]:i},Jr=e=>typeof e=="boolean",Wn=(e,t,n)=>{let i=-1;const s=Bp(t)?[t]:g0(t),o=s.length,l=o-1;for(;++i<o;){const u=s[i];let f=n;if(i!==l){const d=e[u];f=yi(d)||Array.isArray(d)?d:isNaN(+s[i+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=f,e=e[u]}};const g5={BLUR:"blur",FOCUS_OUT:"focusout"},rr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Po={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},dS=Jt.createContext(null);dS.displayName="HookFormContext";var pS=(e,t,n,i=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const l=o;return t._proxyFormState[l]!==rr.all&&(t._proxyFormState[l]=!i||rr.all),e[l]}});return s};const mS=typeof window<"u"?ot.useLayoutEffect:ot.useEffect;var to=e=>typeof e=="string",gS=(e,t,n,i,s)=>to(e)?(i&&t.watch.add(e),be(n,e,s)):Array.isArray(e)?e.map(o=>(i&&t.watch.add(o),be(n,o))):(i&&(t.watchAll=!0),n),bS=(e,t,n,i,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[i]:s||!0}}:{},uh=e=>Array.isArray(e)?e:[e],b5=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},kg=e=>Ea(e)||!Wy(e);function zl(e,t,n=new WeakSet){if(kg(e)||kg(t))return e===t;if(Bc(e)&&Bc(t))return e.getTime()===t.getTime();const i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const o of i){const l=e[o];if(!s.includes(o))return!1;if(o!=="ref"){const u=t[o];if(Bc(l)&&Bc(u)||yi(l)&&yi(u)||Array.isArray(l)&&Array.isArray(u)?!zl(l,u,n):l!==u)return!1}}return!0}var qa=e=>yi(e)&&!Object.keys(e).length,b0=e=>e.type==="file",or=e=>typeof e=="function",mp=e=>{if(!p0)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Xy=e=>e.type==="select-multiple",y0=e=>e.type==="radio",yS=e=>y0(e)||Rh(e),og=e=>mp(e)&&e.isConnected;function vS(e,t){const n=t.slice(0,-1).length;let i=0;for(;i<n;)e=Ei(e)?i++:e[t[i++]];return e}function xS(e){for(const t in e)if(e.hasOwnProperty(t)&&!Ei(e[t]))return!1;return!0}function Li(e,t){const n=Array.isArray(t)?t:Bp(t)?[t]:g0(t),i=n.length===1?e:vS(e,n),s=n.length-1,o=n[s];return i&&delete i[o],s!==0&&(yi(i)&&qa(i)||Array.isArray(i)&&xS(i))&&Li(e,n.slice(0,-1)),e}var Ky=e=>{for(const t in e)if(or(e[t]))return!0;return!1};function gp(e,t={}){const n=Array.isArray(e);if(yi(e)||n)for(const i in e)Array.isArray(e[i])||yi(e[i])&&!Ky(e[i])?(t[i]=Array.isArray(e[i])?[]:{},gp(e[i],t[i])):Ea(e[i])||(t[i]=!0);return t}function $y(e,t,n){const i=Array.isArray(e);if(yi(e)||i)for(const s in e)Array.isArray(e[s])||yi(e[s])&&!Ky(e[s])?Ei(t)||kg(n[s])?n[s]=Array.isArray(e[s])?gp(e[s],[]):{...gp(e[s])}:$y(e[s],Ea(t)?{}:t[s],n[s]):n[s]=!zl(e[s],t[s]);return n}var Qf=(e,t)=>$y(e,t,gp(t));const y5={value:!1,isValid:!1},v5={value:!0,isValid:!0};var Zy=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ei(e[0].attributes.value)?Ei(e[0].value)||e[0].value===""?v5:{value:e[0].value,isValid:!0}:v5:y5}return y5},Qy=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:i})=>Ei(e)?e:t?e===""?NaN:e&&+e:n&&to(e)?new Date(e):i?i(e):e;const x5={isValid:!1,value:null};var Jy=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,x5):x5;function w5(e){const t=e.ref;return b0(t)?t.files:y0(t)?Jy(e.refs).value:Xy(t)?[...t.selectedOptions].map(({value:n})=>n):Rh(t)?Zy(e.refs).value:Qy(Ei(t.value)?e.ref.value:t.value,e)}var wS=(e,t,n,i)=>{const s={};for(const o of e){const l=be(t,o);l&&Wn(s,o,l._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:i}},bp=e=>e instanceof RegExp,Jf=e=>Ei(e)?e:bp(e)?e.source:yi(e)?bp(e.value)?e.value.source:e.value:e,_5=e=>({isOnSubmit:!e||e===rr.onSubmit,isOnBlur:e===rr.onBlur,isOnChange:e===rr.onChange,isOnAll:e===rr.all,isOnTouch:e===rr.onTouched});const S5="AsyncFunction";var _S=e=>!!e&&!!e.validate&&!!(or(e.validate)&&e.validate.constructor.name===S5||yi(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===S5)),SS=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),N5=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));const fh=(e,t,n,i)=>{for(const s of n||Object.keys(e)){const o=be(e,s);if(o){const{_f:l,...u}=o;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],s)&&!i)return!0;if(l.ref&&t(l.ref,l.name)&&!i)return!0;if(fh(u,t))break}else if(yi(u)&&fh(u,t))break}}};function A5(e,t,n){const i=be(e,n);if(i||Bp(n))return{error:i,name:n};const s=n.split(".");for(;s.length;){const o=s.join("."),l=be(t,o),u=be(e,o);if(l&&!Array.isArray(l)&&n!==o)return{name:n};if(u&&u.type)return{name:o,error:u};if(u&&u.root&&u.root.type)return{name:`${o}.root`,error:u.root};s.pop()}return{name:n}}var NS=(e,t,n,i)=>{n(e);const{name:s,...o}=e;return qa(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(l=>t[l]===(!i||rr.all))},AS=(e,t,n)=>!e||!t||e===t||uh(e).some(i=>i&&(n?i===t:i.startsWith(t)||t.startsWith(i))),LS=(e,t,n,i,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?i.isOnBlur:s.isOnBlur)?!e:(n?i.isOnChange:s.isOnChange)?e:!0,ES=(e,t)=>!m0(be(e,t)).length&&Li(e,t),jS=(e,t,n)=>{const i=uh(be(e,n));return Wn(i,"root",t[n]),Wn(e,n,i),e},sp=e=>to(e);function L5(e,t,n="validate"){if(sp(e)||Array.isArray(e)&&e.every(sp)||Jr(e)&&!e)return{type:n,message:sp(e)?e:"",ref:t}}var Mu=e=>yi(e)&&!bp(e)?e:{value:e,message:""},E5=async(e,t,n,i,s,o)=>{const{ref:l,refs:u,required:f,maxLength:d,minLength:m,min:g,max:x,pattern:v,validate:A,name:N,valueAsNumber:E,mount:j}=e._f,C=be(n,N);if(!j||t.has(N))return{};const z=u?u[0]:l,Z=R=>{s&&z.reportValidity&&(z.setCustomValidity(Jr(R)?"":R||""),z.reportValidity())},I={},st=y0(l),K=Rh(l),H=st||K,G=(E||b0(l))&&Ei(l.value)&&Ei(C)||mp(l)&&l.value===""||C===""||Array.isArray(C)&&!C.length,Q=bS.bind(null,N,i,I),D=(R,et,nt,dt=Po.maxLength,W=Po.minLength)=>{const lt=R?et:nt;I[N]={type:R?dt:W,message:lt,ref:l,...Q(R?dt:W,lt)}};if(o?!Array.isArray(C)||!C.length:f&&(!H&&(G||Ea(C))||Jr(C)&&!C||K&&!Zy(u).isValid||st&&!Jy(u).isValid)){const{value:R,message:et}=sp(f)?{value:!!f,message:f}:Mu(f);if(R&&(I[N]={type:Po.required,message:et,ref:z,...Q(Po.required,et)},!i))return Z(et),I}if(!G&&(!Ea(g)||!Ea(x))){let R,et;const nt=Mu(x),dt=Mu(g);if(!Ea(C)&&!isNaN(C)){const W=l.valueAsNumber||C&&+C;Ea(nt.value)||(R=W>nt.value),Ea(dt.value)||(et=W<dt.value)}else{const W=l.valueAsDate||new Date(C),lt=Y=>new Date(new Date().toDateString()+" "+Y),ut=l.type=="time",wt=l.type=="week";to(nt.value)&&C&&(R=ut?lt(C)>lt(nt.value):wt?C>nt.value:W>new Date(nt.value)),to(dt.value)&&C&&(et=ut?lt(C)<lt(dt.value):wt?C<dt.value:W<new Date(dt.value))}if((R||et)&&(D(!!R,nt.message,dt.message,Po.max,Po.min),!i))return Z(I[N].message),I}if((d||m)&&!G&&(to(C)||o&&Array.isArray(C))){const R=Mu(d),et=Mu(m),nt=!Ea(R.value)&&C.length>+R.value,dt=!Ea(et.value)&&C.length<+et.value;if((nt||dt)&&(D(nt,R.message,et.message),!i))return Z(I[N].message),I}if(v&&!G&&to(C)){const{value:R,message:et}=Mu(v);if(bp(R)&&!C.match(R)&&(I[N]={type:Po.pattern,message:et,ref:l,...Q(Po.pattern,et)},!i))return Z(et),I}if(A){if(or(A)){const R=await A(C,n),et=L5(R,z);if(et&&(I[N]={...et,...Q(Po.validate,et.message)},!i))return Z(et.message),I}else if(yi(A)){let R={};for(const et in A){if(!qa(R)&&!i)break;const nt=L5(await A[et](C,n),z,et);nt&&(R={...nt,...Q(et,nt.message)},Z(nt.message),i&&(I[N]=R))}if(!qa(R)&&(I[N]={ref:z,...R},!i))return I}}return Z(!0),I};const TS={mode:rr.onSubmit,reValidateMode:rr.onChange,shouldFocusError:!0};function CS(e={}){let t={...TS,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:or(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},i={},s=yi(t.defaultValues)||yi(t.values)?Vi(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Vi(s),l={action:!1,mount:!1,watch:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,d=0;const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...m};const x={array:b5(),state:b5()},v=t.criteriaMode===rr.all,A=J=>ht=>{clearTimeout(d),d=setTimeout(J,ht)},N=async J=>{if(!t.disabled&&(m.isValid||g.isValid||J)){const ht=t.resolver?qa((await K()).errors):await G(i,!0);ht!==n.isValid&&x.state.next({isValid:ht})}},E=(J,ht)=>{!t.disabled&&(m.isValidating||m.validatingFields||g.isValidating||g.validatingFields)&&((J||Array.from(u.mount)).forEach(mt=>{mt&&(ht?Wn(n.validatingFields,mt,ht):Li(n.validatingFields,mt))}),x.state.next({validatingFields:n.validatingFields,isValidating:!qa(n.validatingFields)}))},j=(J,ht=[],mt,Pt,qt=!0,Ft=!0)=>{if(Pt&&mt&&!t.disabled){if(l.action=!0,Ft&&Array.isArray(be(i,J))){const Kt=mt(be(i,J),Pt.argA,Pt.argB);qt&&Wn(i,J,Kt)}if(Ft&&Array.isArray(be(n.errors,J))){const Kt=mt(be(n.errors,J),Pt.argA,Pt.argB);qt&&Wn(n.errors,J,Kt),ES(n.errors,J)}if((m.touchedFields||g.touchedFields)&&Ft&&Array.isArray(be(n.touchedFields,J))){const Kt=mt(be(n.touchedFields,J),Pt.argA,Pt.argB);qt&&Wn(n.touchedFields,J,Kt)}(m.dirtyFields||g.dirtyFields)&&(n.dirtyFields=Qf(s,o)),x.state.next({name:J,isDirty:D(J,ht),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Wn(o,J,ht)},C=(J,ht)=>{Wn(n.errors,J,ht),x.state.next({errors:n.errors})},z=J=>{n.errors=J,x.state.next({errors:n.errors,isValid:!1})},Z=(J,ht,mt,Pt)=>{const qt=be(i,J);if(qt){const Ft=be(o,J,Ei(mt)?be(s,J):mt);Ei(Ft)||Pt&&Pt.defaultChecked||ht?Wn(o,J,ht?Ft:w5(qt._f)):nt(J,Ft),l.mount&&N()}},I=(J,ht,mt,Pt,qt)=>{let Ft=!1,Kt=!1;const re={name:J};if(!t.disabled){if(!mt||Pt){(m.isDirty||g.isDirty)&&(Kt=n.isDirty,n.isDirty=re.isDirty=D(),Ft=Kt!==re.isDirty);const fe=zl(be(s,J),ht);Kt=!!be(n.dirtyFields,J),fe?Li(n.dirtyFields,J):Wn(n.dirtyFields,J,!0),re.dirtyFields=n.dirtyFields,Ft=Ft||(m.dirtyFields||g.dirtyFields)&&Kt!==!fe}if(mt){const fe=be(n.touchedFields,J);fe||(Wn(n.touchedFields,J,mt),re.touchedFields=n.touchedFields,Ft=Ft||(m.touchedFields||g.touchedFields)&&fe!==mt)}Ft&&qt&&x.state.next(re)}return Ft?re:{}},st=(J,ht,mt,Pt)=>{const qt=be(n.errors,J),Ft=(m.isValid||g.isValid)&&Jr(ht)&&n.isValid!==ht;if(t.delayError&&mt?(f=A(()=>C(J,mt)),f(t.delayError)):(clearTimeout(d),f=null,mt?Wn(n.errors,J,mt):Li(n.errors,J)),(mt?!zl(qt,mt):qt)||!qa(Pt)||Ft){const Kt={...Pt,...Ft&&Jr(ht)?{isValid:ht}:{},errors:n.errors,name:J};n={...n,...Kt},x.state.next(Kt)}},K=async J=>{E(J,!0);const ht=await t.resolver(o,t.context,wS(J||u.mount,i,t.criteriaMode,t.shouldUseNativeValidation));return E(J),ht},H=async J=>{const{errors:ht}=await K(J);if(J)for(const mt of J){const Pt=be(ht,mt);Pt?Wn(n.errors,mt,Pt):Li(n.errors,mt)}else n.errors=ht;return ht},G=async(J,ht,mt={valid:!0})=>{for(const Pt in J){const qt=J[Pt];if(qt){const{_f:Ft,...Kt}=qt;if(Ft){const re=u.array.has(Ft.name),fe=qt._f&&_S(qt._f);fe&&m.validatingFields&&E([Pt],!0);const oe=await E5(qt,u.disabled,o,v,t.shouldUseNativeValidation&&!ht,re);if(fe&&m.validatingFields&&E([Pt]),oe[Ft.name]&&(mt.valid=!1,ht))break;!ht&&(be(oe,Ft.name)?re?jS(n.errors,oe,Ft.name):Wn(n.errors,Ft.name,oe[Ft.name]):Li(n.errors,Ft.name))}!qa(Kt)&&await G(Kt,ht,mt)}}return mt.valid},Q=()=>{for(const J of u.unMount){const ht=be(i,J);ht&&(ht._f.refs?ht._f.refs.every(mt=>!og(mt)):!og(ht._f.ref))&&At(J)}u.unMount=new Set},D=(J,ht)=>!t.disabled&&(J&&ht&&Wn(o,J,ht),!zl(Y(),s)),R=(J,ht,mt)=>gS(J,u,{...l.mount?o:Ei(ht)?s:to(J)?{[J]:ht}:ht},mt,ht),et=J=>m0(be(l.mount?o:s,J,t.shouldUnregister?be(s,J,[]):[])),nt=(J,ht,mt={})=>{const Pt=be(i,J);let qt=ht;if(Pt){const Ft=Pt._f;Ft&&(!Ft.disabled&&Wn(o,J,Qy(ht,Ft)),qt=mp(Ft.ref)&&Ea(ht)?"":ht,Xy(Ft.ref)?[...Ft.ref.options].forEach(Kt=>Kt.selected=qt.includes(Kt.value)):Ft.refs?Rh(Ft.ref)?Ft.refs.forEach(Kt=>{(!Kt.defaultChecked||!Kt.disabled)&&(Array.isArray(qt)?Kt.checked=!!qt.find(re=>re===Kt.value):Kt.checked=qt===Kt.value||!!qt)}):Ft.refs.forEach(Kt=>Kt.checked=Kt.value===qt):b0(Ft.ref)?Ft.ref.value="":(Ft.ref.value=qt,Ft.ref.type||x.state.next({name:J,values:Vi(o)})))}(mt.shouldDirty||mt.shouldTouch)&&I(J,qt,mt.shouldTouch,mt.shouldDirty,!0),mt.shouldValidate&&wt(J)},dt=(J,ht,mt)=>{for(const Pt in ht){if(!ht.hasOwnProperty(Pt))return;const qt=ht[Pt],Ft=J+"."+Pt,Kt=be(i,Ft);(u.array.has(J)||yi(qt)||Kt&&!Kt._f)&&!Bc(qt)?dt(Ft,qt,mt):nt(Ft,qt,mt)}},W=(J,ht,mt={})=>{const Pt=be(i,J),qt=u.array.has(J),Ft=Vi(ht);Wn(o,J,Ft),qt?(x.array.next({name:J,values:Vi(o)}),(m.isDirty||m.dirtyFields||g.isDirty||g.dirtyFields)&&mt.shouldDirty&&x.state.next({name:J,dirtyFields:Qf(s,o),isDirty:D(J,Ft)})):Pt&&!Pt._f&&!Ea(Ft)?dt(J,Ft,mt):nt(J,Ft,mt),N5(J,u)&&x.state.next({...n}),x.state.next({name:l.mount?J:void 0,values:Vi(o)})},lt=async J=>{l.mount=!0;const ht=J.target;let mt=ht.name,Pt=!0;const qt=be(i,mt),Ft=fe=>{Pt=Number.isNaN(fe)||Bc(fe)&&isNaN(fe.getTime())||zl(fe,be(o,mt,fe))},Kt=_5(t.mode),re=_5(t.reValidateMode);if(qt){let fe,oe;const Se=ht.type?w5(qt._f):cS(J),ee=J.type===g5.BLUR||J.type===g5.FOCUS_OUT,En=!SS(qt._f)&&!t.resolver&&!be(n.errors,mt)&&!qt._f.deps||LS(ee,be(n.touchedFields,mt),n.isSubmitted,re,Kt),Pe=N5(mt,u,ee);Wn(o,mt,Se),ee?(qt._f.onBlur&&qt._f.onBlur(J),f&&f(0)):qt._f.onChange&&qt._f.onChange(J);const ei=I(mt,Se,ee),Ue=!qa(ei)||Pe;if(!ee&&x.state.next({name:mt,type:J.type,values:Vi(o)}),En)return(m.isValid||g.isValid)&&(t.mode==="onBlur"?ee&&N():ee||N()),Ue&&x.state.next({name:mt,...Pe?{}:ei});if(!ee&&Pe&&x.state.next({...n}),t.resolver){const{errors:Qe}=await K([mt]);if(Ft(Se),Pt){const vi=A5(n.errors,i,mt),He=A5(Qe,i,vi.name||mt);fe=He.error,mt=He.name,oe=qa(Qe)}}else E([mt],!0),fe=(await E5(qt,u.disabled,o,v,t.shouldUseNativeValidation))[mt],E([mt]),Ft(Se),Pt&&(fe?oe=!1:(m.isValid||g.isValid)&&(oe=await G(i,!0)));Pt&&(qt._f.deps&&wt(qt._f.deps),st(mt,oe,fe,ei))}},ut=(J,ht)=>{if(be(n.errors,ht)&&J.focus)return J.focus(),1},wt=async(J,ht={})=>{let mt,Pt;const qt=uh(J);if(t.resolver){const Ft=await H(Ei(J)?J:qt);mt=qa(Ft),Pt=J?!qt.some(Kt=>be(Ft,Kt)):mt}else J?(Pt=(await Promise.all(qt.map(async Ft=>{const Kt=be(i,Ft);return await G(Kt&&Kt._f?{[Ft]:Kt}:Kt)}))).every(Boolean),!(!Pt&&!n.isValid)&&N()):Pt=mt=await G(i);return x.state.next({...!to(J)||(m.isValid||g.isValid)&&mt!==n.isValid?{}:{name:J},...t.resolver||!J?{isValid:mt}:{},errors:n.errors}),ht.shouldFocus&&!Pt&&fh(i,ut,J?qt:u.mount),Pt},Y=J=>{const ht={...l.mount?o:s};return Ei(J)?ht:to(J)?be(ht,J):J.map(mt=>be(ht,mt))},gt=(J,ht)=>({invalid:!!be((ht||n).errors,J),isDirty:!!be((ht||n).dirtyFields,J),error:be((ht||n).errors,J),isValidating:!!be(n.validatingFields,J),isTouched:!!be((ht||n).touchedFields,J)}),O=J=>{J&&uh(J).forEach(ht=>Li(n.errors,ht)),x.state.next({errors:J?n.errors:{}})},q=(J,ht,mt)=>{const Pt=(be(i,J,{_f:{}})._f||{}).ref,qt=be(n.errors,J)||{},{ref:Ft,message:Kt,type:re,...fe}=qt;Wn(n.errors,J,{...fe,...ht,ref:Pt}),x.state.next({name:J,errors:n.errors,isValid:!1}),mt&&mt.shouldFocus&&Pt&&Pt.focus&&Pt.focus()},$=(J,ht)=>or(J)?x.state.subscribe({next:mt=>J(R(void 0,ht),mt)}):R(J,ht,!0),rt=J=>x.state.subscribe({next:ht=>{AS(J.name,ht.name,J.exact)&&NS(ht,J.formState||m,me,J.reRenderRoot)&&J.callback({values:{...o},...n,...ht})}}).unsubscribe,at=J=>(l.mount=!0,g={...g,...J.formState},rt({...J,formState:g})),At=(J,ht={})=>{for(const mt of J?uh(J):u.mount)u.mount.delete(mt),u.array.delete(mt),ht.keepValue||(Li(i,mt),Li(o,mt)),!ht.keepError&&Li(n.errors,mt),!ht.keepDirty&&Li(n.dirtyFields,mt),!ht.keepTouched&&Li(n.touchedFields,mt),!ht.keepIsValidating&&Li(n.validatingFields,mt),!t.shouldUnregister&&!ht.keepDefaultValue&&Li(s,mt);x.state.next({values:Vi(o)}),x.state.next({...n,...ht.keepDirty?{isDirty:D()}:{}}),!ht.keepIsValid&&N()},St=({disabled:J,name:ht})=>{(Jr(J)&&l.mount||J||u.disabled.has(ht))&&(J?u.disabled.add(ht):u.disabled.delete(ht))},Tt=(J,ht={})=>{let mt=be(i,J);const Pt=Jr(ht.disabled)||Jr(t.disabled);return Wn(i,J,{...mt||{},_f:{...mt&&mt._f?mt._f:{ref:{name:J}},name:J,mount:!0,...ht}}),u.mount.add(J),mt?St({disabled:Jr(ht.disabled)?ht.disabled:t.disabled,name:J}):Z(J,!0,ht.value),{...Pt?{disabled:ht.disabled||t.disabled}:{},...t.progressive?{required:!!ht.required,min:Jf(ht.min),max:Jf(ht.max),minLength:Jf(ht.minLength),maxLength:Jf(ht.maxLength),pattern:Jf(ht.pattern)}:{},name:J,onChange:lt,onBlur:lt,ref:qt=>{if(qt){Tt(J,ht),mt=be(i,J);const Ft=Ei(qt.value)&&qt.querySelectorAll&&qt.querySelectorAll("input,select,textarea")[0]||qt,Kt=yS(Ft),re=mt._f.refs||[];if(Kt?re.find(fe=>fe===Ft):Ft===mt._f.ref)return;Wn(i,J,{_f:{...mt._f,...Kt?{refs:[...re.filter(og),Ft,...Array.isArray(be(s,J))?[{}]:[]],ref:{type:Ft.type,name:J}}:{ref:Ft}}}),Z(J,!1,void 0,Ft)}else mt=be(i,J,{}),mt._f&&(mt._f.mount=!1),(t.shouldUnregister||ht.shouldUnregister)&&!(fS(u.array,J)&&l.action)&&u.unMount.add(J)}}},Zt=()=>t.shouldFocusError&&fh(i,ut,u.mount),Qt=J=>{Jr(J)&&(x.state.next({disabled:J}),fh(i,(ht,mt)=>{const Pt=be(i,mt);Pt&&(ht.disabled=Pt._f.disabled||J,Array.isArray(Pt._f.refs)&&Pt._f.refs.forEach(qt=>{qt.disabled=Pt._f.disabled||J}))},0,!1))},ne=(J,ht)=>async mt=>{let Pt;mt&&(mt.preventDefault&&mt.preventDefault(),mt.persist&&mt.persist());let qt=Vi(o);if(x.state.next({isSubmitting:!0}),t.resolver){const{errors:Ft,values:Kt}=await K();n.errors=Ft,qt=Vi(Kt)}else await G(i);if(u.disabled.size)for(const Ft of u.disabled)Li(qt,Ft);if(Li(n.errors,"root"),qa(n.errors)){x.state.next({errors:{}});try{await J(qt,mt)}catch(Ft){Pt=Ft}}else ht&&await ht({...n.errors},mt),Zt(),setTimeout(Zt);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:qa(n.errors)&&!Pt,submitCount:n.submitCount+1,errors:n.errors}),Pt)throw Pt},ie=(J,ht={})=>{be(i,J)&&(Ei(ht.defaultValue)?W(J,Vi(be(s,J))):(W(J,ht.defaultValue),Wn(s,J,Vi(ht.defaultValue))),ht.keepTouched||Li(n.touchedFields,J),ht.keepDirty||(Li(n.dirtyFields,J),n.isDirty=ht.defaultValue?D(J,Vi(be(s,J))):D()),ht.keepError||(Li(n.errors,J),m.isValid&&N()),x.state.next({...n}))},ye=(J,ht={})=>{const mt=J?Vi(J):s,Pt=Vi(mt),qt=qa(J),Ft=qt?s:Pt;if(ht.keepDefaultValues||(s=mt),!ht.keepValues){if(ht.keepDirtyValues){const Kt=new Set([...u.mount,...Object.keys(Qf(s,o))]);for(const re of Array.from(Kt))be(n.dirtyFields,re)?Wn(Ft,re,be(o,re)):W(re,be(Ft,re))}else{if(p0&&Ei(J))for(const Kt of u.mount){const re=be(i,Kt);if(re&&re._f){const fe=Array.isArray(re._f.refs)?re._f.refs[0]:re._f.ref;if(mp(fe)){const oe=fe.closest("form");if(oe){oe.reset();break}}}}if(ht.keepFieldsRef)for(const Kt of u.mount)W(Kt,be(Ft,Kt));else i={}}o=t.shouldUnregister?ht.keepDefaultValues?Vi(s):{}:Vi(Ft),x.array.next({values:{...Ft}}),x.state.next({values:{...Ft}})}u={mount:ht.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!m.isValid||!!ht.keepIsValid||!!ht.keepDirtyValues,l.watch=!!t.shouldUnregister,x.state.next({submitCount:ht.keepSubmitCount?n.submitCount:0,isDirty:qt?!1:ht.keepDirty?n.isDirty:!!(ht.keepDefaultValues&&!zl(J,s)),isSubmitted:ht.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:qt?{}:ht.keepDirtyValues?ht.keepDefaultValues&&o?Qf(s,o):n.dirtyFields:ht.keepDefaultValues&&J?Qf(s,J):ht.keepDirty?n.dirtyFields:{},touchedFields:ht.keepTouched?n.touchedFields:{},errors:ht.keepErrors?n.errors:{},isSubmitSuccessful:ht.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Bt=(J,ht)=>ye(or(J)?J(o):J,ht),ct=(J,ht={})=>{const mt=be(i,J),Pt=mt&&mt._f;if(Pt){const qt=Pt.refs?Pt.refs[0]:Pt.ref;qt.focus&&(qt.focus(),ht.shouldSelect&&or(qt.select)&&qt.select())}},me=J=>{n={...n,...J}},Xt={control:{register:Tt,unregister:At,getFieldState:gt,handleSubmit:ne,setError:q,_subscribe:rt,_runSchema:K,_focusError:Zt,_getWatch:R,_getDirty:D,_setValid:N,_setFieldArray:j,_setDisabledField:St,_setErrors:z,_getFieldArray:et,_reset:ye,_resetDefaultValues:()=>or(t.defaultValues)&&t.defaultValues().then(J=>{Bt(J,t.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:Q,_disableForm:Qt,_subjects:x,_proxyFormState:m,get _fields(){return i},get _formValues(){return o},get _state(){return l},set _state(J){l=J},get _defaultValues(){return s},get _names(){return u},set _names(J){u=J},get _formState(){return n},get _options(){return t},set _options(J){t={...t,...J}}},subscribe:at,trigger:wt,register:Tt,handleSubmit:ne,watch:$,setValue:W,getValues:Y,reset:Bt,resetField:ie,clearErrors:O,unregister:At,setError:q,setFocus:ct,getFieldState:gt};return{...Xt,formControl:Xt}}function zp(e={}){const t=Jt.useRef(void 0),n=Jt.useRef(void 0),[i,s]=Jt.useState({isDirty:!1,isValidating:!1,isLoading:or(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:or(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!or(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...u}=CS(e);t.current={...u,formState:i}}const o=t.current.control;return o._options=e,mS(()=>{const l=o._subscribe({formState:o._proxyFormState,callback:()=>s({...o._formState}),reRenderRoot:!0});return s(u=>({...u,isReady:!0})),o._formState.isReady=!0,l},[o]),Jt.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),Jt.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),Jt.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),Jt.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),Jt.useEffect(()=>{if(o._proxyFormState.isDirty){const l=o._getDirty();l!==i.isDirty&&o._subjects.state.next({isDirty:l})}},[o,i.isDirty]),Jt.useEffect(()=>{e.values&&!zl(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),n.current=e.values,s(l=>({...l}))):o._resetDefaultValues()},[o,e.values]),Jt.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=pS(i,o),t.current}function OS(){const{register:e,handleSubmit:t,formState:{errors:n}}=zp({mode:"onBlur"}),{setAuthData:i}=ot.useContext(Ya),s=Ri(),[o,l]=ot.useState(!1),u=t(async f=>{l(!0);try{f.clinic_id=f.username.split("_")[0],f.username=f.username.split("_")[1];const d=await De.post("/api/auth/login",f,{withCredentials:!0});i({clinicId:d.data.clinic_id,clinicName:d.data.clinic_name,user:d.data.user_id,username:d.data.username,usertype:d.data.usertype,isLoggedIn:!0}),Be.success("Login successful"),s("/dashboard")}catch(d){d.status===403&&(Be.error("Subscription expired"),s("/expired"));const m=d.response?.data?.messages??{},g=Object.values(m).join(", ");Be.error(g||"An error occurred")}finally{l(!1)}});return ot.useEffect(()=>{document.title="Login - Audiogram"},[]),L.jsx("div",{className:"min-h-screen flex items-center justify-center",children:L.jsxs("div",{className:"card w-full max-w-md bg-base-300 shadow-xl rounded-lg p-6 flex flex-col items-center",children:[L.jsx("h1",{className:"text-3xl font-bold text-center mb-6",children:"Login"}),L.jsxs("form",{className:"space-y-4 text-sm w-full",onSubmit:u,children:[L.jsx("p",{className:"text-xs text-center label label-text max-w-sm text-wrap",children:"Use your clinic ID and username, separated by underscore in username."}),L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Username"})}),L.jsx("input",{type:"text",placeholder:"Enter your username",className:`w-full input input-bordered ${n.username?"input-error":""}`,...e("username",{required:"Username is required",minLength:{value:3,message:"Username must be at least 3 characters"}})}),n.username&&L.jsx("p",{className:"text-error text-sm mt-1",children:n.username.message})]}),L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Password"})}),L.jsx("input",{type:"password",placeholder:"Enter your password",className:`w-full input input-bordered ${n.password?"input-error":""}`,...e("password",{required:"Password is required",minLength:{value:6,message:"Password must be at least 6 characters"}})}),n.password&&L.jsx("p",{className:"text-error text-sm mt-1",children:n.password.message})]}),o&&L.jsx("div",{className:"flex justify-center mt-8",children:L.jsx("span",{className:"loading loading-spinner"})}),L.jsx("div",{className:"form-control mt-8",children:L.jsx("button",{type:"submit",className:"btn w-full",disabled:o,children:"Login"})}),L.jsx("div",{className:"w-full flex justify-center",children:L.jsxs("p",{children:['Don"t have an account? ',L.jsx("a",{href:"/register",className:"hover:cursor-pointer",children:"Register"})]})})]})]})})}function MS(){const{register:e,handleSubmit:t,watch:n,formState:{errors:i}}=zp({mode:"onBlur"}),s=Ri(),[o,l]=ot.useState(!1),u=t(async m=>{l(!0),m={clinicData:{clinic_name:m.clinic_name,clinic_address:m.clinic_address,clinic_phone:m.clinic_phone,clinic_email:m.clinic_email},userData:{phone:m.phone_number,username:m.username,email:m.email,password:m.password,passconf:m.confirmPassword}};try{const g=await De.post("/api/auth/register",m,{withCredentials:!0});Be.success("Registered successfully, your staff ID has been sent to your email."),s("/login")}catch(g){const x=g.response?.data?.messages??{},v=Object.values(x).join(", ");Be.error(v||"An error occurred")}finally{l(!1)}}),[f,d]=ot.useState(0);return ot.useEffect(()=>{document.title="Register | Audiogram"},[]),L.jsx("div",{className:"min-h-screen flex items-center justify-center",children:L.jsxs("div",{className:"card w-full max-w-xl bg-base-300 shadow-xl rounded-lg p-6 flex flex-col items-center",children:[L.jsx("h1",{className:"text-3xl font-bold text-center mb-6",children:"Register"}),L.jsxs("form",{className:"space-y-4 text-sm w-full",onSubmit:u,children:[L.jsx("p",{hidden:f===1,className:"text-lg font-bold",children:"Clinic Details:"}),L.jsxs("div",{hidden:f===1,className:"clinic-details-section grid grid-cols-1 md:grid-cols-2 gap-4",children:[L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Clinic Name"})}),L.jsx("input",{type:"text",placeholder:"Enter your clinic name",className:`w-full input input-bordered ${i.clinic_name?"input-error":""}`,...e("clinic_name",{required:"Clinic Name is required",minLength:{value:3,message:"Clinic Name must be at least 3 characters"}})}),i.clinic_name&&L.jsx("p",{className:"text-error text-sm mt-1",children:i.clinic_name.message})]}),L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Clinic Address"})}),L.jsx("input",{type:"text",placeholder:"Enter your clinic address",className:`w-full input input-bordered ${i.clinic_address?"input-error":""}`,...e("clinic_address",{required:"Clinic Address is required",minLength:{value:3,message:"Clinic Address must be at least 3 characters"}})}),i.clinic_address&&L.jsx("p",{className:"text-error text-sm mt-1",children:i.clinic_address.message})]}),L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Clinic Phone Number"})}),L.jsx("input",{type:"text",placeholder:"Enter your clinic phone number",className:`w-full input input-bordered ${i.clinic_phone?"input-error":""}`,...e("clinic_phone",{required:"Clinic Phone Number is required",minLength:{value:3,message:"Clinic Phone Number must be at least 3 characters"}})}),i.clinic_phone&&L.jsx("p",{className:"text-error text-sm mt-1",children:i.clinic_phone.message})]}),L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Clinic Email"})}),L.jsx("input",{type:"text",placeholder:"Enter your clinic email",className:`w-full input input-bordered ${i.clinic_email?"input-error":""}`,...e("clinic_email",{required:"Clinic Email is required",minLength:{value:3,message:"Clinic Email must be at least 3 characters"}})}),i.clinic_email&&L.jsx("p",{className:"text-error text-sm mt-1",children:i.clinic_email.message})]})]}),L.jsx("p",{hidden:f===0,className:"text-lg font-bold",children:"Head User Details:"}),L.jsxs("div",{hidden:f===0,className:"clinic-details-section grid grid-cols-1 md:grid-cols-2 gap-4",children:[L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Username"})}),L.jsx("input",{type:"text",placeholder:"Enter your username",className:`w-full input input-bordered ${i.username?"input-error":""}`,...e("username",{required:"Username is required",minLength:{value:3,message:"Username must be at least 3 characters"}})}),i.username&&L.jsx("p",{className:"text-error text-sm mt-1",children:i.username.message})]}),L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Email"})}),L.jsx("input",{type:"text",placeholder:"Enter your email",className:`w-full input input-bordered ${i.email?"input-error":""}`,...e("email",{required:"Email is required",pattern:{value:/^\S+@\S+$/i,message:"Email is invalid"}})}),i.email&&L.jsx("p",{className:"text-error text-sm mt-1",children:i.email.message})]}),L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Phone Number"})}),L.jsx("input",{type:"text",placeholder:"Enter your phone number",className:`w-full input input-bordered ${i.phone_number?"input-error":""}`,...e("phone_number",{required:"Phone Number is required",minLength:{value:3,message:"Phone Number must be at least 3 characters"}})}),i.phone_number&&L.jsx("p",{className:"text-error text-sm mt-1",children:i.phone_number.message})]}),L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Password"})}),L.jsx("input",{type:"password",placeholder:"Enter your password",className:`w-full input input-bordered ${i.password?"input-error":""}`,...e("password",{required:"Password is required",minLength:{value:8,message:"Password must be at least 8 characters"}})}),i.password&&L.jsx("p",{className:"text-error text-sm mt-1",children:i.password.message})]}),L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Confirm Password"})}),L.jsx("input",{type:"password",placeholder:"Enter your password again",className:`w-full input input-bordered ${i.confirmPassword?"input-error":""}`,...e("confirmPassword",{required:"Confirm Password is required",validate:m=>m===n("password")||"Passwords do not match"})}),i.confirmPassword&&L.jsx("p",{className:"text-error text-sm mt-1",children:i.confirmPassword.message})]})]}),o&&L.jsx("div",{className:"flex justify-center mt-8",children:L.jsx("span",{className:"loading loading-spinner"})}),L.jsxs("div",{className:"form-control mt-8 grid grid-cols-2 gap-4",children:[L.jsx("button",{className:"btn w-full",onClick:()=>d(0),disabled:o||f==0,type:"button",children:"Back"}),L.jsx("button",{className:"btn w-full",onClick:()=>d(1),disabled:o||f==1,type:"button",children:"Next"})]}),L.jsx("div",{className:"form-control flex gap-4",children:L.jsx("button",{className:"btn w-full",onClick:()=>{f===0&&d(1)},disabled:o||f==0,type:"submit",hidden:f==0,children:"Register"})}),L.jsx("div",{className:"w-full flex justify-center",children:L.jsxs("p",{children:["Already have an account?"," ",L.jsx("a",{href:"/login",className:"hover:cursor-pointer",children:"Login"})]})})]})]})})}function DS(){const e=Ri();return ot.useEffect(()=>{document.title="Subscription Expired | Audiogram"}),L.jsx("div",{className:"h-screen flex justify-center items-center",children:L.jsxs("div",{className:"shadow-lg rounded-2xl bg-base-300 p-8 max-w-md text-center",children:[L.jsx("h2",{className:"text-2xl font-bold text-red-600",children:"Subscription Expired"}),L.jsxs("p",{className:"mt-4",children:["Your subscription has expired. Please contact your provider to renew your subscription.",L.jsx("br",{}),"Contact us at 03274554985",L.jsx("br",{}),"Thank you!"]}),L.jsx("button",{onClick:()=>e("/login"),className:"mt-6 btn hover:cursor-pointer",children:"Return to Login"})]})})}/*!
* @kurkle/color v0.3.4
* https://github.com/kurkle/color#readme
* (c) 2024 Jukka Kurkela
* Released under the MIT License
*/function kh(e){return e+.5|0}const Fl=(e,t,n)=>Math.max(Math.min(e,n),t);function oh(e){return Fl(kh(e*2.55),0,255)}function Ul(e){return Fl(kh(e*255),0,255)}function Uo(e){return Fl(kh(e/2.55)/100,0,1)}function j5(e){return Fl(kh(e*100),0,100)}const Ls={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},Pg=[..."0123456789ABCDEF"],RS=e=>Pg[e&15],kS=e=>Pg[(e&240)>>4]+Pg[e&15],kd=e=>(e&240)>>4===(e&15),PS=e=>kd(e.r)&&kd(e.g)&&kd(e.b)&&kd(e.a);function BS(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Ls[e[1]]*17,g:255&Ls[e[2]]*17,b:255&Ls[e[3]]*17,a:t===5?Ls[e[4]]*17:255}:(t===7||t===9)&&(n={r:Ls[e[1]]<<4|Ls[e[2]],g:Ls[e[3]]<<4|Ls[e[4]],b:Ls[e[5]]<<4|Ls[e[6]],a:t===9?Ls[e[7]]<<4|Ls[e[8]]:255})),n}const zS=(e,t)=>e<255?t(e):"";function FS(e){var t=PS(e)?RS:kS;return e?"#"+t(e.r)+t(e.g)+t(e.b)+zS(e.a,t):void 0}const qS=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function tv(e,t,n){const i=t*Math.min(n,1-n),s=(o,l=(o+e/30)%12)=>n-i*Math.max(Math.min(l-3,9-l,1),-1);return[s(0),s(8),s(4)]}function US(e,t,n){const i=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function IS(e,t,n){const i=tv(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function HS(e,t,n,i,s){return e===s?(t-n)/i+(t<n?6:0):t===s?(n-e)/i+2:(e-t)/i+4}function v0(e){const n=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(n,i,s),l=Math.min(n,i,s),u=(o+l)/2;let f,d,m;return o!==l&&(m=o-l,d=u>.5?m/(2-o-l):m/(o+l),f=HS(n,i,s,m,o),f=f*60+.5),[f|0,d||0,u]}function x0(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Ul)}function w0(e,t,n){return x0(tv,e,t,n)}function VS(e,t,n){return x0(IS,e,t,n)}function YS(e,t,n){return x0(US,e,t,n)}function ev(e){return(e%360+360)%360}function GS(e){const t=qS.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?oh(+t[5]):Ul(+t[5]));const s=ev(+t[2]),o=+t[3]/100,l=+t[4]/100;return t[1]==="hwb"?i=VS(s,o,l):t[1]==="hsv"?i=YS(s,o,l):i=w0(s,o,l),{r:i[0],g:i[1],b:i[2],a:n}}function WS(e,t){var n=v0(e);n[0]=ev(n[0]+t),n=w0(n),e.r=n[0],e.g=n[1],e.b=n[2]}function XS(e){if(!e)return;const t=v0(e),n=t[0],i=j5(t[1]),s=j5(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${Uo(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const T5={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"},C5={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 KS(){const e={},t=Object.keys(C5),n=Object.keys(T5);let i,s,o,l,u;for(i=0;i<t.length;i++){for(l=u=t[i],s=0;s<n.length;s++)o=n[s],u=u.replace(o,T5[o]);o=parseInt(C5[l],16),e[u]=[o>>16&255,o>>8&255,o&255]}return e}let Pd;function $S(e){Pd||(Pd=KS(),Pd.transparent=[0,0,0,0]);const t=Pd[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const ZS=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function QS(e){const t=ZS.exec(e);let n=255,i,s,o;if(t){if(t[7]!==i){const l=+t[7];n=t[8]?oh(l):Fl(l*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?oh(i):Fl(i,0,255)),s=255&(t[4]?oh(s):Fl(s,0,255)),o=255&(t[6]?oh(o):Fl(o,0,255)),{r:i,g:s,b:o,a:n}}}function JS(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Uo(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const lg=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Du=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function t6(e,t,n){const i=Du(Uo(e.r)),s=Du(Uo(e.g)),o=Du(Uo(e.b));return{r:Ul(lg(i+n*(Du(Uo(t.r))-i))),g:Ul(lg(s+n*(Du(Uo(t.g))-s))),b:Ul(lg(o+n*(Du(Uo(t.b))-o))),a:e.a+n*(t.a-e.a)}}function Bd(e,t,n){if(e){let i=v0(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=w0(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function nv(e,t){return e&&Object.assign(t||{},e)}function O5(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Ul(e[3]))):(t=nv(e,{r:0,g:0,b:0,a:1}),t.a=Ul(t.a)),t}function e6(e){return e.charAt(0)==="r"?QS(e):GS(e)}class wh{constructor(t){if(t instanceof wh)return t;const n=typeof t;let i;n==="object"?i=O5(t):n==="string"&&(i=BS(t)||$S(t)||e6(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=nv(this._rgb);return t&&(t.a=Uo(t.a)),t}set rgb(t){this._rgb=O5(t)}rgbString(){return this._valid?JS(this._rgb):void 0}hexString(){return this._valid?FS(this._rgb):void 0}hslString(){return this._valid?XS(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let o;const l=n===o?.5:n,u=2*l-1,f=i.a-s.a,d=((u*f===-1?u:(u+f)/(1+u*f))+1)/2;o=1-d,i.r=255&d*i.r+o*s.r+.5,i.g=255&d*i.g+o*s.g+.5,i.b=255&d*i.b+o*s.b+.5,i.a=l*i.a+(1-l)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=t6(this._rgb,t._rgb,n)),this}clone(){return new wh(this.rgb)}alpha(t){return this._rgb.a=Ul(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=kh(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.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 Bd(this._rgb,2,t),this}darken(t){return Bd(this._rgb,2,-t),this}saturate(t){return Bd(this._rgb,1,t),this}desaturate(t){return Bd(this._rgb,1,-t),this}rotate(t){return WS(this._rgb,t),this}}/*!
* Chart.js v4.5.0
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*/function Bo(){}const n6=(()=>{let e=0;return()=>e++})();function Bn(e){return e==null}function Gi(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function hn(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function js(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Kr(e,t){return js(e)?e:t}function Ze(e,t){return typeof e>"u"?t:e}const i6=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,iv=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function qn(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function xn(e,t,n,i){let s,o,l;if(Gi(e))for(o=e.length,s=0;s<o;s++)t.call(n,e[s],s);else if(hn(e))for(l=Object.keys(e),o=l.length,s=0;s<o;s++)t.call(n,e[l[s]],l[s])}function yp(e,t){let n,i,s,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(s=e[n],o=t[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function vp(e){if(Gi(e))return e.map(vp);if(hn(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let s=0;for(;s<i;++s)t[n[s]]=vp(e[n[s]]);return t}return e}function av(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function a6(e,t,n,i){if(!av(e))return;const s=t[e],o=n[e];hn(s)&&hn(o)?_h(s,o,i):t[e]=vp(o)}function _h(e,t,n){const i=Gi(t)?t:[t],s=i.length;if(!hn(e))return e;n=n||{};const o=n.merger||a6;let l;for(let u=0;u<s;++u){if(l=i[u],!hn(l))continue;const f=Object.keys(l);for(let d=0,m=f.length;d<m;++d)o(f[d],e,l,n)}return e}function hh(e,t){return _h(e,t,{merger:s6})}function s6(e,t,n){if(!av(e))return;const i=t[e],s=n[e];hn(i)&&hn(s)?hh(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=vp(s))}const M5={"":e=>e,x:e=>e.x,y:e=>e.y};function r6(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function o6(e){const t=r6(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Sh(e,t){return(M5[t]||(M5[t]=o6(t)))(e)}function _0(e){return e.charAt(0).toUpperCase()+e.slice(1)}const xp=e=>typeof e<"u",Il=e=>typeof e=="function",D5=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function l6(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const wn=Math.PI,oi=2*wn,c6=oi+wn,wp=Number.POSITIVE_INFINITY,u6=wn/180,Di=wn/2,Tc=wn/4,R5=wn*2/3,sv=Math.log10,Gu=Math.sign;function dh(e,t,n){return Math.abs(e-t)<n}function k5(e){const t=Math.round(e);e=dh(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(sv(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function f6(e){const t=[],n=Math.sqrt(e);let i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((s,o)=>s-o).pop(),t}function h6(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Nh(e){return!h6(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function d6(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function p6(e,t,n){let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Io(e){return e*(wn/180)}function m6(e){return e*(180/wn)}function P5(e){if(!js(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function rv(e,t){const n=t.x-e.x,i=t.y-e.y,s=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*wn&&(o+=oi),{angle:o,distance:s}}function Bg(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function g6(e,t){return(e-t+c6)%oi-wn}function sr(e){return(e%oi+oi)%oi}function Ah(e,t,n,i){const s=sr(e),o=sr(t),l=sr(n),u=sr(o-s),f=sr(l-s),d=sr(s-o),m=sr(s-l);return s===o||s===l||i&&o===l||u>f&&d<m}function ja(e,t,n){return Math.max(t,Math.min(n,e))}function b6(e){return ja(e,-32768,32767)}function Fu(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function S0(e,t,n){n=n||(l=>e[l]<t);let i=e.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,n(o)?s=o:i=o;return{lo:s,hi:i}}const zc=(e,t,n,i)=>S0(e,n,i?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),y6=(e,t,n)=>S0(e,n,i=>e[i][t]>=n);function v6(e,t,n){let i=0,s=e.length;for(;i<s&&e[i]<t;)i++;for(;s>i&&e[s-1]>n;)s--;return i>0||s<e.length?e.slice(i,s):e}const ov=["push","pop","shift","splice","unshift"];function x6(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ov.forEach(n=>{const i="_onData"+_0(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const l=s.apply(this,o);return e._chartjs.listeners.forEach(u=>{typeof u[i]=="function"&&u[i](...o)}),l}})})}function B5(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(ov.forEach(o=>{delete e[o]}),delete e._chartjs)}function w6(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const lv=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function cv(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,lv.call(window,()=>{i=!1,e.apply(t,n)}))}}function _6(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const N0=e=>e==="start"?"left":e==="end"?"right":"center",ma=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,S6=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function N6(e,t,n){const i=t.length;let s=0,o=i;if(e._sorted){const{iScale:l,vScale:u,_parsed:f}=e,d=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,m=l.axis,{min:g,max:x,minDefined:v,maxDefined:A}=l.getUserBounds();if(v){if(s=Math.min(zc(f,m,g).lo,n?i:zc(t,m,l.getPixelForValue(g)).lo),d){const N=f.slice(0,s+1).reverse().findIndex(E=>!Bn(E[u.axis]));s-=Math.max(0,N)}s=ja(s,0,i-1)}if(A){let N=Math.max(zc(f,l.axis,x,!0).hi+1,n?0:zc(t,m,l.getPixelForValue(x),!0).hi+1);if(d){const E=f.slice(N-1).findIndex(j=>!Bn(j[u.axis]));N+=Math.max(0,E)}o=ja(N,s,i)-s}else o=i-s}return{start:s,count:o}}function A6(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}const zd=e=>e===0||e===1,z5=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*oi/n)),F5=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*oi/n)+1,ph={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Di)+1,easeOutSine:e=>Math.sin(e*Di),easeInOutSine:e=>-.5*(Math.cos(wn*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>zd(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>zd(e)?e:z5(e,.075,.3),easeOutElastic:e=>zd(e)?e:F5(e,.075,.3),easeInOutElastic(e){return zd(e)?e:e<.5?.5*z5(e*2,.1125,.45):.5+.5*F5(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-ph.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?ph.easeInBounce(e*2)*.5:ph.easeOutBounce(e*2-1)*.5+.5};function A0(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function q5(e){return A0(e)?e:new wh(e)}function cg(e){return A0(e)?e:new wh(e).saturate(.5).darken(.1).hexString()}const L6=["x","y","borderWidth","radius","tension"],E6=["color","borderColor","backgroundColor"];function j6(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:E6},numbers:{type:"number",properties:L6}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function T6(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const U5=new Map;function C6(e,t){t=t||{};const n=e+JSON.stringify(t);let i=U5.get(n);return i||(i=new Intl.NumberFormat(e,t),U5.set(n,i)),i}function L0(e,t,n){return C6(t,n).format(e)}const O6={values(e){return Gi(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,o=e;if(n.length>1){const d=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(d<1e-4||d>1e15)&&(s="scientific"),o=M6(e,n)}const l=sv(Math.abs(o)),u=isNaN(l)?1:Math.max(Math.min(-1*Math.floor(l),20),0),f={notation:s,minimumFractionDigits:u,maximumFractionDigits:u};return Object.assign(f,this.options.ticks.format),L0(e,i,f)}};function M6(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var uv={formatters:O6};function D6(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:uv.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Hc=Object.create(null),zg=Object.create(null);function mh(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;i<s;++i){const o=n[i];e=e[o]||(e[o]=Object.create(null))}return e}function ug(e,t,n){return typeof t=="string"?_h(mh(e,t),n):_h(mh(e,""),t)}class R6{constructor(t,n){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=i=>i.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=(i,s)=>cg(s.backgroundColor),this.hoverBorderColor=(i,s)=>cg(s.borderColor),this.hoverColor=(i,s)=>cg(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return ug(this,t,n)}get(t){return mh(this,t)}describe(t,n){return ug(zg,t,n)}override(t,n){return ug(Hc,t,n)}route(t,n,i,s){const o=mh(this,t),l=mh(this,i),u="_"+n;Object.defineProperties(o,{[u]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const f=this[u],d=l[s];return hn(f)?Object.assign({},d,f):Ze(f,d)},set(f){this[u]=f}}})}apply(t){t.forEach(n=>n(this))}}var bi=new R6({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[j6,T6,D6]);function k6(e){return!e||Bn(e.size)||Bn(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function I5(e,t,n,i,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>i&&(i=o),i}function Cc(e,t,n){const i=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*i)/i+s}function H5(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Fg(e,t,n,i){fv(e,t,n,i,null)}function fv(e,t,n,i,s){let o,l,u,f,d,m,g,x;const v=t.pointStyle,A=t.rotation,N=t.radius;let E=(A||0)*u6;if(v&&typeof v=="object"&&(o=v.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(E),e.drawImage(v,-v.width/2,-v.height/2,v.width,v.height),e.restore();return}if(!(isNaN(N)||N<=0)){switch(e.beginPath(),v){default:s?e.ellipse(n,i,s/2,N,0,0,oi):e.arc(n,i,N,0,oi),e.closePath();break;case"triangle":m=s?s/2:N,e.moveTo(n+Math.sin(E)*m,i-Math.cos(E)*N),E+=R5,e.lineTo(n+Math.sin(E)*m,i-Math.cos(E)*N),E+=R5,e.lineTo(n+Math.sin(E)*m,i-Math.cos(E)*N),e.closePath();break;case"rectRounded":d=N*.516,f=N-d,l=Math.cos(E+Tc)*f,g=Math.cos(E+Tc)*(s?s/2-d:f),u=Math.sin(E+Tc)*f,x=Math.sin(E+Tc)*(s?s/2-d:f),e.arc(n-g,i-u,d,E-wn,E-Di),e.arc(n+x,i-l,d,E-Di,E),e.arc(n+g,i+u,d,E,E+Di),e.arc(n-x,i+l,d,E+Di,E+wn),e.closePath();break;case"rect":if(!A){f=Math.SQRT1_2*N,m=s?s/2:f,e.rect(n-m,i-f,2*m,2*f);break}E+=Tc;case"rectRot":g=Math.cos(E)*(s?s/2:N),l=Math.cos(E)*N,u=Math.sin(E)*N,x=Math.sin(E)*(s?s/2:N),e.moveTo(n-g,i-u),e.lineTo(n+x,i-l),e.lineTo(n+g,i+u),e.lineTo(n-x,i+l),e.closePath();break;case"crossRot":E+=Tc;case"cross":g=Math.cos(E)*(s?s/2:N),l=Math.cos(E)*N,u=Math.sin(E)*N,x=Math.sin(E)*(s?s/2:N),e.moveTo(n-g,i-u),e.lineTo(n+g,i+u),e.moveTo(n+x,i-l),e.lineTo(n-x,i+l);break;case"star":g=Math.cos(E)*(s?s/2:N),l=Math.cos(E)*N,u=Math.sin(E)*N,x=Math.sin(E)*(s?s/2:N),e.moveTo(n-g,i-u),e.lineTo(n+g,i+u),e.moveTo(n+x,i-l),e.lineTo(n-x,i+l),E+=Tc,g=Math.cos(E)*(s?s/2:N),l=Math.cos(E)*N,u=Math.sin(E)*N,x=Math.sin(E)*(s?s/2:N),e.moveTo(n-g,i-u),e.lineTo(n+g,i+u),e.moveTo(n+x,i-l),e.lineTo(n-x,i+l);break;case"line":l=s?s/2:Math.cos(E)*N,u=Math.sin(E)*N,e.moveTo(n-l,i-u),e.lineTo(n+l,i+u);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(E)*(s?s/2:N),i+Math.sin(E)*N);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Lh(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function E0(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function j0(e){e.restore()}function P6(e,t,n,i,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else s==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function B6(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function z6(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Bn(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function F6(e,t,n,i,s){if(s.strikethrough||s.underline){const o=e.measureText(i),l=t-o.actualBoundingBoxLeft,u=t+o.actualBoundingBoxRight,f=n-o.actualBoundingBoxAscent,d=n+o.actualBoundingBoxDescent,m=s.strikethrough?(f+d)/2:d;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(l,m),e.lineTo(u,m),e.stroke()}}function q6(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Eh(e,t,n,i,s,o={}){const l=Gi(t)?t:[t],u=o.strokeWidth>0&&o.strokeColor!=="";let f,d;for(e.save(),e.font=s.string,z6(e,o),f=0;f<l.length;++f)d=l[f],o.backdrop&&q6(e,o.backdrop),u&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),Bn(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(d,n,i,o.maxWidth)),e.fillText(d,n,i,o.maxWidth),F6(e,n,i,d,o),i+=Number(s.lineHeight);e.restore()}function qg(e,t){const{x:n,y:i,w:s,h:o,radius:l}=t;e.arc(n+l.topLeft,i+l.topLeft,l.topLeft,1.5*wn,wn,!0),e.lineTo(n,i+o-l.bottomLeft),e.arc(n+l.bottomLeft,i+o-l.bottomLeft,l.bottomLeft,wn,Di,!0),e.lineTo(n+s-l.bottomRight,i+o),e.arc(n+s-l.bottomRight,i+o-l.bottomRight,l.bottomRight,Di,0,!0),e.lineTo(n+s,i+l.topRight),e.arc(n+s-l.topRight,i+l.topRight,l.topRight,0,-Di,!0),e.lineTo(n+l.topLeft,i)}const U6=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,I6=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function H6(e,t){const n=(""+e).match(U6);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const V6=e=>+e||0;function T0(e,t){const n={},i=hn(t),s=i?Object.keys(t):t,o=hn(e)?i?l=>Ze(e[l],e[t[l]]):l=>e[l]:()=>e;for(const l of s)n[l]=V6(o(l));return n}function Y6(e){return T0(e,{top:"y",right:"x",bottom:"y",left:"x"})}function gh(e){return T0(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Ts(e){const t=Y6(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ya(e,t){e=e||{},t=t||bi.font;let n=Ze(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=Ze(e.style,t.style);i&&!(""+i).match(I6)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:Ze(e.family,t.family),lineHeight:H6(Ze(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:Ze(e.weight,t.weight),string:""};return s.string=k6(s),s}function Fd(e,t,n,i){let s,o,l;for(s=0,o=e.length;s<o;++s)if(l=e[s],l!==void 0&&l!==void 0)return l}function G6(e,t,n){const{min:i,max:s}=e,o=iv(t,(s-i)/2),l=(u,f)=>n&&u===0?0:u+f;return{min:l(i,-Math.abs(o)),max:l(s,o)}}function Vc(e,t){return Object.assign(Object.create(e),t)}function C0(e,t=[""],n,i,s=()=>e[0]){const o=n||e;typeof i>"u"&&(i=mv("_fallback",e));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:u=>C0([u,...e],t,o,i)};return new Proxy(l,{deleteProperty(u,f){return delete u[f],delete u._keys,delete e[0][f],!0},get(u,f){return dv(u,f,()=>tN(f,t,e,u))},getOwnPropertyDescriptor(u,f){return Reflect.getOwnPropertyDescriptor(u._scopes[0],f)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(u,f){return Y5(u).includes(f)},ownKeys(u){return Y5(u)},set(u,f,d){const m=u._storage||(u._storage=s());return u[f]=m[f]=d,delete u._keys,!0}})}function Wu(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:hv(e,i),setContext:o=>Wu(e,o,n,i),override:o=>Wu(e.override(o),t,n,i)};return new Proxy(s,{deleteProperty(o,l){return delete o[l],delete e[l],!0},get(o,l,u){return dv(o,l,()=>X6(o,l,u))},getOwnPropertyDescriptor(o,l){return o._descriptors.allKeys?Reflect.has(e,l)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,l)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,l){return Reflect.has(e,l)},ownKeys(){return Reflect.ownKeys(e)},set(o,l,u){return e[l]=u,delete o[l],!0}})}function hv(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Il(n)?n:()=>n,isIndexable:Il(i)?i:()=>i}}const W6=(e,t)=>e?e+_0(t):t,O0=(e,t)=>hn(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function dv(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function X6(e,t,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:l}=e;let u=i[t];return Il(u)&&l.isScriptable(t)&&(u=K6(t,u,e,n)),Gi(u)&&u.length&&(u=$6(t,u,e,l.isIndexable)),O0(t,u)&&(u=Wu(u,s,o&&o[t],l)),u}function K6(e,t,n,i){const{_proxy:s,_context:o,_subProxy:l,_stack:u}=n;if(u.has(e))throw new Error("Recursion detected: "+Array.from(u).join("->")+"->"+e);u.add(e);let f=t(o,l||i);return u.delete(e),O0(e,f)&&(f=M0(s._scopes,s,e,f)),f}function $6(e,t,n,i){const{_proxy:s,_context:o,_subProxy:l,_descriptors:u}=n;if(typeof o.index<"u"&&i(e))return t[o.index%t.length];if(hn(t[0])){const f=t,d=s._scopes.filter(m=>m!==f);t=[];for(const m of f){const g=M0(d,s,e,m);t.push(Wu(g,o,l&&l[e],u))}}return t}function pv(e,t,n){return Il(e)?e(t,n):e}const Z6=(e,t)=>e===!0?t:typeof e=="string"?Sh(t,e):void 0;function Q6(e,t,n,i,s){for(const o of t){const l=Z6(n,o);if(l){e.add(l);const u=pv(l._fallback,n,s);if(typeof u<"u"&&u!==n&&u!==i)return u}else if(l===!1&&typeof i<"u"&&n!==i)return null}return!1}function M0(e,t,n,i){const s=t._rootScopes,o=pv(t._fallback,n,i),l=[...e,...s],u=new Set;u.add(i);let f=V5(u,l,n,o||n,i);return f===null||typeof o<"u"&&o!==n&&(f=V5(u,l,o,f,i),f===null)?!1:C0(Array.from(u),[""],s,o,()=>J6(t,n,i))}function V5(e,t,n,i,s){for(;n;)n=Q6(e,t,n,i,s);return n}function J6(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return Gi(s)&&hn(n)?n:s||{}}function tN(e,t,n,i){let s;for(const o of t)if(s=mv(W6(o,e),n),typeof s<"u")return O0(e,s)?M0(n,i,e,s):s}function mv(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function Y5(e){let t=e._keys;return t||(t=e._keys=eN(e._scopes)),t}function eN(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}const nN=Number.EPSILON||1e-14,Xu=(e,t)=>t<e.length&&!e[t].skip&&e[t],gv=e=>e==="x"?"y":"x";function iN(e,t,n,i){const s=e.skip?t:e,o=t,l=n.skip?t:n,u=Bg(o,s),f=Bg(l,o);let d=u/(u+f),m=f/(u+f);d=isNaN(d)?0:d,m=isNaN(m)?0:m;const g=i*d,x=i*m;return{previous:{x:o.x-g*(l.x-s.x),y:o.y-g*(l.y-s.y)},next:{x:o.x+x*(l.x-s.x),y:o.y+x*(l.y-s.y)}}}function aN(e,t,n){const i=e.length;let s,o,l,u,f,d=Xu(e,0);for(let m=0;m<i-1;++m)if(f=d,d=Xu(e,m+1),!(!f||!d)){if(dh(t[m],0,nN)){n[m]=n[m+1]=0;continue}s=n[m]/t[m],o=n[m+1]/t[m],u=Math.pow(s,2)+Math.pow(o,2),!(u<=9)&&(l=3/Math.sqrt(u),n[m]=s*l*t[m],n[m+1]=o*l*t[m])}}function sN(e,t,n="x"){const i=gv(n),s=e.length;let o,l,u,f=Xu(e,0);for(let d=0;d<s;++d){if(l=u,u=f,f=Xu(e,d+1),!u)continue;const m=u[n],g=u[i];l&&(o=(m-l[n])/3,u[`cp1${n}`]=m-o,u[`cp1${i}`]=g-o*t[d]),f&&(o=(f[n]-m)/3,u[`cp2${n}`]=m+o,u[`cp2${i}`]=g+o*t[d])}}function rN(e,t="x"){const n=gv(t),i=e.length,s=Array(i).fill(0),o=Array(i);let l,u,f,d=Xu(e,0);for(l=0;l<i;++l)if(u=f,f=d,d=Xu(e,l+1),!!f){if(d){const m=d[t]-f[t];s[l]=m!==0?(d[n]-f[n])/m:0}o[l]=u?d?Gu(s[l-1])!==Gu(s[l])?0:(s[l-1]+s[l])/2:s[l-1]:s[l]}aN(e,s,o),sN(e,o,t)}function qd(e,t,n){return Math.max(Math.min(e,n),t)}function oN(e,t){let n,i,s,o,l,u=Lh(e[0],t);for(n=0,i=e.length;n<i;++n)l=o,o=u,u=n<i-1&&Lh(e[n+1],t),o&&(s=e[n],l&&(s.cp1x=qd(s.cp1x,t.left,t.right),s.cp1y=qd(s.cp1y,t.top,t.bottom)),u&&(s.cp2x=qd(s.cp2x,t.left,t.right),s.cp2y=qd(s.cp2y,t.top,t.bottom)))}function lN(e,t,n,i,s){let o,l,u,f;if(t.spanGaps&&(e=e.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")rN(e,s);else{let d=i?e[e.length-1]:e[0];for(o=0,l=e.length;o<l;++o)u=e[o],f=iN(d,u,e[Math.min(o+1,l-(i?0:1))%l],t.tension),u.cp1x=f.previous.x,u.cp1y=f.previous.y,u.cp2x=f.next.x,u.cp2y=f.next.y,d=u}t.capBezierPoints&&oN(e,n)}function D0(){return typeof window<"u"&&typeof document<"u"}function R0(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function _p(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}const Fp=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function cN(e,t){return Fp(e).getPropertyValue(t)}const uN=["top","right","bottom","left"];function qc(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=uN[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const fN=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function hN(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i;let l=!1,u,f;if(fN(s,o,e.target))u=s,f=o;else{const d=t.getBoundingClientRect();u=i.clientX-d.left,f=i.clientY-d.top,l=!0}return{x:u,y:f,box:l}}function Mc(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=Fp(n),o=s.boxSizing==="border-box",l=qc(s,"padding"),u=qc(s,"border","width"),{x:f,y:d,box:m}=hN(e,n),g=l.left+(m&&u.left),x=l.top+(m&&u.top);let{width:v,height:A}=t;return o&&(v-=l.width+u.width,A-=l.height+u.height),{x:Math.round((f-g)/v*n.width/i),y:Math.round((d-x)/A*n.height/i)}}function dN(e,t,n){let i,s;if(t===void 0||n===void 0){const o=e&&R0(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const l=o.getBoundingClientRect(),u=Fp(o),f=qc(u,"border","width"),d=qc(u,"padding");t=l.width-d.width-f.width,n=l.height-d.height-f.height,i=_p(u.maxWidth,o,"clientWidth"),s=_p(u.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||wp,maxHeight:s||wp}}const Ud=e=>Math.round(e*10)/10;function pN(e,t,n,i){const s=Fp(e),o=qc(s,"margin"),l=_p(s.maxWidth,e,"clientWidth")||wp,u=_p(s.maxHeight,e,"clientHeight")||wp,f=dN(e,t,n);let{width:d,height:m}=f;if(s.boxSizing==="content-box"){const x=qc(s,"border","width"),v=qc(s,"padding");d-=v.width+x.width,m-=v.height+x.height}return d=Math.max(0,d-o.width),m=Math.max(0,i?d/i:m-o.height),d=Ud(Math.min(d,l,f.maxWidth)),m=Ud(Math.min(m,u,f.maxHeight)),d&&!m&&(m=Ud(d/2)),(t!==void 0||n!==void 0)&&i&&f.height&&m>f.height&&(m=f.height,d=Ud(Math.floor(m*i))),{width:d,height:m}}function G5(e,t,n){const i=t||1,s=Math.floor(e.height*i),o=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const l=e.canvas;return l.style&&(n||!l.style.height&&!l.style.width)&&(l.style.height=`${e.height}px`,l.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||l.height!==s||l.width!==o?(e.currentDevicePixelRatio=i,l.height=s,l.width=o,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const mN=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};D0()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function W5(e,t){const n=cN(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Dc(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function gN(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function bN(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},l=Dc(e,s,n),u=Dc(s,o,n),f=Dc(o,t,n),d=Dc(l,u,n),m=Dc(u,f,n);return Dc(d,m,n)}const yN=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},vN=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Uu(e,t,n){return e?yN(t,n):vN()}function bv(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function yv(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function vv(e){return e==="angle"?{between:Ah,compare:g6,normalize:sr}:{between:Fu,compare:(t,n)=>t-n,normalize:t=>t}}function X5({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function xN(e,t,n){const{property:i,start:s,end:o}=n,{between:l,normalize:u}=vv(i),f=t.length;let{start:d,end:m,loop:g}=e,x,v;if(g){for(d+=f,m+=f,x=0,v=f;x<v&&l(u(t[d%f][i]),s,o);++x)d--,m--;d%=f,m%=f}return m<d&&(m+=f),{start:d,end:m,loop:g,style:e.style}}function wN(e,t,n){if(!n)return[e];const{property:i,start:s,end:o}=n,l=t.length,{compare:u,between:f,normalize:d}=vv(i),{start:m,end:g,loop:x,style:v}=xN(e,t,n),A=[];let N=!1,E=null,j,C,z;const Z=()=>f(s,z,j)&&u(s,z)!==0,I=()=>u(o,j)===0||f(o,z,j),st=()=>N||Z(),K=()=>!N||I();for(let H=m,G=m;H<=g;++H)C=t[H%l],!C.skip&&(j=d(C[i]),j!==z&&(N=f(j,s,o),E===null&&st()&&(E=u(j,s)===0?H:G),E!==null&&K()&&(A.push(X5({start:E,end:H,loop:x,count:l,style:v})),E=null),G=H,z=j));return E!==null&&A.push(X5({start:E,end:g,loop:x,count:l,style:v})),A}function _N(e,t){const n=[],i=e.segments;for(let s=0;s<i.length;s++){const o=wN(i[s],e.points,t);o.length&&n.push(...o)}return n}function SN(e,t,n,i){let s=0,o=t-1;if(n&&!i)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function NN(e,t,n,i){const s=e.length,o=[];let l=t,u=e[t],f;for(f=t+1;f<=n;++f){const d=e[f%s];d.skip||d.stop?u.skip||(i=!1,o.push({start:t%s,end:(f-1)%s,loop:i}),t=l=d.stop?f:null):(l=f,u.skip&&(t=f)),u=d}return l!==null&&o.push({start:t%s,end:l%s,loop:i}),o}function AN(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:l,end:u}=SN(n,s,o,i);if(i===!0)return K5(e,[{start:l,end:u,loop:o}],n,t);const f=u<l?u+s:u,d=!!e._fullLoop&&l===0&&u===s-1;return K5(e,NN(n,l,f,d),n,t)}function K5(e,t,n,i){return!i||!i.setContext||!n?t:LN(e,t,n,i)}function LN(e,t,n,i){const s=e._chart.getContext(),o=$5(e.options),{_datasetIndex:l,options:{spanGaps:u}}=e,f=n.length,d=[];let m=o,g=t[0].start,x=g;function v(A,N,E,j){const C=u?-1:1;if(A!==N){for(A+=f;n[A%f].skip;)A-=C;for(;n[N%f].skip;)N+=C;A%f!==N%f&&(d.push({start:A%f,end:N%f,loop:E,style:j}),m=j,g=N%f)}}for(const A of t){g=u?g:A.start;let N=n[g%f],E;for(x=g+1;x<=A.end;x++){const j=n[x%f];E=$5(i.setContext(Vc(s,{type:"segment",p0:N,p1:j,p0DataIndex:(x-1)%f,p1DataIndex:x%f,datasetIndex:l}))),EN(E,m)&&v(g,x-1,A.loop,m),N=j,m=E}g<x-1&&v(g,x-1,A.loop,m)}return d}function $5(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function EN(e,t){if(!t)return!1;const n=[],i=function(s,o){return A0(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function Id(e,t,n){return e.options.clip?e[n]:t[n]}function jN(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:Id(n,t,"left"),right:Id(n,t,"right"),top:Id(i,t,"top"),bottom:Id(i,t,"bottom")}:t}function TN(e,t){const n=t._clip;if(n.disabled)return!1;const i=jN(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}/*!
* Chart.js v4.5.0
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*/class CN{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){const o=n.listeners[s],l=n.duration;o.forEach(u=>u({chart:t,initial:n.initial,numSteps:l,currentStep:Math.min(i-n.start,l)}))}_refresh(){this._request||(this._running=!0,this._request=lv.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let l=o.length-1,u=!1,f;for(;l>=0;--l)f=o[l],f._active?(f._total>i.duration&&(i.duration=f._total),f.tick(t),u=!0):(o[l]=o[o.length-1],o.pop());u&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Fo=new CN;const Z5="transparent",ON={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=q5(e||Z5),s=i.valid&&q5(t||Z5);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class MN{constructor(t,n,i,s){const o=n[i];s=Fd([t.to,s,o,t.from]);const l=Fd([t.from,o,s]);this._active=!0,this._fn=t.fn||ON[t.type||typeof l],this._easing=ph[t.easing]||ph.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=l,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,l=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(l,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Fd([t.to,n,s,t.from]),this._from=Fd([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,o=this._from,l=this._loop,u=this._to;let f;if(this._active=o!==u&&(l||n<i),!this._active){this._target[s]=u,this._notify(!0);return}if(n<0){this._target[s]=o;return}f=n/i%2,f=l&&f>1?2-f:f,f=this._easing(Math.min(1,Math.max(0,f))),this._target[s]=this._fn(o,u,f)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}}class xv{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!hn(t))return;const n=Object.keys(bi.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!hn(o))return;const l={};for(const u of n)l[u]=o[u];(Gi(o.properties)&&o.properties||[s]).forEach(u=>{(u===s||!i.has(u))&&i.set(u,l)})})}_animateOptions(t,n){const i=n.options,s=RN(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&DN(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),l=Object.keys(n),u=Date.now();let f;for(f=l.length-1;f>=0;--f){const d=l[f];if(d.charAt(0)==="$")continue;if(d==="options"){s.push(...this._animateOptions(t,n));continue}const m=n[d];let g=o[d];const x=i.get(d);if(g)if(x&&g.active()){g.update(x,m,u);continue}else g.cancel();if(!x||!x.duration){t[d]=m;continue}o[d]=g=new MN(x,t,d,m),s.push(g)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return Fo.add(this._chart,i),!0}}function DN(e,t){const n=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=e[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function RN(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Q5(e,t){const n=e&&e.options||{},i=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function kN(e,t,n){if(n===!1)return!1;const i=Q5(e,n),s=Q5(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function PN(e){let t,n,i,s;return hn(e)?(t=e.top,n=e.right,i=e.bottom,s=e.left):t=n=i=s=e,{top:t,right:n,bottom:i,left:s,disabled:e===!1}}function wv(e,t){const n=[],i=e._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function J5(e,t,n,i={}){const s=e.keys,o=i.mode==="single";let l,u,f,d;if(t===null)return;let m=!1;for(l=0,u=s.length;l<u;++l){if(f=+s[l],f===n){if(m=!0,i.all)continue;break}d=e.values[f],js(d)&&(o||t===0||Gu(t)===Gu(d))&&(t+=d)}return!m&&!i.all?0:t}function BN(e,t){const{iScale:n,vScale:i}=t,s=n.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",l=Object.keys(e),u=new Array(l.length);let f,d,m;for(f=0,d=l.length;f<d;++f)m=l[f],u[f]={[s]:m,[o]:e[m]};return u}function fg(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function zN(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function FN(e){const{min:t,max:n,minDefined:i,maxDefined:s}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function qN(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function tb(e,t,n,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function eb(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:l,index:u}=i,f=o.axis,d=l.axis,m=zN(o,l,i),g=t.length;let x;for(let v=0;v<g;++v){const A=t[v],{[f]:N,[d]:E}=A,j=A._stacks||(A._stacks={});x=j[d]=qN(s,m,N),x[u]=E,x._top=tb(x,l,!0,i.type),x._bottom=tb(x,l,!1,i.type);const C=x._visualValues||(x._visualValues={});C[u]=E}}function hg(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function UN(e,t){return Vc(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function IN(e,t,n){return Vc(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function th(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][n]===void 0)return;delete o[i][n],o[i]._visualValues!==void 0&&o[i]._visualValues[n]!==void 0&&delete o[i]._visualValues[n]}}}const dg=e=>e==="reset"||e==="none",nb=(e,t)=>t?e:Object.assign({},e),HN=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:wv(n,!0),values:null};class k0{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=fg(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&th(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(g,x,v,A)=>g==="x"?x:g==="r"?A:v,o=n.xAxisID=Ze(i.xAxisID,hg(t,"x")),l=n.yAxisID=Ze(i.yAxisID,hg(t,"y")),u=n.rAxisID=Ze(i.rAxisID,hg(t,"r")),f=n.indexAxis,d=n.iAxisID=s(f,o,l,u),m=n.vAxisID=s(f,l,o,u);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(l),n.rScale=this.getScaleForId(u),n.iScale=this.getScaleForId(d),n.vScale=this.getScaleForId(m)}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 n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&B5(this._data,this),t._stacked&&th(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(hn(n)){const s=this._cachedMeta;this._data=BN(n,s)}else if(i!==n){if(i){B5(i,this);const s=this._cachedMeta;th(s),s._parsed=[]}n&&Object.isExtensible(n)&&x6(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=fg(n.vScale,n),n.stack!==i.stack&&(s=!0,th(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(eb(this,n._parsed),n._stacked=fg(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:l}=i,u=o.axis;let f=t===0&&n===s.length?!0:i._sorted,d=t>0&&i._parsed[t-1],m,g,x;if(this._parsing===!1)i._parsed=s,i._sorted=!0,x=s;else{Gi(s[t])?x=this.parseArrayData(i,s,t,n):hn(s[t])?x=this.parseObjectData(i,s,t,n):x=this.parsePrimitiveData(i,s,t,n);const v=()=>g[u]===null||d&&g[u]<d[u];for(m=0;m<n;++m)i._parsed[m+t]=g=x[m],f&&(v()&&(f=!1),d=g);i._sorted=f}l&&eb(this,x)}parsePrimitiveData(t,n,i,s){const{iScale:o,vScale:l}=t,u=o.axis,f=l.axis,d=o.getLabels(),m=o===l,g=new Array(s);let x,v,A;for(x=0,v=s;x<v;++x)A=x+i,g[x]={[u]:m||o.parse(d[A],A),[f]:l.parse(n[A],A)};return g}parseArrayData(t,n,i,s){const{xScale:o,yScale:l}=t,u=new Array(s);let f,d,m,g;for(f=0,d=s;f<d;++f)m=f+i,g=n[m],u[f]={x:o.parse(g[0],m),y:l.parse(g[1],m)};return u}parseObjectData(t,n,i,s){const{xScale:o,yScale:l}=t,{xAxisKey:u="x",yAxisKey:f="y"}=this._parsing,d=new Array(s);let m,g,x,v;for(m=0,g=s;m<g;++m)x=m+i,v=n[x],d[m]={x:o.parse(Sh(v,u),x),y:l.parse(Sh(v,f),x)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const s=this.chart,o=this._cachedMeta,l=n[t.axis],u={keys:wv(s,!0),values:n._stacks[t.axis]._visualValues};return J5(u,l,o.index,{mode:i})}updateRangeFromParsed(t,n,i,s){const o=i[n.axis];let l=o===null?NaN:o;const u=s&&i._stacks[n.axis];s&&u&&(s.values=u,l=J5(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,l),t.max=Math.max(t.max,l)}getMinMax(t,n){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,l=s.length,u=this._getOtherScale(t),f=HN(n,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:m,max:g}=FN(u);let x,v;function A(){v=s[x];const N=v[u.axis];return!js(v[t.axis])||m>N||g<N}for(x=0;x<l&&!(!A()&&(this.updateRangeFromParsed(d,t,v,f),o));++x);if(o){for(x=l-1;x>=0;--x)if(!A()){this.updateRangeFromParsed(d,t,v,f);break}}return d}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,o,l;for(s=0,o=n.length;s<o;++s)l=n[s][t.axis],js(l)&&i.push(l);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,i=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=PN(Ze(this.options.clip,kN(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,i=this._cachedMeta,s=i.data||[],o=n.chartArea,l=[],u=this._drawStart||0,f=this._drawCount||s.length-u,d=this.options.drawActiveElementsOnTop;let m;for(i.dataset&&i.dataset.draw(t,o,u,f),m=u;m<u+f;++m){const g=s[m];g.hidden||(g.active&&d?l.push(g):g.draw(t,o))}for(m=0;m<l.length;++m)l[m].draw(t,o)}getStyle(t,n){const i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const l=this._cachedMeta.data[t];o=l.$context||(l.$context=IN(this.getContext(),t,l)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=UN(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){const s=n==="active",o=this._cachedDataOpts,l=t+"-"+n,u=o[l],f=this.enableOptionSharing&&xp(i);if(u)return nb(u,f);const d=this.chart.config,m=d.datasetElementScopeKeys(this._type,t),g=s?[`${t}Hover`,"hover",t,""]:[t,""],x=d.getOptionScopes(this.getDataset(),m),v=Object.keys(bi.elements[t]),A=()=>this.getContext(i,s,n),N=d.resolveNamedOptions(x,v,A,g);return N.$shared&&(N.$shared=f,o[l]=Object.freeze(nb(N,f))),N}_resolveAnimations(t,n,i){const s=this.chart,o=this._cachedDataOpts,l=`animation-${n}`,u=o[l];if(u)return u;let f;if(s.options.animation!==!1){const m=this.chart.config,g=m.datasetAnimationScopeKeys(this._type,n),x=m.getOptionScopes(this.getDataset(),g);f=m.createResolver(x,this.getContext(t,i,n))}const d=new xv(s,f&&f.animations);return f&&f._cacheable&&(o[l]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||dg(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(i),l=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:l}}updateElement(t,n,i,s){dg(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!dg(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"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 n=this._data,i=this._cachedMeta.data;for(const[u,f,d]of this._syncList)this[u](f,d);this._syncList=[];const s=i.length,o=n.length,l=Math.min(o,s);l&&this.parse(0,l),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,i=!0){const s=this._cachedMeta,o=s.data,l=t+n;let u;const f=d=>{for(d.length+=n,u=d.length-1;u>=l;u--)d[u]=d[u-n]};for(f(o),u=t;u<l;++u)o[u]=new this.dataElementType;this._parsing&&f(s._parsed),this.parse(t,n),i&&this.updateElements(o,t,n,"reset")}updateElements(t,n,i,s){}_removeElements(t,n){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,n);i._stacked&&th(i,s)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,s]=t;this[n](i,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,n){n&&this._sync(["_removeElements",t,n]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function VN(e,t,n){let i=1,s=1,o=0,l=0;if(t<oi){const u=e,f=u+t,d=Math.cos(u),m=Math.sin(u),g=Math.cos(f),x=Math.sin(f),v=(z,Z,I)=>Ah(z,u,f,!0)?1:Math.max(Z,Z*n,I,I*n),A=(z,Z,I)=>Ah(z,u,f,!0)?-1:Math.min(Z,Z*n,I,I*n),N=v(0,d,g),E=v(Di,m,x),j=A(wn,d,g),C=A(wn+Di,m,x);i=(N-j)/2,s=(E-C)/2,o=-(N+j)/2,l=-(E+C)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:l}}class YN extends k0{static id="doughnut";static 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"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((o,l)=>{const f=t.getDatasetMeta(0).controller.getStyle(l);return{text:o,fillStyle:f.backgroundColor,strokeStyle:f.borderColor,fontColor:s,lineWidth:f.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(l),index:l}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=f=>+i[f];if(hn(i[t])){const{key:f="value"}=this._parsing;o=d=>+Sh(i[d],f)}let l,u;for(l=t,u=t+n;l<u;++l)s._parsed[l]=o(l)}}_getRotation(){return Io(this.options.rotation-90)}_getCircumference(){return Io(this.options.circumference)}_getRotationExtents(){let t=oi,n=-oi;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),l=s._getCircumference();t=Math.min(t,o),n=Math.max(n,o+l)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:i}=n,s=this._cachedMeta,o=s.data,l=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,u=Math.max((Math.min(i.width,i.height)-l)/2,0),f=Math.min(i6(this.options.cutout,u),1),d=this._getRingWeight(this.index),{circumference:m,rotation:g}=this._getRotationExtents(),{ratioX:x,ratioY:v,offsetX:A,offsetY:N}=VN(g,m,f),E=(i.width-l)/x,j=(i.height-l)/v,C=Math.max(Math.min(E,j)/2,0),z=iv(this.options.radius,C),Z=Math.max(z*f,0),I=(z-Z)/this._getVisibleDatasetWeightTotal();this.offsetX=A*z,this.offsetY=N*z,s.total=this.calculateTotal(),this.outerRadius=z-I*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-I*d,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/oi)}updateElements(t,n,i,s){const o=s==="reset",l=this.chart,u=l.chartArea,d=l.options.animation,m=(u.left+u.right)/2,g=(u.top+u.bottom)/2,x=o&&d.animateScale,v=x?0:this.innerRadius,A=x?0:this.outerRadius,{sharedOptions:N,includeOptions:E}=this._getSharedOptions(n,s);let j=this._getRotation(),C;for(C=0;C<n;++C)j+=this._circumference(C,o);for(C=n;C<n+i;++C){const z=this._circumference(C,o),Z=t[C],I={x:m+this.offsetX,y:g+this.offsetY,startAngle:j,endAngle:j+z,circumference:z,outerRadius:A,innerRadius:v};E&&(I.options=N||this.resolveDataElementOptions(C,Z.active?"active":s)),j+=z,this.updateElement(Z,C,I,s)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let i=0,s;for(s=0;s<n.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?oi*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=L0(n._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,o,l,u,f;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){l=i.getDatasetMeta(s),t=l.data,u=l.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)f=u.resolveDataElementOptions(s),f.borderAlign!=="inner"&&(n=Math.max(n,f.borderWidth||0,f.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,s=t.length;i<s;++i){const o=this.resolveDataElementOptions(i);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(t){return Math.max(Ze(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class GN extends k0{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,l=this.chart._animationsDisabled;let{start:u,count:f}=N6(n,s,l);this._drawStart=u,this._drawCount=f,A6(n)&&(u=0,f=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!l,options:d},t),this.updateElements(s,u,f,t)}updateElements(t,n,i,s){const o=s==="reset",{iScale:l,vScale:u,_stacked:f,_dataset:d}=this._cachedMeta,{sharedOptions:m,includeOptions:g}=this._getSharedOptions(n,s),x=l.axis,v=u.axis,{spanGaps:A,segment:N}=this.options,E=Nh(A)?A:Number.POSITIVE_INFINITY,j=this.chart._animationsDisabled||o||s==="none",C=n+i,z=t.length;let Z=n>0&&this.getParsed(n-1);for(let I=0;I<z;++I){const st=t[I],K=j?st:{};if(I<n||I>=C){K.skip=!0;continue}const H=this.getParsed(I),G=Bn(H[v]),Q=K[x]=l.getPixelForValue(H[x],I),D=K[v]=o||G?u.getBasePixel():u.getPixelForValue(f?this.applyStack(u,H,f):H[v],I);K.skip=isNaN(Q)||isNaN(D)||G,K.stop=I>0&&Math.abs(H[x]-Z[x])>E,N&&(K.parsed=H,K.raw=d.data[I]),g&&(K.options=m||this.resolveDataElementOptions(I,st.active?"active":s)),j||this.updateElement(st,I,K,s),Z=H}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),l=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,l)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function Oc(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class P0{static override(t){Object.assign(P0.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Oc()}parse(){return Oc()}format(){return Oc()}add(){return Oc()}diff(){return Oc()}startOf(){return Oc()}endOf(){return Oc()}}var WN={_date:P0};function XN(e,t,n,i){const{controller:s,data:o,_sorted:l}=e,u=s._cachedMeta.iScale,f=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(u&&t===u.axis&&t!=="r"&&l&&o.length){const d=u._reversePixels?y6:zc;if(i){if(s._sharedOptions){const m=o[0],g=typeof m.getRange=="function"&&m.getRange(t);if(g){const x=d(o,t,n-g),v=d(o,t,n+g);return{lo:x.lo,hi:v.hi}}}}else{const m=d(o,t,n);if(f){const{vScale:g}=s._cachedMeta,{_parsed:x}=e,v=x.slice(0,m.lo+1).reverse().findIndex(N=>!Bn(N[g.axis]));m.lo-=Math.max(0,v);const A=x.slice(m.hi).findIndex(N=>!Bn(N[g.axis]));m.hi+=Math.max(0,A)}return m}}return{lo:0,hi:o.length-1}}function qp(e,t,n,i,s){const o=e.getSortedVisibleDatasetMetas(),l=n[t];for(let u=0,f=o.length;u<f;++u){const{index:d,data:m}=o[u],{lo:g,hi:x}=XN(o[u],t,l,s);for(let v=g;v<=x;++v){const A=m[v];A.skip||i(A,d,v)}}}function KN(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,s){const o=t?Math.abs(i.x-s.x):0,l=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(l,2))}}function pg(e,t,n,i,s){const o=[];return!s&&!e.isPointInArea(t)||qp(e,n,t,function(u,f,d){!s&&!Lh(u,e.chartArea,0)||u.inRange(t.x,t.y,i)&&o.push({element:u,datasetIndex:f,index:d})},!0),o}function $N(e,t,n,i){let s=[];function o(l,u,f){const{startAngle:d,endAngle:m}=l.getProps(["startAngle","endAngle"],i),{angle:g}=rv(l,{x:t.x,y:t.y});Ah(g,d,m)&&s.push({element:l,datasetIndex:u,index:f})}return qp(e,n,t,o),s}function ZN(e,t,n,i,s,o){let l=[];const u=KN(n);let f=Number.POSITIVE_INFINITY;function d(m,g,x){const v=m.inRange(t.x,t.y,s);if(i&&!v)return;const A=m.getCenterPoint(s);if(!(!!o||e.isPointInArea(A))&&!v)return;const E=u(t,A);E<f?(l=[{element:m,datasetIndex:g,index:x}],f=E):E===f&&l.push({element:m,datasetIndex:g,index:x})}return qp(e,n,t,d),l}function mg(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?$N(e,t,n,s):ZN(e,t,n,i,s,o)}function ib(e,t,n,i,s){const o=[],l=n==="x"?"inXRange":"inYRange";let u=!1;return qp(e,n,t,(f,d,m)=>{f[l]&&f[l](t[n],s)&&(o.push({element:f,datasetIndex:d,index:m}),u=u||f.inRange(t.x,t.y,s))}),i&&!u?[]:o}var QN={modes:{index(e,t,n,i){const s=Mc(t,e),o=n.axis||"x",l=n.includeInvisible||!1,u=n.intersect?pg(e,s,o,i,l):mg(e,s,o,!1,i,l),f=[];return u.length?(e.getSortedVisibleDatasetMetas().forEach(d=>{const m=u[0].index,g=d.data[m];g&&!g.skip&&f.push({element:g,datasetIndex:d.index,index:m})}),f):[]},dataset(e,t,n,i){const s=Mc(t,e),o=n.axis||"xy",l=n.includeInvisible||!1;let u=n.intersect?pg(e,s,o,i,l):mg(e,s,o,!1,i,l);if(u.length>0){const f=u[0].datasetIndex,d=e.getDatasetMeta(f).data;u=[];for(let m=0;m<d.length;++m)u.push({element:d[m],datasetIndex:f,index:m})}return u},point(e,t,n,i){const s=Mc(t,e),o=n.axis||"xy",l=n.includeInvisible||!1;return pg(e,s,o,i,l)},nearest(e,t,n,i){const s=Mc(t,e),o=n.axis||"xy",l=n.includeInvisible||!1;return mg(e,s,o,n.intersect,i,l)},x(e,t,n,i){const s=Mc(t,e);return ib(e,s,"x",n.intersect,i)},y(e,t,n,i){const s=Mc(t,e);return ib(e,s,"y",n.intersect,i)}}};const _v=["left","top","right","bottom"];function eh(e,t){return e.filter(n=>n.pos===t)}function ab(e,t){return e.filter(n=>_v.indexOf(n.pos)===-1&&n.box.axis===t)}function nh(e,t){return e.sort((n,i)=>{const s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function JN(e){const t=[];let n,i,s,o,l,u;for(n=0,i=(e||[]).length;n<i;++n)s=e[n],{position:o,options:{stack:l,stackWeight:u=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:l&&o+l,stackWeight:u});return t}function tA(e){const t={};for(const n of e){const{stack:i,pos:s,stackWeight:o}=n;if(!i||!_v.includes(s))continue;const l=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});l.count++,l.weight+=o}return t}function eA(e,t){const n=tA(e),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,l,u;for(o=0,l=e.length;o<l;++o){u=e[o];const{fullSize:f}=u.box,d=n[u.stack],m=d&&u.stackWeight/d.weight;u.horizontal?(u.width=m?m*i:f&&t.availableWidth,u.height=s):(u.width=i,u.height=m?m*s:f&&t.availableHeight)}return n}function nA(e){const t=JN(e),n=nh(t.filter(d=>d.box.fullSize),!0),i=nh(eh(t,"left"),!0),s=nh(eh(t,"right")),o=nh(eh(t,"top"),!0),l=nh(eh(t,"bottom")),u=ab(t,"x"),f=ab(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(f).concat(l).concat(u),chartArea:eh(t,"chartArea"),vertical:i.concat(s).concat(f),horizontal:o.concat(l).concat(u)}}function sb(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function Sv(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function iA(e,t,n,i){const{pos:s,box:o}=n,l=e.maxPadding;if(!hn(s)){n.size&&(e[s]-=n.size);const g=i[n.stack]||{size:0,count:1};g.size=Math.max(g.size,n.horizontal?o.height:o.width),n.size=g.size/g.count,e[s]+=n.size}o.getPadding&&Sv(l,o.getPadding());const u=Math.max(0,t.outerWidth-sb(l,e,"left","right")),f=Math.max(0,t.outerHeight-sb(l,e,"top","bottom")),d=u!==e.w,m=f!==e.h;return e.w=u,e.h=f,n.horizontal?{same:d,other:m}:{same:m,other:d}}function aA(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function sA(e,t){const n=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(l=>{o[l]=Math.max(t[l],n[l])}),o}return i(e?["left","right"]:["top","bottom"])}function lh(e,t,n,i){const s=[];let o,l,u,f,d,m;for(o=0,l=e.length,d=0;o<l;++o){u=e[o],f=u.box,f.update(u.width||t.w,u.height||t.h,sA(u.horizontal,t));const{same:g,other:x}=iA(t,n,u,i);d|=g&&s.length,m=m||x,f.fullSize||s.push(u)}return d&&lh(s,t,n,i)||m}function Hd(e,t,n,i,s){e.top=n,e.left=t,e.right=t+i,e.bottom=n+s,e.width=i,e.height=s}function rb(e,t,n,i){const s=n.padding;let{x:o,y:l}=t;for(const u of e){const f=u.box,d=i[u.stack]||{placed:0,weight:1},m=u.stackWeight/d.weight||1;if(u.horizontal){const g=t.w*m,x=d.size||f.height;xp(d.start)&&(l=d.start),f.fullSize?Hd(f,s.left,l,n.outerWidth-s.right-s.left,x):Hd(f,t.left+d.placed,l,g,x),d.start=l,d.placed+=g,l=f.bottom}else{const g=t.h*m,x=d.size||f.width;xp(d.start)&&(o=d.start),f.fullSize?Hd(f,o,s.top,x,n.outerHeight-s.bottom-s.top):Hd(f,o,t.top+d.placed,x,g),d.start=o,d.placed+=g,o=f.right}}t.x=o,t.y=l}var Es={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;const s=Ts(e.options.layout.padding),o=Math.max(t-s.width,0),l=Math.max(n-s.height,0),u=nA(e.boxes),f=u.vertical,d=u.horizontal;xn(e.boxes,N=>{typeof N.beforeLayout=="function"&&N.beforeLayout()});const m=f.reduce((N,E)=>E.box.options&&E.box.options.display===!1?N:N+1,0)||1,g=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:l,vBoxMaxWidth:o/2/m,hBoxMaxHeight:l/2}),x=Object.assign({},s);Sv(x,Ts(i));const v=Object.assign({maxPadding:x,w:o,h:l,x:s.left,y:s.top},s),A=eA(f.concat(d),g);lh(u.fullSize,v,g,A),lh(f,v,g,A),lh(d,v,g,A)&&lh(f,v,g,A),aA(v),rb(u.leftAndTop,v,g,A),v.x+=v.w,v.y+=v.h,rb(u.rightAndBottom,v,g,A),e.chartArea={left:v.left,top:v.top,right:v.left+v.w,bottom:v.top+v.h,height:v.h,width:v.w},xn(u.chartArea,N=>{const E=N.box;Object.assign(E,e.chartArea),E.update(v.w,v.h,{left:0,top:0,right:0,bottom:0})})}};class Nv{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}}class rA extends Nv{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const rp="$chartjs",oA={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ob=e=>e===null||e==="";function lA(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[rp]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",ob(s)){const o=W5(e,"width");o!==void 0&&(e.width=o)}if(ob(i))if(e.style.height==="")e.height=e.width/(t||2);else{const o=W5(e,"height");o!==void 0&&(e.height=o)}return e}const Av=mN?{passive:!0}:!1;function cA(e,t,n){e&&e.addEventListener(t,n,Av)}function uA(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Av)}function fA(e,t){const n=oA[e.type]||e.type,{x:i,y:s}=Mc(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Sp(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function hA(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let l=!1;for(const u of o)l=l||Sp(u.addedNodes,i),l=l&&!Sp(u.removedNodes,i);l&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function dA(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let l=!1;for(const u of o)l=l||Sp(u.removedNodes,i),l=l&&!Sp(u.addedNodes,i);l&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const jh=new Map;let lb=0;function Lv(){const e=window.devicePixelRatio;e!==lb&&(lb=e,jh.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function pA(e,t){jh.size||window.addEventListener("resize",Lv),jh.set(e,t)}function mA(e){jh.delete(e),jh.size||window.removeEventListener("resize",Lv)}function gA(e,t,n){const i=e.canvas,s=i&&R0(i);if(!s)return;const o=cv((u,f)=>{const d=s.clientWidth;n(u,f),d<s.clientWidth&&n()},window),l=new ResizeObserver(u=>{const f=u[0],d=f.contentRect.width,m=f.contentRect.height;d===0&&m===0||o(d,m)});return l.observe(s),pA(e,o),l}function gg(e,t,n){n&&n.disconnect(),t==="resize"&&mA(e)}function bA(e,t,n){const i=e.canvas,s=cv(o=>{e.ctx!==null&&n(fA(o,e))},e);return cA(i,t,s),s}class yA extends Nv{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(lA(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[rp])return!1;const i=n[rp].initial;["height","width"].forEach(o=>{const l=i[o];Bn(l)?n.removeAttribute(o):n.setAttribute(o,l)});const s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[rp],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),l={attach:hA,detach:dA,resize:gA}[n]||bA;s[n]=l(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:gg,detach:gg,resize:gg}[n]||uA)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return pN(t,n,i,s)}isAttached(t){const n=t&&R0(t);return!!(n&&n.isConnected)}}function vA(e){return!D0()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?rA:yA}class Yl{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Nh(this.x)&&Nh(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}function xA(e,t){const n=e.options.ticks,i=wA(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?SA(t):[],l=o.length,u=o[0],f=o[l-1],d=[];if(l>s)return NA(t,d,o,l/s),d;const m=_A(o,t,s);if(l>0){let g,x;const v=l>1?Math.round((f-u)/(l-1)):null;for(Vd(t,d,m,Bn(v)?0:u-v,u),g=0,x=l-1;g<x;g++)Vd(t,d,m,o[g],o[g+1]);return Vd(t,d,m,f,Bn(v)?t.length:f+v),d}return Vd(t,d,m),d}function wA(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(i,s))}function _A(e,t,n){const i=AA(e),s=t.length/n;if(!i)return Math.max(s,1);const o=f6(i);for(let l=0,u=o.length-1;l<u;l++){const f=o[l];if(f>s)return f}return Math.max(s,1)}function SA(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function NA(e,t,n,i){let s=0,o=n[0],l;for(i=Math.ceil(i),l=0;l<e.length;l++)l===o&&(t.push(e[l]),s++,o=n[s*i])}function Vd(e,t,n,i,s){const o=Ze(i,0),l=Math.min(Ze(s,e.length),e.length);let u=0,f,d,m;for(n=Math.ceil(n),s&&(f=s-i,n=f/Math.floor(f/n)),m=o;m<0;)u++,m=Math.round(o+u*n);for(d=Math.max(o,0);d<l;d++)d===m&&(t.push(e[d]),u++,m=Math.round(o+u*n))}function AA(e){const t=e.length;let n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}const LA=e=>e==="left"?"right":e==="right"?"left":e,cb=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,ub=(e,t)=>Math.min(t||e,e);function fb(e,t){const n=[],i=e.length/t,s=e.length;let o=0;for(;o<s;o+=i)n.push(e[Math.floor(o)]);return n}function EA(e,t,n){const i=e.ticks.length,s=Math.min(t,i-1),o=e._startPixel,l=e._endPixel,u=1e-6;let f=e.getPixelForTick(s),d;if(!(n&&(i===1?d=Math.max(f-o,l-f):t===0?d=(e.getPixelForTick(1)-f)/2:d=(f-e.getPixelForTick(s-1))/2,f+=s<t?d:-d,f<o-u||f>l+u)))return f}function jA(e,t){xn(e,n=>{const i=n.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function ih(e){return e.drawTicks?e.tickLength:0}function hb(e,t){if(!e.display)return 0;const n=ya(e.font,t),i=Ts(e.padding);return(Gi(e.text)?e.text.length:1)*n.lineHeight+i.height}function TA(e,t){return Vc(e,{scale:t,type:"scale"})}function CA(e,t,n){return Vc(e,{tick:n,index:t,type:"tick"})}function OA(e,t,n){let i=N0(e);return(n&&t!=="right"||!n&&t==="right")&&(i=LA(i)),i}function MA(e,t,n,i){const{top:s,left:o,bottom:l,right:u,chart:f}=e,{chartArea:d,scales:m}=f;let g=0,x,v,A;const N=l-s,E=u-o;if(e.isHorizontal()){if(v=ma(i,o,u),hn(n)){const j=Object.keys(n)[0],C=n[j];A=m[j].getPixelForValue(C)+N-t}else n==="center"?A=(d.bottom+d.top)/2+N-t:A=cb(e,n,t);x=u-o}else{if(hn(n)){const j=Object.keys(n)[0],C=n[j];v=m[j].getPixelForValue(C)-E+t}else n==="center"?v=(d.left+d.right)/2-E+t:v=cb(e,n,t);A=ma(i,l,s),g=n==="left"?-Di:Di}return{titleX:v,titleY:A,maxWidth:x,rotation:g}}class ef extends Yl{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,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:s}=this;return t=Kr(t,Number.POSITIVE_INFINITY),n=Kr(n,Number.NEGATIVE_INFINITY),i=Kr(i,Number.POSITIVE_INFINITY),s=Kr(s,Number.NEGATIVE_INFINITY),{min:Kr(t,i),max:Kr(n,s),minDefined:js(t),maxDefined:js(n)}}getMinMax(t){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),l;if(s&&o)return{min:n,max:i};const u=this.getMatchingVisibleMetas();for(let f=0,d=u.length;f<d;++f)l=u[f].controller.getMinMax(this,t),s||(n=Math.min(n,l.min)),o||(i=Math.max(i,l.max));return n=o&&n>i?i:n,i=s&&n>i?n:i,{min:Kr(n,Kr(i,n)),max:Kr(i,Kr(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){qn(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:o,ticks:l}=this.options,u=l.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=G6(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const f=u<this.ticks.length;this._convertTicksToLabels(f?fb(this.ticks,u):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),l.display&&(l.autoSkip||l.source==="auto")&&(this.ticks=xA(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),f&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){qn(this.options.afterUpdate,[this])}beforeSetDimensions(){qn(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(){qn(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),qn(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){qn(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=qn(n.callback,[o.value,i,t],this)}afterTickToLabelConversion(){qn(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){qn(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=ub(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let l=s,u,f,d;if(!this._isVisible()||!n.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const m=this._getLabelSizes(),g=m.widest.width,x=m.highest.height,v=ja(this.chart.width-g,0,this.maxWidth);u=t.offset?this.maxWidth/i:v/(i-1),g+6>u&&(u=v/(i-(t.offset?.5:1)),f=this.maxHeight-ih(t.grid)-n.padding-hb(t.title,this.chart.options.font),d=Math.sqrt(g*g+x*x),l=m6(Math.min(Math.asin(ja((m.highest.height+6)/u,-1,1)),Math.asin(ja(f/d,-1,1))-Math.asin(ja(x/d,-1,1)))),l=Math.max(s,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){qn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){qn(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,l=this._isVisible(),u=this.isHorizontal();if(l){const f=hb(s,n.options.font);if(u?(t.width=this.maxWidth,t.height=ih(o)+f):(t.height=this.maxHeight,t.width=ih(o)+f),i.display&&this.ticks.length){const{first:d,last:m,widest:g,highest:x}=this._getLabelSizes(),v=i.padding*2,A=Io(this.labelRotation),N=Math.cos(A),E=Math.sin(A);if(u){const j=i.mirror?0:E*g.width+N*x.height;t.height=Math.min(this.maxHeight,t.height+j+v)}else{const j=i.mirror?0:N*g.width+E*x.height;t.width=Math.min(this.maxWidth,t.width+j+v)}this._calculatePadding(d,m,E,N)}}this._handleMargins(),u?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:o,padding:l},position:u}=this.options,f=this.labelRotation!==0,d=u!=="top"&&this.axis==="x";if(this.isHorizontal()){const m=this.getPixelForTick(0)-this.left,g=this.right-this.getPixelForTick(this.ticks.length-1);let x=0,v=0;f?d?(x=s*t.width,v=i*n.height):(x=i*t.height,v=s*n.width):o==="start"?v=n.width:o==="end"?x=t.width:o!=="inner"&&(x=t.width/2,v=n.width/2),this.paddingLeft=Math.max((x-m+l)*this.width/(this.width-m),0),this.paddingRight=Math.max((v-g+l)*this.width/(this.width-g),0)}else{let m=n.height/2,g=t.height/2;o==="start"?(m=0,g=t.height):o==="end"&&(m=n.height,g=0),this.paddingTop=m+l,this.paddingBottom=g+l}}_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(){qn(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n<i;n++)Bn(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=fb(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:s,_longestTextCache:o}=this,l=[],u=[],f=Math.floor(n/ub(n,i));let d=0,m=0,g,x,v,A,N,E,j,C,z,Z,I;for(g=0;g<n;g+=f){if(A=t[g].label,N=this._resolveTickFontOptions(g),s.font=E=N.string,j=o[E]=o[E]||{data:{},gc:[]},C=N.lineHeight,z=Z=0,!Bn(A)&&!Gi(A))z=I5(s,j.data,j.gc,z,A),Z=C;else if(Gi(A))for(x=0,v=A.length;x<v;++x)I=A[x],!Bn(I)&&!Gi(I)&&(z=I5(s,j.data,j.gc,z,I),Z+=C);l.push(z),u.push(Z),d=Math.max(z,d),m=Math.max(Z,m)}jA(o,n);const st=l.indexOf(d),K=u.indexOf(m),H=G=>({width:l[G]||0,height:u[G]||0});return{first:H(0),last:H(n-1),widest:H(st),highest:H(K),widths:l,heights:u}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return b6(this._alignToPixels?Cc(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=CA(this.getContext(),t,i))}return this.$context||(this.$context=TA(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Io(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),l=t.autoSkipPadding||0,u=o?o.widest.width+l:0,f=o?o.highest.height+l:0;return this.isHorizontal()?f*i>u*s?u/i:f/s:f*s<u*i?f/i:u/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:o,position:l,border:u}=s,f=o.offset,d=this.isHorizontal(),g=this.ticks.length+(f?1:0),x=ih(o),v=[],A=u.setContext(this.getContext()),N=A.display?A.width:0,E=N/2,j=function(W){return Cc(i,W,N)};let C,z,Z,I,st,K,H,G,Q,D,R,et;if(l==="top")C=j(this.bottom),K=this.bottom-x,G=C-E,D=j(t.top)+E,et=t.bottom;else if(l==="bottom")C=j(this.top),D=t.top,et=j(t.bottom)-E,K=C+E,G=this.top+x;else if(l==="left")C=j(this.right),st=this.right-x,H=C-E,Q=j(t.left)+E,R=t.right;else if(l==="right")C=j(this.left),Q=t.left,R=j(t.right)-E,st=C+E,H=this.left+x;else if(n==="x"){if(l==="center")C=j((t.top+t.bottom)/2+.5);else if(hn(l)){const W=Object.keys(l)[0],lt=l[W];C=j(this.chart.scales[W].getPixelForValue(lt))}D=t.top,et=t.bottom,K=C+E,G=K+x}else if(n==="y"){if(l==="center")C=j((t.left+t.right)/2);else if(hn(l)){const W=Object.keys(l)[0],lt=l[W];C=j(this.chart.scales[W].getPixelForValue(lt))}st=C-E,H=st-x,Q=t.left,R=t.right}const nt=Ze(s.ticks.maxTicksLimit,g),dt=Math.max(1,Math.ceil(g/nt));for(z=0;z<g;z+=dt){const W=this.getContext(z),lt=o.setContext(W),ut=u.setContext(W),wt=lt.lineWidth,Y=lt.color,gt=ut.dash||[],O=ut.dashOffset,q=lt.tickWidth,$=lt.tickColor,rt=lt.tickBorderDash||[],at=lt.tickBorderDashOffset;Z=EA(this,z,f),Z!==void 0&&(I=Cc(i,Z,wt),d?st=H=Q=R=I:K=G=D=et=I,v.push({tx1:st,ty1:K,tx2:H,ty2:G,x1:Q,y1:D,x2:R,y2:et,width:wt,color:Y,borderDash:gt,borderDashOffset:O,tickWidth:q,tickColor:$,tickBorderDash:rt,tickBorderDashOffset:at}))}return this._ticksLength=g,this._borderValue=C,v}_computeLabelItems(t){const n=this.axis,i=this.options,{position:s,ticks:o}=i,l=this.isHorizontal(),u=this.ticks,{align:f,crossAlign:d,padding:m,mirror:g}=o,x=ih(i.grid),v=x+m,A=g?-m:v,N=-Io(this.labelRotation),E=[];let j,C,z,Z,I,st,K,H,G,Q,D,R,et="middle";if(s==="top")st=this.bottom-A,K=this._getXAxisLabelAlignment();else if(s==="bottom")st=this.top+A,K=this._getXAxisLabelAlignment();else if(s==="left"){const dt=this._getYAxisLabelAlignment(x);K=dt.textAlign,I=dt.x}else if(s==="right"){const dt=this._getYAxisLabelAlignment(x);K=dt.textAlign,I=dt.x}else if(n==="x"){if(s==="center")st=(t.top+t.bottom)/2+v;else if(hn(s)){const dt=Object.keys(s)[0],W=s[dt];st=this.chart.scales[dt].getPixelForValue(W)+v}K=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")I=(t.left+t.right)/2-v;else if(hn(s)){const dt=Object.keys(s)[0],W=s[dt];I=this.chart.scales[dt].getPixelForValue(W)}K=this._getYAxisLabelAlignment(x).textAlign}n==="y"&&(f==="start"?et="top":f==="end"&&(et="bottom"));const nt=this._getLabelSizes();for(j=0,C=u.length;j<C;++j){z=u[j],Z=z.label;const dt=o.setContext(this.getContext(j));H=this.getPixelForTick(j)+o.labelOffset,G=this._resolveTickFontOptions(j),Q=G.lineHeight,D=Gi(Z)?Z.length:1;const W=D/2,lt=dt.color,ut=dt.textStrokeColor,wt=dt.textStrokeWidth;let Y=K;l?(I=H,K==="inner"&&(j===C-1?Y=this.options.reverse?"left":"right":j===0?Y=this.options.reverse?"right":"left":Y="center"),s==="top"?d==="near"||N!==0?R=-D*Q+Q/2:d==="center"?R=-nt.highest.height/2-W*Q+Q:R=-nt.highest.height+Q/2:d==="near"||N!==0?R=Q/2:d==="center"?R=nt.highest.height/2-W*Q:R=nt.highest.height-D*Q,g&&(R*=-1),N!==0&&!dt.showLabelBackdrop&&(I+=Q/2*Math.sin(N))):(st=H,R=(1-D)*Q/2);let gt;if(dt.showLabelBackdrop){const O=Ts(dt.backdropPadding),q=nt.heights[j],$=nt.widths[j];let rt=R-O.top,at=0-O.left;switch(et){case"middle":rt-=q/2;break;case"bottom":rt-=q;break}switch(K){case"center":at-=$/2;break;case"right":at-=$;break;case"inner":j===C-1?at-=$:j>0&&(at-=$/2);break}gt={left:at,top:rt,width:$+O.width,height:q+O.height,color:dt.backdropColor}}E.push({label:Z,font:G,textOffset:R,options:{rotation:N,color:lt,strokeColor:ut,strokeWidth:wt,textAlign:Y,textBaseline:et,translation:[I,st],backdrop:gt}})}return E}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Io(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,l=this._getLabelSizes(),u=t+o,f=l.widest.width;let d,m;return n==="left"?s?(m=this.right+o,i==="near"?d="left":i==="center"?(d="center",m+=f/2):(d="right",m+=f)):(m=this.right-u,i==="near"?d="right":i==="center"?(d="center",m-=f/2):(d="left",m=this.left)):n==="right"?s?(m=this.left+o,i==="near"?d="right":i==="center"?(d="center",m-=f/2):(d="left",m-=f)):(m=this.left+u,i==="near"?d="left":i==="center"?(d="center",m+=f/2):(d="right",m=this.right)):d="right",{textAlign:d,x:m}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:i,top:s,width:o,height:l}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,o,l),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,l;const u=(f,d,m)=>{!m.width||!m.color||(i.save(),i.lineWidth=m.width,i.strokeStyle=m.color,i.setLineDash(m.borderDash||[]),i.lineDashOffset=m.borderDashOffset,i.beginPath(),i.moveTo(f.x,f.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(n.display)for(o=0,l=s.length;o<l;++o){const f=s[o];n.drawOnChartArea&&u({x:f.x1,y:f.y1},{x:f.x2,y:f.y2},f),n.drawTicks&&u({x:f.tx1,y:f.ty1},{x:f.tx2,y:f.ty2},{color:f.tickColor,width:f.tickWidth,borderDash:f.tickBorderDash,borderDashOffset:f.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),l=i.display?o.width:0;if(!l)return;const u=s.setContext(this.getContext(0)).lineWidth,f=this._borderValue;let d,m,g,x;this.isHorizontal()?(d=Cc(t,this.left,l)-l/2,m=Cc(t,this.right,u)+u/2,g=x=f):(g=Cc(t,this.top,l)-l/2,x=Cc(t,this.bottom,u)+u/2,d=m=f),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(d,g),n.lineTo(m,x),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&E0(i,s);const o=this.getLabelItems(t);for(const l of o){const u=l.options,f=l.font,d=l.label,m=l.textOffset;Eh(i,d,0,m,f,u)}s&&j0(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;const o=ya(i.font),l=Ts(i.padding),u=i.align;let f=o.lineHeight/2;n==="bottom"||n==="center"||hn(n)?(f+=l.bottom,Gi(i.text)&&(f+=o.lineHeight*(i.text.length-1))):f+=l.top;const{titleX:d,titleY:m,maxWidth:g,rotation:x}=MA(this,f,n,u);Eh(t,i.text,0,0,o,{color:i.color,maxWidth:g,rotation:x,textAlign:OA(u,n,s),textBaseline:"middle",translation:[d,m]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,i=Ze(t.grid&&t.grid.z,-1),s=Ze(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ef.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,l;for(o=0,l=n.length;o<l;++o){const u=n[o];u[i]===this.id&&(!t||u.type===t)&&s.push(u)}return s}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return ya(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Yd{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let i;kA(n)&&(i=this.register(n));const s=this.items,o=t.id,l=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,DA(t,l,i),this.override&&bi.override(t.id,t.overrides)),l}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,s=this.scope;i in n&&delete n[i],s&&i in bi[s]&&(delete bi[s][i],this.override&&delete Hc[i])}}function DA(e,t,n){const i=_h(Object.create(null),[n?bi.get(n):{},bi.get(t),e.defaults]);bi.set(t,i),e.defaultRoutes&&RA(t,e.defaultRoutes),e.descriptors&&bi.describe(t,e.descriptors)}function RA(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),l=t[n].split("."),u=l.pop(),f=l.join(".");bi.route(o,s,f,u)})}function kA(e){return"id"in e&&"defaults"in e}class PA{constructor(){this.controllers=new Yd(k0,"datasets",!0),this.elements=new Yd(Yl,"elements"),this.plugins=new Yd(Object,"plugins"),this.scales=new Yd(ef,"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,n,i){[...n].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):xn(s,l=>{const u=i||this._getRegistryForType(l);this._exec(t,u,l)})})}_exec(t,n,i){const s=_0(t);qn(i["before"+s],[],i),n[t](i),qn(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){const s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Qr=new PA;class BA{constructor(){this._init=[]}notify(t,n,i,s){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=s?this._descriptors(t).filter(s):this._descriptors(t),l=this._notify(o,t,n,i);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),l}_notify(t,n,i,s){s=s||{};for(const o of t){const l=o.plugin,u=l[i],f=[n,s,o.options];if(qn(u,f,l)===!1&&s.cancelable)return!1}return!0}invalidate(){Bn(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const i=t&&t.config,s=Ze(i.options&&i.options.plugins,{}),o=zA(i);return s===!1&&!n?[]:qA(t,o,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,s=(o,l)=>o.filter(u=>!l.some(f=>u.plugin.id===f.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}}function zA(e){const t={},n=[],i=Object.keys(Qr.plugins.items);for(let o=0;o<i.length;o++)n.push(Qr.getPlugin(i[o]));const s=e.plugins||[];for(let o=0;o<s.length;o++){const l=s[o];n.indexOf(l)===-1&&(n.push(l),t[l.id]=!0)}return{plugins:n,localIds:t}}function FA(e,t){return!t&&e===!1?null:e===!0?{}:e}function qA(e,{plugins:t,localIds:n},i,s){const o=[],l=e.getContext();for(const u of t){const f=u.id,d=FA(i[f],s);d!==null&&o.push({plugin:u,options:UA(e.config,{plugin:u,local:n[f]},d,l)})}return o}function UA(e,{plugin:t,local:n},i,s){const o=e.pluginScopeKeys(t),l=e.getOptionScopes(i,o);return n&&t.defaults&&l.push(t.defaults),e.createResolver(l,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ug(e,t){const n=bi.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function IA(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function HA(e,t){return e===t?"_index_":"_value_"}function db(e){if(e==="x"||e==="y"||e==="r")return e}function VA(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Ig(e,...t){if(db(e))return e;for(const n of t){const i=n.axis||VA(n.position)||e.length>1&&db(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function pb(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function YA(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return pb(e,"x",n[0])||pb(e,"y",n[0])}return{}}function GA(e,t){const n=Hc[e.type]||{scales:{}},i=t.scales||{},s=Ug(e.type,t),o=Object.create(null);return Object.keys(i).forEach(l=>{const u=i[l];if(!hn(u))return console.error(`Invalid scale configuration for scale: ${l}`);if(u._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${l}`);const f=Ig(l,u,YA(l,e),bi.scales[u.type]),d=HA(f,s),m=n.scales||{};o[l]=hh(Object.create(null),[{axis:f},u,m[f],m[d]])}),e.data.datasets.forEach(l=>{const u=l.type||e.type,f=l.indexAxis||Ug(u,t),m=(Hc[u]||{}).scales||{};Object.keys(m).forEach(g=>{const x=IA(g,f),v=l[x+"AxisID"]||x;o[v]=o[v]||Object.create(null),hh(o[v],[{axis:x},i[v],m[g]])})}),Object.keys(o).forEach(l=>{const u=o[l];hh(u,[bi.scales[u.type],bi.scale])}),o}function Ev(e){const t=e.options||(e.options={});t.plugins=Ze(t.plugins,{}),t.scales=GA(e,t)}function jv(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function WA(e){return e=e||{},e.data=jv(e.data),Ev(e),e}const mb=new Map,Tv=new Set;function Gd(e,t){let n=mb.get(e);return n||(n=t(),mb.set(e,n),Tv.add(n)),n}const ah=(e,t,n)=>{const i=Sh(t,n);i!==void 0&&e.add(i)};class XA{constructor(t){this._config=WA(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=jv(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(),Ev(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Gd(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Gd(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Gd(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Gd(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:o}=this,l=this._cachedScopes(t,i),u=l.get(n);if(u)return u;const f=new Set;n.forEach(m=>{t&&(f.add(t),m.forEach(g=>ah(f,t,g))),m.forEach(g=>ah(f,s,g)),m.forEach(g=>ah(f,Hc[o]||{},g)),m.forEach(g=>ah(f,bi,g)),m.forEach(g=>ah(f,zg,g))});const d=Array.from(f);return d.length===0&&d.push(Object.create(null)),Tv.has(n)&&l.set(n,d),d}chartOptionScopes(){const{options:t,type:n}=this;return[t,Hc[n]||{},bi.datasets[n]||{},{type:n},bi,zg]}resolveNamedOptions(t,n,i,s=[""]){const o={$shared:!0},{resolver:l,subPrefixes:u}=gb(this._resolverCache,t,s);let f=l;if($A(l,n)){o.$shared=!1,i=Il(i)?i():i;const d=this.createResolver(t,i,u);f=Wu(l,i,d)}for(const d of n)o[d]=f[d];return o}createResolver(t,n,i=[""],s){const{resolver:o}=gb(this._resolverCache,t,i);return hn(n)?Wu(o,n,void 0,s):o}}function gb(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let o=i.get(s);return o||(o={resolver:C0(t,n),subPrefixes:n.filter(u=>!u.toLowerCase().includes("hover"))},i.set(s,o)),o}const KA=e=>hn(e)&&Object.getOwnPropertyNames(e).some(t=>Il(e[t]));function $A(e,t){const{isScriptable:n,isIndexable:i}=hv(e);for(const s of t){const o=n(s),l=i(s),u=(l||o)&&e[s];if(o&&(Il(u)||KA(u))||l&&Gi(u))return!0}return!1}var ZA="4.5.0";const QA=["top","bottom","left","right","chartArea"];function bb(e,t){return e==="top"||e==="bottom"||QA.indexOf(e)===-1&&t==="x"}function yb(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function vb(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),qn(n&&n.onComplete,[e],t)}function JA(e){const t=e.chart,n=t.options.animation;qn(n&&n.onProgress,[e],t)}function Cv(e){return D0()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const op={},xb=e=>{const t=Cv(e);return Object.values(op).filter(n=>n.canvas===t).pop()};function t8(e,t,n){const i=Object.keys(e);for(const s of i){const o=+s;if(o>=t){const l=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=l)}}}function e8(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let lr=class{static defaults=bi;static instances=op;static overrides=Hc;static registry=Qr;static version=ZA;static getChart=xb;static register(...t){Qr.add(...t),wb()}static unregister(...t){Qr.remove(...t),wb()}constructor(t,n){const i=this.config=new XA(n),s=Cv(t),o=xb(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 l=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||vA(s)),this.platform.updateConfig(i);const u=this.platform.acquireContext(s,l.aspectRatio),f=u&&u.canvas,d=f&&f.height,m=f&&f.width;if(this.id=n6(),this.ctx=u,this.canvas=f,this.width=m,this.height=d,this._options=l,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 BA,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=_6(g=>this.update(g),l.resizeDelay||0),this._dataChanges=[],op[this.id]=this,!u||!f){console.error("Failed to create chart: can't acquire context from the given item");return}Fo.listen(this,"complete",vb),Fo.listen(this,"progress",JA),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return Bn(t)?n&&o?o:s?i/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}get registry(){return Qr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():G5(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return H5(this.canvas,this.ctx),this}stop(){return Fo.stop(this),this}resize(t,n){Fo.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,l=this.platform.getMaximumSize(s,t,n,o),u=i.devicePixelRatio||this.platform.getDevicePixelRatio(),f=this.width?"resize":"attach";this.width=l.width,this.height=l.height,this._aspectRatio=this.aspectRatio,G5(this,u,!0)&&(this.notifyPlugins("resize",{size:l}),qn(i.onResize,[this,l],this),this.attached&&this._doResize(f)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};xn(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((l,u)=>(l[u]=!1,l),{});let o=[];n&&(o=o.concat(Object.keys(n).map(l=>{const u=n[l],f=Ig(l,u),d=f==="r",m=f==="x";return{options:u,dposition:d?"chartArea":m?"bottom":"left",dtype:d?"radialLinear":m?"category":"linear"}}))),xn(o,l=>{const u=l.options,f=u.id,d=Ig(f,u),m=Ze(u.type,l.dtype);(u.position===void 0||bb(u.position,d)!==bb(l.dposition))&&(u.position=l.dposition),s[f]=!0;let g=null;if(f in i&&i[f].type===m)g=i[f];else{const x=Qr.getScale(m);g=new x({id:f,type:m,ctx:this.ctx,chart:this}),i[g.id]=g}g.init(u,t)}),xn(s,(l,u)=>{l||delete i[u]}),xn(i,l=>{Es.configure(this,l,l.options),Es.addBox(this,l)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>n){for(let s=n;s<i;++s)this._destroyDatasetMeta(s);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(yb("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){const o=n[i];let l=this.getDatasetMeta(i);const u=o.type||this.config.type;if(l.type&&l.type!==u&&(this._destroyDatasetMeta(i),l=this.getDatasetMeta(i)),l.type=u,l.indexAxis=o.indexAxis||Ug(u,this.options),l.order=o.order||0,l.index=i,l.label=""+o.label,l.visible=this.isDatasetVisible(i),l.controller)l.controller.updateIndex(i),l.controller.linkScales();else{const f=Qr.getController(u),{datasetElementType:d,dataElementType:m}=bi.datasets[u];Object.assign(f,{dataElementType:Qr.getElement(m),datasetElementType:d&&Qr.getElement(d)}),l.controller=new f(this,i),t.push(l.controller)}}return this._updateMetasets(),t}_resetElements(){xn(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.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 l=0;for(let d=0,m=this.data.datasets.length;d<m;d++){const{controller:g}=this.getDatasetMeta(d),x=!s&&o.indexOf(g)===-1;g.buildOrUpdateElements(x),l=Math.max(+g.getMaxOverflow(),l)}l=this._minPadding=i.layout.autoPadding?l:0,this._updateLayout(l),s||xn(o,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(yb("z","_idx"));const{_active:u,_lastEvent:f}=this;f?this._eventHandler(f,!0):u.length&&this._updateHoverStyles(u,u,!0),this.render()}_updateScales(){xn(this.scales,t=>{Es.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!D5(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of n){const l=i==="_removeElements"?-o:o;t8(t,s,l)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=o=>new Set(t.filter(l=>l[0]===o).map((l,u)=>u+","+l.splice(1).join(","))),s=i(0);for(let o=1;o<n;o++)if(!D5(s,i(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;Es.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],xn(this.boxes,s=>{i&&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 n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,Il(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Fo.has(this)?this.attached&&!Fo.running(this)&&Fo.start(this):(this.draw(),vb({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,i=[];let s,o;for(s=0,o=n.length;s<o;++s){const l=n[s];(!t||l.visible)&&i.push(l)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=TN(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&E0(n,s),t.controller.draw(),s&&j0(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Lh(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const o=QN.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Vc(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),l=o.controller._resolveAnimations(void 0,s);xp(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),l.update(o,{visible:i}),this.update(u=>u.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Fo.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),H5(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete op[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,n=this.platform,i=(o,l)=>{n.addEventListener(this,o,l),t[o]=l},s=(o,l,u)=>{o.offsetX=l,o.offsetY=u,this._eventHandler(o)};xn(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(f,d)=>{n.addEventListener(this,f,d),t[f]=d},s=(f,d)=>{t[f]&&(n.removeEventListener(this,f,d),delete t[f])},o=(f,d)=>{this.canvas&&this.resize(f,d)};let l;const u=()=>{s("attach",u),this.attached=!0,this.resize(),i("resize",o),i("detach",l)};l=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",u)},n.isAttached(this.canvas)?u():l()}unbindEvents(){xn(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},xn(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let o,l,u,f;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),u=0,f=t.length;u<f;++u){l=t[u];const d=l&&this.getDatasetMeta(l.datasetIndex).controller;d&&d[s+"HoverStyle"](l.element,l.datasetIndex,l.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],i=t.map(({datasetIndex:o,index:l})=>{const u=this.getDatasetMeta(o);if(!u)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:u.data[l],index:l}});!yp(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const s=this.options.hover,o=(f,d)=>f.filter(m=>!d.some(g=>m.datasetIndex===g.datasetIndex&&m.index===g.index)),l=o(n,t),u=i?t:o(t,n);l.length&&this.updateHoverStyle(l,s.mode,!1),u.length&&s.mode&&this.updateHoverStyle(u,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=l=>(l.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:o}=this,l=n,u=this._getActiveElements(t,s,i,l),f=l6(t),d=e8(t,this._lastEvent,i,f);i&&(this._lastEvent=null,qn(o.onHover,[t,u,this],this),f&&qn(o.onClick,[t,u,this],this));const m=!yp(u,s);return(m||n)&&(this._active=u,this._updateHoverStyles(u,s,n)),this._lastEvent=d,m}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};function wb(){return xn(lr.instances,e=>e._plugins.invalidate())}function n8(e,t,n){const{startAngle:i,x:s,y:o,outerRadius:l,innerRadius:u,options:f}=t,{borderWidth:d,borderJoinStyle:m}=f,g=Math.min(d/l,sr(i-n));if(e.beginPath(),e.arc(s,o,l-d/2,i+g/2,n-g/2),u>0){const x=Math.min(d/u,sr(i-n));e.arc(s,o,u+d/2,n-x/2,i+x/2,!0)}else{const x=Math.min(d/2,l*sr(i-n));if(m==="round")e.arc(s,o,x,n-wn/2,i+wn/2,!0);else if(m==="bevel"){const v=2*x*x,A=-v*Math.cos(n+wn/2)+s,N=-v*Math.sin(n+wn/2)+o,E=v*Math.cos(i+wn/2)+s,j=v*Math.sin(i+wn/2)+o;e.lineTo(A,N),e.lineTo(E,j)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function i8(e,t,n){const{startAngle:i,pixelMargin:s,x:o,y:l,outerRadius:u,innerRadius:f}=t;let d=s/u;e.beginPath(),e.arc(o,l,u,i-d,n+d),f>s?(d=s/f,e.arc(o,l,f,n+d,i-d,!0)):e.arc(o,l,s,n+Di,i-Di),e.closePath(),e.clip()}function a8(e){return T0(e,["outerStart","outerEnd","innerStart","innerEnd"])}function s8(e,t,n,i){const s=a8(e.options.borderRadius),o=(n-t)/2,l=Math.min(o,i*t/2),u=f=>{const d=(n-Math.min(o,f))*i/2;return ja(f,0,Math.min(o,d))};return{outerStart:u(s.outerStart),outerEnd:u(s.outerEnd),innerStart:ja(s.innerStart,0,l),innerEnd:ja(s.innerEnd,0,l)}}function Ru(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Np(e,t,n,i,s,o){const{x:l,y:u,startAngle:f,pixelMargin:d,innerRadius:m}=t,g=Math.max(t.outerRadius+i+n-d,0),x=m>0?m+i+n+d:0;let v=0;const A=s-f;if(i){const dt=m>0?m-i:0,W=g>0?g-i:0,lt=(dt+W)/2,ut=lt!==0?A*lt/(lt+i):A;v=(A-ut)/2}const N=Math.max(.001,A*g-n/wn)/g,E=(A-N)/2,j=f+E+v,C=s-E-v,{outerStart:z,outerEnd:Z,innerStart:I,innerEnd:st}=s8(t,x,g,C-j),K=g-z,H=g-Z,G=j+z/K,Q=C-Z/H,D=x+I,R=x+st,et=j+I/D,nt=C-st/R;if(e.beginPath(),o){const dt=(G+Q)/2;if(e.arc(l,u,g,G,dt),e.arc(l,u,g,dt,Q),Z>0){const wt=Ru(H,Q,l,u);e.arc(wt.x,wt.y,Z,Q,C+Di)}const W=Ru(R,C,l,u);if(e.lineTo(W.x,W.y),st>0){const wt=Ru(R,nt,l,u);e.arc(wt.x,wt.y,st,C+Di,nt+Math.PI)}const lt=(C-st/x+(j+I/x))/2;if(e.arc(l,u,x,C-st/x,lt,!0),e.arc(l,u,x,lt,j+I/x,!0),I>0){const wt=Ru(D,et,l,u);e.arc(wt.x,wt.y,I,et+Math.PI,j-Di)}const ut=Ru(K,j,l,u);if(e.lineTo(ut.x,ut.y),z>0){const wt=Ru(K,G,l,u);e.arc(wt.x,wt.y,z,j-Di,G)}}else{e.moveTo(l,u);const dt=Math.cos(G)*g+l,W=Math.sin(G)*g+u;e.lineTo(dt,W);const lt=Math.cos(Q)*g+l,ut=Math.sin(Q)*g+u;e.lineTo(lt,ut)}e.closePath()}function r8(e,t,n,i,s){const{fullCircles:o,startAngle:l,circumference:u}=t;let f=t.endAngle;if(o){Np(e,t,n,i,f,s);for(let d=0;d<o;++d)e.fill();isNaN(u)||(f=l+(u%oi||oi))}return Np(e,t,n,i,f,s),e.fill(),f}function o8(e,t,n,i,s){const{fullCircles:o,startAngle:l,circumference:u,options:f}=t,{borderWidth:d,borderJoinStyle:m,borderDash:g,borderDashOffset:x,borderRadius:v}=f,A=f.borderAlign==="inner";if(!d)return;e.setLineDash(g||[]),e.lineDashOffset=x,A?(e.lineWidth=d*2,e.lineJoin=m||"round"):(e.lineWidth=d,e.lineJoin=m||"bevel");let N=t.endAngle;if(o){Np(e,t,n,i,N,s);for(let E=0;E<o;++E)e.stroke();isNaN(u)||(N=l+(u%oi||oi))}A&&i8(e,t,N),f.selfJoin&&N-l>=wn&&v===0&&m!=="miter"&&n8(e,t,N),o||(Np(e,t,n,i,N,s),e.stroke())}class l8 extends Yl{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;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,n,i){const s=this.getProps(["x","y"],i),{angle:o,distance:l}=rv(s,{x:t,y:n}),{startAngle:u,endAngle:f,innerRadius:d,outerRadius:m,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),x=(this.options.spacing+this.options.borderWidth)/2,v=Ze(g,f-u),A=Ah(o,u,f)&&u!==f,N=v>=oi||A,E=Fu(l,d+x,m+x);return N&&E}getCenterPoint(t){const{x:n,y:i,startAngle:s,endAngle:o,innerRadius:l,outerRadius:u}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:f,spacing:d}=this.options,m=(s+o)/2,g=(l+u+d+f)/2;return{x:n+Math.cos(m)*g,y:i+Math.sin(m)*g}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,s=(n.offset||0)/4,o=(n.spacing||0)/2,l=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>oi?Math.floor(i/oi):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const u=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(u)*s,Math.sin(u)*s);const f=1-Math.sin(Math.min(wn,i||0)),d=s*f;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,r8(t,this,d,o,l),o8(t,this,d,o,l),t.restore()}}function Ov(e,t,n=t){e.lineCap=Ze(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ze(n.borderDash,t.borderDash)),e.lineDashOffset=Ze(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ze(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ze(n.borderWidth,t.borderWidth),e.strokeStyle=Ze(n.borderColor,t.borderColor)}function c8(e,t,n){e.lineTo(n.x,n.y)}function u8(e){return e.stepped?P6:e.tension||e.cubicInterpolationMode==="monotone"?B6:c8}function Mv(e,t,n={}){const i=e.length,{start:s=0,end:o=i-1}=n,{start:l,end:u}=t,f=Math.max(s,l),d=Math.min(o,u),m=s<l&&o<l||s>u&&o>u;return{count:i,start:f,loop:t.loop,ilen:d<f&&!m?i+d-f:d-f}}function f8(e,t,n,i){const{points:s,options:o}=t,{count:l,start:u,loop:f,ilen:d}=Mv(s,n,i),m=u8(o);let{move:g=!0,reverse:x}=i||{},v,A,N;for(v=0;v<=d;++v)A=s[(u+(x?d-v:v))%l],!A.skip&&(g?(e.moveTo(A.x,A.y),g=!1):m(e,N,A,x,o.stepped),N=A);return f&&(A=s[(u+(x?d:0))%l],m(e,N,A,x,o.stepped)),!!f}function h8(e,t,n,i){const s=t.points,{count:o,start:l,ilen:u}=Mv(s,n,i),{move:f=!0,reverse:d}=i||{};let m=0,g=0,x,v,A,N,E,j;const C=Z=>(l+(d?u-Z:Z))%o,z=()=>{N!==E&&(e.lineTo(m,E),e.lineTo(m,N),e.lineTo(m,j))};for(f&&(v=s[C(0)],e.moveTo(v.x,v.y)),x=0;x<=u;++x){if(v=s[C(x)],v.skip)continue;const Z=v.x,I=v.y,st=Z|0;st===A?(I<N?N=I:I>E&&(E=I),m=(g*m+Z)/++g):(z(),e.lineTo(Z,I),A=st,g=0,N=E=I),j=I}z()}function Hg(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?h8:f8}function d8(e){return e.stepped?gN:e.tension||e.cubicInterpolationMode==="monotone"?bN:Dc}function p8(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),Ov(e,t.options),e.stroke(s)}function m8(e,t,n,i){const{segments:s,options:o}=t,l=Hg(t);for(const u of s)Ov(e,o,u.style),e.beginPath(),l(e,t,u,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const g8=typeof Path2D=="function";function b8(e,t,n,i){g8&&!t.options.segment?p8(e,t,n,i):m8(e,t,n,i)}class Dv extends Yl{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};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,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;lN(this._points,i,t,s,n),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=AN(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],o=this.points,l=_N(this,{property:n,start:s,end:s});if(!l.length)return;const u=[],f=d8(i);let d,m;for(d=0,m=l.length;d<m;++d){const{start:g,end:x}=l[d],v=o[g],A=o[x];if(v===A){u.push(v);continue}const N=Math.abs((s-v[n])/(A[n]-v[n])),E=f(v,A,N,i.stepped);E[n]=t[n],u.push(E)}return u.length===1?u[0]:u}pathSegment(t,n,i){return Hg(this)(t,this,n,i)}path(t,n,i){const s=this.segments,o=Hg(this);let l=this._loop;n=n||0,i=i||this.points.length-n;for(const u of s)l&=o(t,this,u,{start:n,end:n+i-1});return!!l}draw(t,n,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),b8(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function _b(e,t,n,i){const s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}class Rv extends Yl{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};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,n,i){const s=this.options,{x:o,y:l}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(n-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,n){return _b(this,t,"x",n)}inYRange(t,n){return _b(this,t,"y",n)}getCenterPoint(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const i=n&&t.borderWidth||0;return(n+i)*2}draw(t,n){const i=this.options;this.skip||i.radius<.1||!Lh(this,n,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Fg(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}const Sb=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},y8=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Nb extends Yl{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,n,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,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 n=qn(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=ya(i.font),o=s.size,l=this._computeTitleHeight(),{boxWidth:u,itemHeight:f}=Sb(i,o);let d,m;n.font=s.string,this.isHorizontal()?(d=this.maxWidth,m=this._fitRows(l,o,u,f)+10):(m=this.maxHeight,d=this._fitCols(l,s,u,f)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(m,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:o,maxWidth:l,options:{labels:{padding:u}}}=this,f=this.legendHitBoxes=[],d=this.lineWidths=[0],m=s+u;let g=t;o.textAlign="left",o.textBaseline="middle";let x=-1,v=-m;return this.legendItems.forEach((A,N)=>{const E=i+n/2+o.measureText(A.text).width;(N===0||d[d.length-1]+E+2*u>l)&&(g+=m,d[d.length-(N>0?0:1)]=0,v+=m,x++),f[N]={left:0,top:v,row:x,width:E,height:s},d[d.length-1]+=E+u}),g}_fitCols(t,n,i,s){const{ctx:o,maxHeight:l,options:{labels:{padding:u}}}=this,f=this.legendHitBoxes=[],d=this.columnSizes=[],m=l-t;let g=u,x=0,v=0,A=0,N=0;return this.legendItems.forEach((E,j)=>{const{itemWidth:C,itemHeight:z}=v8(i,n,o,E,s);j>0&&v+z+2*u>m&&(g+=x+u,d.push({width:x,height:v}),A+=x+u,N++,x=v=0),f[j]={left:A,top:v,col:N,width:C,height:z},x=Math.max(x,C),v+=z+u}),g+=x,d.push({width:x,height:v}),g}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,l=Uu(o,this.left,this.width);if(this.isHorizontal()){let u=0,f=ma(i,this.left+s,this.right-this.lineWidths[u]);for(const d of n)u!==d.row&&(u=d.row,f=ma(i,this.left+s,this.right-this.lineWidths[u])),d.top+=this.top+t+s,d.left=l.leftForLtr(l.x(f),d.width),f+=d.width+s}else{let u=0,f=ma(i,this.top+t+s,this.bottom-this.columnSizes[u].height);for(const d of n)d.col!==u&&(u=d.col,f=ma(i,this.top+t+s,this.bottom-this.columnSizes[u].height)),d.top=f,d.left+=this.left+s,d.left=l.leftForLtr(l.x(d.left),d.width),f+=d.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;E0(t,this),this._draw(),j0(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:l}=t,u=bi.color,f=Uu(t.rtl,this.left,this.width),d=ya(l.font),{padding:m}=l,g=d.size,x=g/2;let v;this.drawTitle(),s.textAlign=f.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=d.string;const{boxWidth:A,boxHeight:N,itemHeight:E}=Sb(l,g),j=function(st,K,H){if(isNaN(A)||A<=0||isNaN(N)||N<0)return;s.save();const G=Ze(H.lineWidth,1);if(s.fillStyle=Ze(H.fillStyle,u),s.lineCap=Ze(H.lineCap,"butt"),s.lineDashOffset=Ze(H.lineDashOffset,0),s.lineJoin=Ze(H.lineJoin,"miter"),s.lineWidth=G,s.strokeStyle=Ze(H.strokeStyle,u),s.setLineDash(Ze(H.lineDash,[])),l.usePointStyle){const Q={radius:N*Math.SQRT2/2,pointStyle:H.pointStyle,rotation:H.rotation,borderWidth:G},D=f.xPlus(st,A/2),R=K+x;fv(s,Q,D,R,l.pointStyleWidth&&A)}else{const Q=K+Math.max((g-N)/2,0),D=f.leftForLtr(st,A),R=gh(H.borderRadius);s.beginPath(),Object.values(R).some(et=>et!==0)?qg(s,{x:D,y:Q,w:A,h:N,radius:R}):s.rect(D,Q,A,N),s.fill(),G!==0&&s.stroke()}s.restore()},C=function(st,K,H){Eh(s,H.text,st,K+E/2,d,{strikethrough:H.hidden,textAlign:f.textAlign(H.textAlign)})},z=this.isHorizontal(),Z=this._computeTitleHeight();z?v={x:ma(o,this.left+m,this.right-i[0]),y:this.top+m+Z,line:0}:v={x:this.left+m,y:ma(o,this.top+Z+m,this.bottom-n[0].height),line:0},bv(this.ctx,t.textDirection);const I=E+m;this.legendItems.forEach((st,K)=>{s.strokeStyle=st.fontColor,s.fillStyle=st.fontColor;const H=s.measureText(st.text).width,G=f.textAlign(st.textAlign||(st.textAlign=l.textAlign)),Q=A+x+H;let D=v.x,R=v.y;f.setWidth(this.width),z?K>0&&D+Q+m>this.right&&(R=v.y+=I,v.line++,D=v.x=ma(o,this.left+m,this.right-i[v.line])):K>0&&R+I>this.bottom&&(D=v.x=D+n[v.line].width+m,v.line++,R=v.y=ma(o,this.top+Z+m,this.bottom-n[v.line].height));const et=f.x(D);if(j(et,R,st),D=S6(G,D+A+x,z?D+Q:this.right,t.rtl),C(f.x(D),R,st),z)v.x+=Q+m;else if(typeof st.text!="string"){const nt=d.lineHeight;v.y+=kv(st,nt)+m}else v.y+=I}),yv(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=ya(n.font),s=Ts(n.padding);if(!n.display)return;const o=Uu(t.rtl,this.left,this.width),l=this.ctx,u=n.position,f=i.size/2,d=s.top+f;let m,g=this.left,x=this.width;if(this.isHorizontal())x=Math.max(...this.lineWidths),m=this.top+d,g=ma(t.align,g,this.right-x);else{const A=this.columnSizes.reduce((N,E)=>Math.max(N,E.height),0);m=d+ma(t.align,this.top,this.bottom-A-t.labels.padding-this._computeTitleHeight())}const v=ma(u,g,g+x);l.textAlign=o.textAlign(N0(u)),l.textBaseline="middle",l.strokeStyle=n.color,l.fillStyle=n.color,l.font=i.string,Eh(l,n.text,v,m,i)}_computeTitleHeight(){const t=this.options.title,n=ya(t.font),i=Ts(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(Fu(t,this.left,this.right)&&Fu(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],Fu(t,s.left,s.left+s.width)&&Fu(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!_8(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=y8(s,i);s&&!o&&qn(n.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&qn(n.onHover,[t,i,this],this)}else i&&qn(n.onClick,[t,i,this],this)}}function v8(e,t,n,i,s){const o=x8(i,e,t,n),l=w8(s,i,t.lineHeight);return{itemWidth:o,itemHeight:l}}function x8(e,t,n,i){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,l)=>o.length>l.length?o:l)),t+n.size/2+i.measureText(s).width}function w8(e,t,n){let i=e;return typeof t.text!="string"&&(i=kv(t,n)),i}function kv(e,t){const n=e.text?e.text.length:0;return t*n}function _8(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var B0={id:"legend",_element:Nb,start(e,t,n){const i=e.legend=new Nb({ctx:e.ctx,options:n,chart:e});Es.configure(e,i,n),Es.addBox(e,i)},stop(e){Es.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;Es.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:o,useBorderRadius:l,borderRadius:u}}=e.legend.options;return e._getSortedDatasetMetas().map(f=>{const d=f.controller.getStyle(n?0:void 0),m=Ts(d.borderWidth);return{text:t[f.index].label,fillStyle:d.backgroundColor,fontColor:o,hidden:!f.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(m.width+m.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:s||d.textAlign,borderRadius:l&&(u||d.borderRadius),datasetIndex:f.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Pv extends Yl{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,n){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=Gi(i.text)?i.text.length:1;this._padding=Ts(i.padding);const o=s*ya(i.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:n,left:i,bottom:s,right:o,options:l}=this,u=l.align;let f=0,d,m,g;return this.isHorizontal()?(m=ma(u,i,o),g=n+t,d=o-i):(l.position==="left"?(m=i+t,g=ma(u,s,n),f=wn*-.5):(m=o-t,g=ma(u,n,s),f=wn*.5),d=s-n),{titleX:m,titleY:g,maxWidth:d,rotation:f}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=ya(n.font),o=i.lineHeight/2+this._padding.top,{titleX:l,titleY:u,maxWidth:f,rotation:d}=this._drawArgs(o);Eh(t,n.text,0,0,i,{color:n.color,maxWidth:f,rotation:d,textAlign:N0(n.align),textBaseline:"middle",translation:[l,u]})}}function S8(e,t){const n=new Pv({ctx:e.ctx,options:t,chart:e});Es.configure(e,n,t),Es.addBox(e,n),e.titleBlock=n}var Bv={id:"title",_element:Pv,start(e,t,n){S8(e,n)},stop(e){const t=e.titleBlock;Es.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Es.configure(e,i,n),i.options=n},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 ch={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){const u=e[t].element;if(u&&u.hasValue()){const f=u.tooltipPosition();i.add(f.x),s+=f.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((u,f)=>u+f)/i.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,l,u;for(o=0,l=e.length;o<l;++o){const f=e[o].element;if(f&&f.hasValue()){const d=f.getCenterPoint(),m=Bg(t,d);m<s&&(s=m,u=f)}}if(u){const f=u.tooltipPosition();n=f.x,i=f.y}return{x:n,y:i}}};function $r(e,t){return t&&(Gi(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function qo(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
`)>-1?e.split(`
`):e}function N8(e,t){const{element:n,datasetIndex:i,index:s}=t,o=e.getDatasetMeta(i).controller,{label:l,value:u}=o.getLabelAndValue(s);return{chart:e,label:l,parsed:o.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:u,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function Ab(e,t){const n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:l,boxHeight:u}=t,f=ya(t.bodyFont),d=ya(t.titleFont),m=ya(t.footerFont),g=o.length,x=s.length,v=i.length,A=Ts(t.padding);let N=A.height,E=0,j=i.reduce((Z,I)=>Z+I.before.length+I.lines.length+I.after.length,0);if(j+=e.beforeBody.length+e.afterBody.length,g&&(N+=g*d.lineHeight+(g-1)*t.titleSpacing+t.titleMarginBottom),j){const Z=t.displayColors?Math.max(u,f.lineHeight):f.lineHeight;N+=v*Z+(j-v)*f.lineHeight+(j-1)*t.bodySpacing}x&&(N+=t.footerMarginTop+x*m.lineHeight+(x-1)*t.footerSpacing);let C=0;const z=function(Z){E=Math.max(E,n.measureText(Z).width+C)};return n.save(),n.font=d.string,xn(e.title,z),n.font=f.string,xn(e.beforeBody.concat(e.afterBody),z),C=t.displayColors?l+2+t.boxPadding:0,xn(i,Z=>{xn(Z.before,z),xn(Z.lines,z),xn(Z.after,z)}),C=0,n.font=m.string,xn(e.footer,z),n.restore(),E+=A.width,{width:E,height:N}}function A8(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function L8(e,t,n,i){const{x:s,width:o}=i,l=n.caretSize+n.caretPadding;if(e==="left"&&s+o+l>t.width||e==="right"&&s-o-l<0)return!0}function E8(e,t,n,i){const{x:s,width:o}=n,{width:l,chartArea:{left:u,right:f}}=e;let d="center";return i==="center"?d=s<=(u+f)/2?"left":"right":s<=o/2?d="left":s>=l-o/2&&(d="right"),L8(d,e,t,n)&&(d="center"),d}function Lb(e,t,n){const i=n.yAlign||t.yAlign||A8(e,n);return{xAlign:n.xAlign||t.xAlign||E8(e,t,n,i),yAlign:i}}function j8(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function T8(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Eb(e,t,n,i){const{caretSize:s,caretPadding:o,cornerRadius:l}=e,{xAlign:u,yAlign:f}=n,d=s+o,{topLeft:m,topRight:g,bottomLeft:x,bottomRight:v}=gh(l);let A=j8(t,u);const N=T8(t,f,d);return f==="center"?u==="left"?A+=d:u==="right"&&(A-=d):u==="left"?A-=Math.max(m,x)+s:u==="right"&&(A+=Math.max(g,v)+s),{x:ja(A,0,i.width-t.width),y:ja(N,0,i.height-t.height)}}function Wd(e,t,n){const i=Ts(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function jb(e){return $r([],qo(e))}function C8(e,t,n){return Vc(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Tb(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const zv={beforeTitle:Bo,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return n[t.dataIndex]}return""},afterTitle:Bo,beforeBody:Bo,beforeLabel:Bo,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return Bn(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Bo,afterBody:Bo,beforeFooter:Bo,footer:Bo,afterFooter:Bo};function Fa(e,t,n,i){const s=e[t].call(n,i);return typeof s>"u"?zv[t].call(n,i):s}class Cb extends Yl{static positioners=ch;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new xv(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=C8(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=Fa(i,"beforeTitle",this,t),o=Fa(i,"title",this,t),l=Fa(i,"afterTitle",this,t);let u=[];return u=$r(u,qo(s)),u=$r(u,qo(o)),u=$r(u,qo(l)),u}getBeforeBody(t,n){return jb(Fa(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return xn(t,o=>{const l={before:[],lines:[],after:[]},u=Tb(i,o);$r(l.before,qo(Fa(u,"beforeLabel",this,o))),$r(l.lines,Fa(u,"label",this,o)),$r(l.after,qo(Fa(u,"afterLabel",this,o))),s.push(l)}),s}getAfterBody(t,n){return jb(Fa(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=Fa(i,"beforeFooter",this,t),o=Fa(i,"footer",this,t),l=Fa(i,"afterFooter",this,t);let u=[];return u=$r(u,qo(s)),u=$r(u,qo(o)),u=$r(u,qo(l)),u}_createItems(t){const n=this._active,i=this.chart.data,s=[],o=[],l=[];let u=[],f,d;for(f=0,d=n.length;f<d;++f)u.push(N8(this.chart,n[f]));return t.filter&&(u=u.filter((m,g,x)=>t.filter(m,g,x,i))),t.itemSort&&(u=u.sort((m,g)=>t.itemSort(m,g,i))),xn(u,m=>{const g=Tb(t.callbacks,m);s.push(Fa(g,"labelColor",this,m)),o.push(Fa(g,"labelPointStyle",this,m)),l.push(Fa(g,"labelTextColor",this,m))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=l,this.dataPoints=u,u}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let o,l=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const u=ch[i.position].call(this,s,this._eventPosition);l=this._createItems(i),this.title=this.getTitle(l,i),this.beforeBody=this.getBeforeBody(l,i),this.body=this.getBody(l,i),this.afterBody=this.getAfterBody(l,i),this.footer=this.getFooter(l,i);const f=this._size=Ab(this,i),d=Object.assign({},u,f),m=Lb(this.chart,i,d),g=Eb(i,d,m,this.chart);this.xAlign=m.xAlign,this.yAlign=m.yAlign,o={opacity:1,x:g.x,y:g.y,width:f.width,height:f.height,caretX:u.x,caretY:u.y}}this._tooltipItems=l,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const o=this.getCaretPosition(t,i,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:o}=this,{caretSize:l,cornerRadius:u}=i,{topLeft:f,topRight:d,bottomLeft:m,bottomRight:g}=gh(u),{x,y:v}=t,{width:A,height:N}=n;let E,j,C,z,Z,I;return o==="center"?(Z=v+N/2,s==="left"?(E=x,j=E-l,z=Z+l,I=Z-l):(E=x+A,j=E+l,z=Z-l,I=Z+l),C=E):(s==="left"?j=x+Math.max(f,m)+l:s==="right"?j=x+A-Math.max(d,g)-l:j=this.caretX,o==="top"?(z=v,Z=z-l,E=j-l,C=j+l):(z=v+N,Z=z+l,E=j+l,C=j-l),I=z),{x1:E,x2:j,x3:C,y1:z,y2:Z,y3:I}}drawTitle(t,n,i){const s=this.title,o=s.length;let l,u,f;if(o){const d=Uu(i.rtl,this.x,this.width);for(t.x=Wd(this,i.titleAlign,i),n.textAlign=d.textAlign(i.titleAlign),n.textBaseline="middle",l=ya(i.titleFont),u=i.titleSpacing,n.fillStyle=i.titleColor,n.font=l.string,f=0;f<o;++f)n.fillText(s[f],d.x(t.x),t.y+l.lineHeight/2),t.y+=l.lineHeight+u,f+1===o&&(t.y+=i.titleMarginBottom-u)}}_drawColorBox(t,n,i,s,o){const l=this.labelColors[i],u=this.labelPointStyles[i],{boxHeight:f,boxWidth:d}=o,m=ya(o.bodyFont),g=Wd(this,"left",o),x=s.x(g),v=f<m.lineHeight?(m.lineHeight-f)/2:0,A=n.y+v;if(o.usePointStyle){const N={radius:Math.min(d,f)/2,pointStyle:u.pointStyle,rotation:u.rotation,borderWidth:1},E=s.leftForLtr(x,d)+d/2,j=A+f/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Fg(t,N,E,j),t.strokeStyle=l.borderColor,t.fillStyle=l.backgroundColor,Fg(t,N,E,j)}else{t.lineWidth=hn(l.borderWidth)?Math.max(...Object.values(l.borderWidth)):l.borderWidth||1,t.strokeStyle=l.borderColor,t.setLineDash(l.borderDash||[]),t.lineDashOffset=l.borderDashOffset||0;const N=s.leftForLtr(x,d),E=s.leftForLtr(s.xPlus(x,1),d-2),j=gh(l.borderRadius);Object.values(j).some(C=>C!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,qg(t,{x:N,y:A,w:d,h:f,radius:j}),t.fill(),t.stroke(),t.fillStyle=l.backgroundColor,t.beginPath(),qg(t,{x:E,y:A+1,w:d-2,h:f-2,radius:j}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(N,A,d,f),t.strokeRect(N,A,d,f),t.fillStyle=l.backgroundColor,t.fillRect(E,A+1,d-2,f-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:o,bodyAlign:l,displayColors:u,boxHeight:f,boxWidth:d,boxPadding:m}=i,g=ya(i.bodyFont);let x=g.lineHeight,v=0;const A=Uu(i.rtl,this.x,this.width),N=function(H){n.fillText(H,A.x(t.x+v),t.y+x/2),t.y+=x+o},E=A.textAlign(l);let j,C,z,Z,I,st,K;for(n.textAlign=l,n.textBaseline="middle",n.font=g.string,t.x=Wd(this,E,i),n.fillStyle=i.bodyColor,xn(this.beforeBody,N),v=u&&E!=="right"?l==="center"?d/2+m:d+2+m:0,Z=0,st=s.length;Z<st;++Z){for(j=s[Z],C=this.labelTextColors[Z],n.fillStyle=C,xn(j.before,N),z=j.lines,u&&z.length&&(this._drawColorBox(n,t,Z,A,i),x=Math.max(g.lineHeight,f)),I=0,K=z.length;I<K;++I)N(z[I]),x=g.lineHeight;xn(j.after,N)}v=0,x=g.lineHeight,xn(this.afterBody,N),t.y-=o}drawFooter(t,n,i){const s=this.footer,o=s.length;let l,u;if(o){const f=Uu(i.rtl,this.x,this.width);for(t.x=Wd(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=f.textAlign(i.footerAlign),n.textBaseline="middle",l=ya(i.footerFont),n.fillStyle=i.footerColor,n.font=l.string,u=0;u<o;++u)n.fillText(s[u],f.x(t.x),t.y+l.lineHeight/2),t.y+=l.lineHeight+i.footerSpacing}}drawBackground(t,n,i,s){const{xAlign:o,yAlign:l}=this,{x:u,y:f}=t,{width:d,height:m}=i,{topLeft:g,topRight:x,bottomLeft:v,bottomRight:A}=gh(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(u+g,f),l==="top"&&this.drawCaret(t,n,i,s),n.lineTo(u+d-x,f),n.quadraticCurveTo(u+d,f,u+d,f+x),l==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(u+d,f+m-A),n.quadraticCurveTo(u+d,f+m,u+d-A,f+m),l==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(u+v,f+m),n.quadraticCurveTo(u,f+m,u,f+m-v),l==="center"&&o==="left"&&this.drawCaret(t,n,i,s),n.lineTo(u,f+g),n.quadraticCurveTo(u,f,u+g,f),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const l=ch[t.position].call(this,this._active,this._eventPosition);if(!l)return;const u=this._size=Ab(this,t),f=Object.assign({},l,this._size),d=Lb(n,t,f),m=Eb(t,f,d,n);(s._to!==m.x||o._to!==m.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=u.width,this.height=u.height,this.caretX=l.x,this.caretY=l.y,this._resolveAnimations().update(this,m))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const l=Ts(n.padding),u=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&u&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,n),bv(t,n.textDirection),o.y+=l.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),yv(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:u,index:f})=>{const d=this.chart.getDatasetMeta(u);if(!d)throw new Error("Cannot find a dataset at index "+u);return{datasetIndex:u,element:d.data[f],index:f}}),o=!yp(i,s),l=this._positionChanged(s,n);(o||l)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],l=this._getActiveElements(t,o,n,i),u=this._positionChanged(l,t),f=n||!yp(l,o)||u;return f&&(this._active=l,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),f}_getActiveElements(t,n,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(u=>this.chart.data.datasets[u.datasetIndex]&&this.chart.getDatasetMeta(u.datasetIndex).controller.getParsed(u.index)!==void 0);const l=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&l.reverse(),l}_positionChanged(t,n){const{caretX:i,caretY:s,options:o}=this,l=ch[o.position].call(this,t,n);return l!==!1&&(i!==l.x||s!==l.y)}}var z0={id:"tooltip",_element:Cb,positioners:ch,afterInit(e,t,n){n&&(e.tooltip=new Cb({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:zv},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const O8=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function M8(e,t,n,i){const s=e.indexOf(t);if(s===-1)return O8(e,t,n,i);const o=e.lastIndexOf(t);return s!==o?n:s}const D8=(e,t)=>e===null?null:ja(Math.round(e),0,t);function Ob(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Fv extends ef{static id="category";static defaults={ticks:{callback:Ob}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:s,label:o}of n)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Bn(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:M8(i,t,Ze(n,t),this._addedLabels),D8(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let l=t;l<=n;l++)s.push({value:l});return s}getLabelForValue(t){return Ob.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function R8(e,t){const n=[],{bounds:s,step:o,min:l,max:u,precision:f,count:d,maxTicks:m,maxDigits:g,includeBounds:x}=e,v=o||1,A=m-1,{min:N,max:E}=t,j=!Bn(l),C=!Bn(u),z=!Bn(d),Z=(E-N)/(g+1);let I=k5((E-N)/A/v)*v,st,K,H,G;if(I<1e-14&&!j&&!C)return[{value:N},{value:E}];G=Math.ceil(E/I)-Math.floor(N/I),G>A&&(I=k5(G*I/A/v)*v),Bn(f)||(st=Math.pow(10,f),I=Math.ceil(I*st)/st),s==="ticks"?(K=Math.floor(N/I)*I,H=Math.ceil(E/I)*I):(K=N,H=E),j&&C&&o&&d6((u-l)/o,I/1e3)?(G=Math.round(Math.min((u-l)/I,m)),I=(u-l)/G,K=l,H=u):z?(K=j?l:K,H=C?u:H,G=d-1,I=(H-K)/G):(G=(H-K)/I,dh(G,Math.round(G),I/1e3)?G=Math.round(G):G=Math.ceil(G));const Q=Math.max(P5(I),P5(K));st=Math.pow(10,Bn(f)?Q:f),K=Math.round(K*st)/st,H=Math.round(H*st)/st;let D=0;for(j&&(x&&K!==l?(n.push({value:l}),K<l&&D++,dh(Math.round((K+D*I)*st)/st,l,Mb(l,Z,e))&&D++):K<l&&D++);D<G;++D){const R=Math.round((K+D*I)*st)/st;if(C&&R>u)break;n.push({value:R})}return C&&x&&H!==u?n.length&&dh(n[n.length-1].value,u,Mb(u,Z,e))?n[n.length-1].value=u:n.push({value:u}):(!C||H===u)&&n.push({value:H}),n}function Mb(e,t,{horizontal:n,minRotation:i}){const s=Io(i),o=(n?Math.sin(s):Math.cos(s))||.001,l=.75*t*(""+e).length;return Math.min(t/o,l)}class k8 extends ef{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,n){return Bn(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const l=f=>s=n?s:f,u=f=>o=i?o:f;if(t){const f=Gu(s),d=Gu(o);f<0&&d<0?u(0):f>0&&d>0&&l(0)}if(s===o){let f=o===0?1:Math.abs(o*.05);u(o+f),t||l(s-f)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,l=R8(s,o);return t.bounds==="ticks"&&p6(l,this,"value"),t.reverse?(l.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),l}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return L0(t,this.chart.options.locale,this.options.ticks.format)}}class qv extends k8{static id="linear";static defaults={ticks:{callback:uv.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=js(t)?t:0,this.max=js(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Io(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/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}}const Up={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}},Ia=Object.keys(Up);function Db(e,t){return e-t}function Rb(e,t){if(Bn(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts;let l=t;return typeof i=="function"&&(l=i(l)),js(l)||(l=typeof i=="string"?n.parse(l,i):n.parse(l)),l===null?null:(s&&(l=s==="week"&&(Nh(o)||o===!0)?n.startOf(l,"isoWeek",o):n.startOf(l,s)),+l)}function kb(e,t,n,i){const s=Ia.length;for(let o=Ia.indexOf(e);o<s-1;++o){const l=Up[Ia[o]],u=l.steps?l.steps:Number.MAX_SAFE_INTEGER;if(l.common&&Math.ceil((n-t)/(u*l.size))<=i)return Ia[o]}return Ia[s-1]}function P8(e,t,n,i,s){for(let o=Ia.length-1;o>=Ia.indexOf(n);o--){const l=Ia[o];if(Up[l].common&&e._adapter.diff(s,i,l)>=t-1)return l}return Ia[n?Ia.indexOf(n):0]}function B8(e){for(let t=Ia.indexOf(e)+1,n=Ia.length;t<n;++t)if(Up[Ia[t]].common)return Ia[t]}function Pb(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:s}=S0(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function z8(e,t,n,i){const s=e._adapter,o=+s.startOf(t[0].value,i),l=t[t.length-1].value;let u,f;for(u=o;u<=l;u=+s.add(u,1,i))f=n[u],f>=0&&(t[f].major=!0);return t}function Bb(e,t,n){const i=[],s={},o=t.length;let l,u;for(l=0;l<o;++l)u=t[l],s[u]=l,i.push({value:u,major:!1});return o===0||!n?i:z8(e,i,s,n)}class zb extends ef{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};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,n={}){const i=t.time||(t.time={}),s=this._adapter=new WN._date(t.adapters.date);s.init(n),hh(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:Rb(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,i=t.time.unit||"day";let{min:s,max:o,minDefined:l,maxDefined:u}=this.getUserBounds();function f(d){!l&&!isNaN(d.min)&&(s=Math.min(s,d.min)),!u&&!isNaN(d.max)&&(o=Math.max(o,d.max))}(!l||!u)&&(f(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&f(this.getMinMax(!1))),s=js(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=js(o)&&!isNaN(o)?o:+n.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){const t=this.options,n=t.time,i=t.ticks,s=i.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,l=this.max,u=v6(s,o,l);return this._unit=n.unit||(i.autoSkip?kb(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):P8(this,u.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:B8(this._unit),this.initOffsets(s),t.reverse&&u.reverse(),Bb(this,u,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const l=t.length<3?.5:.25;n=ja(n,0,l),i=ja(i,0,l),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,l=o.unit||kb(o.minUnit,n,i,this._getLabelCapacity(n)),u=Ze(s.ticks.stepSize,1),f=l==="week"?o.isoWeekday:!1,d=Nh(f)||f===!0,m={};let g=n,x,v;if(d&&(g=+t.startOf(g,"isoWeek",f)),g=+t.startOf(g,d?"day":l),t.diff(i,n,l)>1e5*u)throw new Error(n+" and "+i+" are too far apart with stepSize of "+u+" "+l);const A=s.ticks.source==="data"&&this.getDataTimestamps();for(x=g,v=0;x<i;x=+t.add(x,u,l),v++)Pb(m,x,A);return(x===i||s.bounds==="ticks"||v===1)&&Pb(m,x,A),Object.keys(m).sort(Db).map(N=>+N)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,o=this._unit,l=n||s[o];return this._adapter.format(t,l)}_tickFormatFunction(t,n,i,s){const o=this.options,l=o.ticks.callback;if(l)return qn(l,[t,n,i],this);const u=o.time.displayFormats,f=this._unit,d=this._majorUnit,m=f&&u[f],g=d&&u[d],x=i[n],v=d&&g&&x&&x.major;return this._adapter.format(t,s||(v?g:m))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n<i;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,i=this.ctx.measureText(t).width,s=Io(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),l=Math.sin(s),u=this._resolveTickFontOptions(0).size;return{w:i*o+u*l,h:i*l+u*o}}_getLabelCapacity(t){const n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(t,0,Bb(this,[t],this._majorUnit),s),l=this._getLabelSize(o),u=Math.floor(this.isHorizontal()?this.width/l.w:this.height/l.h)-1;return u>0?u:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n<i;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,i;if(t.length)return t;const s=this.getLabels();for(n=0,i=s.length;n<i;++n)t.push(Rb(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return w6(t.sort(Db))}}function Xd(e,t,n){let i=0,s=e.length-1,o,l,u,f;n?(t>=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=zc(e,"pos",t)),{pos:o,time:u}=e[i],{pos:l,time:f}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=zc(e,"time",t)),{time:o,pos:u}=e[i],{time:l,pos:f}=e[s]);const d=l-o;return d?u+(f-u)*(t-o)/d:u}class OL extends zb{static id="timeseries";static defaults=zb.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Xd(n,this.min),this._tableRange=Xd(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],o=[];let l,u,f,d,m;for(l=0,u=t.length;l<u;++l)d=t[l],d>=n&&d<=i&&s.push(d);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(l=0,u=s.length;l<u;++l)m=s[l+1],f=s[l-1],d=s[l],Math.round((m+f)/2)!==d&&o.push({time:d,pos:l/(u-1)});return o}_generate(){const t=this.min,n=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Xd(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return Xd(this._table,i*this._tableRange+this._minPos,!0)}}const Uv="label";function Fb(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function F8(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Iv(e,t){e.labels=t}function Hv(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Uv;const i=[];e.datasets=t.map(s=>{const o=e.datasets.find(l=>l[n]===s[n]);return!o||!s.data||i.includes(o)?{...s}:(i.push(o),Object.assign(o,s),o)})}function q8(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Uv;const n={labels:[],datasets:[]};return Iv(n,e.labels),Hv(n,e.datasets,t),n}function U8(e,t){const{height:n=150,width:i=300,redraw:s=!1,datasetIdKey:o,type:l,data:u,options:f,plugins:d=[],fallbackContent:m,updateMode:g,...x}=e,v=ot.useRef(null),A=ot.useRef(null),N=()=>{v.current&&(A.current=new lr(v.current,{type:l,data:q8(u,o),options:f&&{...f},plugins:d}),Fb(t,A.current))},E=()=>{Fb(t,null),A.current&&(A.current.destroy(),A.current=null)};return ot.useEffect(()=>{!s&&A.current&&f&&F8(A.current,f)},[s,f]),ot.useEffect(()=>{!s&&A.current&&Iv(A.current.config.data,u.labels)},[s,u.labels]),ot.useEffect(()=>{!s&&A.current&&u.datasets&&Hv(A.current.config.data,u.datasets,o)},[s,u.datasets]),ot.useEffect(()=>{A.current&&(s?(E(),setTimeout(N)):A.current.update(g))},[s,f,u.labels,u.datasets,g]),ot.useEffect(()=>{A.current&&(E(),setTimeout(N))},[l]),ot.useEffect(()=>(N(),()=>E()),[]),Jt.createElement("canvas",{ref:v,role:"img",height:n,width:i,...x},m)}const I8=ot.forwardRef(U8);function Vv(e,t){return lr.register(t),ot.forwardRef((n,i)=>Jt.createElement(I8,{...n,ref:i,type:e}))}const bh=Vv("line",GN),H8=Vv("doughnut",YN);lr.register(l8,z0,B0);function V8(){const[e,t]=ot.useState(!0),[n,i]=ot.useState(null),{authData:s}=ot.useContext(Ya),[o,l]=ot.useState({audiogramTests:0,tympanogramTests:0}),[u,f]=ot.useState(0),[d,m]=ot.useState([]),[g,x]=ot.useState({labels:["Audiogram","Tympanogram"],datasets:[{data:[0,0],backgroundColor:["rgb(37 99 235)","rgb(147 197 253)"],hoverBackgroundColor:["darkblue","darkblue"],pointRadius:0,pointStyle:"none",borderColor:n==="light"?"rgb(229, 231, 235)":"rgb(17, 24, 39)"}]}),v=Ri(),A=async()=>{try{await Promise.all([N(),E(),j()])}catch{Be.error("Failed to load dashboard data")}finally{t(!1)}},N=async()=>{try{const z=await De.get("/api/tests/audiogramTests/count",{params:{clinic_id:s?.clinicId??-1},withCredentials:!0}),Z=await De.get("/api/tests/tympanogramTests/count",{params:{clinic_id:s?.clinicId??-1},withCredentials:!0});l({audiogramTests:z.data.count,tympanogramTests:Z.data.count}),x(I=>({...I,datasets:[{...I.datasets[0],data:[z.data.count,Z.data.count]}]}))}catch{l({audiogramTests:"Error",tympanogramTests:"Error"})}},E=async()=>{try{const z=await De.get("/api/patients/count",{params:{clinic_id:s?.clinicId??-1},withCredentials:!0});f(z.data)}catch{f("Error")}},j=async()=>{try{const z=await De.get("/api/patients",{params:{clinic_id:s?.clinicId??-1,per_page:5},withCredentials:!0});m(z.data.patients)}catch{m([])}},C={responsive:!0,maintainAspectRatio:!0,plugins:{legend:{display:!1,position:"bottom"},tooltip:{enabled:!0},textPlugin:!1}};return ot.useEffect(()=>{x(z=>({...z,datasets:[{...z.datasets[0],borderColor:n==="light"?"rgb(229, 231, 235)":"rgb(17, 24, 39)"}]}))},[n]),ot.useEffect(()=>{document.title="Dashboard | Audiogram",A();const z=window.matchMedia("(prefers-color-scheme: dark)").matches;i(z?"dark":"light")},[]),L.jsxs("div",{className:"flex flex-col",children:[e&&L.jsx("div",{className:"h-screen w-screen top-0 left-0 fixed bg-base-100 opacity-50 z-50 flex items-center justify-center",children:L.jsx("span",{className:"loading loading-spinner loading-lg"})}),L.jsx("div",{className:"p-6",children:L.jsxs("h1",{className:"text-3xl font-bold",children:["Welcome, ",s?.username??"","!"]})}),L.jsxs("div",{className:"p-6 grid grid-cols-2 lg:grid-cols-4 gap-6",children:[L.jsxs("div",{onClick:()=>{v("/dashboard/patients")},className:"p-2 rounded-xl bg-base-300 col-span-1 flex flex-col justify-center shadow-lg hover:cursor-pointer",children:[L.jsx("h3",{className:"px-4 text-xl text-start font-semibold",children:"Patients"}),L.jsx("h3",{className:"text-4xl text-center h-2/3 py-3 pt-6 font-semibold",children:u})]}),L.jsxs("div",{className:"p-2 rounded-xl bg-base-300 col-span-1 flex flex-col justify-center shadow-lg hover:cursor-pointer",children:[L.jsx("h3",{className:"px-4 text-xl text-start font-semibold",children:"Tests"}),L.jsx("h3",{className:"text-4xl text-center h-2/3 py-3 pt-6 font-semibold",children:String(+o.audiogramTests+ +o.tympanogramTests)})]}),L.jsxs("div",{className:"p-2 rounded-xl bg-base-300 col-span-2 flex flex-col justify-center shadow-lg hover:cursor-pointer",children:[L.jsx("h3",{className:"px-4 text-xl text-start font-semibold",children:"Stats"}),L.jsxs("div",{className:"h-2/3 grid grid-cols-2",children:[L.jsxs("div",{className:"px-4 py-6 col-span-1 flex flex-col justify-start items-start",children:[L.jsxs("p",{className:"font-medium",children:["Audiogram: ",o.audiogramTests]}),L.jsxs("p",{className:"font-medium",children:["Tympanogram: ",o.tympanogramTests]})]}),L.jsx("div",{className:"-mt-6 col-span-1 h-32 py-4 flex justify-center items-center",children:L.jsx(H8,{data:g,options:C})})]})]})]}),L.jsx("div",{className:"row-span-1 md:row-span-2 hidden w-full md:grid place-items-center",children:L.jsxs("div",{id:"recent-patients",onClick:()=>{v("/dashboard/patients")},className:"min-h-[200px] rounded-xl shadow-lg h-4/5 w-full px-6 grid grid-rows-6 hover:cursor-pointer",children:[L.jsx("div",{className:"row-span-2 flex items-center justify-start",children:L.jsx("h3",{className:"text-xl md:text-2xl text-start py-3 font-semibold",children:"Recent Patients"})}),L.jsx("div",{className:"row-span-4 bg-base-300 w-full rounded-lg min-h-[150px] overflow-auto",children:L.jsxs("table",{className:"w-full table text-center",children:[L.jsx("thead",{children:L.jsxs("tr",{children:[L.jsx("th",{children:"Sr. No"}),L.jsx("th",{children:"Name"}),L.jsx("th",{children:"Phone Number"}),L.jsx("th",{children:"DOB"}),L.jsx("th",{children:"Sex"})]})}),d&&d.length>0?L.jsx("tbody",{className:"p-4",children:d.map((z,Z)=>L.jsxs("tr",{children:[L.jsx("td",{children:Z+1}),L.jsx("td",{children:z.patient_name}),L.jsx("td",{children:z.patient_phone}),L.jsx("td",{children:new Date(z.patient_dob).toLocaleDateString("en-GB")}),L.jsx("td",{children:z.patient_sex})]},Z))}):L.jsx("tbody",{className:"p-4",children:L.jsx("tr",{children:L.jsx("td",{colSpan:5,children:L.jsx("p",{children:"No recent patients"})})})})]})})]})})]})}function Y8(){const{authData:e}=ot.useContext(Ya),{register:t,handleSubmit:n,watch:i,formState:{errors:s,isSubmitting:o}}=zp(),l=Ri(),u=n(async f=>{f={clinic_id:e?.clinicId??-1,patient_name:f.name,patient_dob:f.dob,patient_phone:f.phone,patient_sex:f.sex};try{const d=await De.post("/api/patients",f,{withCredentials:!0});Be.success("Patient added successfully"),l(`/dashboard/patients/${d.data.id}/add-test`)}catch(d){console.error("Error adding patient:",d),Be.error(d.response.data.message??"Something went wrong")}});return ot.useEffect(()=>{document.title="Add Patient | Audiogram"},[]),L.jsxs("div",{className:"flex flex-col",children:[o&&L.jsx("div",{className:"h-screen w-screen top-0 left-0 fixed bg-base-100 opacity-50 z-50 flex items-center justify-center",children:L.jsx("span",{className:"loading loading-spinner loading-lg"})}),L.jsx("div",{className:"p-6",children:L.jsx("h1",{className:"text-3xl font-bold",children:"Add Patient"})}),L.jsxs("form",{className:"flex flex-col p-6",onSubmit:u,children:[L.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Patient Name"})}),L.jsx("input",{type:"text",placeholder:"Enter patient name",className:`w-full input input-bordered ${s.name?"input-error":""}`,...t("name",{required:"Name is required",minLength:{value:3,message:"Name must be at least 3 characters"}})}),s.name&&L.jsx("p",{className:"text-error text-sm mt-1",children:s.name.message})]}),L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Phone"})}),L.jsx("input",{type:"tel",placeholder:"Enter your phone number",className:`w-full input input-bordered ${s.phone?"input-error":""}`,...t("phone",{required:"Phone number is required",pattern:{value:/^(0\d{10}|(\+92)\d{10})$/,message:"Phone number should be valid"}})}),s.phone&&L.jsx("p",{className:"text-error text-sm mt-1",children:s.phone.message})]}),L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"DOB"})}),L.jsx("input",{type:"date",className:`w-full input input-bordered ${s.dob?"input-error":""} ${i("dob")==""?"text-base-content/50":""}`,...t("dob",{required:"Date of birth is required"})}),s.dob&&L.jsx("p",{className:"text-error text-sm mt-1",children:s.dob.message})]}),L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Sex"})}),L.jsxs("select",{className:`w-full select select-bordered ${s.sex?"input-error":""} ${i("sex")==""?"text-base-content/50":""}`,...t("sex",{required:"Sex is required"}),children:[L.jsx("option",{value:"",children:"Select sex"}),L.jsx("option",{value:"male",children:"Male"}),L.jsx("option",{value:"female",children:"Female"})]}),s.sex&&L.jsx("p",{className:"text-error text-sm mt-1",children:s.sex.message})]})]}),L.jsx("button",{className:"w-full btn mt-10",type:"submit",children:"Add Patient"})]})]})}function G8(){const{authData:e}=ot.useContext(Ya),[t,n]=ot.useState([]),[i,s]=ot.useState(""),[o,l]=ot.useState([]),[u,f]=ot.useState(!1),d=Ri(),[m,g]=ot.useState(1),[x,v]=ot.useState(1),A=50,[N,E]=ot.useState(!1),[j,C]=ot.useState(!1),z=ot.useRef(null);ot.useEffect(()=>{if(e?.clinicId)return z.current&&clearTimeout(z.current),z.current=setTimeout(async()=>{if(i.trim()===""){l(t);return}try{const st=await De.get("/api/patients",{params:{clinic_id:e?.clinicId??-1,per_page:A,page:m,search:i},withCredentials:!0});l(st.data.patients)}catch(st){Be.error(st.response?.data?.messages?.clinic_id??"Something went wrong")}},300),()=>{clearTimeout(z.current)}},[i]);const Z=async()=>{if(!u&&e?.clinicId){f(!0);try{const st=await De.get("/api/patients",{params:{clinic_id:e?.clinicId??-1,per_page:A,page:m},withCredentials:!0});v(st.data.pager?.pageCount),E(st.data.pager?.previous!==null),C(st.data.pager?.next!==null),n(st.data.patients),l(st.data.patients)}catch(st){Be.error(st.response?.data?.messages?.clinic_id??"Something went wrong")}finally{f(!1)}}},I=st=>{st>=1&&st<=x&&g(st)};return ot.useEffect(()=>{Z()},[m,e]),ot.useEffect(()=>{document.title="Patients | Audiogram"},[]),L.jsxs("div",{className:"flex flex-col",children:[L.jsxs("div",{className:"p-6 flex flex-col md:flex-row justify-between items-center",children:[L.jsx("h1",{className:"text-3xl font-bold",children:"Patients"}),L.jsx("input",{type:"text",placeholder:"Search Patient",value:i,onChange:st=>s(st.target.value),className:"text-center input input-bordered mt-5 md:mt-0"}),L.jsx("button",{className:"btn mt-5 md:mt-0",onClick:()=>d("/dashboard/add-patient"),children:"Add New Patient"})]}),L.jsxs("div",{className:"overflow-x-auto",children:[u?L.jsx("div",{className:"w-full h-[70vh] flex justify-center items-center py-10",children:L.jsx("span",{className:"loading loading-spinner"})}):L.jsx("div",{className:"max-h-[80vh] overflow-auto",children:L.jsxs("table",{className:"table max-h-[70vh] overflow-auto w-full text-center",children:[L.jsx("thead",{children:L.jsxs("tr",{children:[L.jsx("th",{children:"Sr No."}),L.jsx("th",{children:"Name"}),L.jsx("th",{children:"Phone Number"}),L.jsx("th",{children:"Date Of Birth"}),L.jsx("th",{children:"Sex"}),L.jsx("th",{children:"Show Tests"}),L.jsx("th",{children:"Add Test"})]})}),L.jsx("tbody",{children:o.length===0?L.jsx("tr",{children:L.jsx("td",{colSpan:7,children:"No patients found."})}):t.map(st=>L.jsxs("tr",{children:[L.jsx("td",{children:st.patient_id}),L.jsx("td",{children:st.patient_name}),L.jsx("td",{children:st.patient_phone}),L.jsxs("td",{children:[" ",st.patient_dob!=null?new Date(st.patient_dob).toLocaleDateString("en-GB"):"N/A"]}),L.jsx("td",{children:st.patient_sex}),L.jsx("td",{children:L.jsx(us,{to:`/dashboard/patients/${st?.patient_id}/tests`,children:L.jsx("button",{className:"btn btn-sm",children:"Show Tests"})})}),L.jsx("td",{children:L.jsx(us,{to:`/dashboard/patients/${st?.patient_id}/add-test`,children:L.jsx("button",{className:"btn btn-sm",children:"Add Test"})})})]},st.patient_id))})]})}),L.jsxs("div",{className:"flex justify-center items-center mt-4 space-x-2",children:[L.jsx("button",{className:"btn btn-sm",disabled:N===!1,onClick:()=>I(m-1),children:"Previous"}),L.jsxs("span",{className:"text-sm",children:["Page ",m," of ",x," - Rows per page:"," ",A]}),L.jsx("button",{className:"btn btn-sm",disabled:j===!1,onClick:()=>I(m+1),children:"Next"})]})]})]})}function W8(){const{patient:e}=Qu();return ot.useEffect(()=>{document.title="Add Test | Audiogram"}),L.jsxs("div",{className:"flex flex-col",children:[L.jsx("div",{className:"p-6",children:L.jsx("h1",{className:"text-3xl font-bold",children:"Add Test"})}),L.jsxs("div",{className:"flex flex-col justify-center items-center",children:[L.jsx("h3",{className:"text-xl font-semibold p-4",children:"Select a Test Type"}),L.jsxs("div",{className:"flex flex-col md:flex-row gap-6 p-6",children:[L.jsx(us,{to:`/dashboard/patients/${e}/add-test/audiogram`,children:L.jsx("button",{className:"btn btn-xl w-48",children:"Audiogram"})}),L.jsx(us,{to:`/dashboard/patients/${e}/add-test/tympanogram`,children:L.jsx("button",{className:"btn btn-xl w-48",children:"Tympanogram"})})]})]})]})}const Yv=ot.createContext();function X8({children:e}){const[t,n]=ot.useState(null);return L.jsx(Yv.Provider,{value:{printData:t,setPrintData:n},children:e})}function nf(){return ot.useContext(Yv)}function K8(){const{patient:e}=Qu(),{authData:t}=ot.useContext(Ya),[n,i]=ot.useState({}),s=Ri(),{setPrintData:o}=nf(),[l,u]=ot.useState(!1),f=[125,250,500,1e3,2e3,4e3,8e3],d=[10,20,30,40,50,60,70,80,90,100,110,120],[m,g]=ot.useState(["left","right"].flatMap(K=>[1,2,3,4].map(H=>({test_no:H.toString(),ear:K,...f.reduce((G,Q)=>(G[`frequency_${Q}`]=null,G),{})})))),[x,v]=ot.useState(!1),[A,N]=ot.useState(d.map(()=>null)),E=["O","△","<","["],j=["X","[]",">","]"],C=(K,H,G,Q)=>{const D=isNaN(parseInt(Q,10))?null:parseInt(Q,10);g(R=>R.map(et=>et.ear===K&&et.test_no===G.toString()?{...et,[`frequency_${f[H]}`]:D}:et))},z=(K,H)=>{const G=[...A];G[K]=H,N(G)},Z=async()=>{const K=new Date().toISOString().replace("T"," ").slice(0,19),H={patient_id:e,clinic_id:t?.clinicId??-1,test_date:K,puretone_audiometry:m,speech_audiometry:A,include_speech_audiometry:x};u(!0);try{const G=await De.post("/api/tests/audiogramTests",H,{withCredentials:!0});Be.success("Test added successfully"),s(`/dashboard/patients/${e}/tests/audiogram/${G.data.audiogramtest_id}/report`)}catch(G){const Q=G.response.data?.messages??{},D=Object.values(Q).join(", ");Be.error(D??"Something went wrong")}finally{u(!1)}},I=()=>{e&&m?(o({patientData:n,testData:{pureToneData:m,speechData:A,showSpeechTest:x}}),s("/dashboard/prints/audiogram")):Be.error("Patient Id and Test Data is required")};async function st(){try{const K=await De.get(`/api/patients/${e}`,{withCredentials:!0});i(K.data??{})}catch(K){const H=K.response.data?.messages??{},G=Object.values(H).join(", ");Be.error(G??"Something went wrong")}}return ot.useEffect(()=>{st()},[e]),ot.useEffect(()=>{document.title="Add Audiogram Test Report | Audiogram"},[]),L.jsxs("div",{className:"flex flex-col",children:[L.jsxs("div",{className:"p-6 flex justify-between items-center",children:[L.jsx("h1",{className:"text-3xl font-bold",children:"Add Test Report - Audiogram"}),L.jsxs("div",{className:"flex-col space-y-4 md:space-y-0 md:flex-row md:space-x-4",children:[L.jsx("button",{onClick:I,className:"btn w-40",children:"Print"}),L.jsx("button",{onClick:Z,className:"btn w-40",children:"Save"})]})]}),l&&L.jsx("div",{className:"h-screen w-screen top-0 left-0 fixed bg-base-100 opacity-50 z-50 flex items-center justify-center",children:L.jsx("span",{className:"loading loading-spinner loading-lg"})}),L.jsxs("div",{className:"flex flex-col md:flex-row p-6 gap-4",children:[L.jsxs("div",{className:"flex-3 border-r-0 md:border-r-2 pr-4",children:[L.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Pure Tone Audiometry"}),L.jsxs("div",{className:"pt-4 gap-4 grid grid-cols-4 lg:grid-cols-8",children:[L.jsx("div",{className:"col-span-1 flex flex-col gap-4 pt-12",children:f.map((K,H)=>L.jsx("label",{className:"w-full text-center font-medium",children:K},K))}),L.jsxs("div",{className:"col-span-3 grid grid-cols-4",children:[E.map(K=>L.jsx("p",{className:"ml-6 font-semibold",children:K},K)),[1,2,3,4].map(K=>L.jsx("div",{className:"flex flex-col gap-2 pt-5",children:f.map((H,G)=>L.jsx("input",{type:"number",placeholder:"value",value:m.find(Q=>Q.ear==="right"&&Q.test_no===K.toString())?.[`frequency_${H}`]||"",onChange:Q=>C("right",G,K,Q.target.value),className:"input input-sm text-center"},`right-${H}-${K}`))},K))]}),L.jsx("div",{className:"col-span-1 flex flex-col gap-4 pt-12",children:f.map((K,H)=>L.jsx("label",{className:"w-full text-center font-medium",children:K},K))}),L.jsxs("div",{className:"col-span-3 grid grid-cols-4",children:[j.map(K=>L.jsx("p",{className:"ml-6 font-semibold",children:K},K)),[1,2,3,4].map(K=>L.jsx("div",{className:"flex flex-col gap-2 pt-5",children:f.map((H,G)=>L.jsx("input",{type:"number",placeholder:"value",value:m.find(Q=>Q.ear==="left"&&Q.test_no===K.toString())?.[`frequency_${H}`]||"",onChange:Q=>C("left",G,K,Q.target.value),className:"input input-sm text-center"},`left-${H}-${K}`))},K))]})]})]}),L.jsxs("div",{className:"flex-1",children:[L.jsxs("div",{className:"flex items-center",children:[L.jsx("h2",{className:"text-xl font-semibold",children:"Speech Audiometry"}),L.jsx("input",{type:"checkbox",checked:x,onChange:()=>v(!x),className:"checkbox ml-2"})]}),x&&L.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 w-full gap-4 pt-16",children:d.map((K,H)=>L.jsxs("div",{className:"col-span-1 flex gap-4 items-center",children:[L.jsx("label",{className:"text-center font-medium",children:K}),L.jsx("input",{type:"number",value:A[H]||"",placeholder:"value",onChange:G=>z(H,parseInt(G.target.value)||null),className:"input input-sm text-center"})]},K))})]})]})]})}function $8(){const{patient:e,test:t}=Qu(),{authData:n}=ot.useContext(Ya),[i,s]=ot.useState({}),o=Ri(),{setPrintData:l}=nf(),[u,f]=ot.useState(!1),[d,m]=ot.useState({}),[g,x]=ot.useState({left_volume:"",right_volume:"",left_compliance:"",right_compliance:"",left_pressure_1:"",right_pressure_1:"",left_pressure_2:"",right_pressure_2:"",left_pressure_3:"",right_pressure_3:"",frequencies:[]}),[v,A]=ot.useState(""),[N,E]=ot.useState(""),[j,C]=ot.useState("");ot.useEffect(()=>{d&&x({left_volume:d.left_volume??"",right_volume:d.right_volume??"",left_compliance:d.left_compliance??"",right_compliance:d.right_compliance??"",left_pressure_1:d.left_pressure_1??-300,right_pressure_1:d.right_pressure_1??-300,left_pressure_2:d.left_pressure_2??"",right_pressure_2:d.right_pressure_2??"",left_pressure_3:d.left_pressure_3??200,right_pressure_3:d.right_pressure_3??200,frequencies:d.frequencies?.map(G=>({pressure:G?.pressure??"",frequency:G?.frequency??"",level:G?.level??""}))??[]})},[d]);const z=()=>{const G=Number(N),Q=Number(j);if(v&&!isNaN(G)&&!isNaN(Q)){const D={pressure:v,frequency:N,level:j};x(R=>({...R,frequencies:[...R.frequencies,D]})),A(""),E(""),C("")}else Be.error("Please fill all the fields")},Z=G=>{x(Q=>({...Q,frequencies:Q.frequencies.filter((D,R)=>R!==G)}))},I=async()=>{f(!0);try{const G=new Date().toISOString().replace("T"," ").slice(0,19),Q={patient_id:e,clinic_id:n?.clinicId??-1,test_date:G,left_volume:g.left_volume===""?null:g.left_volume,right_volume:g.right_volume===""?null:g.right_volume,left_compliance:g.left_compliance===""?null:g.left_compliance,right_compliance:g.right_compliance===""?null:g.right_compliance,left_pressure_1:g.left_pressure_1===""?null:g.left_pressure_1,right_pressure_1:g.right_pressure_1===""?null:g.right_pressure_1,left_pressure_2:g.left_pressure_2===""?null:g.left_pressure_2,right_pressure_2:g.right_pressure_2===""?null:g.right_pressure_2,left_pressure_3:g.left_pressure_3===""?null:g.left_pressure_3,right_pressure_3:g.right_pressure_3===""?null:g.right_pressure_3,frequencies:g.frequencies,tympanogramtest_id:t},D=await De.post("/api/tests/tympanogramTests",Q,{withCredentials:!0});Be.success("Test added successfully"),o(`/dashboard/patients/${e}/tests/tympanogram/${D.data.tympanogramtest_id}/report`)}catch(G){const Q=G.response?.data?.messages??{},D=Object.values(Q).join(`
`);Be.error(D??"Something went wrong")}finally{f(!1)}},st=()=>{e&&g?(l({patientData:i,testData:{tympanogramTest:g}}),o("/dashboard/prints/tympanogram")):Be.error("Patient Id and Test Data is required")},K=(G,Q)=>{x(D=>({...D,[Q]:G.target.value})),setButtonState("Save")};async function H(){try{const G=await De.get(`/api/patients/${e}`,{withCredentials:!0});s(G.data??{})}catch(G){const Q=G.response.data?.messages??{},D=Object.values(Q).join(", ");Be.error(D??"Something went wrong")}}return ot.useEffect(()=>{H()},[e]),ot.useEffect(()=>{document.title="Add Tympanogram Test Report | Audiogram"},[]),L.jsxs("div",{className:"flex flex-col",children:[L.jsxs("div",{className:"p-6 flex justify-between items-center",children:[L.jsx("h1",{className:"text-3xl font-bold",children:"Add Test Report - Tympanogram"}),L.jsxs("div",{className:"flex-col space-y-4 md:space-y-0 md:flex-row md:space-x-4",children:[L.jsx("button",{onClick:st,className:"btn w-40",children:"Print"}),L.jsx("button",{onClick:I,className:"btn w-40",children:"Save"})]})]}),u&&L.jsx("div",{className:"h-screen w-screen top-0 left-0 fixed bg-base-100 opacity-50 z-50 flex items-center justify-center",children:L.jsx("span",{className:"loading loading-spinner loading-lg"})}),L.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[L.jsxs("div",{className:"mb-2 md:mt-10 pt-20",children:[L.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 pb-4",children:[L.jsx("div",{}),L.jsx("h4",{className:"col-span-1",children:"Right Ear"}),L.jsx("h4",{className:"col-span-1",children:"Left Ear"})]}),L.jsxs("div",{className:"space-y-4",children:[L.jsxs("div",{className:"flex flex-col md:flex-row items-center",children:[L.jsx("label",{className:"w-full md:w-1/4 font-medium",children:"Volume"}),L.jsxs("div",{className:"w-full md:w-3/4 flex flex-col md:flex-row gap-2",children:[L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:g.right_volume,onChange:G=>K(G,"right_volume")}),L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:g.left_volume,onChange:G=>K(G,"left_volume")})]})]}),L.jsxs("div",{className:"flex flex-col md:flex-row items-center",children:[L.jsx("label",{className:"w-full md:w-1/4 font-medium",children:"Compliance"}),L.jsxs("div",{className:"w-full md:w-3/4 flex flex-col md:flex-row gap-2",children:[L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:g.right_compliance,onChange:G=>K(G,"right_compliance")}),L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:g.left_compliance,onChange:G=>K(G,"left_compliance")})]})]}),L.jsxs("div",{className:"flex flex-col md:flex-row items-center",children:[L.jsx("label",{className:"w-full md:w-1/4 font-medium",children:"Pressure"}),L.jsxs("div",{className:"w-full md:w-3/4 flex flex-col md:flex-row gap-2",children:[L.jsxs("div",{className:"flex fflex-row gap-2",children:[L.jsx("input",{type:"number",inputMode:"decimal",placeholder:"value",className:"input text-center",value:g.right_pressure_1,onChange:G=>K(G,"right_pressure_1")}),L.jsx("input",{type:"number",inputMode:"decimal",placeholder:"value",className:"input text-center",value:g.right_pressure_2,onChange:G=>K(G,"right_pressure_2")}),L.jsx("input",{type:"number",inputMode:"numeric",placeholder:"value",className:"input text-center",value:g.right_pressure_3,onChange:G=>K(G,"right_pressure_3")})]}),L.jsxs("div",{className:"flex flex-row gap-2",children:[L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:g.left_pressure_1,onChange:G=>K(G,"left_pressure_1")}),L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:g.left_pressure_2,onChange:G=>K(G,"left_pressure_2")}),L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:g.left_pressure_3,onChange:G=>K(G,"left_pressure_3")})]})]})]})]})]}),L.jsx("div",{className:"mb-2 px-4 mt-10 md:border-l-2",children:L.jsxs("div",{className:"flex flex-col h-full",children:[L.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[L.jsxs("div",{children:[L.jsx("label",{className:"text-sm",children:"Pressure"}),L.jsxs("select",{className:"select",value:v,onChange:G=>A(G.target.value),children:[L.jsx("option",{value:"",children:"Choose an Image"}),L.jsx("option",{value:"image1",children:"Image 1"}),L.jsx("option",{value:"image2",children:"Image 2"}),L.jsx("option",{value:"image3",children:"Image 3"}),L.jsx("option",{value:"image4",children:"Image 4"}),L.jsx("option",{value:"image5",children:"Image 5"})]})]}),L.jsxs("div",{children:[L.jsx("label",{className:"text-sm",children:"Frequency"}),L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:N,onChange:G=>{E(G.target.value),setButtonState("Save")}})]}),L.jsxs("div",{children:[L.jsx("label",{className:"text-sm",children:"Level"}),L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:j,onChange:G=>{C(G.target.value),setButtonState("Save")}})]}),L.jsx("div",{className:"flex items-end",children:L.jsx("button",{onClick:z,className:"btn btn-success w-full",children:"Add Test"})})]}),L.jsx("div",{className:"flex justify-center mb-4"}),L.jsx("div",{className:"mt-4 overflow-y-auto max-h-56 flex-2",children:g.frequencies.length===0?L.jsx("p",{className:"text-center ",children:"No tests added yet."}):L.jsx("ul",{className:"space-y-4",children:g.frequencies.map((G,Q)=>L.jsxs("li",{className:"flex items-center justify-between p-4 rounded-lg shadow-md border",children:[L.jsxs("div",{children:[L.jsxs("p",{children:[L.jsx("strong",{children:"Pressure:"})," ",G.pressure]}),L.jsxs("p",{children:[L.jsx("strong",{children:"Frequency:"})," ",G.frequency," Hz"]}),L.jsxs("p",{children:[L.jsx("strong",{children:"Level:"})," ",G.level," dB"]})]}),L.jsx("button",{onClick:()=>Z(Q),className:"btn btn-error",children:"Delete"})]},Q))})})]})})]})]})}function Z8(){const{authData:e}=ot.useContext(Ya),{patient:t}=Qu(),n=Ri(),[i,s]=ot.useState([]),[o,l]=ot.useState([]),[u,f]=ot.useState(!1),d=async()=>{f(!0);try{const[m,g]=await Promise.all([De.get("/api/tests/audiogramTests",{params:{patient_id:t,clinic_id:e?.clinicId??-1},withCredentials:!0}),De.get("/api/tests/tympanogramTests",{params:{patient_id:t,clinic_id:e?.clinicId??-1},withCredentials:!0})]);s(m.data.reverse()),l(g.data.reverse())}catch(m){Be.error(m.response.data.messages.error??"Something went wrong")}finally{f(!1)}};return ot.useEffect(()=>{document.title="Patient Tests | Audiogram"},[]),ot.useEffect(()=>{d()},[t]),L.jsxs("div",{className:"flex flex-col",children:[L.jsxs("div",{className:"p-6 flex justify-between items-center",children:[L.jsx("h1",{className:"text-3xl font-bold",children:"Patient Tests"}),L.jsx("button",{className:"btn",onClick:()=>n(`/dashboard/patients/${t}/add-test`),children:"Add New Test"})]}),u&&L.jsx("div",{className:"h-screen w-screen top-0 left-0 fixed bg-base-100 opacity-50 z-50 flex items-center justify-center",children:L.jsx("span",{className:"loading loading-spinner loading-lg"})}),L.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 p-6",children:[L.jsxs("div",{className:"md:border-r-2",children:[L.jsx("h3",{className:"text-lg font-semibold text-center",children:"Audiogram Tests"}),L.jsxs("table",{className:"table h-[300px] w-full text-center",children:[L.jsx("thead",{children:L.jsxs("tr",{children:[L.jsx("th",{children:"Date"}),L.jsx("th",{children:"Action"})]})}),L.jsxs("tbody",{children:[i.map(m=>L.jsxs("tr",{children:[L.jsx("td",{children:new Date(m.test_date).toLocaleString("en-GB")}),L.jsx("td",{children:L.jsx(us,{to:`/dashboard/patients/${t}/tests/audiogram/${m.audiogramtest_id}/report`,children:L.jsx("button",{className:"btn btn-sm",children:"Report"})})})]},m.audiogramtest_id)),i.length===0&&L.jsx("tr",{children:L.jsx("td",{colSpan:2,children:"No audiogram tests found."})})]})]})]}),L.jsxs("div",{children:[L.jsx("h3",{className:"text-lg font-semibold text-center",children:"Tympanogram Tests"}),L.jsxs("table",{className:"table h-[300px] w-full text-center",children:[L.jsx("thead",{children:L.jsxs("tr",{children:[L.jsx("th",{children:"Date"}),L.jsx("th",{children:"Action"})]})}),L.jsxs("tbody",{children:[o.map(m=>L.jsxs("tr",{children:[L.jsx("td",{children:new Date(m.test_date).toLocaleString("en-GB")}),L.jsx("td",{children:L.jsx(us,{to:`/dashboard/patients/${t}/tests/tympanogram/${m.tympanogramtest_id}/report`,children:L.jsx("button",{className:"btn btn-sm",children:"Report"})})})]},m.tympanogramtest_id)),o.length===0&&L.jsx("tr",{children:L.jsx("td",{colSpan:2,children:"No tympanogram tests found."})})]})]})]})]})]})}function Q8(){const{patient:e,test:t}=Qu(),{setPrintData:n}=nf(),{authData:i}=ot.useContext(Ya),[s,o]=ot.useState({}),l=Ri(),[u,f]=ot.useState([]),[d,m]=ot.useState(!1),[g,x]=ot.useState([]),[v,A]=ot.useState(!1),N=[125,250,500,1e3,2e3,4e3,8e3],E=[10,20,30,40,50,60,70,80,90,100,110,120],j=["O","△","<","["],C=["X","[]",">","]"],z=async()=>{A(!0);try{const Q=(await De.get(`/api/tests/audiogramTests/${t}`,{params:{clinic_id:i?.clinicId??-1},withCredentials:!0})).data;f(Q.pureTone.map(R=>({puretone_id:R.puretone_id,test_no:R.test_no.toString(),ear:R.ear,...N.reduce((et,nt)=>(et[`frequency_${nt}`]=R[`frequency_${nt}`],et),{})})));const D=E.every(R=>Q.speech?.[0]?.[`frequency_${R}`]==null);m(!D),Q?.speech&&Q.speech?.length>0&&x(E.map(R=>Q?.speech?.[0]?.[`frequency_${R}`]||null))}catch(G){const Q=G.response?.data?.messages??{},D=Object.values(Q).join(`
`);Be.error(D??"Something went wrong")}finally{A(!1)}},Z=(G,Q,D,R)=>{const et=isNaN(parseInt(R,10))?null:parseInt(R,10);f(nt=>nt.map(dt=>dt.ear===G&&dt.test_no===D.toString()?{...dt,[`frequency_${N[Q]}`]:et}:dt))},I=(G,Q)=>{const D=[...g];D[G]=Q,x(D)},st=async()=>{const G=new Date().toISOString().replace("T"," ").slice(0,19),Q={patient_id:e,clinic_id:i?.clinicId??-1,test_date:G,puretone_audiometry:u,speech_audiometry:g,include_speech_audiometry:d};A(!0);try{const D=await De.put(`/api/tests/audiogramTests/${t}`,Q,{withCredentials:!0});Be.success("Test updated successfully")}catch(D){const R=D.response.data?.messages??{},et=Object.values(R).join(", ");Be.error(et??"Something went wrong")}finally{A(!1)}},K=()=>{e&&u?(n({patientData:s,testData:{pureToneData:u,speechData:g,showSpeechTest:d}}),l("/dashboard/prints/audiogram")):Be.error("Patient Id and Test Data is required")};async function H(){try{const G=await De.get(`/api/patients/${e}`,{withCredentials:!0});o(G.data??{})}catch(G){const Q=G.response.data?.messages??{},D=Object.values(Q).join(", ");Be.error(D??"Something went wrong")}}return ot.useEffect(()=>{H()},[e]),ot.useEffect(()=>{z()},[t]),ot.useEffect(()=>{document.title="View Audiogram Test Report | Audiogram"},[]),L.jsxs("div",{className:"flex flex-col",children:[L.jsxs("div",{className:"p-6 flex justify-between items-center",children:[L.jsx("h1",{className:"text-3xl font-bold",children:"View Test Report - Audiogram"}),L.jsxs("div",{className:"flex-col space-y-4 md:space-y-0 md:flex-row md:space-x-4",children:[L.jsx("button",{onClick:K,className:"btn w-40",children:"Print"}),L.jsx("button",{onClick:st,className:"btn w-40",children:"Save"})]})]}),v&&L.jsx("div",{className:"h-screen w-screen top-0 left-0 fixed bg-base-100 opacity-50 z-50 flex items-center justify-center",children:L.jsx("span",{className:"loading loading-spinner loading-lg"})}),L.jsxs("div",{className:"flex flex-col md:flex-row p-6 gap-4",children:[L.jsxs("div",{className:"flex-3 border-r-0 md:border-r-2 pr-4",children:[L.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Pure Tone Audiometry"}),L.jsxs("div",{className:"pt-4 gap-4 grid grid-cols-4 lg:grid-cols-8",children:[L.jsx("div",{className:"col-span-1 flex flex-col gap-4 pt-12",children:N.map((G,Q)=>L.jsx("label",{className:"w-full text-center font-medium",children:G},G))}),L.jsxs("div",{className:"col-span-3 grid grid-cols-4",children:[j.map(G=>L.jsx("p",{className:"ml-6 font-semibold",children:G},G)),[1,2,3,4].map(G=>L.jsx("div",{className:"flex flex-col gap-2 pt-5",children:N.map((Q,D)=>L.jsx("input",{type:"number",placeholder:"value",value:u.find(R=>R.ear==="right"&&R.test_no===G.toString())?.[`frequency_${Q}`]||"",onChange:R=>Z("right",D,G,R.target.value),className:"input input-sm text-center"},`right-${Q}-${G}`))},G))]}),L.jsx("div",{className:"col-span-1 flex flex-col gap-4 pt-12",children:N.map((G,Q)=>L.jsx("label",{className:"w-full text-center font-medium",children:G},G))}),L.jsxs("div",{className:"col-span-3 grid grid-cols-4",children:[C.map(G=>L.jsx("p",{className:"ml-6 font-semibold",children:G},G)),[1,2,3,4].map(G=>L.jsx("div",{className:"flex flex-col gap-2 pt-5",children:N.map((Q,D)=>L.jsx("input",{type:"number",placeholder:"value",value:u.find(R=>R.ear==="left"&&R.test_no===G.toString())?.[`frequency_${Q}`]||"",onChange:R=>Z("left",D,G,R.target.value),className:"input input-sm text-center"},`left-${Q}-${G}`))},G))]})]})]}),L.jsxs("div",{className:"flex-1",children:[L.jsxs("div",{className:"flex items-center",children:[L.jsx("h2",{className:"text-xl font-semibold",children:"Speech Audiometry"}),L.jsx("input",{type:"checkbox",checked:d,onChange:()=>m(!d),className:"checkbox ml-2"})]}),d&&L.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 w-full gap-4 pt-16",children:E.map((G,Q)=>L.jsxs("div",{className:"col-span-1 flex gap-4 items-center",children:[L.jsx("label",{className:"text-center font-medium",children:G}),L.jsx("input",{type:"number",value:g[Q]||"",placeholder:"value",onChange:D=>I(Q,parseInt(D.target.value)||null),className:"input input-sm text-center"})]},G))})]})]})]})}function J8(){const{patient:e,test:t}=Qu(),{authData:n}=ot.useContext(Ya),[i,s]=ot.useState({}),o=Ri(),{setPrintData:l}=nf(),[u,f]=ot.useState(!1),[d,m]=ot.useState({}),[g,x]=ot.useState({left_volume:"",right_volume:"",left_compliance:"",right_compliance:"",left_pressure_1:"",right_pressure_1:"",left_pressure_2:"",right_pressure_2:"",left_pressure_3:"",right_pressure_3:"",frequencies:[]}),[v,A]=ot.useState(""),[N,E]=ot.useState(""),[j,C]=ot.useState(""),z=async()=>{if(t){f(!0);try{const Q=await De.get(`/api/tests/tympanogramTests/${t}`,{params:{clinic_id:n?.clinicId??-1},withCredentials:!0});m(Q.data)}catch(Q){m(null),Be.error(Q.response.data.messages?.error??"Something went wrong")}finally{f(!1)}}};ot.useEffect(()=>{d&&x({left_volume:d.left_volume??"",right_volume:d.right_volume??"",left_compliance:d.left_compliance??"",right_compliance:d.right_compliance??"",left_pressure_1:d.left_pressure_1??-300,right_pressure_1:d.right_pressure_1??-300,left_pressure_2:d.left_pressure_2??"",right_pressure_2:d.right_pressure_2??"",left_pressure_3:d.left_pressure_3??200,right_pressure_3:d.right_pressure_3??200,frequencies:d.frequencies?.map(Q=>({pressure:Q?.pressure??"",frequency:Q?.frequency??"",level:Q?.level??""}))??[]})},[d]);const Z=()=>{const Q=Number(N),D=Number(j);if(v&&!isNaN(Q)&&!isNaN(D)){const R={pressure:v,frequency:N,level:j};x(et=>({...et,frequencies:[...et.frequencies,R]})),A(""),E(""),C("")}else Be.error("Please fill all the fields")},I=Q=>{x(D=>({...D,frequencies:D.frequencies.filter((R,et)=>et!==Q)}))},st=async()=>{f(!0);try{const Q=new Date().toISOString().replace("T"," ").slice(0,19),D={patient_id:e,clinic_id:n?.clinicId??-1,test_date:Q,left_volume:g.left_volume===""?null:g.left_volume,right_volume:g.right_volume===""?null:g.right_volume,left_compliance:g.left_compliance===""?null:g.left_compliance,right_compliance:g.right_compliance===""?null:g.right_compliance,left_pressure_1:g.left_pressure_1===""?null:g.left_pressure_1,right_pressure_1:g.right_pressure_1===""?null:g.right_pressure_1,left_pressure_2:g.left_pressure_2===""?null:g.left_pressure_2,right_pressure_2:g.right_pressure_2===""?null:g.right_pressure_2,left_pressure_3:g.left_pressure_3===""?null:g.left_pressure_3,right_pressure_3:g.right_pressure_3===""?null:g.right_pressure_3,frequencies:g.frequencies,tympanogramtest_id:t};await De.put(`/api/tests/tympanogramTests/${t}`,D,{withCredentials:!0}),Be.success("Test updated successfully")}catch(Q){const D=Q.response?.data?.messages??{},R=Object.values(D).join(`
`);Be.error(R??"Something went wrong")}finally{f(!1)}},K=()=>{e&&g?(l({patientData:i,testData:{tympanogramTest:g}}),o("/dashboard/prints/tympanogram")):Be.error("Patient Id and Test Data is required")},H=(Q,D)=>{x(R=>({...R,[D]:Q.target.value}))};async function G(){try{const Q=await De.get(`/api/patients/${e}`,{withCredentials:!0});s(Q.data??{})}catch(Q){const D=Q.response.data?.messages??{},R=Object.values(D).join(", ");Be.error(R??"Something went wrong")}}return ot.useEffect(()=>{G()},[e]),ot.useEffect(()=>{document.title="View Tympanogram Test Report | Audiogram",z()},[]),L.jsxs("div",{className:"flex flex-col",children:[L.jsxs("div",{className:"p-6 flex justify-between items-center",children:[L.jsx("h1",{className:"text-3xl font-bold",children:"View Test Report - Tympanogram"}),L.jsxs("div",{className:"flex-col space-y-4 md:space-y-0 md:flex-row md:space-x-4",children:[L.jsx("button",{onClick:K,className:"btn w-40",children:"Print"}),L.jsx("button",{onClick:st,className:"btn w-40",children:"Save"})]})]}),u&&L.jsx("div",{className:"h-screen w-screen top-0 left-0 fixed bg-base-100 opacity-50 z-50 flex items-center justify-center",children:L.jsx("span",{className:"loading loading-spinner loading-lg"})}),L.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[L.jsxs("div",{className:"mb-2 md:mt-10 pt-20",children:[L.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 pb-4",children:[L.jsx("div",{}),L.jsx("h4",{className:"col-span-1",children:"Right Ear"}),L.jsx("h4",{className:"col-span-1",children:"Left Ear"})]}),L.jsxs("div",{className:"space-y-4",children:[L.jsxs("div",{className:"flex flex-col md:flex-row items-center",children:[L.jsx("label",{className:"w-full md:w-1/4 font-medium",children:"Volume"}),L.jsxs("div",{className:"w-full md:w-3/4 flex flex-col md:flex-row gap-2",children:[L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:g.right_volume,onChange:Q=>H(Q,"right_volume")}),L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:g.left_volume,onChange:Q=>H(Q,"left_volume")})]})]}),L.jsxs("div",{className:"flex flex-col md:flex-row items-center",children:[L.jsx("label",{className:"w-full md:w-1/4 font-medium",children:"Compliance"}),L.jsxs("div",{className:"w-full md:w-3/4 flex flex-col md:flex-row gap-2",children:[L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:g.right_compliance,onChange:Q=>H(Q,"right_compliance")}),L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:g.left_compliance,onChange:Q=>H(Q,"left_compliance")})]})]}),L.jsxs("div",{className:"flex flex-col md:flex-row items-center",children:[L.jsx("label",{className:"w-full md:w-1/4 font-medium",children:"Pressure"}),L.jsxs("div",{className:"w-full md:w-3/4 flex flex-col md:flex-row gap-2",children:[L.jsxs("div",{className:"flex fflex-row gap-2",children:[L.jsx("input",{type:"number",inputMode:"decimal",placeholder:"value",className:"input text-center",value:g.right_pressure_1,onChange:Q=>H(Q,"right_pressure_1")}),L.jsx("input",{type:"number",inputMode:"decimal",placeholder:"value",className:"input text-center",value:g.right_pressure_2,onChange:Q=>H(Q,"right_pressure_2")}),L.jsx("input",{type:"number",inputMode:"numeric",placeholder:"value",className:"input text-center",value:g.right_pressure_3,onChange:Q=>H(Q,"right_pressure_3")})]}),L.jsxs("div",{className:"flex flex-row gap-2",children:[L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:g.left_pressure_1,onChange:Q=>H(Q,"left_pressure_1")}),L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:g.left_pressure_2,onChange:Q=>H(Q,"left_pressure_2")}),L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:g.left_pressure_3,onChange:Q=>H(Q,"left_pressure_3")})]})]})]})]})]}),L.jsx("div",{className:"mb-2 px-4 mt-10 md:border-l-2",children:L.jsxs("div",{className:"flex flex-col h-full",children:[L.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[L.jsxs("div",{children:[L.jsx("label",{className:"text-sm",children:"Pressure"}),L.jsxs("select",{className:"select",value:v,onChange:Q=>A(Q.target.value),children:[L.jsx("option",{value:"",children:"Choose an Image"}),L.jsx("option",{value:"image1",children:"Image 1"}),L.jsx("option",{value:"image2",children:"Image 2"}),L.jsx("option",{value:"image3",children:"Image 3"}),L.jsx("option",{value:"image4",children:"Image 4"}),L.jsx("option",{value:"image5",children:"Image 5"})]})]}),L.jsxs("div",{children:[L.jsx("label",{className:"text-sm",children:"Frequency"}),L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:N,onChange:Q=>{E(Q.target.value),setButtonState("Save")}})]}),L.jsxs("div",{children:[L.jsx("label",{className:"text-sm",children:"Level"}),L.jsx("input",{type:"number",placeholder:"value",className:"input text-center",value:j,onChange:Q=>{C(Q.target.value),setButtonState("Save")}})]}),L.jsx("div",{className:"flex items-end",children:L.jsx("button",{onClick:Z,className:"btn btn-success w-full",children:"Add Test"})})]}),L.jsx("div",{className:"flex justify-center mb-4"}),L.jsx("div",{className:"mt-4 overflow-y-auto max-h-56 flex-2",children:g.frequencies.length===0?L.jsx("p",{className:"text-center ",children:"No tests added yet."}):L.jsx("ul",{className:"space-y-4",children:g.frequencies.map((Q,D)=>L.jsxs("li",{className:"flex items-center justify-between p-4 rounded-lg shadow-md border",children:[L.jsxs("div",{children:[L.jsxs("p",{children:[L.jsx("strong",{children:"Pressure:"})," ",Q.pressure]}),L.jsxs("p",{children:[L.jsx("strong",{children:"Frequency:"})," ",Q.frequency," Hz"]}),L.jsxs("p",{children:[L.jsx("strong",{children:"Level:"})," ",Q.level," dB"]})]}),L.jsx("button",{onClick:()=>I(D),className:"btn btn-error",children:"Delete"})]},D))})})]})})]})]})}const t7="modulepreload",e7=function(e){return"/"+e},qb={},Vg=function(t,n,i){let s=Promise.resolve();if(n&&n.length>0){let f=function(d){return Promise.all(d.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=l?.nonce||l?.getAttribute("nonce");s=f(n.map(d=>{if(d=e7(d),d in qb)return;qb[d]=!0;const m=d.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${g}`))return;const x=document.createElement("link");if(x.rel=m?"stylesheet":t7,m||(x.as="script"),x.crossOrigin="",x.href=d,u&&x.setAttribute("nonce",u),document.head.appendChild(x),m)return new Promise((v,A)=>{x.addEventListener("load",v),x.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return s.then(l=>{for(const u of l||[])u.status==="rejected"&&o(u.reason);return t().catch(o)})};function _n(e){"@babel/helpers - typeof";return _n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_n(e)}var ba=Uint8Array,cs=Uint16Array,F0=Int32Array,Ip=new ba([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Hp=new ba([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Yg=new ba([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gv=function(e,t){for(var n=new cs(31),i=0;i<31;++i)n[i]=t+=1<<e[i-1];for(var s=new F0(n[30]),i=1;i<30;++i)for(var o=n[i];o<n[i+1];++o)s[o]=o-n[i]<<5|i;return{b:n,r:s}},Wv=Gv(Ip,2),Xv=Wv.b,Gg=Wv.r;Xv[28]=258,Gg[258]=28;var Kv=Gv(Hp,0),n7=Kv.b,Ub=Kv.r,Wg=new cs(32768);for(var Un=0;Un<32768;++Un){var Pl=(Un&43690)>>1|(Un&21845)<<1;Pl=(Pl&52428)>>2|(Pl&13107)<<2,Pl=(Pl&61680)>>4|(Pl&3855)<<4,Wg[Un]=((Pl&65280)>>8|(Pl&255)<<8)>>1}var no=function(e,t,n){for(var i=e.length,s=0,o=new cs(t);s<i;++s)e[s]&&++o[e[s]-1];var l=new cs(t);for(s=1;s<t;++s)l[s]=l[s-1]+o[s-1]<<1;var u;if(n){u=new cs(1<<t);var f=15-t;for(s=0;s<i;++s)if(e[s])for(var d=s<<4|e[s],m=t-e[s],g=l[e[s]-1]++<<m,x=g|(1<<m)-1;g<=x;++g)u[Wg[g]>>f]=d}else for(u=new cs(i),s=0;s<i;++s)e[s]&&(u[s]=Wg[l[e[s]-1]++]>>15-e[s]);return u},Hl=new ba(288);for(var Un=0;Un<144;++Un)Hl[Un]=8;for(var Un=144;Un<256;++Un)Hl[Un]=9;for(var Un=256;Un<280;++Un)Hl[Un]=7;for(var Un=280;Un<288;++Un)Hl[Un]=8;var Th=new ba(32);for(var Un=0;Un<32;++Un)Th[Un]=5;var i7=no(Hl,9,0),a7=no(Hl,9,1),s7=no(Th,5,0),r7=no(Th,5,1),bg=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},nr=function(e,t,n){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(t&7)&n},yg=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},q0=function(e){return(e+7)/8|0},$v=function(e,t,n){return(n==null||n>e.length)&&(n=e.length),new ba(e.subarray(t,n))},o7=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],ar=function(e,t,n){var i=new Error(t||o7[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,ar),!n)throw i;return i},l7=function(e,t,n,i){var s=e.length,o=0;if(!s||t.f&&!t.l)return n||new ba(0);var l=!n,u=l||t.i!=2,f=t.i;l&&(n=new ba(s*3));var d=function(Qt){var ne=n.length;if(Qt>ne){var ie=new ba(Math.max(ne*2,Qt));ie.set(n),n=ie}},m=t.f||0,g=t.p||0,x=t.b||0,v=t.l,A=t.d,N=t.m,E=t.n,j=s*8;do{if(!v){m=nr(e,g,1);var C=nr(e,g+1,3);if(g+=3,C)if(C==1)v=a7,A=r7,N=9,E=5;else if(C==2){var st=nr(e,g,31)+257,K=nr(e,g+10,15)+4,H=st+nr(e,g+5,31)+1;g+=14;for(var G=new ba(H),Q=new ba(19),D=0;D<K;++D)Q[Yg[D]]=nr(e,g+D*3,7);g+=K*3;for(var R=bg(Q),et=(1<<R)-1,nt=no(Q,R,1),D=0;D<H;){var dt=nt[nr(e,g,et)];g+=dt&15;var z=dt>>4;if(z<16)G[D++]=z;else{var W=0,lt=0;for(z==16?(lt=3+nr(e,g,3),g+=2,W=G[D-1]):z==17?(lt=3+nr(e,g,7),g+=3):z==18&&(lt=11+nr(e,g,127),g+=7);lt--;)G[D++]=W}}var ut=G.subarray(0,st),wt=G.subarray(st);N=bg(ut),E=bg(wt),v=no(ut,N,1),A=no(wt,E,1)}else ar(1);else{var z=q0(g)+4,Z=e[z-4]|e[z-3]<<8,I=z+Z;if(I>s){f&&ar(0);break}u&&d(x+Z),n.set(e.subarray(z,I),x),t.b=x+=Z,t.p=g=I*8,t.f=m;continue}if(g>j){f&&ar(0);break}}u&&d(x+131072);for(var Y=(1<<N)-1,gt=(1<<E)-1,O=g;;O=g){var W=v[yg(e,g)&Y],q=W>>4;if(g+=W&15,g>j){f&&ar(0);break}if(W||ar(2),q<256)n[x++]=q;else if(q==256){O=g,v=null;break}else{var $=q-254;if(q>264){var D=q-257,rt=Ip[D];$=nr(e,g,(1<<rt)-1)+Xv[D],g+=rt}var at=A[yg(e,g)>],At=at>>4;at||ar(3),g+=at&15;var wt=n7[At];if(At>3){var rt=Hp[At];wt+=yg(e,g)&(1<<rt)-1,g+=rt}if(g>j){f&&ar(0);break}u&&d(x+131072);var St=x+$;if(x<wt){var Tt=o-wt,Zt=Math.min(wt,St);for(Tt+x<0&&ar(3);x<Zt;++x)n[x]=i[Tt+x]}for(;x<St;++x)n[x]=n[x-wt]}}t.l=v,t.p=O,t.b=x,t.f=m,v&&(m=1,t.m=N,t.d=A,t.n=E)}while(!m);return x!=n.length&&l?$v(n,0,x):n.subarray(0,x)},zo=function(e,t,n){n<<=t&7;var i=t/8|0;e[i]|=n,e[i+1]|=n>>8},sh=function(e,t,n){n<<=t&7;var i=t/8|0;e[i]|=n,e[i+1]|=n>>8,e[i+2]|=n>>16},vg=function(e,t){for(var n=[],i=0;i<e.length;++i)e[i]&&n.push({s:i,f:e[i]});var s=n.length,o=n.slice();if(!s)return{t:Qv,l:0};if(s==1){var l=new ba(n[0].s+1);return l[n[0].s]=1,{t:l,l:1}}n.sort(function(I,st){return I.f-st.f}),n.push({s:-1,f:25001});var u=n[0],f=n[1],d=0,m=1,g=2;for(n[0]={s:-1,f:u.f+f.f,l:u,r:f};m!=s-1;)u=n[n[d].f<n[g].f?d++:g++],f=n[d!=m&&n[d].f<n[g].f?d++:g++],n[m++]={s:-1,f:u.f+f.f,l:u,r:f};for(var x=o[0].s,i=1;i<s;++i)o[i].s>x&&(x=o[i].s);var v=new cs(x+1),A=Xg(n[m-1],v,0);if(A>t){var i=0,N=0,E=A-t,j=1<<E;for(o.sort(function(st,K){return v[K.s]-v[st.s]||st.f-K.f});i<s;++i){var C=o[i].s;if(v[C]>t)N+=j-(1<<A-v[C]),v[C]=t;else break}for(N>>=E;N>0;){var z=o[i].s;v[z]<t?N-=1<<t-v[z]++-1:++i}for(;i>=0&&N;--i){var Z=o[i].s;v[Z]==t&&(--v[Z],++N)}A=t}return{t:new ba(v),l:A}},Xg=function(e,t,n){return e.s==-1?Math.max(Xg(e.l,t,n+1),Xg(e.r,t,n+1)):t[e.s]=n},Ib=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new cs(++t),i=0,s=e[0],o=1,l=function(f){n[i++]=f},u=1;u<=t;++u)if(e[u]==s&&u!=t)++o;else{if(!s&&o>2){for(;o>138;o-=138)l(32754);o>2&&(l(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(l(s),--o;o>6;o-=6)l(8304);o>2&&(l(o-3<<5|8208),o=0)}for(;o--;)l(s);o=1,s=e[u]}return{c:n.subarray(0,i),n:t}},rh=function(e,t){for(var n=0,i=0;i<t.length;++i)n+=e[i]*t[i];return n},Zv=function(e,t,n){var i=n.length,s=q0(t+2);e[s]=i&255,e[s+1]=i>>8,e[s+2]=e[s]^255,e[s+3]=e[s+1]^255;for(var o=0;o<i;++o)e[s+o+4]=n[o];return(s+4+i)*8},Hb=function(e,t,n,i,s,o,l,u,f,d,m){zo(t,m++,n),++s[256];for(var g=vg(s,15),x=g.t,v=g.l,A=vg(o,15),N=A.t,E=A.l,j=Ib(x),C=j.c,z=j.n,Z=Ib(N),I=Z.c,st=Z.n,K=new cs(19),H=0;H<C.length;++H)++K[C[H]&31];for(var H=0;H<I.length;++H)++K[I[H]&31];for(var G=vg(K,7),Q=G.t,D=G.l,R=19;R>4&&!Q[Yg[R-1]];--R);var et=d+5<<3,nt=rh(s,Hl)+rh(o,Th)+l,dt=rh(s,x)+rh(o,N)+l+14+3*R+rh(K,Q)+2*K[16]+3*K[17]+7*K[18];if(f>=0&&et<=nt&&et<=dt)return Zv(t,m,e.subarray(f,f+d));var W,lt,ut,wt;if(zo(t,m,1+(dt<nt)),m+=2,dt<nt){W=no(x,v,0),lt=x,ut=no(N,E,0),wt=N;var Y=no(Q,D,0);zo(t,m,z-257),zo(t,m+5,st-1),zo(t,m+10,R-4),m+=14;for(var H=0;H<R;++H)zo(t,m+3*H,Q[Yg[H]]);m+=3*R;for(var gt=[C,I],O=0;O<2;++O)for(var q=gt[O],H=0;H<q.length;++H){var $=q[H]&31;zo(t,m,Y[$]),m+=Q[$],$>15&&(zo(t,m,q[H]>>5&127),m+=q[H]>>12)}}else W=i7,lt=Hl,ut=s7,wt=Th;for(var H=0;H<u;++H){var rt=i[H];if(rt>255){var $=rt>>18&31;sh(t,m,W[$+257]),m+=lt[$+257],$>7&&(zo(t,m,rt>>23&31),m+=Ip[$]);var at=rt&31;sh(t,m,ut[at]),m+=wt[at],at>3&&(sh(t,m,rt>>5&8191),m+=Hp[at])}else sh(t,m,W[rt]),m+=lt[rt]}return sh(t,m,W[256]),m+lt[256]},c7=new F0([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Qv=new ba(0),u7=function(e,t,n,i,s,o){var l=o.z||e.length,u=new ba(i+l+5*(1+Math.ceil(l/7e3))+s),f=u.subarray(i,u.length-s),d=o.l,m=(o.r||0)&7;if(t){m&&(f[0]=o.r>>3);for(var g=c7[t-1],x=g>>13,v=g&8191,A=(1<<n)-1,N=o.p||new cs(32768),E=o.h||new cs(A+1),j=Math.ceil(n/3),C=2*j,z=function(ye){return(e[ye]^e[ye+1]<<j^e[ye+2]<<C)&A},Z=new F0(25e3),I=new cs(288),st=new cs(32),K=0,H=0,G=o.i||0,Q=0,D=o.w||0,R=0;G+2<l;++G){var et=z(G),nt=G&32767,dt=E[et];if(N[nt]=dt,E[et]=nt,D<=G){var W=l-G;if((K>7e3||Q>24576)&&(W>423||!d)){m=Hb(e,f,0,Z,I,st,H,Q,R,G-R,m),Q=K=H=0,R=G;for(var lt=0;lt<286;++lt)I[lt]=0;for(var lt=0;lt<30;++lt)st[lt]=0}var ut=2,wt=0,Y=v,gt=nt-dt&32767;if(W>2&&et==z(G-gt))for(var O=Math.min(x,W)-1,q=Math.min(32767,G),$=Math.min(258,W);gt<=q&&--Y&&nt!=dt;){if(e[G+ut]==e[G+ut-gt]){for(var rt=0;rt<$&&e[G+rt]==e[G+rt-gt];++rt);if(rt>ut){if(ut=rt,wt=gt,rt>O)break;for(var at=Math.min(gt,rt-2),At=0,lt=0;lt<at;++lt){var St=G-gt+lt&32767,Tt=N[St],Zt=St-Tt&32767;Zt>At&&(At=Zt,dt=St)}}}nt=dt,dt=N[nt],gt+=nt-dt&32767}if(wt){Z[Q++]=268435456|Gg[ut]<<18|Ub[wt];var Qt=Gg[ut]&31,ne=Ub[wt]&31;H+=Ip[Qt]+Hp[ne],++I[257+Qt],++st[ne],D=G+ut,++K}else Z[Q++]=e[G],++I[e[G]]}}for(G=Math.max(G,D);G<l;++G)Z[Q++]=e[G],++I[e[G]];m=Hb(e,f,d,Z,I,st,H,Q,R,G-R,m),d||(o.r=m&7|f[m/8|0]<<3,m-=7,o.h=E,o.p=N,o.i=G,o.w=D)}else{for(var G=o.w||0;G<l+d;G+=65535){var ie=G+65535;ie>=l&&(f[m/8|0]=d,ie=l),m=Zv(f,m+1,e.subarray(G,ie))}o.i=l}return $v(u,0,i+q0(m)+s)},Jv=function(){var e=1,t=0;return{p:function(n){for(var i=e,s=t,o=n.length|0,l=0;l!=o;){for(var u=Math.min(l+2655,o);l<u;++l)s+=i+=n[l];i=(i&65535)+15*(i>>16),s=(s&65535)+15*(s>>16)}e=i,t=s},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},f7=function(e,t,n,i,s){if(!s&&(s={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),l=new ba(o.length+e.length);l.set(o),l.set(e,o.length),e=l,s.w=o.length}return u7(e,t.level==null?6:t.level,t.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,i,s)},tx=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},h7=function(e,t){var n=t.level,i=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=i<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var s=Jv();s.p(t.dictionary),tx(e,2,s.d())}},d7=function(e,t){return((e[0]&15)!=8||e[0]>>4>7||(e[0]<<8|e[1])%31)&&ar(6,"invalid zlib data"),(e[1]>>5&1)==1&&ar(6,"invalid zlib data: "+(e[1]&32?"need":"unexpected")+" dictionary"),(e[1]>>3&4)+2};function Kg(e,t){t||(t={});var n=Jv();n.p(e);var i=f7(e,t,t.dictionary?6:2,4);return h7(i,t),tx(i,i.length-4,n.d()),i}function p7(e,t){return l7(e.subarray(d7(e),-4),{i:2},t,t)}var m7=typeof TextDecoder<"u"&&new TextDecoder,g7=0;try{m7.decode(Qv,{stream:!0}),g7=1}catch{}var je=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function xg(){je.console&&typeof je.console.log=="function"&&je.console.log.apply(je.console,arguments)}var Mn={log:xg,warn:function(e){je.console&&(typeof je.console.warn=="function"?je.console.warn.apply(je.console,arguments):xg.call(null,arguments))},error:function(e){je.console&&(typeof je.console.error=="function"?je.console.error.apply(je.console,arguments):xg(e))}};function wg(e,t,n){var i=new XMLHttpRequest;i.open("GET",e),i.responseType="blob",i.onload=function(){Rc(i.response,t,n)},i.onerror=function(){Mn.error("could not download file")},i.send()}function Vb(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Kd(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var yh,$g,Rc=je.saveAs||((typeof window>"u"?"undefined":_n(window))!=="object"||window!==je?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,t,n){var i=je.URL||je.webkitURL,s=document.createElement("a");t=t||e.name||"download",s.download=t,s.rel="noopener",typeof e=="string"?(s.href=e,s.origin!==location.origin?Vb(s.href)?wg(e,t,n):Kd(s,s.target="_blank"):Kd(s)):(s.href=i.createObjectURL(e),setTimeout(function(){i.revokeObjectURL(s.href)},4e4),setTimeout(function(){Kd(s)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download",typeof e=="string")if(Vb(e))wg(e,t,n);else{var i=document.createElement("a");i.href=e,i.target="_blank",setTimeout(function(){Kd(i)})}else navigator.msSaveOrOpenBlob(function(s,o){return o===void 0?o={autoBom:!1}:_n(o)!=="object"&&(Mn.warn("Deprecated: Expected third argument to be a object"),o={autoBom:!o}),o.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(s.type)?new Blob(["\uFEFF",s],{type:s.type}):s}(e,n),t)}:function(e,t,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),typeof e=="string")return wg(e,t,n);var s=e.type==="application/octet-stream",o=/constructor/i.test(je.HTMLElement)||je.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&o)&&(typeof FileReader>"u"?"undefined":_n(FileReader))==="object"){var u=new FileReader;u.onloadend=function(){var m=u.result;m=l?m:m.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=m:location=m,i=null},u.readAsDataURL(e)}else{var f=je.URL||je.webkitURL,d=f.createObjectURL(e);i?i.location=d:location.href=d,i=null,setTimeout(function(){f.revokeObjectURL(d)},4e4)}});/**
* A class to parse color values
* @author Stoyan Stefanov <sstoo@gmail.com>
* {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
* @license Use it if you like it
*/function ex(e){var t;e=e||"",this.ok=!1,e.charAt(0)=="#"&&(e=e.substr(1,6)),e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[e=(e=e.replace(/ /g,"")).toLowerCase()]||e;for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(u){return[parseInt(u[1]),parseInt(u[2]),parseInt(u[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(u){return[parseInt(u[1],16),parseInt(u[2],16),parseInt(u[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(u){return[parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16),parseInt(u[3]+u[3],16)]}}],i=0;i<n.length;i++){var s=n[i].re,o=n[i].process,l=s.exec(e);l&&(t=o(l),this.r=t[0],this.g=t[1],this.b=t[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var u=this.r.toString(16),f=this.g.toString(16),d=this.b.toString(16);return u.length==1&&(u="0"+u),f.length==1&&(f="0"+f),d.length==1&&(d="0"+d),"#"+u+f+d}}/**
* @license
* Joseph Myers does not specify a particular license for his work.
*
* Author: Joseph Myers
* Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
*
* Modified by: Owen Leong
*/function _g(e,t){var n=e[0],i=e[1],s=e[2],o=e[3];n=fa(n,i,s,o,t[0],7,-680876936),o=fa(o,n,i,s,t[1],12,-389564586),s=fa(s,o,n,i,t[2],17,606105819),i=fa(i,s,o,n,t[3],22,-1044525330),n=fa(n,i,s,o,t[4],7,-176418897),o=fa(o,n,i,s,t[5],12,1200080426),s=fa(s,o,n,i,t[6],17,-1473231341),i=fa(i,s,o,n,t[7],22,-45705983),n=fa(n,i,s,o,t[8],7,1770035416),o=fa(o,n,i,s,t[9],12,-1958414417),s=fa(s,o,n,i,t[10],17,-42063),i=fa(i,s,o,n,t[11],22,-1990404162),n=fa(n,i,s,o,t[12],7,1804603682),o=fa(o,n,i,s,t[13],12,-40341101),s=fa(s,o,n,i,t[14],17,-1502002290),n=ha(n,i=fa(i,s,o,n,t[15],22,1236535329),s,o,t[1],5,-165796510),o=ha(o,n,i,s,t[6],9,-1069501632),s=ha(s,o,n,i,t[11],14,643717713),i=ha(i,s,o,n,t[0],20,-373897302),n=ha(n,i,s,o,t[5],5,-701558691),o=ha(o,n,i,s,t[10],9,38016083),s=ha(s,o,n,i,t[15],14,-660478335),i=ha(i,s,o,n,t[4],20,-405537848),n=ha(n,i,s,o,t[9],5,568446438),o=ha(o,n,i,s,t[14],9,-1019803690),s=ha(s,o,n,i,t[3],14,-187363961),i=ha(i,s,o,n,t[8],20,1163531501),n=ha(n,i,s,o,t[13],5,-1444681467),o=ha(o,n,i,s,t[2],9,-51403784),s=ha(s,o,n,i,t[7],14,1735328473),n=da(n,i=ha(i,s,o,n,t[12],20,-1926607734),s,o,t[5],4,-378558),o=da(o,n,i,s,t[8],11,-2022574463),s=da(s,o,n,i,t[11],16,1839030562),i=da(i,s,o,n,t[14],23,-35309556),n=da(n,i,s,o,t[1],4,-1530992060),o=da(o,n,i,s,t[4],11,1272893353),s=da(s,o,n,i,t[7],16,-155497632),i=da(i,s,o,n,t[10],23,-1094730640),n=da(n,i,s,o,t[13],4,681279174),o=da(o,n,i,s,t[0],11,-358537222),s=da(s,o,n,i,t[3],16,-722521979),i=da(i,s,o,n,t[6],23,76029189),n=da(n,i,s,o,t[9],4,-640364487),o=da(o,n,i,s,t[12],11,-421815835),s=da(s,o,n,i,t[15],16,530742520),n=pa(n,i=da(i,s,o,n,t[2],23,-995338651),s,o,t[0],6,-198630844),o=pa(o,n,i,s,t[7],10,1126891415),s=pa(s,o,n,i,t[14],15,-1416354905),i=pa(i,s,o,n,t[5],21,-57434055),n=pa(n,i,s,o,t[12],6,1700485571),o=pa(o,n,i,s,t[3],10,-1894986606),s=pa(s,o,n,i,t[10],15,-1051523),i=pa(i,s,o,n,t[1],21,-2054922799),n=pa(n,i,s,o,t[8],6,1873313359),o=pa(o,n,i,s,t[15],10,-30611744),s=pa(s,o,n,i,t[6],15,-1560198380),i=pa(i,s,o,n,t[13],21,1309151649),n=pa(n,i,s,o,t[4],6,-145523070),o=pa(o,n,i,s,t[11],10,-1120210379),s=pa(s,o,n,i,t[2],15,718787259),i=pa(i,s,o,n,t[9],21,-343485551),e[0]=ql(n,e[0]),e[1]=ql(i,e[1]),e[2]=ql(s,e[2]),e[3]=ql(o,e[3])}function Vp(e,t,n,i,s,o){return t=ql(ql(t,e),ql(i,o)),ql(t<<s|t>>>32-s,n)}function fa(e,t,n,i,s,o,l){return Vp(t&n|~t&i,e,t,s,o,l)}function ha(e,t,n,i,s,o,l){return Vp(t&i|n&~i,e,t,s,o,l)}function da(e,t,n,i,s,o,l){return Vp(t^n^i,e,t,s,o,l)}function pa(e,t,n,i,s,o,l){return Vp(n^(t|~i),e,t,s,o,l)}function nx(e){var t,n=e.length,i=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)_g(i,b7(e.substring(t-64,t)));e=e.substring(t-64);var s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<e.length;t++)s[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(s[t>>2]|=128<<(t%4<<3),t>55)for(_g(i,s),t=0;t<16;t++)s[t]=0;return s[14]=8*n,_g(i,s),i}function b7(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}yh=je.atob.bind(je),$g=je.btoa.bind(je);var Yb="0123456789abcdef".split("");function y7(e){for(var t="",n=0;n<4;n++)t+=Yb[e>>8*n+4&15]+Yb[e>>8*n&15];return t}function v7(e){return String.fromCharCode((255&e)>>0,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function Zg(e){return nx(e).map(v7).join("")}var x7=function(e){for(var t=0;t<e.length;t++)e[t]=y7(e[t]);return e.join("")}(nx("hello"))!="5d41402abc4b2a76b9719d911017c592";function ql(e,t){if(x7){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}return e+t&4294967295}/**
* @license
* FPDF is released under a permissive license: there is no usage restriction.
* You may embed it freely in your application (commercial or not), with or
* without modifications.
*
* Reference: http://www.fpdf.org/en/script/script37.php
*/function Qg(e,t){var n,i,s,o;if(e!==n){for(var l=(s=e,o=1+(256/e.length>>0),new Array(o+1).join(s)),u=[],f=0;f<256;f++)u[f]=f;var d=0;for(f=0;f<256;f++){var m=u[f];d=(d+m+l.charCodeAt(f))%256,u[f]=u[d],u[d]=m}n=e,i=u}else u=i;var g=t.length,x=0,v=0,A="";for(f=0;f<g;f++)v=(v+(m=u[x=(x+1)%256]))%256,u[x]=u[v],u[v]=m,l=u[(u[x]+u[v])%256],A+=String.fromCharCode(t.charCodeAt(f)^l);return A}/**
* @license
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
* Author: Owen Leong (@owenl131)
* Date: 15 Oct 2020
* References:
* https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
* https://github.com/foliojs/pdfkit/blob/master/lib/security.js
* http://www.fpdf.org/en/script/script37.php
*/var Gb={print:4,modify:8,copy:16,"annot-forms":32};function Bu(e,t,n,i){this.v=1,this.r=2;var s=192;e.forEach(function(u){if(Gb.perm!==void 0)throw new Error("Invalid permission: "+u);s+=Gb[u]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var o=(t+this.padding).substr(0,32),l=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(o,l),this.P=-(1+(255^s)),this.encryptionKey=Zg(o+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(i)).substr(0,5),this.U=Qg(this.encryptionKey,this.padding)}function zu(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",n=e.length,i=0;i<n;i++){var s=e.charCodeAt(i);s<33||s===35||s===37||s===40||s===41||s===47||s===60||s===62||s===91||s===93||s===123||s===125||s>126?t+="#"+("0"+s.toString(16)).slice(-2):t+=e[i]}return t}function Wb(e){if(_n(e)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(n,i,s){if(s=s||!1,typeof n!="string"||typeof i!="function"||typeof s!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(n)||(t[n]={});var o=Math.random().toString(35);return t[n][o]=[i,!!s],o},this.unsubscribe=function(n){for(var i in t)if(t[i][n])return delete t[i][n],Object.keys(t[i]).length===0&&delete t[i],!0;return!1},this.publish=function(n){if(t.hasOwnProperty(n)){var i=Array.prototype.slice.call(arguments,1),s=[];for(var o in t[n]){var l=t[n][o];try{l[0].apply(e,i)}catch(u){je.console&&Mn.error("jsPDF PubSub Error",u.message,u)}l[1]&&s.push(o)}s.length&&s.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function Ap(e){if(!(this instanceof Ap))return new Ap(e);var t="opacity,stroke-opacity".split(",");for(var n in e)e.hasOwnProperty(n)&&t.indexOf(n)>=0&&(this[n]=e[n]);this.id="",this.objectNumber=-1}function ix(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function kc(e,t,n,i,s){if(!(this instanceof kc))return new kc(e,t,n,i,s);this.type=e==="axial"?2:3,this.coords=t,this.colors=n,ix.call(this,i,s)}function qu(e,t,n,i,s){if(!(this instanceof qu))return new qu(e,t,n,i,s);this.boundingBox=e,this.xStep=t,this.yStep=n,this.stream="",this.cloneIndex=0,ix.call(this,i,s)}function Ae(e){var t,n=typeof arguments[0]=="string"?arguments[0]:"p",i=arguments[1],s=arguments[2],o=arguments[3],l=[],u=1,f=16,d="S",m=null;_n(e=e||{})==="object"&&(n=e.orientation,i=e.unit||i,s=e.format||s,o=e.compress||e.compressPdf||o,(m=e.encryption||null)!==null&&(m.userPassword=m.userPassword||"",m.ownerPassword=m.ownerPassword||"",m.userPermissions=m.userPermissions||[]),u=typeof e.userUnit=="number"?Math.abs(e.userUnit):1,e.precision!==void 0&&(t=e.precision),e.floatPrecision!==void 0&&(f=e.floatPrecision),d=e.defaultPathOperation||"S"),l=e.filters||(o===!0?["FlateEncode"]:l),i=i||"mm",n=(""+(n||"P")).toLowerCase();var g=e.putOnlyUsedFonts||!1,x={},v={internal:{},__private__:{}};v.__private__.PubSub=Wb;var A="1.3",N=v.__private__.getPdfVersion=function(){return A};v.__private__.setPdfVersion=function(_){A=_};var E={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};v.__private__.getPageFormats=function(){return E};var j=v.__private__.getPageFormat=function(_){return E[_]};s=s||"a4";var C={COMPAT:"compat",ADVANCED:"advanced"},z=C.COMPAT;function Z(){this.saveGraphicsState(),ct(new ue(ee,0,0,-ee,0,Sr()*ee).toString()+" cm"),this.setFontSize(this.getFontSize()/ee),d="n",z=C.ADVANCED}function I(){this.restoreGraphicsState(),d="S",z=C.COMPAT}var st=v.__private__.combineFontStyleAndFontWeight=function(_,P){if(_=="bold"&&P=="normal"||_=="bold"&&P==400||_=="normal"&&P=="italic"||_=="bold"&&P=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return P&&(_=P==400||P==="normal"?_==="italic"?"italic":"normal":P!=700&&P!=="bold"||_!=="normal"?(P==700?"bold":P)+""+_:"bold"),_};v.advancedAPI=function(_){var P=z===C.COMPAT;return P&&Z.call(this),typeof _!="function"||(_(this),P&&I.call(this)),this},v.compatAPI=function(_){var P=z===C.ADVANCED;return P&&I.call(this),typeof _!="function"||(_(this),P&&Z.call(this)),this},v.isAdvancedAPI=function(){return z===C.ADVANCED};var K,H=function(_){if(z!==C.ADVANCED)throw new Error(_+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},G=v.roundToPrecision=v.__private__.roundToPrecision=function(_,P){var it=t||P;if(isNaN(_)||isNaN(it))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return _.toFixed(it).replace(/0+$/,"")};K=v.hpf=v.__private__.hpf=typeof f=="number"?function(_){if(isNaN(_))throw new Error("Invalid argument passed to jsPDF.hpf");return G(_,f)}:f==="smart"?function(_){if(isNaN(_))throw new Error("Invalid argument passed to jsPDF.hpf");return G(_,_>-1&&_<1?16:5)}:function(_){if(isNaN(_))throw new Error("Invalid argument passed to jsPDF.hpf");return G(_,16)};var Q=v.f2=v.__private__.f2=function(_){if(isNaN(_))throw new Error("Invalid argument passed to jsPDF.f2");return G(_,2)},D=v.__private__.f3=function(_){if(isNaN(_))throw new Error("Invalid argument passed to jsPDF.f3");return G(_,3)},R=v.scale=v.__private__.scale=function(_){if(isNaN(_))throw new Error("Invalid argument passed to jsPDF.scale");return z===C.COMPAT?_*ee:z===C.ADVANCED?_:void 0},et=function(_){return z===C.COMPAT?Sr()-_:z===C.ADVANCED?_:void 0},nt=function(_){return R(et(_))};v.__private__.setPrecision=v.setPrecision=function(_){typeof parseInt(_,10)=="number"&&(t=parseInt(_,10))};var dt,W="00000000000000000000000000000000",lt=v.__private__.getFileId=function(){return W},ut=v.__private__.setFileId=function(_){return W=_!==void 0&&/^[a-fA-F0-9]{32}$/.test(_)?_.toUpperCase():W.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),m!==null&&(xi=new Bu(m.userPermissions,m.userPassword,m.ownerPassword,W)),W};v.setFileId=function(_){return ut(_),this},v.getFileId=function(){return lt()};var wt=v.__private__.convertDateToPDFDate=function(_){var P=_.getTimezoneOffset(),it=P<0?"+":"-",pt=Math.floor(Math.abs(P/60)),Lt=Math.abs(P%60),zt=[it,$(pt),"'",$(Lt),"'"].join("");return["D:",_.getFullYear(),$(_.getMonth()+1),$(_.getDate()),$(_.getHours()),$(_.getMinutes()),$(_.getSeconds()),zt].join("")},Y=v.__private__.convertPDFDateToDate=function(_){var P=parseInt(_.substr(2,4),10),it=parseInt(_.substr(6,2),10)-1,pt=parseInt(_.substr(8,2),10),Lt=parseInt(_.substr(10,2),10),zt=parseInt(_.substr(12,2),10),$t=parseInt(_.substr(14,2),10);return new Date(P,it,pt,Lt,zt,$t,0)},gt=v.__private__.setCreationDate=function(_){var P;if(_===void 0&&(_=new Date),_ instanceof Date)P=wt(_);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(_))throw new Error("Invalid argument passed to jsPDF.setCreationDate");P=_}return dt=P},O=v.__private__.getCreationDate=function(_){var P=dt;return _==="jsDate"&&(P=Y(dt)),P};v.setCreationDate=function(_){return gt(_),this},v.getCreationDate=function(_){return O(_)};var q,$=v.__private__.padd2=function(_){return("0"+parseInt(_)).slice(-2)},rt=v.__private__.padd2Hex=function(_){return("00"+(_=_.toString())).substr(_.length)},at=0,At=[],St=[],Tt=0,Zt=[],Qt=[],ne=!1,ie=St,ye=function(){at=0,Tt=0,St=[],At=[],Zt=[],va=pn(),xa=pn()};v.__private__.setCustomOutputDestination=function(_){ne=!0,ie=_};var Bt=function(_){ne||(ie=_)};v.__private__.resetCustomOutputDestination=function(){ne=!1,ie=St};var ct=v.__private__.out=function(_){return _=_.toString(),Tt+=_.length+1,ie.push(_),ie},me=v.__private__.write=function(_){return ct(arguments.length===1?_.toString():Array.prototype.join.call(arguments," "))},he=v.__private__.getArrayBuffer=function(_){for(var P=_.length,it=new ArrayBuffer(P),pt=new Uint8Array(it);P--;)pt[P]=_.charCodeAt(P);return it},Xt=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];v.__private__.getStandardFonts=function(){return Xt};var J=e.fontSize||16;v.__private__.setFontSize=v.setFontSize=function(_){return J=z===C.ADVANCED?_/ee:_,this};var ht,mt=v.__private__.getFontSize=v.getFontSize=function(){return z===C.COMPAT?J:J*ee},Pt=e.R2L||!1;v.__private__.setR2L=v.setR2L=function(_){return Pt=_,this},v.__private__.getR2L=v.getR2L=function(){return Pt};var qt,Ft=v.__private__.setZoomMode=function(_){var P=[void 0,null,"fullwidth","fullheight","fullpage","original"];if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(_))ht=_;else if(isNaN(_)){if(P.indexOf(_)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+_+'" is not recognized.');ht=_}else ht=parseInt(_,10)};v.__private__.getZoomMode=function(){return ht};var Kt,re=v.__private__.setPageMode=function(_){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(_)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+_+'" is not recognized.');qt=_};v.__private__.getPageMode=function(){return qt};var fe=v.__private__.setLayoutMode=function(_){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(_)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+_+'" is not recognized.');Kt=_};v.__private__.getLayoutMode=function(){return Kt},v.__private__.setDisplayMode=v.setDisplayMode=function(_,P,it){return Ft(_),fe(P),re(it),this};var oe={title:"",subject:"",author:"",keywords:"",creator:""};v.__private__.getDocumentProperty=function(_){if(Object.keys(oe).indexOf(_)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return oe[_]},v.__private__.getDocumentProperties=function(){return oe},v.__private__.setDocumentProperties=v.setProperties=v.setDocumentProperties=function(_){for(var P in oe)oe.hasOwnProperty(P)&&_[P]&&(oe[P]=_[P]);return this},v.__private__.setDocumentProperty=function(_,P){if(Object.keys(oe).indexOf(_)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return oe[_]=P};var Se,ee,En,Pe,ei,Ue={},Qe={},vi=[],He={},ji={},jn={},Wi={},ki=null,Tn=0,te=[],_e=new Wb(v),Sn=e.hotfixes||[],Je={},Pi={},dn=[],ue=function _(P,it,pt,Lt,zt,$t){if(!(this instanceof _))return new _(P,it,pt,Lt,zt,$t);isNaN(P)&&(P=1),isNaN(it)&&(it=0),isNaN(pt)&&(pt=0),isNaN(Lt)&&(Lt=1),isNaN(zt)&&(zt=0),isNaN($t)&&($t=0),this._matrix=[P,it,pt,Lt,zt,$t]};Object.defineProperty(ue.prototype,"sx",{get:function(){return this._matrix[0]},set:function(_){this._matrix[0]=_}}),Object.defineProperty(ue.prototype,"shy",{get:function(){return this._matrix[1]},set:function(_){this._matrix[1]=_}}),Object.defineProperty(ue.prototype,"shx",{get:function(){return this._matrix[2]},set:function(_){this._matrix[2]=_}}),Object.defineProperty(ue.prototype,"sy",{get:function(){return this._matrix[3]},set:function(_){this._matrix[3]=_}}),Object.defineProperty(ue.prototype,"tx",{get:function(){return this._matrix[4]},set:function(_){this._matrix[4]=_}}),Object.defineProperty(ue.prototype,"ty",{get:function(){return this._matrix[5]},set:function(_){this._matrix[5]=_}}),Object.defineProperty(ue.prototype,"a",{get:function(){return this._matrix[0]},set:function(_){this._matrix[0]=_}}),Object.defineProperty(ue.prototype,"b",{get:function(){return this._matrix[1]},set:function(_){this._matrix[1]=_}}),Object.defineProperty(ue.prototype,"c",{get:function(){return this._matrix[2]},set:function(_){this._matrix[2]=_}}),Object.defineProperty(ue.prototype,"d",{get:function(){return this._matrix[3]},set:function(_){this._matrix[3]=_}}),Object.defineProperty(ue.prototype,"e",{get:function(){return this._matrix[4]},set:function(_){this._matrix[4]=_}}),Object.defineProperty(ue.prototype,"f",{get:function(){return this._matrix[5]},set:function(_){this._matrix[5]=_}}),Object.defineProperty(ue.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(ue.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(ue.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(ue.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),ue.prototype.join=function(_){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(K).join(_)},ue.prototype.multiply=function(_){var P=_.sx*this.sx+_.shy*this.shx,it=_.sx*this.shy+_.shy*this.sy,pt=_.shx*this.sx+_.sy*this.shx,Lt=_.shx*this.shy+_.sy*this.sy,zt=_.tx*this.sx+_.ty*this.shx+this.tx,$t=_.tx*this.shy+_.ty*this.sy+this.ty;return new ue(P,it,pt,Lt,zt,$t)},ue.prototype.decompose=function(){var _=this.sx,P=this.shy,it=this.shx,pt=this.sy,Lt=this.tx,zt=this.ty,$t=Math.sqrt(_*_+P*P),le=(_/=$t)*it+(P/=$t)*pt;it-=_*le,pt-=P*le;var ge=Math.sqrt(it*it+pt*pt);return le/=ge,_*(pt/=ge)<P*(it/=ge)&&(_=-_,P=-P,le=-le,$t=-$t),{scale:new ue($t,0,0,ge,0,0),translate:new ue(1,0,0,1,Lt,zt),rotate:new ue(_,P,-P,_,0,0),skew:new ue(1,0,le,1,0,0)}},ue.prototype.toString=function(_){return this.join(" ")},ue.prototype.inversed=function(){var _=this.sx,P=this.shy,it=this.shx,pt=this.sy,Lt=this.tx,zt=this.ty,$t=1/(_*pt-P*it),le=pt*$t,ge=-P*$t,Re=-it*$t,Oe=_*$t;return new ue(le,ge,Re,Oe,-le*Lt-Re*zt,-ge*Lt-Oe*zt)},ue.prototype.applyToPoint=function(_){var P=_.x*this.sx+_.y*this.shx+this.tx,it=_.x*this.shy+_.y*this.sy+this.ty;return new nl(P,it)},ue.prototype.applyToRectangle=function(_){var P=this.applyToPoint(_),it=this.applyToPoint(new nl(_.x+_.w,_.y+_.h));return new ic(P.x,P.y,it.x-P.x,it.y-P.y)},ue.prototype.clone=function(){var _=this.sx,P=this.shy,it=this.shx,pt=this.sy,Lt=this.tx,zt=this.ty;return new ue(_,P,it,pt,Lt,zt)},v.Matrix=ue;var sn=v.matrixMult=function(_,P){return P.multiply(_)},We=new ue(1,0,0,1,0,0);v.unitMatrix=v.identityMatrix=We;var rn=function(_,P){if(!ji[_]){var it=(P instanceof kc?"Sh":"P")+(Object.keys(He).length+1).toString(10);P.id=it,ji[_]=it,He[it]=P,_e.publish("addPattern",P)}};v.ShadingPattern=kc,v.TilingPattern=qu,v.addShadingPattern=function(_,P){return H("addShadingPattern()"),rn(_,P),this},v.beginTilingPattern=function(_){H("beginTilingPattern()"),il(_.boundingBox[0],_.boundingBox[1],_.boundingBox[2]-_.boundingBox[0],_.boundingBox[3]-_.boundingBox[1],_.matrix)},v.endTilingPattern=function(_,P){H("endTilingPattern()"),P.stream=Qt[q].join(`
`),rn(_,P),_e.publish("endTilingPattern",P),dn.pop().restore()};var Dn=v.__private__.newObject=function(){var _=pn();return ea(_,!0),_},pn=v.__private__.newObjectDeferred=function(){return at++,At[at]=function(){return Tt},at},ea=function(_,P){return P=typeof P=="boolean"&&P,At[_]=Tt,P&&ct(_+" 0 obj"),_},ao=v.__private__.newAdditionalObject=function(){var _={objId:pn(),content:""};return Zt.push(_),_},va=pn(),xa=pn(),Bi=v.__private__.decodeColorString=function(_){var P=_.split(" ");if(P.length!==2||P[1]!=="g"&&P[1]!=="G")P.length===5&&(P[4]==="k"||P[4]==="K")&&(P=[(1-P[0])*(1-P[3]),(1-P[1])*(1-P[3]),(1-P[2])*(1-P[3]),"r"]);else{var it=parseFloat(P[0]);P=[it,it,it,"r"]}for(var pt="#",Lt=0;Lt<3;Lt++)pt+=("0"+Math.floor(255*parseFloat(P[Lt])).toString(16)).slice(-2);return pt},zi=v.__private__.encodeColorString=function(_){var P;typeof _=="string"&&(_={ch1:_});var it=_.ch1,pt=_.ch2,Lt=_.ch3,zt=_.ch4,$t=_.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof it=="string"&&it.charAt(0)!=="#"){var le=new ex(it);if(le.ok)it=le.toHex();else if(!/^\d*\.?\d*$/.test(it))throw new Error('Invalid color "'+it+'" passed to jsPDF.encodeColorString.')}if(typeof it=="string"&&/^#[0-9A-Fa-f]{3}$/.test(it)&&(it="#"+it[1]+it[1]+it[2]+it[2]+it[3]+it[3]),typeof it=="string"&&/^#[0-9A-Fa-f]{6}$/.test(it)){var ge=parseInt(it.substr(1),16);it=ge>>16&255,pt=ge>>8&255,Lt=255&ge}if(pt===void 0||zt===void 0&&it===pt&&pt===Lt)if(typeof it=="string")P=it+" "+$t[0];else switch(_.precision){case 2:P=Q(it/255)+" "+$t[0];break;case 3:default:P=D(it/255)+" "+$t[0]}else if(zt===void 0||_n(zt)==="object"){if(zt&&!isNaN(zt.a)&&zt.a===0)return P=["1.","1.","1.",$t[1]].join(" ");if(typeof it=="string")P=[it,pt,Lt,$t[1]].join(" ");else switch(_.precision){case 2:P=[Q(it/255),Q(pt/255),Q(Lt/255),$t[1]].join(" ");break;default:case 3:P=[D(it/255),D(pt/255),D(Lt/255),$t[1]].join(" ")}}else if(typeof it=="string")P=[it,pt,Lt,zt,$t[2]].join(" ");else switch(_.precision){case 2:P=[Q(it),Q(pt),Q(Lt),Q(zt),$t[2]].join(" ");break;case 3:default:P=[D(it),D(pt),D(Lt),D(zt),$t[2]].join(" ")}return P},na=v.__private__.getFilters=function(){return l},Ti=v.__private__.putStream=function(_){var P=(_=_||{}).data||"",it=_.filters||na(),pt=_.alreadyAppliedFilters||[],Lt=_.addLength1||!1,zt=P.length,$t=_.objectId,le=function($n){return $n};if(m!==null&&$t===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");m!==null&&(le=xi.encryptor($t,0));var ge={};it===!0&&(it=["FlateEncode"]);var Re=_.additionalKeyValues||[],Oe=(ge=Ae.API.processDataByFilters!==void 0?Ae.API.processDataByFilters(P,it):{data:P,reverseChain:[]}).reverseChain+(Array.isArray(pt)?pt.join(" "):pt.toString());if(ge.data.length!==0&&(Re.push({key:"Length",value:ge.data.length}),Lt===!0&&Re.push({key:"Length1",value:zt})),Oe.length!=0)if(Oe.split("/").length-1==1)Re.push({key:"Filter",value:Oe});else{Re.push({key:"Filter",value:"["+Oe+"]"});for(var Xe=0;Xe<Re.length;Xe+=1)if(Re[Xe].key==="DecodeParms"){for(var Rn=[],zn=0;zn<ge.reverseChain.split("/").length-1;zn+=1)Rn.push("null");Rn.push(Re[Xe].value),Re[Xe].value="["+Rn.join(" ")+"]"}}ct("<<");for(var Kn=0;Kn<Re.length;Kn++)ct("/"+Re[Kn].key+" "+Re[Kn].value);ct(">>"),ge.data.length!==0&&(ct("stream"),ct(le(ge.data)),ct("endstream"))},gn=v.__private__.putPage=function(_){var P=_.number,it=_.data,pt=_.objId,Lt=_.contentsObjId;ea(pt,!0),ct("<</Type /Page"),ct("/Parent "+_.rootDictionaryObjId+" 0 R"),ct("/Resources "+_.resourceDictionaryObjId+" 0 R"),ct("/MediaBox ["+parseFloat(K(_.mediaBox.bottomLeftX))+" "+parseFloat(K(_.mediaBox.bottomLeftY))+" "+K(_.mediaBox.topRightX)+" "+K(_.mediaBox.topRightY)+"]"),_.cropBox!==null&&ct("/CropBox ["+K(_.cropBox.bottomLeftX)+" "+K(_.cropBox.bottomLeftY)+" "+K(_.cropBox.topRightX)+" "+K(_.cropBox.topRightY)+"]"),_.bleedBox!==null&&ct("/BleedBox ["+K(_.bleedBox.bottomLeftX)+" "+K(_.bleedBox.bottomLeftY)+" "+K(_.bleedBox.topRightX)+" "+K(_.bleedBox.topRightY)+"]"),_.trimBox!==null&&ct("/TrimBox ["+K(_.trimBox.bottomLeftX)+" "+K(_.trimBox.bottomLeftY)+" "+K(_.trimBox.topRightX)+" "+K(_.trimBox.topRightY)+"]"),_.artBox!==null&&ct("/ArtBox ["+K(_.artBox.bottomLeftX)+" "+K(_.artBox.bottomLeftY)+" "+K(_.artBox.topRightX)+" "+K(_.artBox.topRightY)+"]"),typeof _.userUnit=="number"&&_.userUnit!==1&&ct("/UserUnit "+_.userUnit),_e.publish("putPage",{objId:pt,pageContext:te[P],pageNumber:P,page:it}),ct("/Contents "+Lt+" 0 R"),ct(">>"),ct("endobj");var zt=it.join(`
`);return z===C.ADVANCED&&(zt+=`
Q`),ea(Lt,!0),Ti({data:zt,filters:na(),objectId:Lt}),ct("endobj"),pt},pr=v.__private__.putPages=function(){var _,P,it=[];for(_=1;_<=Tn;_++)te[_].objId=pn(),te[_].contentsObjId=pn();for(_=1;_<=Tn;_++)it.push(gn({number:_,data:Qt[_],objId:te[_].objId,contentsObjId:te[_].contentsObjId,mediaBox:te[_].mediaBox,cropBox:te[_].cropBox,bleedBox:te[_].bleedBox,trimBox:te[_].trimBox,artBox:te[_].artBox,userUnit:te[_].userUnit,rootDictionaryObjId:va,resourceDictionaryObjId:xa}));ea(va,!0),ct("<</Type /Pages");var pt="/Kids [";for(P=0;P<Tn;P++)pt+=it[P]+" 0 R ";ct(pt+"]"),ct("/Count "+Tn),ct(">>"),ct("endobj"),_e.publish("postPutPages")},so=function(_){_e.publish("putFont",{font:_,out:ct,newObject:Dn,putStream:Ti}),_.isAlreadyPutted!==!0&&(_.objectNumber=Dn(),ct("<<"),ct("/Type /Font"),ct("/BaseFont /"+zu(_.postScriptName)),ct("/Subtype /Type1"),typeof _.encoding=="string"&&ct("/Encoding /"+_.encoding),ct("/FirstChar 32"),ct("/LastChar 255"),ct(">>"),ct("endobj"))},Ta=function(){for(var _ in Ue)Ue.hasOwnProperty(_)&&(g===!1||g===!0&&x.hasOwnProperty(_))&&so(Ue[_])},Wa=function(_){_.objectNumber=Dn();var P=[];P.push({key:"Type",value:"/XObject"}),P.push({key:"Subtype",value:"/Form"}),P.push({key:"BBox",value:"["+[K(_.x),K(_.y),K(_.x+_.width),K(_.y+_.height)].join(" ")+"]"}),P.push({key:"Matrix",value:"["+_.matrix.toString()+"]"});var it=_.pages[1].join(`
`);Ti({data:it,additionalKeyValues:P,objectId:_.objectNumber}),ct("endobj")},Go=function(){for(var _ in Je)Je.hasOwnProperty(_)&&Wa(Je[_])},Gl=function(_,P){var it,pt=[],Lt=1/(P-1);for(it=0;it<1;it+=Lt)pt.push(it);if(pt.push(1),_[0].offset!=0){var zt={offset:0,color:_[0].color};_.unshift(zt)}if(_[_.length-1].offset!=1){var $t={offset:1,color:_[_.length-1].color};_.push($t)}for(var le="",ge=0,Re=0;Re<pt.length;Re++){for(it=pt[Re];it>_[ge+1].offset;)ge++;var Oe=_[ge].offset,Xe=(it-Oe)/(_[ge+1].offset-Oe),Rn=_[ge].color,zn=_[ge+1].color;le+=rt(Math.round((1-Xe)*Rn[0]+Xe*zn[0]).toString(16))+rt(Math.round((1-Xe)*Rn[1]+Xe*zn[1]).toString(16))+rt(Math.round((1-Xe)*Rn[2]+Xe*zn[2]).toString(16))}return le.trim()},Gc=function(_,P){P||(P=21);var it=Dn(),pt=Gl(_.colors,P),Lt=[];Lt.push({key:"FunctionType",value:"0"}),Lt.push({key:"Domain",value:"[0.0 1.0]"}),Lt.push({key:"Size",value:"["+P+"]"}),Lt.push({key:"BitsPerSample",value:"8"}),Lt.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Lt.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Ti({data:pt,additionalKeyValues:Lt,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:it}),ct("endobj"),_.objectNumber=Dn(),ct("<< /ShadingType "+_.type),ct("/ColorSpace /DeviceRGB");var zt="/Coords ["+K(parseFloat(_.coords[0]))+" "+K(parseFloat(_.coords[1]))+" ";_.type===2?zt+=K(parseFloat(_.coords[2]))+" "+K(parseFloat(_.coords[3])):zt+=K(parseFloat(_.coords[2]))+" "+K(parseFloat(_.coords[3]))+" "+K(parseFloat(_.coords[4]))+" "+K(parseFloat(_.coords[5])),ct(zt+="]"),_.matrix&&ct("/Matrix ["+_.matrix.toString()+"]"),ct("/Function "+it+" 0 R"),ct("/Extend [true true]"),ct(">>"),ct("endobj")},af=function(_,P){var it=pn(),pt=Dn();P.push({resourcesOid:it,objectOid:pt}),_.objectNumber=pt;var Lt=[];Lt.push({key:"Type",value:"/Pattern"}),Lt.push({key:"PatternType",value:"1"}),Lt.push({key:"PaintType",value:"1"}),Lt.push({key:"TilingType",value:"1"}),Lt.push({key:"BBox",value:"["+_.boundingBox.map(K).join(" ")+"]"}),Lt.push({key:"XStep",value:K(_.xStep)}),Lt.push({key:"YStep",value:K(_.yStep)}),Lt.push({key:"Resources",value:it+" 0 R"}),_.matrix&&Lt.push({key:"Matrix",value:"["+_.matrix.toString()+"]"}),Ti({data:_.stream,additionalKeyValues:Lt,objectId:_.objectNumber}),ct("endobj")},Os=function(_){var P;for(P in He)He.hasOwnProperty(P)&&(He[P]instanceof kc?Gc(He[P]):He[P]instanceof qu&&af(He[P],_))},ro=function(_){for(var P in _.objectNumber=Dn(),ct("<<"),_)switch(P){case"opacity":ct("/ca "+Q(_[P]));break;case"stroke-opacity":ct("/CA "+Q(_[P]))}ct(">>"),ct("endobj")},Xa=function(){var _;for(_ in jn)jn.hasOwnProperty(_)&&ro(jn[_])},oo=function(){for(var _ in ct("/XObject <<"),Je)Je.hasOwnProperty(_)&&Je[_].objectNumber>=0&&ct("/"+_+" "+Je[_].objectNumber+" 0 R");_e.publish("putXobjectDict"),ct(">>")},Wc=function(){xi.oid=Dn(),ct("<<"),ct("/Filter /Standard"),ct("/V "+xi.v),ct("/R "+xi.r),ct("/U <"+xi.toHexString(xi.U)+">"),ct("/O <"+xi.toHexString(xi.O)+">"),ct("/P "+xi.P),ct(">>"),ct("endobj")},Ms=function(){for(var _ in ct("/Font <<"),Ue)Ue.hasOwnProperty(_)&&(g===!1||g===!0&&x.hasOwnProperty(_))&&ct("/"+_+" "+Ue[_].objectNumber+" 0 R");ct(">>")},Wl=function(){if(Object.keys(He).length>0){for(var _ in ct("/Shading <<"),He)He.hasOwnProperty(_)&&He[_]instanceof kc&&He[_].objectNumber>=0&&ct("/"+_+" "+He[_].objectNumber+" 0 R");_e.publish("putShadingPatternDict"),ct(">>")}},mr=function(_){if(Object.keys(He).length>0){for(var P in ct("/Pattern <<"),He)He.hasOwnProperty(P)&&He[P]instanceof v.TilingPattern&&He[P].objectNumber>=0&&He[P].objectNumber<_&&ct("/"+P+" "+He[P].objectNumber+" 0 R");_e.publish("putTilingPatternDict"),ct(">>")}},sf=function(){if(Object.keys(jn).length>0){var _;for(_ in ct("/ExtGState <<"),jn)jn.hasOwnProperty(_)&&jn[_].objectNumber>=0&&ct("/"+_+" "+jn[_].objectNumber+" 0 R");_e.publish("putGStateDict"),ct(">>")}},In=function(_){ea(_.resourcesOid,!0),ct("<<"),ct("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),Ms(),Wl(),mr(_.objectOid),sf(),oo(),ct(">>"),ct("endobj")},Xi=function(){var _=[];Ta(),Xa(),Go(),Os(_),_e.publish("putResources"),_.forEach(In),In({resourcesOid:xa,objectOid:Number.MAX_SAFE_INTEGER}),_e.publish("postPutResources")},Xl=function(){_e.publish("putAdditionalObjects");for(var _=0;_<Zt.length;_++){var P=Zt[_];ea(P.objId,!0),ct(P.content),ct("endobj")}_e.publish("postPutAdditionalObjects")},Xc=function(_){Qe[_.fontName]=Qe[_.fontName]||{},Qe[_.fontName][_.fontStyle]=_.id},gr=function(_,P,it,pt,Lt){var zt={id:"F"+(Object.keys(Ue).length+1).toString(10),postScriptName:_,fontName:P,fontStyle:it,encoding:pt,isStandardFont:Lt||!1,metadata:{}};return _e.publish("addFont",{font:zt,instance:this}),Ue[zt.id]=zt,Xc(zt),zt.id},Kc=function(_){for(var P=0,it=Xt.length;P<it;P++){var pt=gr.call(this,_[P][0],_[P][1],_[P][2],Xt[P][3],!0);g===!1&&(x[pt]=!0);var Lt=_[P][0].split("-");Xc({id:pt,fontName:Lt[0],fontStyle:Lt[1]||""})}_e.publish("addFonts",{fonts:Ue,dictionary:Qe})},ia=function(_){return _.foo=function(){try{return _.apply(this,arguments)}catch(pt){var P=pt.stack||"";~P.indexOf(" at ")&&(P=P.split(" at ")[1]);var it="Error in function "+P.split(`
`)[0].split("<")[0]+": "+pt.message;if(!je.console)throw new Error(it);je.console.error(it,pt),je.alert&&alert(it)}},_.foo.bar=_,_.foo},Wo=function(_,P){var it,pt,Lt,zt,$t,le,ge,Re,Oe;if(Lt=(P=P||{}).sourceEncoding||"Unicode",$t=P.outputEncoding,(P.autoencode||$t)&&Ue[Se].metadata&&Ue[Se].metadata[Lt]&&Ue[Se].metadata[Lt].encoding&&(zt=Ue[Se].metadata[Lt].encoding,!$t&&Ue[Se].encoding&&($t=Ue[Se].encoding),!$t&&zt.codePages&&($t=zt.codePages[0]),typeof $t=="string"&&($t=zt[$t]),$t)){for(ge=!1,le=[],it=0,pt=_.length;it<pt;it++)(Re=$t[_.charCodeAt(it)])?le.push(String.fromCharCode(Re)):le.push(_[it]),le[it].charCodeAt(0)>>8&&(ge=!0);_=le.join("")}for(it=_.length;ge===void 0&&it!==0;)_.charCodeAt(it-1)>>8&&(ge=!0),it--;if(!ge)return _;for(le=P.noBOM?[]:[254,255],it=0,pt=_.length;it<pt;it++){if((Oe=(Re=_.charCodeAt(it))>>8)>>8)throw new Error("Character at position "+it+" of string '"+_+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");le.push(Oe),le.push(Re-(Oe<<8))}return String.fromCharCode.apply(void 0,le)},Cn=v.__private__.pdfEscape=v.pdfEscape=function(_,P){return Wo(_,P).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},lo=v.__private__.beginPage=function(_){Qt[++Tn]=[],te[Tn]={objId:0,contentsObjId:0,userUnit:Number(u),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(_[0]),topRightY:Number(_[1])}},Ds(Tn),Bt(Qt[q])},Kl=function(_,P){var it,pt,Lt;switch(n=P||n,typeof _=="string"&&(it=j(_.toLowerCase()),Array.isArray(it)&&(pt=it[0],Lt=it[1])),Array.isArray(_)&&(pt=_[0]*ee,Lt=_[1]*ee),isNaN(pt)&&(pt=s[0],Lt=s[1]),(pt>14400||Lt>14400)&&(Mn.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),pt=Math.min(14400,pt),Lt=Math.min(14400,Lt)),s=[pt,Lt],n.substr(0,1)){case"l":Lt>pt&&(s=[Lt,pt]);break;case"p":pt>Lt&&(s=[Lt,pt])}lo(s),eu(xr),ct(Ka),nc!==0&&ct(nc+" J"),el!==0&&ct(el+" j"),_e.publish("addPage",{pageNumber:Tn})},$l=function(_){_>0&&_<=Tn&&(Qt.splice(_,1),te.splice(_,1),Tn--,q>Tn&&(q=Tn),this.setPage(q))},Ds=function(_){_>0&&_<=Tn&&(q=_)},$c=v.__private__.getNumberOfPages=v.getNumberOfPages=function(){return Qt.length-1},Zl=function(_,P,it){var pt,Lt=void 0;return it=it||{},_=_!==void 0?_:Ue[Se].fontName,P=P!==void 0?P:Ue[Se].fontStyle,pt=_.toLowerCase(),Qe[pt]!==void 0&&Qe[pt][P]!==void 0?Lt=Qe[pt][P]:Qe[_]!==void 0&&Qe[_][P]!==void 0?Lt=Qe[_][P]:it.disableWarning===!1&&Mn.warn("Unable to look up font label for font '"+_+"', '"+P+"'. Refer to getFontList() for available fonts."),Lt||it.noFallback||(Lt=Qe.times[P])==null&&(Lt=Qe.times.normal),Lt},br=v.__private__.putInfo=function(){var _=Dn(),P=function(pt){return pt};for(var it in m!==null&&(P=xi.encryptor(_,0)),ct("<<"),ct("/Producer ("+Cn(P("jsPDF "+Ae.version))+")"),oe)oe.hasOwnProperty(it)&&oe[it]&&ct("/"+it.substr(0,1).toUpperCase()+it.substr(1)+" ("+Cn(P(oe[it]))+")");ct("/CreationDate ("+Cn(P(dt))+")"),ct(">>"),ct("endobj")},Ql=v.__private__.putCatalog=function(_){var P=(_=_||{}).rootDictionaryObjId||va;switch(Dn(),ct("<<"),ct("/Type /Catalog"),ct("/Pages "+P+" 0 R"),ht||(ht="fullwidth"),ht){case"fullwidth":ct("/OpenAction [3 0 R /FitH null]");break;case"fullheight":ct("/OpenAction [3 0 R /FitV null]");break;case"fullpage":ct("/OpenAction [3 0 R /Fit]");break;case"original":ct("/OpenAction [3 0 R /XYZ null null 1]");break;default:var it=""+ht;it.substr(it.length-1)==="%"&&(ht=parseInt(ht)/100),typeof ht=="number"&&ct("/OpenAction [3 0 R /XYZ null null "+Q(ht)+"]")}switch(Kt||(Kt="continuous"),Kt){case"continuous":ct("/PageLayout /OneColumn");break;case"single":ct("/PageLayout /SinglePage");break;case"two":case"twoleft":ct("/PageLayout /TwoColumnLeft");break;case"tworight":ct("/PageLayout /TwoColumnRight")}qt&&ct("/PageMode /"+qt),_e.publish("putCatalog"),ct(">>"),ct("endobj")},Zc=v.__private__.putTrailer=function(){ct("trailer"),ct("<<"),ct("/Size "+(at+1)),ct("/Root "+at+" 0 R"),ct("/Info "+(at-1)+" 0 R"),m!==null&&ct("/Encrypt "+xi.oid+" 0 R"),ct("/ID [ <"+W+"> <"+W+"> ]"),ct(">>")},Qc=v.__private__.putHeader=function(){ct("%PDF-"+A),ct("%ºß¬à")},Jl=v.__private__.putXRef=function(){var _="0000000000";ct("xref"),ct("0 "+(at+1)),ct("0000000000 65535 f ");for(var P=1;P<=at;P++)typeof At[P]=="function"?ct((_+At[P]()).slice(-10)+" 00000 n "):At[P]!==void 0?ct((_+At[P]).slice(-10)+" 00000 n "):ct("0000000000 00000 n ")},Rs=v.__private__.buildDocument=function(){ye(),Bt(St),_e.publish("buildDocument"),Qc(),pr(),Xl(),Xi(),m!==null&&Wc(),br(),Ql();var _=Tt;return Jl(),Zc(),ct("startxref"),ct(""+_),ct("%%EOF"),Bt(Qt[q]),St.join(`
`)},Xo=v.__private__.getBlob=function(_){return new Blob([he(_)],{type:"application/pdf"})},ks=v.output=v.__private__.output=ia(function(_,P){switch(typeof(P=P||{})=="string"?P={filename:P}:P.filename=P.filename||"generated.pdf",_){case void 0:return Rs();case"save":v.save(P.filename);break;case"arraybuffer":return he(Rs());case"blob":return Xo(Rs());case"bloburi":case"bloburl":if(je.URL!==void 0&&typeof je.URL.createObjectURL=="function")return je.URL&&je.URL.createObjectURL(Xo(Rs()))||void 0;Mn.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var it="",pt=Rs();try{it=$g(pt)}catch{it=$g(unescape(encodeURIComponent(pt)))}return"data:application/pdf;filename="+P.filename+";base64,"+it;case"pdfobjectnewwindow":if(Object.prototype.toString.call(je)==="[object Window]"){var Lt="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",zt=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';P.pdfObjectUrl&&(Lt=P.pdfObjectUrl,zt="");var $t='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+Lt+'"'+zt+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(P)+");<\/script></body></html>",le=je.open();return le!==null&&le.document.write($t),le}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(je)==="[object Window]"){var ge='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(P.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+P.filename+'" width="500px" height="400px" /></body></html>',Re=je.open();if(Re!==null){Re.document.write(ge);var Oe=this;Re.document.documentElement.querySelector("#pdfViewer").onload=function(){Re.document.title=P.filename,Re.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(Oe.output("bloburl"))}}return Re}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(je)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Xe='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",P)+'"></iframe></body></html>',Rn=je.open();if(Rn!==null&&(Rn.document.write(Xe),Rn.document.title=P.filename),Rn||typeof safari>"u")return Rn;break;case"datauri":case"dataurl":return je.document.location.href=this.output("datauristring",P);default:return null}}),Ko=function(_){return Array.isArray(Sn)===!0&&Sn.indexOf(_)>-1};switch(i){case"pt":ee=1;break;case"mm":ee=72/25.4;break;case"cm":ee=72/2.54;break;case"in":ee=72;break;case"px":ee=Ko("px_scaling")==1?.75:96/72;break;case"pc":case"em":ee=12;break;case"ex":ee=6;break;default:if(typeof i!="number")throw new Error("Invalid unit: "+i);ee=i}var xi=null;gt(),ut();var yr=function(_){return m!==null?xi.encryptor(_,0):function(P){return P}},Ps=v.__private__.getPageInfo=v.getPageInfo=function(_){if(isNaN(_)||_%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:te[_].objId,pageNumber:_,pageContext:te[_]}},Te=v.__private__.getPageInfoByObjId=function(_){if(isNaN(_)||_%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var P in te)if(te[P].objId===_)break;return Ps(P)},tc=v.__private__.getCurrentPageInfo=v.getCurrentPageInfo=function(){return{objId:te[q].objId,pageNumber:q,pageContext:te[q]}};v.addPage=function(){return Kl.apply(this,arguments),this},v.setPage=function(){return Ds.apply(this,arguments),Bt.call(this,Qt[q]),this},v.insertPage=function(_){return this.addPage(),this.movePage(q,_),this},v.movePage=function(_,P){var it,pt;if(_>P){it=Qt[_],pt=te[_];for(var Lt=_;Lt>P;Lt--)Qt[Lt]=Qt[Lt-1],te[Lt]=te[Lt-1];Qt[P]=it,te[P]=pt,this.setPage(P)}else if(_<P){it=Qt[_],pt=te[_];for(var zt=_;zt<P;zt++)Qt[zt]=Qt[zt+1],te[zt]=te[zt+1];Qt[P]=it,te[P]=pt,this.setPage(P)}return this},v.deletePage=function(){return $l.apply(this,arguments),this},v.__private__.text=v.text=function(_,P,it,pt,Lt){var zt,$t,le,ge,Re,Oe,Xe,Rn,zn,Kn=(pt=pt||{}).scope||this;if(typeof _=="number"&&typeof P=="number"&&(typeof it=="string"||Array.isArray(it))){var $n=it;it=P,P=_,_=$n}if(arguments[3]instanceof ue?(H("The transform parameter of text() with a Matrix value"),zn=Lt):(le=arguments[4],ge=arguments[5],_n(Xe=arguments[3])==="object"&&Xe!==null||(typeof le=="string"&&(ge=le,le=null),typeof Xe=="string"&&(ge=Xe,Xe=null),typeof Xe=="number"&&(le=Xe,Xe=null),pt={flags:Xe,angle:le,align:ge})),isNaN(P)||isNaN(it)||_==null)throw new Error("Invalid arguments passed to jsPDF.text");if(_.length===0)return Kn;var wi="",$a=!1,Sa=typeof pt.lineHeightFactor=="number"?pt.lineHeightFactor:wa,Za=Kn.internal.scaleFactor;function rc(Ve){return Ve=Ve.split(" ").join(Array(pt.TabLen||9).join(" ")),Cn(Ve,Xe)}function zs(Ve){for(var Ye,Nn=Ve.concat(),Zn=[],Da=Nn.length;Da--;)typeof(Ye=Nn.shift())=="string"?Zn.push(Ye):Array.isArray(Ve)&&(Ye.length===1||Ye[1]===void 0&&Ye[2]===void 0)?Zn.push(Ye[0]):Zn.push([Ye[0],Ye[1],Ye[2]]);return Zn}function Fs(Ve,Ye){var Nn;if(typeof Ve=="string")Nn=Ye(Ve)[0];else if(Array.isArray(Ve)){for(var Zn,Da,Dr=Ve.concat(),Rr=[],Is=Dr.length;Is--;)typeof(Zn=Dr.shift())=="string"?Rr.push(Ye(Zn)[0]):Array.isArray(Zn)&&typeof Zn[0]=="string"&&(Da=Ye(Zn[0],Zn[1],Zn[2]),Rr.push([Da[0],Da[1],Da[2]]));Nn=Rr}return Nn}var rl=!1,Nr=!0;if(typeof _=="string")rl=!0;else if(Array.isArray(_)){var ol=_.concat();$t=[];for(var ho,li=ol.length;li--;)(typeof(ho=ol.shift())!="string"||Array.isArray(ho)&&typeof ho[0]!="string")&&(Nr=!1);rl=Nr}if(rl===!1)throw new Error('Type of text must be string or Array. "'+_+'" is not recognized.');typeof _=="string"&&(_=_.match(/[\r?\n]/)?_.split(/\r\n|\r|\n/g):[_]);var Ar=J/Kn.internal.scaleFactor,po=Ar*(Sa-1);switch(pt.baseline){case"bottom":it-=po;break;case"top":it+=Ar-po;break;case"hanging":it+=Ar-2*po;break;case"middle":it+=Ar/2-po}if((Oe=pt.maxWidth||0)>0&&(typeof _=="string"?_=Kn.splitTextToSize(_,Oe):Object.prototype.toString.call(_)==="[object Array]"&&(_=_.reduce(function(Ve,Ye){return Ve.concat(Kn.splitTextToSize(Ye,Oe))},[]))),zt={text:_,x:P,y:it,options:pt,mutex:{pdfEscape:Cn,activeFontKey:Se,fonts:Ue,activeFontSize:J}},_e.publish("preProcessText",zt),_=zt.text,le=(pt=zt.options).angle,!(zn instanceof ue)&&le&&typeof le=="number"){le*=Math.PI/180,pt.rotationDirection===0&&(le=-le),z===C.ADVANCED&&(le=-le);var mo=Math.cos(le),ll=Math.sin(le);zn=new ue(mo,ll,-ll,mo,0,0)}else le&&le instanceof ue&&(zn=le);z!==C.ADVANCED||zn||(zn=We),(Re=pt.charSpace||tl)!==void 0&&(wi+=K(R(Re))+` Tc
`,this.setCharSpace(this.getCharSpace()||0)),(Rn=pt.horizontalScale)!==void 0&&(wi+=K(100*Rn)+` Tz
`),pt.lang;var sa=-1,uf=pt.renderingMode!==void 0?pt.renderingMode:pt.stroke,oc=Kn.internal.getCurrentPageInfo().pageContext;switch(uf){case 0:case!1:case"fill":sa=0;break;case 1:case!0:case"stroke":sa=1;break;case 2:case"fillThenStroke":sa=2;break;case 3:case"invisible":sa=3;break;case 4:case"fillAndAddForClipping":sa=4;break;case 5:case"strokeAndAddPathForClipping":sa=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":sa=6;break;case 7:case"addToPathForClipping":sa=7}var iu=oc.usedRenderingMode!==void 0?oc.usedRenderingMode:-1;sa!==-1?wi+=sa+` Tr
`:iu!==-1&&(wi+=`0 Tr
`),sa!==-1&&(oc.usedRenderingMode=sa),ge=pt.align||"left";var Ma,_i=J*Sa,Lr=Kn.internal.pageSize.getWidth(),lc=Ue[Se];Re=pt.charSpace||tl,Oe=pt.maxWidth||0,Xe=Object.assign({autoencode:!0,noBOM:!0},pt.flags);var qs=[],Er=function(Ve){return Kn.getStringUnitWidth(Ve,{font:lc,charSpace:Re,fontSize:J,doKerning:!1})*J/Za};if(Object.prototype.toString.call(_)==="[object Array]"){var Ki;$t=zs(_),ge!=="left"&&(Ma=$t.map(Er));var Ci,jr=0;if(ge==="right"){P-=Ma[0],_=[],li=$t.length;for(var ra=0;ra<li;ra++)ra===0?(Ci=_a(P),Ki=ps(it)):(Ci=R(jr-Ma[ra]),Ki=-_i),_.push([$t[ra],Ci,Ki]),jr=Ma[ra]}else if(ge==="center"){P-=Ma[0]/2,_=[],li=$t.length;for(var Qa=0;Qa<li;Qa++)Qa===0?(Ci=_a(P),Ki=ps(it)):(Ci=R((jr-Ma[Qa])/2),Ki=-_i),_.push([$t[Qa],Ci,Ki]),jr=Ma[Qa]}else if(ge==="left"){_=[],li=$t.length;for(var ms=0;ms<li;ms++)_.push($t[ms])}else if(ge==="justify"&&lc.encoding==="Identity-H"){_=[],li=$t.length,Oe=Oe!==0?Oe:Lr;for(var Ja=0,Hn=0;Hn<li;Hn++)if(Ki=Hn===0?ps(it):-_i,Ci=Hn===0?_a(P):Ja,Hn<li-1){var ts=R((Oe-Ma[Hn])/($t[Hn].split(" ").length-1)),ni=$t[Hn].split(" ");_.push([ni[0]+" ",Ci,Ki]),Ja=0;for(var oa=1;oa<ni.length;oa++){var go=(Er(ni[oa-1]+" "+ni[oa])-Er(ni[oa]))*Za+ts;oa==ni.length-1?_.push([ni[oa],go,0]):_.push([ni[oa]+" ",go,0]),Ja-=go}}else _.push([$t[Hn],Ci,Ki]);_.push(["",Ja,0])}else{if(ge!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(_=[],li=$t.length,Oe=Oe!==0?Oe:Lr,Hn=0;Hn<li;Hn++)Ki=Hn===0?ps(it):-_i,Ci=Hn===0?_a(P):0,Hn<li-1?qs.push(K(R((Oe-Ma[Hn])/($t[Hn].split(" ").length-1)))):qs.push(0),_.push([$t[Hn],Ci,Ki])}}var gs=typeof pt.R2L=="boolean"?pt.R2L:Pt;gs===!0&&(_=Fs(_,function(Ve,Ye,Nn){return[Ve.split("").reverse().join(""),Ye,Nn]})),zt={text:_,x:P,y:it,options:pt,mutex:{pdfEscape:Cn,activeFontKey:Se,fonts:Ue,activeFontSize:J}},_e.publish("postProcessText",zt),_=zt.text,$a=zt.mutex.isHex||!1;var cl=Ue[Se].encoding;cl!=="WinAnsiEncoding"&&cl!=="StandardEncoding"||(_=Fs(_,function(Ve,Ye,Nn){return[rc(Ve),Ye,Nn]})),$t=zs(_),_=[];for(var Tr,Cr,Or,bo=0,ul=1,Mr=Array.isArray($t[0])?ul:bo,Us="",yo=function(Ve,Ye,Nn){var Zn="";return Nn instanceof ue?(Nn=typeof pt.angle=="number"?sn(Nn,new ue(1,0,0,1,Ve,Ye)):sn(new ue(1,0,0,1,Ve,Ye),Nn),z===C.ADVANCED&&(Nn=sn(new ue(1,0,0,-1,0,0),Nn)),Zn=Nn.join(" ")+` Tm
`):Zn=K(Ve)+" "+K(Ye)+` Td
`,Zn},Vn=0;Vn<$t.length;Vn++){switch(Us="",Mr){case ul:Or=($a?"<":"(")+$t[Vn][0]+($a?">":")"),Tr=parseFloat($t[Vn][1]),Cr=parseFloat($t[Vn][2]);break;case bo:Or=($a?"<":"(")+$t[Vn]+($a?">":")"),Tr=_a(P),Cr=ps(it)}qs!==void 0&&qs[Vn]!==void 0&&(Us=qs[Vn]+` Tw
`),Vn===0?_.push(Us+yo(Tr,Cr,zn)+Or):Mr===bo?_.push(Us+Or):Mr===ul&&_.push(Us+yo(Tr,Cr,zn)+Or)}_=Mr===bo?_.join(` Tj
T* `):_.join(` Tj
`),_+=` Tj
`;var Na=`BT
/`;return Na+=Se+" "+J+` Tf
`,Na+=K(J*Sa)+` TL
`,Na+=uo+`
`,Na+=wi,Na+=_,ct(Na+="ET"),x[Se]=!0,Kn};var Jc=v.__private__.clip=v.clip=function(_){return ct(_==="evenodd"?"W*":"W"),this};v.clipEvenOdd=function(){return Jc("evenodd")},v.__private__.discardPath=v.discardPath=function(){return ct("n"),this};var aa=v.__private__.isValidStyle=function(_){var P=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(_)!==-1&&(P=!0),P};v.__private__.setDefaultPathOperation=v.setDefaultPathOperation=function(_){return aa(_)&&(d=_),this};var Ca=v.__private__.getStyle=v.getStyle=function(_){var P=d;switch(_){case"D":case"S":P="S";break;case"F":P="f";break;case"FD":case"DF":P="B";break;case"f":case"f*":case"B":case"B*":P=_}return P},$o=v.close=function(){return ct("h"),this};v.stroke=function(){return ct("S"),this},v.fill=function(_){return fs("f",_),this},v.fillEvenOdd=function(_){return fs("f*",_),this},v.fillStroke=function(_){return fs("B",_),this},v.fillStrokeEvenOdd=function(_){return fs("B*",_),this};var fs=function(_,P){_n(P)==="object"?Zo(P,_):ct(_)},Oa=function(_){_===null||z===C.ADVANCED&&_===void 0||(_=Ca(_),ct(_))};function ec(_,P,it,pt,Lt){var zt=new qu(P||this.boundingBox,it||this.xStep,pt||this.yStep,this.gState,Lt||this.matrix);zt.stream=this.stream;var $t=_+"$$"+this.cloneIndex+++"$$";return rn($t,zt),zt}var Zo=function(_,P){var it=ji[_.key],pt=He[it];if(pt instanceof kc)ct("q"),ct(tu(P)),pt.gState&&v.setGState(pt.gState),ct(_.matrix.toString()+" cm"),ct("/"+it+" sh"),ct("Q");else if(pt instanceof qu){var Lt=new ue(1,0,0,-1,0,Sr());_.matrix&&(Lt=Lt.multiply(_.matrix||We),it=ec.call(pt,_.key,_.boundingBox,_.xStep,_.yStep,Lt).id),ct("q"),ct("/Pattern cs"),ct("/"+it+" scn"),pt.gState&&v.setGState(pt.gState),ct(P),ct("Q")}},tu=function(_){switch(_){case"f":case"F":return"W n";case"f*":return"W* n";case"B":return"W S";case"B*":return"W* S";case"S":return"W S";case"n":return"W n"}},vr=v.moveTo=function(_,P){return ct(K(R(_))+" "+K(nt(P))+" m"),this},hs=v.lineTo=function(_,P){return ct(K(R(_))+" "+K(nt(P))+" l"),this},Bs=v.curveTo=function(_,P,it,pt,Lt,zt){return ct([K(R(_)),K(nt(P)),K(R(it)),K(nt(pt)),K(R(Lt)),K(nt(zt)),"c"].join(" ")),this};v.__private__.line=v.line=function(_,P,it,pt,Lt){if(isNaN(_)||isNaN(P)||isNaN(it)||isNaN(pt)||!aa(Lt))throw new Error("Invalid arguments passed to jsPDF.line");return z===C.COMPAT?this.lines([[it-_,pt-P]],_,P,[1,1],Lt||"S"):this.lines([[it-_,pt-P]],_,P,[1,1]).stroke()},v.__private__.lines=v.lines=function(_,P,it,pt,Lt,zt){var $t,le,ge,Re,Oe,Xe,Rn,zn,Kn,$n,wi,$a;if(typeof _=="number"&&($a=it,it=P,P=_,_=$a),pt=pt||[1,1],zt=zt||!1,isNaN(P)||isNaN(it)||!Array.isArray(_)||!Array.isArray(pt)||!aa(Lt)||typeof zt!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(vr(P,it),$t=pt[0],le=pt[1],Re=_.length,$n=P,wi=it,ge=0;ge<Re;ge++)(Oe=_[ge]).length===2?($n=Oe[0]*$t+$n,wi=Oe[1]*le+wi,hs($n,wi)):(Xe=Oe[0]*$t+$n,Rn=Oe[1]*le+wi,zn=Oe[2]*$t+$n,Kn=Oe[3]*le+wi,$n=Oe[4]*$t+$n,wi=Oe[5]*le+wi,Bs(Xe,Rn,zn,Kn,$n,wi));return zt&&$o(),Oa(Lt),this},v.path=function(_){for(var P=0;P<_.length;P++){var it=_[P],pt=it.c;switch(it.op){case"m":vr(pt[0],pt[1]);break;case"l":hs(pt[0],pt[1]);break;case"c":Bs.apply(this,pt);break;case"h":$o()}}return this},v.__private__.rect=v.rect=function(_,P,it,pt,Lt){if(isNaN(_)||isNaN(P)||isNaN(it)||isNaN(pt)||!aa(Lt))throw new Error("Invalid arguments passed to jsPDF.rect");return z===C.COMPAT&&(pt=-pt),ct([K(R(_)),K(nt(P)),K(R(it)),K(R(pt)),"re"].join(" ")),Oa(Lt),this},v.__private__.triangle=v.triangle=function(_,P,it,pt,Lt,zt,$t){if(isNaN(_)||isNaN(P)||isNaN(it)||isNaN(pt)||isNaN(Lt)||isNaN(zt)||!aa($t))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[it-_,pt-P],[Lt-it,zt-pt],[_-Lt,P-zt]],_,P,[1,1],$t,!0),this},v.__private__.roundedRect=v.roundedRect=function(_,P,it,pt,Lt,zt,$t){if(isNaN(_)||isNaN(P)||isNaN(it)||isNaN(pt)||isNaN(Lt)||isNaN(zt)||!aa($t))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var le=4/3*(Math.SQRT2-1);return Lt=Math.min(Lt,.5*it),zt=Math.min(zt,.5*pt),this.lines([[it-2*Lt,0],[Lt*le,0,Lt,zt-zt*le,Lt,zt],[0,pt-2*zt],[0,zt*le,-Lt*le,zt,-Lt,zt],[2*Lt-it,0],[-Lt*le,0,-Lt,-zt*le,-Lt,-zt],[0,2*zt-pt],[0,-zt*le,Lt*le,-zt,Lt,-zt]],_+Lt,P,[1,1],$t,!0),this},v.__private__.ellipse=v.ellipse=function(_,P,it,pt,Lt){if(isNaN(_)||isNaN(P)||isNaN(it)||isNaN(pt)||!aa(Lt))throw new Error("Invalid arguments passed to jsPDF.ellipse");var zt=4/3*(Math.SQRT2-1)*it,$t=4/3*(Math.SQRT2-1)*pt;return vr(_+it,P),Bs(_+it,P-$t,_+zt,P-pt,_,P-pt),Bs(_-zt,P-pt,_-it,P-$t,_-it,P),Bs(_-it,P+$t,_-zt,P+pt,_,P+pt),Bs(_+zt,P+pt,_+it,P+$t,_+it,P),Oa(Lt),this},v.__private__.circle=v.circle=function(_,P,it,pt){if(isNaN(_)||isNaN(P)||isNaN(it)||!aa(pt))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(_,P,it,it,pt)},v.setFont=function(_,P,it){return it&&(P=st(P,it)),Se=Zl(_,P,{disableWarning:!1}),this};var Fi=v.__private__.getFont=v.getFont=function(){return Ue[Zl.apply(v,arguments)]};v.__private__.getFontList=v.getFontList=function(){var _,P,it={};for(_ in Qe)if(Qe.hasOwnProperty(_))for(P in it[_]=[],Qe[_])Qe[_].hasOwnProperty(P)&&it[_].push(P);return it},v.addFont=function(_,P,it,pt,Lt){var zt=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&zt.indexOf(arguments[3])!==-1?Lt=arguments[3]:arguments[3]&&zt.indexOf(arguments[3])==-1&&(it=st(it,pt)),Lt=Lt||"Identity-H",gr.call(this,_,P,it,Lt)};var wa,xr=e.lineWidth||.200025,ds=v.__private__.getLineWidth=v.getLineWidth=function(){return xr},eu=v.__private__.setLineWidth=v.setLineWidth=function(_){return xr=_,ct(K(R(_))+" w"),this};v.__private__.setLineDash=Ae.API.setLineDash=Ae.API.setLineDashPattern=function(_,P){if(_=_||[],P=P||0,isNaN(P)||!Array.isArray(_))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return _=_.map(function(it){return K(R(it))}).join(" "),P=K(R(P)),ct("["+_+"] "+P+" d"),this};var Qo=v.__private__.getLineHeight=v.getLineHeight=function(){return J*wa};v.__private__.getLineHeight=v.getLineHeight=function(){return J*wa};var Jo=v.__private__.setLineHeightFactor=v.setLineHeightFactor=function(_){return typeof(_=_||1.15)=="number"&&(wa=_),this},wr=v.__private__.getLineHeightFactor=v.getLineHeightFactor=function(){return wa};Jo(e.lineHeight);var _a=v.__private__.getHorizontalCoordinate=function(_){return R(_)},ps=v.__private__.getVerticalCoordinate=function(_){return z===C.ADVANCED?_:te[q].mediaBox.topRightY-te[q].mediaBox.bottomLeftY-R(_)},rf=v.__private__.getHorizontalCoordinateString=v.getHorizontalCoordinateString=function(_){return K(_a(_))},_r=v.__private__.getVerticalCoordinateString=v.getVerticalCoordinateString=function(_){return K(ps(_))},Ka=e.strokeColor||"0 G";v.__private__.getStrokeColor=v.getDrawColor=function(){return Bi(Ka)},v.__private__.setStrokeColor=v.setDrawColor=function(_,P,it,pt){return Ka=zi({ch1:_,ch2:P,ch3:it,ch4:pt,pdfColorType:"draw",precision:2}),ct(Ka),this};var co=e.fillColor||"0 g";v.__private__.getFillColor=v.getFillColor=function(){return Bi(co)},v.__private__.setFillColor=v.setFillColor=function(_,P,it,pt){return co=zi({ch1:_,ch2:P,ch3:it,ch4:pt,pdfColorType:"fill",precision:2}),ct(co),this};var uo=e.textColor||"0 g",of=v.__private__.getTextColor=v.getTextColor=function(){return Bi(uo)};v.__private__.setTextColor=v.setTextColor=function(_,P,it,pt){return uo=zi({ch1:_,ch2:P,ch3:it,ch4:pt,pdfColorType:"text",precision:3}),this};var tl=e.charSpace,lf=v.__private__.getCharSpace=v.getCharSpace=function(){return parseFloat(tl||0)};v.__private__.setCharSpace=v.setCharSpace=function(_){if(isNaN(_))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return tl=_,this};var nc=0;v.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},v.__private__.setLineCap=v.setLineCap=function(_){var P=v.CapJoinStyles[_];if(P===void 0)throw new Error("Line cap style of '"+_+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return nc=P,ct(P+" J"),this};var el=0;v.__private__.setLineJoin=v.setLineJoin=function(_){var P=v.CapJoinStyles[_];if(P===void 0)throw new Error("Line join style of '"+_+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return el=P,ct(P+" j"),this},v.__private__.setLineMiterLimit=v.__private__.setMiterLimit=v.setLineMiterLimit=v.setMiterLimit=function(_){if(_=_||0,isNaN(_))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return ct(K(R(_))+" M"),this},v.GState=Ap,v.setGState=function(_){(_=typeof _=="string"?jn[Wi[_]]:nu(null,_)).equals(ki)||(ct("/"+_.id+" gs"),ki=_)};var nu=function(_,P){if(!_||!Wi[_]){var it=!1;for(var pt in jn)if(jn.hasOwnProperty(pt)&&jn[pt].equals(P)){it=!0;break}if(it)P=jn[pt];else{var Lt="GS"+(Object.keys(jn).length+1).toString(10);jn[Lt]=P,P.id=Lt}return _&&(Wi[_]=P.id),_e.publish("addGState",P),P}};v.addGState=function(_,P){return nu(_,P),this},v.saveGraphicsState=function(){return ct("q"),vi.push({key:Se,size:J,color:uo}),this},v.restoreGraphicsState=function(){ct("Q");var _=vi.pop();return Se=_.key,J=_.size,uo=_.color,ki=null,this},v.setCurrentTransformationMatrix=function(_){return ct(_.toString()+" cm"),this},v.comment=function(_){return ct("#"+_),this};var nl=function(_,P){var it=_||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return it},set:function(zt){isNaN(zt)||(it=parseFloat(zt))}});var pt=P||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return pt},set:function(zt){isNaN(zt)||(pt=parseFloat(zt))}});var Lt="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return Lt},set:function(zt){Lt=zt.toString()}}),this},ic=function(_,P,it,pt){nl.call(this,_,P),this.type="rect";var Lt=it||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return Lt},set:function($t){isNaN($t)||(Lt=parseFloat($t))}});var zt=pt||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return zt},set:function($t){isNaN($t)||(zt=parseFloat($t))}}),this},ac=function(){this.page=Tn,this.currentPage=q,this.pages=Qt.slice(0),this.pagesContext=te.slice(0),this.x=En,this.y=Pe,this.matrix=ei,this.width=fo(q),this.height=Sr(q),this.outputDestination=ie,this.id="",this.objectNumber=-1};ac.prototype.restore=function(){Tn=this.page,q=this.currentPage,te=this.pagesContext,Qt=this.pages,En=this.x,Pe=this.y,ei=this.matrix,sl(q,this.width),sc(q,this.height),ie=this.outputDestination};var il=function(_,P,it,pt,Lt){dn.push(new ac),Tn=q=0,Qt=[],En=_,Pe=P,ei=Lt,lo([it,pt])},cf=function(_){if(Pi[_])dn.pop().restore();else{var P=new ac,it="Xo"+(Object.keys(Je).length+1).toString(10);P.id=it,Pi[_]=it,Je[it]=P,_e.publish("addFormObject",P),dn.pop().restore()}};for(var al in v.beginFormObject=function(_,P,it,pt,Lt){return il(_,P,it,pt,Lt),this},v.endFormObject=function(_){return cf(_),this},v.doFormObject=function(_,P){var it=Je[Pi[_]];return ct("q"),ct(P.toString()+" cm"),ct("/"+it.id+" Do"),ct("Q"),this},v.getFormObject=function(_){var P=Je[Pi[_]];return{x:P.x,y:P.y,width:P.width,height:P.height,matrix:P.matrix}},v.save=function(_,P){return _=_||"generated.pdf",(P=P||{}).returnPromise=P.returnPromise||!1,P.returnPromise===!1?(Rc(Xo(Rs()),_),typeof Rc.unload=="function"&&je.setTimeout&&setTimeout(Rc.unload,911),this):new Promise(function(it,pt){try{var Lt=Rc(Xo(Rs()),_);typeof Rc.unload=="function"&&je.setTimeout&&setTimeout(Rc.unload,911),it(Lt)}catch(zt){pt(zt.message)}})},Ae.API)Ae.API.hasOwnProperty(al)&&(al==="events"&&Ae.API.events.length?function(_,P){var it,pt,Lt;for(Lt=P.length-1;Lt!==-1;Lt--)it=P[Lt][0],pt=P[Lt][1],_.subscribe.apply(_,[it].concat(typeof pt=="function"?[pt]:pt))}(_e,Ae.API.events):v[al]=Ae.API[al]);var fo=v.getPageWidth=function(_){return(te[_=_||q].mediaBox.topRightX-te[_].mediaBox.bottomLeftX)/ee},sl=v.setPageWidth=function(_,P){te[_].mediaBox.topRightX=P*ee+te[_].mediaBox.bottomLeftX},Sr=v.getPageHeight=function(_){return(te[_=_||q].mediaBox.topRightY-te[_].mediaBox.bottomLeftY)/ee},sc=v.setPageHeight=function(_,P){te[_].mediaBox.topRightY=P*ee+te[_].mediaBox.bottomLeftY};return v.internal={pdfEscape:Cn,getStyle:Ca,getFont:Fi,getFontSize:mt,getCharSpace:lf,getTextColor:of,getLineHeight:Qo,getLineHeightFactor:wr,getLineWidth:ds,write:me,getHorizontalCoordinate:_a,getVerticalCoordinate:ps,getCoordinateString:rf,getVerticalCoordinateString:_r,collections:{},newObject:Dn,newAdditionalObject:ao,newObjectDeferred:pn,newObjectDeferredBegin:ea,getFilters:na,putStream:Ti,events:_e,scaleFactor:ee,pageSize:{getWidth:function(){return fo(q)},setWidth:function(_){sl(q,_)},getHeight:function(){return Sr(q)},setHeight:function(_){sc(q,_)}},encryptionOptions:m,encryption:xi,getEncryptor:yr,output:ks,getNumberOfPages:$c,pages:Qt,out:ct,f2:Q,f3:D,getPageInfo:Ps,getPageInfoByObjId:Te,getCurrentPageInfo:tc,getPDFVersion:N,Point:nl,Rectangle:ic,Matrix:ue,hasHotfix:Ko},Object.defineProperty(v.internal.pageSize,"width",{get:function(){return fo(q)},set:function(_){sl(q,_)},enumerable:!0,configurable:!0}),Object.defineProperty(v.internal.pageSize,"height",{get:function(){return Sr(q)},set:function(_){sc(q,_)},enumerable:!0,configurable:!0}),Kc.call(v,Xt),Se="F1",Kl(s,n),_e.publish("initialized"),v}Bu.prototype.lsbFirstWord=function(e){return String.fromCharCode(e>>0&255,e>>8&255,e>>16&255,e>>24&255)},Bu.prototype.toHexString=function(e){return e.split("").map(function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)}).join("")},Bu.prototype.hexToBytes=function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(String.fromCharCode(parseInt(e.substr(n,2),16)));return t.join("")},Bu.prototype.processOwnerPassword=function(e,t){return Qg(Zg(t).substr(0,5),e)},Bu.prototype.encryptor=function(e,t){var n=Zg(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(i){return Qg(n,i)}},Ap.prototype.equals=function(e){var t,n="id,objectNumber,equals";if(!e||_n(e)!==_n(this))return!1;var i=0;for(t in this)if(!(n.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t)||this[t]!==e[t])return!1;i++}for(t in e)e.hasOwnProperty(t)&&n.indexOf(t)<0&&i--;return i===0},Ae.API={events:[]},Ae.version="3.0.1";var ri=Ae.API,U0=1,Yc=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ku=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},ke=function(e){return e.toFixed(2)},Bl=function(e){return e.toFixed(5)};ri.__acroform__={};var Ga=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},Xb=function(e){return e*U0},Zr=function(e){var t=new sx,n=pe.internal.getHeight(e)||0,i=pe.internal.getWidth(e)||0;return t.BBox=[0,0,Number(ke(i)),Number(ke(n))],t},w7=ri.__acroform__.setBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|=1<<t},_7=ri.__acroform__.clearBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&=~(1<<t)},S7=ri.__acroform__.getBit=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return(e&1<<t)==0?0:1},pi=ri.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return S7(e,t-1)},mi=ri.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return w7(e,t-1)},gi=ri.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return _7(e,t-1)},N7=ri.__acroform__.calculateCoordinates=function(e,t){var n=t.internal.getHorizontalCoordinate,i=t.internal.getVerticalCoordinate,s=e[0],o=e[1],l=e[2],u=e[3],f={};return f.lowerLeft_X=n(s)||0,f.lowerLeft_Y=i(o+u)||0,f.upperRight_X=n(s+l)||0,f.upperRight_Y=i(o)||0,[Number(ke(f.lowerLeft_X)),Number(ke(f.lowerLeft_Y)),Number(ke(f.upperRight_X)),Number(ke(f.upperRight_Y))]},A7=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],n=e._V||e.DV,i=Jg(e,n),s=e.scope.internal.getFont(e.fontName,e.fontStyle).id;t.push("/Tx BMC"),t.push("q"),t.push("BT"),t.push(e.scope.__private__.encodeColorString(e.color)),t.push("/"+s+" "+ke(i.fontSize)+" Tf"),t.push("1 0 0 1 0 0 Tm"),t.push(i.text),t.push("ET"),t.push("Q"),t.push("EMC");var o=Zr(e);return o.scope=e.scope,o.stream=t.join(`
`),o}},Jg=function(e,t){var n=e.fontSize===0?e.maxFontSize:e.fontSize,i={text:"",fontSize:""},s=(t=(t=t.substr(0,1)=="("?t.substr(1):t).substr(t.length-1)==")"?t.substr(0,t.length-1):t).split(" ");s=e.multiline?s.map(function(D){return D.split(`
`)}):s.map(function(D){return[D]});var o=n,l=pe.internal.getHeight(e)||0;l=l<0?-l:l;var u=pe.internal.getWidth(e)||0;u=u<0?-u:u;var f=function(D,R,et){if(D+1<s.length){var nt=R+" "+s[D+1][0];return $d(nt,e,et).width<=u-4}return!1};o++;t:for(;o>0;){t="",o--;var d,m,g=$d("3",e,o).height,x=e.multiline?l-o:(l-g)/2,v=x+=2,A=0,N=0,E=0;if(o<=0){t=`(...) Tj
`,t+="% Width of Text: "+$d(t,e,o=12).width+", FieldWidth:"+u+`
`;break}for(var j="",C=0,z=0;z<s.length;z++)if(s.hasOwnProperty(z)){var Z=!1;if(s[z].length!==1&&E!==s[z].length-1){if((g+2)*(C+2)+2>l)continue t;j+=s[z][E],Z=!0,N=z,z--}else{j=(j+=s[z][E]+" ").substr(j.length-1)==" "?j.substr(0,j.length-1):j;var I=parseInt(z),st=f(I,j,o),K=z>=s.length-1;if(st&&!K){j+=" ",E=0;continue}if(st||K){if(K)N=I;else if(e.multiline&&(g+2)*(C+2)+2>l)continue t}else{if(!e.multiline||(g+2)*(C+2)+2>l)continue t;N=I}}for(var H="",G=A;G<=N;G++){var Q=s[G];if(e.multiline){if(G===N){H+=Q[E]+" ",E=(E+1)%Q.length;continue}if(G===A){H+=Q[Q.length-1]+" ";continue}}H+=Q[0]+" "}switch(H=H.substr(H.length-1)==" "?H.substr(0,H.length-1):H,m=$d(H,e,o).width,e.textAlign){case"right":d=u-m-2;break;case"center":d=(u-m)/2;break;case"left":default:d=2}t+=ke(d)+" "+ke(v)+` Td
`,t+="("+Yc(H)+`) Tj
`,t+=-ke(d)+` 0 Td
`,v=-(o+2),m=0,A=Z?N:N+1,C++,j=""}break}return i.text=t,i.fontSize=o,i},$d=function(e,t,n){var i=t.scope.internal.getFont(t.fontName,t.fontStyle),s=t.scope.getStringUnitWidth(e,{font:i,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:t.scope.getStringUnitWidth("3",{font:i,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:s}},L7={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},E7=function(e,t){var n={type:"reference",object:e};t.internal.getPageInfo(e.page).pageContext.annotations.find(function(i){return i.type===n.type&&i.object===n.object})===void 0&&t.internal.getPageInfo(e.page).pageContext.annotations.push(n)},j7=function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var i=n,s=e[n];t.internal.newObjectDeferredBegin(s.objId,!0),_n(s)==="object"&&typeof s.putStream=="function"&&s.putStream(),delete e[i]}},T7=function(e,t){if(t.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||e.internal.acroformPlugin.isInitialized===!1)){if(hr.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(L7)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");U0=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new rx,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){(function(n){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0})(e)}),e.internal.events.subscribe("buildDocument",function(){(function(n){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var i=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var s in i)if(i.hasOwnProperty(s)){var o=i[s];o.objId=void 0,o.hasAnnotation&&E7(o,n)}})(e)}),e.internal.events.subscribe("putCatalog",function(){(function(n){if(n.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(e)}),e.internal.events.subscribe("postPutPages",function(n){(function(i,s){var o=!i;for(var l in i||(s.internal.newObjectDeferredBegin(s.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),s.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),i=i||s.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(i.hasOwnProperty(l)){var u=i[l],f=[],d=u.Rect;if(u.Rect&&(u.Rect=N7(u.Rect,s)),s.internal.newObjectDeferredBegin(u.objId,!0),u.DA=pe.createDefaultAppearanceStream(u),_n(u)==="object"&&typeof u.getKeyValueListForStream=="function"&&(f=u.getKeyValueListForStream()),u.Rect=d,u.hasAppearanceStream&&!u.appearanceStreamContent){var m=A7(u);f.push({key:"AP",value:"<</N "+m+">>"}),s.internal.acroformPlugin.xForms.push(m)}if(u.appearanceStreamContent){var g="";for(var x in u.appearanceStreamContent)if(u.appearanceStreamContent.hasOwnProperty(x)){var v=u.appearanceStreamContent[x];if(g+="/"+x+" ",g+="<<",Object.keys(v).length>=1||Array.isArray(v)){for(var l in v)if(v.hasOwnProperty(l)){var A=v[l];typeof A=="function"&&(A=A.call(s,u)),g+="/"+l+" "+A+" ",s.internal.acroformPlugin.xForms.indexOf(A)>=0||s.internal.acroformPlugin.xForms.push(A)}}else typeof(A=v)=="function"&&(A=A.call(s,u)),g+="/"+l+" "+A,s.internal.acroformPlugin.xForms.indexOf(A)>=0||s.internal.acroformPlugin.xForms.push(A);g+=">>"}f.push({key:"AP",value:`<<
`+g+">>"})}s.internal.putStream({additionalKeyValues:f,objectId:u.objId}),s.internal.out("endobj")}o&&j7(s.internal.acroformPlugin.xForms,s)})(n,e)}),e.internal.acroformPlugin.isInitialized=!0}},ax=ri.__acroform__.arrayToPdfArray=function(e,t,n){var i=function(l){return l};if(Array.isArray(e)){for(var s="[",o=0;o<e.length;o++)switch(o!==0&&(s+=" "),_n(e[o])){case"boolean":case"number":case"object":s+=e[o].toString();break;case"string":e[o].substr(0,1)!=="/"?(t!==void 0&&n&&(i=n.internal.getEncryptor(t)),s+="("+Yc(i(e[o].toString()))+")"):s+=e[o].toString()}return s+="]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},Sg=function(e,t,n){var i=function(s){return s};return t!==void 0&&n&&(i=n.internal.getEncryptor(t)),(e=e||"").toString(),e="("+Yc(i(e))+")"},eo=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};eo.prototype.toString=function(){return this.objId+" 0 R"},eo.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},eo.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter(function(o){return o!="content"&&o!="appearanceStreamContent"&&o!="scope"&&o!="objId"&&o.substring(0,1)!="_"});for(var n in t)if(Object.getOwnPropertyDescriptor(this,t[n]).configurable===!1){var i=t[n],s=this[i];s&&(Array.isArray(s)?e.push({key:i,value:ax(s,this.objId,this.scope)}):s instanceof eo?(s.scope=this.scope,e.push({key:i,value:s.objId+" 0 R"})):typeof s!="function"&&e.push({key:i,value:s}))}return e};var sx=function(){eo.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,t=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(n){e=n.trim()},get:function(){return e||null}})};Ga(sx,eo);var rx=function(){eo.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var n=function(i){return i};return this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),"("+Yc(n(e))+")"}},set:function(n){e=n}})};Ga(rx,eo);var hr=function e(){eo.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(j){if(isNaN(j))throw new Error('Invalid value "'+j+'" for attribute F supplied.');t=j}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!pi(t,3)},set:function(j){j?this.F=mi(t,3):this.F=gi(t,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(j){if(isNaN(j))throw new Error('Invalid value "'+j+'" for attribute Ff supplied.');n=j}});var i=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(i.length!==0)return i},set:function(j){i=j!==void 0?j:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!i||isNaN(i[0])?0:i[0]},set:function(j){i[0]=j}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!i||isNaN(i[1])?0:i[1]},set:function(j){i[1]=j}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!i||isNaN(i[2])?0:i[2]},set:function(j){i[2]=j}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!i||isNaN(i[3])?0:i[3]},set:function(j){i[3]=j}});var s="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return s},set:function(j){switch(j){case"/Btn":case"/Tx":case"/Ch":case"/Sig":s=j;break;default:throw new Error('Invalid value "'+j+'" for attribute FT supplied.')}}});var o=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!o||o.length<1){if(this instanceof Lp)return;o="FieldObject"+e.FieldNum++}var j=function(C){return C};return this.scope&&(j=this.scope.internal.getEncryptor(this.objId)),"("+Yc(j(o))+")"},set:function(j){o=j.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return o},set:function(j){o=j}});var l="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return l},set:function(j){l=j}});var u="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return u},set:function(j){u=j}});var f=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return f},set:function(j){f=j}});var d=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return d===void 0?50/U0:d},set:function(j){d=j}});var m="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return m},set:function(j){m=j}});var g="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!g||this instanceof Lp||this instanceof Uc))return Sg(g,this.objId,this.scope)},set:function(j){j=j.toString(),g=j}});var x=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(x)return this instanceof Yi?x:Sg(x,this.objId,this.scope)},set:function(j){j=j.toString(),x=this instanceof Yi?j:j.substr(0,1)==="("?ku(j.substr(1,j.length-2)):ku(j)}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Yi?ku(x.substr(1,x.length-1)):x},set:function(j){j=j.toString(),x=this instanceof Yi?"/"+j:j}});var v=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(v)return v},set:function(j){this.V=j}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(v)return this instanceof Yi?v:Sg(v,this.objId,this.scope)},set:function(j){j=j.toString(),v=this instanceof Yi?j:j.substr(0,1)==="("?ku(j.substr(1,j.length-2)):ku(j)}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Yi?ku(v.substr(1,v.length-1)):v},set:function(j){j=j.toString(),v=this instanceof Yi?"/"+j:j}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var A,N=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return N},set:function(j){j=!!j,N=j}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(A)return A},set:function(j){A=j}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,1)},set:function(j){j?this.Ff=mi(this.Ff,1):this.Ff=gi(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,2)},set:function(j){j?this.Ff=mi(this.Ff,2):this.Ff=gi(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,3)},set:function(j){j?this.Ff=mi(this.Ff,3):this.Ff=gi(this.Ff,3)}});var E=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(E!==null)return E},set:function(j){if([0,1,2].indexOf(j)===-1)throw new Error('Invalid value "'+j+'" for attribute Q supplied.');E=j}}),Object.defineProperty(this,"textAlign",{get:function(){var j;switch(E){case 0:default:j="left";break;case 1:j="center";break;case 2:j="right"}return j},configurable:!0,enumerable:!0,set:function(j){switch(j){case"right":case 2:E=2;break;case"center":case 1:E=1;break;case"left":case 0:default:E=0}}})};Ga(hr,eo);var Iu=function(){hr.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(n){e=n}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(n){e=n}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return ax(t,this.objId,this.scope)},set:function(n){var i,s;s=[],typeof(i=n)=="string"&&(s=function(o,l,u){u||(u=1);for(var f,d=[];f=l.exec(o);)d.push(f[u]);return d}(i,/\((.*?)\)/g)),t=s}}),this.getOptions=function(){return t},this.setOptions=function(n){t=n,this.sort&&t.sort()},this.addOption=function(n){n=(n=n||"").toString(),t.push(n),this.sort&&t.sort()},this.removeOption=function(n,i){for(i=i||!1,n=(n=n||"").toString();t.indexOf(n)!==-1&&(t.splice(t.indexOf(n),1),i!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,18)},set:function(n){n?this.Ff=mi(this.Ff,18):this.Ff=gi(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,19)},set:function(n){this.combo===!0&&(n?this.Ff=mi(this.Ff,19):this.Ff=gi(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,20)},set:function(n){n?(this.Ff=mi(this.Ff,20),t.sort()):this.Ff=gi(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,22)},set:function(n){n?this.Ff=mi(this.Ff,22):this.Ff=gi(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,23)},set:function(n){n?this.Ff=mi(this.Ff,23):this.Ff=gi(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,27)},set:function(n){n?this.Ff=mi(this.Ff,27):this.Ff=gi(this.Ff,27)}}),this.hasAppearanceStream=!1};Ga(Iu,hr);var Hu=function(){Iu.call(this),this.fontName="helvetica",this.combo=!1};Ga(Hu,Iu);var Vu=function(){Hu.call(this),this.combo=!0};Ga(Vu,Hu);var lp=function(){Vu.call(this),this.edit=!0};Ga(lp,Vu);var Yi=function(){hr.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,15)},set:function(n){n?this.Ff=mi(this.Ff,15):this.Ff=gi(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,16)},set:function(n){n?this.Ff=mi(this.Ff,16):this.Ff=gi(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,17)},set:function(n){n?this.Ff=mi(this.Ff,17):this.Ff=gi(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,26)},set:function(n){n?this.Ff=mi(this.Ff,26):this.Ff=gi(this.Ff,26)}});var e,t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var n=function(o){return o};if(this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),Object.keys(t).length!==0){var i,s=[];for(i in s.push("<<"),t)s.push("/"+i+" ("+Yc(n(t[i]))+")");return s.push(">>"),s.join(`
`)}},set:function(n){_n(n)==="object"&&(t=n)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(n){typeof n=="string"&&(t.CA=n)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(n){e=n}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(n){e="/"+n}})};Ga(Yi,hr);var cp=function(){Yi.call(this),this.pushButton=!0};Ga(cp,Yi);var Yu=function(){Yi.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t!==void 0?t:[]}})};Ga(Yu,Yi);var Lp=function(){var e,t;hr.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(s){e=s}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(s){t=s}});var n,i={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var s=function(u){return u};this.scope&&(s=this.scope.internal.getEncryptor(this.objId));var o,l=[];for(o in l.push("<<"),i)l.push("/"+o+" ("+Yc(s(i[o]))+")");return l.push(">>"),l.join(`
`)},set:function(s){_n(s)==="object"&&(i=s)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return i.CA||""},set:function(s){typeof s=="string"&&(i.CA=s)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(s){n=s}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(s){n="/"+s}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=pe.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};Ga(Lp,hr),Yu.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var n=this.Kids[t];n.appearanceStreamContent=e.createAppearanceStream(n.optionName),n.caption=e.getCA()}},Yu.prototype.createOption=function(e){var t=new Lp;return t.Parent=this,t.optionName=e,this.Kids.push(t),C7.call(this.scope,t),t};var up=function(){Yi.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=pe.CheckBox.createAppearanceStream()};Ga(up,Yi);var Uc=function(){hr.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,13)},set:function(t){t?this.Ff=mi(this.Ff,13):this.Ff=gi(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,21)},set:function(t){t?this.Ff=mi(this.Ff,21):this.Ff=gi(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,23)},set:function(t){t?this.Ff=mi(this.Ff,23):this.Ff=gi(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,24)},set:function(t){t?this.Ff=mi(this.Ff,24):this.Ff=gi(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,25)},set:function(t){t?this.Ff=mi(this.Ff,25):this.Ff=gi(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,26)},set:function(t){t?this.Ff=mi(this.Ff,26):this.Ff=gi(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};Ga(Uc,hr);var fp=function(){Uc.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!pi(this.Ff,14)},set:function(e){e?this.Ff=mi(this.Ff,14):this.Ff=gi(this.Ff,14)}}),this.password=!0};Ga(fp,Uc);var pe={CheckBox:{createAppearanceStream:function(){return{N:{On:pe.CheckBox.YesNormal},D:{On:pe.CheckBox.YesPushDown,Off:pe.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=Zr(e);t.scope=e.scope;var n=[],i=e.scope.internal.getFont(e.fontName,e.fontStyle).id,s=e.scope.__private__.encodeColorString(e.color),o=Jg(e,e.caption);return n.push("0.749023 g"),n.push("0 0 "+ke(pe.internal.getWidth(e))+" "+ke(pe.internal.getHeight(e))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+i+" "+ke(o.fontSize)+" Tf "+s),n.push("BT"),n.push(o.text),n.push("ET"),n.push("Q"),n.push("EMC"),t.stream=n.join(`
`),t},YesNormal:function(e){var t=Zr(e);t.scope=e.scope;var n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,i=e.scope.__private__.encodeColorString(e.color),s=[],o=pe.internal.getHeight(e),l=pe.internal.getWidth(e),u=Jg(e,e.caption);return s.push("1 g"),s.push("0 0 "+ke(l)+" "+ke(o)+" re"),s.push("f"),s.push("q"),s.push("0 0 1 rg"),s.push("0 0 "+ke(l-1)+" "+ke(o-1)+" re"),s.push("W"),s.push("n"),s.push("0 g"),s.push("BT"),s.push("/"+n+" "+ke(u.fontSize)+" Tf "+i),s.push(u.text),s.push("ET"),s.push("Q"),t.stream=s.join(`
`),t},OffPushDown:function(e){var t=Zr(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+ke(pe.internal.getWidth(e))+" "+ke(pe.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join(`
`),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:pe.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=pe.RadioButton.Circle.YesNormal,t.D[e]=pe.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=Zr(e);t.scope=e.scope;var n=[],i=pe.internal.getWidth(e)<=pe.internal.getHeight(e)?pe.internal.getWidth(e)/4:pe.internal.getHeight(e)/4;i=Number((.9*i).toFixed(5));var s=pe.internal.Bezier_C,o=Number((i*s).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+Bl(pe.internal.getWidth(e)/2)+" "+Bl(pe.internal.getHeight(e)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
`),t},YesPushDown:function(e){var t=Zr(e);t.scope=e.scope;var n=[],i=pe.internal.getWidth(e)<=pe.internal.getHeight(e)?pe.internal.getWidth(e)/4:pe.internal.getHeight(e)/4;i=Number((.9*i).toFixed(5));var s=Number((2*i).toFixed(5)),o=Number((s*pe.internal.Bezier_C).toFixed(5)),l=Number((i*pe.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+Bl(pe.internal.getWidth(e)/2)+" "+Bl(pe.internal.getHeight(e)/2)+" cm"),n.push(s+" 0 m"),n.push(s+" "+o+" "+o+" "+s+" 0 "+s+" c"),n.push("-"+o+" "+s+" -"+s+" "+o+" -"+s+" 0 c"),n.push("-"+s+" -"+o+" -"+o+" -"+s+" 0 -"+s+" c"),n.push(o+" -"+s+" "+s+" -"+o+" "+s+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+Bl(pe.internal.getWidth(e)/2)+" "+Bl(pe.internal.getHeight(e)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+l+" "+l+" "+i+" 0 "+i+" c"),n.push("-"+l+" "+i+" -"+i+" "+l+" -"+i+" 0 c"),n.push("-"+i+" -"+l+" -"+l+" -"+i+" 0 -"+i+" c"),n.push(l+" -"+i+" "+i+" -"+l+" "+i+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
`),t},OffPushDown:function(e){var t=Zr(e);t.scope=e.scope;var n=[],i=pe.internal.getWidth(e)<=pe.internal.getHeight(e)?pe.internal.getWidth(e)/4:pe.internal.getHeight(e)/4;i=Number((.9*i).toFixed(5));var s=Number((2*i).toFixed(5)),o=Number((s*pe.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+Bl(pe.internal.getWidth(e)/2)+" "+Bl(pe.internal.getHeight(e)/2)+" cm"),n.push(s+" 0 m"),n.push(s+" "+o+" "+o+" "+s+" 0 "+s+" c"),n.push("-"+o+" "+s+" -"+s+" "+o+" -"+s+" 0 c"),n.push("-"+s+" -"+o+" -"+o+" -"+s+" 0 -"+s+" c"),n.push(o+" -"+s+" "+s+" -"+o+" "+s+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
`),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:pe.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=pe.RadioButton.Cross.YesNormal,t.D[e]=pe.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=Zr(e);t.scope=e.scope;var n=[],i=pe.internal.calculateCross(e);return n.push("q"),n.push("1 1 "+ke(pe.internal.getWidth(e)-2)+" "+ke(pe.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(ke(i.x1.x)+" "+ke(i.x1.y)+" m"),n.push(ke(i.x2.x)+" "+ke(i.x2.y)+" l"),n.push(ke(i.x4.x)+" "+ke(i.x4.y)+" m"),n.push(ke(i.x3.x)+" "+ke(i.x3.y)+" l"),n.push("s"),n.push("Q"),t.stream=n.join(`
`),t},YesPushDown:function(e){var t=Zr(e);t.scope=e.scope;var n=pe.internal.calculateCross(e),i=[];return i.push("0.749023 g"),i.push("0 0 "+ke(pe.internal.getWidth(e))+" "+ke(pe.internal.getHeight(e))+" re"),i.push("f"),i.push("q"),i.push("1 1 "+ke(pe.internal.getWidth(e)-2)+" "+ke(pe.internal.getHeight(e)-2)+" re"),i.push("W"),i.push("n"),i.push(ke(n.x1.x)+" "+ke(n.x1.y)+" m"),i.push(ke(n.x2.x)+" "+ke(n.x2.y)+" l"),i.push(ke(n.x4.x)+" "+ke(n.x4.y)+" m"),i.push(ke(n.x3.x)+" "+ke(n.x3.y)+" l"),i.push("s"),i.push("Q"),t.stream=i.join(`
`),t},OffPushDown:function(e){var t=Zr(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+ke(pe.internal.getWidth(e))+" "+ke(pe.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join(`
`),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+n}};pe.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=pe.internal.getWidth(e),n=pe.internal.getHeight(e),i=Math.min(t,n);return{x1:{x:(t-i)/2,y:(n-i)/2+i},x2:{x:(t-i)/2+i,y:(n-i)/2},x3:{x:(t-i)/2,y:(n-i)/2},x4:{x:(t-i)/2+i,y:(n-i)/2+i}}}},pe.internal.getWidth=function(e){var t=0;return _n(e)==="object"&&(t=Xb(e.Rect[2])),t},pe.internal.getHeight=function(e){var t=0;return _n(e)==="object"&&(t=Xb(e.Rect[3])),t};var C7=ri.addField=function(e){if(T7(this,e),!(e instanceof hr))throw new Error("Invalid argument passed to jsPDF.addField.");var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};ri.AcroFormChoiceField=Iu,ri.AcroFormListBox=Hu,ri.AcroFormComboBox=Vu,ri.AcroFormEditBox=lp,ri.AcroFormButton=Yi,ri.AcroFormPushButton=cp,ri.AcroFormRadioButton=Yu,ri.AcroFormCheckBox=up,ri.AcroFormTextField=Uc,ri.AcroFormPasswordField=fp,ri.AcroFormAppearance=pe,ri.AcroForm={ChoiceField:Iu,ListBox:Hu,ComboBox:Vu,EditBox:lp,Button:Yi,PushButton:cp,RadioButton:Yu,CheckBox:up,TextField:Uc,PasswordField:fp,Appearance:pe},Ae.AcroForm={ChoiceField:Iu,ListBox:Hu,ComboBox:Vu,EditBox:lp,Button:Yi,PushButton:cp,RadioButton:Yu,CheckBox:up,TextField:Uc,PasswordField:fp,Appearance:pe};Ae.AcroForm;function ox(e){return e.reduce(function(t,n,i){return t[n]=i,t},{})}(function(e){e.__addimage__={};var t="UNKNOWN",n={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},i=e.__addimage__.getImageFileTypeByImageData=function(D,R){var et,nt,dt,W,lt,ut=t;if((R=R||t)==="RGBA"||D.data!==void 0&&D.data instanceof Uint8ClampedArray&&"height"in D&&"width"in D)return"RGBA";if(st(D))for(lt in n)for(dt=n[lt],et=0;et<dt.length;et+=1){for(W=!0,nt=0;nt<dt[et].length;nt+=1)if(dt[et][nt]!==void 0&&dt[et][nt]!==D[nt]){W=!1;break}if(W===!0){ut=lt;break}}else for(lt in n)for(dt=n[lt],et=0;et<dt.length;et+=1){for(W=!0,nt=0;nt<dt[et].length;nt+=1)if(dt[et][nt]!==void 0&&dt[et][nt]!==D.charCodeAt(nt)){W=!1;break}if(W===!0){ut=lt;break}}return ut===t&&R!==t&&(ut=R),ut},s=function D(R){for(var et=this.internal.write,nt=this.internal.putStream,dt=(0,this.internal.getFilters)();dt.indexOf("FlateEncode")!==-1;)dt.splice(dt.indexOf("FlateEncode"),1);R.objectId=this.internal.newObject();var W=[];if(W.push({key:"Type",value:"/XObject"}),W.push({key:"Subtype",value:"/Image"}),W.push({key:"Width",value:R.width}),W.push({key:"Height",value:R.height}),R.colorSpace===E.INDEXED?W.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(R.palette.length/3-1)+" "+("sMask"in R&&R.sMask!==void 0?R.objectId+2:R.objectId+1)+" 0 R]"}):(W.push({key:"ColorSpace",value:"/"+R.colorSpace}),R.colorSpace===E.DEVICE_CMYK&&W.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),W.push({key:"BitsPerComponent",value:R.bitsPerComponent}),"decodeParameters"in R&&R.decodeParameters!==void 0&&W.push({key:"DecodeParms",value:"<<"+R.decodeParameters+">>"}),"transparency"in R&&Array.isArray(R.transparency)){for(var lt="",ut=0,wt=R.transparency.length;ut<wt;ut++)lt+=R.transparency[ut]+" "+R.transparency[ut]+" ";W.push({key:"Mask",value:"["+lt+"]"})}R.sMask!==void 0&&W.push({key:"SMask",value:R.objectId+1+" 0 R"});var Y=R.filter!==void 0?["/"+R.filter]:void 0;if(nt({data:R.data,additionalKeyValues:W,alreadyAppliedFilters:Y,objectId:R.objectId}),et("endobj"),"sMask"in R&&R.sMask!==void 0){var gt="/Predictor "+R.predictor+" /Colors 1 /BitsPerComponent "+R.bitsPerComponent+" /Columns "+R.width,O={width:R.width,height:R.height,colorSpace:"DeviceGray",bitsPerComponent:R.bitsPerComponent,decodeParameters:gt,data:R.sMask};"filter"in R&&(O.filter=R.filter),D.call(this,O)}if(R.colorSpace===E.INDEXED){var q=this.internal.newObject();nt({data:H(new Uint8Array(R.palette)),objectId:q}),et("endobj")}},o=function(){var D=this.internal.collections.addImage_images;for(var R in D)s.call(this,D[R])},l=function(){var D,R=this.internal.collections.addImage_images,et=this.internal.write;for(var nt in R)et("/I"+(D=R[nt]).index,D.objectId,"0","R")},u=function(){this.internal.collections.addImage_images||(this.internal.collections.addImage_images={},this.internal.events.subscribe("putResources",o),this.internal.events.subscribe("putXobjectDict",l))},f=function(){var D=this.internal.collections.addImage_images;return u.call(this),D},d=function(){return Object.keys(this.internal.collections.addImage_images).length},m=function(D){return typeof e["process"+D.toUpperCase()]=="function"},g=function(D){return _n(D)==="object"&&D.nodeType===1},x=function(D,R){if(D.nodeName==="IMG"&&D.hasAttribute("src")){var et=""+D.getAttribute("src");if(et.indexOf("data:image/")===0)return yh(unescape(et).split("base64,").pop());var nt=e.loadFile(et,!0);if(nt!==void 0)return nt}if(D.nodeName==="CANVAS"){if(D.width===0||D.height===0)throw new Error("Given canvas must have data. Canvas width: "+D.width+", height: "+D.height);var dt;switch(R){case"PNG":dt="image/png";break;case"WEBP":dt="image/webp";break;case"JPEG":case"JPG":default:dt="image/jpeg"}return yh(D.toDataURL(dt,1).split("base64,").pop())}},v=function(D){var R=this.internal.collections.addImage_images;if(R){for(var et in R)if(D===R[et].alias)return R[et]}},A=function(D,R,et){return D||R||(D=-96,R=-96),D<0&&(D=-1*et.width*72/D/this.internal.scaleFactor),R<0&&(R=-1*et.height*72/R/this.internal.scaleFactor),D===0&&(D=R*et.width/et.height),R===0&&(R=D*et.height/et.width),[D,R]},N=function(D,R,et,nt,dt,W){var lt=A.call(this,et,nt,dt),ut=this.internal.getCoordinateString,wt=this.internal.getVerticalCoordinateString,Y=f.call(this);if(et=lt[0],nt=lt[1],Y[dt.index]=dt,W){W*=Math.PI/180;var gt=Math.cos(W),O=Math.sin(W),q=function(rt){return rt.toFixed(4)},$=[q(gt),q(O),q(-1*O),q(gt),0,0,"cm"]}this.internal.write("q"),W?(this.internal.write([1,"0","0",1,ut(D),wt(R+nt),"cm"].join(" ")),this.internal.write($.join(" ")),this.internal.write([ut(et),"0","0",ut(nt),"0","0","cm"].join(" "))):this.internal.write([ut(et),"0","0",ut(nt),ut(D),wt(R+nt),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+dt.index+" Do"),this.internal.write("Q")},E=e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var j=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},C=e.__addimage__.sHashCode=function(D){var R,et,nt=0;if(typeof D=="string")for(et=D.length,R=0;R<et;R++)nt=(nt<<5)-nt+D.charCodeAt(R),nt|=0;else if(st(D))for(et=D.byteLength/2,R=0;R<et;R++)nt=(nt<<5)-nt+D[R],nt|=0;return nt},z=e.__addimage__.validateStringAsBase64=function(D){(D=D||"").toString().trim();var R=!0;return D.length===0&&(R=!1),D.length%4!=0&&(R=!1),/^[A-Za-z0-9+/]+$/.test(D.substr(0,D.length-2))===!1&&(R=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(D.substr(-2))===!1&&(R=!1),R},Z=e.__addimage__.extractImageFromDataUrl=function(D){if(D==null||!(D=D.trim()).startsWith("data:"))return null;var R=D.indexOf(",");return R<0?null:D.substring(0,R).trim().endsWith("base64")?D.substring(R+1):null},I=e.__addimage__.supportsArrayBuffer=function(){return typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"};e.__addimage__.isArrayBuffer=function(D){return I()&&D instanceof ArrayBuffer};var st=e.__addimage__.isArrayBufferView=function(D){return I()&&typeof Uint32Array<"u"&&(D instanceof Int8Array||D instanceof Uint8Array||typeof Uint8ClampedArray<"u"&&D instanceof Uint8ClampedArray||D instanceof Int16Array||D instanceof Uint16Array||D instanceof Int32Array||D instanceof Uint32Array||D instanceof Float32Array||D instanceof Float64Array)},K=e.__addimage__.binaryStringToUint8Array=function(D){for(var R=D.length,et=new Uint8Array(R),nt=0;nt<R;nt++)et[nt]=D.charCodeAt(nt);return et},H=e.__addimage__.arrayBufferToBinaryString=function(D){for(var R="",et=st(D)?D:new Uint8Array(D),nt=0;nt<et.length;nt+=8192)R+=String.fromCharCode.apply(null,et.subarray(nt,nt+8192));return R};e.addImage=function(){var D,R,et,nt,dt,W,lt,ut,wt;if(typeof arguments[1]=="number"?(R=t,et=arguments[1],nt=arguments[2],dt=arguments[3],W=arguments[4],lt=arguments[5],ut=arguments[6],wt=arguments[7]):(R=arguments[1],et=arguments[2],nt=arguments[3],dt=arguments[4],W=arguments[5],lt=arguments[6],ut=arguments[7],wt=arguments[8]),_n(D=arguments[0])==="object"&&!g(D)&&"imageData"in D){var Y=D;D=Y.imageData,R=Y.format||R||t,et=Y.x||et||0,nt=Y.y||nt||0,dt=Y.w||Y.width||dt,W=Y.h||Y.height||W,lt=Y.alias||lt,ut=Y.compression||ut,wt=Y.rotation||Y.angle||wt}var gt=this.internal.getFilters();if(ut===void 0&>.indexOf("FlateEncode")!==-1&&(ut="SLOW"),isNaN(et)||isNaN(nt))throw new Error("Invalid coordinates passed to jsPDF.addImage");u.call(this);var O=G.call(this,D,R,lt,ut);return N.call(this,et,nt,dt,W,O,wt),this};var G=function(D,R,et,nt){var dt,W,lt;if(typeof D=="string"&&i(D)===t){D=unescape(D);var ut=Q(D,!1);(ut!==""||(ut=e.loadFile(D,!0))!==void 0)&&(D=ut)}if(g(D)&&(D=x(D,R)),R=i(D,R),!m(R))throw new Error("addImage does not support files of type '"+R+"', please ensure that a plugin for '"+R+"' support is added.");if(((lt=et)==null||lt.length===0)&&(et=function(wt){return typeof wt=="string"||st(wt)?C(wt):st(wt.data)?C(wt.data):null}(D)),(dt=v.call(this,et))||(I()&&(D instanceof Uint8Array||R==="RGBA"||(W=D,D=K(D))),dt=this["process"+R.toUpperCase()](D,d.call(this),et,function(wt){return wt&&typeof wt=="string"&&(wt=wt.toUpperCase()),wt in e.image_compression?wt:j.NONE}(nt),W)),!dt)throw new Error("An unknown error occurred whilst processing the image.");return dt},Q=e.__addimage__.convertBase64ToBinaryString=function(D,R){R=typeof R!="boolean"||R;var et,nt="";if(typeof D=="string"){var dt;et=(dt=Z(D))!==null&&dt!==void 0?dt:D;try{nt=yh(et)}catch(W){if(R)throw z(et)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+W.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return nt};e.getImageProperties=function(D){var R,et,nt="";if(g(D)&&(D=x(D)),typeof D=="string"&&i(D)===t&&((nt=Q(D,!1))===""&&(nt=e.loadFile(D)||""),D=nt),et=i(D),!m(et))throw new Error("addImage does not support files of type '"+et+"', please ensure that a plugin for '"+et+"' support is added.");if(!I()||D instanceof Uint8Array||(D=K(D)),!(R=this["process"+et.toUpperCase()](D)))throw new Error("An unknown error occurred whilst processing the image");return R.fileType=et,R}})(Ae.API),function(e){var t=function(n){if(n!==void 0&&n!="")return!0};Ae.API.events.push(["addPage",function(n){this.internal.getPageInfo(n.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(n){for(var i,s,o,l=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString,f=this.internal.getPageInfoByObjId(n.objId),d=n.pageContext.annotations,m=!1,g=0;g<d.length&&!m;g++)switch((i=d[g]).type){case"link":(t(i.options.url)||t(i.options.pageNumber))&&(m=!0);break;case"reference":case"text":case"freetext":m=!0}if(m!=0){this.internal.write("/Annots [");for(var x=0;x<d.length;x++){i=d[x];var v=this.internal.pdfEscape,A=this.internal.getEncryptor(n.objId);switch(i.type){case"reference":this.internal.write(" "+i.object.objId+" 0 R ");break;case"text":var N=this.internal.newAdditionalObject(),E=this.internal.newAdditionalObject(),j=this.internal.getEncryptor(N.objId),C=i.title||"Note";o="<</Type /Annot /Subtype /Text "+(s="/Rect ["+l(i.bounds.x)+" "+u(i.bounds.y+i.bounds.h)+" "+l(i.bounds.x+i.bounds.w)+" "+u(i.bounds.y)+"] ")+"/Contents ("+v(j(i.contents))+")",o+=" /Popup "+E.objId+" 0 R",o+=" /P "+f.objId+" 0 R",o+=" /T ("+v(j(C))+") >>",N.content=o;var z=N.objId+" 0 R";o="<</Type /Annot /Subtype /Popup "+(s="/Rect ["+l(i.bounds.x+30)+" "+u(i.bounds.y+i.bounds.h)+" "+l(i.bounds.x+i.bounds.w+30)+" "+u(i.bounds.y)+"] ")+" /Parent "+z,i.open&&(o+=" /Open true"),o+=" >>",E.content=o,this.internal.write(N.objId,"0 R",E.objId,"0 R");break;case"freetext":s="/Rect ["+l(i.bounds.x)+" "+u(i.bounds.y)+" "+l(i.bounds.x+i.bounds.w)+" "+u(i.bounds.y+i.bounds.h)+"] ";var Z=i.color||"#000000";o="<</Type /Annot /Subtype /FreeText "+s+"/Contents ("+v(A(i.contents))+")",o+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+Z+")",o+=" /Border [0 0 0]",o+=" >>",this.internal.write(o);break;case"link":if(i.options.name){var I=this.annotations._nameMap[i.options.name];i.options.pageNumber=I.page,i.options.top=I.y}else i.options.top||(i.options.top=0);if(s="/Rect ["+i.finalBounds.x+" "+i.finalBounds.y+" "+i.finalBounds.w+" "+i.finalBounds.h+"] ",o="",i.options.url)o="<</Type /Annot /Subtype /Link "+s+"/Border [0 0 0] /A <</S /URI /URI ("+v(A(i.options.url))+") >>";else if(i.options.pageNumber)switch(o="<</Type /Annot /Subtype /Link "+s+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(i.options.pageNumber).objId+" 0 R",i.options.magFactor=i.options.magFactor||"XYZ",i.options.magFactor){case"Fit":o+=" /Fit]";break;case"FitH":o+=" /FitH "+i.options.top+"]";break;case"FitV":i.options.left=i.options.left||0,o+=" /FitV "+i.options.left+"]";break;case"XYZ":default:var st=u(i.options.top);i.options.left=i.options.left||0,i.options.zoom===void 0&&(i.options.zoom=0),o+=" /XYZ "+i.options.left+" "+st+" "+i.options.zoom+"]"}o!=""&&(o+=" >>",this.internal.write(o))}}this.internal.write("]")}}]),e.createAnnotation=function(n){var i=this.internal.getCurrentPageInfo();switch(n.type){case"link":this.link(n.bounds.x,n.bounds.y,n.bounds.w,n.bounds.h,n);break;case"text":case"freetext":i.pageContext.annotations.push(n)}},e.link=function(n,i,s,o,l){var u=this.internal.getCurrentPageInfo(),f=this.internal.getCoordinateString,d=this.internal.getVerticalCoordinateString;u.pageContext.annotations.push({finalBounds:{x:f(n),y:d(i),w:f(n+s),h:d(i+o)},options:l,type:"link"})},e.textWithLink=function(n,i,s,o){var l,u,f=this.getTextWidth(n),d=this.internal.getLineHeight()/this.internal.scaleFactor;if(o.maxWidth!==void 0){u=o.maxWidth;var m=this.splitTextToSize(n,u).length;l=Math.ceil(d*m)}else u=f,l=d;return this.text(n,i,s,o),s+=.2*d,o.align==="center"&&(i-=f/2),o.align==="right"&&(i-=f),this.link(i,s-d,u,l,o),f},e.getTextWidth=function(n){var i=this.internal.getFontSize();return this.getStringUnitWidth(n)*i/this.internal.scaleFactor}}(Ae.API),function(e){var t={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},n={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},i={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},s=[1570,1571,1573,1575];e.__arabicParser__={};var o=e.__arabicParser__.isInArabicSubstitutionA=function(N){return t[N.charCodeAt(0)]!==void 0},l=e.__arabicParser__.isArabicLetter=function(N){return typeof N=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(N)},u=e.__arabicParser__.isArabicEndLetter=function(N){return l(N)&&o(N)&&t[N.charCodeAt(0)].length<=2},f=e.__arabicParser__.isArabicAlfLetter=function(N){return l(N)&&s.indexOf(N.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(N){return l(N)&&o(N)&&t[N.charCodeAt(0)].length>=1};var d=e.__arabicParser__.arabicLetterHasFinalForm=function(N){return l(N)&&o(N)&&t[N.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(N){return l(N)&&o(N)&&t[N.charCodeAt(0)].length>=3};var m=e.__arabicParser__.arabicLetterHasMedialForm=function(N){return l(N)&&o(N)&&t[N.charCodeAt(0)].length==4},g=e.__arabicParser__.resolveLigatures=function(N){var E=0,j=n,C="",z=0;for(E=0;E<N.length;E+=1)j[N.charCodeAt(E)]!==void 0?(z++,typeof(j=j[N.charCodeAt(E)])=="number"&&(C+=String.fromCharCode(j),j=n,z=0),E===N.length-1&&(j=n,C+=N.charAt(E-(z-1)),E-=z-1,z=0)):(j=n,C+=N.charAt(E-z),E-=z,z=0);return C};e.__arabicParser__.isArabicDiacritic=function(N){return N!==void 0&&i[N.charCodeAt(0)]!==void 0};var x=e.__arabicParser__.getCorrectForm=function(N,E,j){return l(N)?o(N)===!1?-1:!d(N)||!l(E)&&!l(j)||!l(j)&&u(E)||u(N)&&!l(E)||u(N)&&f(E)||u(N)&&u(E)?0:m(N)&&l(E)&&!u(E)&&l(j)&&d(j)?3:u(N)||!l(j)?1:2:-1},v=function(N){var E=0,j=0,C=0,z="",Z="",I="",st=(N=N||"").split("\\s+"),K=[];for(E=0;E<st.length;E+=1){for(K.push(""),j=0;j<st[E].length;j+=1)z=st[E][j],Z=st[E][j-1],I=st[E][j+1],l(z)?(C=x(z,Z,I),K[E]+=C!==-1?String.fromCharCode(t[z.charCodeAt(0)][C]):z):K[E]+=z;K[E]=g(K[E])}return K.join(" ")},A=e.__arabicParser__.processArabic=e.processArabic=function(){var N,E=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,j=[];if(Array.isArray(E)){var C=0;for(j=[],C=0;C<E.length;C+=1)Array.isArray(E[C])?j.push([v(E[C][0]),E[C][1],E[C][2]]):j.push([v(E[C])]);N=j}else N=v(E);return typeof arguments[0]=="string"?N:(arguments[0].text=N,arguments[0])};e.events.push(["preProcessText",A])}(Ae.API),Ae.API.autoPrint=function(e){var t;switch((e=e||{}).variant=e.variant||"non-conform",e.variant){case"javascript":this.addJS("print({});");break;case"non-conform":default:this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+t+" 0 R")})}return this},function(e){var t=function(){var n=void 0;Object.defineProperty(this,"pdf",{get:function(){return n},set:function(u){n=u}});var i=150;Object.defineProperty(this,"width",{get:function(){return i},set:function(u){i=isNaN(u)||Number.isInteger(u)===!1||u<0?150:u,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=i+1)}});var s=300;Object.defineProperty(this,"height",{get:function(){return s},set:function(u){s=isNaN(u)||Number.isInteger(u)===!1||u<0?300:u,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=s+1)}});var o=[];Object.defineProperty(this,"childNodes",{get:function(){return o},set:function(u){o=u}});var l={};Object.defineProperty(this,"style",{get:function(){return l},set:function(u){l=u}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(n,i){var s;if((n=n||"2d")!=="2d")return null;for(s in i)this.pdf.context2d.hasOwnProperty(s)&&(this.pdf.context2d[s]=i[s]);return this.pdf.context2d._canvas=this,this.pdf.context2d},t.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new t,this.canvas.pdf=this}])}(Ae.API),function(e){var t={left:0,top:0,bottom:0,right:0},n=!1,i=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},t),this.internal.__cell__.margins.width=this.getPageWidth(),s.call(this))},s=function(){this.internal.__cell__.lastCell=new o,this.internal.__cell__.pages=1},o=function(){var f=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return f},set:function(N){f=N}});var d=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return d},set:function(N){d=N}});var m=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return m},set:function(N){m=N}});var g=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return g},set:function(N){g=N}});var x=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return x},set:function(N){x=N}});var v=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return v},set:function(N){v=N}});var A=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return A},set:function(N){A=N}}),this};o.prototype.clone=function(){return new o(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},o.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(f){return i.call(this),this.internal.__cell__.headerFunction=typeof f=="function"?f:void 0,this},e.getTextDimensions=function(f,d){i.call(this);var m=(d=d||{}).fontSize||this.getFontSize(),g=d.font||this.getFont(),x=d.scaleFactor||this.internal.scaleFactor,v=0,A=0,N=0,E=this;if(!Array.isArray(f)&&typeof f!="string"){if(typeof f!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");f=String(f)}var j=d.maxWidth;j>0?typeof f=="string"?f=this.splitTextToSize(f,j):Object.prototype.toString.call(f)==="[object Array]"&&(f=f.reduce(function(z,Z){return z.concat(E.splitTextToSize(Z,j))},[])):f=Array.isArray(f)?f:[f];for(var C=0;C<f.length;C++)v<(N=this.getStringUnitWidth(f[C],{font:g})*m)&&(v=N);return v!==0&&(A=f.length),{w:v/=x,h:Math.max((A*m*this.getLineHeightFactor()-m*(this.getLineHeightFactor()-1))/x,0)}},e.cellAddPage=function(){i.call(this),this.addPage();var f=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new o(f.left,f.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var l=e.cell=function(){var f;f=arguments[0]instanceof o?arguments[0]:new o(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),i.call(this);var d=this.internal.__cell__.lastCell,m=this.internal.__cell__.padding,g=this.internal.__cell__.margins||t,x=this.internal.__cell__.tableHeaderRow,v=this.internal.__cell__.printHeaders;return d.lineNumber!==void 0&&(d.lineNumber===f.lineNumber?(f.x=(d.x||0)+(d.width||0),f.y=d.y||0):d.y+d.height+f.height+g.bottom>this.getPageHeight()?(this.cellAddPage(),f.y=g.top,v&&x&&(this.printHeaderRow(f.lineNumber,!0),f.y+=x[0].height)):f.y=d.y+d.height||f.y),f.text[0]!==void 0&&(this.rect(f.x,f.y,f.width,f.height,n===!0?"FD":void 0),f.align==="right"?this.text(f.text,f.x+f.width-m,f.y+m,{align:"right",baseline:"top"}):f.align==="center"?this.text(f.text,f.x+f.width/2,f.y+m,{align:"center",baseline:"top",maxWidth:f.width-m-m}):this.text(f.text,f.x+m,f.y+m,{align:"left",baseline:"top",maxWidth:f.width-m-m})),this.internal.__cell__.lastCell=f,this};e.table=function(f,d,m,g,x){if(i.call(this),!m)throw new Error("No data for PDF table.");var v,A,N,E,j=[],C=[],z=[],Z={},I={},st=[],K=[],H=(x=x||{}).autoSize||!1,G=x.printHeaders!==!1,Q=x.css&&x.css["font-size"]!==void 0?16*x.css["font-size"]:x.fontSize||12,D=x.margins||Object.assign({width:this.getPageWidth()},t),R=typeof x.padding=="number"?x.padding:3,et=x.headerBackgroundColor||"#c8c8c8",nt=x.headerTextColor||"#000";if(s.call(this),this.internal.__cell__.printHeaders=G,this.internal.__cell__.margins=D,this.internal.__cell__.table_font_size=Q,this.internal.__cell__.padding=R,this.internal.__cell__.headerBackgroundColor=et,this.internal.__cell__.headerTextColor=nt,this.setFontSize(Q),g==null)C=j=Object.keys(m[0]),z=j.map(function(){return"left"});else if(Array.isArray(g)&&_n(g[0])==="object")for(j=g.map(function(Y){return Y.name}),C=g.map(function(Y){return Y.prompt||Y.name||""}),z=g.map(function(Y){return Y.align||"left"}),v=0;v<g.length;v+=1)I[g[v].name]=g[v].width*(19.049976/25.4);else Array.isArray(g)&&typeof g[0]=="string"&&(C=j=g,z=j.map(function(){return"left"}));if(H||Array.isArray(g)&&typeof g[0]=="string")for(v=0;v<j.length;v+=1){for(Z[E=j[v]]=m.map(function(Y){return Y[E]}),this.setFont(void 0,"bold"),st.push(this.getTextDimensions(C[v],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),A=Z[E],this.setFont(void 0,"normal"),N=0;N<A.length;N+=1)st.push(this.getTextDimensions(A[N],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);I[E]=Math.max.apply(null,st)+R+R,st=[]}if(G){var dt={};for(v=0;v<j.length;v+=1)dt[j[v]]={},dt[j[v]].text=C[v],dt[j[v]].align=z[v];var W=u.call(this,dt,I);K=j.map(function(Y){return new o(f,d,I[Y],W,dt[Y].text,void 0,dt[Y].align)}),this.setTableHeaderRow(K),this.printHeaderRow(1,!1)}var lt=g.reduce(function(Y,gt){return Y[gt.name]=gt.align,Y},{});for(v=0;v<m.length;v+=1){"rowStart"in x&&x.rowStart instanceof Function&&x.rowStart({row:v,data:m[v]},this);var ut=u.call(this,m[v],I);for(N=0;N<j.length;N+=1){var wt=m[v][j[N]];"cellStart"in x&&x.cellStart instanceof Function&&x.cellStart({row:v,col:N,data:wt},this),l.call(this,new o(f,d,I[j[N]],ut,wt,v+2,lt[j[N]]))}}return this.internal.__cell__.table_x=f,this.internal.__cell__.table_y=d,this};var u=function(f,d){var m=this.internal.__cell__.padding,g=this.internal.__cell__.table_font_size,x=this.internal.scaleFactor;return Object.keys(f).map(function(v){var A=f[v];return this.splitTextToSize(A.hasOwnProperty("text")?A.text:A,d[v]-m-m)},this).map(function(v){return this.getLineHeightFactor()*v.length*g/x+m+m},this).reduce(function(v,A){return Math.max(v,A)},0)};e.setTableHeaderRow=function(f){i.call(this),this.internal.__cell__.tableHeaderRow=f},e.printHeaderRow=function(f,d){if(i.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var m;if(n=!0,typeof this.internal.__cell__.headerFunction=="function"){var g=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new o(g[0],g[1],g[2],g[3],void 0,-1)}this.setFont(void 0,"bold");for(var x=[],v=0;v<this.internal.__cell__.tableHeaderRow.length;v+=1){m=this.internal.__cell__.tableHeaderRow[v].clone(),d&&(m.y=this.internal.__cell__.margins.top||0,x.push(m)),m.lineNumber=f;var A=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),l.call(this,m),this.setTextColor(A)}x.length>0&&this.setTableHeaderRow(x),this.setFont(void 0,"normal"),n=!1}}(Ae.API);var lx={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},cx=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],t0=ox(cx),ux=[100,200,300,400,500,600,700,800,900],O7=ox(ux);function e0(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),n=function(o){return lx[o=o||"normal"]?o:"normal"}(e.style),i=function(o){if(!o)return 400;if(typeof o=="number")return o>=100&&o<=900&&o%100==0?o:400;if(/^\d00$/.test(o))return parseInt(o);switch(o){case"bold":return 700;case"normal":default:return 400}}(e.weight),s=function(o){return typeof t0[o=o||"normal"]=="number"?o:"normal"}(e.stretch);return{family:t,style:n,weight:i,stretch:s,src:e.src||[],ref:e.ref||{name:t,style:[s,n,i].join(" ")}}}function Kb(e,t,n,i){var s;for(s=n;s>=0&&s<t.length;s+=i)if(e[t[s]])return e[t[s]];for(s=n;s>=0&&s<t.length;s-=i)if(e[t[s]])return e[t[s]]}var M7={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},$b={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Zb(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function D7(e,t,n){for(var i=(n=n||{}).defaultFontFamily||"times",s=Object.assign({},M7,n.genericFontFamilies||{}),o=null,l=null,u=0;u<t.length;++u)if(s[(o=e0(t[u])).family]&&(o.family=s[o.family]),e.hasOwnProperty(o.family)){l=e[o.family];break}if(!(l=l||e[i]))throw new Error("Could not find a font-family for the rule '"+Zb(o)+"' and default family '"+i+"'.");if(l=function(f,d){if(d[f])return d[f];var m=t0[f],g=m<=t0.normal?-1:1,x=Kb(d,cx,m,g);if(!x)throw new Error("Could not find a matching font-stretch value for "+f);return x}(o.stretch,l),l=function(f,d){if(d[f])return d[f];for(var m=lx[f],g=0;g<m.length;++g)if(d[m[g]])return d[m[g]];throw new Error("Could not find a matching font-style for "+f)}(o.style,l),!(l=function(f,d){if(d[f])return d[f];if(f===400&&d[500])return d[500];if(f===500&&d[400])return d[400];var m=O7[f],g=Kb(d,ux,m,f<400?-1:1);if(!g)throw new Error("Could not find a matching font-weight for value "+f);return g}(o.weight,l)))throw new Error("Failed to resolve a font for the rule '"+Zb(o)+"'.");return l}function Qb(e){return e.trimLeft()}function R7(e,t){for(var n=0;n<e.length;){if(e.charAt(n)===t)return[e.substring(0,n),e.substring(n+1)];n+=1}return null}function k7(e){var t=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return t===null?null:[t[0],e.substring(t[0].length)]}var Zd,Jb,ty,Ng=["times"];(function(e){var t,n,i,s,o,l,u,f,d,m=function(O){return O=O||{},this.isStrokeTransparent=O.isStrokeTransparent||!1,this.strokeOpacity=O.strokeOpacity||1,this.strokeStyle=O.strokeStyle||"#000000",this.fillStyle=O.fillStyle||"#000000",this.isFillTransparent=O.isFillTransparent||!1,this.fillOpacity=O.fillOpacity||1,this.font=O.font||"10px sans-serif",this.textBaseline=O.textBaseline||"alphabetic",this.textAlign=O.textAlign||"left",this.lineWidth=O.lineWidth||1,this.lineJoin=O.lineJoin||"miter",this.lineCap=O.lineCap||"butt",this.path=O.path||[],this.transform=O.transform!==void 0?O.transform.clone():new f,this.globalCompositeOperation=O.globalCompositeOperation||"normal",this.globalAlpha=O.globalAlpha||1,this.clip_path=O.clip_path||[],this.currentPoint=O.currentPoint||new l,this.miterLimit=O.miterLimit||10,this.lastPoint=O.lastPoint||new l,this.lineDashOffset=O.lineDashOffset||0,this.lineDash=O.lineDash||[],this.margin=O.margin||[0,0,0,0],this.prevPageLastElemOffset=O.prevPageLastElemOffset||0,this.ignoreClearRect=typeof O.ignoreClearRect!="boolean"||O.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new g(this),t=this.internal.f2,n=this.internal.getCoordinateString,i=this.internal.getVerticalCoordinateString,s=this.internal.getHorizontalCoordinate,o=this.internal.getVerticalCoordinate,l=this.internal.Point,u=this.internal.Rectangle,f=this.internal.Matrix,d=new m}]);var g=function(O){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var q=O;Object.defineProperty(this,"pdf",{get:function(){return q}});var $=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return $},set:function(Bt){$=!!Bt}});var rt=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return rt},set:function(Bt){rt=!!Bt}});var at=0;Object.defineProperty(this,"posX",{get:function(){return at},set:function(Bt){isNaN(Bt)||(at=Bt)}});var At=0;Object.defineProperty(this,"posY",{get:function(){return At},set:function(Bt){isNaN(Bt)||(At=Bt)}}),Object.defineProperty(this,"margin",{get:function(){return d.margin},set:function(Bt){var ct;typeof Bt=="number"?ct=[Bt,Bt,Bt,Bt]:((ct=new Array(4))[0]=Bt[0],ct[1]=Bt.length>=2?Bt[1]:ct[0],ct[2]=Bt.length>=3?Bt[2]:ct[0],ct[3]=Bt.length>=4?Bt[3]:ct[1]),d.margin=ct}});var St=!1;Object.defineProperty(this,"autoPaging",{get:function(){return St},set:function(Bt){St=Bt}});var Tt=0;Object.defineProperty(this,"lastBreak",{get:function(){return Tt},set:function(Bt){Tt=Bt}});var Zt=[];Object.defineProperty(this,"pageBreaks",{get:function(){return Zt},set:function(Bt){Zt=Bt}}),Object.defineProperty(this,"ctx",{get:function(){return d},set:function(Bt){Bt instanceof m&&(d=Bt)}}),Object.defineProperty(this,"path",{get:function(){return d.path},set:function(Bt){d.path=Bt}});var Qt=[];Object.defineProperty(this,"ctxStack",{get:function(){return Qt},set:function(Bt){Qt=Bt}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(Bt){var ct;ct=x(Bt),this.ctx.fillStyle=ct.style,this.ctx.isFillTransparent=ct.a===0,this.ctx.fillOpacity=ct.a,this.pdf.setFillColor(ct.r,ct.g,ct.b,{a:ct.a}),this.pdf.setTextColor(ct.r,ct.g,ct.b,{a:ct.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(Bt){var ct=x(Bt);this.ctx.strokeStyle=ct.style,this.ctx.isStrokeTransparent=ct.a===0,this.ctx.strokeOpacity=ct.a,ct.a===0?this.pdf.setDrawColor(255,255,255):(ct.a,this.pdf.setDrawColor(ct.r,ct.g,ct.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(Bt){["butt","round","square"].indexOf(Bt)!==-1&&(this.ctx.lineCap=Bt,this.pdf.setLineCap(Bt))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(Bt){isNaN(Bt)||(this.ctx.lineWidth=Bt,this.pdf.setLineWidth(Bt))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(Bt){["bevel","round","miter"].indexOf(Bt)!==-1&&(this.ctx.lineJoin=Bt,this.pdf.setLineJoin(Bt))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(Bt){isNaN(Bt)||(this.ctx.miterLimit=Bt,this.pdf.setMiterLimit(Bt))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(Bt){this.ctx.textBaseline=Bt}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(Bt){["right","end","center","left","start"].indexOf(Bt)!==-1&&(this.ctx.textAlign=Bt)}});var ne=null;function ie(Bt,ct){if(ne===null){var me=function(he){var Xt=[];return Object.keys(he).forEach(function(J){he[J].forEach(function(ht){var mt=null;switch(ht){case"bold":mt={family:J,weight:"bold"};break;case"italic":mt={family:J,style:"italic"};break;case"bolditalic":mt={family:J,weight:"bold",style:"italic"};break;case"":case"normal":mt={family:J}}mt!==null&&(mt.ref={name:J,style:ht},Xt.push(mt))})}),Xt}(Bt.getFontList());ne=function(he){for(var Xt={},J=0;J<he.length;++J){var ht=e0(he[J]),mt=ht.family,Pt=ht.stretch,qt=ht.style,Ft=ht.weight;Xt[mt]=Xt[mt]||{},Xt[mt][Pt]=Xt[mt][Pt]||{},Xt[mt][Pt][qt]=Xt[mt][Pt][qt]||{},Xt[mt][Pt][qt][Ft]=ht}return Xt}(me.concat(ct))}return ne}var ye=null;Object.defineProperty(this,"fontFaces",{get:function(){return ye},set:function(Bt){ne=null,ye=Bt}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(Bt){var ct;if(this.ctx.font=Bt,(ct=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(Bt))!==null){var me=ct[1];ct[2];var he=ct[3],Xt=ct[4];ct[5];var J=ct[6],ht=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Xt)[2];Xt=Math.floor(ht==="px"?parseFloat(Xt)*this.pdf.internal.scaleFactor:ht==="em"?parseFloat(Xt)*this.pdf.getFontSize():parseFloat(Xt)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Xt);var mt=function(oe){var Se,ee,En=[],Pe=oe.trim();if(Pe==="")return Ng;if(Pe in $b)return[$b[Pe]];for(;Pe!=="";){switch(ee=null,Se=(Pe=Qb(Pe)).charAt(0)){case'"':case"'":ee=R7(Pe.substring(1),Se);break;default:ee=k7(Pe)}if(ee===null||(En.push(ee[0]),(Pe=Qb(ee[1]))!==""&&Pe.charAt(0)!==","))return Ng;Pe=Pe.replace(/^,/,"")}return En}(J);if(this.fontFaces){var Pt=D7(ie(this.pdf,this.fontFaces),mt.map(function(oe){return{family:oe,stretch:"normal",weight:he,style:me}}));this.pdf.setFont(Pt.ref.name,Pt.ref.style)}else{var qt="";(he==="bold"||parseInt(he,10)>=700||me==="bold")&&(qt="bold"),me==="italic"&&(qt+="italic"),qt.length===0&&(qt="normal");for(var Ft="",Kt={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},re=0;re<mt.length;re++){if(this.pdf.internal.getFont(mt[re],qt,{noFallback:!0,disableWarning:!0})!==void 0){Ft=mt[re];break}if(qt==="bolditalic"&&this.pdf.internal.getFont(mt[re],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Ft=mt[re],qt="bold";else if(this.pdf.internal.getFont(mt[re],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Ft=mt[re],qt="normal";break}}if(Ft===""){for(var fe=0;fe<mt.length;fe++)if(Kt[mt[fe]]){Ft=Kt[mt[fe]];break}}Ft=Ft===""?"Times":Ft,this.pdf.setFont(Ft,qt)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(Bt){this.ctx.globalCompositeOperation=Bt}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(Bt){this.ctx.globalAlpha=Bt}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(Bt){this.ctx.lineDashOffset=Bt,gt.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(Bt){this.ctx.lineDash=Bt,gt.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(Bt){this.ctx.ignoreClearRect=!!Bt}})};g.prototype.setLineDash=function(O){this.lineDash=O},g.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},g.prototype.fill=function(){Z.call(this,"fill",!1)},g.prototype.stroke=function(){Z.call(this,"stroke",!1)},g.prototype.beginPath=function(){this.path=[{type:"begin"}]},g.prototype.moveTo=function(O,q){if(isNaN(O)||isNaN(q))throw Mn.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var $=this.ctx.transform.applyToPoint(new l(O,q));this.path.push({type:"mt",x:$.x,y:$.y}),this.ctx.lastPoint=new l(O,q)},g.prototype.closePath=function(){var O=new l(0,0),q=0;for(q=this.path.length-1;q!==-1;q--)if(this.path[q].type==="begin"&&_n(this.path[q+1])==="object"&&typeof this.path[q+1].x=="number"){O=new l(this.path[q+1].x,this.path[q+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new l(O.x,O.y)},g.prototype.lineTo=function(O,q){if(isNaN(O)||isNaN(q))throw Mn.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var $=this.ctx.transform.applyToPoint(new l(O,q));this.path.push({type:"lt",x:$.x,y:$.y}),this.ctx.lastPoint=new l($.x,$.y)},g.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),Z.call(this,null,!0)},g.prototype.quadraticCurveTo=function(O,q,$,rt){if(isNaN($)||isNaN(rt)||isNaN(O)||isNaN(q))throw Mn.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var at=this.ctx.transform.applyToPoint(new l($,rt)),At=this.ctx.transform.applyToPoint(new l(O,q));this.path.push({type:"qct",x1:At.x,y1:At.y,x:at.x,y:at.y}),this.ctx.lastPoint=new l(at.x,at.y)},g.prototype.bezierCurveTo=function(O,q,$,rt,at,At){if(isNaN(at)||isNaN(At)||isNaN(O)||isNaN(q)||isNaN($)||isNaN(rt))throw Mn.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var St=this.ctx.transform.applyToPoint(new l(at,At)),Tt=this.ctx.transform.applyToPoint(new l(O,q)),Zt=this.ctx.transform.applyToPoint(new l($,rt));this.path.push({type:"bct",x1:Tt.x,y1:Tt.y,x2:Zt.x,y2:Zt.y,x:St.x,y:St.y}),this.ctx.lastPoint=new l(St.x,St.y)},g.prototype.arc=function(O,q,$,rt,at,At){if(isNaN(O)||isNaN(q)||isNaN($)||isNaN(rt)||isNaN(at))throw Mn.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(At=!!At,!this.ctx.transform.isIdentity){var St=this.ctx.transform.applyToPoint(new l(O,q));O=St.x,q=St.y;var Tt=this.ctx.transform.applyToPoint(new l(0,$)),Zt=this.ctx.transform.applyToPoint(new l(0,0));$=Math.sqrt(Math.pow(Tt.x-Zt.x,2)+Math.pow(Tt.y-Zt.y,2))}Math.abs(at-rt)>=2*Math.PI&&(rt=0,at=2*Math.PI),this.path.push({type:"arc",x:O,y:q,radius:$,startAngle:rt,endAngle:at,counterclockwise:At})},g.prototype.arcTo=function(O,q,$,rt,at){throw new Error("arcTo not implemented.")},g.prototype.rect=function(O,q,$,rt){if(isNaN(O)||isNaN(q)||isNaN($)||isNaN(rt))throw Mn.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(O,q),this.lineTo(O+$,q),this.lineTo(O+$,q+rt),this.lineTo(O,q+rt),this.lineTo(O,q),this.lineTo(O+$,q),this.lineTo(O,q)},g.prototype.fillRect=function(O,q,$,rt){if(isNaN(O)||isNaN(q)||isNaN($)||isNaN(rt))throw Mn.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!v.call(this)){var at={};this.lineCap!=="butt"&&(at.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(at.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(O,q,$,rt),this.fill(),at.hasOwnProperty("lineCap")&&(this.lineCap=at.lineCap),at.hasOwnProperty("lineJoin")&&(this.lineJoin=at.lineJoin)}},g.prototype.strokeRect=function(O,q,$,rt){if(isNaN(O)||isNaN(q)||isNaN($)||isNaN(rt))throw Mn.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");A.call(this)||(this.beginPath(),this.rect(O,q,$,rt),this.stroke())},g.prototype.clearRect=function(O,q,$,rt){if(isNaN(O)||isNaN(q)||isNaN($)||isNaN(rt))throw Mn.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(O,q,$,rt))},g.prototype.save=function(O){O=typeof O!="boolean"||O;for(var q=this.pdf.internal.getCurrentPageInfo().pageNumber,$=0;$<this.pdf.internal.getNumberOfPages();$++)this.pdf.setPage($+1),this.pdf.internal.out("q");if(this.pdf.setPage(q),O){this.ctx.fontSize=this.pdf.internal.getFontSize();var rt=new m(this.ctx);this.ctxStack.push(this.ctx),this.ctx=rt}},g.prototype.restore=function(O){O=typeof O!="boolean"||O;for(var q=this.pdf.internal.getCurrentPageInfo().pageNumber,$=0;$<this.pdf.internal.getNumberOfPages();$++)this.pdf.setPage($+1),this.pdf.internal.out("Q");this.pdf.setPage(q),O&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},g.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var x=function(O){var q,$,rt,at;if(O.isCanvasGradient===!0&&(O=O.getColor()),!O)return{r:0,g:0,b:0,a:0,style:O};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(O))q=0,$=0,rt=0,at=0;else{var At=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(O);if(At!==null)q=parseInt(At[1]),$=parseInt(At[2]),rt=parseInt(At[3]),at=1;else if((At=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(O))!==null)q=parseInt(At[1]),$=parseInt(At[2]),rt=parseInt(At[3]),at=parseFloat(At[4]);else{if(at=1,typeof O=="string"&&O.charAt(0)!=="#"){var St=new ex(O);O=St.ok?St.toHex():"#000000"}O.length===4?(q=O.substring(1,2),q+=q,$=O.substring(2,3),$+=$,rt=O.substring(3,4),rt+=rt):(q=O.substring(1,3),$=O.substring(3,5),rt=O.substring(5,7)),q=parseInt(q,16),$=parseInt($,16),rt=parseInt(rt,16)}}return{r:q,g:$,b:rt,a:at,style:O}},v=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},A=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};g.prototype.fillText=function(O,q,$,rt){if(isNaN(q)||isNaN($)||typeof O!="string")throw Mn.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(rt=isNaN(rt)?void 0:rt,!v.call(this)){var at=ut(this.ctx.transform.rotation),At=this.ctx.transform.scaleX;R.call(this,{text:O,x:q,y:$,scale:At,angle:at,align:this.textAlign,maxWidth:rt})}},g.prototype.strokeText=function(O,q,$,rt){if(isNaN(q)||isNaN($)||typeof O!="string")throw Mn.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!A.call(this)){rt=isNaN(rt)?void 0:rt;var at=ut(this.ctx.transform.rotation),At=this.ctx.transform.scaleX;R.call(this,{text:O,x:q,y:$,scale:At,renderingMode:"stroke",angle:at,align:this.textAlign,maxWidth:rt})}},g.prototype.measureText=function(O){if(typeof O!="string")throw Mn.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var q=this.pdf,$=this.pdf.internal.scaleFactor,rt=q.internal.getFontSize(),at=q.getStringUnitWidth(O)*rt/q.internal.scaleFactor,At=function(St){var Tt=(St=St||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return Tt}}),this};return new At({width:at*=Math.round(96*$/72*1e4)/1e4})},g.prototype.scale=function(O,q){if(isNaN(O)||isNaN(q))throw Mn.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var $=new f(O,0,0,q,0,0);this.ctx.transform=this.ctx.transform.multiply($)},g.prototype.rotate=function(O){if(isNaN(O))throw Mn.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var q=new f(Math.cos(O),Math.sin(O),-Math.sin(O),Math.cos(O),0,0);this.ctx.transform=this.ctx.transform.multiply(q)},g.prototype.translate=function(O,q){if(isNaN(O)||isNaN(q))throw Mn.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var $=new f(1,0,0,1,O,q);this.ctx.transform=this.ctx.transform.multiply($)},g.prototype.transform=function(O,q,$,rt,at,At){if(isNaN(O)||isNaN(q)||isNaN($)||isNaN(rt)||isNaN(at)||isNaN(At))throw Mn.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var St=new f(O,q,$,rt,at,At);this.ctx.transform=this.ctx.transform.multiply(St)},g.prototype.setTransform=function(O,q,$,rt,at,At){O=isNaN(O)?1:O,q=isNaN(q)?0:q,$=isNaN($)?0:$,rt=isNaN(rt)?1:rt,at=isNaN(at)?0:at,At=isNaN(At)?0:At,this.ctx.transform=new f(O,q,$,rt,at,At)};var N=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};g.prototype.drawImage=function(O,q,$,rt,at,At,St,Tt,Zt){var Qt=this.pdf.getImageProperties(O),ne=1,ie=1,ye=1,Bt=1;rt!==void 0&&Tt!==void 0&&(ye=Tt/rt,Bt=Zt/at,ne=Qt.width/rt*Tt/rt,ie=Qt.height/at*Zt/at),At===void 0&&(At=q,St=$,q=0,$=0),rt!==void 0&&Tt===void 0&&(Tt=rt,Zt=at),rt===void 0&&Tt===void 0&&(Tt=Qt.width,Zt=Qt.height);for(var ct,me=this.ctx.transform.decompose(),he=ut(me.rotate.shx),Xt=new f,J=(Xt=(Xt=(Xt=Xt.multiply(me.translate)).multiply(me.skew)).multiply(me.scale)).applyToRectangle(new u(At-q*ye,St-$*Bt,rt*ne,at*ie)),ht=E.call(this,J),mt=[],Pt=0;Pt<ht.length;Pt+=1)mt.indexOf(ht[Pt])===-1&&mt.push(ht[Pt]);if(z(mt),this.autoPaging)for(var qt=mt[0],Ft=mt[mt.length-1],Kt=qt;Kt<Ft+1;Kt++){this.pdf.setPage(Kt);var re=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],fe=Kt===1?this.posY+this.margin[0]:this.margin[0],oe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Se=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],ee=Kt===1?0:oe+(Kt-2)*Se;if(this.ctx.clip_path.length!==0){var En=this.path;ct=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=C(ct,this.posX+this.margin[3],-ee+fe+this.ctx.prevPageLastElemOffset),I.call(this,"fill",!0),this.path=En}var Pe=JSON.parse(JSON.stringify(J));Pe=C([Pe],this.posX+this.margin[3],-ee+fe+this.ctx.prevPageLastElemOffset)[0];var ei=(Kt>qt||Kt<Ft)&&N.call(this);ei&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],re,Se,null).clip().discardPath()),this.pdf.addImage(O,"JPEG",Pe.x,Pe.y,Pe.w,Pe.h,null,null,he),ei&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(O,"JPEG",J.x,J.y,J.w,J.h,null,null,he)};var E=function(O,q,$){var rt=[];q=q||this.pdf.internal.pageSize.width,$=$||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var at=this.posY+this.ctx.prevPageLastElemOffset;switch(O.type){default:case"mt":case"lt":rt.push(Math.floor((O.y+at)/$)+1);break;case"arc":rt.push(Math.floor((O.y+at-O.radius)/$)+1),rt.push(Math.floor((O.y+at+O.radius)/$)+1);break;case"qct":var At=wt(this.ctx.lastPoint.x,this.ctx.lastPoint.y,O.x1,O.y1,O.x,O.y);rt.push(Math.floor((At.y+at)/$)+1),rt.push(Math.floor((At.y+At.h+at)/$)+1);break;case"bct":var St=Y(this.ctx.lastPoint.x,this.ctx.lastPoint.y,O.x1,O.y1,O.x2,O.y2,O.x,O.y);rt.push(Math.floor((St.y+at)/$)+1),rt.push(Math.floor((St.y+St.h+at)/$)+1);break;case"rect":rt.push(Math.floor((O.y+at)/$)+1),rt.push(Math.floor((O.y+O.h+at)/$)+1)}for(var Tt=0;Tt<rt.length;Tt+=1)for(;this.pdf.internal.getNumberOfPages()<rt[Tt];)j.call(this);return rt},j=function(){var O=this.fillStyle,q=this.strokeStyle,$=this.font,rt=this.lineCap,at=this.lineWidth,At=this.lineJoin;this.pdf.addPage(),this.fillStyle=O,this.strokeStyle=q,this.font=$,this.lineCap=rt,this.lineWidth=at,this.lineJoin=At},C=function(O,q,$){for(var rt=0;rt<O.length;rt++)switch(O[rt].type){case"bct":O[rt].x2+=q,O[rt].y2+=$;case"qct":O[rt].x1+=q,O[rt].y1+=$;case"mt":case"lt":case"arc":default:O[rt].x+=q,O[rt].y+=$}return O},z=function(O){return O.sort(function(q,$){return q-$})},Z=function(O,q){for(var $,rt,at=this.fillStyle,At=this.strokeStyle,St=this.lineCap,Tt=this.lineWidth,Zt=Math.abs(Tt*this.ctx.transform.scaleX),Qt=this.lineJoin,ne=JSON.parse(JSON.stringify(this.path)),ie=JSON.parse(JSON.stringify(this.path)),ye=[],Bt=0;Bt<ie.length;Bt++)if(ie[Bt].x!==void 0)for(var ct=E.call(this,ie[Bt]),me=0;me<ct.length;me+=1)ye.indexOf(ct[me])===-1&&ye.push(ct[me]);for(var he=0;he<ye.length;he++)for(;this.pdf.internal.getNumberOfPages()<ye[he];)j.call(this);if(z(ye),this.autoPaging)for(var Xt=ye[0],J=ye[ye.length-1],ht=Xt;ht<J+1;ht++){this.pdf.setPage(ht),this.fillStyle=at,this.strokeStyle=At,this.lineCap=St,this.lineWidth=Zt,this.lineJoin=Qt;var mt=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Pt=ht===1?this.posY+this.margin[0]:this.margin[0],qt=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ft=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],Kt=ht===1?0:qt+(ht-2)*Ft;if(this.ctx.clip_path.length!==0){var re=this.path;$=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=C($,this.posX+this.margin[3],-Kt+Pt+this.ctx.prevPageLastElemOffset),I.call(this,O,!0),this.path=re}if(rt=JSON.parse(JSON.stringify(ne)),this.path=C(rt,this.posX+this.margin[3],-Kt+Pt+this.ctx.prevPageLastElemOffset),q===!1||ht===0){var fe=(ht>Xt||ht<J)&&N.call(this);fe&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],mt,Ft,null).clip().discardPath()),I.call(this,O,q),fe&&this.pdf.restoreGraphicsState()}this.lineWidth=Tt}else this.lineWidth=Zt,I.call(this,O,q),this.lineWidth=Tt;this.path=ne},I=function(O,q){if((O!=="stroke"||q||!A.call(this))&&(O==="stroke"||q||!v.call(this))){for(var $,rt,at=[],At=this.path,St=0;St<At.length;St++){var Tt=At[St];switch(Tt.type){case"begin":at.push({begin:!0});break;case"close":at.push({close:!0});break;case"mt":at.push({start:Tt,deltas:[],abs:[]});break;case"lt":var Zt=at.length;if(At[St-1]&&!isNaN(At[St-1].x)&&($=[Tt.x-At[St-1].x,Tt.y-At[St-1].y],Zt>0)){for(;Zt>=0;Zt--)if(at[Zt-1].close!==!0&&at[Zt-1].begin!==!0){at[Zt-1].deltas.push($),at[Zt-1].abs.push(Tt);break}}break;case"bct":$=[Tt.x1-At[St-1].x,Tt.y1-At[St-1].y,Tt.x2-At[St-1].x,Tt.y2-At[St-1].y,Tt.x-At[St-1].x,Tt.y-At[St-1].y],at[at.length-1].deltas.push($);break;case"qct":var Qt=At[St-1].x+2/3*(Tt.x1-At[St-1].x),ne=At[St-1].y+2/3*(Tt.y1-At[St-1].y),ie=Tt.x+2/3*(Tt.x1-Tt.x),ye=Tt.y+2/3*(Tt.y1-Tt.y),Bt=Tt.x,ct=Tt.y;$=[Qt-At[St-1].x,ne-At[St-1].y,ie-At[St-1].x,ye-At[St-1].y,Bt-At[St-1].x,ct-At[St-1].y],at[at.length-1].deltas.push($);break;case"arc":at.push({deltas:[],abs:[],arc:!0}),Array.isArray(at[at.length-1].abs)&&at[at.length-1].abs.push(Tt)}}rt=q?null:O==="stroke"?"stroke":"fill";for(var me=!1,he=0;he<at.length;he++)if(at[he].arc)for(var Xt=at[he].abs,J=0;J<Xt.length;J++){var ht=Xt[J];ht.type==="arc"?H.call(this,ht.x,ht.y,ht.radius,ht.startAngle,ht.endAngle,ht.counterclockwise,void 0,q,!me):et.call(this,ht.x,ht.y),me=!0}else if(at[he].close===!0)this.pdf.internal.out("h"),me=!1;else if(at[he].begin!==!0){var mt=at[he].start.x,Pt=at[he].start.y;nt.call(this,at[he].deltas,mt,Pt),me=!0}rt&&G.call(this,rt),q&&Q.call(this)}},st=function(O){var q=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,$=q*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return O-$;case"top":return O+q-$;case"hanging":return O+q-2*$;case"middle":return O+q/2-$;case"ideographic":return O;case"alphabetic":default:return O}},K=function(O){return O+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};g.prototype.createLinearGradient=function(){var O=function(){};return O.colorStops=[],O.addColorStop=function(q,$){this.colorStops.push([q,$])},O.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},O.isCanvasGradient=!0,O},g.prototype.createPattern=function(){return this.createLinearGradient()},g.prototype.createRadialGradient=function(){return this.createLinearGradient()};var H=function(O,q,$,rt,at,At,St,Tt,Zt){for(var Qt=W.call(this,$,rt,at,At),ne=0;ne<Qt.length;ne++){var ie=Qt[ne];ne===0&&(Zt?D.call(this,ie.x1+O,ie.y1+q):et.call(this,ie.x1+O,ie.y1+q)),dt.call(this,O,q,ie.x2,ie.y2,ie.x3,ie.y3,ie.x4,ie.y4)}Tt?Q.call(this):G.call(this,St)},G=function(O){switch(O){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},Q=function(){this.pdf.clip(),this.pdf.discardPath()},D=function(O,q){this.pdf.internal.out(n(O)+" "+i(q)+" m")},R=function(O){var q;switch(O.align){case"right":case"end":q="right";break;case"center":q="center";break;case"left":case"start":default:q="left"}var $=this.pdf.getTextDimensions(O.text),rt=st.call(this,O.y),at=K.call(this,rt)-$.h,At=this.ctx.transform.applyToPoint(new l(O.x,rt)),St=this.ctx.transform.decompose(),Tt=new f;Tt=(Tt=(Tt=Tt.multiply(St.translate)).multiply(St.skew)).multiply(St.scale);for(var Zt,Qt,ne,ie=this.ctx.transform.applyToRectangle(new u(O.x,rt,$.w,$.h)),ye=Tt.applyToRectangle(new u(O.x,at,$.w,$.h)),Bt=E.call(this,ye),ct=[],me=0;me<Bt.length;me+=1)ct.indexOf(Bt[me])===-1&&ct.push(Bt[me]);if(z(ct),this.autoPaging)for(var he=ct[0],Xt=ct[ct.length-1],J=he;J<Xt+1;J++){this.pdf.setPage(J);var ht=J===1?this.posY+this.margin[0]:this.margin[0],mt=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Pt=this.pdf.internal.pageSize.height-this.margin[2],qt=Pt-this.margin[0],Ft=this.pdf.internal.pageSize.width-this.margin[1],Kt=Ft-this.margin[3],re=J===1?0:mt+(J-2)*qt;if(this.ctx.clip_path.length!==0){var fe=this.path;Zt=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=C(Zt,this.posX+this.margin[3],-1*re+ht),I.call(this,"fill",!0),this.path=fe}var oe=C([JSON.parse(JSON.stringify(ye))],this.posX+this.margin[3],-re+ht+this.ctx.prevPageLastElemOffset)[0];O.scale>=.01&&(Qt=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Qt*O.scale),ne=this.lineWidth,this.lineWidth=ne*O.scale);var Se=this.autoPaging!=="text";if(Se||oe.y+oe.h<=Pt){if(Se||oe.y>=ht&&oe.x<=Ft){var ee=Se?O.text:this.pdf.splitTextToSize(O.text,O.maxWidth||Ft-oe.x)[0],En=C([JSON.parse(JSON.stringify(ie))],this.posX+this.margin[3],-re+ht+this.ctx.prevPageLastElemOffset)[0],Pe=Se&&(J>he||J<Xt)&&N.call(this);Pe&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Kt,qt,null).clip().discardPath()),this.pdf.text(ee,En.x,En.y,{angle:O.angle,align:q,renderingMode:O.renderingMode}),Pe&&this.pdf.restoreGraphicsState()}}else oe.y<Pt&&(this.ctx.prevPageLastElemOffset+=Pt-oe.y);O.scale>=.01&&(this.pdf.setFontSize(Qt),this.lineWidth=ne)}else O.scale>=.01&&(Qt=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Qt*O.scale),ne=this.lineWidth,this.lineWidth=ne*O.scale),this.pdf.text(O.text,At.x+this.posX,At.y+this.posY,{angle:O.angle,align:q,renderingMode:O.renderingMode,maxWidth:O.maxWidth}),O.scale>=.01&&(this.pdf.setFontSize(Qt),this.lineWidth=ne)},et=function(O,q,$,rt){$=$||0,rt=rt||0,this.pdf.internal.out(n(O+$)+" "+i(q+rt)+" l")},nt=function(O,q,$){return this.pdf.lines(O,q,$,null,null)},dt=function(O,q,$,rt,at,At,St,Tt){this.pdf.internal.out([t(s($+O)),t(o(rt+q)),t(s(at+O)),t(o(At+q)),t(s(St+O)),t(o(Tt+q)),"c"].join(" "))},W=function(O,q,$,rt){for(var at=2*Math.PI,At=Math.PI/2;q>$;)q-=at;var St=Math.abs($-q);St<at&&rt&&(St=at-St);for(var Tt=[],Zt=rt?-1:1,Qt=q;St>1e-5;){var ne=Qt+Zt*Math.min(St,At);Tt.push(lt.call(this,O,Qt,ne)),St-=Math.abs(ne-Qt),Qt=ne}return Tt},lt=function(O,q,$){var rt=($-q)/2,at=O*Math.cos(rt),At=O*Math.sin(rt),St=at,Tt=-At,Zt=St*St+Tt*Tt,Qt=Zt+St*at+Tt*At,ne=4/3*(Math.sqrt(2*Zt*Qt)-Qt)/(St*At-Tt*at),ie=St-ne*Tt,ye=Tt+ne*St,Bt=ie,ct=-ye,me=rt+q,he=Math.cos(me),Xt=Math.sin(me);return{x1:O*Math.cos(q),y1:O*Math.sin(q),x2:ie*he-ye*Xt,y2:ie*Xt+ye*he,x3:Bt*he-ct*Xt,y3:Bt*Xt+ct*he,x4:O*Math.cos($),y4:O*Math.sin($)}},ut=function(O){return 180*O/Math.PI},wt=function(O,q,$,rt,at,At){var St=O+.5*($-O),Tt=q+.5*(rt-q),Zt=at+.5*($-at),Qt=At+.5*(rt-At),ne=Math.min(O,at,St,Zt),ie=Math.max(O,at,St,Zt),ye=Math.min(q,At,Tt,Qt),Bt=Math.max(q,At,Tt,Qt);return new u(ne,ye,ie-ne,Bt-ye)},Y=function(O,q,$,rt,at,At,St,Tt){var Zt,Qt,ne,ie,ye,Bt,ct,me,he,Xt,J,ht,mt,Pt,qt=$-O,Ft=rt-q,Kt=at-$,re=At-rt,fe=St-at,oe=Tt-At;for(Qt=0;Qt<41;Qt++)he=(ct=(ne=O+(Zt=Qt/40)*qt)+Zt*((ye=$+Zt*Kt)-ne))+Zt*(ye+Zt*(at+Zt*fe-ye)-ct),Xt=(me=(ie=q+Zt*Ft)+Zt*((Bt=rt+Zt*re)-ie))+Zt*(Bt+Zt*(At+Zt*oe-Bt)-me),Qt==0?(J=he,ht=Xt,mt=he,Pt=Xt):(J=Math.min(J,he),ht=Math.min(ht,Xt),mt=Math.max(mt,he),Pt=Math.max(Pt,Xt));return new u(Math.round(J),Math.round(ht),Math.round(mt-J),Math.round(Pt-ht))},gt=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var O,q,$=(O=this.ctx.lineDash,q=this.ctx.lineDashOffset,JSON.stringify({lineDash:O,lineDashOffset:q}));this.prevLineDash!==$&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=$)}}})(Ae.API),function(e){var t=function(o){var l,u,f,d,m,g,x,v,A,N;for(u=[],f=0,d=(o+=l="\0\0\0\0".slice(o.length%4||4)).length;d>f;f+=4)(m=(o.charCodeAt(f)<<24)+(o.charCodeAt(f+1)<<16)+(o.charCodeAt(f+2)<<8)+o.charCodeAt(f+3))!==0?(g=(m=((m=((m=((m=(m-(N=m%85))/85)-(A=m%85))/85)-(v=m%85))/85)-(x=m%85))/85)%85,u.push(g+33,x+33,v+33,A+33,N+33)):u.push(122);return function(E,j){for(var C=j;C>0;C--)E.pop()}(u,l.length),String.fromCharCode.apply(String,u)+"~>"},n=function(o){var l,u,f,d,m,g=String,x="length",v=255,A="charCodeAt",N="slice",E="replace";for(o[N](-2),o=o[N](0,-2)[E](/\s/g,"")[E]("z","!!!!!"),f=[],d=0,m=(o+=l="uuuuu"[N](o[x]%5||5))[x];m>d;d+=5)u=52200625*(o[A](d)-33)+614125*(o[A](d+1)-33)+7225*(o[A](d+2)-33)+85*(o[A](d+3)-33)+(o[A](d+4)-33),f.push(v&u>>24,v&u>>16,v&u>>8,v&u);return function(j,C){for(var z=C;z>0;z--)j.pop()}(f,l[x]),g.fromCharCode.apply(g,f)},i=function(o){var l=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((o=o.replace(/\s/g,"")).indexOf(">")!==-1&&(o=o.substr(0,o.indexOf(">"))),o.length%2&&(o+="0"),l.test(o)===!1)return"";for(var u="",f=0;f<o.length;f+=2)u+=String.fromCharCode("0x"+(o[f]+o[f+1]));return u},s=function(o){for(var l=new Uint8Array(o.length),u=o.length;u--;)l[u]=o.charCodeAt(u);return o=(l=Kg(l)).reduce(function(f,d){return f+String.fromCharCode(d)},"")};e.processDataByFilters=function(o,l){var u=0,f=o||"",d=[];for(typeof(l=l||[])=="string"&&(l=[l]),u=0;u<l.length;u+=1)switch(l[u]){case"ASCII85Decode":case"/ASCII85Decode":f=n(f),d.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":f=t(f),d.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":f=i(f),d.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":f=f.split("").map(function(m){return("0"+m.charCodeAt().toString(16)).slice(-2)}).join("")+">",d.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":f=s(f),d.push("/FlateDecode");break;default:throw new Error('The filter: "'+l[u]+'" is not implemented')}return{data:f,reverseChain:d.reverse().join(" ")}}}(Ae.API),function(e){e.loadFile=function(t,n,i){return function(s,o,l){o=o!==!1,l=typeof l=="function"?l:function(){};var u=void 0;try{u=function(f,d,m){var g=new XMLHttpRequest,x=0,v=function(A){var N=A.length,E=[],j=String.fromCharCode;for(x=0;x<N;x+=1)E.push(j(255&A.charCodeAt(x)));return E.join("")};if(g.open("GET",f,!d),g.overrideMimeType("text/plain; charset=x-user-defined"),d===!1&&(g.onload=function(){g.status===200?m(v(this.responseText)):m(void 0)}),g.send(null),d&&g.status===200)return v(g.responseText)}(s,o,l)}catch{}return u}(t,n,i)},e.loadImageFile=e.loadFile}(Ae.API),function(e){function t(){return(je.html2canvas?Promise.resolve(je.html2canvas):Vg(()=>import("./html2canvas.esm-BfxBtG_O.js"),[])).catch(function(l){return Promise.reject(new Error("Could not load html2canvas: "+l))}).then(function(l){return l.default?l.default:l})}function n(){return(je.DOMPurify?Promise.resolve(je.DOMPurify):Vg(()=>import("./purify.es-CQJ0hv7W.js"),[])).catch(function(l){return Promise.reject(new Error("Could not load dompurify: "+l))}).then(function(l){return l.default?l.default:l})}var i=function(l){var u=_n(l);return u==="undefined"?"undefined":u==="string"||l instanceof String?"string":u==="number"||l instanceof Number?"number":u==="function"||l instanceof Function?"function":l&&l.constructor===Array?"array":l&&l.nodeType===1?"element":u==="object"?"object":"unknown"},s=function(l,u){var f=document.createElement(l);for(var d in u.className&&(f.className=u.className),u.innerHTML&&u.dompurify&&(f.innerHTML=u.dompurify.sanitize(u.innerHTML)),u.style)f.style[d]=u.style[d];return f},o=function l(u){var f=Object.assign(l.convert(Promise.resolve()),JSON.parse(JSON.stringify(l.template))),d=l.convert(Promise.resolve(),f);return d=(d=d.setProgress(1,l,1,[l])).set(u)};(o.prototype=Object.create(Promise.prototype)).constructor=o,o.convert=function(l,u){return l.__proto__=u||o.prototype,l},o.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},o.prototype.from=function(l,u){return this.then(function(){switch(u=u||function(f){switch(i(f)){case"string":return"string";case"element":return f.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(l)){case"string":return this.then(n).then(function(f){return this.set({src:s("div",{innerHTML:l,dompurify:f})})});case"element":return this.set({src:l});case"canvas":return this.set({canvas:l});case"img":return this.set({img:l});default:return this.error("Unknown source type.")}})},o.prototype.to=function(l){switch(l){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},o.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var l={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},u=function f(d,m){for(var g=d.nodeType===3?document.createTextNode(d.nodeValue):d.cloneNode(!1),x=d.firstChild;x;x=x.nextSibling)m!==!0&&x.nodeType===1&&x.nodeName==="SCRIPT"||g.appendChild(f(x,m));return d.nodeType===1&&(d.nodeName==="CANVAS"?(g.width=d.width,g.height=d.height,g.getContext("2d").drawImage(d,0,0)):d.nodeName!=="TEXTAREA"&&d.nodeName!=="SELECT"||(g.value=d.value),g.addEventListener("load",function(){g.scrollTop=d.scrollTop,g.scrollLeft=d.scrollLeft},!0)),g}(this.prop.src,this.opt.html2canvas.javascriptEnabled);u.tagName==="BODY"&&(l.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=s("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=s("div",{className:"html2pdf__container",style:l}),this.prop.container.appendChild(u),this.prop.container.firstChild.appendChild(s("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},o.prototype.toCanvas=function(){var l=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(l).then(t).then(function(u){var f=Object.assign({},this.opt.html2canvas);return delete f.onrendered,u(this.prop.container,f)}).then(function(u){(this.opt.html2canvas.onrendered||function(){})(u),this.prop.canvas=u,document.body.removeChild(this.prop.overlay)})},o.prototype.toContext2d=function(){var l=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(l).then(t).then(function(u){var f=this.opt.jsPDF,d=this.opt.fontFaces,m=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,g=Object.assign({async:!0,allowTaint:!0,scale:m,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete g.onrendered,f.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,f.context2d.posX=this.opt.x,f.context2d.posY=this.opt.y,f.context2d.margin=this.opt.margin,f.context2d.fontFaces=d,d)for(var x=0;x<d.length;++x){var v=d[x],A=v.src.find(function(N){return N.format==="truetype"});A&&f.addFont(A.url,v.ref.name,v.ref.style)}return g.windowHeight=g.windowHeight||0,g.windowHeight=g.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):g.windowHeight,f.context2d.save(!0),u(this.prop.container,g)}).then(function(u){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(u),this.prop.canvas=u,document.body.removeChild(this.prop.overlay)})},o.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var l=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=l})},o.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},o.prototype.output=function(l,u,f){return(f=f||"pdf").toLowerCase()==="img"||f.toLowerCase()==="image"?this.outputImg(l,u):this.outputPdf(l,u)},o.prototype.outputPdf=function(l,u){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(l,u)})},o.prototype.outputImg=function(l){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(l){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+l+'" is not supported.'}})},o.prototype.save=function(l){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(l?{filename:l}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},o.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},o.prototype.set=function(l){if(i(l)!=="object")return this;var u=Object.keys(l||{}).map(function(f){if(f in o.template.prop)return function(){this.prop[f]=l[f]};switch(f){case"margin":return this.setMargin.bind(this,l.margin);case"jsPDF":return function(){return this.opt.jsPDF=l.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,l.pageSize);default:return function(){this.opt[f]=l[f]}}},this);return this.then(function(){return this.thenList(u)})},o.prototype.get=function(l,u){return this.then(function(){var f=l in o.template.prop?this.prop[l]:this.opt[l];return u?u(f):f})},o.prototype.setMargin=function(l){return this.then(function(){switch(i(l)){case"number":l=[l,l,l,l];case"array":if(l.length===2&&(l=[l[0],l[1],l[0],l[1]]),l.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=l}).then(this.setPageSize)},o.prototype.setPageSize=function(l){function u(f,d){return Math.floor(f*d/72*96)}return this.then(function(){(l=l||Ae.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(l.inner={width:l.width-this.opt.margin[1]-this.opt.margin[3],height:l.height-this.opt.margin[0]-this.opt.margin[2]},l.inner.px={width:u(l.inner.width,l.k),height:u(l.inner.height,l.k)},l.inner.ratio=l.inner.height/l.inner.width),this.prop.pageSize=l})},o.prototype.setProgress=function(l,u,f,d){return l!=null&&(this.progress.val=l),u!=null&&(this.progress.state=u),f!=null&&(this.progress.n=f),d!=null&&(this.progress.stack=d),this.progress.ratio=this.progress.val/this.progress.state,this},o.prototype.updateProgress=function(l,u,f,d){return this.setProgress(l?this.progress.val+l:null,u||null,f?this.progress.n+f:null,d?this.progress.stack.concat(d):null)},o.prototype.then=function(l,u){var f=this;return this.thenCore(l,u,function(d,m){return f.updateProgress(null,null,1,[d]),Promise.prototype.then.call(this,function(g){return f.updateProgress(null,d),g}).then(d,m).then(function(g){return f.updateProgress(1),g})})},o.prototype.thenCore=function(l,u,f){f=f||Promise.prototype.then,l&&(l=l.bind(this)),u&&(u=u.bind(this));var d=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?this:o.convert(Object.assign({},this),Promise.prototype),m=f.call(d,l,u);return o.convert(m,this.__proto__)},o.prototype.thenExternal=function(l,u){return Promise.prototype.then.call(this,l,u)},o.prototype.thenList=function(l){var u=this;return l.forEach(function(f){u=u.thenCore(f)}),u},o.prototype.catch=function(l){l&&(l=l.bind(this));var u=Promise.prototype.catch.call(this,l);return o.convert(u,this)},o.prototype.catchExternal=function(l){return Promise.prototype.catch.call(this,l)},o.prototype.error=function(l){return this.then(function(){throw new Error(l)})},o.prototype.using=o.prototype.set,o.prototype.saveAs=o.prototype.save,o.prototype.export=o.prototype.output,o.prototype.run=o.prototype.then,Ae.getPageSize=function(l,u,f){if(_n(l)==="object"){var d=l;l=d.orientation,u=d.unit||u,f=d.format||f}u=u||"mm",f=f||"a4",l=(""+(l||"P")).toLowerCase();var m,g=(""+f).toLowerCase(),x={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(u){case"pt":m=1;break;case"mm":m=72/25.4;break;case"cm":m=72/2.54;break;case"in":m=72;break;case"px":m=.75;break;case"pc":case"em":m=12;break;case"ex":m=6;break;default:throw"Invalid unit: "+u}var v,A=0,N=0;if(x.hasOwnProperty(g))A=x[g][1]/m,N=x[g][0]/m;else try{A=f[1],N=f[0]}catch{throw new Error("Invalid format: "+f)}if(l==="p"||l==="portrait")l="p",N>A&&(v=N,N=A,A=v);else{if(l!=="l"&&l!=="landscape")throw"Invalid orientation: "+l;l="l",A>N&&(v=N,N=A,A=v)}return{width:N,height:A,unit:u,k:m,orientation:l}},e.html=function(l,u){(u=u||{}).callback=u.callback||function(){},u.html2canvas=u.html2canvas||{},u.html2canvas.canvas=u.html2canvas.canvas||this.canvas,u.jsPDF=u.jsPDF||this,u.fontFaces=u.fontFaces?u.fontFaces.map(e0):null;var f=new o(u);return u.worker?f:f.from(l).doCallback()}}(Ae.API),Ae.API.addJS=function(e){return ty=e,this.internal.events.subscribe("postPutResources",function(){Zd=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(Zd+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),Jb=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+ty+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){Zd!==void 0&&Jb!==void 0&&this.internal.out("/Names <</JavaScript "+Zd+" 0 R>>")}),this},function(e){var t;e.events.push(["postPutResources",function(){var n=this,i=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var s=n.outline.render().split(/\r\n/),o=0;o<s.length;o++){var l=s[o],u=i.exec(l);if(u!=null){var f=u[1];n.internal.newObjectDeferredBegin(f,!1)}n.internal.write(l)}if(this.outline.createNamedDestinations){var d=this.internal.pages.length,m=[];for(o=0;o<d;o++){var g=n.internal.newObject();m.push(g);var x=n.internal.getPageInfo(o+1);n.internal.write("<< /D["+x.objId+" 0 R /XYZ null null null]>> endobj")}var v=n.internal.newObject();for(n.internal.write("<< /Names [ "),o=0;o<m.length;o++)n.internal.write("(page_"+(o+1)+")"+m[o]+" 0 R");n.internal.write(" ] >>","endobj"),t=n.internal.newObject(),n.internal.write("<< /Dests "+v+" 0 R"),n.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){this.outline.root.children.length>0&&(this.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&this.internal.write("/Names "+t+" 0 R"))}]),e.events.push(["initialized",function(){var n=this;n.outline={createNamedDestinations:!1,root:{children:[]}},n.outline.add=function(i,s,o){var l={title:s,options:o,children:[]};return i==null&&(i=this.root),i.children.push(l),l},n.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=n,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},n.outline.genIds_r=function(i){i.id=n.internal.newObjectDeferred();for(var s=0;s<i.children.length;s++)this.genIds_r(i.children[s])},n.outline.renderRoot=function(i){this.objStart(i),this.line("/Type /Outlines"),i.children.length>0&&(this.line("/First "+this.makeRef(i.children[0])),this.line("/Last "+this.makeRef(i.children[i.children.length-1]))),this.line("/Count "+this.count_r({count:0},i)),this.objEnd()},n.outline.renderItems=function(i){for(var s=this.ctx.pdf.internal.getVerticalCoordinateString,o=0;o<i.children.length;o++){var l=i.children[o];this.objStart(l),this.line("/Title "+this.makeString(l.title)),this.line("/Parent "+this.makeRef(i)),o>0&&this.line("/Prev "+this.makeRef(i.children[o-1])),o<i.children.length-1&&this.line("/Next "+this.makeRef(i.children[o+1])),l.children.length>0&&(this.line("/First "+this.makeRef(l.children[0])),this.line("/Last "+this.makeRef(l.children[l.children.length-1])));var u=this.count=this.count_r({count:0},l);if(u>0&&this.line("/Count "+u),l.options&&l.options.pageNumber){var f=n.internal.getPageInfo(l.options.pageNumber);this.line("/Dest ["+f.objId+" 0 R /XYZ 0 "+s(0)+" 0]")}this.objEnd()}for(var d=0;d<i.children.length;d++)this.renderItems(i.children[d])},n.outline.line=function(i){this.ctx.val+=i+`\r
`},n.outline.makeRef=function(i){return i.id+" 0 R"},n.outline.makeString=function(i){return"("+n.internal.pdfEscape(i)+")"},n.outline.objStart=function(i){this.ctx.val+=`\r
`+i.id+` 0 obj\r
<<\r
`},n.outline.objEnd=function(){this.ctx.val+=`>> \r
endobj\r
`},n.outline.count_r=function(i,s){for(var o=0;o<s.children.length;o++)i.count++,this.count_r(i,s.children[o]);return i.count}}])}(Ae.API),function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(n,i,s,o,l,u){var f,d=this.decode.DCT_DECODE,m=null;if(typeof n=="string"||this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n)){switch(n=l||n,n=this.__addimage__.isArrayBuffer(n)?new Uint8Array(n):n,(f=function(g){for(var x,v=256*g.charCodeAt(4)+g.charCodeAt(5),A=g.length,N={width:0,height:0,numcomponents:1},E=4;E<A;E+=2){if(E+=v,t.indexOf(g.charCodeAt(E+1))!==-1){x=256*g.charCodeAt(E+5)+g.charCodeAt(E+6),N={width:256*g.charCodeAt(E+7)+g.charCodeAt(E+8),height:x,numcomponents:g.charCodeAt(E+9)};break}v=256*g.charCodeAt(E+2)+g.charCodeAt(E+3)}return N}(n=this.__addimage__.isArrayBufferView(n)?this.__addimage__.arrayBufferToBinaryString(n):n)).numcomponents){case 1:u=this.color_spaces.DEVICE_GRAY;break;case 4:u=this.color_spaces.DEVICE_CMYK;break;case 3:u=this.color_spaces.DEVICE_RGB}m={data:n,width:f.width,height:f.height,colorSpace:u,bitsPerComponent:8,filter:d,index:i,alias:s}}return m}}(Ae.API);var Pu,Qd,ey,ny,iy,P7=function(){var e,t,n;function i(o){var l,u,f,d,m,g,x,v,A,N,E,j,C,z;for(this.data=o,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},g=null;;){switch(l=this.readUInt32(),A=(function(){var Z,I;for(I=[],Z=0;Z<4;++Z)I.push(String.fromCharCode(this.data[this.pos++]));return I}).call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(l);break;case"fcTL":g&&this.animation.frames.push(g),this.pos+=4,g={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},m=this.readUInt16(),d=this.readUInt16()||100,g.delay=1e3*m/d,g.disposeOp=this.data[this.pos++],g.blendOp=this.data[this.pos++],g.data=[];break;case"IDAT":case"fdAT":for(A==="fdAT"&&(this.pos+=4,l-=4),o=g?.data||this.imgData,j=0;0<=l?j<l:j>l;0<=l?++j:--j)o.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(f=this.palette.length/3,this.transparency.indexed=this.read(l),this.transparency.indexed.length>f)throw new Error("More transparent colors than palette size");if((N=f-this.transparency.indexed.length)>0)for(C=0;0<=N?C<N:C>N;0<=N?++C:--C)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(l)[0];break;case 2:this.transparency.rgb=this.read(l)}break;case"tEXt":x=(E=this.read(l)).indexOf(0),v=String.fromCharCode.apply(String,E.slice(0,x)),this.text[v]=String.fromCharCode.apply(String,E.slice(x+1));break;case"IEND":return g&&this.animation.frames.push(g),this.colors=(function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}).call(this),this.hasAlphaChannel=(z=this.colorType)===4||z===6,u=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*u,this.colorSpace=(function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}).call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=l}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}i.prototype.read=function(o){var l,u;for(u=[],l=0;0<=o?l<o:l>o;0<=o?++l:--l)u.push(this.data[this.pos++]);return u},i.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},i.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},i.prototype.decodePixels=function(o){var l=this.pixelBitlength/8,u=new Uint8Array(this.width*this.height*l),f=0,d=this;if(o==null&&(o=this.imgData),o.length===0)return new Uint8Array(0);function m(g,x,v,A){var N,E,j,C,z,Z,I,st,K,H,G,Q,D,R,et,nt,dt,W,lt,ut,wt,Y=Math.ceil((d.width-g)/v),gt=Math.ceil((d.height-x)/A),O=d.width==Y&&d.height==gt;for(R=l*Y,Q=O?u:new Uint8Array(R*gt),Z=o.length,D=0,E=0;D<gt&&f<Z;){switch(o[f++]){case 0:for(C=dt=0;dt<R;C=dt+=1)Q[E++]=o[f++];break;case 1:for(C=W=0;W<R;C=W+=1)N=o[f++],z=C<l?0:Q[E-l],Q[E++]=(N+z)%256;break;case 2:for(C=lt=0;lt<R;C=lt+=1)N=o[f++],j=(C-C%l)/l,et=D&&Q[(D-1)*R+j*l+C%l],Q[E++]=(et+N)%256;break;case 3:for(C=ut=0;ut<R;C=ut+=1)N=o[f++],j=(C-C%l)/l,z=C<l?0:Q[E-l],et=D&&Q[(D-1)*R+j*l+C%l],Q[E++]=(N+Math.floor((z+et)/2))%256;break;case 4:for(C=wt=0;wt<R;C=wt+=1)N=o[f++],j=(C-C%l)/l,z=C<l?0:Q[E-l],D===0?et=nt=0:(et=Q[(D-1)*R+j*l+C%l],nt=j&&Q[(D-1)*R+(j-1)*l+C%l]),I=z+et-nt,st=Math.abs(I-z),H=Math.abs(I-et),G=Math.abs(I-nt),K=st<=H&&st<=G?z:H<=G?et:nt,Q[E++]=(N+K)%256;break;default:throw new Error("Invalid filter algorithm: "+o[f-1])}if(!O){var q=((x+D*A)*d.width+g)*l,$=D*R;for(C=0;C<Y;C+=1){for(var rt=0;rt<l;rt+=1)u[q++]=Q[$++];q+=(v-1)*l}}D++}}return o=p7(o),d.interlaceMethod==1?(m(0,0,8,8),m(4,0,8,8),m(0,4,4,8),m(2,0,4,4),m(0,2,2,4),m(1,0,2,2),m(0,1,1,2)):m(0,0,1,1),u},i.prototype.decodePalette=function(){var o,l,u,f,d,m,g,x,v;for(u=this.palette,m=this.transparency.indexed||[],d=new Uint8Array((m.length||0)+u.length),f=0,o=0,l=g=0,x=u.length;g<x;l=g+=3)d[f++]=u[l],d[f++]=u[l+1],d[f++]=u[l+2],d[f++]=(v=m[o++])!=null?v:255;return d},i.prototype.copyToImageData=function(o,l){var u,f,d,m,g,x,v,A,N,E,j;if(f=this.colors,N=null,u=this.hasAlphaChannel,this.palette.length&&(N=(j=this._decodedPalette)!=null?j:this._decodedPalette=this.decodePalette(),f=4,u=!0),A=(d=o.data||o).length,g=N||l,m=x=0,f===1)for(;m<A;)v=N?4*l[m/4]:x,E=g[v++],d[m++]=E,d[m++]=E,d[m++]=E,d[m++]=u?g[v++]:255,x=v;else for(;m<A;)v=N?4*l[m/4]:x,d[m++]=g[v++],d[m++]=g[v++],d[m++]=g[v++],d[m++]=u?g[v++]:255,x=v},i.prototype.decode=function(){var o;return o=new Uint8Array(this.width*this.height*4),this.copyToImageData(o,this.decodePixels()),o};var s=function(){if(Object.prototype.toString.call(je)==="[object Window]"){try{t=je.document.createElement("canvas"),n=t.getContext("2d")}catch{return!1}return!0}return!1};return s(),e=function(o){var l;if(s()===!0)return n.width=o.width,n.height=o.height,n.clearRect(0,0,o.width,o.height),n.putImageData(o,0,0),(l=new Image).src=t.toDataURL(),l;throw new Error("This method requires a Browser with Canvas-capability.")},i.prototype.decodeFrames=function(o){var l,u,f,d,m,g,x,v;if(this.animation){for(v=[],u=m=0,g=(x=this.animation.frames).length;m<g;u=++m)l=x[u],f=o.createImageData(l.width,l.height),d=this.decodePixels(new Uint8Array(l.data)),this.copyToImageData(f,d),l.imageData=f,v.push(l.image=e(f));return v}},i.prototype.renderFrame=function(o,l){var u,f,d;return u=(f=this.animation.frames)[l],d=f[l-1],l===0&&o.clearRect(0,0,this.width,this.height),d?.disposeOp===1?o.clearRect(d.xOffset,d.yOffset,d.width,d.height):d?.disposeOp===2&&o.putImageData(d.imageData,d.xOffset,d.yOffset),u.blendOp===0&&o.clearRect(u.xOffset,u.yOffset,u.width,u.height),o.drawImage(u.image,u.xOffset,u.yOffset)},i.prototype.animate=function(o){var l,u,f,d,m,g,x=this;return u=0,g=this.animation,d=g.numFrames,f=g.frames,m=g.numPlays,(l=function(){var v,A;if(v=u++%d,A=f[v],x.renderFrame(o,v),d>1&&u/d<m)return x.animation._timeout=setTimeout(l,A.delay)})()},i.prototype.stopAnimation=function(){var o;return clearTimeout((o=this.animation)!=null?o._timeout:void 0)},i.prototype.render=function(o){var l,u;return o._png&&o._png.stopAnimation(),o._png=this,o.width=this.width,o.height=this.height,l=o.getContext("2d"),this.animation?(this.decodeFrames(l),this.animate(l)):(u=l.createImageData(this.width,this.height),this.copyToImageData(u,this.decodePixels()),l.putImageData(u,0,0))},i}();/**
* @license
*
* Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* ====================================================================
*//**
* @license
* (c) Dean McNamee <dean@gmail.com>, 2013.
*
* https://github.com/deanm/omggif
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
* including animation and compression. It does not rely on any specific
* underlying system, so should run in the browser, Node, or Plask.
*/function B7(e){var t=0;if(e[t++]!==71||e[t++]!==73||e[t++]!==70||e[t++]!==56||(e[t++]+1&253)!=56||e[t++]!==97)throw new Error("Invalid GIF 87a/89a header.");var n=e[t++]|e[t++]<<8,i=e[t++]|e[t++]<<8,s=e[t++],o=s>>7,l=1<<(7&s)+1;e[t++],e[t++];var u=null,f=null;o&&(u=t,f=l,t+=3*l);var d=!0,m=[],g=0,x=null,v=0,A=null;for(this.width=n,this.height=i;d&&t<e.length;)switch(e[t++]){case 33:switch(e[t++]){case 255:if(e[t]!==11||e[t+1]==78&&e[t+2]==69&&e[t+3]==84&&e[t+4]==83&&e[t+5]==67&&e[t+6]==65&&e[t+7]==80&&e[t+8]==69&&e[t+9]==50&&e[t+10]==46&&e[t+11]==48&&e[t+12]==3&&e[t+13]==1&&e[t+16]==0)t+=14,A=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!((D=e[t++])>=0))throw Error("Invalid block size");if(D===0)break;t+=D}break;case 249:if(e[t++]!==4||e[t+4]!==0)throw new Error("Invalid graphics extension block.");var N=e[t++];g=e[t++]|e[t++]<<8,x=e[t++],(1&N)==0&&(x=null),v=N>>2&7,t++;break;case 254:for(;;){if(!((D=e[t++])>=0))throw Error("Invalid block size");if(D===0)break;t+=D}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var E=e[t++]|e[t++]<<8,j=e[t++]|e[t++]<<8,C=e[t++]|e[t++]<<8,z=e[t++]|e[t++]<<8,Z=e[t++],I=Z>>6&1,st=1<<(7&Z)+1,K=u,H=f,G=!1;Z>>7&&(G=!0,K=t,H=st,t+=3*st);var Q=t;for(t++;;){var D;if(!((D=e[t++])>=0))throw Error("Invalid block size");if(D===0)break;t+=D}m.push({x:E,y:j,width:C,height:z,has_local_palette:G,palette_offset:K,palette_size:H,data_offset:Q,data_length:t-Q,transparent_index:x,interlaced:!!I,delay:g,disposal:v});break;case 59:d=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return m.length},this.loopCount=function(){return A},this.frameInfo=function(R){if(R<0||R>=m.length)throw new Error("Frame index out of range.");return m[R]},this.decodeAndBlitFrameBGRA=function(R,et){var nt=this.frameInfo(R),dt=nt.width*nt.height,W=new Uint8Array(dt);ay(e,nt.data_offset,W,dt);var lt=nt.palette_offset,ut=nt.transparent_index;ut===null&&(ut=256);var wt=nt.width,Y=n-wt,gt=wt,O=4*(nt.y*n+nt.x),q=4*((nt.y+nt.height)*n+nt.x),$=O,rt=4*Y;nt.interlaced===!0&&(rt+=4*n*7);for(var at=8,At=0,St=W.length;At<St;++At){var Tt=W[At];if(gt===0&&(gt=wt,($+=rt)>=q&&(rt=4*Y+4*n*(at-1),$=O+(wt+Y)*(at<<1),at>>=1)),Tt===ut)$+=4;else{var Zt=e[lt+3*Tt],Qt=e[lt+3*Tt+1],ne=e[lt+3*Tt+2];et[$++]=ne,et[$++]=Qt,et[$++]=Zt,et[$++]=255}--gt}},this.decodeAndBlitFrameRGBA=function(R,et){var nt=this.frameInfo(R),dt=nt.width*nt.height,W=new Uint8Array(dt);ay(e,nt.data_offset,W,dt);var lt=nt.palette_offset,ut=nt.transparent_index;ut===null&&(ut=256);var wt=nt.width,Y=n-wt,gt=wt,O=4*(nt.y*n+nt.x),q=4*((nt.y+nt.height)*n+nt.x),$=O,rt=4*Y;nt.interlaced===!0&&(rt+=4*n*7);for(var at=8,At=0,St=W.length;At<St;++At){var Tt=W[At];if(gt===0&&(gt=wt,($+=rt)>=q&&(rt=4*Y+4*n*(at-1),$=O+(wt+Y)*(at<<1),at>>=1)),Tt===ut)$+=4;else{var Zt=e[lt+3*Tt],Qt=e[lt+3*Tt+1],ne=e[lt+3*Tt+2];et[$++]=Zt,et[$++]=Qt,et[$++]=ne,et[$++]=255}--gt}}}function ay(e,t,n,i){for(var s=e[t++],o=1<<s,l=o+1,u=l+1,f=s+1,d=(1<<f)-1,m=0,g=0,x=0,v=e[t++],A=new Int32Array(4096),N=null;;){for(;m<16&&v!==0;)g|=e[t++]<<m,m+=8,v===1?v=e[t++]:--v;if(m<f)break;var E=g&d;if(g>>=f,m-=f,E!==o){if(E===l)break;for(var j=E<u?E:N,C=0,z=j;z>o;)z=A[z]>>8,++C;var Z=z;if(x+C+(j!==E?1:0)>i)return void Mn.log("Warning, gif stream longer than expected.");n[x++]=Z;var I=x+=C;for(j!==E&&(n[x++]=Z),z=j;C--;)z=A[z],n[--I]=255&z,z>>=8;N!==null&&u<4096&&(A[u++]=N<<8|Z,u>=d+1&&f<12&&(++f,d=d<<1|1)),N=E}else u=l+1,d=(1<<(f=s+1))-1,N=null}return x!==i&&Mn.log("Warning, gif stream shorter than expected."),n}/**
* @license
Copyright (c) 2008, Adobe Systems Incorporated
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Adobe Systems Incorporated nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/function Ag(e){var t,n,i,s,o,l=Math.floor,u=new Array(64),f=new Array(64),d=new Array(64),m=new Array(64),g=new Array(65535),x=new Array(65535),v=new Array(64),A=new Array(64),N=[],E=0,j=7,C=new Array(64),z=new Array(64),Z=new Array(64),I=new Array(256),st=new Array(2048),K=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],H=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],G=[0,1,2,3,4,5,6,7,8,9,10,11],Q=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],D=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],R=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],et=[0,1,2,3,4,5,6,7,8,9,10,11],nt=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],dt=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function W(O,q){for(var $=0,rt=0,at=new Array,At=1;At<=16;At++){for(var St=1;St<=O[At];St++)at[q[rt]]=[],at[q[rt]][0]=$,at[q[rt]][1]=At,rt++,$++;$*=2}return at}function lt(O){for(var q=O[0],$=O[1]-1;$>=0;)q&1<<$&&(E|=1<<j),$--,--j<0&&(E==255?(ut(255),ut(0)):ut(E),j=7,E=0)}function ut(O){N.push(O)}function wt(O){ut(O>>8&255),ut(255&O)}function Y(O,q,$,rt,at){for(var At,St=at[0],Tt=at[240],Zt=function(Xt,J){var ht,mt,Pt,qt,Ft,Kt,re,fe,oe,Se,ee=0;for(oe=0;oe<8;++oe){ht=Xt[ee],mt=Xt[ee+1],Pt=Xt[ee+2],qt=Xt[ee+3],Ft=Xt[ee+4],Kt=Xt[ee+5],re=Xt[ee+6];var En=ht+(fe=Xt[ee+7]),Pe=ht-fe,ei=mt+re,Ue=mt-re,Qe=Pt+Kt,vi=Pt-Kt,He=qt+Ft,ji=qt-Ft,jn=En+He,Wi=En-He,ki=ei+Qe,Tn=ei-Qe;Xt[ee]=jn+ki,Xt[ee+4]=jn-ki;var te=.707106781*(Tn+Wi);Xt[ee+2]=Wi+te,Xt[ee+6]=Wi-te;var _e=.382683433*((jn=ji+vi)-(Tn=Ue+Pe)),Sn=.5411961*jn+_e,Je=1.306562965*Tn+_e,Pi=.707106781*(ki=vi+Ue),dn=Pe+Pi,ue=Pe-Pi;Xt[ee+5]=ue+Sn,Xt[ee+3]=ue-Sn,Xt[ee+1]=dn+Je,Xt[ee+7]=dn-Je,ee+=8}for(ee=0,oe=0;oe<8;++oe){ht=Xt[ee],mt=Xt[ee+8],Pt=Xt[ee+16],qt=Xt[ee+24],Ft=Xt[ee+32],Kt=Xt[ee+40],re=Xt[ee+48];var sn=ht+(fe=Xt[ee+56]),We=ht-fe,rn=mt+re,Dn=mt-re,pn=Pt+Kt,ea=Pt-Kt,ao=qt+Ft,va=qt-Ft,xa=sn+ao,Bi=sn-ao,zi=rn+pn,na=rn-pn;Xt[ee]=xa+zi,Xt[ee+32]=xa-zi;var Ti=.707106781*(na+Bi);Xt[ee+16]=Bi+Ti,Xt[ee+48]=Bi-Ti;var gn=.382683433*((xa=va+ea)-(na=Dn+We)),pr=.5411961*xa+gn,so=1.306562965*na+gn,Ta=.707106781*(zi=ea+Dn),Wa=We+Ta,Go=We-Ta;Xt[ee+40]=Go+pr,Xt[ee+24]=Go-pr,Xt[ee+8]=Wa+so,Xt[ee+56]=Wa-so,ee++}for(oe=0;oe<64;++oe)Se=Xt[oe]*J[oe],v[oe]=Se>0?Se+.5|0:Se-.5|0;return v}(O,q),Qt=0;Qt<64;++Qt)A[K[Qt]]=Zt[Qt];var ne=A[0]-$;$=A[0],ne==0?lt(rt[0]):(lt(rt[x[At=32767+ne]]),lt(g[At]));for(var ie=63;ie>0&&A[ie]==0;)ie--;if(ie==0)return lt(St),$;for(var ye,Bt=1;Bt<=ie;){for(var ct=Bt;A[Bt]==0&&Bt<=ie;)++Bt;var me=Bt-ct;if(me>=16){ye=me>>4;for(var he=1;he<=ye;++he)lt(Tt);me&=15}At=32767+A[Bt],lt(at[(me<<4)+x[At]]),lt(g[At]),Bt++}return ie!=63&<(St),$}function gt(O){O=Math.min(Math.max(O,1),100),o!=O&&(function(q){for(var $=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],rt=0;rt<64;rt++){var at=l(($[rt]*q+50)/100);at=Math.min(Math.max(at,1),255),u[K[rt]]=at}for(var At=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],St=0;St<64;St++){var Tt=l((At[St]*q+50)/100);Tt=Math.min(Math.max(Tt,1),255),f[K[St]]=Tt}for(var Zt=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Qt=0,ne=0;ne<8;ne++)for(var ie=0;ie<8;ie++)d[Qt]=1/(u[K[Qt]]*Zt[ne]*Zt[ie]*8),m[Qt]=1/(f[K[Qt]]*Zt[ne]*Zt[ie]*8),Qt++}(O<50?Math.floor(5e3/O):Math.floor(200-2*O)),o=O)}this.encode=function(O,q){q&>(q),N=new Array,E=0,j=7,wt(65496),wt(65504),wt(16),ut(74),ut(70),ut(73),ut(70),ut(0),ut(1),ut(1),ut(0),wt(1),wt(1),ut(0),ut(0),function(){wt(65499),wt(132),ut(0);for(var mt=0;mt<64;mt++)ut(u[mt]);ut(1);for(var Pt=0;Pt<64;Pt++)ut(f[Pt])}(),function(mt,Pt){wt(65472),wt(17),ut(8),wt(Pt),wt(mt),ut(3),ut(1),ut(17),ut(0),ut(2),ut(17),ut(1),ut(3),ut(17),ut(1)}(O.width,O.height),function(){wt(65476),wt(418),ut(0);for(var mt=0;mt<16;mt++)ut(H[mt+1]);for(var Pt=0;Pt<=11;Pt++)ut(G[Pt]);ut(16);for(var qt=0;qt<16;qt++)ut(Q[qt+1]);for(var Ft=0;Ft<=161;Ft++)ut(D[Ft]);ut(1);for(var Kt=0;Kt<16;Kt++)ut(R[Kt+1]);for(var re=0;re<=11;re++)ut(et[re]);ut(17);for(var fe=0;fe<16;fe++)ut(nt[fe+1]);for(var oe=0;oe<=161;oe++)ut(dt[oe])}(),wt(65498),wt(12),ut(3),ut(1),ut(0),ut(2),ut(17),ut(3),ut(17),ut(0),ut(63),ut(0);var $=0,rt=0,at=0;E=0,j=7,this.encode.displayName="_encode_";for(var At,St,Tt,Zt,Qt,ne,ie,ye,Bt,ct=O.data,me=O.width,he=O.height,Xt=4*me,J=0;J<he;){for(At=0;At<Xt;){for(Qt=Xt*J+At,ie=-1,ye=0,Bt=0;Bt<64;Bt++)ne=Qt+(ye=Bt>>3)*Xt+(ie=4*(7&Bt)),J+ye>=he&&(ne-=Xt*(J+1+ye-he)),At+ie>=Xt&&(ne-=At+ie-Xt+4),St=ct[ne++],Tt=ct[ne++],Zt=ct[ne++],C[Bt]=(st[St]+st[Tt+256>>0]+st[Zt+512>>0]>>16)-128,z[Bt]=(st[St+768>>0]+st[Tt+1024>>0]+st[Zt+1280>>0]>>16)-128,Z[Bt]=(st[St+1280>>0]+st[Tt+1536>>0]+st[Zt+1792>>0]>>16)-128;$=Y(C,d,$,t,i),rt=Y(z,m,rt,n,s),at=Y(Z,m,at,n,s),At+=32}J+=8}if(j>=0){var ht=[];ht[1]=j+1,ht[0]=(1<<j+1)-1,lt(ht)}return wt(65497),new Uint8Array(N)},e=e||50,function(){for(var O=String.fromCharCode,q=0;q<256;q++)I[q]=O(q)}(),t=W(H,G),n=W(R,et),i=W(Q,D),s=W(nt,dt),function(){for(var O=1,q=2,$=1;$<=15;$++){for(var rt=O;rt<q;rt++)x[32767+rt]=$,g[32767+rt]=[],g[32767+rt][1]=$,g[32767+rt][0]=rt;for(var at=-(q-1);at<=-O;at++)x[32767+at]=$,g[32767+at]=[],g[32767+at][1]=$,g[32767+at][0]=q-1+at;O<<=1,q<<=1}}(),function(){for(var O=0;O<256;O++)st[O]=19595*O,st[O+256>>0]=38470*O,st[O+512>>0]=7471*O+32768,st[O+768>>0]=-11059*O,st[O+1024>>0]=-21709*O,st[O+1280>>0]=32768*O+8421375,st[O+1536>>0]=-27439*O,st[O+1792>>0]=-5329*O}(),gt(e)}/**
* @license
* Copyright (c) 2017 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/function ir(e,t){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!t,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function sy(e){function t(H){if(!H)throw Error("assert :P")}function n(H,G,Q){for(var D=0;4>D;D++)if(H[G+D]!=Q.charCodeAt(D))return!0;return!1}function i(H,G,Q,D,R){for(var et=0;et<R;et++)H[G+et]=Q[D+et]}function s(H,G,Q,D){for(var R=0;R<D;R++)H[G+R]=Q}function o(H){return new Int32Array(H)}function l(H,G){for(var Q=[],D=0;D<H;D++)Q.push(new G);return Q}function u(H,G){var Q=[];return function D(R,et,nt){for(var dt=nt[et],W=0;W<dt&&(R.push(nt.length>et+1?[]:new G),!(nt.length<et+1));W++)D(R[W],et+1,nt)}(Q,0,H),Q}var f=function(){var H=this;function G(p,y){for(var S=1<<y-1>>>0;p&S;)S>>>=1;return S?(p&S-1)+S:p}function Q(p,y,S,T,k){t(!(T%S));do p[y+(T-=S)]=k;while(0<T)}function D(p,y,S,T,k){if(t(2328>=k),512>=k)var B=o(512);else if((B=o(k))==null)return 0;return function(F,U,X,tt,bt,Ct){var Et,_t,Yt=U,Rt=1<<X,yt=o(16),xt=o(16);for(t(bt!=0),t(tt!=null),t(F!=null),t(0<X),_t=0;_t<bt;++_t){if(15<tt[_t])return 0;++yt[tt[_t]]}if(yt[0]==bt)return 0;for(xt[1]=0,Et=1;15>Et;++Et){if(yt[Et]>1<<Et)return 0;xt[Et+1]=xt[Et]+yt[Et]}for(_t=0;_t<bt;++_t)Et=tt[_t],0<tt[_t]&&(Ct[xt[Et]++]=_t);if(xt[15]==1)return(tt=new R).g=0,tt.value=Ct[0],Q(F,Yt,1,Rt,tt),Rt;var Ut,Gt=-1,Ht=Rt-1,ce=0,ae=1,ve=1,se=1<<X;for(_t=0,Et=1,bt=2;Et<=X;++Et,bt<<=1){if(ae+=ve<<=1,0>(ve-=yt[Et]))return 0;for(;0<yt[Et];--yt[Et])(tt=new R).g=Et,tt.value=Ct[_t++],Q(F,Yt+ce,bt,se,tt),ce=G(ce,Et)}for(Et=X+1,bt=2;15>=Et;++Et,bt<<=1){if(ae+=ve<<=1,0>(ve-=yt[Et]))return 0;for(;0<yt[Et];--yt[Et]){if(tt=new R,(ce&Ht)!=Gt){for(Yt+=se,Ut=1<<(Gt=Et)-X;15>Gt&&!(0>=(Ut-=yt[Gt]));)++Gt,Ut<<=1;Rt+=se=1<<(Ut=Gt-X),F[U+(Gt=ce&Ht)].g=Ut+X,F[U+Gt].value=Yt-U-Gt}tt.g=Et-X,tt.value=Ct[_t++],Q(F,Yt+(ce>>X),bt,se,tt),ce=G(ce,Et)}}return ae!=2*xt[15]-1?0:Rt}(p,y,S,T,k,B)}function R(){this.value=this.g=0}function et(){this.value=this.g=0}function nt(){this.G=l(5,R),this.H=o(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=l(li,et)}function dt(p,y,S,T){t(p!=null),t(y!=null),t(2147483648>T),p.Ca=254,p.I=0,p.b=-8,p.Ka=0,p.oa=y,p.pa=S,p.Jd=y,p.Yc=S+T,p.Zc=4<=T?S+T-4+1:S,At(p)}function W(p,y){for(var S=0;0<y--;)S|=Tt(p,128)<<y;return S}function lt(p,y){var S=W(p,y);return St(p)?-S:S}function ut(p,y,S,T){var k,B=0;for(t(p!=null),t(y!=null),t(4294967288>T),p.Sb=T,p.Ra=0,p.u=0,p.h=0,4<T&&(T=4),k=0;k<T;++k)B+=y[S+k]<<8*k;p.Ra=B,p.bb=T,p.oa=y,p.pa=S}function wt(p){for(;8<=p.u&&p.bb<p.Sb;)p.Ra>>>=8,p.Ra+=p.oa[p.pa+p.bb]<<mo-8>>>0,++p.bb,p.u-=8;$(p)&&(p.h=1,p.u=0)}function Y(p,y){if(t(0<=y),!p.h&&y<=po){var S=q(p)&Ar[y];return p.u+=y,wt(p),S}return p.h=1,p.u=0}function gt(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function O(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function q(p){return p.Ra>>>(p.u&mo-1)>>>0}function $(p){return t(p.bb<=p.Sb),p.h||p.bb==p.Sb&&p.u>mo}function rt(p,y){p.u=y,p.h=$(p)}function at(p){p.u>=ll&&(t(p.u>=ll),wt(p))}function At(p){t(p!=null&&p.oa!=null),p.pa<p.Zc?(p.I=(p.oa[p.pa++]|p.I<<8)>>>0,p.b+=8):(t(p!=null&&p.oa!=null),p.pa<p.Yc?(p.b+=8,p.I=p.oa[p.pa++]|p.I<<8):p.Ka?p.b=0:(p.I<<=8,p.b+=8,p.Ka=1))}function St(p){return W(p,1)}function Tt(p,y){var S=p.Ca;0>p.b&&At(p);var T=p.b,k=S*y>>>8,B=(p.I>>>T>k)+0;for(B?(S-=k,p.I-=k+1<<T>>>0):S=k+1,T=S,k=0;256<=T;)k+=8,T>>=8;return T=7^k+sa[T],p.b-=T,p.Ca=(S<<T)-1,B}function Zt(p,y,S){p[y+0]=S>>24&255,p[y+1]=S>>16&255,p[y+2]=S>>8&255,p[y+3]=S>>0&255}function Qt(p,y){return p[y+0]<<0|p[y+1]<<8}function ne(p,y){return Qt(p,y)|p[y+2]<<16}function ie(p,y){return Qt(p,y)|Qt(p,y+2)<<16}function ye(p,y){var S=1<<y;return t(p!=null),t(0<y),p.X=o(S),p.X==null?0:(p.Mb=32-y,p.Xa=y,1)}function Bt(p,y){t(p!=null),t(y!=null),t(p.Xa==y.Xa),i(y.X,0,p.X,0,1<<y.Xa)}function ct(){this.X=[],this.Xa=this.Mb=0}function me(p,y,S,T){t(S!=null),t(T!=null);var k=S[0],B=T[0];return k==0&&(k=(p*B+y/2)/y),B==0&&(B=(y*k+p/2)/p),0>=k||0>=B?0:(S[0]=k,T[0]=B,1)}function he(p,y){return p+(1<<y)-1>>>y}function Xt(p,y){return((4278255360&p)+(4278255360&y)>>>0&4278255360)+((16711935&p)+(16711935&y)>>>0&16711935)>>>0}function J(p,y){H[y]=function(S,T,k,B,F,U,X){var tt;for(tt=0;tt<F;++tt){var bt=H[p](U[X+tt-1],k,B+tt);U[X+tt]=Xt(S[T+tt],bt)}}}function ht(){this.ud=this.hd=this.jd=0}function mt(p,y){return((4278124286&(p^y))>>>1)+(p&y)>>>0}function Pt(p){return 0<=p&&256>p?p:0>p?0:255<p?255:void 0}function qt(p,y){return Pt(p+(p-y+.5>>1))}function Ft(p,y,S){return Math.abs(y-S)-Math.abs(p-S)}function Kt(p,y,S,T,k,B,F){for(T=B[F-1],S=0;S<k;++S)B[F+S]=T=Xt(p[y+S],T)}function re(p,y,S,T,k){var B;for(B=0;B<S;++B){var F=p[y+B],U=F>>8&255,X=16711935&(X=(X=16711935&F)+((U<<16)+U));T[k+B]=(4278255360&F)+X>>>0}}function fe(p,y){y.jd=p>>0&255,y.hd=p>>8&255,y.ud=p>>16&255}function oe(p,y,S,T,k,B){var F;for(F=0;F<T;++F){var U=y[S+F],X=U>>>8,tt=U,bt=255&(bt=(bt=U>>>16)+((p.jd<<24>>24)*(X<<24>>24)>>>5));tt=255&(tt=(tt=tt+((p.hd<<24>>24)*(X<<24>>24)>>>5))+((p.ud<<24>>24)*(bt<<24>>24)>>>5)),k[B+F]=(4278255360&U)+(bt<<16)+tt}}function Se(p,y,S,T,k){H[y]=function(B,F,U,X,tt,bt,Ct,Et,_t){for(X=Ct;X<Et;++X)for(Ct=0;Ct<_t;++Ct)tt[bt++]=k(U[T(B[F++])])},H[p]=function(B,F,U,X,tt,bt,Ct){var Et=8>>B.b,_t=B.Ea,Yt=B.K[0],Rt=B.w;if(8>Et)for(B=(1<<B.b)-1,Rt=(1<<Et)-1;F<U;++F){var yt,xt=0;for(yt=0;yt<_t;++yt)yt&B||(xt=T(X[tt++])),bt[Ct++]=k(Yt[xt&Rt]),xt>>=Et}else H["VP8LMapColor"+S](X,tt,Yt,Rt,bt,Ct,F,U,_t)}}function ee(p,y,S,T,k){for(S=y+S;y<S;){var B=p[y++];T[k++]=B>>16&255,T[k++]=B>>8&255,T[k++]=B>>0&255}}function En(p,y,S,T,k){for(S=y+S;y<S;){var B=p[y++];T[k++]=B>>16&255,T[k++]=B>>8&255,T[k++]=B>>0&255,T[k++]=B>>24&255}}function Pe(p,y,S,T,k){for(S=y+S;y<S;){var B=(F=p[y++])>>16&240|F>>12&15,F=F>>0&240|F>>28&15;T[k++]=B,T[k++]=F}}function ei(p,y,S,T,k){for(S=y+S;y<S;){var B=(F=p[y++])>>16&248|F>>13&7,F=F>>5&224|F>>3&31;T[k++]=B,T[k++]=F}}function Ue(p,y,S,T,k){for(S=y+S;y<S;){var B=p[y++];T[k++]=B>>0&255,T[k++]=B>>8&255,T[k++]=B>>16&255}}function Qe(p,y,S,T,k,B){if(B==0)for(S=y+S;y<S;)Zt(T,((B=p[y++])[0]>>24|B[1]>>8&65280|B[2]<<8&16711680|B[3]<<24)>>>0),k+=32;else i(T,k,p,y,S)}function vi(p,y){H[y][0]=H[p+"0"],H[y][1]=H[p+"1"],H[y][2]=H[p+"2"],H[y][3]=H[p+"3"],H[y][4]=H[p+"4"],H[y][5]=H[p+"5"],H[y][6]=H[p+"6"],H[y][7]=H[p+"7"],H[y][8]=H[p+"8"],H[y][9]=H[p+"9"],H[y][10]=H[p+"10"],H[y][11]=H[p+"11"],H[y][12]=H[p+"12"],H[y][13]=H[p+"13"],H[y][14]=H[p+"0"],H[y][15]=H[p+"0"]}function He(p){return p==uc||p==kr||p==Vs||p==hl}function ji(){this.eb=[],this.size=this.A=this.fb=0}function jn(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function Wi(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new ji,this.f.kb=new jn,this.sd=null}function ki(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Tn(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function te(p){return alert("todo:WebPSamplerProcessPlane"),p.T}function _e(p,y){var S=p.T,T=y.ba.f.RGBA,k=T.eb,B=T.fb+p.ka*T.A,F=Ni[y.ba.S],U=p.y,X=p.O,tt=p.f,bt=p.N,Ct=p.ea,Et=p.W,_t=y.cc,Yt=y.dc,Rt=y.Mc,yt=y.Nc,xt=p.ka,Ut=p.ka+p.T,Gt=p.U,Ht=Gt+1>>1;for(xt==0?F(U,X,null,null,tt,bt,Ct,Et,tt,bt,Ct,Et,k,B,null,null,Gt):(F(y.ec,y.fc,U,X,_t,Yt,Rt,yt,tt,bt,Ct,Et,k,B-T.A,k,B,Gt),++S);xt+2<Ut;xt+=2)_t=tt,Yt=bt,Rt=Ct,yt=Et,bt+=p.Rc,Et+=p.Rc,B+=2*T.A,F(U,(X+=2*p.fa)-p.fa,U,X,_t,Yt,Rt,yt,tt,bt,Ct,Et,k,B-T.A,k,B,Gt);return X+=p.fa,p.j+Ut<p.o?(i(y.ec,y.fc,U,X,Gt),i(y.cc,y.dc,tt,bt,Ht),i(y.Mc,y.Nc,Ct,Et,Ht),S--):1&Ut||F(U,X,null,null,tt,bt,Ct,Et,tt,bt,Ct,Et,k,B+T.A,null,null,Gt),S}function Sn(p,y,S){var T=p.F,k=[p.J];if(T!=null){var B=p.U,F=y.ba.S,U=F==xo||F==Vs;y=y.ba.f.RGBA;var X=[0],tt=p.ka;X[0]=p.T,p.Kb&&(tt==0?--X[0]:(--tt,k[0]-=p.width),p.j+p.ka+p.T==p.o&&(X[0]=p.o-p.j-tt));var bt=y.eb;tt=y.fb+tt*y.A,p=Ye(T,k[0],p.width,B,X,bt,tt+(U?0:3),y.A),t(S==X),p&&He(F)&&Na(bt,tt,U,B,X,y.A)}return 0}function Je(p){var y=p.ma,S=y.ba.S,T=11>S,k=S==fl||S==cc||S==xo||S==Hs||S==12||He(S);if(y.memory=null,y.Ib=null,y.Jb=null,y.Nd=null,!Nr(y.Oa,p,k?11:12))return 0;if(k&&He(S)&&$t(),p.da)alert("todo:use_scaling");else{if(T){if(y.Ib=te,p.Kb){if(S=p.U+1>>1,y.memory=o(p.U+2*S),y.memory==null)return 0;y.ec=y.memory,y.fc=0,y.cc=y.ec,y.dc=y.fc+p.U,y.Mc=y.cc,y.Nc=y.dc+S,y.Ib=_e,$t()}}else alert("todo:EmitYUV");k&&(y.Jb=Sn,T&&Lt())}if(T&&!Fh){for(p=0;256>p;++p)Gp[p]=89858*(p-128)+ui>>ws,dc[p]=-22014*(p-128)+ui,hf[p]=-45773*(p-128),fi[p]=113618*(p-128)+ui>>ws;for(p=zr;p<uu;++p)y=76283*(p-16)+ui>>ws,pc[p-zr]=Sa(y,255),df[p-zr]=Sa(y+8>>4,15);Fh=1}return 1}function Pi(p){var y=p.ma,S=p.U,T=p.T;return t(!(1&p.ka)),0>=S||0>=T?0:(S=y.Ib(p,y),y.Jb!=null&&y.Jb(p,y,S),y.Dc+=S,1)}function dn(p){p.ma.memory=null}function ue(p,y,S,T){return Y(p,8)!=47?0:(y[0]=Y(p,14)+1,S[0]=Y(p,14)+1,T[0]=Y(p,1),Y(p,3)!=0?0:!p.h)}function sn(p,y){if(4>p)return p+1;var S=p-2>>1;return(2+(1&p)<<S)+Y(y,S)+1}function We(p,y){return 120<y?y-120:1<=(S=((S=Gs[y-1])>>4)*p+(8-(15&S)))?S:1;var S}function rn(p,y,S){var T=q(S),k=p[y+=255&T].g-8;return 0<k&&(rt(S,S.u+8),T=q(S),y+=p[y].value,y+=T&(1<<k)-1),rt(S,S.u+p[y].g),p[y].value}function Dn(p,y,S){return S.g+=p.g,S.value+=p.value<<y>>>0,t(8>=S.g),p.g}function pn(p,y,S){var T=p.xc;return t((y=T==0?0:p.vc[p.md*(S>>T)+(y>>T)])<p.Wb),p.Ya[y]}function ea(p,y,S,T){var k=p.ab,B=p.c*y,F=p.C;y=F+y;var U=S,X=T;for(T=p.Ta,S=p.Ua;0<k--;){var tt=p.gc[k],bt=F,Ct=y,Et=U,_t=X,Yt=(X=T,U=S,tt.Ea);switch(t(bt<Ct),t(Ct<=tt.nc),tt.hc){case 2:iu(Et,_t,(Ct-bt)*Yt,X,U);break;case 0:var Rt=bt,yt=Ct,xt=X,Ut=U,Gt=(se=tt).Ea;Rt==0&&(uf(Et,_t,null,null,1,xt,Ut),Kt(Et,_t+1,0,0,Gt-1,xt,Ut+1),_t+=Gt,Ut+=Gt,++Rt);for(var Ht=1<<se.b,ce=Ht-1,ae=he(Gt,se.b),ve=se.K,se=se.w+(Rt>>se.b)*ae;Rt<yt;){var en=ve,ln=se,Ie=1;for(oc(Et,_t,xt,Ut-Gt,1,xt,Ut);Ie<Gt;){var Fe=(Ie&~ce)+Ht;Fe>Gt&&(Fe=Gt),(0,qs[en[ln++]>>8&15])(Et,_t+ +Ie,xt,Ut+Ie-Gt,Fe-Ie,xt,Ut+Ie),Ie=Fe}_t+=Gt,Ut+=Gt,++Rt&ce||(se+=ae)}Ct!=tt.nc&&i(X,U-Yt,X,U+(Ct-bt-1)*Yt,Yt);break;case 1:for(Yt=Et,yt=_t,Gt=(Et=tt.Ea)-(Ut=Et&~(xt=(_t=1<<tt.b)-1)),Rt=he(Et,tt.b),Ht=tt.K,tt=tt.w+(bt>>tt.b)*Rt;bt<Ct;){for(ce=Ht,ae=tt,ve=new ht,se=yt+Ut,en=yt+Et;yt<se;)fe(ce[ae++],ve),Er(ve,Yt,yt,_t,X,U),yt+=_t,U+=_t;yt<en&&(fe(ce[ae++],ve),Er(ve,Yt,yt,Gt,X,U),yt+=Gt,U+=Gt),++bt&xt||(tt+=Rt)}break;case 3:if(Et==X&&_t==U&&0<tt.b){for(yt=X,Et=Yt=U+(Ct-bt)*Yt-(Ut=(Ct-bt)*he(tt.Ea,tt.b)),_t=X,xt=U,Rt=[],Ut=(Gt=Ut)-1;0<=Ut;--Ut)Rt[Ut]=_t[xt+Ut];for(Ut=Gt-1;0<=Ut;--Ut)yt[Et+Ut]=Rt[Ut];Ma(tt,bt,Ct,X,Yt,X,U)}else Ma(tt,bt,Ct,Et,_t,X,U)}U=T,X=S}X!=S&&i(T,S,U,X,B)}function ao(p,y){var S=p.V,T=p.Ba+p.c*p.C,k=y-p.C;if(t(y<=p.l.o),t(16>=k),0<k){var B=p.l,F=p.Ta,U=p.Ua,X=B.width;if(ea(p,k,S,T),k=U=[U],t((S=p.C)<(T=y)),t(B.v<B.va),T>B.o&&(T=B.o),S<B.j){var tt=B.j-S;S=B.j,k[0]+=tt*X}if(S>=T?S=0:(k[0]+=4*B.v,B.ka=S-B.j,B.U=B.va-B.v,B.T=T-S,S=1),S){if(U=U[0],11>(S=p.ca).S){var bt=S.f.RGBA,Ct=(T=S.S,k=B.U,B=B.T,tt=bt.eb,bt.A),Et=B;for(bt=bt.fb+p.Ma*bt.A;0<Et--;){var _t=F,Yt=U,Rt=k,yt=tt,xt=bt;switch(T){case qi:Ki(_t,Yt,Rt,yt,xt);break;case fl:Ci(_t,Yt,Rt,yt,xt);break;case uc:Ci(_t,Yt,Rt,yt,xt),Na(yt,xt,0,Rt,1,0);break;case bs:Qa(_t,Yt,Rt,yt,xt);break;case cc:Qe(_t,Yt,Rt,yt,xt,1);break;case kr:Qe(_t,Yt,Rt,yt,xt,1),Na(yt,xt,0,Rt,1,0);break;case xo:Qe(_t,Yt,Rt,yt,xt,0);break;case Vs:Qe(_t,Yt,Rt,yt,xt,0),Na(yt,xt,1,Rt,1,0);break;case Hs:jr(_t,Yt,Rt,yt,xt);break;case hl:jr(_t,Yt,Rt,yt,xt),Ve(yt,xt,Rt,1,0);break;case su:ra(_t,Yt,Rt,yt,xt);break;default:t(0)}U+=X,bt+=Ct}p.Ma+=B}else alert("todo:EmitRescaledRowsYUVA");t(p.Ma<=S.height)}}p.C=y,t(p.C<=p.i)}function va(p){var y;if(0<p.ua)return 0;for(y=0;y<p.Wb;++y){var S=p.Ya[y].G,T=p.Ya[y].H;if(0<S[1][T[1]+0].g||0<S[2][T[2]+0].g||0<S[3][T[3]+0].g)return 0}return 1}function xa(p,y,S,T,k,B){if(p.Z!=0){var F=p.qd,U=p.rd;for(t(vs[p.Z]!=null);y<S;++y)vs[p.Z](F,U,T,k,T,k,B),F=T,U=k,k+=B;p.qd=F,p.rd=U}}function Bi(p,y){var S=p.l.ma,T=S.Z==0||S.Z==1?p.l.j:p.C;if(T=p.C<T?T:p.C,t(y<=p.l.o),y>T){var k=p.l.width,B=S.ca,F=S.tb+k*T,U=p.V,X=p.Ba+p.c*T,tt=p.gc;t(p.ab==1),t(tt[0].hc==3),Lr(tt[0],T,y,U,X,B,F),xa(S,T,y,B,F,k)}p.C=p.Ma=y}function zi(p,y,S,T,k,B,F){var U=p.$/T,X=p.$%T,tt=p.m,bt=p.s,Ct=S+p.$,Et=Ct;k=S+T*k;var _t=S+T*B,Yt=280+bt.ua,Rt=p.Pb?U:16777216,yt=0<bt.ua?bt.Wa:null,xt=bt.wc,Ut=Ct<_t?pn(bt,X,U):null;t(p.C<B),t(_t<=k);var Gt=!1;t:for(;;){for(;Gt||Ct<_t;){var Ht=0;if(U>=Rt){var ce=Ct-S;t((Rt=p).Pb),Rt.wd=Rt.m,Rt.xd=ce,0<Rt.s.ua&&Bt(Rt.s.Wa,Rt.s.vb),Rt=U+Ph}if(X&xt||(Ut=pn(bt,X,U)),t(Ut!=null),Ut.Qb&&(y[Ct]=Ut.qb,Gt=!0),!Gt)if(at(tt),Ut.jc){Ht=tt,ce=y;var ae=Ct,ve=Ut.pd[q(Ht)&li-1];t(Ut.jc),256>ve.g?(rt(Ht,Ht.u+ve.g),ce[ae]=ve.value,Ht=0):(rt(Ht,Ht.u+ve.g-256),t(256<=ve.value),Ht=ve.value),Ht==0&&(Gt=!0)}else Ht=rn(Ut.G[0],Ut.H[0],tt);if(tt.h)break;if(Gt||256>Ht){if(!Gt)if(Ut.nd)y[Ct]=(Ut.qb|Ht<<8)>>>0;else{if(at(tt),Gt=rn(Ut.G[1],Ut.H[1],tt),at(tt),ce=rn(Ut.G[2],Ut.H[2],tt),ae=rn(Ut.G[3],Ut.H[3],tt),tt.h)break;y[Ct]=(ae<<24|Gt<<16|Ht<<8|ce)>>>0}if(Gt=!1,++Ct,++X>=T&&(X=0,++U,F!=null&&U<=B&&!(U%16)&&F(p,U),yt!=null))for(;Et<Ct;)Ht=y[Et++],yt.X[(506832829*Ht&4294967295)>>>yt.Mb]=Ht}else if(280>Ht){if(Ht=sn(Ht-256,tt),ce=rn(Ut.G[4],Ut.H[4],tt),at(tt),ce=We(T,ce=sn(ce,tt)),tt.h)break;if(Ct-S<ce||k-Ct<Ht)break t;for(ae=0;ae<Ht;++ae)y[Ct+ae]=y[Ct+ae-ce];for(Ct+=Ht,X+=Ht;X>=T;)X-=T,++U,F!=null&&U<=B&&!(U%16)&&F(p,U);if(t(Ct<=k),X&xt&&(Ut=pn(bt,X,U)),yt!=null)for(;Et<Ct;)Ht=y[Et++],yt.X[(506832829*Ht&4294967295)>>>yt.Mb]=Ht}else{if(!(Ht<Yt))break t;for(Gt=Ht-280,t(yt!=null);Et<Ct;)Ht=y[Et++],yt.X[(506832829*Ht&4294967295)>>>yt.Mb]=Ht;Ht=Ct,t(!(Gt>>>(ce=yt).Xa)),y[Ht]=ce.X[Gt],Gt=!0}Gt||t(tt.h==$(tt))}if(p.Pb&&tt.h&&Ct<k)t(p.m.h),p.a=5,p.m=p.wd,p.$=p.xd,0<p.s.ua&&Bt(p.s.vb,p.s.Wa);else{if(tt.h)break t;F?.(p,U>B?B:U),p.a=0,p.$=Ct-S}return 1}return p.a=3,0}function na(p){t(p!=null),p.vc=null,p.yc=null,p.Ya=null;var y=p.Wa;y!=null&&(y.X=null),p.vb=null,t(p!=null)}function Ti(){var p=new cf;return p==null?null:(p.a=0,p.xb=dl,vi("Predictor","VP8LPredictors"),vi("Predictor","VP8LPredictors_C"),vi("PredictorAdd","VP8LPredictorsAdd"),vi("PredictorAdd","VP8LPredictorsAdd_C"),iu=re,Er=oe,Ki=ee,Ci=En,jr=Pe,ra=ei,Qa=Ue,H.VP8LMapColor32b=_i,H.VP8LMapColor8b=lc,p)}function gn(p,y,S,T,k){var B=1,F=[p],U=[y],X=T.m,tt=T.s,bt=null,Ct=0;t:for(;;){if(S)for(;B&&Y(X,1);){var Et=F,_t=U,Yt=T,Rt=1,yt=Yt.m,xt=Yt.gc[Yt.ab],Ut=Y(yt,2);if(Yt.Oc&1<<Ut)B=0;else{switch(Yt.Oc|=1<<Ut,xt.hc=Ut,xt.Ea=Et[0],xt.nc=_t[0],xt.K=[null],++Yt.ab,t(4>=Yt.ab),Ut){case 0:case 1:xt.b=Y(yt,3)+2,Rt=gn(he(xt.Ea,xt.b),he(xt.nc,xt.b),0,Yt,xt.K),xt.K=xt.K[0];break;case 3:var Gt,Ht=Y(yt,8)+1,ce=16<Ht?0:4<Ht?1:2<Ht?2:3;if(Et[0]=he(xt.Ea,ce),xt.b=ce,Gt=Rt=gn(Ht,1,0,Yt,xt.K)){var ae,ve=Ht,se=xt,en=1<<(8>>se.b),ln=o(en);if(ln==null)Gt=0;else{var Ie=se.K[0],Fe=se.w;for(ln[0]=se.K[0][0],ae=1;ae<1*ve;++ae)ln[ae]=Xt(Ie[Fe+ae],ln[ae-1]);for(;ae<4*en;++ae)ln[ae]=0;se.K[0]=null,se.K[0]=ln,Gt=1}}Rt=Gt;break;case 2:break;default:t(0)}B=Rt}}if(F=F[0],U=U[0],B&&Y(X,1)&&!(B=1<=(Ct=Y(X,4))&&11>=Ct)){T.a=3;break t}var mn;if(mn=B)e:{var cn,Me,bn,we=T,Ee=F,tn=U,nn=Ct,Ai=S,hi=we.m,Qn=we.s,Jn=[null],ii=1,Pa=0,un=_o[nn];n:for(;;){if(Ai&&Y(hi,1)){var ai=Y(hi,3)+2,es=he(Ee,ai),Fr=he(tn,ai),Ao=es*Fr;if(!gn(es,Fr,0,we,Jn))break n;for(Jn=Jn[0],Qn.xc=ai,cn=0;cn<Ao;++cn){var qr=Jn[cn]>>8&65535;Jn[cn]=qr,qr>=ii&&(ii=qr+1)}}if(hi.h)break n;for(Me=0;5>Me;++Me){var kn=Aa[Me];!Me&&0<nn&&(kn+=1<<nn),Pa<kn&&(Pa=kn)}var mc=l(ii*un,R),fu=ii,Zi=l(fu,nt);if(Zi==null)var Fn=null;else t(65536>=fu),Fn=Zi;var Lo=o(Pa);if(Fn==null||Lo==null||mc==null){we.a=1;break n}var Ur=mc;for(cn=bn=0;cn<ii;++cn){var la=Fn[cn],Ir=la.G,ca=la.H,gc=0,ml=1,hu=0;for(Me=0;5>Me;++Me){kn=Aa[Me],Ir[Me]=Ur,ca[Me]=bn,!Me&&0<nn&&(kn+=1<<nn);a:{var bc,du=kn,yc=we,gl=Lo,Ih=Ur,Hh=bn,vc=0,$s=yc.m,Xp=Y($s,1);if(s(gl,0,0,du),Xp){var Vh=Y($s,1)+1,Yh=Y($s,1),pf=Y($s,Yh==0?1:8);gl[pf]=1,Vh==2&&(gl[pf=Y($s,8)]=1);var bl=1}else{var mf=o(19),gf=Y($s,4)+4;if(19<gf){yc.a=3;var xc=0;break a}for(bc=0;bc<gf;++bc)mf[Ys[bc]]=Y($s,3);var pu=void 0,yl=void 0,Gh=yc,Wh=mf,Zs=du,wc=gl,mu=0,ns=Gh.m,vl=8,bf=l(128,R);i:for(;D(bf,0,7,Wh,19);){if(Y(ns,1)){var Xh=2+2*Y(ns,3);if((pu=2+Y(ns,Xh))>Zs)break i}else pu=Zs;for(yl=0;yl<Zs&&pu--;){at(ns);var yf=bf[0+(127&q(ns))];rt(ns,ns.u+yf.g);var Eo=yf.value;if(16>Eo)wc[yl++]=Eo,Eo!=0&&(vl=Eo);else{var Kh=Eo==16,vf=Eo-16,xf=ka[vf],wf=Y(ns,ru[vf])+xf;if(yl+wf>Zs)break i;for(var $h=Kh?vl:0;0<wf--;)wc[yl++]=$h}}mu=1;break i}mu||(Gh.a=3),bl=mu}(bl=bl&&!$s.h)&&(vc=D(Ih,Hh,8,gl,du)),bl&&vc!=0?xc=vc:(yc.a=3,xc=0)}if(xc==0)break n;if(ml&&wo[Me]==1&&(ml=Ur[bn].g==0),gc+=Ur[bn].g,bn+=xc,3>=Me){var jo,gu=Lo[0];for(jo=1;jo<kn;++jo)Lo[jo]>gu&&(gu=Lo[jo]);hu+=gu}}if(la.nd=ml,la.Qb=0,ml&&(la.qb=(Ir[3][ca[3]+0].value<<24|Ir[1][ca[1]+0].value<<16|Ir[2][ca[2]+0].value)>>>0,gc==0&&256>Ir[0][ca[0]+0].value&&(la.Qb=1,la.qb+=Ir[0][ca[0]+0].value<<8)),la.jc=!la.Qb&&6>hu,la.jc){var _c,Qs=la;for(_c=0;_c<li;++_c){var _s=_c,Js=Qs.pd[_s],Sc=Qs.G[0][Qs.H[0]+_s];256<=Sc.value?(Js.g=Sc.g+256,Js.value=Sc.value):(Js.g=0,Js.value=0,_s>>=Dn(Sc,8,Js),_s>>=Dn(Qs.G[1][Qs.H[1]+_s],16,Js),_s>>=Dn(Qs.G[2][Qs.H[2]+_s],0,Js),Dn(Qs.G[3][Qs.H[3]+_s],24,Js))}}}Qn.vc=Jn,Qn.Wb=ii,Qn.Ya=Fn,Qn.yc=mc,mn=1;break e}mn=0}if(!(B=mn)){T.a=3;break t}if(0<Ct){if(tt.ua=1<<Ct,!ye(tt.Wa,Ct)){T.a=1,B=0;break t}}else tt.ua=0;var Nc=T,_f=F,Zh=U,Sf=Nc.s,Nf=Sf.xc;if(Nc.c=_f,Nc.i=Zh,Sf.md=he(_f,Nf),Sf.wc=Nf==0?-1:(1<<Nf)-1,S){T.xb=zh;break t}if((bt=o(F*U))==null){T.a=1,B=0;break t}B=(B=zi(T,bt,0,F,U,U,null))&&!X.h;break t}return B?(k!=null?k[0]=bt:(t(bt==null),t(S)),T.$=0,S||na(tt)):na(tt),B}function pr(p,y){var S=p.c*p.i,T=S+y+16*y;return t(p.c<=y),p.V=o(T),p.V==null?(p.Ta=null,p.Ua=0,p.a=1,0):(p.Ta=p.V,p.Ua=p.Ba+S+y,1)}function so(p,y){var S=p.C,T=y-S,k=p.V,B=p.Ba+p.c*S;for(t(y<=p.l.o);0<T;){var F=16<T?16:T,U=p.l.ma,X=p.l.width,tt=X*F,bt=U.ca,Ct=U.tb+X*S,Et=p.Ta,_t=p.Ua;ea(p,F,k,B),Nn(Et,_t,bt,Ct,tt),xa(U,S,S+F,bt,Ct,X),T-=F,k+=F*p.c,S+=F}t(S==y),p.C=p.Ma=y}function Ta(){this.ub=this.yd=this.td=this.Rb=0}function Wa(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Go(){this.Fb=this.Bb=this.Cb=0,this.Zb=o(4),this.Lb=o(4)}function Gl(){this.Yb=function(){var p=[];return function y(S,T,k){for(var B=k[T],F=0;F<B&&(S.push(k.length>T+1?[]:0),!(k.length<T+1));F++)y(S[F],T+1,k)}(p,0,[3,11]),p}()}function Gc(){this.jb=o(3),this.Wc=u([4,8],Gl),this.Xc=u([4,17],Gl)}function af(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new o(4),this.od=new o(4)}function Os(){this.ld=this.La=this.dd=this.tc=0}function ro(){this.Na=this.la=0}function Xa(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function oo(){this.ad=o(384),this.Za=0,this.Ob=o(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Wc(){this.uc=this.M=this.Nb=0,this.wa=Array(new Os),this.Y=0,this.ya=Array(new oo),this.aa=0,this.l=new mr}function Ms(){this.y=o(16),this.f=o(8),this.ea=o(8)}function Wl(){this.cb=this.a=0,this.sc="",this.m=new gt,this.Od=new Ta,this.Kc=new Wa,this.ed=new af,this.Qa=new Go,this.Ic=this.$c=this.Aa=0,this.D=new Wc,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=l(8,gt),this.ia=0,this.pb=l(4,Xa),this.Pa=new Gc,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Ms),this.Hd=0,this.rb=Array(new ro),this.sb=0,this.wa=Array(new Os),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new oo),this.L=this.aa=0,this.gd=u([4,2],Os),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function mr(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function sf(){var p=new Wl;return p!=null&&(p.a=0,p.sc="OK",p.cb=0,p.Xb=0,ci||(ci=Xc)),p}function In(p,y,S){return p.a==0&&(p.a=y,p.sc=S,p.cb=0),0}function Xi(p,y,S){return 3<=S&&p[y+0]==157&&p[y+1]==1&&p[y+2]==42}function Xl(p,y){if(p==null)return 0;if(p.a=0,p.sc="OK",y==null)return In(p,2,"null VP8Io passed to VP8GetHeaders()");var S=y.data,T=y.w,k=y.ha;if(4>k)return In(p,7,"Truncated header.");var B=S[T+0]|S[T+1]<<8|S[T+2]<<16,F=p.Od;if(F.Rb=!(1&B),F.td=B>>1&7,F.yd=B>>4&1,F.ub=B>>5,3<F.td)return In(p,3,"Incorrect keyframe parameters.");if(!F.yd)return In(p,4,"Frame not displayable.");T+=3,k-=3;var U=p.Kc;if(F.Rb){if(7>k)return In(p,7,"cannot parse picture header");if(!Xi(S,T,k))return In(p,3,"Bad code word");U.c=16383&(S[T+4]<<8|S[T+3]),U.Td=S[T+4]>>6,U.i=16383&(S[T+6]<<8|S[T+5]),U.Ud=S[T+6]>>6,T+=7,k-=7,p.za=U.c+15>>4,p.Ub=U.i+15>>4,y.width=U.c,y.height=U.i,y.Da=0,y.j=0,y.v=0,y.va=y.width,y.o=y.height,y.da=0,y.ib=y.width,y.hb=y.height,y.U=y.width,y.T=y.height,s((B=p.Pa).jb,0,255,B.jb.length),t((B=p.Qa)!=null),B.Cb=0,B.Bb=0,B.Fb=1,s(B.Zb,0,0,B.Zb.length),s(B.Lb,0,0,B.Lb)}if(F.ub>k)return In(p,7,"bad partition length");dt(B=p.m,S,T,F.ub),T+=F.ub,k-=F.ub,F.Rb&&(U.Ld=St(B),U.Kd=St(B)),U=p.Qa;var X,tt=p.Pa;if(t(B!=null),t(U!=null),U.Cb=St(B),U.Cb){if(U.Bb=St(B),St(B)){for(U.Fb=St(B),X=0;4>X;++X)U.Zb[X]=St(B)?lt(B,7):0;for(X=0;4>X;++X)U.Lb[X]=St(B)?lt(B,6):0}if(U.Bb)for(X=0;3>X;++X)tt.jb[X]=St(B)?W(B,8):255}else U.Bb=0;if(B.Ka)return In(p,3,"cannot parse segment header");if((U=p.ed).zd=St(B),U.Tb=W(B,6),U.wb=W(B,3),U.Pc=St(B),U.Pc&&St(B)){for(tt=0;4>tt;++tt)St(B)&&(U.vd[tt]=lt(B,6));for(tt=0;4>tt;++tt)St(B)&&(U.od[tt]=lt(B,6))}if(p.L=U.Tb==0?0:U.zd?1:2,B.Ka)return In(p,3,"cannot parse filter header");var bt=k;if(k=X=T,T=X+bt,U=bt,p.Xb=(1<<W(p.m,2))-1,bt<3*(tt=p.Xb))S=7;else{for(X+=3*tt,U-=3*tt,bt=0;bt<tt;++bt){var Ct=S[k+0]|S[k+1]<<8|S[k+2]<<16;Ct>U&&(Ct=U),dt(p.Jc[+bt],S,X,Ct),X+=Ct,U-=Ct,k+=3}dt(p.Jc[+tt],S,X,U),S=X<T?0:5}if(S!=0)return In(p,S,"cannot parse partitions");for(S=W(X=p.m,7),k=St(X)?lt(X,4):0,T=St(X)?lt(X,4):0,U=St(X)?lt(X,4):0,tt=St(X)?lt(X,4):0,X=St(X)?lt(X,4):0,bt=p.Qa,Ct=0;4>Ct;++Ct){if(bt.Cb){var Et=bt.Zb[Ct];bt.Fb||(Et+=S)}else{if(0<Ct){p.pb[Ct]=p.pb[0];continue}Et=S}var _t=p.pb[Ct];_t.Sc[0]=fc[Sa(Et+k,127)],_t.Sc[1]=hc[Sa(Et+0,127)],_t.Eb[0]=2*fc[Sa(Et+T,127)],_t.Eb[1]=101581*hc[Sa(Et+U,127)]>>16,8>_t.Eb[1]&&(_t.Eb[1]=8),_t.Qc[0]=fc[Sa(Et+tt,117)],_t.Qc[1]=hc[Sa(Et+X,127)],_t.lc=Et+X}if(!F.Rb)return In(p,4,"Not a key frame.");for(St(B),F=p.Pa,S=0;4>S;++S){for(k=0;8>k;++k)for(T=0;3>T;++T)for(U=0;11>U;++U)tt=Tt(B,So[S][k][T][U])?W(B,8):ys[S][k][T][U],F.Wc[S][k].Yb[T][U]=tt;for(k=0;17>k;++k)F.Xc[S][k]=F.Wc[S][Bh[k]]}return p.kc=St(B),p.kc&&(p.Bd=W(B,8)),p.cb=1}function Xc(p,y,S,T,k,B,F){var U=y[k].Yb[S];for(S=0;16>k;++k){if(!Tt(p,U[S+0]))return k;for(;!Tt(p,U[S+1]);)if(U=y[++k].Yb[0],S=0,k==16)return 16;var X=y[k+1].Yb;if(Tt(p,U[S+2])){var tt=p,bt=0;if(Tt(tt,(Et=U)[(Ct=S)+3]))if(Tt(tt,Et[Ct+6])){for(U=0,Ct=2*(bt=Tt(tt,Et[Ct+8]))+(Et=Tt(tt,Et[Ct+9+bt])),bt=0,Et=Yn[Ct];Et[U];++U)bt+=bt+Tt(tt,Et[U]);bt+=3+(8<<Ct)}else Tt(tt,Et[Ct+7])?(bt=7+2*Tt(tt,165),bt+=Tt(tt,145)):bt=5+Tt(tt,159);else bt=Tt(tt,Et[Ct+4])?3+Tt(tt,Et[Ct+5]):2;U=X[2]}else bt=1,U=X[1];X=F+on[k],0>(tt=p).b&&At(tt);var Ct,Et=tt.b,_t=(Ct=tt.Ca>>1)-(tt.I>>Et)>>31;--tt.b,tt.Ca+=_t,tt.Ca|=1,tt.I-=(Ct+1&_t)<<Et,B[X]=((bt^_t)-_t)*T[(0<k)+0]}return 16}function gr(p){var y=p.rb[p.sb-1];y.la=0,y.Na=0,s(p.zc,0,0,p.zc.length),p.ja=0}function Kc(p,y){if(p==null)return 0;if(y==null)return In(p,2,"NULL VP8Io parameter in VP8Decode().");if(!p.cb&&!Xl(p,y))return 0;if(t(p.cb),y.ac==null||y.ac(y)){y.ob&&(p.L=0);var S=Ks[p.L];if(p.L==2?(p.yb=0,p.zb=0):(p.yb=y.v-S>>4,p.zb=y.j-S>>4,0>p.yb&&(p.yb=0),0>p.zb&&(p.zb=0)),p.Va=y.o+15+S>>4,p.Hb=y.va+15+S>>4,p.Hb>p.za&&(p.Hb=p.za),p.Va>p.Ub&&(p.Va=p.Ub),0<p.L){var T=p.ed;for(S=0;4>S;++S){var k;if(p.Qa.Cb){var B=p.Qa.Lb[S];p.Qa.Fb||(B+=T.Tb)}else B=T.Tb;for(k=0;1>=k;++k){var F=p.gd[S][k],U=B;if(T.Pc&&(U+=T.vd[0],k&&(U+=T.od[0])),0<(U=0>U?0:63<U?63:U)){var X=U;0<T.wb&&(X=4<T.wb?X>>2:X>>1)>9-T.wb&&(X=9-T.wb),1>X&&(X=1),F.dd=X,F.tc=2*U+X,F.ld=40<=U?2:15<=U?1:0}else F.tc=0;F.La=k}}}S=0}else In(p,6,"Frame setup failed"),S=p.a;if(S=S==0){if(S){p.$c=0,0<p.Aa||(p.Ic=qh);t:{S=p.Ic,T=4*(X=p.za);var tt=32*X,bt=X+1,Ct=0<p.L?X*(0<p.Aa?2:1):0,Et=(p.Aa==2?2:1)*X;if((F=T+832+(k=3*(16*S+Ks[p.L])/2*tt)+(B=p.Fa!=null&&0<p.Fa.length?p.Kc.c*p.Kc.i:0))!=F)S=0;else{if(F>p.Vb){if(p.Vb=0,p.Ec=o(F),p.Fc=0,p.Ec==null){S=In(p,1,"no memory during frame initialization.");break t}p.Vb=F}F=p.Ec,U=p.Fc,p.Ac=F,p.Bc=U,U+=T,p.Gd=l(tt,Ms),p.Hd=0,p.rb=l(bt+1,ro),p.sb=1,p.wa=Ct?l(Ct,Os):null,p.Y=0,p.D.Nb=0,p.D.wa=p.wa,p.D.Y=p.Y,0<p.Aa&&(p.D.Y+=X),t(!0),p.oc=F,p.pc=U,U+=832,p.ya=l(Et,oo),p.aa=0,p.D.ya=p.ya,p.D.aa=p.aa,p.Aa==2&&(p.D.aa+=X),p.R=16*X,p.B=8*X,X=(tt=Ks[p.L])*p.R,tt=tt/2*p.B,p.sa=F,p.ta=U+X,p.qa=p.sa,p.ra=p.ta+16*S*p.R+tt,p.Ha=p.qa,p.Ia=p.ra+8*S*p.B+tt,p.$c=0,U+=k,p.mb=B?F:null,p.nb=B?U:null,t(U+B<=p.Fc+p.Vb),gr(p),s(p.Ac,p.Bc,0,T),S=1}}if(S){if(y.ka=0,y.y=p.sa,y.O=p.ta,y.f=p.qa,y.N=p.ra,y.ea=p.Ha,y.Vd=p.Ia,y.fa=p.R,y.Rc=p.B,y.F=null,y.J=0,!Is){for(S=-255;255>=S;++S)Zn[255+S]=0>S?-S:S;for(S=-1020;1020>=S;++S)Da[1020+S]=-128>S?-128:127<S?127:S;for(S=-112;112>=S;++S)Dr[112+S]=-16>S?-16:15<S?15:S;for(S=-255;510>=S;++S)Rr[255+S]=0>S?0:255<S?255:S;Is=1}ms=br,Ja=$l,ts=Ds,ni=$c,oa=Zl,Hn=Kl,go=co,gs=uo,cl=lf,Tr=nc,Cr=of,Or=tl,bo=el,ul=nu,Mr=wr,Us=_a,yo=ps,Vn=rf,$i[0]=aa,$i[1]=Zc,$i[2]=tc,$i[3]=Jc,$i[4]=Ca,$i[5]=fs,$i[6]=$o,$i[7]=Oa,$i[8]=Zo,$i[9]=ec,Ws[0]=Ko,Ws[1]=Jl,Ws[2]=Rs,Ws[3]=Xo,Ws[4]=xi,Ws[5]=yr,Ws[6]=Ps,La[0]=Bs,La[1]=Qc,La[2]=tu,La[3]=vr,La[4]=wa,La[5]=Fi,La[6]=xr,S=1}else S=0}S&&(S=function(_t,Yt){for(_t.M=0;_t.M<_t.Va;++_t.M){var Rt,yt=_t.Jc[_t.M&_t.Xb],xt=_t.m,Ut=_t;for(Rt=0;Rt<Ut.za;++Rt){var Gt=xt,Ht=Ut,ce=Ht.Ac,ae=Ht.Bc+4*Rt,ve=Ht.zc,se=Ht.ya[Ht.aa+Rt];if(Ht.Qa.Bb?se.$b=Tt(Gt,Ht.Pa.jb[0])?2+Tt(Gt,Ht.Pa.jb[2]):Tt(Gt,Ht.Pa.jb[1]):se.$b=0,Ht.kc&&(se.Ad=Tt(Gt,Ht.Bd)),se.Za=!Tt(Gt,145)+0,se.Za){var en=se.Ob,ln=0;for(Ht=0;4>Ht;++Ht){var Ie,Fe=ve[0+Ht];for(Ie=0;4>Ie;++Ie){Fe=ff[ce[ae+Ie]][Fe];for(var mn=Pr[Tt(Gt,Fe[0])];0<mn;)mn=Pr[2*mn+Tt(Gt,Fe[mn])];Fe=-mn,ce[ae+Ie]=Fe}i(en,ln,ce,ae,4),ln+=4,ve[0+Ht]=Fe}}else Fe=Tt(Gt,156)?Tt(Gt,128)?1:3:Tt(Gt,163)?2:0,se.Ob[0]=Fe,s(ce,ae,Fe,4),s(ve,0,Fe,4);se.Dd=Tt(Gt,142)?Tt(Gt,114)?Tt(Gt,183)?1:3:2:0}if(Ut.m.Ka)return In(_t,7,"Premature end-of-partition0 encountered.");for(;_t.ja<_t.za;++_t.ja){if(Ut=yt,Gt=(xt=_t).rb[xt.sb-1],ce=xt.rb[xt.sb+xt.ja],Rt=xt.ya[xt.aa+xt.ja],ae=xt.kc?Rt.Ad:0)Gt.la=ce.la=0,Rt.Za||(Gt.Na=ce.Na=0),Rt.Hc=0,Rt.Gc=0,Rt.ia=0;else{var cn,Me;if(Gt=ce,ce=Ut,ae=xt.Pa.Xc,ve=xt.ya[xt.aa+xt.ja],se=xt.pb[ve.$b],Ht=ve.ad,en=0,ln=xt.rb[xt.sb-1],Fe=Ie=0,s(Ht,en,0,384),ve.Za)var bn=0,we=ae[3];else{mn=o(16);var Ee=Gt.Na+ln.Na;if(Ee=ci(ce,ae[1],Ee,se.Eb,0,mn,0),Gt.Na=ln.Na=(0<Ee)+0,1<Ee)ms(mn,0,Ht,en);else{var tn=mn[0]+3>>3;for(mn=0;256>mn;mn+=16)Ht[en+mn]=tn}bn=1,we=ae[0]}var nn=15&Gt.la,Ai=15&ln.la;for(mn=0;4>mn;++mn){var hi=1&Ai;for(tn=Me=0;4>tn;++tn)nn=nn>>1|(hi=(Ee=ci(ce,we,Ee=hi+(1&nn),se.Sc,bn,Ht,en))>bn)<<7,Me=Me<<2|(3<Ee?3:1<Ee?2:Ht[en+0]!=0),en+=16;nn>>=4,Ai=Ai>>1|hi<<7,Ie=(Ie<<8|Me)>>>0}for(we=nn,bn=Ai>>4,cn=0;4>cn;cn+=2){for(Me=0,nn=Gt.la>>4+cn,Ai=ln.la>>4+cn,mn=0;2>mn;++mn){for(hi=1&Ai,tn=0;2>tn;++tn)Ee=hi+(1&nn),nn=nn>>1|(hi=0<(Ee=ci(ce,ae[2],Ee,se.Qc,0,Ht,en)))<<3,Me=Me<<2|(3<Ee?3:1<Ee?2:Ht[en+0]!=0),en+=16;nn>>=2,Ai=Ai>>1|hi<<5}Fe|=Me<<4*cn,we|=nn<<4<<cn,bn|=(240&Ai)<<cn}Gt.la=we,ln.la=bn,ve.Hc=Ie,ve.Gc=Fe,ve.ia=43690&Fe?0:se.ia,ae=!(Ie|Fe)}if(0<xt.L&&(xt.wa[xt.Y+xt.ja]=xt.gd[Rt.$b][Rt.Za],xt.wa[xt.Y+xt.ja].La|=!ae),Ut.Ka)return In(_t,7,"Premature end-of-file encountered.")}if(gr(_t),xt=Yt,Ut=1,Rt=(yt=_t).D,Gt=0<yt.L&&yt.M>=yt.zb&&yt.M<=yt.Va,yt.Aa==0)t:{if(Rt.M=yt.M,Rt.uc=Gt,Fs(yt,Rt),Ut=1,Rt=(Me=yt.D).Nb,Gt=(Fe=Ks[yt.L])*yt.R,ce=Fe/2*yt.B,mn=16*Rt*yt.R,tn=8*Rt*yt.B,ae=yt.sa,ve=yt.ta-Gt+mn,se=yt.qa,Ht=yt.ra-ce+tn,en=yt.Ha,ln=yt.Ia-ce+tn,Ai=(nn=Me.M)==0,Ie=nn>=yt.Va-1,yt.Aa==2&&Fs(yt,Me),Me.uc)for(hi=(Ee=yt).D.M,t(Ee.D.uc),Me=Ee.yb;Me<Ee.Hb;++Me){bn=Me,we=hi;var Qn=(Jn=(kn=Ee).D).Nb;cn=kn.R;var Jn=Jn.wa[Jn.Y+bn],ii=kn.sa,Pa=kn.ta+16*Qn*cn+16*bn,un=Jn.dd,ai=Jn.tc;if(ai!=0)if(t(3<=ai),kn.L==1)0<bn&&Us(ii,Pa,cn,ai+4),Jn.La&&Vn(ii,Pa,cn,ai),0<we&&Mr(ii,Pa,cn,ai+4),Jn.La&&yo(ii,Pa,cn,ai);else{var es=kn.B,Fr=kn.qa,Ao=kn.ra+8*Qn*es+8*bn,qr=kn.Ha,kn=kn.Ia+8*Qn*es+8*bn;Qn=Jn.ld,0<bn&&(gs(ii,Pa,cn,ai+4,un,Qn),Tr(Fr,Ao,qr,kn,es,ai+4,un,Qn)),Jn.La&&(Or(ii,Pa,cn,ai,un,Qn),ul(Fr,Ao,qr,kn,es,ai,un,Qn)),0<we&&(go(ii,Pa,cn,ai+4,un,Qn),cl(Fr,Ao,qr,kn,es,ai+4,un,Qn)),Jn.La&&(Cr(ii,Pa,cn,ai,un,Qn),bo(Fr,Ao,qr,kn,es,ai,un,Qn))}}if(yt.ia&&alert("todo:DitherRow"),xt.put!=null){if(Me=16*nn,nn=16*(nn+1),Ai?(xt.y=yt.sa,xt.O=yt.ta+mn,xt.f=yt.qa,xt.N=yt.ra+tn,xt.ea=yt.Ha,xt.W=yt.Ia+tn):(Me-=Fe,xt.y=ae,xt.O=ve,xt.f=se,xt.N=Ht,xt.ea=en,xt.W=ln),Ie||(nn-=Fe),nn>xt.o&&(nn=xt.o),xt.F=null,xt.J=null,yt.Fa!=null&&0<yt.Fa.length&&Me<nn&&(xt.J=sc(yt,xt,Me,nn-Me),xt.F=yt.mb,xt.F==null&&xt.F.length==0)){Ut=In(yt,3,"Could not decode alpha data.");break t}Me<xt.j&&(Fe=xt.j-Me,Me=xt.j,t(!(1&Fe)),xt.O+=yt.R*Fe,xt.N+=yt.B*(Fe>>1),xt.W+=yt.B*(Fe>>1),xt.F!=null&&(xt.J+=xt.width*Fe)),Me<nn&&(xt.O+=xt.v,xt.N+=xt.v>>1,xt.W+=xt.v>>1,xt.F!=null&&(xt.J+=xt.v),xt.ka=Me-xt.j,xt.U=xt.va-xt.v,xt.T=nn-Me,Ut=xt.put(xt))}Rt+1!=yt.Ic||Ie||(i(yt.sa,yt.ta-Gt,ae,ve+16*yt.R,Gt),i(yt.qa,yt.ra-ce,se,Ht+8*yt.B,ce),i(yt.Ha,yt.Ia-ce,en,ln+8*yt.B,ce))}if(!Ut)return In(_t,6,"Output aborted.")}return 1}(p,y)),y.bc!=null&&y.bc(y),S&=1}return S?(p.cb=0,S):0}function ia(p,y,S,T,k){k=p[y+S+32*T]+(k>>3),p[y+S+32*T]=-256&k?0>k?0:255:k}function Wo(p,y,S,T,k,B){ia(p,y,0,S,T+k),ia(p,y,1,S,T+B),ia(p,y,2,S,T-B),ia(p,y,3,S,T-k)}function Cn(p){return(20091*p>>16)+p}function lo(p,y,S,T){var k,B=0,F=o(16);for(k=0;4>k;++k){var U=p[y+0]+p[y+8],X=p[y+0]-p[y+8],tt=(35468*p[y+4]>>16)-Cn(p[y+12]),bt=Cn(p[y+4])+(35468*p[y+12]>>16);F[B+0]=U+bt,F[B+1]=X+tt,F[B+2]=X-tt,F[B+3]=U-bt,B+=4,y++}for(k=B=0;4>k;++k)U=(p=F[B+0]+4)+F[B+8],X=p-F[B+8],tt=(35468*F[B+4]>>16)-Cn(F[B+12]),ia(S,T,0,0,U+(bt=Cn(F[B+4])+(35468*F[B+12]>>16))),ia(S,T,1,0,X+tt),ia(S,T,2,0,X-tt),ia(S,T,3,0,U-bt),B++,T+=32}function Kl(p,y,S,T){var k=p[y+0]+4,B=35468*p[y+4]>>16,F=Cn(p[y+4]),U=35468*p[y+1]>>16;Wo(S,T,0,k+F,p=Cn(p[y+1]),U),Wo(S,T,1,k+B,p,U),Wo(S,T,2,k-B,p,U),Wo(S,T,3,k-F,p,U)}function $l(p,y,S,T,k){lo(p,y,S,T),k&&lo(p,y+16,S,T+4)}function Ds(p,y,S,T){Ja(p,y+0,S,T,1),Ja(p,y+32,S,T+128,1)}function $c(p,y,S,T){var k;for(p=p[y+0]+4,k=0;4>k;++k)for(y=0;4>y;++y)ia(S,T,y,k,p)}function Zl(p,y,S,T){p[y+0]&&ni(p,y+0,S,T),p[y+16]&&ni(p,y+16,S,T+4),p[y+32]&&ni(p,y+32,S,T+128),p[y+48]&&ni(p,y+48,S,T+128+4)}function br(p,y,S,T){var k,B=o(16);for(k=0;4>k;++k){var F=p[y+0+k]+p[y+12+k],U=p[y+4+k]+p[y+8+k],X=p[y+4+k]-p[y+8+k],tt=p[y+0+k]-p[y+12+k];B[0+k]=F+U,B[8+k]=F-U,B[4+k]=tt+X,B[12+k]=tt-X}for(k=0;4>k;++k)F=(p=B[0+4*k]+3)+B[3+4*k],U=B[1+4*k]+B[2+4*k],X=B[1+4*k]-B[2+4*k],tt=p-B[3+4*k],S[T+0]=F+U>>3,S[T+16]=tt+X>>3,S[T+32]=F-U>>3,S[T+48]=tt-X>>3,T+=64}function Ql(p,y,S){var T,k=y-32,B=Si,F=255-p[k-1];for(T=0;T<S;++T){var U,X=B,tt=F+p[y-1];for(U=0;U<S;++U)p[y+U]=X[tt+p[k+U]];y+=32}}function Zc(p,y){Ql(p,y,4)}function Qc(p,y){Ql(p,y,8)}function Jl(p,y){Ql(p,y,16)}function Rs(p,y){var S;for(S=0;16>S;++S)i(p,y+32*S,p,y-32,16)}function Xo(p,y){var S;for(S=16;0<S;--S)s(p,y,p[y-1],16),y+=32}function ks(p,y,S){var T;for(T=0;16>T;++T)s(y,S+32*T,p,16)}function Ko(p,y){var S,T=16;for(S=0;16>S;++S)T+=p[y-1+32*S]+p[y+S-32];ks(T>>5,p,y)}function xi(p,y){var S,T=8;for(S=0;16>S;++S)T+=p[y-1+32*S];ks(T>>4,p,y)}function yr(p,y){var S,T=8;for(S=0;16>S;++S)T+=p[y+S-32];ks(T>>4,p,y)}function Ps(p,y){ks(128,p,y)}function Te(p,y,S){return p+2*y+S+2>>2}function tc(p,y){var S,T=y-32;for(T=new Uint8Array([Te(p[T-1],p[T+0],p[T+1]),Te(p[T+0],p[T+1],p[T+2]),Te(p[T+1],p[T+2],p[T+3]),Te(p[T+2],p[T+3],p[T+4])]),S=0;4>S;++S)i(p,y+32*S,T,0,T.length)}function Jc(p,y){var S=p[y-1],T=p[y-1+32],k=p[y-1+64],B=p[y-1+96];Zt(p,y+0,16843009*Te(p[y-1-32],S,T)),Zt(p,y+32,16843009*Te(S,T,k)),Zt(p,y+64,16843009*Te(T,k,B)),Zt(p,y+96,16843009*Te(k,B,B))}function aa(p,y){var S,T=4;for(S=0;4>S;++S)T+=p[y+S-32]+p[y-1+32*S];for(T>>=3,S=0;4>S;++S)s(p,y+32*S,T,4)}function Ca(p,y){var S=p[y-1+0],T=p[y-1+32],k=p[y-1+64],B=p[y-1-32],F=p[y+0-32],U=p[y+1-32],X=p[y+2-32],tt=p[y+3-32];p[y+0+96]=Te(T,k,p[y-1+96]),p[y+1+96]=p[y+0+64]=Te(S,T,k),p[y+2+96]=p[y+1+64]=p[y+0+32]=Te(B,S,T),p[y+3+96]=p[y+2+64]=p[y+1+32]=p[y+0+0]=Te(F,B,S),p[y+3+64]=p[y+2+32]=p[y+1+0]=Te(U,F,B),p[y+3+32]=p[y+2+0]=Te(X,U,F),p[y+3+0]=Te(tt,X,U)}function $o(p,y){var S=p[y+1-32],T=p[y+2-32],k=p[y+3-32],B=p[y+4-32],F=p[y+5-32],U=p[y+6-32],X=p[y+7-32];p[y+0+0]=Te(p[y+0-32],S,T),p[y+1+0]=p[y+0+32]=Te(S,T,k),p[y+2+0]=p[y+1+32]=p[y+0+64]=Te(T,k,B),p[y+3+0]=p[y+2+32]=p[y+1+64]=p[y+0+96]=Te(k,B,F),p[y+3+32]=p[y+2+64]=p[y+1+96]=Te(B,F,U),p[y+3+64]=p[y+2+96]=Te(F,U,X),p[y+3+96]=Te(U,X,X)}function fs(p,y){var S=p[y-1+0],T=p[y-1+32],k=p[y-1+64],B=p[y-1-32],F=p[y+0-32],U=p[y+1-32],X=p[y+2-32],tt=p[y+3-32];p[y+0+0]=p[y+1+64]=B+F+1>>1,p[y+1+0]=p[y+2+64]=F+U+1>>1,p[y+2+0]=p[y+3+64]=U+X+1>>1,p[y+3+0]=X+tt+1>>1,p[y+0+96]=Te(k,T,S),p[y+0+64]=Te(T,S,B),p[y+0+32]=p[y+1+96]=Te(S,B,F),p[y+1+32]=p[y+2+96]=Te(B,F,U),p[y+2+32]=p[y+3+96]=Te(F,U,X),p[y+3+32]=Te(U,X,tt)}function Oa(p,y){var S=p[y+0-32],T=p[y+1-32],k=p[y+2-32],B=p[y+3-32],F=p[y+4-32],U=p[y+5-32],X=p[y+6-32],tt=p[y+7-32];p[y+0+0]=S+T+1>>1,p[y+1+0]=p[y+0+64]=T+k+1>>1,p[y+2+0]=p[y+1+64]=k+B+1>>1,p[y+3+0]=p[y+2+64]=B+F+1>>1,p[y+0+32]=Te(S,T,k),p[y+1+32]=p[y+0+96]=Te(T,k,B),p[y+2+32]=p[y+1+96]=Te(k,B,F),p[y+3+32]=p[y+2+96]=Te(B,F,U),p[y+3+64]=Te(F,U,X),p[y+3+96]=Te(U,X,tt)}function ec(p,y){var S=p[y-1+0],T=p[y-1+32],k=p[y-1+64],B=p[y-1+96];p[y+0+0]=S+T+1>>1,p[y+2+0]=p[y+0+32]=T+k+1>>1,p[y+2+32]=p[y+0+64]=k+B+1>>1,p[y+1+0]=Te(S,T,k),p[y+3+0]=p[y+1+32]=Te(T,k,B),p[y+3+32]=p[y+1+64]=Te(k,B,B),p[y+3+64]=p[y+2+64]=p[y+0+96]=p[y+1+96]=p[y+2+96]=p[y+3+96]=B}function Zo(p,y){var S=p[y-1+0],T=p[y-1+32],k=p[y-1+64],B=p[y-1+96],F=p[y-1-32],U=p[y+0-32],X=p[y+1-32],tt=p[y+2-32];p[y+0+0]=p[y+2+32]=S+F+1>>1,p[y+0+32]=p[y+2+64]=T+S+1>>1,p[y+0+64]=p[y+2+96]=k+T+1>>1,p[y+0+96]=B+k+1>>1,p[y+3+0]=Te(U,X,tt),p[y+2+0]=Te(F,U,X),p[y+1+0]=p[y+3+32]=Te(S,F,U),p[y+1+32]=p[y+3+64]=Te(T,S,F),p[y+1+64]=p[y+3+96]=Te(k,T,S),p[y+1+96]=Te(B,k,T)}function tu(p,y){var S;for(S=0;8>S;++S)i(p,y+32*S,p,y-32,8)}function vr(p,y){var S;for(S=0;8>S;++S)s(p,y,p[y-1],8),y+=32}function hs(p,y,S){var T;for(T=0;8>T;++T)s(y,S+32*T,p,8)}function Bs(p,y){var S,T=8;for(S=0;8>S;++S)T+=p[y+S-32]+p[y-1+32*S];hs(T>>4,p,y)}function Fi(p,y){var S,T=4;for(S=0;8>S;++S)T+=p[y+S-32];hs(T>>3,p,y)}function wa(p,y){var S,T=4;for(S=0;8>S;++S)T+=p[y-1+32*S];hs(T>>3,p,y)}function xr(p,y){hs(128,p,y)}function ds(p,y,S){var T=p[y-S],k=p[y+0],B=3*(k-T)+au[1020+p[y-2*S]-p[y+S]],F=vo[112+(B+4>>3)];p[y-S]=Si[255+T+vo[112+(B+3>>3)]],p[y+0]=Si[255+k-F]}function eu(p,y,S,T){var k=p[y+0],B=p[y+S];return Ra[255+p[y-2*S]-p[y-S]]>T||Ra[255+B-k]>T}function Qo(p,y,S,T){return 4*Ra[255+p[y-S]-p[y+0]]+Ra[255+p[y-2*S]-p[y+S]]<=T}function Jo(p,y,S,T,k){var B=p[y-3*S],F=p[y-2*S],U=p[y-S],X=p[y+0],tt=p[y+S],bt=p[y+2*S],Ct=p[y+3*S];return 4*Ra[255+U-X]+Ra[255+F-tt]>T?0:Ra[255+p[y-4*S]-B]<=k&&Ra[255+B-F]<=k&&Ra[255+F-U]<=k&&Ra[255+Ct-bt]<=k&&Ra[255+bt-tt]<=k&&Ra[255+tt-X]<=k}function wr(p,y,S,T){var k=2*T+1;for(T=0;16>T;++T)Qo(p,y+T,S,k)&&ds(p,y+T,S)}function _a(p,y,S,T){var k=2*T+1;for(T=0;16>T;++T)Qo(p,y+T*S,1,k)&&ds(p,y+T*S,1)}function ps(p,y,S,T){var k;for(k=3;0<k;--k)wr(p,y+=4*S,S,T)}function rf(p,y,S,T){var k;for(k=3;0<k;--k)_a(p,y+=4,S,T)}function _r(p,y,S,T,k,B,F,U){for(B=2*B+1;0<k--;){if(Jo(p,y,S,B,F))if(eu(p,y,S,U))ds(p,y,S);else{var X=p,tt=y,bt=S,Ct=X[tt-2*bt],Et=X[tt-bt],_t=X[tt+0],Yt=X[tt+bt],Rt=X[tt+2*bt],yt=27*(Ut=au[1020+3*(_t-Et)+au[1020+Ct-Yt]])+63>>7,xt=18*Ut+63>>7,Ut=9*Ut+63>>7;X[tt-3*bt]=Si[255+X[tt-3*bt]+Ut],X[tt-2*bt]=Si[255+Ct+xt],X[tt-bt]=Si[255+Et+yt],X[tt+0]=Si[255+_t-yt],X[tt+bt]=Si[255+Yt-xt],X[tt+2*bt]=Si[255+Rt-Ut]}y+=T}}function Ka(p,y,S,T,k,B,F,U){for(B=2*B+1;0<k--;){if(Jo(p,y,S,B,F))if(eu(p,y,S,U))ds(p,y,S);else{var X=p,tt=y,bt=S,Ct=X[tt-bt],Et=X[tt+0],_t=X[tt+bt],Yt=vo[112+((Rt=3*(Et-Ct))+4>>3)],Rt=vo[112+(Rt+3>>3)],yt=Yt+1>>1;X[tt-2*bt]=Si[255+X[tt-2*bt]+yt],X[tt-bt]=Si[255+Ct+Rt],X[tt+0]=Si[255+Et-Yt],X[tt+bt]=Si[255+_t-yt]}y+=T}}function co(p,y,S,T,k,B){_r(p,y,S,1,16,T,k,B)}function uo(p,y,S,T,k,B){_r(p,y,1,S,16,T,k,B)}function of(p,y,S,T,k,B){var F;for(F=3;0<F;--F)Ka(p,y+=4*S,S,1,16,T,k,B)}function tl(p,y,S,T,k,B){var F;for(F=3;0<F;--F)Ka(p,y+=4,1,S,16,T,k,B)}function lf(p,y,S,T,k,B,F,U){_r(p,y,k,1,8,B,F,U),_r(S,T,k,1,8,B,F,U)}function nc(p,y,S,T,k,B,F,U){_r(p,y,1,k,8,B,F,U),_r(S,T,1,k,8,B,F,U)}function el(p,y,S,T,k,B,F,U){Ka(p,y+4*k,k,1,8,B,F,U),Ka(S,T+4*k,k,1,8,B,F,U)}function nu(p,y,S,T,k,B,F,U){Ka(p,y+4,1,k,8,B,F,U),Ka(S,T+4,1,k,8,B,F,U)}function nl(){this.ba=new Wi,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new Tn,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function ic(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function ac(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function il(){this.ua=0,this.Wa=new ct,this.vb=new ct,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new nt,this.yc=new R}function cf(){this.xb=this.a=0,this.l=new mr,this.ca=new Wi,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new O,this.Pb=0,this.wd=new O,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new il,this.ab=0,this.gc=l(4,ac),this.Oc=0}function al(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new mr,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function fo(p,y,S,T,k,B,F){for(p=p==null?0:p[y+0],y=0;y<F;++y)k[B+y]=p+S[T+y]&255,p=k[B+y]}function sl(p,y,S,T,k,B,F){var U;if(p==null)fo(null,null,S,T,k,B,F);else for(U=0;U<F;++U)k[B+U]=p[y+U]+S[T+U]&255}function Sr(p,y,S,T,k,B,F){if(p==null)fo(null,null,S,T,k,B,F);else{var U,X=p[y+0],tt=X,bt=X;for(U=0;U<F;++U)tt=bt+(X=p[y+U])-tt,bt=S[T+U]+(-256&tt?0>tt?0:255:tt)&255,tt=X,k[B+U]=bt}}function sc(p,y,S,T){var k=y.width,B=y.o;if(t(p!=null&&y!=null),0>S||0>=T||S+T>B)return null;if(!p.Cc){if(p.ga==null){var F;if(p.ga=new al,(F=p.ga==null)||(F=y.width*y.o,t(p.Gb.length==0),p.Gb=o(F),p.Uc=0,p.Gb==null?F=0:(p.mb=p.Gb,p.nb=p.Uc,p.rc=null,F=1),F=!F),!F){F=p.ga;var U=p.Fa,X=p.P,tt=p.qc,bt=p.mb,Ct=p.nb,Et=X+1,_t=tt-1,Yt=F.l;if(t(U!=null&&bt!=null&&y!=null),vs[0]=null,vs[1]=fo,vs[2]=sl,vs[3]=Sr,F.ca=bt,F.tb=Ct,F.c=y.width,F.i=y.height,t(0<F.c&&0<F.i),1>=tt)y=0;else if(F.$a=U[X+0]>>0&3,F.Z=U[X+0]>>2&3,F.Lc=U[X+0]>>4&3,X=U[X+0]>>6&3,0>F.$a||1<F.$a||4<=F.Z||1<F.Lc||X)y=0;else if(Yt.put=Pi,Yt.ac=Je,Yt.bc=dn,Yt.ma=F,Yt.width=y.width,Yt.height=y.height,Yt.Da=y.Da,Yt.v=y.v,Yt.va=y.va,Yt.j=y.j,Yt.o=y.o,F.$a)t:{t(F.$a==1),y=Ti();e:for(;;){if(y==null){y=0;break t}if(t(F!=null),F.mc=y,y.c=F.c,y.i=F.i,y.l=F.l,y.l.ma=F,y.l.width=F.c,y.l.height=F.i,y.a=0,ut(y.m,U,Et,_t),!gn(F.c,F.i,1,y,null)||(y.ab==1&&y.gc[0].hc==3&&va(y.s)?(F.ic=1,U=y.c*y.i,y.Ta=null,y.Ua=0,y.V=o(U),y.Ba=0,y.V==null?(y.a=1,y=0):y=1):(F.ic=0,y=pr(y,F.c)),!y))break e;y=1;break t}F.mc=null,y=0}else y=_t>=F.c*F.i;F=!y}if(F)return null;p.ga.Lc!=1?p.Ga=0:T=B-S}t(p.ga!=null),t(S+T<=B);t:{if(y=(U=p.ga).c,B=U.l.o,U.$a==0){if(Et=p.rc,_t=p.Vc,Yt=p.Fa,X=p.P+1+S*y,tt=p.mb,bt=p.nb+S*y,t(X<=p.P+p.qc),U.Z!=0)for(t(vs[U.Z]!=null),F=0;F<T;++F)vs[U.Z](Et,_t,Yt,X,tt,bt,y),Et=tt,_t=bt,bt+=y,X+=y;else for(F=0;F<T;++F)i(tt,bt,Yt,X,y),Et=tt,_t=bt,bt+=y,X+=y;p.rc=Et,p.Vc=_t}else{if(t(U.mc!=null),y=S+T,t((F=U.mc)!=null),t(y<=F.i),F.C>=y)y=1;else if(U.ic||Lt(),U.ic){U=F.V,Et=F.Ba,_t=F.c;var Rt=F.i,yt=(Yt=1,X=F.$/_t,tt=F.$%_t,bt=F.m,Ct=F.s,F.$),xt=_t*Rt,Ut=_t*y,Gt=Ct.wc,Ht=yt<Ut?pn(Ct,tt,X):null;t(yt<=xt),t(y<=Rt),t(va(Ct));e:for(;;){for(;!bt.h&&yt<Ut;){if(tt&Gt||(Ht=pn(Ct,tt,X)),t(Ht!=null),at(bt),256>(Rt=rn(Ht.G[0],Ht.H[0],bt)))U[Et+yt]=Rt,++yt,++tt>=_t&&(tt=0,++X<=y&&!(X%16)&&Bi(F,X));else{if(!(280>Rt)){Yt=0;break e}Rt=sn(Rt-256,bt);var ce,ae=rn(Ht.G[4],Ht.H[4],bt);if(at(bt),!(yt>=(ae=We(_t,ae=sn(ae,bt)))&&xt-yt>=Rt)){Yt=0;break e}for(ce=0;ce<Rt;++ce)U[Et+yt+ce]=U[Et+yt+ce-ae];for(yt+=Rt,tt+=Rt;tt>=_t;)tt-=_t,++X<=y&&!(X%16)&&Bi(F,X);yt<Ut&&tt&Gt&&(Ht=pn(Ct,tt,X))}t(bt.h==$(bt))}Bi(F,X>y?y:X);break e}!Yt||bt.h&&yt<xt?(Yt=0,F.a=bt.h?5:3):F.$=yt,y=Yt}else y=zi(F,F.V,F.Ba,F.c,F.i,y,so);if(!y){T=0;break t}}S+T>=B&&(p.Cc=1),T=1}if(!T)return null;if(p.Cc&&((T=p.ga)!=null&&(T.mc=null),p.ga=null,0<p.Ga))return alert("todo:WebPDequantizeLevels"),null}return p.nb+S*k}function _(p,y,S,T,k,B){for(;0<k--;){var F,U=p,X=y+(S?1:0),tt=p,bt=y+(S?0:3);for(F=0;F<T;++F){var Ct=tt[bt+4*F];Ct!=255&&(Ct*=32897,U[X+4*F+0]=U[X+4*F+0]*Ct>>23,U[X+4*F+1]=U[X+4*F+1]*Ct>>23,U[X+4*F+2]=U[X+4*F+2]*Ct>>23)}y+=B}}function P(p,y,S,T,k){for(;0<T--;){var B;for(B=0;B<S;++B){var F=p[y+2*B+0],U=15&(tt=p[y+2*B+1]),X=4369*U,tt=(240&tt|tt>>4)*X>>16;p[y+2*B+0]=(240&F|F>>4)*X>>16&240|(15&F|F<<4)*X>>16>>4&15,p[y+2*B+1]=240&tt|U}y+=k}}function it(p,y,S,T,k,B,F,U){var X,tt,bt=255;for(tt=0;tt<k;++tt){for(X=0;X<T;++X){var Ct=p[y+X];B[F+4*X]=Ct,bt&=Ct}y+=S,F+=U}return bt!=255}function pt(p,y,S,T,k){var B;for(B=0;B<k;++B)S[T+B]=p[y+B]>>8}function Lt(){Na=_,Ve=P,Ye=it,Nn=pt}function zt(p,y,S){H[p]=function(T,k,B,F,U,X,tt,bt,Ct,Et,_t,Yt,Rt,yt,xt,Ut,Gt){var Ht,ce=Gt-1>>1,ae=U[X+0]|tt[bt+0]<<16,ve=Ct[Et+0]|_t[Yt+0]<<16;t(T!=null);var se=3*ae+ve+131074>>2;for(y(T[k+0],255&se,se>>16,Rt,yt),B!=null&&(se=3*ve+ae+131074>>2,y(B[F+0],255&se,se>>16,xt,Ut)),Ht=1;Ht<=ce;++Ht){var en=U[X+Ht]|tt[bt+Ht]<<16,ln=Ct[Et+Ht]|_t[Yt+Ht]<<16,Ie=ae+en+ve+ln+524296,Fe=Ie+2*(en+ve)>>3;se=Fe+ae>>1,ae=(Ie=Ie+2*(ae+ln)>>3)+en>>1,y(T[k+2*Ht-1],255&se,se>>16,Rt,yt+(2*Ht-1)*S),y(T[k+2*Ht-0],255&ae,ae>>16,Rt,yt+(2*Ht-0)*S),B!=null&&(se=Ie+ve>>1,ae=Fe+ln>>1,y(B[F+2*Ht-1],255&se,se>>16,xt,Ut+(2*Ht-1)*S),y(B[F+2*Ht+0],255&ae,ae>>16,xt,Ut+(2*Ht+0)*S)),ae=en,ve=ln}1&Gt||(se=3*ae+ve+131074>>2,y(T[k+Gt-1],255&se,se>>16,Rt,yt+(Gt-1)*S),B!=null&&(se=3*ve+ae+131074>>2,y(B[F+Gt-1],255&se,se>>16,xt,Ut+(Gt-1)*S)))}}function $t(){Ni[qi]=Xs,Ni[fl]=xs,Ni[bs]=Br,Ni[cc]=ou,Ni[xo]=lu,Ni[Hs]=pl,Ni[su]=cu,Ni[uc]=xs,Ni[kr]=ou,Ni[Vs]=lu,Ni[hl]=pl}function le(p){return p&-16384?0>p?0:255:p>>Yp}function ge(p,y){return le((19077*p>>8)+(26149*y>>8)-14234)}function Re(p,y,S){return le((19077*p>>8)-(6419*y>>8)-(13320*S>>8)+8708)}function Oe(p,y){return le((19077*p>>8)+(33050*y>>8)-17685)}function Xe(p,y,S,T,k){T[k+0]=ge(p,S),T[k+1]=Re(p,y,S),T[k+2]=Oe(p,y)}function Rn(p,y,S,T,k){T[k+0]=Oe(p,y),T[k+1]=Re(p,y,S),T[k+2]=ge(p,S)}function zn(p,y,S,T,k){var B=Re(p,y,S);y=B<<3&224|Oe(p,y)>>3,T[k+0]=248&ge(p,S)|B>>5,T[k+1]=y}function Kn(p,y,S,T,k){var B=240&Oe(p,y)|15;T[k+0]=240&ge(p,S)|Re(p,y,S)>>4,T[k+1]=B}function $n(p,y,S,T,k){T[k+0]=255,Xe(p,y,S,T,k+1)}function wi(p,y,S,T,k){Rn(p,y,S,T,k),T[k+3]=255}function $a(p,y,S,T,k){Xe(p,y,S,T,k),T[k+3]=255}function Sa(p,y){return 0>p?0:p>y?y:p}function Za(p,y,S){H[p]=function(T,k,B,F,U,X,tt,bt,Ct){for(var Et=bt+(-2&Ct)*S;bt!=Et;)y(T[k+0],B[F+0],U[X+0],tt,bt),y(T[k+1],B[F+0],U[X+0],tt,bt+S),k+=2,++F,++X,bt+=2*S;1&Ct&&y(T[k+0],B[F+0],U[X+0],tt,bt)}}function rc(p,y,S){return S==0?p==0?y==0?6:5:y==0?4:0:S}function zs(p,y,S,T,k){switch(p>>>30){case 3:Ja(y,S,T,k,0);break;case 2:Hn(y,S,T,k);break;case 1:ni(y,S,T,k)}}function Fs(p,y){var S,T,k=y.M,B=y.Nb,F=p.oc,U=p.pc+40,X=p.oc,tt=p.pc+584,bt=p.oc,Ct=p.pc+600;for(S=0;16>S;++S)F[U+32*S-1]=129;for(S=0;8>S;++S)X[tt+32*S-1]=129,bt[Ct+32*S-1]=129;for(0<k?F[U-1-32]=X[tt-1-32]=bt[Ct-1-32]=129:(s(F,U-32-1,127,21),s(X,tt-32-1,127,9),s(bt,Ct-32-1,127,9)),T=0;T<p.za;++T){var Et=y.ya[y.aa+T];if(0<T){for(S=-1;16>S;++S)i(F,U+32*S-4,F,U+32*S+12,4);for(S=-1;8>S;++S)i(X,tt+32*S-4,X,tt+32*S+4,4),i(bt,Ct+32*S-4,bt,Ct+32*S+4,4)}var _t=p.Gd,Yt=p.Hd+T,Rt=Et.ad,yt=Et.Hc;if(0<k&&(i(F,U-32,_t[Yt].y,0,16),i(X,tt-32,_t[Yt].f,0,8),i(bt,Ct-32,_t[Yt].ea,0,8)),Et.Za){var xt=F,Ut=U-32+16;for(0<k&&(T>=p.za-1?s(xt,Ut,_t[Yt].y[15],4):i(xt,Ut,_t[Yt+1].y,0,4)),S=0;4>S;S++)xt[Ut+128+S]=xt[Ut+256+S]=xt[Ut+384+S]=xt[Ut+0+S];for(S=0;16>S;++S,yt<<=2)xt=F,Ut=U+No[S],$i[Et.Ob[S]](xt,Ut),zs(yt,Rt,16*+S,xt,Ut)}else if(xt=rc(T,k,Et.Ob[0]),Ws[xt](F,U),yt!=0)for(S=0;16>S;++S,yt<<=2)zs(yt,Rt,16*+S,F,U+No[S]);for(S=Et.Gc,xt=rc(T,k,Et.Dd),La[xt](X,tt),La[xt](bt,Ct),yt=Rt,xt=X,Ut=tt,255&(Et=S>>0)&&(170&Et?ts(yt,256,xt,Ut):oa(yt,256,xt,Ut)),Et=bt,yt=Ct,255&(S>>=8)&&(170&S?ts(Rt,320,Et,yt):oa(Rt,320,Et,yt)),k<p.Ub-1&&(i(_t[Yt].y,0,F,U+480,16),i(_t[Yt].f,0,X,tt+224,8),i(_t[Yt].ea,0,bt,Ct+224,8)),S=8*B*p.B,_t=p.sa,Yt=p.ta+16*T+16*B*p.R,Rt=p.qa,Et=p.ra+8*T+S,yt=p.Ha,xt=p.Ia+8*T+S,S=0;16>S;++S)i(_t,Yt+S*p.R,F,U+32*S,16);for(S=0;8>S;++S)i(Rt,Et+S*p.B,X,tt+32*S,8),i(yt,xt+S*p.B,bt,Ct+32*S,8)}}function rl(p,y,S,T,k,B,F,U,X){var tt=[0],bt=[0],Ct=0,Et=X!=null?X.kd:0,_t=X??new ic;if(p==null||12>S)return 7;_t.data=p,_t.w=y,_t.ha=S,y=[y],S=[S],_t.gb=[_t.gb];t:{var Yt=y,Rt=S,yt=_t.gb;if(t(p!=null),t(Rt!=null),t(yt!=null),yt[0]=0,12<=Rt[0]&&!n(p,Yt[0],"RIFF")){if(n(p,Yt[0]+8,"WEBP")){yt=3;break t}var xt=ie(p,Yt[0]+4);if(12>xt||4294967286<xt){yt=3;break t}if(Et&&xt>Rt[0]-8){yt=7;break t}yt[0]=xt,Yt[0]+=12,Rt[0]-=12}yt=0}if(yt!=0)return yt;for(xt=0<_t.gb[0],S=S[0];;){t:{var Ut=p;Rt=y,yt=S;var Gt=tt,Ht=bt,ce=Yt=[0];if((se=Ct=[Ct])[0]=0,8>yt[0])yt=7;else{if(!n(Ut,Rt[0],"VP8X")){if(ie(Ut,Rt[0]+4)!=10){yt=3;break t}if(18>yt[0]){yt=7;break t}var ae=ie(Ut,Rt[0]+8),ve=1+ne(Ut,Rt[0]+12);if(2147483648<=ve*(Ut=1+ne(Ut,Rt[0]+15))){yt=3;break t}ce!=null&&(ce[0]=ae),Gt!=null&&(Gt[0]=ve),Ht!=null&&(Ht[0]=Ut),Rt[0]+=18,yt[0]-=18,se[0]=1}yt=0}}if(Ct=Ct[0],Yt=Yt[0],yt!=0)return yt;if(Rt=!!(2&Yt),!xt&&Ct)return 3;if(B!=null&&(B[0]=!!(16&Yt)),F!=null&&(F[0]=Rt),U!=null&&(U[0]=0),F=tt[0],Yt=bt[0],Ct&&Rt&&X==null){yt=0;break}if(4>S){yt=7;break}if(xt&&Ct||!xt&&!Ct&&!n(p,y[0],"ALPH")){S=[S],_t.na=[_t.na],_t.P=[_t.P],_t.Sa=[_t.Sa];t:{ae=p,yt=y,xt=S;var se=_t.gb;Gt=_t.na,Ht=_t.P,ce=_t.Sa,ve=22,t(ae!=null),t(xt!=null),Ut=yt[0];var en=xt[0];for(t(Gt!=null),t(ce!=null),Gt[0]=null,Ht[0]=null,ce[0]=0;;){if(yt[0]=Ut,xt[0]=en,8>en){yt=7;break t}var ln=ie(ae,Ut+4);if(4294967286<ln){yt=3;break t}var Ie=8+ln+1&-2;if(ve+=Ie,0<se&&ve>se){yt=3;break t}if(!n(ae,Ut,"VP8 ")||!n(ae,Ut,"VP8L")){yt=0;break t}if(en[0]<Ie){yt=7;break t}n(ae,Ut,"ALPH")||(Gt[0]=ae,Ht[0]=Ut+8,ce[0]=ln),Ut+=Ie,en-=Ie}}if(S=S[0],_t.na=_t.na[0],_t.P=_t.P[0],_t.Sa=_t.Sa[0],yt!=0)break}S=[S],_t.Ja=[_t.Ja],_t.xa=[_t.xa];t:if(se=p,yt=y,xt=S,Gt=_t.gb[0],Ht=_t.Ja,ce=_t.xa,ae=yt[0],Ut=!n(se,ae,"VP8 "),ve=!n(se,ae,"VP8L"),t(se!=null),t(xt!=null),t(Ht!=null),t(ce!=null),8>xt[0])yt=7;else{if(Ut||ve){if(se=ie(se,ae+4),12<=Gt&&se>Gt-12){yt=3;break t}if(Et&&se>xt[0]-8){yt=7;break t}Ht[0]=se,yt[0]+=8,xt[0]-=8,ce[0]=ve}else ce[0]=5<=xt[0]&&se[ae+0]==47&&!(se[ae+4]>>5),Ht[0]=xt[0];yt=0}if(S=S[0],_t.Ja=_t.Ja[0],_t.xa=_t.xa[0],y=y[0],yt!=0)break;if(4294967286<_t.Ja)return 3;if(U==null||Rt||(U[0]=_t.xa?2:1),F=[F],Yt=[Yt],_t.xa){if(5>S){yt=7;break}U=F,Et=Yt,Rt=B,p==null||5>S?p=0:5<=S&&p[y+0]==47&&!(p[y+4]>>5)?(xt=[0],se=[0],Gt=[0],ut(Ht=new O,p,y,S),ue(Ht,xt,se,Gt)?(U!=null&&(U[0]=xt[0]),Et!=null&&(Et[0]=se[0]),Rt!=null&&(Rt[0]=Gt[0]),p=1):p=0):p=0}else{if(10>S){yt=7;break}U=Yt,p==null||10>S||!Xi(p,y+3,S-3)?p=0:(Et=p[y+0]|p[y+1]<<8|p[y+2]<<16,Rt=16383&(p[y+7]<<8|p[y+6]),p=16383&(p[y+9]<<8|p[y+8]),1&Et||3<(Et>>1&7)||!(Et>>4&1)||Et>>5>=_t.Ja||!Rt||!p?p=0:(F&&(F[0]=Rt),U&&(U[0]=p),p=1))}if(!p||(F=F[0],Yt=Yt[0],Ct&&(tt[0]!=F||bt[0]!=Yt)))return 3;X!=null&&(X[0]=_t,X.offset=y-X.w,t(4294967286>y-X.w),t(X.offset==X.ha-S));break}return yt==0||yt==7&&Ct&&X==null?(B!=null&&(B[0]|=_t.na!=null&&0<_t.na.length),T!=null&&(T[0]=F),k!=null&&(k[0]=Yt),0):yt}function Nr(p,y,S){var T=y.width,k=y.height,B=0,F=0,U=T,X=k;if(y.Da=p!=null&&0<p.Da,y.Da&&(U=p.cd,X=p.bd,B=p.v,F=p.j,11>S||(B&=-2,F&=-2),0>B||0>F||0>=U||0>=X||B+U>T||F+X>k))return 0;if(y.v=B,y.j=F,y.va=B+U,y.o=F+X,y.U=U,y.T=X,y.da=p!=null&&0<p.da,y.da){if(!me(U,X,S=[p.ib],B=[p.hb]))return 0;y.ib=S[0],y.hb=B[0]}return y.ob=p!=null&&p.ob,y.Kb=p==null||!p.Sd,y.da&&(y.ob=y.ib<3*T/4&&y.hb<3*k/4,y.Kb=0),1}function ol(p){if(p==null)return 2;if(11>p.S){var y=p.f.RGBA;y.fb+=(p.height-1)*y.A,y.A=-y.A}else y=p.f.kb,p=p.height,y.O+=(p-1)*y.fa,y.fa=-y.fa,y.N+=(p-1>>1)*y.Ab,y.Ab=-y.Ab,y.W+=(p-1>>1)*y.Db,y.Db=-y.Db,y.F!=null&&(y.J+=(p-1)*y.lb,y.lb=-y.lb);return 0}function ho(p,y,S,T){if(T==null||0>=p||0>=y)return 2;if(S!=null){if(S.Da){var k=S.cd,B=S.bd,F=-2&S.v,U=-2&S.j;if(0>F||0>U||0>=k||0>=B||F+k>p||U+B>y)return 2;p=k,y=B}if(S.da){if(!me(p,y,k=[S.ib],B=[S.hb]))return 2;p=k[0],y=B[0]}}T.width=p,T.height=y;t:{var X=T.width,tt=T.height;if(p=T.S,0>=X||0>=tt||!(p>=qi&&13>p))p=2;else{if(0>=T.Rd&&T.sd==null){F=B=k=y=0;var bt=(U=X*Uh[p])*tt;if(11>p||(B=(tt+1)/2*(y=(X+1)/2),p==12&&(F=(k=X)*tt)),(tt=o(bt+2*B+F))==null){p=1;break t}T.sd=tt,11>p?((X=T.f.RGBA).eb=tt,X.fb=0,X.A=U,X.size=bt):((X=T.f.kb).y=tt,X.O=0,X.fa=U,X.Fd=bt,X.f=tt,X.N=0+bt,X.Ab=y,X.Cd=B,X.ea=tt,X.W=0+bt+B,X.Db=y,X.Ed=B,p==12&&(X.F=tt,X.J=0+bt+2*B),X.Tc=F,X.lb=k)}if(y=1,k=T.S,B=T.width,F=T.height,k>=qi&&13>k)if(11>k)p=T.f.RGBA,y&=(U=Math.abs(p.A))*(F-1)+B<=p.size,y&=U>=B*Uh[k],y&=p.eb!=null;else{p=T.f.kb,U=(B+1)/2,bt=(F+1)/2,X=Math.abs(p.fa),tt=Math.abs(p.Ab);var Ct=Math.abs(p.Db),Et=Math.abs(p.lb),_t=Et*(F-1)+B;y&=X*(F-1)+B<=p.Fd,y&=tt*(bt-1)+U<=p.Cd,y=(y&=Ct*(bt-1)+U<=p.Ed)&X>=B&tt>=U&Ct>=U,y&=p.y!=null,y&=p.f!=null,y&=p.ea!=null,k==12&&(y&=Et>=B,y&=_t<=p.Tc,y&=p.F!=null)}else y=0;p=y?0:2}}return p!=0||S!=null&&S.fd&&(p=ol(T)),p}var li=64,Ar=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],po=24,mo=32,ll=8,sa=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];J("Predictor0","PredictorAdd0"),H.Predictor0=function(){return 4278190080},H.Predictor1=function(p){return p},H.Predictor2=function(p,y,S){return y[S+0]},H.Predictor3=function(p,y,S){return y[S+1]},H.Predictor4=function(p,y,S){return y[S-1]},H.Predictor5=function(p,y,S){return mt(mt(p,y[S+1]),y[S+0])},H.Predictor6=function(p,y,S){return mt(p,y[S-1])},H.Predictor7=function(p,y,S){return mt(p,y[S+0])},H.Predictor8=function(p,y,S){return mt(y[S-1],y[S+0])},H.Predictor9=function(p,y,S){return mt(y[S+0],y[S+1])},H.Predictor10=function(p,y,S){return mt(mt(p,y[S-1]),mt(y[S+0],y[S+1]))},H.Predictor11=function(p,y,S){var T=y[S+0];return 0>=Ft(T>>24&255,p>>24&255,(y=y[S-1])>>24&255)+Ft(T>>16&255,p>>16&255,y>>16&255)+Ft(T>>8&255,p>>8&255,y>>8&255)+Ft(255&T,255&p,255&y)?T:p},H.Predictor12=function(p,y,S){var T=y[S+0];return(Pt((p>>24&255)+(T>>24&255)-((y=y[S-1])>>24&255))<<24|Pt((p>>16&255)+(T>>16&255)-(y>>16&255))<<16|Pt((p>>8&255)+(T>>8&255)-(y>>8&255))<<8|Pt((255&p)+(255&T)-(255&y)))>>>0},H.Predictor13=function(p,y,S){var T=y[S-1];return(qt((p=mt(p,y[S+0]))>>24&255,T>>24&255)<<24|qt(p>>16&255,T>>16&255)<<16|qt(p>>8&255,T>>8&255)<<8|qt(p>>0&255,T>>0&255))>>>0};var uf=H.PredictorAdd0;H.PredictorAdd1=Kt,J("Predictor2","PredictorAdd2"),J("Predictor3","PredictorAdd3"),J("Predictor4","PredictorAdd4"),J("Predictor5","PredictorAdd5"),J("Predictor6","PredictorAdd6"),J("Predictor7","PredictorAdd7"),J("Predictor8","PredictorAdd8"),J("Predictor9","PredictorAdd9"),J("Predictor10","PredictorAdd10"),J("Predictor11","PredictorAdd11"),J("Predictor12","PredictorAdd12"),J("Predictor13","PredictorAdd13");var oc=H.PredictorAdd2;Se("ColorIndexInverseTransform","MapARGB","32b",function(p){return p>>8&255},function(p){return p}),Se("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(p){return p},function(p){return p>>8&255});var iu,Ma=H.ColorIndexInverseTransform,_i=H.MapARGB,Lr=H.VP8LColorIndexInverseTransformAlpha,lc=H.MapAlpha,qs=H.VP8LPredictorsAdd=[];qs.length=16,(H.VP8LPredictors=[]).length=16,(H.VP8LPredictorsAdd_C=[]).length=16,(H.VP8LPredictors_C=[]).length=16;var Er,Ki,Ci,jr,ra,Qa,ms,Ja,Hn,ts,ni,oa,go,gs,cl,Tr,Cr,Or,bo,ul,Mr,Us,yo,Vn,Na,Ve,Ye,Nn,Zn=o(511),Da=o(2041),Dr=o(225),Rr=o(767),Is=0,au=Da,vo=Dr,Si=Rr,Ra=Zn,qi=0,fl=1,bs=2,cc=3,xo=4,Hs=5,su=6,uc=7,kr=8,Vs=9,hl=10,ru=[2,3,7],ka=[3,3,11],Aa=[280,256,256,256,40],wo=[0,1,1,1,0],Ys=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Gs=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],_o=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Ph=8,fc=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],hc=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],ci=null,Yn=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],on=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Pr=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],ys=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],ff=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],So=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],Bh=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Ws=[],$i=[],La=[],zh=1,dl=2,vs=[],Ni=[];zt("UpsampleRgbLinePair",Xe,3),zt("UpsampleBgrLinePair",Rn,3),zt("UpsampleRgbaLinePair",$a,4),zt("UpsampleBgraLinePair",wi,4),zt("UpsampleArgbLinePair",$n,4),zt("UpsampleRgba4444LinePair",Kn,2),zt("UpsampleRgb565LinePair",zn,2);var Xs=H.UpsampleRgbLinePair,Br=H.UpsampleBgrLinePair,xs=H.UpsampleRgbaLinePair,ou=H.UpsampleBgraLinePair,lu=H.UpsampleArgbLinePair,pl=H.UpsampleRgba4444LinePair,cu=H.UpsampleRgb565LinePair,ws=16,ui=1<<ws-1,zr=-227,uu=482,Yp=6,Fh=0,Gp=o(256),fi=o(256),hf=o(256),dc=o(256),pc=o(uu-zr),df=o(uu-zr);Za("YuvToRgbRow",Xe,3),Za("YuvToBgrRow",Rn,3),Za("YuvToRgbaRow",$a,4),Za("YuvToBgraRow",wi,4),Za("YuvToArgbRow",$n,4),Za("YuvToRgba4444Row",Kn,2),Za("YuvToRgb565Row",zn,2);var No=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Ks=[0,2,8],Wp=[8,7,6,4,4,2,2,2,1,1,1,1],qh=1;this.WebPDecodeRGBA=function(p,y,S,T,k){var B=fl,F=new nl,U=new Wi;F.ba=U,U.S=B,U.width=[U.width],U.height=[U.height];var X=U.width,tt=U.height,bt=new ki;if(bt==null||p==null)var Ct=2;else t(bt!=null),Ct=rl(p,y,S,bt.width,bt.height,bt.Pd,bt.Qd,bt.format,null);if(Ct!=0?X=0:(X!=null&&(X[0]=bt.width[0]),tt!=null&&(tt[0]=bt.height[0]),X=1),X){U.width=U.width[0],U.height=U.height[0],T!=null&&(T[0]=U.width),k!=null&&(k[0]=U.height);t:{if(T=new mr,(k=new ic).data=p,k.w=y,k.ha=S,k.kd=1,y=[0],t(k!=null),((p=rl(k.data,k.w,k.ha,null,null,null,y,null,k))==0||p==7)&&y[0]&&(p=4),(y=p)==0){if(t(F!=null),T.data=k.data,T.w=k.w+k.offset,T.ha=k.ha-k.offset,T.put=Pi,T.ac=Je,T.bc=dn,T.ma=F,k.xa){if((p=Ti())==null){F=1;break t}if(function(Et,_t){var Yt=[0],Rt=[0],yt=[0];e:for(;;){if(Et==null)return 0;if(_t==null)return Et.a=2,0;if(Et.l=_t,Et.a=0,ut(Et.m,_t.data,_t.w,_t.ha),!ue(Et.m,Yt,Rt,yt)){Et.a=3;break e}if(Et.xb=dl,_t.width=Yt[0],_t.height=Rt[0],!gn(Yt[0],Rt[0],1,Et,null))break e;return 1}return t(Et.a!=0),0}(p,T)){if(T=(y=ho(T.width,T.height,F.Oa,F.ba))==0){e:{T=p;n:for(;;){if(T==null){T=0;break e}if(t(T.s.yc!=null),t(T.s.Ya!=null),t(0<T.s.Wb),t((S=T.l)!=null),t((k=S.ma)!=null),T.xb!=0){if(T.ca=k.ba,T.tb=k.tb,t(T.ca!=null),!Nr(k.Oa,S,cc)){T.a=2;break n}if(!pr(T,S.width)||S.da)break n;if((S.da||He(T.ca.S))&&Lt(),11>T.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),T.ca.f.kb.F!=null&&Lt()),T.Pb&&0<T.s.ua&&T.s.vb.X==null&&!ye(T.s.vb,T.s.Wa.Xa)){T.a=1;break n}T.xb=0}if(!zi(T,T.V,T.Ba,T.c,T.i,S.o,ao))break n;k.Dc=T.Ma,T=1;break e}t(T.a!=0),T=0}T=!T}T&&(y=p.a)}else y=p.a}else{if((p=new sf)==null){F=1;break t}if(p.Fa=k.na,p.P=k.P,p.qc=k.Sa,Xl(p,T)){if((y=ho(T.width,T.height,F.Oa,F.ba))==0){if(p.Aa=0,S=F.Oa,t((k=p)!=null),S!=null){if(0<(X=0>(X=S.Md)?0:100<X?255:255*X/100)){for(tt=bt=0;4>tt;++tt)12>(Ct=k.pb[tt]).lc&&(Ct.ia=X*Wp[0>Ct.lc?0:Ct.lc]>>3),bt|=Ct.ia;bt&&(alert("todo:VP8InitRandom"),k.ia=1)}k.Ga=S.Id,100<k.Ga?k.Ga=100:0>k.Ga&&(k.Ga=0)}Kc(p,T)||(y=p.a)}}else y=p.a}y==0&&F.Oa!=null&&F.Oa.fd&&(y=ol(F.ba))}F=y}B=F!=0?null:11>B?U.f.RGBA.eb:U.f.kb.y}else B=null;return B};var Uh=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function d(H,G){for(var Q="",D=0;D<4;D++)Q+=String.fromCharCode(H[G++]);return Q}function m(H,G){return(H[G+0]<<0|H[G+1]<<8|H[G+2]<<16)>>>0}function g(H,G){return(H[G+0]<<0|H[G+1]<<8|H[G+2]<<16|H[G+3]<<24)>>>0}new f;var x=[0],v=[0],A=[],N=new f,E=e,j=function(H,G){var Q={},D=0,R=!1,et=0,nt=0;if(Q.frames=[],!function(q,$,rt,at){for(var At=0;At<at;At++)if(q[$+At]!=rt.charCodeAt(At))return!0;return!1}(H,G,"RIFF",4)){for(g(H,G+=4),G+=8;G<H.length;){var dt=d(H,G),W=g(H,G+=4);G+=4;var lt=W+(1&W);switch(dt){case"VP8 ":case"VP8L":Q.frames[D]===void 0&&(Q.frames[D]={}),(Y=Q.frames[D]).src_off=R?nt:G-8,Y.src_size=et+W+8,D++,R&&(R=!1,et=0,nt=0);break;case"VP8X":(Y=Q.header={}).feature_flags=H[G];var ut=G+4;Y.canvas_width=1+m(H,ut),ut+=3,Y.canvas_height=1+m(H,ut),ut+=3;break;case"ALPH":R=!0,et=lt+8,nt=G-8;break;case"ANIM":(Y=Q.header).bgcolor=g(H,G),ut=G+4,Y.loop_count=(gt=H)[(O=ut)+0]<<0|gt[O+1]<<8,ut+=2;break;case"ANMF":var wt,Y;(Y=Q.frames[D]={}).offset_x=2*m(H,G),G+=3,Y.offset_y=2*m(H,G),G+=3,Y.width=1+m(H,G),G+=3,Y.height=1+m(H,G),G+=3,Y.duration=m(H,G),G+=3,wt=H[G++],Y.dispose=1&wt,Y.blend=wt>>1&1}dt!="ANMF"&&(G+=lt)}var gt,O;return Q}}(E,0);j.response=E,j.rgbaoutput=!0,j.dataurl=!1;var C=j.header?j.header:null,z=j.frames?j.frames:null;if(C){C.loop_counter=C.loop_count,x=[C.canvas_height],v=[C.canvas_width];for(var Z=0;Z<z.length&&z[Z].blend!=0;Z++);}var I=z[0],st=N.WebPDecodeRGBA(E,I.src_off,I.src_size,v,x);I.rgba=st,I.imgwidth=v[0],I.imgheight=x[0];for(var K=0;K<v[0]*x[0]*4;K++)A[K]=st[K];return this.width=v,this.height=x,this.data=A,this}(function(e){var t=function(){return typeof Kg=="function"},n=function(x,v,A,N){var E=4,j=l;switch(N){case e.image_compression.FAST:E=1,j=o;break;case e.image_compression.MEDIUM:E=6,j=u;break;case e.image_compression.SLOW:E=9,j=f}x=i(x,v,A,j);var C=Kg(x,{level:E});return e.__addimage__.arrayBufferToBinaryString(C)},i=function(x,v,A,N){for(var E,j,C,z=x.length/v,Z=new Uint8Array(x.length+z),I=m(),st=0;st<z;st+=1){if(C=st*v,E=x.subarray(C,C+v),N)Z.set(N(E,A,j),C+st);else{for(var K,H=I.length,G=[];K<H;K+=1)G[K]=I[K](E,A,j);var Q=g(G.concat());Z.set(G[Q],C+st)}j=E}return Z},s=function(x){var v=Array.apply([],x);return v.unshift(0),v},o=function(x,v){var A,N=[],E=x.length;N[0]=1;for(var j=0;j<E;j+=1)A=x[j-v]||0,N[j+1]=x[j]-A+256&255;return N},l=function(x,v,A){var N,E=[],j=x.length;E[0]=2;for(var C=0;C<j;C+=1)N=A&&A[C]||0,E[C+1]=x[C]-N+256&255;return E},u=function(x,v,A){var N,E,j=[],C=x.length;j[0]=3;for(var z=0;z<C;z+=1)N=x[z-v]||0,E=A&&A[z]||0,j[z+1]=x[z]+256-(N+E>>>1)&255;return j},f=function(x,v,A){var N,E,j,C,z=[],Z=x.length;z[0]=4;for(var I=0;I<Z;I+=1)N=x[I-v]||0,E=A&&A[I]||0,j=A&&A[I-v]||0,C=d(N,E,j),z[I+1]=x[I]-C+256&255;return z},d=function(x,v,A){if(x===v&&v===A)return x;var N=Math.abs(v-A),E=Math.abs(x-A),j=Math.abs(x+v-A-A);return N<=E&&N<=j?x:E<=j?v:A},m=function(){return[s,o,l,u,f]},g=function(x){var v=x.map(function(A){return A.reduce(function(N,E){return N+Math.abs(E)},0)});return v.indexOf(Math.min.apply(null,v))};e.processPNG=function(x,v,A,N){var E,j,C,z,Z,I,st,K,H,G,Q,D,R,et,nt,dt=this.decode.FLATE_DECODE,W="";if(this.__addimage__.isArrayBuffer(x)&&(x=new Uint8Array(x)),this.__addimage__.isArrayBufferView(x)){if(x=(C=new P7(x)).imgData,j=C.bits,E=C.colorSpace,Z=C.colors,[4,6].indexOf(C.colorType)!==-1){if(C.bits===8){H=(K=C.pixelBitlength==32?new Uint32Array(C.decodePixels().buffer):C.pixelBitlength==16?new Uint16Array(C.decodePixels().buffer):new Uint8Array(C.decodePixels().buffer)).length,Q=new Uint8Array(H*C.colors),G=new Uint8Array(H);var lt,ut=C.pixelBitlength-C.bits;for(et=0,nt=0;et<H;et++){for(R=K[et],lt=0;lt<ut;)Q[nt++]=R>>>lt&255,lt+=C.bits;G[et]=R>>>lt&255}}if(C.bits===16){H=(K=new Uint32Array(C.decodePixels().buffer)).length,Q=new Uint8Array(H*(32/C.pixelBitlength)*C.colors),G=new Uint8Array(H*(32/C.pixelBitlength)),D=C.colors>1,et=0,nt=0;for(var wt=0;et<H;)R=K[et++],Q[nt++]=R>>>0&255,D&&(Q[nt++]=R>>>16&255,R=K[et++],Q[nt++]=R>>>0&255),G[wt++]=R>>>16&255;j=8}N!==e.image_compression.NONE&&t()?(x=n(Q,C.width*C.colors,C.colors,N),st=n(G,C.width,1,N)):(x=Q,st=G,dt=void 0)}if(C.colorType===3&&(E=this.color_spaces.INDEXED,I=C.palette,C.transparency.indexed)){var Y=C.transparency.indexed,gt=0;for(et=0,H=Y.length;et<H;++et)gt+=Y[et];if((gt/=255)===H-1&&Y.indexOf(0)!==-1)z=[Y.indexOf(0)];else if(gt!==H){for(K=C.decodePixels(),G=new Uint8Array(K.length),et=0,H=K.length;et<H;et++)G[et]=Y[K[et]];st=n(G,C.width,1)}}var O=function(q){var $;switch(q){case e.image_compression.FAST:$=11;break;case e.image_compression.MEDIUM:$=13;break;case e.image_compression.SLOW:$=14;break;default:$=12}return $}(N);return dt===this.decode.FLATE_DECODE&&(W="/Predictor "+O+" "),W+="/Colors "+Z+" /BitsPerComponent "+j+" /Columns "+C.width,(this.__addimage__.isArrayBuffer(x)||this.__addimage__.isArrayBufferView(x))&&(x=this.__addimage__.arrayBufferToBinaryString(x)),(st&&this.__addimage__.isArrayBuffer(st)||this.__addimage__.isArrayBufferView(st))&&(st=this.__addimage__.arrayBufferToBinaryString(st)),{alias:A,data:x,index:v,filter:dt,decodeParameters:W,transparency:z,palette:I,sMask:st,predictor:O,width:C.width,height:C.height,bitsPerComponent:j,colorSpace:E}}}})(Ae.API),function(e){e.processGIF89A=function(t,n,i,s){var o=new B7(t),l=o.width,u=o.height,f=[];o.decodeAndBlitFrameRGBA(0,f);var d={data:f,width:l,height:u},m=new Ag(100).encode(d,100);return e.processJPEG.call(this,m,n,i,s)},e.processGIF87A=e.processGIF89A}(Ae.API),ir.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var t=0;t<e;t++){var n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:s,green:i,blue:n,quad:o}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},ir.prototype.parseBGR=function(){this.pos=this.offset;try{var e="bit"+this.bitPP,t=this.width*this.height*4;this.data=new Uint8Array(t),this[e]()}catch(n){Mn.log("bit decode error:"+n)}},ir.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),n=t%4;for(e=this.height-1;e>=0;e--){for(var i=this.bottom_up?e:this.height-1-e,s=0;s<t;s++)for(var o=this.datav.getUint8(this.pos++,!0),l=i*this.width*4+8*s*4,u=0;u<8&&8*s+u<this.width;u++){var f=this.palette[o>>7-u&1];this.data[l+4*u]=f.blue,this.data[l+4*u+1]=f.green,this.data[l+4*u+2]=f.red,this.data[l+4*u+3]=255}n!==0&&(this.pos+=4-n)}},ir.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,n=this.height-1;n>=0;n--){for(var i=this.bottom_up?n:this.height-1-n,s=0;s<e;s++){var o=this.datav.getUint8(this.pos++,!0),l=i*this.width*4+2*s*4,u=o>>4,f=15&o,d=this.palette[u];if(this.data[l]=d.blue,this.data[l+1]=d.green,this.data[l+2]=d.red,this.data[l+3]=255,2*s+1>=this.width)break;d=this.palette[f],this.data[l+4]=d.blue,this.data[l+4+1]=d.green,this.data[l+4+2]=d.red,this.data[l+4+3]=255}t!==0&&(this.pos+=4-t)}},ir.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,i=0;i<this.width;i++){var s=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+4*i;if(s<this.palette.length){var l=this.palette[s];this.data[o]=l.red,this.data[o+1]=l.green,this.data[o+2]=l.blue,this.data[o+3]=255}else this.data[o]=255,this.data[o+1]=255,this.data[o+2]=255,this.data[o+3]=255}e!==0&&(this.pos+=4-e)}},ir.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var i=this.bottom_up?n:this.height-1-n,s=0;s<this.width;s++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var l=(o&t)/t*255|0,u=(o>>5&t)/t*255|0,f=(o>>10&t)/t*255|0,d=o>>15?255:0,m=i*this.width*4+4*s;this.data[m]=f,this.data[m+1]=u,this.data[m+2]=l,this.data[m+3]=d}this.pos+=e}},ir.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),n=parseInt("111111",2),i=this.height-1;i>=0;i--){for(var s=this.bottom_up?i:this.height-1-i,o=0;o<this.width;o++){var l=this.datav.getUint16(this.pos,!0);this.pos+=2;var u=(l&t)/t*255|0,f=(l>>5&n)/n*255|0,d=(l>>11)/t*255|0,m=s*this.width*4+4*o;this.data[m]=d,this.data[m+1]=f,this.data[m+2]=u,this.data[m+3]=255}this.pos+=e}},ir.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var i=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),l=t*this.width*4+4*n;this.data[l]=o,this.data[l+1]=s,this.data[l+2]=i,this.data[l+3]=255}this.pos+=this.width%4}},ir.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var i=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),l=this.datav.getUint8(this.pos++,!0),u=t*this.width*4+4*n;this.data[u]=o,this.data[u+1]=s,this.data[u+2]=i,this.data[u+3]=l}},ir.prototype.getData=function(){return this.data},function(e){e.processBMP=function(t,n,i,s){var o=new ir(t,!1),l=o.width,u=o.height,f={data:o.getData(),width:l,height:u},d=new Ag(100).encode(f,100);return e.processJPEG.call(this,d,n,i,s)}}(Ae.API),sy.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(t,n,i,s){var o=new sy(t),l=o.width,u=o.height,f={data:o.getData(),width:l,height:u},d=new Ag(100).encode(f,100);return e.processJPEG.call(this,d,n,i,s)}}(Ae.API),Ae.API.processRGBA=function(e,t,n){for(var i=e.data,s=i.length,o=new Uint8Array(s/4*3),l=new Uint8Array(s/4),u=0,f=0,d=0;d<s;d+=4){var m=i[d],g=i[d+1],x=i[d+2],v=i[d+3];o[u++]=m,o[u++]=g,o[u++]=x,l[f++]=v}var A=this.__addimage__.arrayBufferToBinaryString(o);return{alpha:this.__addimage__.arrayBufferToBinaryString(l),data:A,index:t,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},Ae.API.setLanguage=function(e){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[e]!==void 0&&(this.internal.languageSettings.languageCode=e,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},Pu=Ae.API,Qd=Pu.getCharWidthsArray=function(e,t){var n,i,s=(t=t||{}).font||this.internal.getFont(),o=t.fontSize||this.internal.getFontSize(),l=t.charSpace||this.internal.getCharSpace(),u=t.widths?t.widths:s.metadata.Unicode.widths,f=u.fof?u.fof:1,d=t.kerning?t.kerning:s.metadata.Unicode.kerning,m=d.fof?d.fof:1,g=t.doKerning!==!1,x=0,v=e.length,A=0,N=u[0]||f,E=[];for(n=0;n<v;n++)i=e.charCodeAt(n),typeof s.metadata.widthOfString=="function"?E.push((s.metadata.widthOfGlyph(s.metadata.characterToGlyph(i))+l*(1e3/o)||0)/1e3):(x=g&&_n(d[i])==="object"&&!isNaN(parseInt(d[i][A],10))?d[i][A]/m:0,E.push((u[i]||N)/f+x)),A=i;return E},ey=Pu.getStringUnitWidth=function(e,t){var n=(t=t||{}).fontSize||this.internal.getFontSize(),i=t.font||this.internal.getFont(),s=t.charSpace||this.internal.getCharSpace();return Pu.processArabic&&(e=Pu.processArabic(e)),typeof i.metadata.widthOfString=="function"?i.metadata.widthOfString(e,n,s)/n:Qd.apply(this,arguments).reduce(function(o,l){return o+l},0)},ny=function(e,t,n,i){for(var s=[],o=0,l=e.length,u=0;o!==l&&u+t[o]<n;)u+=t[o],o++;s.push(e.slice(0,o));var f=o;for(u=0;o!==l;)u+t[o]>i&&(s.push(e.slice(f,o)),u=0,f=o),u+=t[o],o++;return f!==o&&s.push(e.slice(f,o)),s},iy=function(e,t,n){n||(n={});var i,s,o,l,u,f,d,m=[],g=[m],x=n.textIndent||0,v=0,A=0,N=e.split(" "),E=Qd.apply(this,[" ",n])[0];if(f=n.lineIndent===-1?N[0].length+2:n.lineIndent||0){var j=Array(f).join(" "),C=[];N.map(function(Z){(Z=Z.split(/\s*\n/)).length>1?C=C.concat(Z.map(function(I,st){return(st&&I.length?`
`:"")+I})):C.push(Z[0])}),N=C,f=ey.apply(this,[j,n])}for(o=0,l=N.length;o<l;o++){var z=0;if(i=N[o],f&&i[0]==`
`&&(i=i.substr(1),z=1),x+v+(A=(s=Qd.apply(this,[i,n])).reduce(function(Z,I){return Z+I},0))>t||z){if(A>t){for(u=ny.apply(this,[i,s,t-(x+v),t]),m.push(u.shift()),m=[u.pop()];u.length;)g.push([u.shift()]);A=s.slice(i.length-(m[0]?m[0].length:0)).reduce(function(Z,I){return Z+I},0)}else m=[i];g.push(m),x=A+f,v=E}else m.push(i),x+=v+A,v=E}return d=f?function(Z,I){return(I?j:"")+Z.join(" ")}:function(Z){return Z.join(" ")},g.map(d)},Pu.splitTextToSize=function(e,t,n){var i,s=(n=n||{}).fontSize||this.internal.getFontSize(),o=(function(m){if(m.widths&&m.kerning)return{widths:m.widths,kerning:m.kerning};var g=this.internal.getFont(m.fontName,m.fontStyle);return g.metadata.Unicode?{widths:g.metadata.Unicode.widths||{0:1},kerning:g.metadata.Unicode.kerning||{}}:{font:g.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);i=Array.isArray(e)?e:String(e).split(/\r?\n/);var l=1*this.internal.scaleFactor*t/s;o.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/s:0,o.lineIndent=n.lineIndent;var u,f,d=[];for(u=0,f=i.length;u<f;u++)d=d.concat(iy.apply(this,[i[u],l,o]));return d},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="klmnopqrstuvwxyz",n={},i={},s=0;s<t.length;s++)n[t[s]]="0123456789abcdef"[s],i["0123456789abcdef"[s]]=t[s];var o=function(g){return"0x"+parseInt(g,10).toString(16)},l=e.__fontmetrics__.compress=function(g){var x,v,A,N,E=["{"];for(var j in g){if(x=g[j],isNaN(parseInt(j,10))?v="'"+j+"'":(j=parseInt(j,10),v=(v=o(j).slice(2)).slice(0,-1)+i[v.slice(-1)]),typeof x=="number")x<0?(A=o(x).slice(3),N="-"):(A=o(x).slice(2),N=""),A=N+A.slice(0,-1)+i[A.slice(-1)];else{if(_n(x)!=="object")throw new Error("Don't know what to do with value type "+_n(x)+".");A=l(x)}E.push(v+A)}return E.push("}"),E.join("")},u=e.__fontmetrics__.uncompress=function(g){if(typeof g!="string")throw new Error("Invalid argument passed to uncompress.");for(var x,v,A,N,E={},j=1,C=E,z=[],Z="",I="",st=g.length-1,K=1;K<st;K+=1)(N=g[K])=="'"?x?(A=x.join(""),x=void 0):x=[]:x?x.push(N):N=="{"?(z.push([C,A]),C={},A=void 0):N=="}"?((v=z.pop())[0][v[1]]=C,A=void 0,C=v[0]):N=="-"?j=-1:A===void 0?n.hasOwnProperty(N)?(Z+=n[N],A=parseInt(Z,16)*j,j=1,Z=""):Z+=N:n.hasOwnProperty(N)?(I+=n[N],C[A]=parseInt(I,16)*j,j=1,A=void 0,I=""):I+=N;return E},f={codePages:["WinAnsiEncoding"],WinAnsiEncoding:u("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},d={Unicode:{Courier:f,"Courier-Bold":f,"Courier-BoldOblique":f,"Courier-Oblique":f,Helvetica:f,"Helvetica-Bold":f,"Helvetica-BoldOblique":f,"Helvetica-Oblique":f,"Times-Roman":f,"Times-Bold":f,"Times-BoldItalic":f,"Times-Italic":f}},m={Unicode:{"Courier-Oblique":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":u("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":u("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":u("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:u("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:u("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":u("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:u("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":u("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":u("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":u("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":u("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(g){var x=g.font,v=m.Unicode[x.postScriptName];v&&(x.metadata.Unicode={},x.metadata.Unicode.widths=v.widths,x.metadata.Unicode.kerning=v.kerning);var A=d.Unicode[x.postScriptName];A&&(x.metadata.Unicode.encoding=A,x.encoding=A.codePages[0])}])}(Ae.API),function(e){var t=function(n){for(var i=n.length,s=new Uint8Array(i),o=0;o<i;o++)s[o]=n.charCodeAt(o);return s};e.API.events.push(["addFont",function(n){var i=void 0,s=n.font,o=n.instance;if(!s.isStandardFont){if(o===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+s.postScriptName+"').");if(typeof(i=o.existsFileInVFS(s.postScriptName)===!1?o.loadFile(s.postScriptName):o.getFileFromVFS(s.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+s.postScriptName+"').");(function(l,u){u=/^\x00\x01\x00\x00/.test(u)?t(u):t(yh(u)),l.metadata=e.API.TTFFont.open(u),l.metadata.Unicode=l.metadata.Unicode||{encoding:{},kerning:{},widths:[]},l.metadata.glyIdsUsed=[0]})(s,i)}}])}(Ae),function(e){function t(){return(je.canvg?Promise.resolve(je.canvg):Vg(()=>import("./index.es-K2clJAJ0.js"),[])).catch(function(n){return Promise.reject(new Error("Could not load canvg: "+n))}).then(function(n){return n.default?n.default:n})}Ae.API.addSvgAsImage=function(n,i,s,o,l,u,f,d){if(isNaN(i)||isNaN(s))throw Mn.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(o)||isNaN(l))throw Mn.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var m=document.createElement("canvas");m.width=o,m.height=l;var g=m.getContext("2d");g.fillStyle="#fff",g.fillRect(0,0,m.width,m.height);var x={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},v=this;return t().then(function(A){return A.fromString(g,n,x)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(A){return A.render(x)}).then(function(){v.addImage(m.toDataURL("image/jpeg",1),i,s,o,l,f,d)})}}(),Ae.API.putTotalPages=function(e){var t,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),n=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var i=1;i<=this.internal.getNumberOfPages();i++)for(var s=0;s<this.internal.pages[i].length;s++)this.internal.pages[i][s]=this.internal.pages[i][s].replace(t,n);return this},Ae.API.viewerPreferences=function(e,t){var n;e=e||{},t=t||!1;var i,s,o,l={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},u=Object.keys(l),f=[],d=0,m=0,g=0;function x(A,N){var E,j=!1;for(E=0;E<A.length;E+=1)A[E]===N&&(j=!0);return j}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(l)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var v=u.length;for(g=0;g<v;g+=1)n[u[g]].value=n[u[g]].defaultValue,n[u[g]].explicitSet=!1}if(_n(e)==="object"){for(s in e)if(o=e[s],x(u,s)&&o!==void 0){if(n[s].type==="boolean"&&typeof o=="boolean")n[s].value=o;else if(n[s].type==="name"&&x(n[s].valueSet,o))n[s].value=o;else if(n[s].type==="integer"&&Number.isInteger(o))n[s].value=o;else if(n[s].type==="array"){for(d=0;d<o.length;d+=1)if(i=!0,o[d].length===1&&typeof o[d][0]=="number")f.push(String(o[d]-1));else if(o[d].length>1){for(m=0;m<o[d].length;m+=1)typeof o[d][m]!="number"&&(i=!1);i===!0&&f.push([o[d][0]-1,o[d][1]-1].join(" "))}n[s].value="["+f.join(" ")+"]"}else n[s].value=n[s].defaultValue;n[s].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var A,N=[];for(A in n)n[A].explicitSet===!0&&(n[A].type==="name"?N.push("/"+A+" /"+n[A].value):N.push("/"+A+" "+n[A].value));N.length!==0&&this.internal.write(`/ViewerPreferences
<<
`+N.join(`
`)+`
>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},function(e){var t=function(){var i='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',s=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),o=unescape(encodeURIComponent(i)),l=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),u=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),f=unescape(encodeURIComponent("</x:xmpmeta>")),d=o.length+l.length+u.length+s.length+f.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+d+" >>"),this.internal.write("stream"),this.internal.write(s+o+l+u+f),this.internal.write("endstream"),this.internal.write("endobj")},n=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};e.addMetadata=function(i,s){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:i,namespaceuri:s||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",n),this.internal.events.subscribe("postPutResources",t)),this}}(Ae.API),function(e){var t=e.API,n=t.pdfEscape16=function(o,l){for(var u,f=l.metadata.Unicode.widths,d=["","0","00","000","0000"],m=[""],g=0,x=o.length;g<x;++g){if(u=l.metadata.characterToGlyph(o.charCodeAt(g)),l.metadata.glyIdsUsed.push(u),l.metadata.toUnicode[u]=o.charCodeAt(g),f.indexOf(u)==-1&&(f.push(u),f.push([parseInt(l.metadata.widthOfGlyph(u),10)])),u=="0")return m.join("");u=u.toString(16),m.push(d[4-u.length],u)}return m.join("")},i=function(o){var l,u,f,d,m,g,x;for(m=`/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo <<
/Registry (Adobe)
/Ordering (UCS)
/Supplement 0
>> def
/CMapName /Adobe-Identity-UCS def
/CMapType 2 def
1 begincodespacerange
<0000><ffff>
endcodespacerange`,f=[],g=0,x=(u=Object.keys(o).sort(function(v,A){return v-A})).length;g<x;g++)l=u[g],f.length>=100&&(m+=`
`+f.length+` beginbfchar
`+f.join(`
`)+`
endbfchar`,f=[]),o[l]!==void 0&&o[l]!==null&&typeof o[l].toString=="function"&&(d=("0000"+o[l].toString(16)).slice(-4),l=("0000"+(+l).toString(16)).slice(-4),f.push("<"+l+"><"+d+">"));return f.length&&(m+=`
`+f.length+` beginbfchar
`+f.join(`
`)+`
endbfchar
`),m+=`endcmap
CMapName currentdict /CMap defineresource pop
end
end`};t.events.push(["putFont",function(o){(function(l){var u=l.font,f=l.out,d=l.newObject,m=l.putStream;if(u.metadata instanceof e.API.TTFFont&&u.encoding==="Identity-H"){for(var g=u.metadata.Unicode.widths,x=u.metadata.subset.encode(u.metadata.glyIdsUsed,1),v="",A=0;A<x.length;A++)v+=String.fromCharCode(x[A]);var N=d();m({data:v,addLength1:!0,objectId:N}),f("endobj");var E=d();m({data:i(u.metadata.toUnicode),addLength1:!0,objectId:E}),f("endobj");var j=d();f("<<"),f("/Type /FontDescriptor"),f("/FontName /"+zu(u.fontName)),f("/FontFile2 "+N+" 0 R"),f("/FontBBox "+e.API.PDFObject.convert(u.metadata.bbox)),f("/Flags "+u.metadata.flags),f("/StemV "+u.metadata.stemV),f("/ItalicAngle "+u.metadata.italicAngle),f("/Ascent "+u.metadata.ascender),f("/Descent "+u.metadata.decender),f("/CapHeight "+u.metadata.capHeight),f(">>"),f("endobj");var C=d();f("<<"),f("/Type /Font"),f("/BaseFont /"+zu(u.fontName)),f("/FontDescriptor "+j+" 0 R"),f("/W "+e.API.PDFObject.convert(g)),f("/CIDToGIDMap /Identity"),f("/DW 1000"),f("/Subtype /CIDFontType2"),f("/CIDSystemInfo"),f("<<"),f("/Supplement 0"),f("/Registry (Adobe)"),f("/Ordering ("+u.encoding+")"),f(">>"),f(">>"),f("endobj"),u.objectNumber=d(),f("<<"),f("/Type /Font"),f("/Subtype /Type0"),f("/ToUnicode "+E+" 0 R"),f("/BaseFont /"+zu(u.fontName)),f("/Encoding /"+u.encoding),f("/DescendantFonts ["+C+" 0 R]"),f(">>"),f("endobj"),u.isAlreadyPutted=!0}})(o)}]),t.events.push(["putFont",function(o){(function(l){var u=l.font,f=l.out,d=l.newObject,m=l.putStream;if(u.metadata instanceof e.API.TTFFont&&u.encoding==="WinAnsiEncoding"){for(var g=u.metadata.rawData,x="",v=0;v<g.length;v++)x+=String.fromCharCode(g[v]);var A=d();m({data:x,addLength1:!0,objectId:A}),f("endobj");var N=d();m({data:i(u.metadata.toUnicode),addLength1:!0,objectId:N}),f("endobj");var E=d();f("<<"),f("/Descent "+u.metadata.decender),f("/CapHeight "+u.metadata.capHeight),f("/StemV "+u.metadata.stemV),f("/Type /FontDescriptor"),f("/FontFile2 "+A+" 0 R"),f("/Flags 96"),f("/FontBBox "+e.API.PDFObject.convert(u.metadata.bbox)),f("/FontName /"+zu(u.fontName)),f("/ItalicAngle "+u.metadata.italicAngle),f("/Ascent "+u.metadata.ascender),f(">>"),f("endobj"),u.objectNumber=d();for(var j=0;j<u.metadata.hmtx.widths.length;j++)u.metadata.hmtx.widths[j]=parseInt(u.metadata.hmtx.widths[j]*(1e3/u.metadata.head.unitsPerEm));f("<</Subtype/TrueType/Type/Font/ToUnicode "+N+" 0 R/BaseFont/"+zu(u.fontName)+"/FontDescriptor "+E+" 0 R/Encoding/"+u.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(u.metadata.hmtx.widths)+">>"),f("endobj"),u.isAlreadyPutted=!0}})(o)}]);var s=function(o){var l,u=o.text||"",f=o.x,d=o.y,m=o.options||{},g=o.mutex||{},x=g.pdfEscape,v=g.activeFontKey,A=g.fonts,N=v,E="",j=0,C="",z=A[N].encoding;if(A[N].encoding!=="Identity-H")return{text:u,x:f,y:d,options:m,mutex:g};for(C=u,N=v,Array.isArray(u)&&(C=u[0]),j=0;j<C.length;j+=1)A[N].metadata.hasOwnProperty("cmap")&&(l=A[N].metadata.cmap.unicode.codeMap[C[j].charCodeAt(0)]),l||C[j].charCodeAt(0)<256&&A[N].metadata.hasOwnProperty("Unicode")?E+=C[j]:E+="";var Z="";return parseInt(N.slice(1))<14||z==="WinAnsiEncoding"?Z=x(E,N).split("").map(function(I){return I.charCodeAt(0).toString(16)}).join(""):z==="Identity-H"&&(Z=n(E,A[N])),g.isHex=!0,{text:Z,x:f,y:d,options:m,mutex:g}};t.events.push(["postProcessText",function(o){var l=o.text||"",u=[],f={text:l,x:o.x,y:o.y,options:o.options,mutex:o.mutex};if(Array.isArray(l)){var d=0;for(d=0;d<l.length;d+=1)Array.isArray(l[d])&&l[d].length===3?u.push([s(Object.assign({},f,{text:l[d][0]})).text,l[d][1],l[d][2]]):u.push(s(Object.assign({},f,{text:l[d]})).text);o.text=u}else o.text=s(Object.assign({},f,{text:l})).text}])}(Ae),function(e){var t=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(n){return t.call(this),this.internal.vFS[n]!==void 0},e.addFileToVFS=function(n,i){return t.call(this),this.internal.vFS[n]=i,this},e.getFileFromVFS=function(n){return t.call(this),this.internal.vFS[n]!==void 0?this.internal.vFS[n]:null}}(Ae.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(i){var s,o,l,u,f,d,m,g=t,x=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],v=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],A={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},N={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},E=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],j=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),C=!1,z=0;this.__bidiEngine__={};var Z=function(D){var R=D.charCodeAt(),et=R>>8,nt=N[et];return nt!==void 0?g[256*nt+(255&R)]:et===252||et===253?"AL":j.test(et)?"L":et===8?"R":"N"},I=function(D){for(var R,et=0;et<D.length;et++){if((R=Z(D.charAt(et)))==="L")return!1;if(R==="R")return!0}return!1},st=function(D,R,et,nt){var dt,W,lt,ut,wt=R[nt];switch(wt){case"L":case"R":C=!1;break;case"N":case"AN":break;case"EN":C&&(wt="AN");break;case"AL":C=!0,wt="R";break;case"WS":wt="N";break;case"CS":nt<1||nt+1>=R.length||(dt=et[nt-1])!=="EN"&&dt!=="AN"||(W=R[nt+1])!=="EN"&&W!=="AN"?wt="N":C&&(W="AN"),wt=W===dt?W:"N";break;case"ES":wt=(dt=nt>0?et[nt-1]:"B")==="EN"&&nt+1<R.length&&R[nt+1]==="EN"?"EN":"N";break;case"ET":if(nt>0&&et[nt-1]==="EN"){wt="EN";break}if(C){wt="N";break}for(lt=nt+1,ut=R.length;lt<ut&&R[lt]==="ET";)lt++;wt=lt<ut&&R[lt]==="EN"?"EN":"N";break;case"NSM":if(l&&!u){for(ut=R.length,lt=nt+1;lt<ut&&R[lt]==="NSM";)lt++;if(lt<ut){var Y=D[nt],gt=Y>=1425&&Y<=2303||Y===64286;if(dt=R[lt],gt&&(dt==="R"||dt==="AL")){wt="R";break}}}wt=nt<1||(dt=R[nt-1])==="B"?"N":et[nt-1];break;case"B":C=!1,s=!0,wt=z;break;case"S":o=!0,wt="N";break;case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":C=!1;break;case"BN":wt="N"}return wt},K=function(D,R,et){var nt=D.split("");return et&&H(nt,et,{hiLevel:z}),nt.reverse(),R&&R.reverse(),nt.join("")},H=function(D,R,et){var nt,dt,W,lt,ut,wt=-1,Y=D.length,gt=0,O=[],q=z?v:x,$=[];for(C=!1,s=!1,o=!1,dt=0;dt<Y;dt++)$[dt]=Z(D[dt]);for(W=0;W<Y;W++){if(ut=gt,O[W]=st(D,$,O,W),nt=240&(gt=q[ut][A[O[W]]]),gt&=15,R[W]=lt=q[gt][5],nt>0)if(nt===16){for(dt=wt;dt<W;dt++)R[dt]=1;wt=-1}else wt=-1;if(q[gt][6])wt===-1&&(wt=W);else if(wt>-1){for(dt=wt;dt<W;dt++)R[dt]=lt;wt=-1}$[W]==="B"&&(R[W]=0),et.hiLevel|=lt}o&&function(rt,at,At){for(var St=0;St<At;St++)if(rt[St]==="S"){at[St]=z;for(var Tt=St-1;Tt>=0&&rt[Tt]==="WS";Tt--)at[Tt]=z}}($,R,Y)},G=function(D,R,et,nt,dt){if(!(dt.hiLevel<D)){if(D===1&&z===1&&!s)return R.reverse(),void(et&&et.reverse());for(var W,lt,ut,wt,Y=R.length,gt=0;gt<Y;){if(nt[gt]>=D){for(ut=gt+1;ut<Y&&nt[ut]>=D;)ut++;for(wt=gt,lt=ut-1;wt<lt;wt++,lt--)W=R[wt],R[wt]=R[lt],R[lt]=W,et&&(W=et[wt],et[wt]=et[lt],et[lt]=W);gt=ut}gt++}}},Q=function(D,R,et){var nt=D.split(""),dt={hiLevel:z};return et||(et=[]),H(nt,et,dt),function(W,lt,ut){if(ut.hiLevel!==0&&m)for(var wt,Y=0;Y<W.length;Y++)lt[Y]===1&&(wt=E.indexOf(W[Y]))>=0&&(W[Y]=E[wt+1])}(nt,et,dt),G(2,nt,R,et,dt),G(1,nt,R,et,dt),nt.join("")};return this.__bidiEngine__.doBidiReorder=function(D,R,et){if(function(dt,W){if(W)for(var lt=0;lt<dt.length;lt++)W[lt]=lt;u===void 0&&(u=I(dt)),d===void 0&&(d=I(dt))}(D,R),l||!f||d)if(l&&f&&u^d)z=u?1:0,D=K(D,R,et);else if(!l&&f&&d)z=u?1:0,D=Q(D,R,et),D=K(D,R);else if(!l||u||f||d){if(l&&!f&&u^d)D=K(D,R),u?(z=0,D=Q(D,R,et)):(z=1,D=Q(D,R,et),D=K(D,R));else if(l&&u&&!f&&d)z=1,D=Q(D,R,et),D=K(D,R);else if(!l&&!f&&u^d){var nt=m;u?(z=1,D=Q(D,R,et),z=0,m=!1,D=Q(D,R,et),m=nt):(z=0,D=Q(D,R,et),D=K(D,R),z=1,m=!1,D=Q(D,R,et),m=nt,D=K(D,R))}}else z=0,D=Q(D,R,et);else z=u?1:0,D=Q(D,R,et);return D},this.__bidiEngine__.setOptions=function(D){D&&(l=D.isInputVisual,f=D.isOutputVisual,u=D.isInputRtl,d=D.isOutputRtl,m=D.isSymmetricSwapping)},this.__bidiEngine__.setOptions(i),this.__bidiEngine__};var t=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],n=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(i){var s=i.text;i.x,i.y;var o=i.options||{};i.mutex,o.lang;var l=[];if(o.isInputVisual=typeof o.isInputVisual!="boolean"||o.isInputVisual,n.setOptions(o),Object.prototype.toString.call(s)==="[object Array]"){var u=0;for(l=[],u=0;u<s.length;u+=1)Object.prototype.toString.call(s[u])==="[object Array]"?l.push([n.doBidiReorder(s[u][0]),s[u][1],s[u][2]]):l.push([n.doBidiReorder(s[u])]);i.text=l}else i.text=n.doBidiReorder(s);n.setOptions({isInputVisual:!0})}])}(Ae),Ae.API.TTFFont=function(){function e(t){var n;if(this.rawData=t,n=this.contents=new Vl(t),this.contents.pos=4,n.readString(4)==="ttcf")throw new Error("TTCF not supported.");n.pos=0,this.parse(),this.subset=new Q7(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new z7(this.contents),this.head=new q7(this),this.name=new Y7(this),this.cmap=new fx(this),this.toUnicode={},this.hhea=new U7(this),this.maxp=new G7(this),this.hmtx=new W7(this),this.post=new H7(this),this.os2=new I7(this),this.loca=new Z7(this),this.glyf=new X7(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var t,n,i,s,o;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var l,u,f,d;for(d=[],l=0,u=(f=this.bbox).length;l<u;l++)t=f[l],d.push(Math.round(t*this.scaleFactor));return d}).call(this),this.stemV=0,this.post.exists?(i=255&(s=this.post.italic_angle),(32768&(n=s>>16))!=0&&(n=-(1+(65535^n))),this.italicAngle=+(n+"."+i)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(o=this.familyClass)===1||o===2||o===3||o===4||o===5||o===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(t){var n;return((n=this.cmap.unicode)!=null?n.codeMap[t]:void 0)||0},e.prototype.widthOfGlyph=function(t){var n;return n=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*n},e.prototype.widthOfString=function(t,n,i){var s,o,l,u;for(l=0,o=0,u=(t=""+t).length;0<=u?o<u:o>u;o=0<=u?++o:--o)s=t.charCodeAt(o),l+=this.widthOfGlyph(this.characterToGlyph(s))+i*(1e3/n)||0;return l*(n/1e3)},e.prototype.lineHeight=function(t,n){var i;return n==null&&(n=!1),i=n?this.lineGap:0,(this.ascender+i-this.decender)/1e3*t},e}();var dr,Vl=function(){function e(t){this.data=t??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(t){return this.data[this.pos++]=t},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt32=function(){var t;return(t=this.readUInt32())>=2147483648?t-4294967296:t},e.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt16=function(){var t;return(t=this.readUInt16())>=32768?t-65536:t},e.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},e.prototype.readString=function(t){var n,i;for(i=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)i[n]=String.fromCharCode(this.readByte());return i.join("")},e.prototype.writeString=function(t){var n,i,s;for(s=[],n=0,i=t.length;0<=i?n<i:n>i;n=0<=i?++n:--n)s.push(this.writeByte(t.charCodeAt(n)));return s},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(t){return this.writeInt16(t)},e.prototype.readLongLong=function(){var t,n,i,s,o,l,u,f;return t=this.readByte(),n=this.readByte(),i=this.readByte(),s=this.readByte(),o=this.readByte(),l=this.readByte(),u=this.readByte(),f=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^n)+1099511627776*(255^i)+4294967296*(255^s)+16777216*(255^o)+65536*(255^l)+256*(255^u)+(255^f)+1):72057594037927940*t+281474976710656*n+1099511627776*i+4294967296*s+16777216*o+65536*l+256*u+f},e.prototype.writeLongLong=function(t){var n,i;return n=Math.floor(t/4294967296),i=4294967295&t,this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n),this.writeByte(i>>24&255),this.writeByte(i>>16&255),this.writeByte(i>>8&255),this.writeByte(255&i)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(t){return this.writeInt32(t)},e.prototype.read=function(t){var n,i;for(n=[],i=0;0<=t?i<t:i>t;i=0<=t?++i:--i)n.push(this.readByte());return n},e.prototype.write=function(t){var n,i,s,o;for(o=[],i=0,s=t.length;i<s;i++)n=t[i],o.push(this.writeByte(n));return o},e}(),z7=function(){var e;function t(n){var i,s,o;for(this.scalarType=n.readInt(),this.tableCount=n.readShort(),this.searchRange=n.readShort(),this.entrySelector=n.readShort(),this.rangeShift=n.readShort(),this.tables={},s=0,o=this.tableCount;0<=o?s<o:s>o;s=0<=o?++s:--s)i={tag:n.readString(4),checksum:n.readInt(),offset:n.readInt(),length:n.readInt()},this.tables[i.tag]=i}return t.prototype.encode=function(n){var i,s,o,l,u,f,d,m,g,x,v,A,N;for(N in v=Object.keys(n).length,f=Math.log(2),g=16*Math.floor(Math.log(v)/f),l=Math.floor(g/f),m=16*v-g,(s=new Vl).writeInt(this.scalarType),s.writeShort(v),s.writeShort(g),s.writeShort(l),s.writeShort(m),o=16*v,d=s.pos+o,u=null,A=[],n)for(x=n[N],s.writeString(N),s.writeInt(e(x)),s.writeInt(d),s.writeInt(x.length),A=A.concat(x),N==="head"&&(u=d),d+=x.length;d%4;)A.push(0),d++;return s.write(A),i=2981146554-e(s.data),s.pos=u+8,s.writeUInt32(i),s.data},e=function(n){var i,s,o,l;for(n=hx.call(n);n.length%4;)n.push(0);for(o=new Vl(n),s=0,i=0,l=n.length;i<l;i=i+=4)s+=o.readUInt32();return 4294967295&s},t}(),F7={}.hasOwnProperty,io=function(e,t){for(var n in t)F7.call(t,n)&&(e[n]=t[n]);function i(){this.constructor=e}return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e};dr=function(){function e(t){var n;this.file=t,n=this.file.directory.tables[this.tag],this.exists=!!n,n&&(this.offset=n.offset,this.length=n.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var q7=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return io(t,dr),t.prototype.tag="head",t.prototype.parse=function(n){return n.pos=this.offset,this.version=n.readInt(),this.revision=n.readInt(),this.checkSumAdjustment=n.readInt(),this.magicNumber=n.readInt(),this.flags=n.readShort(),this.unitsPerEm=n.readShort(),this.created=n.readLongLong(),this.modified=n.readLongLong(),this.xMin=n.readShort(),this.yMin=n.readShort(),this.xMax=n.readShort(),this.yMax=n.readShort(),this.macStyle=n.readShort(),this.lowestRecPPEM=n.readShort(),this.fontDirectionHint=n.readShort(),this.indexToLocFormat=n.readShort(),this.glyphDataFormat=n.readShort()},t.prototype.encode=function(n){var i;return(i=new Vl).writeInt(this.version),i.writeInt(this.revision),i.writeInt(this.checkSumAdjustment),i.writeInt(this.magicNumber),i.writeShort(this.flags),i.writeShort(this.unitsPerEm),i.writeLongLong(this.created),i.writeLongLong(this.modified),i.writeShort(this.xMin),i.writeShort(this.yMin),i.writeShort(this.xMax),i.writeShort(this.yMax),i.writeShort(this.macStyle),i.writeShort(this.lowestRecPPEM),i.writeShort(this.fontDirectionHint),i.writeShort(n),i.writeShort(this.glyphDataFormat),i.data},t}(),ry=function(){function e(t,n){var i,s,o,l,u,f,d,m,g,x,v,A,N,E,j,C,z;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=n+t.readInt(),g=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(f=0;f<256;++f)this.codeMap[f]=t.readByte();break;case 4:for(v=t.readUInt16(),x=v/2,t.pos+=6,o=function(){var Z,I;for(I=[],f=Z=0;0<=x?Z<x:Z>x;f=0<=x?++Z:--Z)I.push(t.readUInt16());return I}(),t.pos+=2,N=function(){var Z,I;for(I=[],f=Z=0;0<=x?Z<x:Z>x;f=0<=x?++Z:--Z)I.push(t.readUInt16());return I}(),d=function(){var Z,I;for(I=[],f=Z=0;0<=x?Z<x:Z>x;f=0<=x?++Z:--Z)I.push(t.readUInt16());return I}(),m=function(){var Z,I;for(I=[],f=Z=0;0<=x?Z<x:Z>x;f=0<=x?++Z:--Z)I.push(t.readUInt16());return I}(),s=(this.length-t.pos+this.offset)/2,u=function(){var Z,I;for(I=[],f=Z=0;0<=s?Z<s:Z>s;f=0<=s?++Z:--Z)I.push(t.readUInt16());return I}(),f=j=0,z=o.length;j<z;f=++j)for(E=o[f],i=C=A=N[f];A<=E?C<=E:C>=E;i=A<=E?++C:--C)m[f]===0?l=i+d[f]:(l=u[m[f]/2+(i-A)-(x-f)]||0)!==0&&(l+=d[f]),this.codeMap[i]=65535&l}t.pos=g}return e.encode=function(t,n){var i,s,o,l,u,f,d,m,g,x,v,A,N,E,j,C,z,Z,I,st,K,H,G,Q,D,R,et,nt,dt,W,lt,ut,wt,Y,gt,O,q,$,rt,at,At,St,Tt,Zt,Qt,ne;switch(nt=new Vl,l=Object.keys(t).sort(function(ie,ye){return ie-ye}),n){case"macroman":for(N=0,E=function(){var ie=[];for(A=0;A<256;++A)ie.push(0);return ie}(),C={0:0},o={},dt=0,wt=l.length;dt<wt;dt++)C[Tt=t[s=l[dt]]]==null&&(C[Tt]=++N),o[s]={old:t[s],new:C[t[s]]},E[s]=C[t[s]];return nt.writeUInt16(1),nt.writeUInt16(0),nt.writeUInt32(12),nt.writeUInt16(0),nt.writeUInt16(262),nt.writeUInt16(0),nt.write(E),{charMap:o,subtable:nt.data,maxGlyphID:N+1};case"unicode":for(R=[],g=[],z=0,C={},i={},j=d=null,W=0,Y=l.length;W<Y;W++)C[I=t[s=l[W]]]==null&&(C[I]=++z),i[s]={old:I,new:C[I]},u=C[I]-s,j!=null&&u===d||(j&&g.push(j),R.push(s),d=u),j=s;for(j&&g.push(j),g.push(65535),R.push(65535),Q=2*(G=R.length),H=2*Math.pow(Math.log(G)/Math.LN2,2),x=Math.log(H/2)/Math.LN2,K=2*G-H,f=[],st=[],v=[],A=lt=0,gt=R.length;lt<gt;A=++lt){if(D=R[A],m=g[A],D===65535){f.push(0),st.push(0);break}if(D-(et=i[D].new)>=32768)for(f.push(0),st.push(2*(v.length+G-A)),s=ut=D;D<=m?ut<=m:ut>=m;s=D<=m?++ut:--ut)v.push(i[s].new);else f.push(et-D),st.push(0)}for(nt.writeUInt16(3),nt.writeUInt16(1),nt.writeUInt32(12),nt.writeUInt16(4),nt.writeUInt16(16+8*G+2*v.length),nt.writeUInt16(0),nt.writeUInt16(Q),nt.writeUInt16(H),nt.writeUInt16(x),nt.writeUInt16(K),At=0,O=g.length;At<O;At++)s=g[At],nt.writeUInt16(s);for(nt.writeUInt16(0),St=0,q=R.length;St<q;St++)s=R[St],nt.writeUInt16(s);for(Zt=0,$=f.length;Zt<$;Zt++)u=f[Zt],nt.writeUInt16(u);for(Qt=0,rt=st.length;Qt<rt;Qt++)Z=st[Qt],nt.writeUInt16(Z);for(ne=0,at=v.length;ne<at;ne++)N=v[ne],nt.writeUInt16(N);return{charMap:i,subtable:nt.data,maxGlyphID:z+1}}},e}(),fx=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return io(t,dr),t.prototype.tag="cmap",t.prototype.parse=function(n){var i,s,o;for(n.pos=this.offset,this.version=n.readUInt16(),o=n.readUInt16(),this.tables=[],this.unicode=null,s=0;0<=o?s<o:s>o;s=0<=o?++s:--s)i=new ry(n,this.offset),this.tables.push(i),i.isUnicode&&this.unicode==null&&(this.unicode=i);return!0},t.encode=function(n,i){var s,o;return i==null&&(i="macroman"),s=ry.encode(n,i),(o=new Vl).writeUInt16(0),o.writeUInt16(1),s.table=o.data.concat(s.subtable),s},t}(),U7=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return io(t,dr),t.prototype.tag="hhea",t.prototype.parse=function(n){return n.pos=this.offset,this.version=n.readInt(),this.ascender=n.readShort(),this.decender=n.readShort(),this.lineGap=n.readShort(),this.advanceWidthMax=n.readShort(),this.minLeftSideBearing=n.readShort(),this.minRightSideBearing=n.readShort(),this.xMaxExtent=n.readShort(),this.caretSlopeRise=n.readShort(),this.caretSlopeRun=n.readShort(),this.caretOffset=n.readShort(),n.pos+=8,this.metricDataFormat=n.readShort(),this.numberOfMetrics=n.readUInt16()},t}(),I7=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return io(t,dr),t.prototype.tag="OS/2",t.prototype.parse=function(n){if(n.pos=this.offset,this.version=n.readUInt16(),this.averageCharWidth=n.readShort(),this.weightClass=n.readUInt16(),this.widthClass=n.readUInt16(),this.type=n.readShort(),this.ySubscriptXSize=n.readShort(),this.ySubscriptYSize=n.readShort(),this.ySubscriptXOffset=n.readShort(),this.ySubscriptYOffset=n.readShort(),this.ySuperscriptXSize=n.readShort(),this.ySuperscriptYSize=n.readShort(),this.ySuperscriptXOffset=n.readShort(),this.ySuperscriptYOffset=n.readShort(),this.yStrikeoutSize=n.readShort(),this.yStrikeoutPosition=n.readShort(),this.familyClass=n.readShort(),this.panose=function(){var i,s;for(s=[],i=0;i<10;++i)s.push(n.readByte());return s}(),this.charRange=function(){var i,s;for(s=[],i=0;i<4;++i)s.push(n.readInt());return s}(),this.vendorID=n.readString(4),this.selection=n.readShort(),this.firstCharIndex=n.readShort(),this.lastCharIndex=n.readShort(),this.version>0&&(this.ascent=n.readShort(),this.descent=n.readShort(),this.lineGap=n.readShort(),this.winAscent=n.readShort(),this.winDescent=n.readShort(),this.codePageRange=function(){var i,s;for(s=[],i=0;i<2;i=++i)s.push(n.readInt());return s}(),this.version>1))return this.xHeight=n.readShort(),this.capHeight=n.readShort(),this.defaultChar=n.readShort(),this.breakChar=n.readShort(),this.maxContext=n.readShort()},t}(),H7=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return io(t,dr),t.prototype.tag="post",t.prototype.parse=function(n){var i,s,o;switch(n.pos=this.offset,this.format=n.readInt(),this.italicAngle=n.readInt(),this.underlinePosition=n.readShort(),this.underlineThickness=n.readShort(),this.isFixedPitch=n.readInt(),this.minMemType42=n.readInt(),this.maxMemType42=n.readInt(),this.minMemType1=n.readInt(),this.maxMemType1=n.readInt(),this.format){case 65536:break;case 131072:var l;for(s=n.readUInt16(),this.glyphNameIndex=[],l=0;0<=s?l<s:l>s;l=0<=s?++l:--l)this.glyphNameIndex.push(n.readUInt16());for(this.names=[],o=[];n.pos<this.offset+this.length;)i=n.readByte(),o.push(this.names.push(n.readString(i)));return o;case 151552:return s=n.readUInt16(),this.offsets=n.read(s);case 196608:break;case 262144:return this.map=(function(){var u,f,d;for(d=[],l=u=0,f=this.file.maxp.numGlyphs;0<=f?u<f:u>f;l=0<=f?++u:--u)d.push(n.readUInt32());return d}).call(this)}},t}(),V7=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},Y7=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return io(t,dr),t.prototype.tag="name",t.prototype.parse=function(n){var i,s,o,l,u,f,d,m,g,x,v;for(n.pos=this.offset,n.readShort(),i=n.readShort(),f=n.readShort(),s=[],l=0;0<=i?l<i:l>i;l=0<=i?++l:--l)s.push({platformID:n.readShort(),encodingID:n.readShort(),languageID:n.readShort(),nameID:n.readShort(),length:n.readShort(),offset:this.offset+f+n.readShort()});for(d={},l=g=0,x=s.length;g<x;l=++g)o=s[l],n.pos=o.offset,m=n.readString(o.length),u=new V7(m,o),d[v=o.nameID]==null&&(d[v]=[]),d[o.nameID].push(u);this.strings=d,this.copyright=d[0],this.fontFamily=d[1],this.fontSubfamily=d[2],this.uniqueSubfamily=d[3],this.fontName=d[4],this.version=d[5];try{this.postscriptName=d[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=d[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=d[7],this.manufacturer=d[8],this.designer=d[9],this.description=d[10],this.vendorUrl=d[11],this.designerUrl=d[12],this.license=d[13],this.licenseUrl=d[14],this.preferredFamily=d[15],this.preferredSubfamily=d[17],this.compatibleFull=d[18],this.sampleText=d[19]},t}(),G7=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return io(t,dr),t.prototype.tag="maxp",t.prototype.parse=function(n){return n.pos=this.offset,this.version=n.readInt(),this.numGlyphs=n.readUInt16(),this.maxPoints=n.readUInt16(),this.maxContours=n.readUInt16(),this.maxCompositePoints=n.readUInt16(),this.maxComponentContours=n.readUInt16(),this.maxZones=n.readUInt16(),this.maxTwilightPoints=n.readUInt16(),this.maxStorage=n.readUInt16(),this.maxFunctionDefs=n.readUInt16(),this.maxInstructionDefs=n.readUInt16(),this.maxStackElements=n.readUInt16(),this.maxSizeOfInstructions=n.readUInt16(),this.maxComponentElements=n.readUInt16(),this.maxComponentDepth=n.readUInt16()},t}(),W7=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return io(t,dr),t.prototype.tag="hmtx",t.prototype.parse=function(n){var i,s,o,l,u,f,d;for(n.pos=this.offset,this.metrics=[],i=0,f=this.file.hhea.numberOfMetrics;0<=f?i<f:i>f;i=0<=f?++i:--i)this.metrics.push({advance:n.readUInt16(),lsb:n.readInt16()});for(o=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var m,g;for(g=[],i=m=0;0<=o?m<o:m>o;i=0<=o?++m:--m)g.push(n.readInt16());return g}(),this.widths=(function(){var m,g,x,v;for(v=[],m=0,g=(x=this.metrics).length;m<g;m++)l=x[m],v.push(l.advance);return v}).call(this),s=this.widths[this.widths.length-1],d=[],i=u=0;0<=o?u<o:u>o;i=0<=o?++u:--u)d.push(this.widths.push(s));return d},t.prototype.forGlyph=function(n){return n in this.metrics?this.metrics[n]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[n-this.metrics.length]}},t}(),hx=[].slice,X7=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return io(t,dr),t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(n){var i,s,o,l,u,f,d,m,g,x;return n in this.cache?this.cache[n]:(l=this.file.loca,i=this.file.contents,s=l.indexOf(n),(o=l.lengthOf(n))===0?this.cache[n]=null:(i.pos=this.offset+s,u=(f=new Vl(i.read(o))).readShort(),m=f.readShort(),x=f.readShort(),d=f.readShort(),g=f.readShort(),this.cache[n]=u===-1?new $7(f,m,x,d,g):new K7(f,u,m,x,d,g),this.cache[n]))},t.prototype.encode=function(n,i,s){var o,l,u,f,d;for(u=[],l=[],f=0,d=i.length;f<d;f++)o=n[i[f]],l.push(u.length),o&&(u=u.concat(o.encode(s)));return l.push(u.length),{table:u,offsets:l}},t}(),K7=function(){function e(t,n,i,s,o,l){this.raw=t,this.numberOfContours=n,this.xMin=i,this.yMin=s,this.xMax=o,this.yMax=l,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),$7=function(){function e(t,n,i,s,o){var l,u;for(this.raw=t,this.xMin=n,this.yMin=i,this.xMax=s,this.yMax=o,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],l=this.raw;u=l.readShort(),this.glyphOffsets.push(l.pos),this.glyphIDs.push(l.readUInt16()),32&u;)l.pos+=1&u?4:2,128&u?l.pos+=8:64&u?l.pos+=4:8&u&&(l.pos+=2)}return e.prototype.encode=function(){var t,n,i;for(n=new Vl(hx.call(this.raw.data)),t=0,i=this.glyphIDs.length;t<i;++t)n.pos=this.glyphOffsets[t];return n.data},e}(),Z7=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return io(t,dr),t.prototype.tag="loca",t.prototype.parse=function(n){var i,s;return n.pos=this.offset,i=this.file.head.indexToLocFormat,this.offsets=i===0?(function(){var o,l;for(l=[],s=0,o=this.length;s<o;s+=2)l.push(2*n.readUInt16());return l}).call(this):(function(){var o,l;for(l=[],s=0,o=this.length;s<o;s+=4)l.push(n.readUInt32());return l}).call(this)},t.prototype.indexOf=function(n){return this.offsets[n]},t.prototype.lengthOf=function(n){return this.offsets[n+1]-this.offsets[n]},t.prototype.encode=function(n,i){for(var s=new Uint32Array(this.offsets.length),o=0,l=0,u=0;u<s.length;++u)if(s[u]=o,l<i.length&&i[l]==u){++l,s[u]=o;var f=this.offsets[u],d=this.offsets[u+1]-f;d>0&&(o+=d)}for(var m=new Array(4*s.length),g=0;g<s.length;++g)m[4*g+3]=255&s[g],m[4*g+2]=(65280&s[g])>>8,m[4*g+1]=(16711680&s[g])>>16,m[4*g]=(4278190080&s[g])>>24;return m},t}(),Q7=function(){function e(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var t,n,i,s,o;for(n in s=this.font.cmap.tables[0].codeMap,t={},o=this.subset)i=o[n],t[n]=s[i];return t},e.prototype.glyphsFor=function(t){var n,i,s,o,l,u,f;for(s={},l=0,u=t.length;l<u;l++)s[o=t[l]]=this.font.glyf.glyphFor(o);for(o in n=[],s)(i=s[o])!=null&&i.compound&&n.push.apply(n,i.glyphIDs);if(n.length>0)for(o in f=this.glyphsFor(n))i=f[o],s[o]=i;return s},e.prototype.encode=function(t,n){var i,s,o,l,u,f,d,m,g,x,v,A,N,E,j;for(s in i=fx.encode(this.generateCmap(),"unicode"),l=this.glyphsFor(t),v={0:0},j=i.charMap)v[(f=j[s]).old]=f.new;for(A in x=i.maxGlyphID,l)A in v||(v[A]=x++);return m=function(C){var z,Z;for(z in Z={},C)Z[C[z]]=z;return Z}(v),g=Object.keys(m).sort(function(C,z){return C-z}),N=function(){var C,z,Z;for(Z=[],C=0,z=g.length;C<z;C++)u=g[C],Z.push(m[u]);return Z}(),o=this.font.glyf.encode(l,N,v),d=this.font.loca.encode(o.offsets,N),E={cmap:this.font.cmap.raw(),glyf:o.table,loca:d,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(n)},this.font.os2.exists&&(E["OS/2"]=this.font.os2.raw()),this.font.directory.encode(E)},e}();Ae.API.PDFObject=function(){var e;function t(){}return e=function(n,i){return(Array(i+1).join("0")+n).slice(-i)},t.convert=function(n){var i,s,o,l;if(Array.isArray(n))return"["+function(){var u,f,d;for(d=[],u=0,f=n.length;u<f;u++)i=n[u],d.push(t.convert(i));return d}().join(" ")+"]";if(typeof n=="string")return"/"+n;if(n?.isString)return"("+n+")";if(n instanceof Date)return"(D:"+e(n.getUTCFullYear(),4)+e(n.getUTCMonth(),2)+e(n.getUTCDate(),2)+e(n.getUTCHours(),2)+e(n.getUTCMinutes(),2)+e(n.getUTCSeconds(),2)+"Z)";if({}.toString.call(n)==="[object Object]"){for(s in o=["<<"],n)l=n[s],o.push("/"+s+" "+t.convert(l));return o.push(">>"),o.join(`
`)}return""+n},t}();function Ep(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}const J7=({patientData:e,testData:t,pureToneLeftCanvas:n,pureToneRightCanvas:i,speechCanvas:s})=>new Promise((o,l)=>{try{const u=new Ae;u.setFontSize(10),u.setFont("times","bold");const d={title:e.patient_name+" - "+new Date().toLocaleDateString("en-GB")+" - Audiogram",author:"Assersoft.com"};u.setProperties(d),u.text(`Patient Name: ${Ep(e.patient_name)}`,10,35);const m=e.patient_dob==null?"N/A":new Date(e.patient_dob).toLocaleDateString("en-GB");u.text(`Date of Birth: ${m}`,10,40),u.text(`Sex: ${Ep(e.patient_sex)}`,100,35),u.text(`Case No: ${e.patient_id}`,175,35),u.text(`Date: ${new Date().toLocaleDateString("en-GB")}`,175,40),u.setFontSize(14),u.text("Pure Tone Audiometry",35,49),u.text("Pure Tone Audiometry",135,49),n&&i&&(u.addImage(n,"JPEG",110,50,93,100),u.addImage(i,"JPEG",10,50,93,100)),u.setFontSize(12),u.text("Left Ear",150,153),u.text("Right Ear",50,153),t.showSpeechTest&&s&&u.addImage(s,"JPEG",10,170,190,80);const g=u.output("blob"),x=URL.createObjectURL(g);window.open(x,"_blank"),o()}catch(u){l(u)}}),tL=()=>{const e=typeof window<"u"&&window.innerWidth<1024;return{animation:!1,responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(t){return`${t.dataset.label}: ${t.raw}`}}},textPlugin:{}},scales:{x:{grid:{color:"black"},ticks:{font:{size:e?15:20},color:"black"},beginAtZero:!0,title:{display:!0,text:"Frequency Hz.",color:"black",font:{size:e?16:22,weight:"bold"}},min:0},y:{grid:{color:"black"},beginAtZero:!0,title:{display:!0,text:"Hearing Level (dB I.S.O.)",color:"#000",font:{size:e?16:22,weight:"bold"}},min:-20,max:120,ticks:{font:{size:e?15:20},stepSize:10,color:"black"},reverse:!0}}}},eL=()=>{const e=typeof window<"u"&&window.innerWidth<1024;return{animation:!1,responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(t){return`${t.dataset.label}: ${t.raw}`}}},textPlugin:!1},scales:{x:{grid:{color:"black"},beginAtZero:!0,title:{display:!0,text:"Relative Speech Level (dB)",color:"black",font:{size:e?16:22,weight:"bold"}},ticks:{color:"black",font:{size:e?15:20}}},y:{grid:{color:"black"},beginAtZero:!0,title:{display:!0,text:"Score (%)",color:"black",font:{size:e?16:22,weight:"bold"}},min:0,max:100,ticks:{stepSize:10,color:"black",font:{size:e?15:20}},reverse:!1}}}},nL=()=>({animation:!1,responsive:!0,maintainAspectRatio:!0,plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(e){return`${e.dataset.label}: ${e.raw}`}}},textPlugin:!1},scales:{x:{type:"linear",grid:{drawBorder:!0,display:!0,color:e=>e.tick.value===0|e.tick.value===-300?"black":"transparent"},beginAtZero:!0,title:{display:!0,text:"daPa",color:"#000",font:{size:14,weight:"bold"}},min:-300,max:200,ticks:{stepSize:100,color:"black"}},y:{grid:{color:"black"},beginAtZero:!0,title:{display:!0,text:"ml",color:"#000",font:{size:14,weight:"bold"}},max:3,min:0,ticks:{stepSize:.4,color:"black"},reverse:!1}}}),iL={id:"textPlugin",afterDatasetsDraw(e,t,n){const{ctx:i,data:s}=e;i.save();const o=[["X","[]",">","]"],["O","△","<","["]];s.datasets.forEach((l,u)=>{const f=e.getDatasetMeta(u),d=new RegExp("L1|L2|L3|L4|Speech","i").test(f.label)?0:1;f.data.forEach((m,g)=>{const{x,y:v}=m.tooltipPosition();i.font="bold 18px Arial",i.textAlign="center",i.textBaseline="middle";const A=o[d]?.[u]||"",N=l.data[g];A&&N!==0&&N!==null&&N!==""&&i.fillText(A,x,v)})}),i.restore()}};lr.register(Dv,Fv,Rv,qv,Bv,z0,B0,iL);function aL(){const e=Ri(),{printData:t}=nf(),n=t?.patientData||{},i=t?.testData||{},s=i.pureToneData||[],o=i.speechData||[],[l,u]=ot.useState(null),[f,d]=ot.useState(null),[m,g]=ot.useState(null),[x,v]=ot.useState(null),[A,N]=ot.useState(null),[E,j]=ot.useState(!0),[C,z]=ot.useState(!1),Z=ot.useRef(null),I=ot.useRef(null),st=ot.useRef(null);ot.useEffect(()=>{t||e("/dashboard")},[t]);const K=[125,250,500,1e3,2e3,4e3,8e3],{leftEarData:H,rightEarData:G}=ot.useMemo(()=>{const D={1:[],2:[],3:[],4:[]},R={1:[],2:[],3:[],4:[]};return s.forEach(et=>{const{test_no:nt,ear:dt}=et,W=K.map(lt=>et[`frequency_${lt}`]);dt==="left"&&D[nt]?.push(...W),dt==="right"&&R[nt]?.push(...W)}),{leftEarData:{labels:K,datasets:[{label:"L1",data:D[1],borderColor:"blue",pointRadius:0,tension:0},{label:"L2",data:D[2],borderColor:"blue",pointRadius:0,tension:0},{label:"L3",data:D[3],borderColor:"blue",pointRadius:0,borderDash:[5,5],tension:0},{label:"L4",data:D[4],borderColor:"blue",pointRadius:0,borderDash:[5,5],tension:0}]},rightEarData:{labels:K,datasets:[{label:"R1",data:R[1],borderColor:"red",pointRadius:0,tension:0},{label:"R2",data:R[2],borderColor:"red",pointRadius:0,tension:0},{label:"R3",data:R[3],borderColor:"red",pointRadius:0,borderDash:[5,5],tension:0},{label:"R4",data:R[4],borderColor:"red",pointRadius:0,borderDash:[5,5],tension:0}]}}},[s]),Q=ot.useMemo(()=>({labels:[10,20,30,40,50,60,70,80,90,100,110,120],datasets:[{label:"Speech",data:o||[],borderColor:"black",pointRadius:0,tension:0}]}),[o]);return ot.useEffect(()=>{!C&&H&&G&&Q&&z(!0)},[s,o]),ot.useEffect(()=>{if(!C)return;(async()=>{await new Promise(dt=>setTimeout(dt,1e3));const R=Z.current,et=I.current;let nt=null;i.showSpeechTest&&(nt=st.current),R&&et&&(R.resize(),et.resize(),nt&&nt.resize(),setTimeout(()=>{const dt=lr.getChart(R?.ctx?.canvas),W=lr.getChart(et?.ctx?.canvas);if(dt&&W){if(g(dt.toBase64Image("image/png")),v(W.toBase64Image("image/png")),i.showSpeechTest){const lt=lr.getChart(nt?.ctx?.canvas);lt?N(lt.toBase64Image("image/png")):console.warn("Could not find speech chart instance")}j(!1)}else console.warn("Could not find ChartJS instances")},200)),j(!1)})()},[C]),ot.useEffect(()=>{!E&&m&&x&&J7({patientData:n,testData:i,pureToneLeftCanvas:m,pureToneRightCanvas:x,speechCanvas:A}).then(()=>{e(-1)}).catch(D=>{Be.error("Error generating pdf"),e(-1)})},[E,m,x,A]),ot.useEffect(()=>{u(tL()),d(eL())},[]),L.jsxs(L.Fragment,{children:[L.jsx("div",{className:"h-screen",children:L.jsx("div",{className:"h-screen w-screen top-0 left-0 fixed bg-black opacity-50 z-50 flex items-center justify-center",children:L.jsx("span",{className:"loading bg-white loading-spinner loading-lg"})})}),L.jsx("h1",{children:"Report Graph"}),L.jsxs("div",{id:"pureToneAudiometry",className:"flex flex-col",children:[L.jsxs("div",{id:"pureToneAudiometryLeft",className:"w-full lg:w-1/2 h-auto mb-4",children:[" ",L.jsx("h2",{className:"text-black text-center text-2xl lg:text-3xl pl-6 pb-4 font-bold",children:"PureTone Audiometry"}),L.jsx("div",{className:"relative",style:{height:"550px",maxWidth:"100%"},children:L.jsx(bh,{id:"leftGraph",ref:Z,data:H,options:{...l,responsive:!0,maintainAspectRatio:!1}})}),L.jsx("h3",{className:"text-black text-center pl-6 text-xl font-bold",children:"Left Ear"}),L.jsx("div",{children:L.jsx("br",{})})]}),L.jsxs("div",{id:"pureToneAudiometryRight",className:"w-full lg:w-1/2 h-auto mb-4",children:[" ",L.jsx("h2",{className:"text-black text-center text-2xl lg:text-3xl pl-6 pb-4 font-bold",children:"PureTone Audiometry"}),L.jsx("div",{className:"relative",style:{height:"550px",maxWidth:"100%"},children:L.jsx(bh,{id:"rightGraph",ref:I,data:G,options:{...l,responsive:!0,maintainAspectRatio:!1}})}),L.jsx("h3",{className:"text-black text-center pl-6 text-xl font-bold",children:"Right Ear"}),L.jsx("div",{children:L.jsx("br",{})})]})]}),i?.showSpeechTest&&L.jsx("div",{className:"flex justify-center items-center my-16",children:L.jsxs("div",{id:"speechAudiometry",className:"w-full lg:w-1/2 h-auto mb-4",children:[" ",L.jsx("h2",{className:"text-black text-center text-2xl lg:text-3xl pl-6 pb-4 font-bold",children:"Speech Audiometry"}),L.jsx("div",{className:"relative",style:{height:"550px",maxWidth:"100%"},children:L.jsx(bh,{id:"speechGraph",ref:st,data:Q,options:{...f,responsive:!0,maintainAspectRatio:!1}})})]})})]})}const sL=async({patientData:e,tympanogramTest:t,tympanogramLeftCanvas:n,tympanogramRightCanvas:i})=>new Promise((s,o)=>{try{const l=new Ae;l.setFontSize(10),l.setFont("times","bold");const f={title:e.patient_name+" - "+new Date().toLocaleDateString("en-GB")+" - Tympanogram",author:"Assersoft.com"};l.setProperties(f),l.text(`Patient Name: ${Ep(e.patient_name)}`,10,35);const d=e.patient_dob==null?"N/A":new Date(e.patient_dob).toLocaleDateString("en-GB");l.text(`Date of Birth: ${d}`,10,40),l.text(`Sex: ${Ep(e.patient_sex)}`,105,35),l.text(`Case No: ${e.patient_id}`,175,35),l.text(`Date: ${new Date().toLocaleDateString("en-GB")}`,175,40),l.setFontSize(14),l.text("Tympanogram",40,49),l.text("Tympanogram",140,49),n&&i&&(l.addImage(i,"PNG",10,50,90,100),l.addImage(n,"PNG",110,50,90,100)),l.setFontSize(12),l.text("Left Ear",150,153),l.text("Right Ear",50,153),l.setFontSize(10),l.text(`Volume: ${t.right_volume} ml`,30,160),l.text(`Volume: ${t.left_volume} ml`,130,160),l.text(`Compliance: ${t.right_compliance} ml`,30,165),l.text(`Compliance: ${t.left_compliance} ml`,130,165),l.text(`Pressure: ${t.right_pressure_2} daPa`,30,170),l.text(`Pressure: ${t.left_pressure_2} daPa`,130,170);const m=A=>new Promise((N,E)=>{const j=new Image;j.src=A,j.onload=function(){const C=document.createElement("canvas");C.width=j.width,C.height=j.height,C.getContext("2d").drawImage(j,0,0),N(C.toDataURL("image/jpeg"))},j.onerror=E});let g=30,x=200;(async()=>{})().then(()=>{const A=l.output("blob"),N=URL.createObjectURL(A);window.open(N,"_blank"),s()}).catch(o),s()}catch(l){o(l)}});lr.register(Dv,Fv,Rv,qv,Bv,z0,B0);function rL(){const{printData:e}=nf(),t=e?.testData,n=e?.patientData,i=Ri(),[s,o]=ot.useState(null),[l]=ot.useState(t?.tympanogramTest||0),[u,f]=ot.useState(null),[d,m]=ot.useState(null),[g,x]=ot.useState(!0),[v,A]=ot.useState(!1),N=ot.useRef(null),E=ot.useRef(null),j={labels:[l.left_pressure_1,l.left_pressure_2,l.left_pressure_3],datasets:[{label:"Left",data:[0,l.left_compliance,0],fill:!1,borderColor:"blue",pointStyle:"circle",pointRadius:0,pointBorderColor:"black",borderWidth:2,tension:0}]},C={labels:[l.right_pressure_1,l.right_pressure_2,l.right_pressure_3],datasets:[{label:"Right",data:[0,l.right_compliance,0],fill:!1,borderColor:"red",pointStyle:"circle",pointRadius:0,pointBorderColor:"black",borderWidth:2,tension:0}]};return ot.useEffect(()=>{!v&&j&&C&&A(!0)},[j,C]),ot.useEffect(()=>{if(!v)return;(async()=>{await new Promise(st=>setTimeout(st,1e3));const Z=N.current,I=E.current;Z&&I&&(Z.resize(),I.resize(),setTimeout(()=>{const st=lr.getChart(Z?.ctx?.canvas),K=lr.getChart(I?.ctx?.canvas);st&&K?(f(st.toBase64Image("image/png")),m(K.toBase64Image("image/png")),x(!1)):console.warn("Could not find ChartJS instances")},200)),x(!1)})()},[v]),ot.useEffect(()=>{!g&&u&&d&&sL({patientData:n,tympanogramTest:l,tympanogramLeftCanvas:u,tympanogramRightCanvas:d}).then(()=>{i(-1)}).catch(z=>{Be.error("Error generating PDF"),i(-1)})},[g,u,d]),ot.useEffect(()=>{o(nL())},[]),L.jsxs(L.Fragment,{children:[L.jsx("div",{className:"h-screen",children:L.jsx("div",{className:"h-screen w-screen top-0 left-0 fixed bg-black opacity-50 z-50 flex items-center justify-center",children:L.jsx("span",{className:"loading bg-white loading-spinner loading-lg"})})}),L.jsx("h1",{children:"Report Graph"}),L.jsxs("div",{id:"tympanogram",className:"",children:[L.jsxs("div",{id:"tympanogramLeft",className:"w-1/2 h-auto mb-4",children:[" ",L.jsx("h2",{className:"text-black text-center font-bold pl-8",children:"Tympanogram"}),L.jsx(bh,{id:"leftGraph",ref:N,data:j,options:s,width:500,height:400}),L.jsx("h3",{className:"text-black text-center font-bold pl-8",children:"Left Ear"}),L.jsx("div",{children:L.jsx("br",{})})]}),L.jsxs("div",{id:"tympanogramRight",className:"w-1/2 h-auto mb-4",children:[" ",L.jsx("h2",{className:"text-black text-center font-bold pl-8",children:"Tympanogram"}),L.jsx(bh,{id:"rightGraph",ref:E,data:C,options:s,width:500,height:400}),L.jsx("h3",{className:"text-black text-center font-bold pl-8",children:"Right Ear"}),L.jsx("div",{children:L.jsx("br",{})})]})]})]})}function oL(){const{authData:e}=ot.useContext(Ya),t=Ri(),{register:n,handleSubmit:i,setValue:s,watch:o,formState:{errors:l,isSubmitting:u}}=zp(),f=i(async m=>{m.clinic_id=e?.clinicId??-1;try{const g=await De.post("/api/users",m,{withCredentials:!0});Be.success("User added successfully"),t("/dashboard/users")}catch(g){console.error("Error adding patient:",g);const x=g.response.data.messages,v=Object.values(x).join(`
`);Be.error(v??"Something went wrong")}});function d(){const g="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";let x="";for(let v=0;v<8;v++)x+=g.charAt(Math.floor(Math.random()*g.length));return x}return ot.useEffect(()=>{document.title="Add User | Audiogram"},[]),L.jsx("div",{className:"flex flex-col",children:e?.usertype=="local"?L.jsxs("div",{className:"h-[80vh] flex flex-col justify-center items-center text-center space-y-4 p-4",children:[L.jsx("h3",{className:"text-4xl font-bold text-red-600",children:"Oops!"}),L.jsxs("p",{className:"text-lg max-w-lg",children:["It looks like you don’t have permission to access this page.",L.jsx("br",{}),"Please contact an admin if you believe this is a mistake."]}),L.jsx("div",{className:"mt-6",children:L.jsx(us,{to:"/dashboard",children:L.jsx("button",{className:"btn btn-outline btn-error",children:"Back to Dashboard"})})})]}):L.jsxs(L.Fragment,{children:[u&&L.jsx("div",{className:"h-screen w-screen top-0 left-0 fixed bg-base-100 opacity-50 z-50 flex items-center justify-center",children:L.jsx("span",{className:"loading loading-spinner loading-lg"})}),L.jsx("div",{className:"p-6",children:L.jsx("h1",{className:"text-3xl font-bold",children:"Add User"})}),L.jsxs("form",{className:"flex flex-col p-6",onSubmit:f,children:[L.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Username"})}),L.jsx("input",{type:"text",placeholder:"Enter username",className:`w-full input input-bordered ${l.username?"input-error":""}`,...n("username",{required:"Username is required",minLength:{value:3,message:"Username must be at least 3 characters"}})}),l.username&&L.jsx("p",{className:"text-error text-sm mt-1",children:l.username.message})]}),L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Usertype"})}),L.jsxs("select",{className:`w-full select select-bordered ${l.usertype?"input-error":""} ${o("usertype")==""?"text-base-content/50":""}`,...n("usertype",{required:"Usertype is required"}),children:[L.jsx("option",{value:"",children:"Select usertype"}),L.jsx("option",{value:"admin",children:"Admin"}),L.jsx("option",{value:"local",children:"Local"})]}),l.usertype&&L.jsx("p",{className:"text-error text-sm mt-1",children:l.usertype.message})]}),L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Email"})}),L.jsx("input",{type:"email",placeholder:"Enter your email",className:`w-full input input-bordered ${l.email?"input-error":""}`,...n("email",{required:"Email is required",pattern:{value:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,message:"Email is not valid"}})}),l.email&&L.jsx("p",{className:"text-error text-sm mt-1",children:l.email.message})]}),L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Phone"})}),L.jsx("input",{type:"tel",placeholder:"Enter your phone number",className:`w-full input input-bordered ${l.email?"input-error":""}`,...n("phone",{required:"Phone number is required",pattern:{value:/^(0\d{10}|\+92\d{10})$/,message:"Phone number is not valid"}})}),l.phone&&L.jsx("p",{className:"text-error text-sm mt-1",children:l.phone.message})]}),L.jsxs("div",{className:"form-control flex flex-col gap-2",children:[L.jsx("label",{className:"label",children:L.jsx("span",{className:"label-text",children:"Password"})}),L.jsx("input",{type:"password",placeholder:"Enter your password",className:`w-full input input-bordered ${l.password?"input-error":""}`,...n("password",{required:"Password is required",minLength:{value:6,message:"Password must be at least 6 characters"}})}),l.password&&L.jsx("p",{className:"text-error text-sm mt-1",children:l.password.message})]}),L.jsx("div",{className:"form-control flex flex-col justify-end gap-2",children:L.jsx("button",{className:"btn",type:"button",onClick:()=>{s("password",d())},children:"Generate Password"})})]}),L.jsx("button",{className:"w-full btn mt-10",type:"submit",children:"Add User"})]})]})})}function lL(){const{authData:e}=ot.useContext(Ya),[t,n]=ot.useState([]),[i,s]=ot.useState(""),[o,l]=ot.useState([]),[u,f]=ot.useState(!1),[d,m]=ot.useState(!1),g=Ri(),x=N=>{const E=N.target.value;if(s(E),E==="")l(t);else{const j=t.filter(C=>C.Username.toLowerCase().includes(E.toLowerCase()));l(j)}},v=async()=>{if(!u&&e?.clinicId){f(!0);try{const N=await De.get("/api/users",{params:{clinic_id:e?.clinicId??-1},withCredentials:!0});n(N.data),l(N.data)}catch(N){Be.error(N.response?.data?.messages?.clinic_id??"Something went wrong")}finally{f(!1)}}},A=async N=>{const E=t.filter(j=>j.usertype==="admin").length;if(N.usertype==="admin"&&E<=1){Be.error("Cannot delete the last admin user.");return}if(N.username===e?.username){Be.error("You cannot delete your own account.");return}f(!0);try{const j=await De.delete(`/api/users/${N.user_id}/delete`,{withCredentials:!0});Be.success("User deleted successfully"),g("/dashboard/users")}catch(j){Be.error(j?.response?.data?.message||j.message)}finally{f(!1),v()}};return ot.useEffect(()=>{document.title="Users | Audiogram",v()},[]),ot.useEffect(()=>{!e||!e.clinicId||e.usertype=="local"||v()},[e]),L.jsx("div",{className:"flex flex-col",children:e?.usertype=="local"?L.jsxs("div",{className:"h-[80vh] flex flex-col justify-center items-center text-center space-y-4 px-4",children:[L.jsx("h3",{className:"text-4xl font-bold text-red-600",children:"Oops!"}),L.jsxs("p",{className:"text-lg max-w-lg",children:["It looks like you don’t have permission to access this page.",L.jsx("br",{}),"Please contact an admin if you believe this is a mistake."]}),L.jsx("div",{className:"mt-6",children:L.jsx(us,{to:"/dashboard",children:L.jsx("button",{className:"btn btn-outline btn-error",children:"Back to Dashboard"})})})]}):L.jsxs(L.Fragment,{children:[L.jsxs("div",{className:"p-6 flex flex-col md:flex-row justify-between items-center",children:[L.jsx("h1",{className:"text-3xl font-bold",children:"Users"}),L.jsx("input",{type:"text",placeholder:"Search User",value:i,onChange:x,className:"input input-bordered text-center mt-5 md:mt-0"}),L.jsx("button",{className:"btn mt-5 md:mt-0",onClick:()=>g("/dashboard/add-user"),children:"Add New User"})]}),L.jsx("div",{className:"overflow-x-auto",children:u?L.jsx("div",{className:"w-full h-[70vh] flex justify-center items-center py-10",children:L.jsx("span",{className:"loading loading-spinner"})}):L.jsx("div",{className:"max-h-[80vh] overflow-auto",children:L.jsxs("table",{className:"table max-h-[70vh] overflow-auto w-full text-center",children:[L.jsx("thead",{children:L.jsxs("tr",{children:[L.jsx("th",{children:"User ID"}),L.jsx("th",{children:"Username"}),L.jsx("th",{children:"Usertype"}),L.jsx("th",{children:"Delete User"})]})}),L.jsx("tbody",{children:t.length===0?L.jsx("tr",{children:L.jsx("td",{colSpan:4,children:"No users found."})}):t.map(N=>L.jsxs("tr",{children:[L.jsx("td",{children:N.user_id}),L.jsx("td",{children:N.username}),L.jsx("td",{children:N.usertype}),L.jsx("td",{children:t.length===1?"Not Allowed":L.jsx("button",{onClick:()=>{window.confirm(`Are you sure you want to delete user ${N.username}?`)&&A(N)},className:"btn btn-sm btn-error",children:"Delete User"})})]},N.user_id))})]})})})]})})}function cL(){return L.jsxs(qw,{children:[L.jsx(aS,{}),L.jsxs(bw,{children:[L.jsx(Mi,{path:"/",element:L.jsx(pw,{to:"/dashboard"})}),L.jsx(Mi,{path:"/login",element:L.jsx(OS,{})}),L.jsx(Mi,{path:"/register",element:L.jsx(MS,{})}),L.jsx(Mi,{path:"/expired",element:L.jsx(DS,{})}),L.jsxs(Mi,{path:"/dashboard",element:L.jsx(lS,{}),children:[L.jsx(Mi,{index:!0,element:L.jsx(ls,{children:L.jsx(V8,{})})}),L.jsx(Mi,{path:"add-patient",element:L.jsx(ls,{children:L.jsx(Y8,{})})}),L.jsx(Mi,{path:"patients",element:L.jsx(ls,{children:L.jsx(G8,{})})}),L.jsx(Mi,{path:"patients/:patient/add-test",element:L.jsx(ls,{children:L.jsx(W8,{})})}),L.jsx(Mi,{path:"patients/:patient/add-test/audiogram",element:L.jsx(ls,{children:L.jsx(K8,{})})}),L.jsx(Mi,{path:"patients/:patient/add-test/tympanogram",element:L.jsx(ls,{children:L.jsx($8,{})})}),L.jsx(Mi,{path:"patients/:patient/tests",element:L.jsx(ls,{children:L.jsx(Z8,{})})}),L.jsx(Mi,{path:"patients/:patient/tests/audiogram/:test/report",element:L.jsx(ls,{children:L.jsx(Q8,{})})}),L.jsx(Mi,{path:"patients/:patient/tests/tympanogram/:test/report",element:L.jsx(ls,{children:L.jsx(J8,{})})}),L.jsx(Mi,{path:"prints/audiogram",element:L.jsx(ls,{children:L.jsx(aL,{})})}),L.jsx(Mi,{path:"prints/tympanogram",element:L.jsx(ls,{children:L.jsx(rL,{})})}),L.jsx(Mi,{path:"add-user",element:L.jsx(ls,{children:L.jsx(oL,{})})}),L.jsx(Mi,{path:"users",element:L.jsx(ls,{children:L.jsx(lL,{})})})]})]})]})}const uL=({children:e})=>{const[t,n]=ot.useState(null);ot.useEffect(()=>{const s=JSON.parse(localStorage.getItem("authData"));n(s||{})},[]);const i=s=>{n(s),localStorage.setItem("authData",JSON.stringify(s))};return L.jsx(Ya.Provider,{value:{authData:t,setAuthData:i},children:e})};S3.createRoot(document.getElementById("root")).render(L.jsxs(ot.StrictMode,{children:[L.jsx(uL,{children:L.jsx(X8,{children:L.jsx(cL,{})})}),L.jsx(N4,{richColors:!0,visibleToasts:5,theme:"system"})]}));export{_n as _,fL as c,n0 as g};
Back to Directory
File Manager