liberty-framework 6.0.82__py3-none-any.whl → 6.0.83__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"5fbe6cc3499565958a8ee56dc74a25932365b8ff"}}catch{}})();try{(function(){var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="75ed12da-93f8-49a5-bae2-c24d758f1bf2",e._sentryDebugIdIdentifier="sentry-dbid-75ed12da-93f8-49a5-bae2-c24d758f1bf2")})()}catch{}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();function i7(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var M_={exports:{}},Lb={};var yF;function oee(){if(yF)return Lb;yF=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,i,o){var a=null;if(o!==void 0&&(a=""+o),i.key!==void 0&&(a=""+i.key),"key"in i){o={};for(var s in i)s!=="key"&&(o[s]=i[s])}else o=i;return i=o.ref,{$$typeof:e,type:n,key:a,ref:i!==void 0?i:null,props:o}}return Lb.Fragment=t,Lb.jsx=r,Lb.jsxs=r,Lb}var vF;function aee(){return vF||(vF=1,M_.exports=oee()),M_.exports}var Ff=aee(),T_={exports:{}},pn={};var wF;function see(){if(wF)return pn;wF=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),h=Symbol.iterator;function f(U){return U===null||typeof U!="object"?null:(U=h&&U[h]||U["@@iterator"],typeof U=="function"?U:null)}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function b(U,O,H){this.props=U,this.context=O,this.refs=g,this.updater=H||p}b.prototype.isReactComponent={},b.prototype.setState=function(U,O){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,O,"setState")},b.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function v(){}v.prototype=b.prototype;function w(U,O,H){this.props=U,this.context=O,this.refs=g,this.updater=H||p}var C=w.prototype=new v;C.constructor=w,m(C,b.prototype),C.isPureReactComponent=!0;var F=Array.isArray;function M(){}var j={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function P(U,O,H){var W=H.ref;return{$$typeof:e,type:U,key:O,ref:W!==void 0?W:null,props:H}}function N(U,O){return P(U.type,O,U.props)}function z(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function Q(U){var O={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(H){return O[H]})}var D=/\/+/g;function I(U,O){return typeof U=="object"&&U!==null&&U.key!=null?Q(""+U.key):O.toString(36)}function E(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(M,M):(U.status="pending",U.then(function(O){U.status==="pending"&&(U.status="fulfilled",U.value=O)},function(O){U.status==="pending"&&(U.status="rejected",U.reason=O)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function x(U,O,H,W,te){var V=typeof U;(V==="undefined"||V==="boolean")&&(U=null);var ee=!1;if(U===null)ee=!0;else switch(V){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(U.$$typeof){case e:case t:ee=!0;break;case u:return ee=U._init,x(ee(U._payload),O,H,W,te)}}if(ee)return te=te(U),ee=W===""?"."+I(U,0):W,F(te)?(H="",ee!=null&&(H=ee.replace(D,"$&/")+"/"),x(te,O,H,"",function(X){return X})):te!=null&&(z(te)&&(te=N(te,H+(te.key==null||U&&U.key===te.key?"":(""+te.key).replace(D,"$&/")+"/")+ee)),O.push(te)),1;ee=0;var G=W===""?".":W+":";if(F(U))for(var q=0;q<U.length;q++)W=U[q],V=G+I(W,q),ee+=x(W,O,H,V,te);else if(q=f(U),typeof q=="function")for(U=q.call(U),q=0;!(W=U.next()).done;)W=W.value,V=G+I(W,q++),ee+=x(W,O,H,V,te);else if(V==="object"){if(typeof U.then=="function")return x(E(U),O,H,W,te);throw O=String(U),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return ee}function _(U,O,H){if(U==null)return U;var W=[],te=0;return x(U,W,"","",function(V){return O.call(H,V,te++)}),W}function S(U){if(U._status===-1){var O=U._result;O=O(),O.then(function(H){(U._status===0||U._status===-1)&&(U._status=1,U._result=H)},function(H){(U._status===0||U._status===-1)&&(U._status=2,U._result=H)}),U._status===-1&&(U._status=0,U._result=O)}if(U._status===1)return U._result.default;throw U._result}var B=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},T={map:_,forEach:function(U,O,H){_(U,function(){O.apply(this,arguments)},H)},count:function(U){var O=0;return _(U,function(){O++}),O},toArray:function(U){return _(U,function(O){return O})||[]},only:function(U){if(!z(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return pn.Activity=d,pn.Children=T,pn.Component=b,pn.Fragment=r,pn.Profiler=i,pn.PureComponent=w,pn.StrictMode=n,pn.Suspense=c,pn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,pn.__COMPILER_RUNTIME={__proto__:null,c:function(U){return j.H.useMemoCache(U)}},pn.cache=function(U){return function(){return U.apply(null,arguments)}},pn.cacheSignal=function(){return null},pn.cloneElement=function(U,O,H){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var W=m({},U.props),te=U.key;if(O!=null)for(V in O.key!==void 0&&(te=""+O.key),O)!L.call(O,V)||V==="key"||V==="__self"||V==="__source"||V==="ref"&&O.ref===void 0||(W[V]=O[V]);var V=arguments.length-2;if(V===1)W.children=H;else if(1<V){for(var ee=Array(V),G=0;G<V;G++)ee[G]=arguments[G+2];W.children=ee}return P(U.type,te,W)},pn.createContext=function(U){return U={$$typeof:a,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:o,_context:U},U},pn.createElement=function(U,O,H){var W,te={},V=null;if(O!=null)for(W in O.key!==void 0&&(V=""+O.key),O)L.call(O,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(te[W]=O[W]);var ee=arguments.length-2;if(ee===1)te.children=H;else if(1<ee){for(var G=Array(ee),q=0;q<ee;q++)G[q]=arguments[q+2];te.children=G}if(U&&U.defaultProps)for(W in ee=U.defaultProps,ee)te[W]===void 0&&(te[W]=ee[W]);return P(U,V,te)},pn.createRef=function(){return{current:null}},pn.forwardRef=function(U){return{$$typeof:s,render:U}},pn.isValidElement=z,pn.lazy=function(U){return{$$typeof:u,_payload:{_status:-1,_result:U},_init:S}},pn.memo=function(U,O){return{$$typeof:l,type:U,compare:O===void 0?null:O}},pn.startTransition=function(U){var O=j.T,H={};j.T=H;try{var W=U(),te=j.S;te!==null&&te(H,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(M,B)}catch(V){B(V)}finally{O!==null&&H.types!==null&&(O.types=H.types),j.T=O}},pn.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},pn.use=function(U){return j.H.use(U)},pn.useActionState=function(U,O,H){return j.H.useActionState(U,O,H)},pn.useCallback=function(U,O){return j.H.useCallback(U,O)},pn.useContext=function(U){return j.H.useContext(U)},pn.useDebugValue=function(){},pn.useDeferredValue=function(U,O){return j.H.useDeferredValue(U,O)},pn.useEffect=function(U,O){return j.H.useEffect(U,O)},pn.useEffectEvent=function(U){return j.H.useEffectEvent(U)},pn.useId=function(){return j.H.useId()},pn.useImperativeHandle=function(U,O,H){return j.H.useImperativeHandle(U,O,H)},pn.useInsertionEffect=function(U,O){return j.H.useInsertionEffect(U,O)},pn.useLayoutEffect=function(U,O){return j.H.useLayoutEffect(U,O)},pn.useMemo=function(U,O){return j.H.useMemo(U,O)},pn.useOptimistic=function(U,O){return j.H.useOptimistic(U,O)},pn.useReducer=function(U,O,H){return j.H.useReducer(U,O,H)},pn.useRef=function(U){return j.H.useRef(U)},pn.useState=function(U){return j.H.useState(U)},pn.useSyncExternalStore=function(U,O,H){return j.H.useSyncExternalStore(U,O,H)},pn.useTransition=function(){return j.H.useTransition()},pn.version="19.2.0",pn}var xF;function o7(){return xF||(xF=1,T_.exports=see()),T_.exports}var ne=o7();const ze=i7(ne);var F_={exports:{}},Pb={},D_={exports:{}},I_={};var _F;function lee(){return _F||(_F=1,(function(e){function t(x,_){var S=x.length;x.push(_);e:for(;0<S;){var B=S-1>>>1,T=x[B];if(0<i(T,_))x[B]=_,x[S]=T,S=B;else break e}}function r(x){return x.length===0?null:x[0]}function n(x){if(x.length===0)return null;var _=x[0],S=x.pop();if(S!==_){x[0]=S;e:for(var B=0,T=x.length,U=T>>>1;B<U;){var O=2*(B+1)-1,H=x[O],W=O+1,te=x[W];if(0>i(H,S))W<T&&0>i(te,H)?(x[B]=te,x[W]=S,B=W):(x[B]=H,x[O]=S,B=O);else if(W<T&&0>i(te,S))x[B]=te,x[W]=S,B=W;else break e}}return _}function i(x,_){var S=x.sortIndex-_.sortIndex;return S!==0?S:x.id-_.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 a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var c=[],l=[],u=1,d=null,h=3,f=!1,p=!1,m=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function C(x){for(var _=r(l);_!==null;){if(_.callback===null)n(l);else if(_.startTime<=x)n(l),_.sortIndex=_.expirationTime,t(c,_);else break;_=r(l)}}function F(x){if(m=!1,C(x),!p)if(r(c)!==null)p=!0,M||(M=!0,Q());else{var _=r(l);_!==null&&E(F,_.startTime-x)}}var M=!1,j=-1,L=5,P=-1;function N(){return g?!0:!(e.unstable_now()-P<L)}function z(){if(g=!1,M){var x=e.unstable_now();P=x;var _=!0;try{e:{p=!1,m&&(m=!1,v(j),j=-1),f=!0;var S=h;try{t:{for(C(x),d=r(c);d!==null&&!(d.expirationTime>x&&N());){var B=d.callback;if(typeof B=="function"){d.callback=null,h=d.priorityLevel;var T=B(d.expirationTime<=x);if(x=e.unstable_now(),typeof T=="function"){d.callback=T,C(x),_=!0;break t}d===r(c)&&n(c),C(x)}else n(c);d=r(c)}if(d!==null)_=!0;else{var U=r(l);U!==null&&E(F,U.startTime-x),_=!1}}break e}finally{d=null,h=S,f=!1}_=void 0}}finally{_?Q():M=!1}}}var Q;if(typeof w=="function")Q=function(){w(z)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,I=D.port2;D.port1.onmessage=z,Q=function(){I.postMessage(null)}}else Q=function(){b(z,0)};function E(x,_){j=b(function(){x(e.unstable_now())},_)}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(x){x.callback=null},e.unstable_forceFrameRate=function(x){0>x||125<x?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<x?Math.floor(1e3/x):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(x){switch(h){case 1:case 2:case 3:var _=3;break;default:_=h}var S=h;h=_;try{return x()}finally{h=S}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(x,_){switch(x){case 1:case 2:case 3:case 4:case 5:break;default:x=3}var S=h;h=x;try{return _()}finally{h=S}},e.unstable_scheduleCallback=function(x,_,S){var B=e.unstable_now();switch(typeof S=="object"&&S!==null?(S=S.delay,S=typeof S=="number"&&0<S?B+S:B):S=B,x){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=S+T,x={id:u++,callback:_,priorityLevel:x,startTime:S,expirationTime:T,sortIndex:-1},S>B?(x.sortIndex=S,t(l,x),r(c)===null&&x===r(l)&&(m?(v(j),j=-1):m=!0,E(F,S-B))):(x.sortIndex=T,t(c,x),p||f||(p=!0,M||(M=!0,Q()))),x},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(x){var _=h;return function(){var S=h;h=_;try{return x.apply(this,arguments)}finally{h=S}}}})(I_)),I_}var SF;function cee(){return SF||(SF=1,D_.exports=lee()),D_.exports}var R_={exports:{}},bs={};var kF;function uee(){if(kF)return bs;kF=1;var e=o7();function t(c){var l="https://react.dev/errors/"+c;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)l+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+c+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(c,l,u){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:d==null?null:""+d,children:c,containerInfo:l,implementation:u}}var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function s(c,l){if(c==="font")return"";if(typeof l=="string")return l==="use-credentials"?l:""}return bs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,bs.createPortal=function(c,l){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)throw Error(t(299));return o(c,l,null,u)},bs.flushSync=function(c){var l=a.T,u=n.p;try{if(a.T=null,n.p=2,c)return c()}finally{a.T=l,n.p=u,n.d.f()}},bs.preconnect=function(c,l){typeof c=="string"&&(l?(l=l.crossOrigin,l=typeof l=="string"?l==="use-credentials"?l:"":void 0):l=null,n.d.C(c,l))},bs.prefetchDNS=function(c){typeof c=="string"&&n.d.D(c)},bs.preinit=function(c,l){if(typeof c=="string"&&l&&typeof l.as=="string"){var u=l.as,d=s(u,l.crossOrigin),h=typeof l.integrity=="string"?l.integrity:void 0,f=typeof l.fetchPriority=="string"?l.fetchPriority:void 0;u==="style"?n.d.S(c,typeof l.precedence=="string"?l.precedence:void 0,{crossOrigin:d,integrity:h,fetchPriority:f}):u==="script"&&n.d.X(c,{crossOrigin:d,integrity:h,fetchPriority:f,nonce:typeof l.nonce=="string"?l.nonce:void 0})}},bs.preinitModule=function(c,l){if(typeof c=="string")if(typeof l=="object"&&l!==null){if(l.as==null||l.as==="script"){var u=s(l.as,l.crossOrigin);n.d.M(c,{crossOrigin:u,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0})}}else l==null&&n.d.M(c)},bs.preload=function(c,l){if(typeof c=="string"&&typeof l=="object"&&l!==null&&typeof l.as=="string"){var u=l.as,d=s(u,l.crossOrigin);n.d.L(c,u,{crossOrigin:d,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0,type:typeof l.type=="string"?l.type:void 0,fetchPriority:typeof l.fetchPriority=="string"?l.fetchPriority:void 0,referrerPolicy:typeof l.referrerPolicy=="string"?l.referrerPolicy:void 0,imageSrcSet:typeof l.imageSrcSet=="string"?l.imageSrcSet:void 0,imageSizes:typeof l.imageSizes=="string"?l.imageSizes:void 0,media:typeof l.media=="string"?l.media:void 0})}},bs.preloadModule=function(c,l){if(typeof c=="string")if(l){var u=s(l.as,l.crossOrigin);n.d.m(c,{as:typeof l.as=="string"&&l.as!=="script"?l.as:void 0,crossOrigin:u,integrity:typeof l.integrity=="string"?l.integrity:void 0})}else n.d.m(c)},bs.requestFormReset=function(c){n.d.r(c)},bs.unstable_batchedUpdates=function(c,l){return c(l)},bs.useFormState=function(c,l,u){return a.H.useFormState(c,l,u)},bs.useFormStatus=function(){return a.H.useHostTransitionStatus()},bs.version="19.2.0",bs}var CF;function qH(){if(CF)return R_.exports;CF=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(),R_.exports=uee(),R_.exports}var BF;function dee(){if(BF)return Pb;BF=1;var e=cee(),t=o7(),r=qH();function n(A){var y="https://react.dev/errors/"+A;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var k=2;k<arguments.length;k++)y+="&args[]="+encodeURIComponent(arguments[k])}return"Minified React error #"+A+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(A){return!(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11)}function o(A){var y=A,k=A;if(A.alternate)for(;y.return;)y=y.return;else{A=y;do y=A,(y.flags&4098)!==0&&(k=y.return),A=y.return;while(A)}return y.tag===3?k:null}function a(A){if(A.tag===13){var y=A.memoizedState;if(y===null&&(A=A.alternate,A!==null&&(y=A.memoizedState)),y!==null)return y.dehydrated}return null}function s(A){if(A.tag===31){var y=A.memoizedState;if(y===null&&(A=A.alternate,A!==null&&(y=A.memoizedState)),y!==null)return y.dehydrated}return null}function c(A){if(o(A)!==A)throw Error(n(188))}function l(A){var y=A.alternate;if(!y){if(y=o(A),y===null)throw Error(n(188));return y!==A?null:A}for(var k=A,R=y;;){var Y=k.return;if(Y===null)break;var J=Y.alternate;if(J===null){if(R=Y.return,R!==null){k=R;continue}break}if(Y.child===J.child){for(J=Y.child;J;){if(J===k)return c(Y),A;if(J===R)return c(Y),y;J=J.sibling}throw Error(n(188))}if(k.return!==R.return)k=Y,R=J;else{for(var he=!1,Se=Y.child;Se;){if(Se===k){he=!0,k=Y,R=J;break}if(Se===R){he=!0,R=Y,k=J;break}Se=Se.sibling}if(!he){for(Se=J.child;Se;){if(Se===k){he=!0,k=J,R=Y;break}if(Se===R){he=!0,R=J,k=Y;break}Se=Se.sibling}if(!he)throw Error(n(189))}}if(k.alternate!==R)throw Error(n(190))}if(k.tag!==3)throw Error(n(188));return k.stateNode.current===k?A:y}function u(A){var y=A.tag;if(y===5||y===26||y===27||y===6)return A;for(A=A.child;A!==null;){if(y=u(A),y!==null)return y;A=A.sibling}return null}var d=Object.assign,h=Symbol.for("react.element"),f=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),w=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),N=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function Q(A){return A===null||typeof A!="object"?null:(A=z&&A[z]||A["@@iterator"],typeof A=="function"?A:null)}var D=Symbol.for("react.client.reference");function I(A){if(A==null)return null;if(typeof A=="function")return A.$$typeof===D?null:A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case m:return"Fragment";case b:return"Profiler";case g:return"StrictMode";case F:return"Suspense";case M:return"SuspenseList";case P:return"Activity"}if(typeof A=="object")switch(A.$$typeof){case p:return"Portal";case w:return A.displayName||"Context";case v:return(A._context.displayName||"Context")+".Consumer";case C:var y=A.render;return A=A.displayName,A||(A=y.displayName||y.name||"",A=A!==""?"ForwardRef("+A+")":"ForwardRef"),A;case j:return y=A.displayName||null,y!==null?y:I(A.type)||"Memo";case L:y=A._payload,A=A._init;try{return I(A(y))}catch{}}return null}var E=Array.isArray,x=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,S={pending:!1,data:null,method:null,action:null},B=[],T=-1;function U(A){return{current:A}}function O(A){0>T||(A.current=B[T],B[T]=null,T--)}function H(A,y){T++,B[T]=A.current,A.current=y}var W=U(null),te=U(null),V=U(null),ee=U(null);function G(A,y){switch(H(V,y),H(te,A),H(W,null),y.nodeType){case 9:case 11:A=(A=y.documentElement)&&(A=A.namespaceURI)?HT(A):0;break;default:if(A=y.tagName,y=y.namespaceURI)y=HT(y),A=zT(y,A);else switch(A){case"svg":A=1;break;case"math":A=2;break;default:A=0}}O(W),H(W,A)}function q(){O(W),O(te),O(V)}function X(A){A.memoizedState!==null&&H(ee,A);var y=W.current,k=zT(y,A.type);y!==k&&(H(te,A),H(W,k))}function ce(A){te.current===A&&(O(W),O(te)),ee.current===A&&(O(ee),Db._currentValue=S)}var fe,ie;function le(A){if(fe===void 0)try{throw Error()}catch(k){var y=k.stack.trim().match(/\n( *(at )?)/);fe=y&&y[1]||"",ie=-1<k.stack.indexOf(`
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"64a40c6fc2be6d46e5a8d7ddd575ceefcde55201"}}catch{}})();try{(function(){var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="75ed12da-93f8-49a5-bae2-c24d758f1bf2",e._sentryDebugIdIdentifier="sentry-dbid-75ed12da-93f8-49a5-bae2-c24d758f1bf2")})()}catch{}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();function i7(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var M_={exports:{}},Lb={};var yF;function oee(){if(yF)return Lb;yF=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,i,o){var a=null;if(o!==void 0&&(a=""+o),i.key!==void 0&&(a=""+i.key),"key"in i){o={};for(var s in i)s!=="key"&&(o[s]=i[s])}else o=i;return i=o.ref,{$$typeof:e,type:n,key:a,ref:i!==void 0?i:null,props:o}}return Lb.Fragment=t,Lb.jsx=r,Lb.jsxs=r,Lb}var vF;function aee(){return vF||(vF=1,M_.exports=oee()),M_.exports}var Ff=aee(),T_={exports:{}},pn={};var wF;function see(){if(wF)return pn;wF=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),h=Symbol.iterator;function f(U){return U===null||typeof U!="object"?null:(U=h&&U[h]||U["@@iterator"],typeof U=="function"?U:null)}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function b(U,O,H){this.props=U,this.context=O,this.refs=g,this.updater=H||p}b.prototype.isReactComponent={},b.prototype.setState=function(U,O){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,O,"setState")},b.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function v(){}v.prototype=b.prototype;function w(U,O,H){this.props=U,this.context=O,this.refs=g,this.updater=H||p}var C=w.prototype=new v;C.constructor=w,m(C,b.prototype),C.isPureReactComponent=!0;var F=Array.isArray;function M(){}var j={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function P(U,O,H){var W=H.ref;return{$$typeof:e,type:U,key:O,ref:W!==void 0?W:null,props:H}}function N(U,O){return P(U.type,O,U.props)}function z(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function Q(U){var O={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(H){return O[H]})}var D=/\/+/g;function I(U,O){return typeof U=="object"&&U!==null&&U.key!=null?Q(""+U.key):O.toString(36)}function E(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(M,M):(U.status="pending",U.then(function(O){U.status==="pending"&&(U.status="fulfilled",U.value=O)},function(O){U.status==="pending"&&(U.status="rejected",U.reason=O)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function x(U,O,H,W,te){var V=typeof U;(V==="undefined"||V==="boolean")&&(U=null);var ee=!1;if(U===null)ee=!0;else switch(V){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(U.$$typeof){case e:case t:ee=!0;break;case u:return ee=U._init,x(ee(U._payload),O,H,W,te)}}if(ee)return te=te(U),ee=W===""?"."+I(U,0):W,F(te)?(H="",ee!=null&&(H=ee.replace(D,"$&/")+"/"),x(te,O,H,"",function(X){return X})):te!=null&&(z(te)&&(te=N(te,H+(te.key==null||U&&U.key===te.key?"":(""+te.key).replace(D,"$&/")+"/")+ee)),O.push(te)),1;ee=0;var G=W===""?".":W+":";if(F(U))for(var q=0;q<U.length;q++)W=U[q],V=G+I(W,q),ee+=x(W,O,H,V,te);else if(q=f(U),typeof q=="function")for(U=q.call(U),q=0;!(W=U.next()).done;)W=W.value,V=G+I(W,q++),ee+=x(W,O,H,V,te);else if(V==="object"){if(typeof U.then=="function")return x(E(U),O,H,W,te);throw O=String(U),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return ee}function _(U,O,H){if(U==null)return U;var W=[],te=0;return x(U,W,"","",function(V){return O.call(H,V,te++)}),W}function S(U){if(U._status===-1){var O=U._result;O=O(),O.then(function(H){(U._status===0||U._status===-1)&&(U._status=1,U._result=H)},function(H){(U._status===0||U._status===-1)&&(U._status=2,U._result=H)}),U._status===-1&&(U._status=0,U._result=O)}if(U._status===1)return U._result.default;throw U._result}var B=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},T={map:_,forEach:function(U,O,H){_(U,function(){O.apply(this,arguments)},H)},count:function(U){var O=0;return _(U,function(){O++}),O},toArray:function(U){return _(U,function(O){return O})||[]},only:function(U){if(!z(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return pn.Activity=d,pn.Children=T,pn.Component=b,pn.Fragment=r,pn.Profiler=i,pn.PureComponent=w,pn.StrictMode=n,pn.Suspense=c,pn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,pn.__COMPILER_RUNTIME={__proto__:null,c:function(U){return j.H.useMemoCache(U)}},pn.cache=function(U){return function(){return U.apply(null,arguments)}},pn.cacheSignal=function(){return null},pn.cloneElement=function(U,O,H){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var W=m({},U.props),te=U.key;if(O!=null)for(V in O.key!==void 0&&(te=""+O.key),O)!L.call(O,V)||V==="key"||V==="__self"||V==="__source"||V==="ref"&&O.ref===void 0||(W[V]=O[V]);var V=arguments.length-2;if(V===1)W.children=H;else if(1<V){for(var ee=Array(V),G=0;G<V;G++)ee[G]=arguments[G+2];W.children=ee}return P(U.type,te,W)},pn.createContext=function(U){return U={$$typeof:a,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:o,_context:U},U},pn.createElement=function(U,O,H){var W,te={},V=null;if(O!=null)for(W in O.key!==void 0&&(V=""+O.key),O)L.call(O,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(te[W]=O[W]);var ee=arguments.length-2;if(ee===1)te.children=H;else if(1<ee){for(var G=Array(ee),q=0;q<ee;q++)G[q]=arguments[q+2];te.children=G}if(U&&U.defaultProps)for(W in ee=U.defaultProps,ee)te[W]===void 0&&(te[W]=ee[W]);return P(U,V,te)},pn.createRef=function(){return{current:null}},pn.forwardRef=function(U){return{$$typeof:s,render:U}},pn.isValidElement=z,pn.lazy=function(U){return{$$typeof:u,_payload:{_status:-1,_result:U},_init:S}},pn.memo=function(U,O){return{$$typeof:l,type:U,compare:O===void 0?null:O}},pn.startTransition=function(U){var O=j.T,H={};j.T=H;try{var W=U(),te=j.S;te!==null&&te(H,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(M,B)}catch(V){B(V)}finally{O!==null&&H.types!==null&&(O.types=H.types),j.T=O}},pn.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},pn.use=function(U){return j.H.use(U)},pn.useActionState=function(U,O,H){return j.H.useActionState(U,O,H)},pn.useCallback=function(U,O){return j.H.useCallback(U,O)},pn.useContext=function(U){return j.H.useContext(U)},pn.useDebugValue=function(){},pn.useDeferredValue=function(U,O){return j.H.useDeferredValue(U,O)},pn.useEffect=function(U,O){return j.H.useEffect(U,O)},pn.useEffectEvent=function(U){return j.H.useEffectEvent(U)},pn.useId=function(){return j.H.useId()},pn.useImperativeHandle=function(U,O,H){return j.H.useImperativeHandle(U,O,H)},pn.useInsertionEffect=function(U,O){return j.H.useInsertionEffect(U,O)},pn.useLayoutEffect=function(U,O){return j.H.useLayoutEffect(U,O)},pn.useMemo=function(U,O){return j.H.useMemo(U,O)},pn.useOptimistic=function(U,O){return j.H.useOptimistic(U,O)},pn.useReducer=function(U,O,H){return j.H.useReducer(U,O,H)},pn.useRef=function(U){return j.H.useRef(U)},pn.useState=function(U){return j.H.useState(U)},pn.useSyncExternalStore=function(U,O,H){return j.H.useSyncExternalStore(U,O,H)},pn.useTransition=function(){return j.H.useTransition()},pn.version="19.2.0",pn}var xF;function o7(){return xF||(xF=1,T_.exports=see()),T_.exports}var ne=o7();const ze=i7(ne);var F_={exports:{}},Pb={},D_={exports:{}},I_={};var _F;function lee(){return _F||(_F=1,(function(e){function t(x,_){var S=x.length;x.push(_);e:for(;0<S;){var B=S-1>>>1,T=x[B];if(0<i(T,_))x[B]=_,x[S]=T,S=B;else break e}}function r(x){return x.length===0?null:x[0]}function n(x){if(x.length===0)return null;var _=x[0],S=x.pop();if(S!==_){x[0]=S;e:for(var B=0,T=x.length,U=T>>>1;B<U;){var O=2*(B+1)-1,H=x[O],W=O+1,te=x[W];if(0>i(H,S))W<T&&0>i(te,H)?(x[B]=te,x[W]=S,B=W):(x[B]=H,x[O]=S,B=O);else if(W<T&&0>i(te,S))x[B]=te,x[W]=S,B=W;else break e}}return _}function i(x,_){var S=x.sortIndex-_.sortIndex;return S!==0?S:x.id-_.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 a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var c=[],l=[],u=1,d=null,h=3,f=!1,p=!1,m=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function C(x){for(var _=r(l);_!==null;){if(_.callback===null)n(l);else if(_.startTime<=x)n(l),_.sortIndex=_.expirationTime,t(c,_);else break;_=r(l)}}function F(x){if(m=!1,C(x),!p)if(r(c)!==null)p=!0,M||(M=!0,Q());else{var _=r(l);_!==null&&E(F,_.startTime-x)}}var M=!1,j=-1,L=5,P=-1;function N(){return g?!0:!(e.unstable_now()-P<L)}function z(){if(g=!1,M){var x=e.unstable_now();P=x;var _=!0;try{e:{p=!1,m&&(m=!1,v(j),j=-1),f=!0;var S=h;try{t:{for(C(x),d=r(c);d!==null&&!(d.expirationTime>x&&N());){var B=d.callback;if(typeof B=="function"){d.callback=null,h=d.priorityLevel;var T=B(d.expirationTime<=x);if(x=e.unstable_now(),typeof T=="function"){d.callback=T,C(x),_=!0;break t}d===r(c)&&n(c),C(x)}else n(c);d=r(c)}if(d!==null)_=!0;else{var U=r(l);U!==null&&E(F,U.startTime-x),_=!1}}break e}finally{d=null,h=S,f=!1}_=void 0}}finally{_?Q():M=!1}}}var Q;if(typeof w=="function")Q=function(){w(z)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,I=D.port2;D.port1.onmessage=z,Q=function(){I.postMessage(null)}}else Q=function(){b(z,0)};function E(x,_){j=b(function(){x(e.unstable_now())},_)}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(x){x.callback=null},e.unstable_forceFrameRate=function(x){0>x||125<x?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<x?Math.floor(1e3/x):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(x){switch(h){case 1:case 2:case 3:var _=3;break;default:_=h}var S=h;h=_;try{return x()}finally{h=S}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(x,_){switch(x){case 1:case 2:case 3:case 4:case 5:break;default:x=3}var S=h;h=x;try{return _()}finally{h=S}},e.unstable_scheduleCallback=function(x,_,S){var B=e.unstable_now();switch(typeof S=="object"&&S!==null?(S=S.delay,S=typeof S=="number"&&0<S?B+S:B):S=B,x){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=S+T,x={id:u++,callback:_,priorityLevel:x,startTime:S,expirationTime:T,sortIndex:-1},S>B?(x.sortIndex=S,t(l,x),r(c)===null&&x===r(l)&&(m?(v(j),j=-1):m=!0,E(F,S-B))):(x.sortIndex=T,t(c,x),p||f||(p=!0,M||(M=!0,Q()))),x},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(x){var _=h;return function(){var S=h;h=_;try{return x.apply(this,arguments)}finally{h=S}}}})(I_)),I_}var SF;function cee(){return SF||(SF=1,D_.exports=lee()),D_.exports}var R_={exports:{}},bs={};var kF;function uee(){if(kF)return bs;kF=1;var e=o7();function t(c){var l="https://react.dev/errors/"+c;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)l+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+c+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(c,l,u){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:d==null?null:""+d,children:c,containerInfo:l,implementation:u}}var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function s(c,l){if(c==="font")return"";if(typeof l=="string")return l==="use-credentials"?l:""}return bs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,bs.createPortal=function(c,l){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)throw Error(t(299));return o(c,l,null,u)},bs.flushSync=function(c){var l=a.T,u=n.p;try{if(a.T=null,n.p=2,c)return c()}finally{a.T=l,n.p=u,n.d.f()}},bs.preconnect=function(c,l){typeof c=="string"&&(l?(l=l.crossOrigin,l=typeof l=="string"?l==="use-credentials"?l:"":void 0):l=null,n.d.C(c,l))},bs.prefetchDNS=function(c){typeof c=="string"&&n.d.D(c)},bs.preinit=function(c,l){if(typeof c=="string"&&l&&typeof l.as=="string"){var u=l.as,d=s(u,l.crossOrigin),h=typeof l.integrity=="string"?l.integrity:void 0,f=typeof l.fetchPriority=="string"?l.fetchPriority:void 0;u==="style"?n.d.S(c,typeof l.precedence=="string"?l.precedence:void 0,{crossOrigin:d,integrity:h,fetchPriority:f}):u==="script"&&n.d.X(c,{crossOrigin:d,integrity:h,fetchPriority:f,nonce:typeof l.nonce=="string"?l.nonce:void 0})}},bs.preinitModule=function(c,l){if(typeof c=="string")if(typeof l=="object"&&l!==null){if(l.as==null||l.as==="script"){var u=s(l.as,l.crossOrigin);n.d.M(c,{crossOrigin:u,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0})}}else l==null&&n.d.M(c)},bs.preload=function(c,l){if(typeof c=="string"&&typeof l=="object"&&l!==null&&typeof l.as=="string"){var u=l.as,d=s(u,l.crossOrigin);n.d.L(c,u,{crossOrigin:d,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0,type:typeof l.type=="string"?l.type:void 0,fetchPriority:typeof l.fetchPriority=="string"?l.fetchPriority:void 0,referrerPolicy:typeof l.referrerPolicy=="string"?l.referrerPolicy:void 0,imageSrcSet:typeof l.imageSrcSet=="string"?l.imageSrcSet:void 0,imageSizes:typeof l.imageSizes=="string"?l.imageSizes:void 0,media:typeof l.media=="string"?l.media:void 0})}},bs.preloadModule=function(c,l){if(typeof c=="string")if(l){var u=s(l.as,l.crossOrigin);n.d.m(c,{as:typeof l.as=="string"&&l.as!=="script"?l.as:void 0,crossOrigin:u,integrity:typeof l.integrity=="string"?l.integrity:void 0})}else n.d.m(c)},bs.requestFormReset=function(c){n.d.r(c)},bs.unstable_batchedUpdates=function(c,l){return c(l)},bs.useFormState=function(c,l,u){return a.H.useFormState(c,l,u)},bs.useFormStatus=function(){return a.H.useHostTransitionStatus()},bs.version="19.2.0",bs}var CF;function qH(){if(CF)return R_.exports;CF=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(),R_.exports=uee(),R_.exports}var BF;function dee(){if(BF)return Pb;BF=1;var e=cee(),t=o7(),r=qH();function n(A){var y="https://react.dev/errors/"+A;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var k=2;k<arguments.length;k++)y+="&args[]="+encodeURIComponent(arguments[k])}return"Minified React error #"+A+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(A){return!(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11)}function o(A){var y=A,k=A;if(A.alternate)for(;y.return;)y=y.return;else{A=y;do y=A,(y.flags&4098)!==0&&(k=y.return),A=y.return;while(A)}return y.tag===3?k:null}function a(A){if(A.tag===13){var y=A.memoizedState;if(y===null&&(A=A.alternate,A!==null&&(y=A.memoizedState)),y!==null)return y.dehydrated}return null}function s(A){if(A.tag===31){var y=A.memoizedState;if(y===null&&(A=A.alternate,A!==null&&(y=A.memoizedState)),y!==null)return y.dehydrated}return null}function c(A){if(o(A)!==A)throw Error(n(188))}function l(A){var y=A.alternate;if(!y){if(y=o(A),y===null)throw Error(n(188));return y!==A?null:A}for(var k=A,R=y;;){var Y=k.return;if(Y===null)break;var J=Y.alternate;if(J===null){if(R=Y.return,R!==null){k=R;continue}break}if(Y.child===J.child){for(J=Y.child;J;){if(J===k)return c(Y),A;if(J===R)return c(Y),y;J=J.sibling}throw Error(n(188))}if(k.return!==R.return)k=Y,R=J;else{for(var he=!1,Se=Y.child;Se;){if(Se===k){he=!0,k=Y,R=J;break}if(Se===R){he=!0,R=Y,k=J;break}Se=Se.sibling}if(!he){for(Se=J.child;Se;){if(Se===k){he=!0,k=J,R=Y;break}if(Se===R){he=!0,R=J,k=Y;break}Se=Se.sibling}if(!he)throw Error(n(189))}}if(k.alternate!==R)throw Error(n(190))}if(k.tag!==3)throw Error(n(188));return k.stateNode.current===k?A:y}function u(A){var y=A.tag;if(y===5||y===26||y===27||y===6)return A;for(A=A.child;A!==null;){if(y=u(A),y!==null)return y;A=A.sibling}return null}var d=Object.assign,h=Symbol.for("react.element"),f=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),w=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),N=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function Q(A){return A===null||typeof A!="object"?null:(A=z&&A[z]||A["@@iterator"],typeof A=="function"?A:null)}var D=Symbol.for("react.client.reference");function I(A){if(A==null)return null;if(typeof A=="function")return A.$$typeof===D?null:A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case m:return"Fragment";case b:return"Profiler";case g:return"StrictMode";case F:return"Suspense";case M:return"SuspenseList";case P:return"Activity"}if(typeof A=="object")switch(A.$$typeof){case p:return"Portal";case w:return A.displayName||"Context";case v:return(A._context.displayName||"Context")+".Consumer";case C:var y=A.render;return A=A.displayName,A||(A=y.displayName||y.name||"",A=A!==""?"ForwardRef("+A+")":"ForwardRef"),A;case j:return y=A.displayName||null,y!==null?y:I(A.type)||"Memo";case L:y=A._payload,A=A._init;try{return I(A(y))}catch{}}return null}var E=Array.isArray,x=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,S={pending:!1,data:null,method:null,action:null},B=[],T=-1;function U(A){return{current:A}}function O(A){0>T||(A.current=B[T],B[T]=null,T--)}function H(A,y){T++,B[T]=A.current,A.current=y}var W=U(null),te=U(null),V=U(null),ee=U(null);function G(A,y){switch(H(V,y),H(te,A),H(W,null),y.nodeType){case 9:case 11:A=(A=y.documentElement)&&(A=A.namespaceURI)?HT(A):0;break;default:if(A=y.tagName,y=y.namespaceURI)y=HT(y),A=zT(y,A);else switch(A){case"svg":A=1;break;case"math":A=2;break;default:A=0}}O(W),H(W,A)}function q(){O(W),O(te),O(V)}function X(A){A.memoizedState!==null&&H(ee,A);var y=W.current,k=zT(y,A.type);y!==k&&(H(te,A),H(W,k))}function ce(A){te.current===A&&(O(W),O(te)),ee.current===A&&(O(ee),Db._currentValue=S)}var fe,ie;function le(A){if(fe===void 0)try{throw Error()}catch(k){var y=k.stack.trim().match(/\n( *(at )?)/);fe=y&&y[1]||"",ie=-1<k.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<k.stack.indexOf("@")?"@unknown:0:0":""}return`
3
3
  `+fe+A+ie}var re=!1;function Ae(A,y){if(!A||re)return"";re=!0;var k=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var R={DetermineComponentFrameRoot:function(){try{if(y){var Ct=function(){throw Error()};if(Object.defineProperty(Ct.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ct,[])}catch(At){var dt=At}Reflect.construct(A,[],Ct)}else{try{Ct.call()}catch(At){dt=At}A.call(Ct.prototype)}}else{try{throw Error()}catch(At){dt=At}(Ct=A())&&typeof Ct.catch=="function"&&Ct.catch(function(){})}}catch(At){if(At&&dt&&typeof At.stack=="string")return[At.stack,dt.stack]}return[null,null]}};R.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var Y=Object.getOwnPropertyDescriptor(R.DetermineComponentFrameRoot,"name");Y&&Y.configurable&&Object.defineProperty(R.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var J=R.DetermineComponentFrameRoot(),he=J[0],Se=J[1];if(he&&Se){var He=he.split(`
4
4
  `),lt=Se.split(`
@@ -383,7 +383,7 @@ T* `):oe.join(` Tj
383
383
  `),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:vr.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=vr.RadioButton.Cross.YesNormal,t.D[e]=vr.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=bd(e);t.scope=e.scope;var r=[],n=vr.internal.calculateCross(e);return r.push("q"),r.push("1 1 "+gn(vr.internal.getWidth(e)-2)+" "+gn(vr.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(gn(n.x1.x)+" "+gn(n.x1.y)+" m"),r.push(gn(n.x2.x)+" "+gn(n.x2.y)+" l"),r.push(gn(n.x4.x)+" "+gn(n.x4.y)+" m"),r.push(gn(n.x3.x)+" "+gn(n.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join(`
384
384
  `),t},YesPushDown:function(e){var t=bd(e);t.scope=e.scope;var r=vr.internal.calculateCross(e),n=[];return n.push("0.749023 g"),n.push("0 0 "+gn(vr.internal.getWidth(e))+" "+gn(vr.internal.getHeight(e))+" re"),n.push("f"),n.push("q"),n.push("1 1 "+gn(vr.internal.getWidth(e)-2)+" "+gn(vr.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(gn(r.x1.x)+" "+gn(r.x1.y)+" m"),n.push(gn(r.x2.x)+" "+gn(r.x2.y)+" l"),n.push(gn(r.x4.x)+" "+gn(r.x4.y)+" m"),n.push(gn(r.x3.x)+" "+gn(r.x3.y)+" l"),n.push("s"),n.push("Q"),t.stream=n.join(`
385
385
  `),t},OffPushDown:function(e){var t=bd(e);t.scope=e.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+gn(vr.internal.getWidth(e))+" "+gn(vr.internal.getHeight(e))+" re"),r.push("f"),t.stream=r.join(`
386
- `),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+r}};vr.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=vr.internal.getWidth(e),r=vr.internal.getHeight(e),n=Math.min(t,r);return{x1:{x:(t-n)/2,y:(r-n)/2+n},x2:{x:(t-n)/2+n,y:(r-n)/2},x3:{x:(t-n)/2,y:(r-n)/2},x4:{x:(t-n)/2+n,y:(r-n)/2+n}}}},vr.internal.getWidth=function(e){var t=0;return di(e)==="object"&&(t=dU(e.Rect[2])),t},vr.internal.getHeight=function(e){var t=0;return di(e)==="object"&&(t=dU(e.Rect[3])),t};var BIe=Ko.addField=function(e){if(CIe(this,e),!(e instanceof Vu))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};Ko.AcroFormChoiceField=Zm,Ko.AcroFormListBox=Jm,Ko.AcroFormComboBox=e0,Ko.AcroFormEditBox=C5,Ko.AcroFormButton=Ka,Ko.AcroFormPushButton=B5,Ko.AcroFormRadioButton=t0,Ko.AcroFormCheckBox=E5,Ko.AcroFormTextField=KA,Ko.AcroFormPasswordField=M5,Ko.AcroFormAppearance=vr,Ko.AcroForm={ChoiceField:Zm,ListBox:Jm,ComboBox:e0,EditBox:C5,Button:Ka,PushButton:B5,RadioButton:t0,CheckBox:E5,TextField:KA,PasswordField:M5,Appearance:vr},Er.AcroForm={ChoiceField:Zm,ListBox:Jm,ComboBox:e0,EditBox:C5,Button:Ka,PushButton:B5,RadioButton:t0,CheckBox:E5,TextField:KA,PasswordField:M5,Appearance:vr};Er.AcroForm;function BY(e){return e.reduce(function(t,r,n){return t[r]=n,t},{})}(function(e){var t="addImage_";e.__addimage__={};var r="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(z,Q){var D,I,E,x,_,S=r;if((Q=Q||r)==="RGBA"||z.data!==void 0&&z.data instanceof Uint8ClampedArray&&"height"in z&&"width"in z)return"RGBA";if(M(z))for(_ in n)for(E=n[_],D=0;D<E.length;D+=1){for(x=!0,I=0;I<E[D].length;I+=1)if(E[D][I]!==void 0&&E[D][I]!==z[I]){x=!1;break}if(x===!0){S=_;break}}else for(_ in n)for(E=n[_],D=0;D<E.length;D+=1){for(x=!0,I=0;I<E[D].length;I+=1)if(E[D][I]!==void 0&&E[D][I]!==z.charCodeAt(I)){x=!1;break}if(x===!0){S=_;break}}return S===r&&Q!==r&&(S=Q),S},o=function z(Q){for(var D=this.internal.write,I=this.internal.putStream,E=(0,this.internal.getFilters)();E.indexOf("FlateEncode")!==-1;)E.splice(E.indexOf("FlateEncode"),1);Q.objectId=this.internal.newObject();var x=[];if(x.push({key:"Type",value:"/XObject"}),x.push({key:"Subtype",value:"/Image"}),x.push({key:"Width",value:Q.width}),x.push({key:"Height",value:Q.height}),Q.colorSpace===b.INDEXED?x.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(Q.palette.length/3-1)+" "+("sMask"in Q&&Q.sMask!==void 0?Q.objectId+2:Q.objectId+1)+" 0 R]"}):(x.push({key:"ColorSpace",value:"/"+Q.colorSpace}),Q.colorSpace===b.DEVICE_CMYK&&x.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),x.push({key:"BitsPerComponent",value:Q.bitsPerComponent}),"decodeParameters"in Q&&Q.decodeParameters!==void 0&&x.push({key:"DecodeParms",value:"<<"+Q.decodeParameters+">>"}),"transparency"in Q&&Array.isArray(Q.transparency)&&Q.transparency.length>0){for(var _="",S=0,B=Q.transparency.length;S<B;S++)_+=Q.transparency[S]+" "+Q.transparency[S]+" ";x.push({key:"Mask",value:"["+_+"]"})}Q.sMask!==void 0&&x.push({key:"SMask",value:Q.objectId+1+" 0 R"});var T=Q.filter!==void 0?["/"+Q.filter]:void 0;if(I({data:Q.data,additionalKeyValues:x,alreadyAppliedFilters:T,objectId:Q.objectId}),D("endobj"),"sMask"in Q&&Q.sMask!==void 0){var U,O=(U=Q.sMaskBitsPerComponent)!==null&&U!==void 0?U:Q.bitsPerComponent,H={width:Q.width,height:Q.height,colorSpace:"DeviceGray",bitsPerComponent:O,data:Q.sMask};"filter"in Q&&(H.decodeParameters="/Predictor ".concat(Q.predictor," /Colors 1 /BitsPerComponent ").concat(O," /Columns ").concat(Q.width),H.filter=Q.filter),z.call(this,H)}if(Q.colorSpace===b.INDEXED){var W=this.internal.newObject();I({data:L(new Uint8Array(Q.palette)),objectId:W}),D("endobj")}},a=function(){var z=this.internal.collections[t+"images"];for(var Q in z)o.call(this,z[Q])},s=function(){var z,Q=this.internal.collections[t+"images"],D=this.internal.write;for(var I in Q)D("/I"+(z=Q[I]).index,z.objectId,"0","R")},c=function(){this.internal.collections[t+"images"]||(this.internal.collections[t+"images"]={},this.internal.events.subscribe("putResources",a),this.internal.events.subscribe("putXobjectDict",s))},l=function(){var z=this.internal.collections[t+"images"];return c.call(this),z},u=function(){return Object.keys(this.internal.collections[t+"images"]).length},d=function(z){return typeof e["process"+z.toUpperCase()]=="function"},h=function(z){return di(z)==="object"&&z.nodeType===1},f=function(z,Q){if(z.nodeName==="IMG"&&z.hasAttribute("src")){var D=""+z.getAttribute("src");if(D.indexOf("data:image/")===0)return k5(unescape(D).split("base64,").pop());var I=e.loadFile(D,!0);if(I!==void 0)return I}if(z.nodeName==="CANVAS"){if(z.width===0||z.height===0)throw new Error("Given canvas must have data. Canvas width: "+z.width+", height: "+z.height);var E;switch(Q){case"PNG":E="image/png";break;case"WEBP":E="image/webp";break;default:E="image/jpeg"}return k5(z.toDataURL(E,1).split("base64,").pop())}},p=function(z){var Q=this.internal.collections[t+"images"];if(Q){for(var D in Q)if(z===Q[D].alias)return Q[D]}},m=function(z,Q,D){return z||Q||(z=-96,Q=-96),z<0&&(z=-1*D.width*72/z/this.internal.scaleFactor),Q<0&&(Q=-1*D.height*72/Q/this.internal.scaleFactor),z===0&&(z=Q*D.width/D.height),Q===0&&(Q=z*D.height/D.width),[z,Q]},g=function(z,Q,D,I,E,x){var _=m.call(this,D,I,E),S=this.internal.getCoordinateString,B=this.internal.getVerticalCoordinateString,T=l.call(this);if(D=_[0],I=_[1],T[E.index]=E,x){x*=Math.PI/180;var U=Math.cos(x),O=Math.sin(x),H=function(te){return te.toFixed(4)},W=[H(U),H(O),H(-1*O),H(U),0,0,"cm"]}this.internal.write("q"),x?(this.internal.write([1,"0","0",1,S(z),B(Q+I),"cm"].join(" ")),this.internal.write(W.join(" ")),this.internal.write([S(D),"0","0",S(I),"0","0","cm"].join(" "))):this.internal.write([S(D),"0","0",S(I),S(z),B(Q+I),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+E.index+" Do"),this.internal.write("Q")},b=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 v=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},w=e.__addimage__.sHashCode=function(z){var Q,D,I=0;if(typeof z=="string")for(D=z.length,Q=0;Q<D;Q++)I=(I<<5)-I+z.charCodeAt(Q),I|=0;else if(M(z))for(D=z.byteLength/2,Q=0;Q<D;Q++)I=(I<<5)-I+z[Q],I|=0;return I},C=e.__addimage__.validateStringAsBase64=function(z){(z=z||"").toString().trim();var Q=!0;return z.length===0&&(Q=!1),z.length%4!=0&&(Q=!1),/^[A-Za-z0-9+/]+$/.test(z.substr(0,z.length-2))===!1&&(Q=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(z.substr(-2))===!1&&(Q=!1),Q},F=e.__addimage__.extractImageFromDataUrl=function(z){if(z==null||!(z=z.trim()).startsWith("data:"))return null;var Q=z.indexOf(",");return Q<0?null:z.substring(0,Q).trim().endsWith("base64")?z.substring(Q+1):null};e.__addimage__.isArrayBuffer=function(z){return z instanceof ArrayBuffer};var M=e.__addimage__.isArrayBufferView=function(z){return z instanceof Int8Array||z instanceof Uint8Array||z instanceof Uint8ClampedArray||z instanceof Int16Array||z instanceof Uint16Array||z instanceof Int32Array||z instanceof Uint32Array||z instanceof Float32Array||z instanceof Float64Array},j=e.__addimage__.binaryStringToUint8Array=function(z){for(var Q=z.length,D=new Uint8Array(Q),I=0;I<Q;I++)D[I]=z.charCodeAt(I);return D},L=e.__addimage__.arrayBufferToBinaryString=function(z){for(var Q="",D=M(z)?z:new Uint8Array(z),I=0;I<D.length;I+=8192)Q+=String.fromCharCode.apply(null,D.subarray(I,I+8192));return Q};e.addImage=function(){var z,Q,D,I,E,x,_,S,B;if(typeof arguments[1]=="number"?(Q=r,D=arguments[1],I=arguments[2],E=arguments[3],x=arguments[4],_=arguments[5],S=arguments[6],B=arguments[7]):(Q=arguments[1],D=arguments[2],I=arguments[3],E=arguments[4],x=arguments[5],_=arguments[6],S=arguments[7],B=arguments[8]),di(z=arguments[0])==="object"&&!h(z)&&"imageData"in z){var T=z;z=T.imageData,Q=T.format||Q||r,D=T.x||D||0,I=T.y||I||0,E=T.w||T.width||E,x=T.h||T.height||x,_=T.alias||_,S=T.compression||S,B=T.rotation||T.angle||B}var U=this.internal.getFilters();if(S===void 0&&U.indexOf("FlateEncode")!==-1&&(S="SLOW"),isNaN(D)||isNaN(I))throw new Error("Invalid coordinates passed to jsPDF.addImage");c.call(this);var O=P.call(this,z,Q,_,S);return g.call(this,D,I,E,x,O,B),this};var P=function(z,Q,D,I){var E,x,_;if(typeof z=="string"&&i(z)===r){z=unescape(z);var S=N(z,!1);(S!==""||(S=e.loadFile(z,!0))!==void 0)&&(z=S)}if(h(z)&&(z=f(z,Q)),Q=i(z,Q),!d(Q))throw new Error("addImage does not support files of type '"+Q+"', please ensure that a plugin for '"+Q+"' support is added.");if(((_=D)==null||_.length===0)&&(D=(function(B){return typeof B=="string"||M(B)?w(B):M(B.data)?w(B.data):null})(z)),(E=p.call(this,D))||(z instanceof Uint8Array||Q==="RGBA"||(x=z,z=j(z)),E=this["process"+Q.toUpperCase()](z,u.call(this),D,(function(B){return B&&typeof B=="string"&&(B=B.toUpperCase()),B in e.image_compression?B:v.NONE})(I),x)),!E)throw new Error("An unknown error occurred whilst processing the image.");return E},N=e.__addimage__.convertBase64ToBinaryString=function(z,Q){Q=typeof Q!="boolean"||Q;var D,I="";if(typeof z=="string"){var E;D=(E=F(z))!==null&&E!==void 0?E:z;try{I=k5(D)}catch(x){if(Q)throw C(D)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+x.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return I};e.getImageProperties=function(z){var Q,D,I="";if(h(z)&&(z=f(z)),typeof z=="string"&&i(z)===r&&((I=N(z,!1))===""&&(I=e.loadFile(z)||""),z=I),D=i(z),!d(D))throw new Error("addImage does not support files of type '"+D+"', please ensure that a plugin for '"+D+"' support is added.");if(z instanceof Uint8Array||(z=j(z)),!(Q=this["process"+D.toUpperCase()](z)))throw new Error("An unknown error occurred whilst processing the image");return Q.fileType=D,Q}})(Er.API),(function(e){var t=function(r){if(r!==void 0&&r!="")return!0};Er.API.events.push(["addPage",function(r){this.internal.getPageInfo(r.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(r){for(var n,i,o,a=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString,c=this.internal.getPageInfoByObjId(r.objId),l=r.pageContext.annotations,u=!1,d=0;d<l.length&&!u;d++)switch((n=l[d]).type){case"link":(t(n.options.url)||t(n.options.pageNumber))&&(u=!0);break;case"reference":case"text":case"freetext":u=!0}if(u!=0){this.internal.write("/Annots [");for(var h=0;h<l.length;h++){n=l[h];var f=this.internal.pdfEscape,p=this.internal.getEncryptor(r.objId);switch(n.type){case"reference":this.internal.write(" "+n.object.objId+" 0 R ");break;case"text":var m=this.internal.newAdditionalObject(),g=this.internal.newAdditionalObject(),b=this.internal.getEncryptor(m.objId),v=n.title||"Note";o="<</Type /Annot /Subtype /Text "+(i="/Rect ["+a(n.bounds.x)+" "+s(n.bounds.y+n.bounds.h)+" "+a(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y)+"] ")+"/Contents ("+f(b(n.contents))+")",o+=" /Popup "+g.objId+" 0 R",o+=" /P "+c.objId+" 0 R",o+=" /T ("+f(b(v))+") >>",m.content=o;var w=m.objId+" 0 R";o="<</Type /Annot /Subtype /Popup "+(i="/Rect ["+a(n.bounds.x+30)+" "+s(n.bounds.y+n.bounds.h)+" "+a(n.bounds.x+n.bounds.w+30)+" "+s(n.bounds.y)+"] ")+" /Parent "+w,n.open&&(o+=" /Open true"),o+=" >>",g.content=o,this.internal.write(m.objId,"0 R",g.objId,"0 R");break;case"freetext":i="/Rect ["+a(n.bounds.x)+" "+s(n.bounds.y)+" "+a(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y+n.bounds.h)+"] ";var C=n.color||"#000000";o="<</Type /Annot /Subtype /FreeText "+i+"/Contents ("+f(p(n.contents))+")",o+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+C+")",o+=" /Border [0 0 0]",o+=" >>",this.internal.write(o);break;case"link":if(n.options.name){var F=this.annotations._nameMap[n.options.name];n.options.pageNumber=F.page,n.options.top=F.y}else n.options.top||(n.options.top=0);if(i="/Rect ["+n.finalBounds.x+" "+n.finalBounds.y+" "+n.finalBounds.w+" "+n.finalBounds.h+"] ",o="",n.options.url)o="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /A <</S /URI /URI ("+f(p(n.options.url))+") >>";else if(n.options.pageNumber)switch(o="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(n.options.pageNumber).objId+" 0 R",n.options.magFactor=n.options.magFactor||"XYZ",n.options.magFactor){case"Fit":o+=" /Fit]";break;case"FitH":o+=" /FitH "+n.options.top+"]";break;case"FitV":n.options.left=n.options.left||0,o+=" /FitV "+n.options.left+"]";break;default:var M=s(n.options.top);n.options.left=n.options.left||0,n.options.zoom===void 0&&(n.options.zoom=0),o+=" /XYZ "+n.options.left+" "+M+" "+n.options.zoom+"]"}o!=""&&(o+=" >>",this.internal.write(o))}}this.internal.write("]")}}]),e.createAnnotation=function(r){var n=this.internal.getCurrentPageInfo();switch(r.type){case"link":this.link(r.bounds.x,r.bounds.y,r.bounds.w,r.bounds.h,r);break;case"text":case"freetext":n.pageContext.annotations.push(r)}},e.link=function(r,n,i,o,a){var s=this.internal.getCurrentPageInfo(),c=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString;s.pageContext.annotations.push({finalBounds:{x:c(r),y:l(n),w:c(r+i),h:l(n+o)},options:a,type:"link"})},e.textWithLink=function(r,n,i,o){var a,s,c=this.getTextWidth(r),l=this.internal.getLineHeight()/this.internal.scaleFactor;if(o.maxWidth!==void 0){s=o.maxWidth;var u=this.splitTextToSize(r,s).length;a=Math.ceil(l*u)}else s=c,a=l;return this.text(r,n,i,o),i+=.2*l,o.align==="center"&&(n-=c/2),o.align==="right"&&(n-=c),this.link(n,i-l,s,a,o),c},e.getTextWidth=function(r){var n=this.internal.getFontSize();return this.getStringUnitWidth(r)*n/this.internal.scaleFactor}})(Er.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]},r={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}},n={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];e.__arabicParser__={};var o=e.__arabicParser__.isInArabicSubstitutionA=function(m){return t[m.charCodeAt(0)]!==void 0},a=e.__arabicParser__.isArabicLetter=function(m){return typeof m=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(m)},s=e.__arabicParser__.isArabicEndLetter=function(m){return a(m)&&o(m)&&t[m.charCodeAt(0)].length<=2},c=e.__arabicParser__.isArabicAlfLetter=function(m){return a(m)&&i.indexOf(m.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(m){return a(m)&&o(m)&&t[m.charCodeAt(0)].length>=1};var l=e.__arabicParser__.arabicLetterHasFinalForm=function(m){return a(m)&&o(m)&&t[m.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(m){return a(m)&&o(m)&&t[m.charCodeAt(0)].length>=3};var u=e.__arabicParser__.arabicLetterHasMedialForm=function(m){return a(m)&&o(m)&&t[m.charCodeAt(0)].length==4},d=e.__arabicParser__.resolveLigatures=function(m){var g=0,b=r,v="",w=0;for(g=0;g<m.length;g+=1)b[m.charCodeAt(g)]!==void 0?(w++,typeof(b=b[m.charCodeAt(g)])=="number"&&(v+=String.fromCharCode(b),b=r,w=0),g===m.length-1&&(b=r,v+=m.charAt(g-(w-1)),g-=w-1,w=0)):(b=r,v+=m.charAt(g-w),g-=w,w=0);return v};e.__arabicParser__.isArabicDiacritic=function(m){return m!==void 0&&n[m.charCodeAt(0)]!==void 0};var h=e.__arabicParser__.getCorrectForm=function(m,g,b){return a(m)?o(m)===!1?-1:!l(m)||!a(g)&&!a(b)||!a(b)&&s(g)||s(m)&&!a(g)||s(m)&&c(g)||s(m)&&s(g)?0:u(m)&&a(g)&&!s(g)&&a(b)&&l(b)?3:s(m)||!a(b)?1:2:-1},f=function(m){var g=0,b=0,v=0,w="",C="",F="",M=(m=m||"").split("\\s+"),j=[];for(g=0;g<M.length;g+=1){for(j.push(""),b=0;b<M[g].length;b+=1)w=M[g][b],C=M[g][b-1],F=M[g][b+1],a(w)?(v=h(w,C,F),j[g]+=v!==-1?String.fromCharCode(t[w.charCodeAt(0)][v]):w):j[g]+=w;j[g]=d(j[g])}return j.join(" ")},p=e.__arabicParser__.processArabic=e.processArabic=function(){var m,g=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,b=[];if(Array.isArray(g)){var v=0;for(b=[],v=0;v<g.length;v+=1)Array.isArray(g[v])?b.push([f(g[v][0]),g[v][1],g[v][2]]):b.push([f(g[v])]);m=b}else m=f(g);return typeof arguments[0]=="string"?m:(arguments[0].text=m,arguments[0])};e.events.push(["preProcessText",p])})(Er.API),Er.API.autoPrint=function(e){var t;return(e=e||{}).variant=e.variant||"non-conform",e.variant==="javascript"?this.addJS("print({});"):(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")})),this},(function(e){var t=function(){var r=void 0;Object.defineProperty(this,"pdf",{get:function(){return r},set:function(s){r=s}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(s){n=isNaN(s)||Number.isInteger(s)===!1||s<0?150:s,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var i=300;Object.defineProperty(this,"height",{get:function(){return i},set:function(s){i=isNaN(s)||Number.isInteger(s)===!1||s<0?300:s,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=i+1)}});var o=[];Object.defineProperty(this,"childNodes",{get:function(){return o},set:function(s){o=s}});var a={};Object.defineProperty(this,"style",{get:function(){return a},set:function(s){a=s}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(r,n){var i;if((r=r||"2d")!=="2d")return null;for(i in n)this.pdf.context2d.hasOwnProperty(i)&&(this.pdf.context2d[i]=n[i]);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}])})(Er.API),(function(e){var t={left:0,top:0,bottom:0,right:0},r=!1,n=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(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new o,this.internal.__cell__.pages=1},o=function(){var c=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return c},set:function(m){c=m}});var l=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return l},set:function(m){l=m}});var u=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return u},set:function(m){u=m}});var d=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return d},set:function(m){d=m}});var h=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return h},set:function(m){h=m}});var f=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return f},set:function(m){f=m}});var p=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return p},set:function(m){p=m}}),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(c){return n.call(this),this.internal.__cell__.headerFunction=typeof c=="function"?c:void 0,this},e.getTextDimensions=function(c,l){n.call(this);var u=(l=l||{}).fontSize||this.getFontSize(),d=l.font||this.getFont(),h=l.scaleFactor||this.internal.scaleFactor,f=0,p=0,m=0,g=this;if(!Array.isArray(c)&&typeof c!="string"){if(typeof c!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");c=String(c)}var b=l.maxWidth;b>0?typeof c=="string"?c=this.splitTextToSize(c,b):Object.prototype.toString.call(c)==="[object Array]"&&(c=c.reduce(function(w,C){return w.concat(g.splitTextToSize(C,b))},[])):c=Array.isArray(c)?c:[c];for(var v=0;v<c.length;v++)f<(m=this.getStringUnitWidth(c[v],{font:d})*u)&&(f=m);return f!==0&&(p=c.length),{w:f/=h,h:Math.max((p*u*this.getLineHeightFactor()-u*(this.getLineHeightFactor()-1))/h,0)}},e.cellAddPage=function(){n.call(this),this.addPage();var c=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new o(c.left,c.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var a=e.cell=function(){var c;c=arguments[0]instanceof o?arguments[0]:new o(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),n.call(this);var l=this.internal.__cell__.lastCell,u=this.internal.__cell__.padding,d=this.internal.__cell__.margins||t,h=this.internal.__cell__.tableHeaderRow,f=this.internal.__cell__.printHeaders;return l.lineNumber!==void 0&&(l.lineNumber===c.lineNumber?(c.x=(l.x||0)+(l.width||0),c.y=l.y||0):l.y+l.height+c.height+d.bottom>this.getPageHeight()?(this.cellAddPage(),c.y=d.top,f&&h&&(this.printHeaderRow(c.lineNumber,!0),c.y+=h[0].height)):c.y=l.y+l.height||c.y),c.text[0]!==void 0&&(this.rect(c.x,c.y,c.width,c.height,r===!0?"FD":void 0),c.align==="right"?this.text(c.text,c.x+c.width-u,c.y+u,{align:"right",baseline:"top"}):c.align==="center"?this.text(c.text,c.x+c.width/2,c.y+u,{align:"center",baseline:"top",maxWidth:c.width-u-u}):this.text(c.text,c.x+u,c.y+u,{align:"left",baseline:"top",maxWidth:c.width-u-u})),this.internal.__cell__.lastCell=c,this};e.table=function(c,l,u,d,h){if(n.call(this),!u)throw new Error("No data for PDF table.");var f,p,m,g,b=[],v=[],w=[],C={},F={},M=[],j=[],L=(h=h||{}).autoSize||!1,P=h.printHeaders!==!1,N=h.css&&h.css["font-size"]!==void 0?16*h.css["font-size"]:h.fontSize||12,z=h.margins||Object.assign({width:this.getPageWidth()},t),Q=typeof h.padding=="number"?h.padding:3,D=h.headerBackgroundColor||"#c8c8c8",I=h.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=P,this.internal.__cell__.margins=z,this.internal.__cell__.table_font_size=N,this.internal.__cell__.padding=Q,this.internal.__cell__.headerBackgroundColor=D,this.internal.__cell__.headerTextColor=I,this.setFontSize(N),d==null)v=b=Object.keys(u[0]),w=b.map(function(){return"left"});else if(Array.isArray(d)&&di(d[0])==="object")for(b=d.map(function(T){return T.name}),v=d.map(function(T){return T.prompt||T.name||""}),w=d.map(function(T){return T.align||"left"}),f=0;f<d.length;f+=1)F[d[f].name]=.7499990551181103*d[f].width;else Array.isArray(d)&&typeof d[0]=="string"&&(v=b=d,w=b.map(function(){return"left"}));if(L||Array.isArray(d)&&typeof d[0]=="string")for(f=0;f<b.length;f+=1){for(C[g=b[f]]=u.map(function(T){return T[g]}),this.setFont(void 0,"bold"),M.push(this.getTextDimensions(v[f],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),p=C[g],this.setFont(void 0,"normal"),m=0;m<p.length;m+=1)M.push(this.getTextDimensions(p[m],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);F[g]=Math.max.apply(null,M)+Q+Q,M=[]}if(P){var E={};for(f=0;f<b.length;f+=1)E[b[f]]={},E[b[f]].text=v[f],E[b[f]].align=w[f];var x=s.call(this,E,F);j=b.map(function(T){return new o(c,l,F[T],x,E[T].text,void 0,E[T].align)}),this.setTableHeaderRow(j),this.printHeaderRow(1,!1)}var _=d.reduce(function(T,U){return T[U.name]=U.align,T},{});for(f=0;f<u.length;f+=1){"rowStart"in h&&h.rowStart instanceof Function&&h.rowStart({row:f,data:u[f]},this);var S=s.call(this,u[f],F);for(m=0;m<b.length;m+=1){var B=u[f][b[m]];"cellStart"in h&&h.cellStart instanceof Function&&h.cellStart({row:f,col:m,data:B},this),a.call(this,new o(c,l,F[b[m]],S,B,f+2,_[b[m]]))}}return this.internal.__cell__.table_x=c,this.internal.__cell__.table_y=l,this};var s=function(c,l){var u=this.internal.__cell__.padding,d=this.internal.__cell__.table_font_size,h=this.internal.scaleFactor;return Object.keys(c).map(function(f){var p=c[f];return this.splitTextToSize(p.hasOwnProperty("text")?p.text:p,l[f]-u-u)},this).map(function(f){return this.getLineHeightFactor()*f.length*d/h+u+u},this).reduce(function(f,p){return Math.max(f,p)},0)};e.setTableHeaderRow=function(c){n.call(this),this.internal.__cell__.tableHeaderRow=c},e.printHeaderRow=function(c,l){if(n.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var u;if(r=!0,typeof this.internal.__cell__.headerFunction=="function"){var d=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new o(d[0],d[1],d[2],d[3],void 0,-1)}this.setFont(void 0,"bold");for(var h=[],f=0;f<this.internal.__cell__.tableHeaderRow.length;f+=1){u=this.internal.__cell__.tableHeaderRow[f].clone(),l&&(u.y=this.internal.__cell__.margins.top||0,h.push(u)),u.lineNumber=c;var p=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),a.call(this,u),this.setTextColor(p)}h.length>0&&this.setTableHeaderRow(h),this.setFont(void 0,"normal"),r=!1}})(Er.API);var EY={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},MY=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],AB=BY(MY),TY=[100,200,300,400,500,600,700,800,900],EIe=BY(TY);function T6(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),r=(function(o){return EY[o=o||"normal"]?o:"normal"})(e.style),n=(function(o){return o?typeof o=="number"?o>=100&&o<=900&&o%100==0?o:400:/^\d00$/.test(o)?parseInt(o):o==="bold"?700:400:400})(e.weight),i=(function(o){return typeof AB[o=o||"normal"]=="number"?o:"normal"})(e.stretch);return{family:t,style:r,weight:n,stretch:i,src:e.src||[],ref:e.ref||{name:t,style:[i,r,n].join(" ")}}}function fU(e,t,r,n){var i;for(i=r;i>=0&&i<t.length;i+=n)if(e[t[i]])return e[t[i]];for(i=r;i>=0&&i<t.length;i-=n)if(e[t[i]])return e[t[i]]}var MIe={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},hU={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function pU(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function AU(e){return e.trimLeft()}function TIe(e,t){for(var r=0;r<e.length;){if(e.charAt(r)===t)return[e.substring(0,r),e.substring(r+1)];r+=1}return null}function FIe(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 Aw,gU,mU,pm,gw,bU,yU,vU,wU=["times"];function xU(e,t,r,n,i){var o=4,a=SU;switch(i){case Er.API.image_compression.FAST:o=1,a=_U;break;case Er.API.image_compression.MEDIUM:o=6,a=kU;break;case Er.API.image_compression.SLOW:o=9,a=CU}e=(function(c,l,u,d){for(var h,f=c.length/l,p=new Uint8Array(c.length+f),m=[DIe,_U,SU,kU,CU],g=0;g<f;g+=1){var b=g*l,v=c.subarray(b,b+l);if(d)p.set(d(v,u,h),b+g);else{for(var w=m.length,C=[],F=0;F<w;F+=1)C[F]=m[F](v,u,h);var M=RIe(C.concat());p.set(C[M],b+g)}h=v}return p})(e,t,Math.ceil(r*n/8),a);var s=lB(e,{level:o});return Er.API.__addimage__.arrayBufferToBinaryString(s)}function DIe(e){var t=Array.apply([],e);return t.unshift(0),t}function _U(e,t){var r=e.length,n=[];n[0]=1;for(var i=0;i<r;i+=1){var o=e[i-t]||0;n[i+1]=e[i]-o+256&255}return n}function SU(e,t,r){var n=e.length,i=[];i[0]=2;for(var o=0;o<n;o+=1){var a=r&&r[o]||0;i[o+1]=e[o]-a+256&255}return i}function kU(e,t,r){var n=e.length,i=[];i[0]=3;for(var o=0;o<n;o+=1){var a=e[o-t]||0,s=r&&r[o]||0;i[o+1]=e[o]+256-(a+s>>>1)&255}return i}function CU(e,t,r){var n=e.length,i=[];i[0]=4;for(var o=0;o<n;o+=1){var a=IIe(e[o-t]||0,r&&r[o]||0,r&&r[o-t]||0);i[o+1]=e[o]-a+256&255}return i}function IIe(e,t,r){if(e===t&&t===r)return e;var n=Math.abs(t-r),i=Math.abs(e-r),o=Math.abs(e+t-r-r);return n<=i&&n<=o?e:i<=o?t:r}function RIe(e){var t=e.map(function(r){return r.reduce(function(n,i){return n+Math.abs(i)},0)});return t.indexOf(Math.min.apply(null,t))}function F6(e,t,r){var n=t*r,i=Math.floor(n/8),o=16-(n-8*i+r),a=(1<<r)-1;return FY(e,i)>>o&a}function BU(e,t,r,n){var i=r*n,o=Math.floor(i/8),a=16-(i-8*o+n),s=(1<<n)-1,c=(t&s)<<a;(function(l,u,d){if(u+1<l.byteLength)l.setUint16(u,d,!1);else{var h=d>>8&255;l.setUint8(u,h)}})(e,o,FY(e,o)&~(s<<a)&65535|c)}function FY(e,t){return t+1<e.byteLength?e.getUint16(t,!1):e.getUint8(t)<<8}function OIe(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 r=e[t++]|e[t++]<<8,n=e[t++]|e[t++]<<8,i=e[t++],o=i>>7,a=1<<1+(7&i);e[t++],e[t++];var s=null,c=null;o&&(s=t,c=a,t+=3*a);var l=!0,u=[],d=0,h=null,f=0,p=null;for(this.width=r,this.height=n;l&&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,p=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!((z=e[t++])>=0))throw Error("Invalid block size");if(z===0)break;t+=z}break;case 249:if(e[t++]!==4||e[t+4]!==0)throw new Error("Invalid graphics extension block.");var m=e[t++];d=e[t++]|e[t++]<<8,h=e[t++],1&m||(h=null),f=m>>2&7,t++;break;case 254:for(;;){if(!((z=e[t++])>=0))throw Error("Invalid block size");if(z===0)break;t+=z}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var g=e[t++]|e[t++]<<8,b=e[t++]|e[t++]<<8,v=e[t++]|e[t++]<<8,w=e[t++]|e[t++]<<8,C=e[t++],F=C>>6&1,M=1<<1+(7&C),j=s,L=c,P=!1;C>>7&&(P=!0,j=t,L=M,t+=3*M);var N=t;for(t++;;){var z;if(!((z=e[t++])>=0))throw Error("Invalid block size");if(z===0)break;t+=z}u.push({x:g,y:b,width:v,height:w,has_local_palette:P,palette_offset:j,palette_size:L,data_offset:N,data_length:t-N,transparent_index:h,interlaced:!!F,delay:d,disposal:f});break;case 59:l=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return u.length},this.loopCount=function(){return p},this.frameInfo=function(Q){if(Q<0||Q>=u.length)throw new Error("Frame index out of range.");return u[Q]},this.decodeAndBlitFrameBGRA=function(Q,D){var I=this.frameInfo(Q),E=I.width*I.height,x=new Uint8Array(E);EU(e,I.data_offset,x,E);var _=I.palette_offset,S=I.transparent_index;S===null&&(S=256);var B=I.width,T=r-B,U=B,O=4*(I.y*r+I.x),H=4*((I.y+I.height)*r+I.x),W=O,te=4*T;I.interlaced===!0&&(te+=4*r*7);for(var V=8,ee=0,G=x.length;ee<G;++ee){var q=x[ee];if(U===0&&(U=B,(W+=te)>=H&&(te=4*T+4*r*(V-1),W=O+(B+T)*(V<<1),V>>=1)),q===S)W+=4;else{var X=e[_+3*q],ce=e[_+3*q+1],fe=e[_+3*q+2];D[W++]=fe,D[W++]=ce,D[W++]=X,D[W++]=255}--U}},this.decodeAndBlitFrameRGBA=function(Q,D){var I=this.frameInfo(Q),E=I.width*I.height,x=new Uint8Array(E);EU(e,I.data_offset,x,E);var _=I.palette_offset,S=I.transparent_index;S===null&&(S=256);var B=I.width,T=r-B,U=B,O=4*(I.y*r+I.x),H=4*((I.y+I.height)*r+I.x),W=O,te=4*T;I.interlaced===!0&&(te+=4*r*7);for(var V=8,ee=0,G=x.length;ee<G;++ee){var q=x[ee];if(U===0&&(U=B,(W+=te)>=H&&(te=4*T+4*r*(V-1),W=O+(B+T)*(V<<1),V>>=1)),q===S)W+=4;else{var X=e[_+3*q],ce=e[_+3*q+1],fe=e[_+3*q+2];D[W++]=X,D[W++]=ce,D[W++]=fe,D[W++]=255}--U}}}function EU(e,t,r,n){for(var i=e[t++],o=1<<i,a=o+1,s=a+1,c=i+1,l=(1<<c)-1,u=0,d=0,h=0,f=e[t++],p=new Int32Array(4096),m=null;;){for(;u<16&&f!==0;)d|=e[t++]<<u,u+=8,f===1?f=e[t++]:--f;if(u<c)break;var g=d&l;if(d>>=c,u-=c,g!==o){if(g===a)break;for(var b=g<s?g:m,v=0,w=b;w>o;)w=p[w]>>8,++v;var C=w;if(h+v+(b!==g?1:0)>n)return void Xi.log("Warning, gif stream longer than expected.");r[h++]=C;var F=h+=v;for(b!==g&&(r[h++]=C),w=b;v--;)w=p[w],r[--F]=255&w,w>>=8;m!==null&&s<4096&&(p[s++]=m<<8|C,s>=l+1&&c<12&&(++c,l=l<<1|1)),m=g}else s=a+1,l=(1<<(c=i+1))-1,m=null}return h!==n&&Xi.log("Warning, gif stream shorter than expected."),r}function D6(e){var t,r,n,i,o,a=Math.floor,s=new Array(64),c=new Array(64),l=new Array(64),u=new Array(64),d=new Array(65535),h=new Array(65535),f=new Array(64),p=new Array(64),m=[],g=0,b=7,v=new Array(64),w=new Array(64),C=new Array(64),F=new Array(256),M=new Array(2048),j=[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],L=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],P=[0,1,2,3,4,5,6,7,8,9,10,11],N=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],z=[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],Q=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],D=[0,1,2,3,4,5,6,7,8,9,10,11],I=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],E=[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 x(O,H){for(var W=0,te=0,V=new Array,ee=1;ee<=16;ee++){for(var G=1;G<=O[ee];G++)V[H[te]]=[],V[H[te]][0]=W,V[H[te]][1]=ee,te++,W++;W*=2}return V}function _(O){for(var H=O[0],W=O[1]-1;W>=0;)H&1<<W&&(g|=1<<b),W--,--b<0&&(g==255?(S(255),S(0)):S(g),b=7,g=0)}function S(O){m.push(O)}function B(O){S(O>>8&255),S(255&O)}function T(O,H,W,te,V){for(var ee,G=V[0],q=V[240],X=(function(ge,Ee){var ve,Me,Be,we,Ne,pe,Fe,ke,Ie,Ke,et=0;for(Ie=0;Ie<8;++Ie){ve=ge[et],Me=ge[et+1],Be=ge[et+2],we=ge[et+3],Ne=ge[et+4],pe=ge[et+5],Fe=ge[et+6];var Et=ve+(ke=ge[et+7]),pt=ve-ke,at=Me+Fe,rt=Me-Fe,wt=Be+pe,ht=Be-pe,$t=we+Ne,qt=we-Ne,It=Et+$t,gr=Et-$t,Gt=at+wt,Tt=at-wt;ge[et]=It+Gt,ge[et+4]=It-Gt;var hr=.707106781*(Tt+gr);ge[et+2]=gr+hr,ge[et+6]=gr-hr;var Wr=.382683433*((It=qt+ht)-(Tt=rt+pt)),nr=.5411961*It+Wr,Kr=1.306562965*Tt+Wr,nn=.707106781*(Gt=ht+rt),Ft=pt+nn,on=pt-nn;ge[et+5]=on+nr,ge[et+3]=on-nr,ge[et+1]=Ft+Kr,ge[et+7]=Ft-Kr,et+=8}for(et=0,Ie=0;Ie<8;++Ie){ve=ge[et],Me=ge[et+8],Be=ge[et+16],we=ge[et+24],Ne=ge[et+32],pe=ge[et+40],Fe=ge[et+48];var un=ve+(ke=ge[et+56]),xr=ve-ke,Qe=Me+Fe,$e=Me-Fe,ut=Be+pe,Ot=Be-pe,pr=we+Ne,Pt=we-Ne,Jt=un+pr,Zt=un-pr,er=Qe+ut,nt=Qe-ut;ge[et]=Jt+er,ge[et+32]=Jt-er;var kt=.707106781*(nt+Zt);ge[et+16]=Zt+kt,ge[et+48]=Zt-kt;var rr=.382683433*((Jt=Pt+Ot)-(nt=$e+xr)),mn=.5411961*Jt+rr,_n=1.306562965*nt+rr,vi=.707106781*(er=Ot+$e),ri=xr+vi,Ri=xr-vi;ge[et+40]=Ri+mn,ge[et+24]=Ri-mn,ge[et+8]=ri+_n,ge[et+56]=ri-_n,et++}for(Ie=0;Ie<64;++Ie)Ke=ge[Ie]*Ee[Ie],f[Ie]=Ke>0?Ke+.5|0:Ke-.5|0;return f})(O,H),ce=0;ce<64;++ce)p[j[ce]]=X[ce];var fe=p[0]-W;W=p[0],fe==0?_(te[0]):(_(te[h[ee=32767+fe]]),_(d[ee]));for(var ie=63;ie>0&&p[ie]==0;)ie--;if(ie==0)return _(G),W;for(var le,re=1;re<=ie;){for(var Ae=re;p[re]==0&&re<=ie;)++re;var ue=re-Ae;if(ue>=16){le=ue>>4;for(var me=1;me<=le;++me)_(q);ue&=15}ee=32767+p[re],_(V[(ue<<4)+h[ee]]),_(d[ee]),re++}return ie!=63&&_(G),W}function U(O){O=Math.min(Math.max(O,1),100),o!=O&&((function(H){for(var W=[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],te=0;te<64;te++){var V=a((W[te]*H+50)/100);V=Math.min(Math.max(V,1),255),s[j[te]]=V}for(var ee=[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],G=0;G<64;G++){var q=a((ee[G]*H+50)/100);q=Math.min(Math.max(q,1),255),c[j[G]]=q}for(var X=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],ce=0,fe=0;fe<8;fe++)for(var ie=0;ie<8;ie++)l[ce]=1/(s[j[ce]]*X[fe]*X[ie]*8),u[ce]=1/(c[j[ce]]*X[fe]*X[ie]*8),ce++})(O<50?Math.floor(5e3/O):Math.floor(200-2*O)),o=O)}this.encode=function(O,H){H&&U(H),m=new Array,g=0,b=7,B(65496),B(65504),B(16),S(74),S(70),S(73),S(70),S(0),S(1),S(1),S(0),B(1),B(1),S(0),S(0),(function(){B(65499),B(132),S(0);for(var Me=0;Me<64;Me++)S(s[Me]);S(1);for(var Be=0;Be<64;Be++)S(c[Be])})(),(function(Me,Be){B(65472),B(17),S(8),B(Be),B(Me),S(3),S(1),S(17),S(0),S(2),S(17),S(1),S(3),S(17),S(1)})(O.width,O.height),(function(){B(65476),B(418),S(0);for(var Me=0;Me<16;Me++)S(L[Me+1]);for(var Be=0;Be<=11;Be++)S(P[Be]);S(16);for(var we=0;we<16;we++)S(N[we+1]);for(var Ne=0;Ne<=161;Ne++)S(z[Ne]);S(1);for(var pe=0;pe<16;pe++)S(Q[pe+1]);for(var Fe=0;Fe<=11;Fe++)S(D[Fe]);S(17);for(var ke=0;ke<16;ke++)S(I[ke+1]);for(var Ie=0;Ie<=161;Ie++)S(E[Ie])})(),B(65498),B(12),S(3),S(1),S(0),S(2),S(17),S(3),S(17),S(0),S(63),S(0);var W=0,te=0,V=0;g=0,b=7,this.encode.displayName="_encode_";for(var ee,G,q,X,ce,fe,ie,le,re,Ae=O.data,ue=O.width,me=O.height,ge=4*ue,Ee=0;Ee<me;){for(ee=0;ee<ge;){for(ce=ge*Ee+ee,ie=-1,le=0,re=0;re<64;re++)fe=ce+(le=re>>3)*ge+(ie=4*(7&re)),Ee+le>=me&&(fe-=ge*(Ee+1+le-me)),ee+ie>=ge&&(fe-=ee+ie-ge+4),G=Ae[fe++],q=Ae[fe++],X=Ae[fe++],v[re]=(M[G]+M[q+256|0]+M[X+512|0]>>16)-128,w[re]=(M[G+768|0]+M[q+1024|0]+M[X+1280|0]>>16)-128,C[re]=(M[G+1280|0]+M[q+1536|0]+M[X+1792|0]>>16)-128;W=T(v,l,W,t,n),te=T(w,u,te,r,i),V=T(C,u,V,r,i),ee+=32}Ee+=8}if(b>=0){var ve=[];ve[1]=b+1,ve[0]=(1<<b+1)-1,_(ve)}return B(65497),new Uint8Array(m)},e=e||50,(function(){for(var O=String.fromCharCode,H=0;H<256;H++)F[H]=O(H)})(),t=x(L,P),r=x(Q,D),n=x(N,z),i=x(I,E),(function(){for(var O=1,H=2,W=1;W<=15;W++){for(var te=O;te<H;te++)h[32767+te]=W,d[32767+te]=[],d[32767+te][1]=W,d[32767+te][0]=te;for(var V=-(H-1);V<=-O;V++)h[32767+V]=W,d[32767+V]=[],d[32767+V][1]=W,d[32767+V][0]=H-1+V;O<<=1,H<<=1}})(),(function(){for(var O=0;O<256;O++)M[O]=19595*O,M[O+256|0]=38470*O,M[O+512|0]=7471*O+32768,M[O+768|0]=-11059*O,M[O+1024|0]=-21709*O,M[O+1280|0]=32768*O+8421375,M[O+1536|0]=-27439*O,M[O+1792|0]=-5329*O})(),U(e)}function Su(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 MU(e){function t(P){if(!P)throw Error("assert :P")}function r(P,N,z){for(var Q=0;4>Q;Q++)if(P[N+Q]!=z.charCodeAt(Q))return!0;return!1}function n(P,N,z,Q,D){for(var I=0;I<D;I++)P[N+I]=z[Q+I]}function i(P,N,z,Q){for(var D=0;D<Q;D++)P[N+D]=z}function o(P){return new Int32Array(P)}function a(P,N){for(var z=[],Q=0;Q<P;Q++)z.push(new N);return z}function s(P,N){var z=[];return(function Q(D,I,E){for(var x=E[I],_=0;_<x&&(D.push(E.length>I+1?[]:new N),!(E.length<I+1));_++)Q(D[_],I+1,E)})(z,0,P),z}var c=function(){var P=this;function N($,Z){for(var se=1<<Z-1>>>0;$&se;)se>>>=1;return se?($&se-1)+se:$}function z($,Z,se,de,ye){t(!(de%se));do $[Z+(de-=se)]=ye;while(0<de)}function Q($,Z,se,de,ye){if(t(2328>=ye),512>=ye)var xe=o(512);else if((xe=o(ye))==null)return 0;return(function(_e,Ce,Te,Le,Ge,ot){var Oe,We,Je=Ce,yt=1<<Te,tt=o(16),bt=o(16);for(t(Ge!=0),t(Le!=null),t(_e!=null),t(0<Te),We=0;We<Ge;++We){if(15<Le[We])return 0;++tt[Le[We]]}if(tt[0]==Ge)return 0;for(bt[1]=0,Oe=1;15>Oe;++Oe){if(tt[Oe]>1<<Oe)return 0;bt[Oe+1]=bt[Oe]+tt[Oe]}for(We=0;We<Ge;++We)Oe=Le[We],0<Le[We]&&(ot[bt[Oe]++]=We);if(bt[15]==1)return(Le=new D).g=0,Le.value=ot[0],z(_e,Je,1,yt,Le),yt;var _t,Nt=-1,Bt=yt-1,yr=0,lr=1,Zr=1,Ar=1<<Te;for(We=0,Oe=1,Ge=2;Oe<=Te;++Oe,Ge<<=1){if(lr+=Zr<<=1,0>(Zr-=tt[Oe]))return 0;for(;0<tt[Oe];--tt[Oe])(Le=new D).g=Oe,Le.value=ot[We++],z(_e,Je+yr,Ge,Ar,Le),yr=N(yr,Oe)}for(Oe=Te+1,Ge=2;15>=Oe;++Oe,Ge<<=1){if(lr+=Zr<<=1,0>(Zr-=tt[Oe]))return 0;for(;0<tt[Oe];--tt[Oe]){if(Le=new D,(yr&Bt)!=Nt){for(Je+=Ar,_t=1<<(Nt=Oe)-Te;15>Nt&&!(0>=(_t-=tt[Nt]));)++Nt,_t<<=1;yt+=Ar=1<<(_t=Nt-Te),_e[Ce+(Nt=yr&Bt)].g=_t+Te,_e[Ce+Nt].value=Je-Ce-Nt}Le.g=Oe-Te,Le.value=ot[We++],z(_e,Je+(yr>>Te),Ge,Ar,Le),yr=N(yr,Oe)}}return lr!=2*bt[15]-1?0:yt})($,Z,se,de,ye,xe)}function D(){this.value=this.g=0}function I(){this.value=this.g=0}function E(){this.G=a(5,D),this.H=o(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=a(Zu,I)}function x($,Z,se,de){t($!=null),t(Z!=null),t(2147483648>de),$.Ca=254,$.I=0,$.b=-8,$.Ka=0,$.oa=Z,$.pa=se,$.Jd=Z,$.Yc=se+de,$.Zc=4<=de?se+de-4+1:se,G($)}function _($,Z){for(var se=0;0<Z--;)se|=X($,128)<<Z;return se}function S($,Z){var se=_($,Z);return q($)?-se:se}function B($,Z,se,de){var ye,xe=0;for(t($!=null),t(Z!=null),t(4294967288>de),$.Sb=de,$.Ra=0,$.u=0,$.h=0,4<de&&(de=4),ye=0;ye<de;++ye)xe+=Z[se+ye]<<8*ye;$.Ra=xe,$.bb=de,$.oa=Z,$.pa=se}function T($){for(;8<=$.u&&$.bb<$.Sb;)$.Ra>>>=8,$.Ra+=$.oa[$.pa+$.bb]<<bc-8>>>0,++$.bb,$.u-=8;te($)&&($.h=1,$.u=0)}function U($,Z){if(t(0<=Z),!$.h&&Z<=rs){var se=W($)&gs[Z];return $.u+=Z,T($),se}return $.h=1,$.u=0}function O(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function H(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function W($){return $.Ra>>>($.u&bc-1)>>>0}function te($){return t($.bb<=$.Sb),$.h||$.bb==$.Sb&&$.u>bc}function V($,Z){$.u=Z,$.h=te($)}function ee($){$.u>=yc&&(t($.u>=yc),T($))}function G($){t($!=null&&$.oa!=null),$.pa<$.Zc?($.I=($.oa[$.pa++]|$.I<<8)>>>0,$.b+=8):(t($!=null&&$.oa!=null),$.pa<$.Yc?($.b+=8,$.I=$.oa[$.pa++]|$.I<<8):$.Ka?$.b=0:($.I<<=8,$.b+=8,$.Ka=1))}function q($){return _($,1)}function X($,Z){var se=$.Ca;0>$.b&&G($);var de=$.b,ye=se*Z>>>8,xe=($.I>>>de>ye)+0;for(xe?(se-=ye,$.I-=ye+1<<de>>>0):se=ye+1,de=se,ye=0;256<=de;)ye+=8,de>>=8;return de=7^ye+du[de],$.b-=de,$.Ca=(se<<de)-1,xe}function ce($,Z,se){$[Z+0]=se>>24&255,$[Z+1]=se>>16&255,$[Z+2]=se>>8&255,$[Z+3]=255&se}function fe($,Z){return $[Z+0]|$[Z+1]<<8}function ie($,Z){return fe($,Z)|$[Z+2]<<16}function le($,Z){return fe($,Z)|fe($,Z+2)<<16}function re($,Z){var se=1<<Z;return t($!=null),t(0<Z),$.X=o(se),$.X==null?0:($.Mb=32-Z,$.Xa=Z,1)}function Ae($,Z){t($!=null),t(Z!=null),t($.Xa==Z.Xa),n(Z.X,0,$.X,0,1<<Z.Xa)}function ue(){this.X=[],this.Xa=this.Mb=0}function me($,Z,se,de){t(se!=null),t(de!=null);var ye=se[0],xe=de[0];return ye==0&&(ye=($*xe+Z/2)/Z),xe==0&&(xe=(Z*ye+$/2)/$),0>=ye||0>=xe?0:(se[0]=ye,de[0]=xe,1)}function ge($,Z){return $+(1<<Z)-1>>>Z}function Ee($,Z){return((4278255360&$)+(4278255360&Z)>>>0&4278255360)+((16711935&$)+(16711935&Z)>>>0&16711935)>>>0}function ve($,Z){P[Z]=function(se,de,ye,xe,_e,Ce,Te){var Le;for(Le=0;Le<_e;++Le){var Ge=P[$](Ce[Te+Le-1],ye,xe+Le);Ce[Te+Le]=Ee(se[de+Le],Ge)}}}function Me(){this.ud=this.hd=this.jd=0}function Be($,Z){return((4278124286&($^Z))>>>1)+($&Z)>>>0}function we($){return 0<=$&&256>$?$:0>$?0:255<$?255:void 0}function Ne($,Z){return we($+($-Z+.5>>1))}function pe($,Z,se){return Math.abs(Z-se)-Math.abs($-se)}function Fe($,Z,se,de,ye,xe,_e){for(de=xe[_e-1],se=0;se<ye;++se)xe[_e+se]=de=Ee($[Z+se],de)}function ke($,Z,se,de,ye){var xe;for(xe=0;xe<se;++xe){var _e=$[Z+xe],Ce=_e>>8&255,Te=16711935&(Te=(Te=16711935&_e)+((Ce<<16)+Ce));de[ye+xe]=(4278255360&_e)+Te>>>0}}function Ie($,Z){Z.jd=255&$,Z.hd=$>>8&255,Z.ud=$>>16&255}function Ke($,Z,se,de,ye,xe){var _e;for(_e=0;_e<de;++_e){var Ce=Z[se+_e],Te=Ce>>>8,Le=Ce,Ge=255&(Ge=(Ge=Ce>>>16)+(($.jd<<24>>24)*(Te<<24>>24)>>>5));Le=255&(Le=(Le+=($.hd<<24>>24)*(Te<<24>>24)>>>5)+(($.ud<<24>>24)*(Ge<<24>>24)>>>5)),ye[xe+_e]=(4278255360&Ce)+(Ge<<16)+Le}}function et($,Z,se,de,ye){P[Z]=function(xe,_e,Ce,Te,Le,Ge,ot,Oe,We){for(Te=ot;Te<Oe;++Te)for(ot=0;ot<We;++ot)Le[Ge++]=ye(Ce[de(xe[_e++])])},P[$]=function(xe,_e,Ce,Te,Le,Ge,ot){var Oe=8>>xe.b,We=xe.Ea,Je=xe.K[0],yt=xe.w;if(8>Oe)for(xe=(1<<xe.b)-1,yt=(1<<Oe)-1;_e<Ce;++_e){var tt,bt=0;for(tt=0;tt<We;++tt)tt&xe||(bt=de(Te[Le++])),Ge[ot++]=ye(Je[bt&yt]),bt>>=Oe}else P["VP8LMapColor"+se](Te,Le,Je,yt,Ge,ot,_e,Ce,We)}}function Et($,Z,se,de,ye){for(se=Z+se;Z<se;){var xe=$[Z++];de[ye++]=xe>>16&255,de[ye++]=xe>>8&255,de[ye++]=255&xe}}function pt($,Z,se,de,ye){for(se=Z+se;Z<se;){var xe=$[Z++];de[ye++]=xe>>16&255,de[ye++]=xe>>8&255,de[ye++]=255&xe,de[ye++]=xe>>24&255}}function at($,Z,se,de,ye){for(se=Z+se;Z<se;){var xe=(_e=$[Z++])>>16&240|_e>>12&15,_e=240&_e|_e>>28&15;de[ye++]=xe,de[ye++]=_e}}function rt($,Z,se,de,ye){for(se=Z+se;Z<se;){var xe=(_e=$[Z++])>>16&248|_e>>13&7,_e=_e>>5&224|_e>>3&31;de[ye++]=xe,de[ye++]=_e}}function wt($,Z,se,de,ye){for(se=Z+se;Z<se;){var xe=$[Z++];de[ye++]=255&xe,de[ye++]=xe>>8&255,de[ye++]=xe>>16&255}}function ht($,Z,se,de,ye,xe){if(xe==0)for(se=Z+se;Z<se;)ce(de,((xe=$[Z++])[0]>>24|xe[1]>>8&65280|xe[2]<<8&16711680|xe[3]<<24)>>>0),ye+=32;else n(de,ye,$,Z,se)}function $t($,Z){P[Z][0]=P[$+"0"],P[Z][1]=P[$+"1"],P[Z][2]=P[$+"2"],P[Z][3]=P[$+"3"],P[Z][4]=P[$+"4"],P[Z][5]=P[$+"5"],P[Z][6]=P[$+"6"],P[Z][7]=P[$+"7"],P[Z][8]=P[$+"8"],P[Z][9]=P[$+"9"],P[Z][10]=P[$+"10"],P[Z][11]=P[$+"11"],P[Z][12]=P[$+"12"],P[Z][13]=P[$+"13"],P[Z][14]=P[$+"0"],P[Z][15]=P[$+"0"]}function qt($){return $==eA||$==Bg||$==Sh||$==Eg}function It(){this.eb=[],this.size=this.A=this.fb=0}function gr(){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 Gt(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new It,this.f.kb=new gr,this.sd=null}function Tt(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function hr(){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 Wr($){return alert("todo:WebPSamplerProcessPlane"),$.T}function nr($,Z){var se=$.T,de=Z.ba.f.RGBA,ye=de.eb,xe=de.fb+$.ka*de.A,_e=Sa[Z.ba.S],Ce=$.y,Te=$.O,Le=$.f,Ge=$.N,ot=$.ea,Oe=$.W,We=Z.cc,Je=Z.dc,yt=Z.Mc,tt=Z.Nc,bt=$.ka,_t=$.ka+$.T,Nt=$.U,Bt=Nt+1>>1;for(bt==0?_e(Ce,Te,null,null,Le,Ge,ot,Oe,Le,Ge,ot,Oe,ye,xe,null,null,Nt):(_e(Z.ec,Z.fc,Ce,Te,We,Je,yt,tt,Le,Ge,ot,Oe,ye,xe-de.A,ye,xe,Nt),++se);bt+2<_t;bt+=2)We=Le,Je=Ge,yt=ot,tt=Oe,Ge+=$.Rc,Oe+=$.Rc,xe+=2*de.A,_e(Ce,(Te+=2*$.fa)-$.fa,Ce,Te,We,Je,yt,tt,Le,Ge,ot,Oe,ye,xe-de.A,ye,xe,Nt);return Te+=$.fa,$.j+_t<$.o?(n(Z.ec,Z.fc,Ce,Te,Nt),n(Z.cc,Z.dc,Le,Ge,Bt),n(Z.Mc,Z.Nc,ot,Oe,Bt),se--):1&_t||_e(Ce,Te,null,null,Le,Ge,ot,Oe,Le,Ge,ot,Oe,ye,xe+de.A,null,null,Nt),se}function Kr($,Z,se){var de=$.F,ye=[$.J];if(de!=null){var xe=$.U,_e=Z.ba.S,Ce=_e==Jp||_e==Sh;Z=Z.ba.f.RGBA;var Te=[0],Le=$.ka;Te[0]=$.T,$.Kb&&(Le==0?--Te[0]:(--Le,ye[0]-=$.width),$.j+$.ka+$.T==$.o&&(Te[0]=$.o-$.j-Le));var Ge=Z.eb;Le=Z.fb+Le*Z.A,$=Wp(de,ye[0],$.width,xe,Te,Ge,Le+(Ce?0:3),Z.A),t(se==Te),$&&qt(_e)&&af(Ge,Le,Ce,xe,Te,Z.A)}return 0}function nn($){var Z=$.ma,se=Z.ba.S,de=11>se,ye=se==Na||se==il||se==Jp||se==_h||se==12||qt(se);if(Z.memory=null,Z.Ib=null,Z.Jb=null,Z.Nd=null,!uu(Z.Oa,$,ye?11:12))return 0;if(ye&&qt(se)&&Kp(),$.da)alert("todo:use_scaling");else{if(de){if(Z.Ib=Wr,$.Kb){if(se=$.U+1>>1,Z.memory=o($.U+2*se),Z.memory==null)return 0;Z.ec=Z.memory,Z.fc=0,Z.cc=Z.ec,Z.dc=Z.fc+$.U,Z.Mc=Z.cc,Z.Nc=Z.dc+se,Z.Ib=nr,Kp()}}else alert("todo:EmitYUV");ye&&(Z.Jb=Kr,de&&jl())}if(de&&!od){for($=0;256>$;++$)ka[$]=89858*($-128)+Bh>>ul,b3[$]=-22014*($-128)+Bh,Ov[$]=-45773*($-128),Ig[$]=113618*($-128)+Bh>>ul;for($=uf;$<id;++$)Z=76283*($-16)+Bh>>ul,y3[$-uf]=an(Z,255),v3[$-uf]=an(Z+8>>4,15);od=1}return 1}function Ft($){var Z=$.ma,se=$.U,de=$.T;return t(!(1&$.ka)),0>=se||0>=de?0:(se=Z.Ib($,Z),Z.Jb!=null&&Z.Jb($,Z,se),Z.Dc+=se,1)}function on($){$.ma.memory=null}function un($,Z,se,de){return U($,8)!=47?0:(Z[0]=U($,14)+1,se[0]=U($,14)+1,de[0]=U($,1),U($,3)!=0?0:!$.h)}function xr($,Z){if(4>$)return $+1;var se=$-2>>1;return(2+(1&$)<<se)+U(Z,se)+1}function Qe($,Z){return 120<Z?Z-120:1<=(se=((se=al[Z-1])>>4)*$+(8-(15&se)))?se:1;var se}function $e($,Z,se){var de=W(se),ye=$[Z+=255&de].g-8;return 0<ye&&(V(se,se.u+8),de=W(se),Z+=$[Z].value,Z+=de&(1<<ye)-1),V(se,se.u+$[Z].g),$[Z].value}function ut($,Z,se){return se.g+=$.g,se.value+=$.value<<Z>>>0,t(8>=se.g),$.g}function Ot($,Z,se){var de=$.xc;return t((Z=de==0?0:$.vc[$.md*(se>>de)+(Z>>de)])<$.Wb),$.Ya[Z]}function pr($,Z,se,de){var ye=$.ab,xe=$.c*Z,_e=$.C;Z=_e+Z;var Ce=se,Te=de;for(de=$.Ta,se=$.Ua;0<ye--;){var Le=$.gc[ye],Ge=_e,ot=Z,Oe=Ce,We=Te,Je=(Te=de,Ce=se,Le.Ea);switch(t(Ge<ot),t(ot<=Le.nc),Le.hc){case 2:Bo(Oe,We,(ot-Ge)*Je,Te,Ce);break;case 0:var yt=Ge,tt=ot,bt=Te,_t=Ce,Nt=(Ar=Le).Ea;yt==0&&(yh(Oe,We,null,null,1,bt,_t),Fe(Oe,We+1,0,0,Nt-1,bt,_t+1),We+=Nt,_t+=Nt,++yt);for(var Bt=1<<Ar.b,yr=Bt-1,lr=ge(Nt,Ar.b),Zr=Ar.K,Ar=Ar.w+(yt>>Ar.b)*lr;yt<tt;){var Fn=Zr,$i=Ar,hn=1;for(vh(Oe,We,bt,_t-Nt,1,bt,_t);hn<Nt;){var cr=(hn&~yr)+Bt;cr>Nt&&(cr=Nt),(0,fu[Fn[$i++]>>8&15])(Oe,We+ +hn,bt,_t+hn-Nt,cr-hn,bt,_t+hn),hn=cr}We+=Nt,_t+=Nt,++yt&yr||(Ar+=lr)}ot!=Le.nc&&n(Te,Ce-Je,Te,Ce+(ot-Ge-1)*Je,Je);break;case 1:for(Je=Oe,tt=We,Nt=(Oe=Le.Ea)-(_t=Oe&~(bt=(We=1<<Le.b)-1)),yt=ge(Oe,Le.b),Bt=Le.K,Le=Le.w+(Ge>>Le.b)*yt;Ge<ot;){for(yr=Bt,lr=Le,Zr=new Me,Ar=tt+_t,Fn=tt+Oe;tt<Ar;)Ie(yr[lr++],Zr),wh(Zr,Je,tt,We,Te,Ce),tt+=We,Ce+=We;tt<Fn&&(Ie(yr[lr++],Zr),wh(Zr,Je,tt,Nt,Te,Ce),tt+=Nt,Ce+=Nt),++Ge&bt||(Le+=yt)}break;case 3:if(Oe==Te&&We==Ce&&0<Le.b){for(tt=Te,Oe=Je=Ce+(ot-Ge)*Je-(_t=(ot-Ge)*ge(Le.Ea,Le.b)),We=Te,bt=Ce,yt=[],_t=(Nt=_t)-1;0<=_t;--_t)yt[_t]=We[bt+_t];for(_t=Nt-1;0<=_t;--_t)tt[Oe+_t]=yt[_t];xg(Le,Ge,ot,Te,Je,Te,Ce)}else xg(Le,Ge,ot,Oe,We,Te,Ce)}Ce=de,Te=se}Te!=se&&n(de,se,Ce,Te,xe)}function Pt($,Z){var se=$.V,de=$.Ba+$.c*$.C,ye=Z-$.C;if(t(Z<=$.l.o),t(16>=ye),0<ye){var xe=$.l,_e=$.Ta,Ce=$.Ua,Te=xe.width;if(pr($,ye,se,de),ye=Ce=[Ce],t((se=$.C)<(de=Z)),t(xe.v<xe.va),de>xe.o&&(de=xe.o),se<xe.j){var Le=xe.j-se;se=xe.j,ye[0]+=Le*Te}if(se>=de?se=0:(ye[0]+=4*xe.v,xe.ka=se-xe.j,xe.U=xe.va-xe.v,xe.T=de-se,se=1),se){if(Ce=Ce[0],11>(se=$.ca).S){var Ge=se.f.RGBA,ot=(de=se.S,ye=xe.U,xe=xe.T,Le=Ge.eb,Ge.A),Oe=xe;for(Ge=Ge.fb+$.Ma*Ge.A;0<Oe--;){var We=_e,Je=Ce,yt=ye,tt=Le,bt=Ge;switch(de){case kg:xh(We,Je,yt,tt,bt);break;case Na:hu(We,Je,yt,tt,bt);break;case eA:hu(We,Je,yt,tt,bt),af(tt,bt,0,yt,1,0);break;case Cg:nf(We,Je,yt,tt,bt);break;case il:ht(We,Je,yt,tt,bt,1);break;case Bg:ht(We,Je,yt,tt,bt,1),af(tt,bt,0,yt,1,0);break;case Jp:ht(We,Je,yt,tt,bt,0);break;case Sh:ht(We,Je,yt,tt,bt,0),af(tt,bt,1,yt,1,0);break;case _h:pu(We,Je,yt,tt,bt);break;case Eg:pu(We,Je,yt,tt,bt),nl(tt,bt,yt,1,0);break;case Ju:xc(We,Je,yt,tt,bt);break;default:t(0)}Ce+=Te,Ge+=ot}$.Ma+=xe}else alert("todo:EmitRescaledRowsYUVA");t($.Ma<=se.height)}}$.C=Z,t($.C<=$.i)}function Jt($){var Z;if(0<$.ua)return 0;for(Z=0;Z<$.Wb;++Z){var se=$.Ya[Z].G,de=$.Ya[Z].H;if(0<se[1][de[1]+0].g||0<se[2][de[2]+0].g||0<se[3][de[3]+0].g)return 0}return 1}function Zt($,Z,se,de,ye,xe){if($.Z!=0){var _e=$.qd,Ce=$.rd;for(t(mu[$.Z]!=null);Z<se;++Z)mu[$.Z](_e,Ce,de,ye,de,ye,xe),_e=de,Ce=ye,ye+=xe;$.qd=_e,$.rd=Ce}}function er($,Z){var se=$.l.ma,de=se.Z==0||se.Z==1?$.l.j:$.C;if(de=$.C<de?de:$.C,t(Z<=$.l.o),Z>de){var ye=$.l.width,xe=se.ca,_e=se.tb+ye*de,Ce=$.V,Te=$.Ba+$.c*de,Le=$.gc;t($.ab==1),t(Le[0].hc==3),wc(Le[0],de,Z,Ce,Te,xe,_e),Zt(se,de,Z,xe,_e,ye)}$.C=$.Ma=Z}function nt($,Z,se,de,ye,xe,_e){var Ce=$.$/de,Te=$.$%de,Le=$.m,Ge=$.s,ot=se+$.$,Oe=ot;ye=se+de*ye;var We=se+de*xe,Je=280+Ge.ua,yt=$.Pb?Ce:16777216,tt=0<Ge.ua?Ge.Wa:null,bt=Ge.wc,_t=ot<We?Ot(Ge,Te,Ce):null;t($.C<xe),t(We<=ye);var Nt=!1;e:for(;;){for(;Nt||ot<We;){var Bt=0;if(Ce>=yt){var yr=ot-se;t((yt=$).Pb),yt.wd=yt.m,yt.xd=yr,0<yt.s.ua&&Ae(yt.s.Wa,yt.s.vb),yt=Ce+ed}if(Te&bt||(_t=Ot(Ge,Te,Ce)),t(_t!=null),_t.Qb&&(Z[ot]=_t.qb,Nt=!0),!Nt)if(ee(Le),_t.jc){Bt=Le,yr=Z;var lr=ot,Zr=_t.pd[W(Bt)&Zu-1];t(_t.jc),256>Zr.g?(V(Bt,Bt.u+Zr.g),yr[lr]=Zr.value,Bt=0):(V(Bt,Bt.u+Zr.g-256),t(256<=Zr.value),Bt=Zr.value),Bt==0&&(Nt=!0)}else Bt=$e(_t.G[0],_t.H[0],Le);if(Le.h)break;if(Nt||256>Bt){if(!Nt)if(_t.nd)Z[ot]=(_t.qb|Bt<<8)>>>0;else{if(ee(Le),Nt=$e(_t.G[1],_t.H[1],Le),ee(Le),yr=$e(_t.G[2],_t.H[2],Le),lr=$e(_t.G[3],_t.H[3],Le),Le.h)break;Z[ot]=(lr<<24|Nt<<16|Bt<<8|yr)>>>0}if(Nt=!1,++ot,++Te>=de&&(Te=0,++Ce,_e!=null&&Ce<=xe&&!(Ce%16)&&_e($,Ce),tt!=null))for(;Oe<ot;)Bt=Z[Oe++],tt.X[(506832829*Bt&4294967295)>>>tt.Mb]=Bt}else if(280>Bt){if(Bt=xr(Bt-256,Le),yr=$e(_t.G[4],_t.H[4],Le),ee(Le),yr=Qe(de,yr=xr(yr,Le)),Le.h)break;if(ot-se<yr||ye-ot<Bt)break e;for(lr=0;lr<Bt;++lr)Z[ot+lr]=Z[ot+lr-yr];for(ot+=Bt,Te+=Bt;Te>=de;)Te-=de,++Ce,_e!=null&&Ce<=xe&&!(Ce%16)&&_e($,Ce);if(t(ot<=ye),Te&bt&&(_t=Ot(Ge,Te,Ce)),tt!=null)for(;Oe<ot;)Bt=Z[Oe++],tt.X[(506832829*Bt&4294967295)>>>tt.Mb]=Bt}else{if(!(Bt<Je))break e;for(Nt=Bt-280,t(tt!=null);Oe<ot;)Bt=Z[Oe++],tt.X[(506832829*Bt&4294967295)>>>tt.Mb]=Bt;Bt=ot,t(!(Nt>>>(yr=tt).Xa)),Z[Bt]=yr.X[Nt],Nt=!0}Nt||t(Le.h==te(Le))}if($.Pb&&Le.h&&ot<ye)t($.m.h),$.a=5,$.m=$.wd,$.$=$.xd,0<$.s.ua&&Ae($.s.vb,$.s.Wa);else{if(Le.h)break e;_e?.($,Ce>xe?xe:Ce),$.a=0,$.$=ot-se}return 1}return $.a=3,0}function kt($){t($!=null),$.vc=null,$.yc=null,$.Ya=null;var Z=$.Wa;Z!=null&&(Z.X=null),$.vb=null,t($!=null)}function rr(){var $=new Vr;return $==null?null:($.a=0,$.xb=ob,$t("Predictor","VP8LPredictors"),$t("Predictor","VP8LPredictors_C"),$t("PredictorAdd","VP8LPredictorsAdd"),$t("PredictorAdd","VP8LPredictorsAdd_C"),Bo=ke,wh=Ke,xh=Et,hu=pt,pu=at,xc=rt,nf=wt,P.VP8LMapColor32b=vc,P.VP8LMapColor8b=wa,$)}function mn($,Z,se,de,ye){var xe=1,_e=[$],Ce=[Z],Te=de.m,Le=de.s,Ge=null,ot=0;e:for(;;){if(se)for(;xe&&U(Te,1);){var Oe=_e,We=Ce,Je=de,yt=1,tt=Je.m,bt=Je.gc[Je.ab],_t=U(tt,2);if(Je.Oc&1<<_t)xe=0;else{switch(Je.Oc|=1<<_t,bt.hc=_t,bt.Ea=Oe[0],bt.nc=We[0],bt.K=[null],++Je.ab,t(4>=Je.ab),_t){case 0:case 1:bt.b=U(tt,3)+2,yt=mn(ge(bt.Ea,bt.b),ge(bt.nc,bt.b),0,Je,bt.K),bt.K=bt.K[0];break;case 3:var Nt,Bt=U(tt,8)+1,yr=16<Bt?0:4<Bt?1:2<Bt?2:3;if(Oe[0]=ge(bt.Ea,yr),bt.b=yr,Nt=yt=mn(Bt,1,0,Je,bt.K)){var lr,Zr=Bt,Ar=bt,Fn=1<<(8>>Ar.b),$i=o(Fn);if($i==null)Nt=0;else{var hn=Ar.K[0],cr=Ar.w;for($i[0]=Ar.K[0][0],lr=1;lr<1*Zr;++lr)$i[lr]=Ee(hn[cr+lr],$i[lr-1]);for(;lr<4*Fn;++lr)$i[lr]=0;Ar.K[0]=null,Ar.K[0]=$i,Nt=1}}yt=Nt;break;case 2:break;default:t(0)}xe=yt}}if(_e=_e[0],Ce=Ce[0],xe&&U(Te,1)&&!(xe=1<=(ot=U(Te,4))&&11>=ot)){de.a=3;break e}var Vt;if(Vt=xe)t:{var so,jr,yn,hi=de,Zo=_e,Ca=Ce,Ni=ot,Po=se,Ua=hi.m,jo=hi.s,En=[null],Wn=1,lo=0,ii=sl[Ni];r:for(;;){if(Po&&U(Ua,1)){var Jo=U(Ua,3)+2,co=ge(Zo,Jo),Yn=ge(Ca,Jo),To=co*Yn;if(!mn(co,Yn,0,hi,En))break r;for(En=En[0],jo.xc=Jo,so=0;so<To;++so){var pi=En[so]>>8&65535;En[so]=pi,pi>=Wn&&(Wn=pi+1)}}if(Ua.h)break r;for(jr=0;5>jr;++jr){var No=lf[jr];!jr&&0<Ni&&(No+=1<<Ni),lo<No&&(lo=No)}var Uo=a(Wn*ii,D),Ci=Wn,qn=a(Ci,E);if(qn==null)var Qa=null;else t(65536>=Ci),Qa=qn;var mo=o(lo);if(Qa==null||mo==null||Uo==null){hi.a=1;break r}var Ir=Uo;for(so=yn=0;so<Wn;++so){var Rr=Qa[so],Xn=Rr.G,ms=Rr.H,dl=0,is=1,Qo=0;for(jr=0;5>jr;++jr){No=lf[jr],Xn[jr]=Ir,ms[jr]=yn,!jr&&0<Ni&&(No+=1<<Ni);i:{var ad,sd=No,Og=hi,Ui=mo,sb=Ir,lb=yn,Lg=0,bu=Og.m,w3=U(bu,1);if(i(Ui,0,0,sd),w3){var cb=U(bu,1)+1,ub=U(bu,1),Pg=U(bu,ub==0?1:8);Ui[Pg]=1,cb==2&&(Ui[Pg=U(bu,8)]=1);var ca=1}else{var bo=o(19),iA=U(bu,4)+4;if(19<iA){Og.a=3;var ld=0;break i}for(ad=0;ad<iA;++ad)bo[tA[ad]]=U(bu,3);var Mh=void 0,df=void 0,kc=Og,jg=bo,Th=sd,Ng=Ui,Ug=0,yu=kc.m,db=8,fb=a(128,D);n:for(;Q(fb,0,7,jg,19);){if(U(yu,1)){var Lv=2+2*U(yu,3);if((Mh=2+U(yu,Lv))>Th)break n}else Mh=Th;for(df=0;df<Th&&Mh--;){ee(yu);var hb=fb[0+(127&W(yu))];V(yu,yu.u+hb.g);var cd=hb.value;if(16>cd)Ng[df++]=cd,cd!=0&&(db=cd);else{var Pv=cd==16,jv=cd-16,Nv=kh[jv],pb=U(yu,ol[jv])+Nv;if(df+pb>Th)break n;for(var Uv=Pv?db:0;0<pb--;)Ng[df++]=Uv}}Ug=1;break n}Ug||(kc.a=3),ca=Ug}(ca=ca&&!bu.h)&&(Lg=Q(sb,lb,8,Ui,sd)),ca&&Lg!=0?ld=Lg:(Og.a=3,ld=0)}if(ld==0)break r;if(is&&Mg[jr]==1&&(is=Ir[yn].g==0),dl+=Ir[yn].g,yn+=ld,3>=jr){var ff,Qg=mo[0];for(ff=1;ff<No;++ff)mo[ff]>Qg&&(Qg=mo[ff]);Qo+=Qg}}if(Rr.nd=is,Rr.Qb=0,is&&(Rr.qb=(Xn[3][ms[3]+0].value<<24|Xn[1][ms[1]+0].value<<16|Xn[2][ms[2]+0].value)>>>0,dl==0&&256>Xn[0][ms[0]+0].value&&(Rr.Qb=1,Rr.qb+=Xn[0][ms[0]+0].value<<8)),Rr.jc=!Rr.Qb&&6>Qo,Rr.jc){var oA,Cc=Rr;for(oA=0;oA<Zu;++oA){var vu=oA,wu=Cc.pd[vu],Hg=Cc.G[0][Cc.H[0]+vu];256<=Hg.value?(wu.g=Hg.g+256,wu.value=Hg.value):(wu.g=0,wu.value=0,vu>>=ut(Hg,8,wu),vu>>=ut(Cc.G[1][Cc.H[1]+vu],16,wu),vu>>=ut(Cc.G[2][Cc.H[2]+vu],0,wu),ut(Cc.G[3][Cc.H[3]+vu],24,wu))}}}jo.vc=En,jo.Wb=Wn,jo.Ya=Qa,jo.yc=Uo,Vt=1;break t}Vt=0}if(!(xe=Vt)){de.a=3;break e}if(0<ot){if(Le.ua=1<<ot,!re(Le.Wa,ot)){de.a=1,xe=0;break e}}else Le.ua=0;var zg=de,hf=_e,Qv=Ce,Fh=zg.s,Dh=Fh.xc;if(zg.c=hf,zg.i=Qv,Fh.md=ge(hf,Dh),Fh.wc=Dh==0?-1:(1<<Dh)-1,se){de.xb=td;break e}if((Ge=o(_e*Ce))==null){de.a=1,xe=0;break e}xe=(xe=nt(de,Ge,0,_e,Ce,Ce,null))&&!Te.h;break e}return xe?(ye!=null?ye[0]=Ge:(t(Ge==null),t(se)),de.$=0,se||kt(Le)):kt(Le),xe}function _n($,Z){var se=$.c*$.i,de=se+Z+16*Z;return t($.c<=Z),$.V=o(de),$.V==null?($.Ta=null,$.Ua=0,$.a=1,0):($.Ta=$.V,$.Ua=$.Ba+se+Z,1)}function vi($,Z){var se=$.C,de=Z-se,ye=$.V,xe=$.Ba+$.c*se;for(t(Z<=$.l.o);0<de;){var _e=16<de?16:de,Ce=$.l.ma,Te=$.l.width,Le=Te*_e,Ge=Ce.ca,ot=Ce.tb+Te*se,Oe=$.Ta,We=$.Ua;pr($,_e,ye,xe),Ns(Oe,We,Ge,ot,Le),Zt(Ce,se,se+_e,Ge,ot,Te),de-=_e,ye+=_e*$.c,se+=_e}t(se==Z),$.C=$.Ma=Z}function ri(){this.ub=this.yd=this.td=this.Rb=0}function Ri(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Re(){this.Fb=this.Bb=this.Cb=0,this.Zb=o(4),this.Lb=o(4)}function Ze(){this.Yb=(function(){var $=[];return(function Z(se,de,ye){for(var xe=ye[de],_e=0;_e<xe&&(se.push(ye.length>de+1?[]:0),!(ye.length<de+1));_e++)Z(se[_e],de+1,ye)})($,0,[3,11]),$})()}function mt(){this.jb=o(3),this.Wc=s([4,8],Ze),this.Xc=s([4,17],Ze)}function Rt(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new o(4),this.od=new o(4)}function tr(){this.ld=this.La=this.dd=this.tc=0}function jt(){this.Na=this.la=0}function Ut(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function dn(){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 Gr(){this.uc=this.M=this.Nb=0,this.wa=Array(new tr),this.Y=0,this.ya=Array(new dn),this.aa=0,this.l=new Sn}function Xr(){this.y=o(16),this.f=o(8),this.ea=o(8)}function Br(){this.cb=this.a=0,this.sc="",this.m=new O,this.Od=new ri,this.Kc=new Ri,this.ed=new Rt,this.Qa=new Re,this.Ic=this.$c=this.Aa=0,this.D=new Gr,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=a(8,O),this.ia=0,this.pb=a(4,Ut),this.Pa=new mt,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Xr),this.Hd=0,this.rb=Array(new jt),this.sb=0,this.wa=Array(new tr),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 dn),this.L=this.aa=0,this.gd=s([4,2],tr),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 an($,Z){return 0>$?0:$>Z?Z:$}function Sn(){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 bn(){var $=new Br;return $!=null&&($.a=0,$.sc="OK",$.cb=0,$.Xb=0,Us||(Us=Ro)),$}function Mr($,Z,se){return $.a==0&&($.a=Z,$.sc=se,$.cb=0),0}function Ji($,Z,se){return 3<=se&&$[Z+0]==157&&$[Z+1]==1&&$[Z+2]==42}function Oi($,Z){if($==null)return 0;if($.a=0,$.sc="OK",Z==null)return Mr($,2,"null VP8Io passed to VP8GetHeaders()");var se=Z.data,de=Z.w,ye=Z.ha;if(4>ye)return Mr($,7,"Truncated header.");var xe=se[de+0]|se[de+1]<<8|se[de+2]<<16,_e=$.Od;if(_e.Rb=!(1&xe),_e.td=xe>>1&7,_e.yd=xe>>4&1,_e.ub=xe>>5,3<_e.td)return Mr($,3,"Incorrect keyframe parameters.");if(!_e.yd)return Mr($,4,"Frame not displayable.");de+=3,ye-=3;var Ce=$.Kc;if(_e.Rb){if(7>ye)return Mr($,7,"cannot parse picture header");if(!Ji(se,de,ye))return Mr($,3,"Bad code word");Ce.c=16383&(se[de+4]<<8|se[de+3]),Ce.Td=se[de+4]>>6,Ce.i=16383&(se[de+6]<<8|se[de+5]),Ce.Ud=se[de+6]>>6,de+=7,ye-=7,$.za=Ce.c+15>>4,$.Ub=Ce.i+15>>4,Z.width=Ce.c,Z.height=Ce.i,Z.Da=0,Z.j=0,Z.v=0,Z.va=Z.width,Z.o=Z.height,Z.da=0,Z.ib=Z.width,Z.hb=Z.height,Z.U=Z.width,Z.T=Z.height,i((xe=$.Pa).jb,0,255,xe.jb.length),t((xe=$.Qa)!=null),xe.Cb=0,xe.Bb=0,xe.Fb=1,i(xe.Zb,0,0,xe.Zb.length),i(xe.Lb,0,0,xe.Lb)}if(_e.ub>ye)return Mr($,7,"bad partition length");x(xe=$.m,se,de,_e.ub),de+=_e.ub,ye-=_e.ub,_e.Rb&&(Ce.Ld=q(xe),Ce.Kd=q(xe)),Ce=$.Qa;var Te,Le=$.Pa;if(t(xe!=null),t(Ce!=null),Ce.Cb=q(xe),Ce.Cb){if(Ce.Bb=q(xe),q(xe)){for(Ce.Fb=q(xe),Te=0;4>Te;++Te)Ce.Zb[Te]=q(xe)?S(xe,7):0;for(Te=0;4>Te;++Te)Ce.Lb[Te]=q(xe)?S(xe,6):0}if(Ce.Bb)for(Te=0;3>Te;++Te)Le.jb[Te]=q(xe)?_(xe,8):255}else Ce.Bb=0;if(xe.Ka)return Mr($,3,"cannot parse segment header");if((Ce=$.ed).zd=q(xe),Ce.Tb=_(xe,6),Ce.wb=_(xe,3),Ce.Pc=q(xe),Ce.Pc&&q(xe)){for(Le=0;4>Le;++Le)q(xe)&&(Ce.vd[Le]=S(xe,6));for(Le=0;4>Le;++Le)q(xe)&&(Ce.od[Le]=S(xe,6))}if($.L=Ce.Tb==0?0:Ce.zd?1:2,xe.Ka)return Mr($,3,"cannot parse filter header");var Ge=ye;if(ye=Te=de,de=Te+Ge,Ce=Ge,$.Xb=(1<<_($.m,2))-1,Ge<3*(Le=$.Xb))se=7;else{for(Te+=3*Le,Ce-=3*Le,Ge=0;Ge<Le;++Ge){var ot=se[ye+0]|se[ye+1]<<8|se[ye+2]<<16;ot>Ce&&(ot=Ce),x($.Jc[+Ge],se,Te,ot),Te+=ot,Ce-=ot,ye+=3}x($.Jc[+Le],se,Te,Ce),se=Te<de?0:5}if(se!=0)return Mr($,se,"cannot parse partitions");for(se=_(Te=$.m,7),ye=q(Te)?S(Te,4):0,de=q(Te)?S(Te,4):0,Ce=q(Te)?S(Te,4):0,Le=q(Te)?S(Te,4):0,Te=q(Te)?S(Te,4):0,Ge=$.Qa,ot=0;4>ot;++ot){if(Ge.Cb){var Oe=Ge.Zb[ot];Ge.Fb||(Oe+=se)}else{if(0<ot){$.pb[ot]=$.pb[0];continue}Oe=se}var We=$.pb[ot];We.Sc[0]=ll[an(Oe+ye,127)],We.Sc[1]=cl[an(Oe+0,127)],We.Eb[0]=2*ll[an(Oe+de,127)],We.Eb[1]=101581*cl[an(Oe+Ce,127)]>>16,8>We.Eb[1]&&(We.Eb[1]=8),We.Qc[0]=ll[an(Oe+Le,117)],We.Qc[1]=cl[an(Oe+Te,127)],We.lc=Oe+Te}if(!_e.Rb)return Mr($,4,"Not a key frame.");for(q(xe),_e=$.Pa,se=0;4>se;++se){for(ye=0;8>ye;++ye)for(de=0;3>de;++de)for(Ce=0;11>Ce;++Ce)Le=X(xe,Vi[se][ye][de][Ce])?_(xe,8):Rv[se][ye][de][Ce],_e.Wc[se][ye].Yb[de][Ce]=Le;for(ye=0;17>ye;++ye)_e.Xc[se][ye]=_e.Wc[se][In[ye]]}return $.kc=q(xe),$.kc&&($.Bd=_(xe,8)),$.cb=1}function Ro($,Z,se,de,ye,xe,_e){var Ce=Z[ye].Yb[se];for(se=0;16>ye;++ye){if(!X($,Ce[se+0]))return ye;for(;!X($,Ce[se+1]);)if(Ce=Z[++ye].Yb[0],se=0,ye==16)return 16;var Te=Z[ye+1].Yb;if(X($,Ce[se+2])){var Le=$,Ge=0;if(X(Le,(Oe=Ce)[(ot=se)+3]))if(X(Le,Oe[ot+6])){for(Ce=0,ot=2*(Ge=X(Le,Oe[ot+8]))+(Oe=X(Le,Oe[ot+9+Ge])),Ge=0,Oe=Iv[ot];Oe[Ce];++Ce)Ge+=Ge+X(Le,Oe[Ce]);Ge+=3+(8<<ot)}else X(Le,Oe[ot+7])?(Ge=7+2*X(Le,165),Ge+=X(Le,145)):Ge=5+X(Le,159);else Ge=X(Le,Oe[ot+4])?3+X(Le,Oe[ot+5]):2;Ce=Te[2]}else Ge=1,Ce=Te[1];Te=_e+ib[ye],0>(Le=$).b&&G(Le);var ot,Oe=Le.b,We=(ot=Le.Ca>>1)-(Le.I>>Oe)>>31;--Le.b,Le.Ca+=We,Le.Ca|=1,Le.I-=(ot+1&We)<<Oe,xe[Te]=((Ge^We)-We)*de[(0<ye)+0]}return 16}function Rs($){var Z=$.rb[$.sb-1];Z.la=0,Z.Na=0,i($.zc,0,0,$.zc.length),$.ja=0}function Ao($,Z,se,de,ye){ye=$[Z+se+32*de]+(ye>>3),$[Z+se+32*de]=-256&ye?0>ye?0:255:ye}function Li($,Z,se,de,ye,xe){Ao($,Z,0,se,de+ye),Ao($,Z,1,se,de+xe),Ao($,Z,2,se,de-xe),Ao($,Z,3,se,de-ye)}function ki($){return(20091*$>>16)+$}function Mn($,Z,se,de){var ye,xe=0,_e=o(16);for(ye=0;4>ye;++ye){var Ce=$[Z+0]+$[Z+8],Te=$[Z+0]-$[Z+8],Le=(35468*$[Z+4]>>16)-ki($[Z+12]),Ge=ki($[Z+4])+(35468*$[Z+12]>>16);_e[xe+0]=Ce+Ge,_e[xe+1]=Te+Le,_e[xe+2]=Te-Le,_e[xe+3]=Ce-Ge,xe+=4,Z++}for(ye=xe=0;4>ye;++ye)Ce=($=_e[xe+0]+4)+_e[xe+8],Te=$-_e[xe+8],Le=(35468*_e[xe+4]>>16)-ki(_e[xe+12]),Ao(se,de,0,0,Ce+(Ge=ki(_e[xe+4])+(35468*_e[xe+12]>>16))),Ao(se,de,1,0,Te+Le),Ao(se,de,2,0,Te-Le),Ao(se,de,3,0,Ce-Ge),xe++,de+=32}function kn($,Z,se,de){var ye=$[Z+0]+4,xe=35468*$[Z+4]>>16,_e=ki($[Z+4]),Ce=35468*$[Z+1]>>16;Li(se,de,0,ye+_e,$=ki($[Z+1]),Ce),Li(se,de,1,ye+xe,$,Ce),Li(se,de,2,ye-xe,$,Ce),Li(se,de,3,ye-_e,$,Ce)}function hs($,Z,se,de,ye){Mn($,Z,se,de),ye&&Mn($,Z+16,se,de+4)}function oo($,Z,se,de){Au($,Z+0,se,de,1),Au($,Z+32,se,de+128,1)}function fc($,Z,se,de){var ye;for($=$[Z+0]+4,ye=0;4>ye;++ye)for(Z=0;4>Z;++Z)Ao(se,de,Z,ye,$)}function Wo($,Z,se,de){$[Z+0]&&ni($,Z+0,se,de),$[Z+16]&&ni($,Z+16,se,de+4),$[Z+32]&&ni($,Z+32,se,de+128),$[Z+48]&&ni($,Z+48,se,de+128+4)}function Co($,Z,se,de){var ye,xe=o(16);for(ye=0;4>ye;++ye){var _e=$[Z+0+ye]+$[Z+12+ye],Ce=$[Z+4+ye]+$[Z+8+ye],Te=$[Z+4+ye]-$[Z+8+ye],Le=$[Z+0+ye]-$[Z+12+ye];xe[0+ye]=_e+Ce,xe[8+ye]=_e-Ce,xe[4+ye]=Le+Te,xe[12+ye]=Le-Te}for(ye=0;4>ye;++ye)_e=($=xe[0+4*ye]+3)+xe[3+4*ye],Ce=xe[1+4*ye]+xe[2+4*ye],Te=xe[1+4*ye]-xe[2+4*ye],Le=$-xe[3+4*ye],se[de+0]=_e+Ce>>3,se[de+16]=Le+Te>>3,se[de+32]=_e-Ce>>3,se[de+48]=Le-Te>>3,de+=64}function La($,Z,se){var de,ye=Z-32,xe=ja,_e=255-$[ye-1];for(de=0;de<se;++de){var Ce,Te=xe,Le=_e+$[Z-1];for(Ce=0;Ce<se;++Ce)$[Z+Ce]=Te[Le+$[ye+Ce]];Z+=32}}function hc($,Z){La($,Z,4)}function Zc($,Z){La($,Z,8)}function Zs($,Z){La($,Z,16)}function ps($,Z){var se;for(se=0;16>se;++se)n($,Z+32*se,$,Z-32,16)}function Xd($,Z){var se;for(se=16;0<se;--se)i($,Z,$[Z-1],16),Z+=32}function Yo($,Z,se){var de;for(de=0;16>de;++de)i(Z,se+32*de,$,16)}function es($,Z){var se,de=16;for(se=0;16>se;++se)de+=$[Z-1+32*se]+$[Z+se-32];Yo(de>>5,$,Z)}function As($,Z){var se,de=8;for(se=0;16>se;++se)de+=$[Z-1+32*se];Yo(de>>4,$,Z)}function Js($,Z){var se,de=8;for(se=0;16>se;++se)de+=$[Z+se-32];Yo(de>>4,$,Z)}function Pl($,Z){Yo(128,$,Z)}function Tr($,Z,se){return $+2*Z+se+2>>2}function Jc($,Z){var se,de=Z-32;for(de=new Uint8Array([Tr($[de-1],$[de+0],$[de+1]),Tr($[de+0],$[de+1],$[de+2]),Tr($[de+1],$[de+2],$[de+3]),Tr($[de+2],$[de+3],$[de+4])]),se=0;4>se;++se)n($,Z+32*se,de,0,de.length)}function Hp($,Z){var se=$[Z-1],de=$[Z-1+32],ye=$[Z-1+64],xe=$[Z-1+96];ce($,Z+0,16843009*Tr($[Z-1-32],se,de)),ce($,Z+32,16843009*Tr(se,de,ye)),ce($,Z+64,16843009*Tr(de,ye,xe)),ce($,Z+96,16843009*Tr(ye,xe,xe))}function bg($,Z){var se,de=4;for(se=0;4>se;++se)de+=$[Z+se-32]+$[Z-1+32*se];for(de>>=3,se=0;4>se;++se)i($,Z+32*se,de,4)}function Os($,Z){var se=$[Z-1+0],de=$[Z-1+32],ye=$[Z-1+64],xe=$[Z-1-32],_e=$[Z+0-32],Ce=$[Z+1-32],Te=$[Z+2-32],Le=$[Z+3-32];$[Z+0+96]=Tr(de,ye,$[Z-1+96]),$[Z+1+96]=$[Z+0+64]=Tr(se,de,ye),$[Z+2+96]=$[Z+1+64]=$[Z+0+32]=Tr(xe,se,de),$[Z+3+96]=$[Z+2+64]=$[Z+1+32]=$[Z+0+0]=Tr(_e,xe,se),$[Z+3+64]=$[Z+2+32]=$[Z+1+0]=Tr(Ce,_e,xe),$[Z+3+32]=$[Z+2+0]=Tr(Te,Ce,_e),$[Z+3+0]=Tr(Le,Te,Ce)}function ya($,Z){var se=$[Z+1-32],de=$[Z+2-32],ye=$[Z+3-32],xe=$[Z+4-32],_e=$[Z+5-32],Ce=$[Z+6-32],Te=$[Z+7-32];$[Z+0+0]=Tr($[Z+0-32],se,de),$[Z+1+0]=$[Z+0+32]=Tr(se,de,ye),$[Z+2+0]=$[Z+1+32]=$[Z+0+64]=Tr(de,ye,xe),$[Z+3+0]=$[Z+2+32]=$[Z+1+64]=$[Z+0+96]=Tr(ye,xe,_e),$[Z+3+32]=$[Z+2+64]=$[Z+1+96]=Tr(xe,_e,Ce),$[Z+3+64]=$[Z+2+96]=Tr(_e,Ce,Te),$[Z+3+96]=Tr(Ce,Te,Te)}function zp($,Z){var se=$[Z-1+0],de=$[Z-1+32],ye=$[Z-1+64],xe=$[Z-1-32],_e=$[Z+0-32],Ce=$[Z+1-32],Te=$[Z+2-32],Le=$[Z+3-32];$[Z+0+0]=$[Z+1+64]=xe+_e+1>>1,$[Z+1+0]=$[Z+2+64]=_e+Ce+1>>1,$[Z+2+0]=$[Z+3+64]=Ce+Te+1>>1,$[Z+3+0]=Te+Le+1>>1,$[Z+0+96]=Tr(ye,de,se),$[Z+0+64]=Tr(de,se,xe),$[Z+0+32]=$[Z+1+96]=Tr(se,xe,_e),$[Z+1+32]=$[Z+2+96]=Tr(xe,_e,Ce),$[Z+2+32]=$[Z+3+96]=Tr(_e,Ce,Te),$[Z+3+32]=Tr(Ce,Te,Le)}function Zd($,Z){var se=$[Z+0-32],de=$[Z+1-32],ye=$[Z+2-32],xe=$[Z+3-32],_e=$[Z+4-32],Ce=$[Z+5-32],Te=$[Z+6-32],Le=$[Z+7-32];$[Z+0+0]=se+de+1>>1,$[Z+1+0]=$[Z+0+64]=de+ye+1>>1,$[Z+2+0]=$[Z+1+64]=ye+xe+1>>1,$[Z+3+0]=$[Z+2+64]=xe+_e+1>>1,$[Z+0+32]=Tr(se,de,ye),$[Z+1+32]=$[Z+0+96]=Tr(de,ye,xe),$[Z+2+32]=$[Z+1+96]=Tr(ye,xe,_e),$[Z+3+32]=$[Z+2+96]=Tr(xe,_e,Ce),$[Z+3+64]=Tr(_e,Ce,Te),$[Z+3+96]=Tr(Ce,Te,Le)}function Ls($,Z){var se=$[Z-1+0],de=$[Z-1+32],ye=$[Z-1+64],xe=$[Z-1+96];$[Z+0+0]=se+de+1>>1,$[Z+2+0]=$[Z+0+32]=de+ye+1>>1,$[Z+2+32]=$[Z+0+64]=ye+xe+1>>1,$[Z+1+0]=Tr(se,de,ye),$[Z+3+0]=$[Z+1+32]=Tr(de,ye,xe),$[Z+3+32]=$[Z+1+64]=Tr(ye,xe,xe),$[Z+3+64]=$[Z+2+64]=$[Z+0+96]=$[Z+1+96]=$[Z+2+96]=$[Z+3+96]=xe}function Jd($,Z){var se=$[Z-1+0],de=$[Z-1+32],ye=$[Z-1+64],xe=$[Z-1+96],_e=$[Z-1-32],Ce=$[Z+0-32],Te=$[Z+1-32],Le=$[Z+2-32];$[Z+0+0]=$[Z+2+32]=se+_e+1>>1,$[Z+0+32]=$[Z+2+64]=de+se+1>>1,$[Z+0+64]=$[Z+2+96]=ye+de+1>>1,$[Z+0+96]=xe+ye+1>>1,$[Z+3+0]=Tr(Ce,Te,Le),$[Z+2+0]=Tr(_e,Ce,Te),$[Z+1+0]=$[Z+3+32]=Tr(se,_e,Ce),$[Z+1+32]=$[Z+3+64]=Tr(de,se,_e),$[Z+1+64]=$[Z+3+96]=Tr(ye,de,se),$[Z+1+96]=Tr(xe,ye,de)}function pc($,Z){var se;for(se=0;8>se;++se)n($,Z+32*se,$,Z-32,8)}function yg($,Z){var se;for(se=0;8>se;++se)i($,Z,$[Z-1],8),Z+=32}function el($,Z,se){var de;for(de=0;8>de;++de)i(Z,se+32*de,$,8)}function hh($,Z){var se,de=8;for(se=0;8>se;++se)de+=$[Z+se-32]+$[Z-1+32*se];el(de>>4,$,Z)}function ph($,Z){var se,de=4;for(se=0;8>se;++se)de+=$[Z+se-32];el(de>>3,$,Z)}function sa($,Z){var se,de=4;for(se=0;8>se;++se)de+=$[Z-1+32*se];el(de>>3,$,Z)}function Ac($,Z){el(128,$,Z)}function tl($,Z,se){var de=$[Z-se],ye=$[Z+0],xe=3*(ye-de)+gu[1020+$[Z-2*se]-$[Z+se]],_e=Zp[112+(xe+4>>3)];$[Z-se]=ja[255+de+Zp[112+(xe+3>>3)]],$[Z+0]=ja[255+ye-_e]}function eu($,Z,se,de){var ye=$[Z+0],xe=$[Z+se];return xa[255+$[Z-2*se]-$[Z-se]]>de||xa[255+xe-ye]>de}function Ah($,Z,se,de){return 4*xa[255+$[Z-se]-$[Z+0]]+xa[255+$[Z-2*se]-$[Z+se]]<=de}function ef($,Z,se,de,ye){var xe=$[Z-3*se],_e=$[Z-2*se],Ce=$[Z-se],Te=$[Z+0],Le=$[Z+se],Ge=$[Z+2*se],ot=$[Z+3*se];return 4*xa[255+Ce-Te]+xa[255+_e-Le]>de?0:xa[255+$[Z-4*se]-xe]<=ye&&xa[255+xe-_e]<=ye&&xa[255+_e-Ce]<=ye&&xa[255+ot-Ge]<=ye&&xa[255+Ge-Le]<=ye&&xa[255+Le-Te]<=ye}function tu($,Z,se,de){var ye=2*de+1;for(de=0;16>de;++de)Ah($,Z+de,se,ye)&&tl($,Z+de,se)}function ru($,Z,se,de){var ye=2*de+1;for(de=0;16>de;++de)Ah($,Z+de*se,1,ye)&&tl($,Z+de*se,1)}function tf($,Z,se,de){var ye;for(ye=3;0<ye;--ye)tu($,Z+=4*se,se,de)}function qp($,Z,se,de){var ye;for(ye=3;0<ye;--ye)ru($,Z+=4,se,de)}function nu($,Z,se,de,ye,xe,_e,Ce){for(xe=2*xe+1;0<ye--;){if(ef($,Z,se,xe,_e))if(eu($,Z,se,Ce))tl($,Z,se);else{var Te=$,Le=Z,Ge=se,ot=Te[Le-2*Ge],Oe=Te[Le-Ge],We=Te[Le+0],Je=Te[Le+Ge],yt=Te[Le+2*Ge],tt=27*(_t=gu[1020+3*(We-Oe)+gu[1020+ot-Je]])+63>>7,bt=18*_t+63>>7,_t=9*_t+63>>7;Te[Le-3*Ge]=ja[255+Te[Le-3*Ge]+_t],Te[Le-2*Ge]=ja[255+ot+bt],Te[Le-Ge]=ja[255+Oe+tt],Te[Le+0]=ja[255+We-tt],Te[Le+Ge]=ja[255+Je-bt],Te[Le+2*Ge]=ja[255+yt-_t]}Z+=de}}function iu($,Z,se,de,ye,xe,_e,Ce){for(xe=2*xe+1;0<ye--;){if(ef($,Z,se,xe,_e))if(eu($,Z,se,Ce))tl($,Z,se);else{var Te=$,Le=Z,Ge=se,ot=Te[Le-Ge],Oe=Te[Le+0],We=Te[Le+Ge],Je=Zp[112+(4+(yt=3*(Oe-ot))>>3)],yt=Zp[112+(yt+3>>3)],tt=Je+1>>1;Te[Le-2*Ge]=ja[255+Te[Le-2*Ge]+tt],Te[Le-Ge]=ja[255+ot+yt],Te[Le+0]=ja[255+Oe-Je],Te[Le+Ge]=ja[255+We-tt]}Z+=de}}function vg($,Z,se,de,ye,xe){nu($,Z,se,1,16,de,ye,xe)}function ou($,Z,se,de,ye,xe){nu($,Z,1,se,16,de,ye,xe)}function wg($,Z,se,de,ye,xe){var _e;for(_e=3;0<_e;--_e)iu($,Z+=4*se,se,1,16,de,ye,xe)}function oe($,Z,se,de,ye,xe){var _e;for(_e=3;0<_e;--_e)iu($,Z+=4,1,se,16,de,ye,xe)}function be($,Z,se,de,ye,xe,_e,Ce){nu($,Z,ye,1,8,xe,_e,Ce),nu(se,de,ye,1,8,xe,_e,Ce)}function Pe($,Z,se,de,ye,xe,_e,Ce){nu($,Z,1,ye,8,xe,_e,Ce),nu(se,de,1,ye,8,xe,_e,Ce)}function qe($,Z,se,de,ye,xe,_e,Ce){iu($,Z+4*ye,ye,1,8,xe,_e,Ce),iu(se,de+4*ye,ye,1,8,xe,_e,Ce)}function Ye($,Z,se,de,ye,xe,_e,Ce){iu($,Z+4,1,ye,8,xe,_e,Ce),iu(se,de+4,1,ye,8,xe,_e,Ce)}function xt(){this.ba=new Gt,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new hr,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function Dt(){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 mr(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Sr(){this.ua=0,this.Wa=new ue,this.vb=new ue,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new E,this.yc=new D}function Vr(){this.xb=this.a=0,this.l=new Sn,this.ca=new Gt,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new H,this.Pb=0,this.wd=new H,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Sr,this.ab=0,this.gc=a(4,mr),this.Oc=0}function fn(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Sn,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Hn($,Z,se,de,ye,xe,_e){for($=$==null?0:$[Z+0],Z=0;Z<_e;++Z)ye[xe+Z]=$+se[de+Z]&255,$=ye[xe+Z]}function ao($,Z,se,de,ye,xe,_e){var Ce;if($==null)Hn(null,null,se,de,ye,xe,_e);else for(Ce=0;Ce<_e;++Ce)ye[xe+Ce]=$[Z+Ce]+se[de+Ce]&255}function Oo($,Z,se,de,ye,xe,_e){if($==null)Hn(null,null,se,de,ye,xe,_e);else{var Ce,Te=$[Z+0],Le=Te,Ge=Te;for(Ce=0;Ce<_e;++Ce)Le=Ge+(Te=$[Z+Ce])-Le,Ge=se[de+Ce]+(-256&Le?0>Le?0:255:Le)&255,Le=Te,ye[xe+Ce]=Ge}}function Pi($,Z,se,de){var ye=Z.width,xe=Z.o;if(t($!=null&&Z!=null),0>se||0>=de||se+de>xe)return null;if(!$.Cc){if($.ga==null){var _e;if($.ga=new fn,(_e=$.ga==null)||(_e=Z.width*Z.o,t($.Gb.length==0),$.Gb=o(_e),$.Uc=0,$.Gb==null?_e=0:($.mb=$.Gb,$.nb=$.Uc,$.rc=null,_e=1),_e=!_e),!_e){_e=$.ga;var Ce=$.Fa,Te=$.P,Le=$.qc,Ge=$.mb,ot=$.nb,Oe=Te+1,We=Le-1,Je=_e.l;if(t(Ce!=null&&Ge!=null&&Z!=null),mu[0]=null,mu[1]=Hn,mu[2]=ao,mu[3]=Oo,_e.ca=Ge,_e.tb=ot,_e.c=Z.width,_e.i=Z.height,t(0<_e.c&&0<_e.i),1>=Le)Z=0;else if(_e.$a=3&Ce[Te+0],_e.Z=Ce[Te+0]>>2&3,_e.Lc=Ce[Te+0]>>4&3,Te=Ce[Te+0]>>6&3,0>_e.$a||1<_e.$a||4<=_e.Z||1<_e.Lc||Te)Z=0;else if(Je.put=Ft,Je.ac=nn,Je.bc=on,Je.ma=_e,Je.width=Z.width,Je.height=Z.height,Je.Da=Z.Da,Je.v=Z.v,Je.va=Z.va,Je.j=Z.j,Je.o=Z.o,_e.$a)e:{t(_e.$a==1),Z=rr();t:for(;;){if(Z==null){Z=0;break e}if(t(_e!=null),_e.mc=Z,Z.c=_e.c,Z.i=_e.i,Z.l=_e.l,Z.l.ma=_e,Z.l.width=_e.c,Z.l.height=_e.i,Z.a=0,B(Z.m,Ce,Oe,We),!mn(_e.c,_e.i,1,Z,null)||(Z.ab==1&&Z.gc[0].hc==3&&Jt(Z.s)?(_e.ic=1,Ce=Z.c*Z.i,Z.Ta=null,Z.Ua=0,Z.V=o(Ce),Z.Ba=0,Z.V==null?(Z.a=1,Z=0):Z=1):(_e.ic=0,Z=_n(Z,_e.c)),!Z))break t;Z=1;break e}_e.mc=null,Z=0}else Z=We>=_e.c*_e.i;_e=!Z}if(_e)return null;$.ga.Lc!=1?$.Ga=0:de=xe-se}t($.ga!=null),t(se+de<=xe);e:{if(Z=(Ce=$.ga).c,xe=Ce.l.o,Ce.$a==0){if(Oe=$.rc,We=$.Vc,Je=$.Fa,Te=$.P+1+se*Z,Le=$.mb,Ge=$.nb+se*Z,t(Te<=$.P+$.qc),Ce.Z!=0)for(t(mu[Ce.Z]!=null),_e=0;_e<de;++_e)mu[Ce.Z](Oe,We,Je,Te,Le,Ge,Z),Oe=Le,We=Ge,Ge+=Z,Te+=Z;else for(_e=0;_e<de;++_e)n(Le,Ge,Je,Te,Z),Oe=Le,We=Ge,Ge+=Z,Te+=Z;$.rc=Oe,$.Vc=We}else{if(t(Ce.mc!=null),Z=se+de,t((_e=Ce.mc)!=null),t(Z<=_e.i),_e.C>=Z)Z=1;else if(Ce.ic||jl(),Ce.ic){Ce=_e.V,Oe=_e.Ba,We=_e.c;var yt=_e.i,tt=(Je=1,Te=_e.$/We,Le=_e.$%We,Ge=_e.m,ot=_e.s,_e.$),bt=We*yt,_t=We*Z,Nt=ot.wc,Bt=tt<_t?Ot(ot,Le,Te):null;t(tt<=bt),t(Z<=yt),t(Jt(ot));t:for(;;){for(;!Ge.h&&tt<_t;){if(Le&Nt||(Bt=Ot(ot,Le,Te)),t(Bt!=null),ee(Ge),256>(yt=$e(Bt.G[0],Bt.H[0],Ge)))Ce[Oe+tt]=yt,++tt,++Le>=We&&(Le=0,++Te<=Z&&!(Te%16)&&er(_e,Te));else{if(!(280>yt)){Je=0;break t}yt=xr(yt-256,Ge);var yr,lr=$e(Bt.G[4],Bt.H[4],Ge);if(ee(Ge),!(tt>=(lr=Qe(We,lr=xr(lr,Ge)))&&bt-tt>=yt)){Je=0;break t}for(yr=0;yr<yt;++yr)Ce[Oe+tt+yr]=Ce[Oe+tt+yr-lr];for(tt+=yt,Le+=yt;Le>=We;)Le-=We,++Te<=Z&&!(Te%16)&&er(_e,Te);tt<_t&&Le&Nt&&(Bt=Ot(ot,Le,Te))}t(Ge.h==te(Ge))}er(_e,Te>Z?Z:Te);break t}!Je||Ge.h&&tt<bt?(Je=0,_e.a=Ge.h?5:3):_e.$=tt,Z=Je}else Z=nt(_e,_e.V,_e.Ba,_e.c,_e.i,Z,vi);if(!Z){de=0;break e}}se+de>=xe&&($.Cc=1),de=1}if(!de)return null;if($.Cc&&((de=$.ga)!=null&&(de.mc=null),$.ga=null,0<$.Ga))return alert("todo:WebPDequantizeLevels"),null}return $.nb+se*ye}function Xo($,Z,se,de,ye,xe){for(;0<ye--;){var _e,Ce=$,Te=Z+(se?1:0),Le=$,Ge=Z+(se?0:3);for(_e=0;_e<de;++_e){var ot=Le[Ge+4*_e];ot!=255&&(ot*=32897,Ce[Te+4*_e+0]=Ce[Te+4*_e+0]*ot>>23,Ce[Te+4*_e+1]=Ce[Te+4*_e+1]*ot>>23,Ce[Te+4*_e+2]=Ce[Te+4*_e+2]*ot>>23)}Z+=xe}}function Lo($,Z,se,de,ye){for(;0<de--;){var xe;for(xe=0;xe<se;++xe){var _e=$[Z+2*xe+0],Ce=15&(Le=$[Z+2*xe+1]),Te=4369*Ce,Le=(240&Le|Le>>4)*Te>>16;$[Z+2*xe+0]=(240&_e|_e>>4)*Te>>16&240|(15&_e|_e<<4)*Te>>16>>4&15,$[Z+2*xe+1]=240&Le|Ce}Z+=ye}}function va($,Z,se,de,ye,xe,_e,Ce){var Te,Le,Ge=255;for(Le=0;Le<ye;++Le){for(Te=0;Te<de;++Te){var ot=$[Z+Te];xe[_e+4*Te]=ot,Ge&=ot}Z+=se,_e+=Ce}return Ge!=255}function au($,Z,se,de,ye){var xe;for(xe=0;xe<ye;++xe)se[de+xe]=$[Z+xe]>>8}function jl(){af=Xo,nl=Lo,Wp=va,Ns=au}function su($,Z,se){P[$]=function(de,ye,xe,_e,Ce,Te,Le,Ge,ot,Oe,We,Je,yt,tt,bt,_t,Nt){var Bt,yr=Nt-1>>1,lr=Ce[Te+0]|Le[Ge+0]<<16,Zr=ot[Oe+0]|We[Je+0]<<16;t(de!=null);var Ar=3*lr+Zr+131074>>2;for(Z(de[ye+0],255&Ar,Ar>>16,yt,tt),xe!=null&&(Ar=3*Zr+lr+131074>>2,Z(xe[_e+0],255&Ar,Ar>>16,bt,_t)),Bt=1;Bt<=yr;++Bt){var Fn=Ce[Te+Bt]|Le[Ge+Bt]<<16,$i=ot[Oe+Bt]|We[Je+Bt]<<16,hn=lr+Fn+Zr+$i+524296,cr=hn+2*(Fn+Zr)>>3;Ar=cr+lr>>1,lr=(hn=hn+2*(lr+$i)>>3)+Fn>>1,Z(de[ye+2*Bt-1],255&Ar,Ar>>16,yt,tt+(2*Bt-1)*se),Z(de[ye+2*Bt-0],255&lr,lr>>16,yt,tt+(2*Bt-0)*se),xe!=null&&(Ar=hn+Zr>>1,lr=cr+$i>>1,Z(xe[_e+2*Bt-1],255&Ar,Ar>>16,bt,_t+(2*Bt-1)*se),Z(xe[_e+2*Bt+0],255&lr,lr>>16,bt,_t+(2*Bt+0)*se)),lr=Fn,Zr=$i}1&Nt||(Ar=3*lr+Zr+131074>>2,Z(de[ye+Nt-1],255&Ar,Ar>>16,yt,tt+(Nt-1)*se),xe!=null&&(Ar=3*Zr+lr+131074>>2,Z(xe[_e+Nt-1],255&Ar,Ar>>16,bt,_t+(Nt-1)*se)))}}function Kp(){Sa[kg]=cf,Sa[Na]=Ch,Sa[Cg]=ab,Sa[il]=Fg,Sa[Jp]=rd,Sa[_h]=Sc,Sa[Ju]=nd,Sa[eA]=Ch,Sa[Bg]=Fg,Sa[Sh]=rd,Sa[Eg]=Sc}function gh($){return $&-16384?0>$?0:255:$>>Dg}function gc($,Z){return gh((19077*$>>8)+(26149*Z>>8)-14234)}function Nl($,Z,se){return gh((19077*$>>8)-(6419*Z>>8)-(13320*se>>8)+8708)}function rf($,Z){return gh((19077*$>>8)+(33050*Z>>8)-17685)}function lu($,Z,se,de,ye){de[ye+0]=gc($,se),de[ye+1]=Nl($,Z,se),de[ye+2]=rf($,Z)}function la($,Z,se,de,ye){de[ye+0]=rf($,Z),de[ye+1]=Nl($,Z,se),de[ye+2]=gc($,se)}function Yu($,Z,se,de,ye){var xe=Nl($,Z,se);Z=xe<<3&224|rf($,Z)>>3,de[ye+0]=248&gc($,se)|xe>>5,de[ye+1]=Z}function Xu($,Z,se,de,ye){var xe=240&rf($,Z)|15;de[ye+0]=240&gc($,se)|Nl($,Z,se)>>4,de[ye+1]=xe}function mh($,Z,se,de,ye){de[ye+0]=255,lu($,Z,se,de,ye+1)}function mc($,Z,se,de,ye){la($,Z,se,de,ye),de[ye+3]=255}function ts($,Z,se,de,ye){lu($,Z,se,de,ye),de[ye+3]=255}function cu($,Z,se){P[$]=function(de,ye,xe,_e,Ce,Te,Le,Ge,ot){for(var Oe=Ge+(-2&ot)*se;Ge!=Oe;)Z(de[ye+0],xe[_e+0],Ce[Te+0],Le,Ge),Z(de[ye+1],xe[_e+0],Ce[Te+0],Le,Ge+se),ye+=2,++_e,++Te,Ge+=2*se;1&ot&&Z(de[ye+0],xe[_e+0],Ce[Te+0],Le,Ge)}}function bh($,Z,se){return se==0?$==0?Z==0?6:5:Z==0?4:0:se}function Gp($,Z,se,de,ye){switch($>>>30){case 3:Au(Z,se,de,ye,0);break;case 2:Pa(Z,se,de,ye);break;case 1:ni(Z,se,de,ye)}}function Ps($,Z){var se,de,ye=Z.M,xe=Z.Nb,_e=$.oc,Ce=$.pc+40,Te=$.oc,Le=$.pc+584,Ge=$.oc,ot=$.pc+600;for(se=0;16>se;++se)_e[Ce+32*se-1]=129;for(se=0;8>se;++se)Te[Le+32*se-1]=129,Ge[ot+32*se-1]=129;for(0<ye?_e[Ce-1-32]=Te[Le-1-32]=Ge[ot-1-32]=129:(i(_e,Ce-32-1,127,21),i(Te,Le-32-1,127,9),i(Ge,ot-32-1,127,9)),de=0;de<$.za;++de){var Oe=Z.ya[Z.aa+de];if(0<de){for(se=-1;16>se;++se)n(_e,Ce+32*se-4,_e,Ce+32*se+12,4);for(se=-1;8>se;++se)n(Te,Le+32*se-4,Te,Le+32*se+4,4),n(Ge,ot+32*se-4,Ge,ot+32*se+4,4)}var We=$.Gd,Je=$.Hd+de,yt=Oe.ad,tt=Oe.Hc;if(0<ye&&(n(_e,Ce-32,We[Je].y,0,16),n(Te,Le-32,We[Je].f,0,8),n(Ge,ot-32,We[Je].ea,0,8)),Oe.Za){var bt=_e,_t=Ce-32+16;for(0<ye&&(de>=$.za-1?i(bt,_t,We[Je].y[15],4):n(bt,_t,We[Je+1].y,0,4)),se=0;4>se;se++)bt[_t+128+se]=bt[_t+256+se]=bt[_t+384+se]=bt[_t+0+se];for(se=0;16>se;++se,tt<<=2)bt=_e,_t=Ce+Mo[se],go[Oe.Ob[se]](bt,_t),Gp(tt,yt,16*+se,bt,_t)}else if(bt=bh(de,ye,Oe.Ob[0]),ns[bt](_e,Ce),tt!=0)for(se=0;16>se;++se,tt<<=2)Gp(tt,yt,16*+se,_e,Ce+Mo[se]);for(se=Oe.Gc,bt=bh(de,ye,Oe.Dd),zl[bt](Te,Le),zl[bt](Ge,ot),tt=yt,bt=Te,_t=Le,255&(Oe=0|se)&&(170&Oe?rl(tt,256,bt,_t):zn(tt,256,bt,_t)),Oe=Ge,tt=ot,255&(se>>=8)&&(170&se?rl(yt,320,Oe,tt):zn(yt,320,Oe,tt)),ye<$.Ub-1&&(n(We[Je].y,0,_e,Ce+480,16),n(We[Je].f,0,Te,Le+224,8),n(We[Je].ea,0,Ge,ot+224,8)),se=8*xe*$.B,We=$.sa,Je=$.ta+16*de+16*xe*$.R,yt=$.qa,Oe=$.ra+8*de+se,tt=$.Ha,bt=$.Ia+8*de+se,se=0;16>se;++se)n(We,Je+se*$.R,_e,Ce+32*se,16);for(se=0;8>se;++se)n(yt,Oe+se*$.B,Te,Le+32*se,8),n(tt,bt+se*$.B,Ge,ot+32*se,8)}}function Ul($,Z,se,de,ye,xe,_e,Ce,Te){var Le=[0],Ge=[0],ot=0,Oe=Te!=null?Te.kd:0,We=Te??new Dt;if($==null||12>se)return 7;We.data=$,We.w=Z,We.ha=se,Z=[Z],se=[se],We.gb=[We.gb];e:{var Je=Z,yt=se,tt=We.gb;if(t($!=null),t(yt!=null),t(tt!=null),tt[0]=0,12<=yt[0]&&!r($,Je[0],"RIFF")){if(r($,Je[0]+8,"WEBP")){tt=3;break e}var bt=le($,Je[0]+4);if(12>bt||4294967286<bt){tt=3;break e}if(Oe&&bt>yt[0]-8){tt=7;break e}tt[0]=bt,Je[0]+=12,yt[0]-=12}tt=0}if(tt!=0)return tt;for(bt=0<We.gb[0],se=se[0];;){e:{var _t=$;yt=Z,tt=se;var Nt=Le,Bt=Ge,yr=Je=[0];if((Ar=ot=[ot])[0]=0,8>tt[0])tt=7;else{if(!r(_t,yt[0],"VP8X")){if(le(_t,yt[0]+4)!=10){tt=3;break e}if(18>tt[0]){tt=7;break e}var lr=le(_t,yt[0]+8),Zr=1+ie(_t,yt[0]+12);if(2147483648<=Zr*(_t=1+ie(_t,yt[0]+15))){tt=3;break e}yr!=null&&(yr[0]=lr),Nt!=null&&(Nt[0]=Zr),Bt!=null&&(Bt[0]=_t),yt[0]+=18,tt[0]-=18,Ar[0]=1}tt=0}}if(ot=ot[0],Je=Je[0],tt!=0)return tt;if(yt=!!(2&Je),!bt&&ot)return 3;if(xe!=null&&(xe[0]=!!(16&Je)),_e!=null&&(_e[0]=yt),Ce!=null&&(Ce[0]=0),_e=Le[0],Je=Ge[0],ot&&yt&&Te==null){tt=0;break}if(4>se){tt=7;break}if(bt&&ot||!bt&&!ot&&!r($,Z[0],"ALPH")){se=[se],We.na=[We.na],We.P=[We.P],We.Sa=[We.Sa];e:{lr=$,tt=Z,bt=se;var Ar=We.gb;Nt=We.na,Bt=We.P,yr=We.Sa,Zr=22,t(lr!=null),t(bt!=null),_t=tt[0];var Fn=bt[0];for(t(Nt!=null),t(yr!=null),Nt[0]=null,Bt[0]=null,yr[0]=0;;){if(tt[0]=_t,bt[0]=Fn,8>Fn){tt=7;break e}var $i=le(lr,_t+4);if(4294967286<$i){tt=3;break e}var hn=8+$i+1&-2;if(Zr+=hn,0<Ar&&Zr>Ar){tt=3;break e}if(!r(lr,_t,"VP8 ")||!r(lr,_t,"VP8L")){tt=0;break e}if(Fn[0]<hn){tt=7;break e}r(lr,_t,"ALPH")||(Nt[0]=lr,Bt[0]=_t+8,yr[0]=$i),_t+=hn,Fn-=hn}}if(se=se[0],We.na=We.na[0],We.P=We.P[0],We.Sa=We.Sa[0],tt!=0)break}se=[se],We.Ja=[We.Ja],We.xa=[We.xa];e:if(Ar=$,tt=Z,bt=se,Nt=We.gb[0],Bt=We.Ja,yr=We.xa,lr=tt[0],_t=!r(Ar,lr,"VP8 "),Zr=!r(Ar,lr,"VP8L"),t(Ar!=null),t(bt!=null),t(Bt!=null),t(yr!=null),8>bt[0])tt=7;else{if(_t||Zr){if(Ar=le(Ar,lr+4),12<=Nt&&Ar>Nt-12){tt=3;break e}if(Oe&&Ar>bt[0]-8){tt=7;break e}Bt[0]=Ar,tt[0]+=8,bt[0]-=8,yr[0]=Zr}else yr[0]=5<=bt[0]&&Ar[lr+0]==47&&!(Ar[lr+4]>>5),Bt[0]=bt[0];tt=0}if(se=se[0],We.Ja=We.Ja[0],We.xa=We.xa[0],Z=Z[0],tt!=0)break;if(4294967286<We.Ja)return 3;if(Ce==null||yt||(Ce[0]=We.xa?2:1),_e=[_e],Je=[Je],We.xa){if(5>se){tt=7;break}Ce=_e,Oe=Je,yt=xe,$==null||5>se?$=0:5<=se&&$[Z+0]==47&&!($[Z+4]>>5)?(bt=[0],Ar=[0],Nt=[0],B(Bt=new H,$,Z,se),un(Bt,bt,Ar,Nt)?(Ce!=null&&(Ce[0]=bt[0]),Oe!=null&&(Oe[0]=Ar[0]),yt!=null&&(yt[0]=Nt[0]),$=1):$=0):$=0}else{if(10>se){tt=7;break}Ce=Je,$==null||10>se||!Ji($,Z+3,se-3)?$=0:(Oe=$[Z+0]|$[Z+1]<<8|$[Z+2]<<16,yt=16383&($[Z+7]<<8|$[Z+6]),$=16383&($[Z+9]<<8|$[Z+8]),1&Oe||3<(Oe>>1&7)||!(Oe>>4&1)||Oe>>5>=We.Ja||!yt||!$?$=0:(_e&&(_e[0]=yt),Ce&&(Ce[0]=$),$=1))}if(!$||(_e=_e[0],Je=Je[0],ot&&(Le[0]!=_e||Ge[0]!=Je)))return 3;Te!=null&&(Te[0]=We,Te.offset=Z-Te.w,t(4294967286>Z-Te.w),t(Te.offset==Te.ha-se));break}return tt==0||tt==7&&ot&&Te==null?(xe!=null&&(xe[0]|=We.na!=null&&0<We.na.length),de!=null&&(de[0]=_e),ye!=null&&(ye[0]=Je),0):tt}function uu($,Z,se){var de=Z.width,ye=Z.height,xe=0,_e=0,Ce=de,Te=ye;if(Z.Da=$!=null&&0<$.Da,Z.Da&&(Ce=$.cd,Te=$.bd,xe=$.v,_e=$.j,11>se||(xe&=-2,_e&=-2),0>xe||0>_e||0>=Ce||0>=Te||xe+Ce>de||_e+Te>ye))return 0;if(Z.v=xe,Z.j=_e,Z.va=xe+Ce,Z.o=_e+Te,Z.U=Ce,Z.T=Te,Z.da=$!=null&&0<$.da,Z.da){if(!me(Ce,Te,se=[$.ib],xe=[$.hb]))return 0;Z.ib=se[0],Z.hb=xe[0]}return Z.ob=$!=null&&$.ob,Z.Kb=$==null||!$.Sd,Z.da&&(Z.ob=Z.ib<3*de/4&&Z.hb<3*ye/4,Z.Kb=0),1}function Vp($){if($==null)return 2;if(11>$.S){var Z=$.f.RGBA;Z.fb+=($.height-1)*Z.A,Z.A=-Z.A}else Z=$.f.kb,$=$.height,Z.O+=($-1)*Z.fa,Z.fa=-Z.fa,Z.N+=($-1>>1)*Z.Ab,Z.Ab=-Z.Ab,Z.W+=($-1>>1)*Z.Db,Z.Db=-Z.Db,Z.F!=null&&(Z.J+=($-1)*Z.lb,Z.lb=-Z.lb);return 0}function Ql($,Z,se,de){if(de==null||0>=$||0>=Z)return 2;if(se!=null){if(se.Da){var ye=se.cd,xe=se.bd,_e=-2&se.v,Ce=-2&se.j;if(0>_e||0>Ce||0>=ye||0>=xe||_e+ye>$||Ce+xe>Z)return 2;$=ye,Z=xe}if(se.da){if(!me($,Z,ye=[se.ib],xe=[se.hb]))return 2;$=ye[0],Z=xe[0]}}de.width=$,de.height=Z;e:{var Te=de.width,Le=de.height;if($=de.S,0>=Te||0>=Le||!($>=kg&&13>$))$=2;else{if(0>=de.Rd&&de.sd==null){_e=xe=ye=Z=0;var Ge=(Ce=Te*Rg[$])*Le;if(11>$||(xe=(Le+1)/2*(Z=(Te+1)/2),$==12&&(_e=(ye=Te)*Le)),(Le=o(Ge+2*xe+_e))==null){$=1;break e}de.sd=Le,11>$?((Te=de.f.RGBA).eb=Le,Te.fb=0,Te.A=Ce,Te.size=Ge):((Te=de.f.kb).y=Le,Te.O=0,Te.fa=Ce,Te.Fd=Ge,Te.f=Le,Te.N=0+Ge,Te.Ab=Z,Te.Cd=xe,Te.ea=Le,Te.W=0+Ge+xe,Te.Db=Z,Te.Ed=xe,$==12&&(Te.F=Le,Te.J=0+Ge+2*xe),Te.Tc=_e,Te.lb=ye)}if(Z=1,ye=de.S,xe=de.width,_e=de.height,ye>=kg&&13>ye)if(11>ye)$=de.f.RGBA,Z&=(Ce=Math.abs($.A))*(_e-1)+xe<=$.size,Z&=Ce>=xe*Rg[ye],Z&=$.eb!=null;else{$=de.f.kb,Ce=(xe+1)/2,Ge=(_e+1)/2,Te=Math.abs($.fa),Le=Math.abs($.Ab);var ot=Math.abs($.Db),Oe=Math.abs($.lb),We=Oe*(_e-1)+xe;Z&=Te*(_e-1)+xe<=$.Fd,Z&=Le*(Ge-1)+Ce<=$.Cd,Z=(Z&=ot*(Ge-1)+Ce<=$.Ed)&Te>=xe&Le>=Ce&ot>=Ce,Z&=$.y!=null,Z&=$.f!=null,Z&=$.ea!=null,ye==12&&(Z&=Oe>=xe,Z&=We<=$.Tc,Z&=$.F!=null)}else Z=0;$=Z?0:2}}return $!=0||se!=null&&se.fd&&($=Vp(de)),$}var Zu=64,gs=[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],rs=24,bc=32,yc=8,du=[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];ve("Predictor0","PredictorAdd0"),P.Predictor0=function(){return 4278190080},P.Predictor1=function($){return $},P.Predictor2=function($,Z,se){return Z[se+0]},P.Predictor3=function($,Z,se){return Z[se+1]},P.Predictor4=function($,Z,se){return Z[se-1]},P.Predictor5=function($,Z,se){return Be(Be($,Z[se+1]),Z[se+0])},P.Predictor6=function($,Z,se){return Be($,Z[se-1])},P.Predictor7=function($,Z,se){return Be($,Z[se+0])},P.Predictor8=function($,Z,se){return Be(Z[se-1],Z[se+0])},P.Predictor9=function($,Z,se){return Be(Z[se+0],Z[se+1])},P.Predictor10=function($,Z,se){return Be(Be($,Z[se-1]),Be(Z[se+0],Z[se+1]))},P.Predictor11=function($,Z,se){var de=Z[se+0];return 0>=pe(de>>24&255,$>>24&255,(Z=Z[se-1])>>24&255)+pe(de>>16&255,$>>16&255,Z>>16&255)+pe(de>>8&255,$>>8&255,Z>>8&255)+pe(255&de,255&$,255&Z)?de:$},P.Predictor12=function($,Z,se){var de=Z[se+0];return(we(($>>24&255)+(de>>24&255)-((Z=Z[se-1])>>24&255))<<24|we(($>>16&255)+(de>>16&255)-(Z>>16&255))<<16|we(($>>8&255)+(de>>8&255)-(Z>>8&255))<<8|we((255&$)+(255&de)-(255&Z)))>>>0},P.Predictor13=function($,Z,se){var de=Z[se-1];return(Ne(($=Be($,Z[se+0]))>>24&255,de>>24&255)<<24|Ne($>>16&255,de>>16&255)<<16|Ne($>>8&255,de>>8&255)<<8|Ne(255&$,255&de))>>>0};var yh=P.PredictorAdd0;P.PredictorAdd1=Fe,ve("Predictor2","PredictorAdd2"),ve("Predictor3","PredictorAdd3"),ve("Predictor4","PredictorAdd4"),ve("Predictor5","PredictorAdd5"),ve("Predictor6","PredictorAdd6"),ve("Predictor7","PredictorAdd7"),ve("Predictor8","PredictorAdd8"),ve("Predictor9","PredictorAdd9"),ve("Predictor10","PredictorAdd10"),ve("Predictor11","PredictorAdd11"),ve("Predictor12","PredictorAdd12"),ve("Predictor13","PredictorAdd13");var vh=P.PredictorAdd2;et("ColorIndexInverseTransform","MapARGB","32b",function($){return $>>8&255},function($){return $}),et("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function($){return $},function($){return $>>8&255});var Bo,xg=P.ColorIndexInverseTransform,vc=P.MapARGB,wc=P.VP8LColorIndexInverseTransformAlpha,wa=P.MapAlpha,fu=P.VP8LPredictorsAdd=[];fu.length=16,(P.VP8LPredictors=[]).length=16,(P.VP8LPredictorsAdd_C=[]).length=16,(P.VP8LPredictors_C=[]).length=16;var wh,xh,hu,pu,xc,nf,js,Au,Pa,rl,ni,zn,ji,Eo,_c,Hl,of,$p,tb,Tv,Fv,Dv,rb,nb,af,nl,Wp,Ns,sf=o(511),_g=o(2041),Yp=o(225),Xp=o(767),Sg=0,gu=_g,Zp=Yp,ja=Xp,xa=sf,kg=0,Na=1,Cg=2,il=3,Jp=4,_h=5,Ju=6,eA=7,Bg=8,Sh=9,Eg=10,ol=[2,3,7],kh=[3,3,11],lf=[280,256,256,256,40],Mg=[0,1,1,1,0],tA=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],al=[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],sl=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],ed=8,ll=[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],cl=[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],Us=null,Iv=[[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]],ib=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Tg=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Rv=[[[[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]]]],_a=[[[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]]],Vi=[[[[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]]]],In=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],ns=[],go=[],zl=[],td=1,ob=2,mu=[],Sa=[];su("UpsampleRgbLinePair",lu,3),su("UpsampleBgrLinePair",la,3),su("UpsampleRgbaLinePair",ts,4),su("UpsampleBgraLinePair",mc,4),su("UpsampleArgbLinePair",mh,4),su("UpsampleRgba4444LinePair",Xu,2),su("UpsampleRgb565LinePair",Yu,2);var cf=P.UpsampleRgbLinePair,ab=P.UpsampleBgrLinePair,Ch=P.UpsampleRgbaLinePair,Fg=P.UpsampleBgraLinePair,rd=P.UpsampleArgbLinePair,Sc=P.UpsampleRgba4444LinePair,nd=P.UpsampleRgb565LinePair,ul=16,Bh=1<<ul-1,uf=-227,id=482,Dg=6,od=0,ka=o(256),Ig=o(256),Ov=o(256),b3=o(256),y3=o(id-uf),v3=o(id-uf);cu("YuvToRgbRow",lu,3),cu("YuvToBgrRow",la,3),cu("YuvToRgbaRow",ts,4),cu("YuvToBgraRow",mc,4),cu("YuvToArgbRow",mh,4),cu("YuvToRgba4444Row",Xu,2),cu("YuvToRgb565Row",Yu,2);var Mo=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Eh=[0,2,8],rA=[8,7,6,4,4,2,2,2,1,1,1,1],nA=1;this.WebPDecodeRGBA=function($,Z,se,de,ye){var xe=Na,_e=new xt,Ce=new Gt;_e.ba=Ce,Ce.S=xe,Ce.width=[Ce.width],Ce.height=[Ce.height];var Te=Ce.width,Le=Ce.height,Ge=new Tt;if(Ge==null||$==null)var ot=2;else t(Ge!=null),ot=Ul($,Z,se,Ge.width,Ge.height,Ge.Pd,Ge.Qd,Ge.format,null);if(ot!=0?Te=0:(Te!=null&&(Te[0]=Ge.width[0]),Le!=null&&(Le[0]=Ge.height[0]),Te=1),Te){Ce.width=Ce.width[0],Ce.height=Ce.height[0],de!=null&&(de[0]=Ce.width),ye!=null&&(ye[0]=Ce.height);e:{if(de=new Sn,(ye=new Dt).data=$,ye.w=Z,ye.ha=se,ye.kd=1,Z=[0],t(ye!=null),(($=Ul(ye.data,ye.w,ye.ha,null,null,null,Z,null,ye))==0||$==7)&&Z[0]&&($=4),(Z=$)==0){if(t(_e!=null),de.data=ye.data,de.w=ye.w+ye.offset,de.ha=ye.ha-ye.offset,de.put=Ft,de.ac=nn,de.bc=on,de.ma=_e,ye.xa){if(($=rr())==null){_e=1;break e}if((function(Oe,We){var Je=[0],yt=[0],tt=[0];t:for(;;){if(Oe==null)return 0;if(We==null)return Oe.a=2,0;if(Oe.l=We,Oe.a=0,B(Oe.m,We.data,We.w,We.ha),!un(Oe.m,Je,yt,tt)){Oe.a=3;break t}if(Oe.xb=ob,We.width=Je[0],We.height=yt[0],!mn(Je[0],yt[0],1,Oe,null))break t;return 1}return t(Oe.a!=0),0})($,de)){if(de=(Z=Ql(de.width,de.height,_e.Oa,_e.ba))==0){t:{de=$;r:for(;;){if(de==null){de=0;break t}if(t(de.s.yc!=null),t(de.s.Ya!=null),t(0<de.s.Wb),t((se=de.l)!=null),t((ye=se.ma)!=null),de.xb!=0){if(de.ca=ye.ba,de.tb=ye.tb,t(de.ca!=null),!uu(ye.Oa,se,il)){de.a=2;break r}if(!_n(de,se.width)||se.da)break r;if((se.da||qt(de.ca.S))&&jl(),11>de.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),de.ca.f.kb.F!=null&&jl()),de.Pb&&0<de.s.ua&&de.s.vb.X==null&&!re(de.s.vb,de.s.Wa.Xa)){de.a=1;break r}de.xb=0}if(!nt(de,de.V,de.Ba,de.c,de.i,se.o,Pt))break r;ye.Dc=de.Ma,de=1;break t}t(de.a!=0),de=0}de=!de}de&&(Z=$.a)}else Z=$.a}else{if(($=new bn)==null){_e=1;break e}if($.Fa=ye.na,$.P=ye.P,$.qc=ye.Sa,Oi($,de)){if((Z=Ql(de.width,de.height,_e.Oa,_e.ba))==0){if($.Aa=0,se=_e.Oa,t((ye=$)!=null),se!=null){if(0<(Te=0>(Te=se.Md)?0:100<Te?255:255*Te/100)){for(Le=Ge=0;4>Le;++Le)12>(ot=ye.pb[Le]).lc&&(ot.ia=Te*rA[0>ot.lc?0:ot.lc]>>3),Ge|=ot.ia;Ge&&(alert("todo:VP8InitRandom"),ye.ia=1)}ye.Ga=se.Id,100<ye.Ga?ye.Ga=100:0>ye.Ga&&(ye.Ga=0)}(function(Oe,We){if(Oe==null)return 0;if(We==null)return Mr(Oe,2,"NULL VP8Io parameter in VP8Decode().");if(!Oe.cb&&!Oi(Oe,We))return 0;if(t(Oe.cb),We.ac==null||We.ac(We)){We.ob&&(Oe.L=0);var Je=Eh[Oe.L];if(Oe.L==2?(Oe.yb=0,Oe.zb=0):(Oe.yb=We.v-Je>>4,Oe.zb=We.j-Je>>4,0>Oe.yb&&(Oe.yb=0),0>Oe.zb&&(Oe.zb=0)),Oe.Va=We.o+15+Je>>4,Oe.Hb=We.va+15+Je>>4,Oe.Hb>Oe.za&&(Oe.Hb=Oe.za),Oe.Va>Oe.Ub&&(Oe.Va=Oe.Ub),0<Oe.L){var yt=Oe.ed;for(Je=0;4>Je;++Je){var tt;if(Oe.Qa.Cb){var bt=Oe.Qa.Lb[Je];Oe.Qa.Fb||(bt+=yt.Tb)}else bt=yt.Tb;for(tt=0;1>=tt;++tt){var _t=Oe.gd[Je][tt],Nt=bt;if(yt.Pc&&(Nt+=yt.vd[0],tt&&(Nt+=yt.od[0])),0<(Nt=0>Nt?0:63<Nt?63:Nt)){var Bt=Nt;0<yt.wb&&(Bt=4<yt.wb?Bt>>2:Bt>>1)>9-yt.wb&&(Bt=9-yt.wb),1>Bt&&(Bt=1),_t.dd=Bt,_t.tc=2*Nt+Bt,_t.ld=40<=Nt?2:15<=Nt?1:0}else _t.tc=0;_t.La=tt}}}Je=0}else Mr(Oe,6,"Frame setup failed"),Je=Oe.a;if(Je=Je==0){if(Je){Oe.$c=0,0<Oe.Aa||(Oe.Ic=nA);t:{Je=Oe.Ic,yt=4*(Bt=Oe.za);var yr=32*Bt,lr=Bt+1,Zr=0<Oe.L?Bt*(0<Oe.Aa?2:1):0,Ar=(Oe.Aa==2?2:1)*Bt;if((_t=yt+832+(tt=3*(16*Je+Eh[Oe.L])/2*yr)+(bt=Oe.Fa!=null&&0<Oe.Fa.length?Oe.Kc.c*Oe.Kc.i:0))!=_t)Je=0;else{if(_t>Oe.Vb){if(Oe.Vb=0,Oe.Ec=o(_t),Oe.Fc=0,Oe.Ec==null){Je=Mr(Oe,1,"no memory during frame initialization.");break t}Oe.Vb=_t}_t=Oe.Ec,Nt=Oe.Fc,Oe.Ac=_t,Oe.Bc=Nt,Nt+=yt,Oe.Gd=a(yr,Xr),Oe.Hd=0,Oe.rb=a(lr+1,jt),Oe.sb=1,Oe.wa=Zr?a(Zr,tr):null,Oe.Y=0,Oe.D.Nb=0,Oe.D.wa=Oe.wa,Oe.D.Y=Oe.Y,0<Oe.Aa&&(Oe.D.Y+=Bt),t(!0),Oe.oc=_t,Oe.pc=Nt,Nt+=832,Oe.ya=a(Ar,dn),Oe.aa=0,Oe.D.ya=Oe.ya,Oe.D.aa=Oe.aa,Oe.Aa==2&&(Oe.D.aa+=Bt),Oe.R=16*Bt,Oe.B=8*Bt,Bt=(yr=Eh[Oe.L])*Oe.R,yr=yr/2*Oe.B,Oe.sa=_t,Oe.ta=Nt+Bt,Oe.qa=Oe.sa,Oe.ra=Oe.ta+16*Je*Oe.R+yr,Oe.Ha=Oe.qa,Oe.Ia=Oe.ra+8*Je*Oe.B+yr,Oe.$c=0,Nt+=tt,Oe.mb=bt?_t:null,Oe.nb=bt?Nt:null,t(Nt+bt<=Oe.Fc+Oe.Vb),Rs(Oe),i(Oe.Ac,Oe.Bc,0,yt),Je=1}}if(Je){if(We.ka=0,We.y=Oe.sa,We.O=Oe.ta,We.f=Oe.qa,We.N=Oe.ra,We.ea=Oe.Ha,We.Vd=Oe.Ia,We.fa=Oe.R,We.Rc=Oe.B,We.F=null,We.J=0,!Sg){for(Je=-255;255>=Je;++Je)sf[255+Je]=0>Je?-Je:Je;for(Je=-1020;1020>=Je;++Je)_g[1020+Je]=-128>Je?-128:127<Je?127:Je;for(Je=-112;112>=Je;++Je)Yp[112+Je]=-16>Je?-16:15<Je?15:Je;for(Je=-255;510>=Je;++Je)Xp[255+Je]=0>Je?0:255<Je?255:Je;Sg=1}js=Co,Au=hs,rl=oo,ni=fc,zn=Wo,Pa=kn,ji=vg,Eo=ou,_c=be,Hl=Pe,of=wg,$p=oe,tb=qe,Tv=Ye,Fv=tu,Dv=ru,rb=tf,nb=qp,go[0]=bg,go[1]=hc,go[2]=Jc,go[3]=Hp,go[4]=Os,go[5]=zp,go[6]=ya,go[7]=Zd,go[8]=Jd,go[9]=Ls,ns[0]=es,ns[1]=Zs,ns[2]=ps,ns[3]=Xd,ns[4]=As,ns[5]=Js,ns[6]=Pl,zl[0]=hh,zl[1]=Zc,zl[2]=pc,zl[3]=yg,zl[4]=sa,zl[5]=ph,zl[6]=Ac,Je=1}else Je=0}Je&&(Je=(function(Fn,$i){for(Fn.M=0;Fn.M<Fn.Va;++Fn.M){var hn,cr=Fn.Jc[Fn.M&Fn.Xb],Vt=Fn.m,so=Fn;for(hn=0;hn<so.za;++hn){var jr=Vt,yn=so,hi=yn.Ac,Zo=yn.Bc+4*hn,Ca=yn.zc,Ni=yn.ya[yn.aa+hn];if(yn.Qa.Bb?Ni.$b=X(jr,yn.Pa.jb[0])?2+X(jr,yn.Pa.jb[2]):X(jr,yn.Pa.jb[1]):Ni.$b=0,yn.kc&&(Ni.Ad=X(jr,yn.Bd)),Ni.Za=!X(jr,145)+0,Ni.Za){var Po=Ni.Ob,Ua=0;for(yn=0;4>yn;++yn){var jo,En=Ca[0+yn];for(jo=0;4>jo;++jo){En=_a[hi[Zo+jo]][En];for(var Wn=Tg[X(jr,En[0])];0<Wn;)Wn=Tg[2*Wn+X(jr,En[Wn])];En=-Wn,hi[Zo+jo]=En}n(Po,Ua,hi,Zo,4),Ua+=4,Ca[0+yn]=En}}else En=X(jr,156)?X(jr,128)?1:3:X(jr,163)?2:0,Ni.Ob[0]=En,i(hi,Zo,En,4),i(Ca,0,En,4);Ni.Dd=X(jr,142)?X(jr,114)?X(jr,183)?1:3:2:0}if(so.m.Ka)return Mr(Fn,7,"Premature end-of-partition0 encountered.");for(;Fn.ja<Fn.za;++Fn.ja){if(so=cr,jr=(Vt=Fn).rb[Vt.sb-1],hi=Vt.rb[Vt.sb+Vt.ja],hn=Vt.ya[Vt.aa+Vt.ja],Zo=Vt.kc?hn.Ad:0)jr.la=hi.la=0,hn.Za||(jr.Na=hi.Na=0),hn.Hc=0,hn.Gc=0,hn.ia=0;else{var lo,ii;if(jr=hi,hi=so,Zo=Vt.Pa.Xc,Ca=Vt.ya[Vt.aa+Vt.ja],Ni=Vt.pb[Ca.$b],yn=Ca.ad,Po=0,Ua=Vt.rb[Vt.sb-1],En=jo=0,i(yn,Po,0,384),Ca.Za)var Jo=0,co=Zo[3];else{Wn=o(16);var Yn=jr.Na+Ua.Na;if(Yn=Us(hi,Zo[1],Yn,Ni.Eb,0,Wn,0),jr.Na=Ua.Na=(0<Yn)+0,1<Yn)js(Wn,0,yn,Po);else{var To=Wn[0]+3>>3;for(Wn=0;256>Wn;Wn+=16)yn[Po+Wn]=To}Jo=1,co=Zo[0]}var pi=15&jr.la,No=15&Ua.la;for(Wn=0;4>Wn;++Wn){var Uo=1&No;for(To=ii=0;4>To;++To)pi=pi>>1|(Uo=(Yn=Us(hi,co,Yn=Uo+(1&pi),Ni.Sc,Jo,yn,Po))>Jo)<<7,ii=ii<<2|(3<Yn?3:1<Yn?2:yn[Po+0]!=0),Po+=16;pi>>=4,No=No>>1|Uo<<7,jo=(jo<<8|ii)>>>0}for(co=pi,Jo=No>>4,lo=0;4>lo;lo+=2){for(ii=0,pi=jr.la>>4+lo,No=Ua.la>>4+lo,Wn=0;2>Wn;++Wn){for(Uo=1&No,To=0;2>To;++To)Yn=Uo+(1&pi),pi=pi>>1|(Uo=0<(Yn=Us(hi,Zo[2],Yn,Ni.Qc,0,yn,Po)))<<3,ii=ii<<2|(3<Yn?3:1<Yn?2:yn[Po+0]!=0),Po+=16;pi>>=2,No=No>>1|Uo<<5}En|=ii<<4*lo,co|=pi<<4<<lo,Jo|=(240&No)<<lo}jr.la=co,Ua.la=Jo,Ca.Hc=jo,Ca.Gc=En,Ca.ia=43690&En?0:Ni.ia,Zo=!(jo|En)}if(0<Vt.L&&(Vt.wa[Vt.Y+Vt.ja]=Vt.gd[hn.$b][hn.Za],Vt.wa[Vt.Y+Vt.ja].La|=!Zo),so.Ka)return Mr(Fn,7,"Premature end-of-file encountered.")}if(Rs(Fn),Vt=$i,so=1,hn=(cr=Fn).D,jr=0<cr.L&&cr.M>=cr.zb&&cr.M<=cr.Va,cr.Aa==0)t:{if(hn.M=cr.M,hn.uc=jr,Ps(cr,hn),so=1,hn=(ii=cr.D).Nb,jr=(En=Eh[cr.L])*cr.R,hi=En/2*cr.B,Wn=16*hn*cr.R,To=8*hn*cr.B,Zo=cr.sa,Ca=cr.ta-jr+Wn,Ni=cr.qa,yn=cr.ra-hi+To,Po=cr.Ha,Ua=cr.Ia-hi+To,No=(pi=ii.M)==0,jo=pi>=cr.Va-1,cr.Aa==2&&Ps(cr,ii),ii.uc)for(Uo=(Yn=cr).D.M,t(Yn.D.uc),ii=Yn.yb;ii<Yn.Hb;++ii){Jo=ii,co=Uo;var Ci=(qn=(Qo=Yn).D).Nb;lo=Qo.R;var qn=qn.wa[qn.Y+Jo],Qa=Qo.sa,mo=Qo.ta+16*Ci*lo+16*Jo,Ir=qn.dd,Rr=qn.tc;if(Rr!=0)if(t(3<=Rr),Qo.L==1)0<Jo&&Dv(Qa,mo,lo,Rr+4),qn.La&&nb(Qa,mo,lo,Rr),0<co&&Fv(Qa,mo,lo,Rr+4),qn.La&&rb(Qa,mo,lo,Rr);else{var Xn=Qo.B,ms=Qo.qa,dl=Qo.ra+8*Ci*Xn+8*Jo,is=Qo.Ha,Qo=Qo.Ia+8*Ci*Xn+8*Jo;Ci=qn.ld,0<Jo&&(Eo(Qa,mo,lo,Rr+4,Ir,Ci),Hl(ms,dl,is,Qo,Xn,Rr+4,Ir,Ci)),qn.La&&($p(Qa,mo,lo,Rr,Ir,Ci),Tv(ms,dl,is,Qo,Xn,Rr,Ir,Ci)),0<co&&(ji(Qa,mo,lo,Rr+4,Ir,Ci),_c(ms,dl,is,Qo,Xn,Rr+4,Ir,Ci)),qn.La&&(of(Qa,mo,lo,Rr,Ir,Ci),tb(ms,dl,is,Qo,Xn,Rr,Ir,Ci))}}if(cr.ia&&alert("todo:DitherRow"),Vt.put!=null){if(ii=16*pi,pi=16*(pi+1),No?(Vt.y=cr.sa,Vt.O=cr.ta+Wn,Vt.f=cr.qa,Vt.N=cr.ra+To,Vt.ea=cr.Ha,Vt.W=cr.Ia+To):(ii-=En,Vt.y=Zo,Vt.O=Ca,Vt.f=Ni,Vt.N=yn,Vt.ea=Po,Vt.W=Ua),jo||(pi-=En),pi>Vt.o&&(pi=Vt.o),Vt.F=null,Vt.J=null,cr.Fa!=null&&0<cr.Fa.length&&ii<pi&&(Vt.J=Pi(cr,Vt,ii,pi-ii),Vt.F=cr.mb,Vt.F==null&&Vt.F.length==0)){so=Mr(cr,3,"Could not decode alpha data.");break t}ii<Vt.j&&(En=Vt.j-ii,ii=Vt.j,t(!(1&En)),Vt.O+=cr.R*En,Vt.N+=cr.B*(En>>1),Vt.W+=cr.B*(En>>1),Vt.F!=null&&(Vt.J+=Vt.width*En)),ii<pi&&(Vt.O+=Vt.v,Vt.N+=Vt.v>>1,Vt.W+=Vt.v>>1,Vt.F!=null&&(Vt.J+=Vt.v),Vt.ka=ii-Vt.j,Vt.U=Vt.va-Vt.v,Vt.T=pi-ii,so=Vt.put(Vt))}hn+1!=cr.Ic||jo||(n(cr.sa,cr.ta-jr,Zo,Ca+16*cr.R,jr),n(cr.qa,cr.ra-hi,Ni,yn+8*cr.B,hi),n(cr.Ha,cr.Ia-hi,Po,Ua+8*cr.B,hi))}if(!so)return Mr(Fn,6,"Output aborted.")}return 1})(Oe,We)),We.bc!=null&&We.bc(We),Je&=1}return Je?(Oe.cb=0,Je):0})($,de)||(Z=$.a)}}else Z=$.a}Z==0&&_e.Oa!=null&&_e.Oa.fd&&(Z=Vp(_e.ba))}_e=Z}xe=_e!=0?null:11>xe?Ce.f.RGBA.eb:Ce.f.kb.y}else xe=null;return xe};var Rg=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function l(P,N){for(var z="",Q=0;Q<4;Q++)z+=String.fromCharCode(P[N++]);return z}function u(P,N){return P[N+0]|P[N+1]<<8}function d(P,N){return(P[N+0]|P[N+1]<<8|P[N+2]<<16)>>>0}function h(P,N){return(P[N+0]|P[N+1]<<8|P[N+2]<<16|P[N+3]<<24)>>>0}new c;var f=[0],p=[0],m=[],g=new c,b=e,v=(function(P,N){var z={},Q=0,D=!1,I=0,E=0;if(z.frames=[],!(function(O,H){for(var W=0;W<4;W++)if(O[H+W]!="RIFF".charCodeAt(W))return!0;return!1})(P,N)){for(h(P,N+=4),N+=8;N<P.length;){var x=l(P,N),_=h(P,N+=4);N+=4;var S=_+(1&_);switch(x){case"VP8 ":case"VP8L":z.frames[Q]===void 0&&(z.frames[Q]={}),(U=z.frames[Q]).src_off=D?E:N-8,U.src_size=I+_+8,Q++,D&&(D=!1,I=0,E=0);break;case"VP8X":(U=z.header={}).feature_flags=P[N];var B=N+4;U.canvas_width=1+d(P,B),B+=3,U.canvas_height=1+d(P,B),B+=3;break;case"ALPH":D=!0,I=S+8,E=N-8;break;case"ANIM":(U=z.header).bgcolor=h(P,N),B=N+4,U.loop_count=u(P,B),B+=2;break;case"ANMF":var T,U;(U=z.frames[Q]={}).offset_x=2*d(P,N),N+=3,U.offset_y=2*d(P,N),N+=3,U.width=1+d(P,N),N+=3,U.height=1+d(P,N),N+=3,U.duration=d(P,N),N+=3,T=P[N++],U.dispose=1&T,U.blend=T>>1&1}x!="ANMF"&&(N+=S)}return z}})(b,0);v.response=b,v.rgbaoutput=!0,v.dataurl=!1;var w=v.header?v.header:null,C=v.frames?v.frames:null;if(w){w.loop_counter=w.loop_count,f=[w.canvas_height],p=[w.canvas_width];for(var F=0;F<C.length&&C[F].blend!=0;F++);}var M=C[0],j=g.WebPDecodeRGBA(b,M.src_off,M.src_size,p,f);M.rgba=j,M.imgwidth=p[0],M.imgheight=f[0];for(var L=0;L<p[0]*f[0]*4;L++)m[L]=j[L];return this.width=p,this.height=f,this.data=m,this}(function(e){var t,r,n,i,o,a,s,c,l,u=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 c,this.globalCompositeOperation=O.globalCompositeOperation||"normal",this.globalAlpha=O.globalAlpha||1,this.clip_path=O.clip_path||[],this.currentPoint=O.currentPoint||new a,this.miterLimit=O.miterLimit||10,this.lastPoint=O.lastPoint||new a,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 d(this),t=this.internal.f2,r=this.internal.getCoordinateString,n=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,o=this.internal.getVerticalCoordinate,a=this.internal.Point,s=this.internal.Rectangle,c=this.internal.Matrix,l=new u}]);var d=function(O){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var H=O;Object.defineProperty(this,"pdf",{get:function(){return H}});var W=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return W},set:function(re){W=!!re}});var te=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return te},set:function(re){te=!!re}});var V=0;Object.defineProperty(this,"posX",{get:function(){return V},set:function(re){isNaN(re)||(V=re)}});var ee=0;Object.defineProperty(this,"posY",{get:function(){return ee},set:function(re){isNaN(re)||(ee=re)}}),Object.defineProperty(this,"margin",{get:function(){return l.margin},set:function(re){var Ae;typeof re=="number"?Ae=[re,re,re,re]:((Ae=new Array(4))[0]=re[0],Ae[1]=re.length>=2?re[1]:Ae[0],Ae[2]=re.length>=3?re[2]:Ae[0],Ae[3]=re.length>=4?re[3]:Ae[1]),l.margin=Ae}});var G=!1;Object.defineProperty(this,"autoPaging",{get:function(){return G},set:function(re){G=re}});var q=0;Object.defineProperty(this,"lastBreak",{get:function(){return q},set:function(re){q=re}});var X=[];Object.defineProperty(this,"pageBreaks",{get:function(){return X},set:function(re){X=re}}),Object.defineProperty(this,"ctx",{get:function(){return l},set:function(re){re instanceof u&&(l=re)}}),Object.defineProperty(this,"path",{get:function(){return l.path},set:function(re){l.path=re}});var ce=[];Object.defineProperty(this,"ctxStack",{get:function(){return ce},set:function(re){ce=re}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(re){var Ae;Ae=h(re),this.ctx.fillStyle=Ae.style,this.ctx.isFillTransparent=Ae.a===0,this.ctx.fillOpacity=Ae.a,this.pdf.setFillColor(Ae.r,Ae.g,Ae.b,{a:Ae.a}),this.pdf.setTextColor(Ae.r,Ae.g,Ae.b,{a:Ae.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(re){var Ae=h(re);this.ctx.strokeStyle=Ae.style,this.ctx.isStrokeTransparent=Ae.a===0,this.ctx.strokeOpacity=Ae.a,Ae.a===0?this.pdf.setDrawColor(255,255,255):(Ae.a,this.pdf.setDrawColor(Ae.r,Ae.g,Ae.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(re){["butt","round","square"].indexOf(re)!==-1&&(this.ctx.lineCap=re,this.pdf.setLineCap(re))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(re){isNaN(re)||(this.ctx.lineWidth=re,this.pdf.setLineWidth(re))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(re){["bevel","round","miter"].indexOf(re)!==-1&&(this.ctx.lineJoin=re,this.pdf.setLineJoin(re))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(re){isNaN(re)||(this.ctx.miterLimit=re,this.pdf.setMiterLimit(re))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(re){this.ctx.textBaseline=re}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(re){["right","end","center","left","start"].indexOf(re)!==-1&&(this.ctx.textAlign=re)}});var fe=null,ie=null,le=null;Object.defineProperty(this,"fontFaces",{get:function(){return le},set:function(re){fe=null,ie=null,le=re}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(re){var Ae;if(this.ctx.font=re,(Ae=/^\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-z0-9]+?)\s*$/i.exec(re))!==null){var ue=Ae[1];Ae[2];var me=Ae[3],ge=Ae[4];Ae[5];var Ee=Ae[6],ve=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(ge)[2];ge=Math.floor(ve==="px"?parseFloat(ge)*this.pdf.internal.scaleFactor:ve==="em"?parseFloat(ge)*this.pdf.getFontSize():parseFloat(ge)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(ge);var Me=(function(et){var Et,pt,at=[],rt=et.trim();if(rt==="")return wU;if(rt in hU)return[hU[rt]];for(;rt!=="";){switch(pt=null,Et=(rt=AU(rt)).charAt(0)){case'"':case"'":pt=TIe(rt.substring(1),Et);break;default:pt=FIe(rt)}if(pt===null||(at.push(pt[0]),(rt=AU(pt[1]))!==""&&rt.charAt(0)!==","))return wU;rt=rt.replace(/^,/,"")}return at})(Ee);if(this.fontFaces){var Be=(function(et,Et){var pt=et.getFontList(),at=JSON.stringify(pt);if(fe===null||ie!==at){var rt=(function(wt){var ht=[];return Object.keys(wt).forEach(function($t){wt[$t].forEach(function(qt){var It=null;switch(qt){case"bold":It={family:$t,weight:"bold"};break;case"italic":It={family:$t,style:"italic"};break;case"bolditalic":It={family:$t,weight:"bold",style:"italic"};break;case"":case"normal":It={family:$t}}It!==null&&(It.ref={name:$t,style:qt},ht.push(It))})}),ht})(pt);fe=(function(wt){for(var ht={},$t=0;$t<wt.length;++$t){var qt=T6(wt[$t]),It=qt.family,gr=qt.stretch,Gt=qt.style,Tt=qt.weight;ht[It]=ht[It]||{},ht[It][gr]=ht[It][gr]||{},ht[It][gr][Gt]=ht[It][gr][Gt]||{},ht[It][gr][Gt][Tt]=qt}return ht})(rt.concat(Et)),ie=at}return fe})(this.pdf,this.fontFaces),we=Me.map(function(et){return{family:et,stretch:"normal",weight:me,style:ue}}),Ne=(function(et,Et,pt){for(var at=(pt=pt||{}).defaultFontFamily||"times",rt=Object.assign({},MIe,pt.genericFontFamilies||{}),wt=null,ht=null,$t=0;$t<Et.length;++$t)if(rt[(wt=T6(Et[$t])).family]&&(wt.family=rt[wt.family]),et.hasOwnProperty(wt.family)){ht=et[wt.family];break}if(!(ht=ht||et[at]))throw new Error("Could not find a font-family for the rule '"+pU(wt)+"' and default family '"+at+"'.");if(ht=(function(qt,It){if(It[qt])return It[qt];var gr=AB[qt],Gt=gr<=AB.normal?-1:1,Tt=fU(It,MY,gr,Gt);if(!Tt)throw new Error("Could not find a matching font-stretch value for "+qt);return Tt})(wt.stretch,ht),ht=(function(qt,It){if(It[qt])return It[qt];for(var gr=EY[qt],Gt=0;Gt<gr.length;++Gt)if(It[gr[Gt]])return It[gr[Gt]];throw new Error("Could not find a matching font-style for "+qt)})(wt.style,ht),!(ht=(function(qt,It){if(It[qt])return It[qt];if(qt===400&&It[500])return It[500];if(qt===500&&It[400])return It[400];var gr=EIe[qt],Gt=fU(It,TY,gr,qt<400?-1:1);if(!Gt)throw new Error("Could not find a matching font-weight for value "+qt);return Gt})(wt.weight,ht)))throw new Error("Failed to resolve a font for the rule '"+pU(wt)+"'.");return ht})(Be,we);this.pdf.setFont(Ne.ref.name,Ne.ref.style)}else{var pe="";(me==="bold"||parseInt(me,10)>=700||ue==="bold")&&(pe="bold"),ue==="italic"&&(pe+="italic"),pe.length===0&&(pe="normal");for(var Fe="",ke={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"},Ie=0;Ie<Me.length;Ie++){if(this.pdf.internal.getFont(Me[Ie],pe,{noFallback:!0,disableWarning:!0})!==void 0){Fe=Me[Ie];break}if(pe==="bolditalic"&&this.pdf.internal.getFont(Me[Ie],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Fe=Me[Ie],pe="bold";else if(this.pdf.internal.getFont(Me[Ie],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Fe=Me[Ie],pe="normal";break}}if(Fe===""){for(var Ke=0;Ke<Me.length;Ke++)if(ke[Me[Ke]]){Fe=ke[Me[Ke]];break}}Fe=Fe===""?"Times":Fe,this.pdf.setFont(Fe,pe)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(re){this.ctx.globalCompositeOperation=re}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(re){this.ctx.globalAlpha=re}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(re){this.ctx.lineDashOffset=re,U.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(re){this.ctx.lineDash=re,U.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(re){this.ctx.ignoreClearRect=!!re}})};d.prototype.setLineDash=function(O){this.lineDash=O},d.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},d.prototype.fill=function(){C.call(this,"fill",!1)},d.prototype.stroke=function(){C.call(this,"stroke",!1)},d.prototype.beginPath=function(){this.path=[{type:"begin"}]},d.prototype.moveTo=function(O,H){if(isNaN(O)||isNaN(H))throw Xi.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var W=this.ctx.transform.applyToPoint(new a(O,H));this.path.push({type:"mt",x:W.x,y:W.y}),this.ctx.lastPoint=new a(O,H)},d.prototype.closePath=function(){var O=new a(0,0),H=0;for(H=this.path.length-1;H!==-1;H--)if(this.path[H].type==="begin"&&di(this.path[H+1])==="object"&&typeof this.path[H+1].x=="number"){O=new a(this.path[H+1].x,this.path[H+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new a(O.x,O.y)},d.prototype.lineTo=function(O,H){if(isNaN(O)||isNaN(H))throw Xi.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var W=this.ctx.transform.applyToPoint(new a(O,H));this.path.push({type:"lt",x:W.x,y:W.y}),this.ctx.lastPoint=new a(W.x,W.y)},d.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),C.call(this,null,!0)},d.prototype.quadraticCurveTo=function(O,H,W,te){if(isNaN(W)||isNaN(te)||isNaN(O)||isNaN(H))throw Xi.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var V=this.ctx.transform.applyToPoint(new a(W,te)),ee=this.ctx.transform.applyToPoint(new a(O,H));this.path.push({type:"qct",x1:ee.x,y1:ee.y,x:V.x,y:V.y}),this.ctx.lastPoint=new a(V.x,V.y)},d.prototype.bezierCurveTo=function(O,H,W,te,V,ee){if(isNaN(V)||isNaN(ee)||isNaN(O)||isNaN(H)||isNaN(W)||isNaN(te))throw Xi.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var G=this.ctx.transform.applyToPoint(new a(V,ee)),q=this.ctx.transform.applyToPoint(new a(O,H)),X=this.ctx.transform.applyToPoint(new a(W,te));this.path.push({type:"bct",x1:q.x,y1:q.y,x2:X.x,y2:X.y,x:G.x,y:G.y}),this.ctx.lastPoint=new a(G.x,G.y)},d.prototype.arc=function(O,H,W,te,V,ee){if(isNaN(O)||isNaN(H)||isNaN(W)||isNaN(te)||isNaN(V))throw Xi.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(ee=!!ee,!this.ctx.transform.isIdentity){var G=this.ctx.transform.applyToPoint(new a(O,H));O=G.x,H=G.y;var q=this.ctx.transform.applyToPoint(new a(0,W)),X=this.ctx.transform.applyToPoint(new a(0,0));W=Math.sqrt(Math.pow(q.x-X.x,2)+Math.pow(q.y-X.y,2))}Math.abs(V-te)>=2*Math.PI&&(te=0,V=2*Math.PI),this.path.push({type:"arc",x:O,y:H,radius:W,startAngle:te,endAngle:V,counterclockwise:ee})},d.prototype.arcTo=function(O,H,W,te,V){throw new Error("arcTo not implemented.")},d.prototype.rect=function(O,H,W,te){if(isNaN(O)||isNaN(H)||isNaN(W)||isNaN(te))throw Xi.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(O,H),this.lineTo(O+W,H),this.lineTo(O+W,H+te),this.lineTo(O,H+te),this.lineTo(O,H),this.lineTo(O+W,H),this.lineTo(O,H)},d.prototype.fillRect=function(O,H,W,te){if(isNaN(O)||isNaN(H)||isNaN(W)||isNaN(te))throw Xi.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!f.call(this)){var V={};this.lineCap!=="butt"&&(V.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(V.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(O,H,W,te),this.fill(),V.hasOwnProperty("lineCap")&&(this.lineCap=V.lineCap),V.hasOwnProperty("lineJoin")&&(this.lineJoin=V.lineJoin)}},d.prototype.strokeRect=function(O,H,W,te){if(isNaN(O)||isNaN(H)||isNaN(W)||isNaN(te))throw Xi.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");p.call(this)||(this.beginPath(),this.rect(O,H,W,te),this.stroke())},d.prototype.clearRect=function(O,H,W,te){if(isNaN(O)||isNaN(H)||isNaN(W)||isNaN(te))throw Xi.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(O,H,W,te))},d.prototype.save=function(O){O=typeof O!="boolean"||O;for(var H=this.pdf.internal.getCurrentPageInfo().pageNumber,W=0;W<this.pdf.internal.getNumberOfPages();W++)this.pdf.setPage(W+1),this.pdf.internal.out("q");if(this.pdf.setPage(H),O){this.ctx.fontSize=this.pdf.internal.getFontSize();var te=new u(this.ctx);this.ctxStack.push(this.ctx),this.ctx=te}},d.prototype.restore=function(O){O=typeof O!="boolean"||O;for(var H=this.pdf.internal.getCurrentPageInfo().pageNumber,W=0;W<this.pdf.internal.getNumberOfPages();W++)this.pdf.setPage(W+1),this.pdf.internal.out("Q");this.pdf.setPage(H),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)},d.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var h=function(O){var H,W,te,V;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))H=0,W=0,te=0,V=0;else{var ee=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(O);if(ee!==null)H=parseInt(ee[1]),W=parseInt(ee[2]),te=parseInt(ee[3]),V=1;else if((ee=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(O))!==null)H=parseInt(ee[1]),W=parseInt(ee[2]),te=parseInt(ee[3]),V=parseFloat(ee[4]);else{if(V=1,typeof O=="string"&&O.charAt(0)!=="#"){var G=new wY(O);O=G.ok?G.toHex():"#000000"}O.length===4?(H=O.substring(1,2),H+=H,W=O.substring(2,3),W+=W,te=O.substring(3,4),te+=te):(H=O.substring(1,3),W=O.substring(3,5),te=O.substring(5,7)),H=parseInt(H,16),W=parseInt(W,16),te=parseInt(te,16)}}return{r:H,g:W,b:te,a:V,style:O}},f=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},p=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};d.prototype.fillText=function(O,H,W,te){if(isNaN(H)||isNaN(W)||typeof O!="string")throw Xi.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(te=isNaN(te)?void 0:te,!f.call(this)){var V=S(this.ctx.transform.rotation),ee=this.ctx.transform.scaleX;Q.call(this,{text:O,x:H,y:W,scale:ee,angle:V,align:this.textAlign,maxWidth:te})}},d.prototype.strokeText=function(O,H,W,te){if(isNaN(H)||isNaN(W)||typeof O!="string")throw Xi.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!p.call(this)){te=isNaN(te)?void 0:te;var V=S(this.ctx.transform.rotation),ee=this.ctx.transform.scaleX;Q.call(this,{text:O,x:H,y:W,scale:ee,renderingMode:"stroke",angle:V,align:this.textAlign,maxWidth:te})}},d.prototype.measureText=function(O){if(typeof O!="string")throw Xi.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var H=this.pdf,W=this.pdf.internal.scaleFactor,te=H.internal.getFontSize(),V=H.getStringUnitWidth(O)*te/H.internal.scaleFactor;return new function(ee){var G=(ee=ee||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return G}}),this}({width:V*=Math.round(96*W/72*1e4)/1e4})},d.prototype.scale=function(O,H){if(isNaN(O)||isNaN(H))throw Xi.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var W=new c(O,0,0,H,0,0);this.ctx.transform=this.ctx.transform.multiply(W)},d.prototype.rotate=function(O){if(isNaN(O))throw Xi.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var H=new c(Math.cos(O),Math.sin(O),-Math.sin(O),Math.cos(O),0,0);this.ctx.transform=this.ctx.transform.multiply(H)},d.prototype.translate=function(O,H){if(isNaN(O)||isNaN(H))throw Xi.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var W=new c(1,0,0,1,O,H);this.ctx.transform=this.ctx.transform.multiply(W)},d.prototype.transform=function(O,H,W,te,V,ee){if(isNaN(O)||isNaN(H)||isNaN(W)||isNaN(te)||isNaN(V)||isNaN(ee))throw Xi.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var G=new c(O,H,W,te,V,ee);this.ctx.transform=this.ctx.transform.multiply(G)},d.prototype.setTransform=function(O,H,W,te,V,ee){O=isNaN(O)?1:O,H=isNaN(H)?0:H,W=isNaN(W)?0:W,te=isNaN(te)?1:te,V=isNaN(V)?0:V,ee=isNaN(ee)?0:ee,this.ctx.transform=new c(O,H,W,te,V,ee)};var m=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};d.prototype.drawImage=function(O,H,W,te,V,ee,G,q,X){var ce=this.pdf.getImageProperties(O),fe=1,ie=1,le=1,re=1;te!==void 0&&q!==void 0&&(le=q/te,re=X/V,fe=ce.width/te*q/te,ie=ce.height/V*X/V),ee===void 0&&(ee=H,G=W,H=0,W=0),te!==void 0&&q===void 0&&(q=te,X=V),te===void 0&&q===void 0&&(q=ce.width,X=ce.height);var Ae=this.ctx.transform.decompose(),ue=S(Ae.rotate.shx),me=new c,ge=(me=(me=(me=me.multiply(Ae.translate)).multiply(Ae.skew)).multiply(Ae.scale)).applyToRectangle(new s(ee-H*le,G-W*re,te*fe,V*ie));if(this.autoPaging){for(var Ee,ve=g.call(this,ge),Me=[],Be=0;Be<ve.length;Be+=1)Me.indexOf(ve[Be])===-1&&Me.push(ve[Be]);w(Me);for(var we=Me[0],Ne=Me[Me.length-1],pe=we;pe<Ne+1;pe++){this.pdf.setPage(pe);var Fe=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],ke=pe===1?this.posY+this.margin[0]:this.margin[0],Ie=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ke=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],et=pe===1?0:Ie+(pe-2)*Ke;if(this.ctx.clip_path.length!==0){var Et=this.path;Ee=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(Ee,this.posX+this.margin[3],-et+ke+this.ctx.prevPageLastElemOffset),F.call(this,"fill",!0),this.path=Et}var pt=JSON.parse(JSON.stringify(ge));pt=v([pt],this.posX+this.margin[3],-et+ke+this.ctx.prevPageLastElemOffset)[0];var at=(pe>we||pe<Ne)&&m.call(this);at&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Fe,Ke,null).clip().discardPath()),this.pdf.addImage(O,"JPEG",pt.x,pt.y,pt.w,pt.h,null,null,ue),at&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(O,"JPEG",ge.x,ge.y,ge.w,ge.h,null,null,ue)};var g=function(O,H,W){var te=[];H=H||this.pdf.internal.pageSize.width,W=W||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var V=this.posY+this.ctx.prevPageLastElemOffset;switch(O.type){default:case"mt":case"lt":te.push(Math.floor((O.y+V)/W)+1);break;case"arc":te.push(Math.floor((O.y+V-O.radius)/W)+1),te.push(Math.floor((O.y+V+O.radius)/W)+1);break;case"qct":var ee=B(this.ctx.lastPoint.x,this.ctx.lastPoint.y,O.x1,O.y1,O.x,O.y);te.push(Math.floor((ee.y+V)/W)+1),te.push(Math.floor((ee.y+ee.h+V)/W)+1);break;case"bct":var G=T(this.ctx.lastPoint.x,this.ctx.lastPoint.y,O.x1,O.y1,O.x2,O.y2,O.x,O.y);te.push(Math.floor((G.y+V)/W)+1),te.push(Math.floor((G.y+G.h+V)/W)+1);break;case"rect":te.push(Math.floor((O.y+V)/W)+1),te.push(Math.floor((O.y+O.h+V)/W)+1)}for(var q=0;q<te.length;q+=1)for(;this.pdf.internal.getNumberOfPages()<te[q];)b.call(this);return te},b=function(){var O=this.fillStyle,H=this.strokeStyle,W=this.font,te=this.lineCap,V=this.lineWidth,ee=this.lineJoin;this.pdf.addPage(),this.fillStyle=O,this.strokeStyle=H,this.font=W,this.lineCap=te,this.lineWidth=V,this.lineJoin=ee},v=function(O,H,W){for(var te=0;te<O.length;te++)switch(O[te].type){case"bct":O[te].x2+=H,O[te].y2+=W;case"qct":O[te].x1+=H,O[te].y1+=W;default:O[te].x+=H,O[te].y+=W}return O},w=function(O){return O.sort(function(H,W){return H-W})},C=function(O,H){var W=this.fillStyle,te=this.strokeStyle,V=this.lineCap,ee=this.lineWidth,G=Math.abs(ee*this.ctx.transform.scaleX),q=this.lineJoin;if(this.autoPaging){for(var X,ce,fe=JSON.parse(JSON.stringify(this.path)),ie=JSON.parse(JSON.stringify(this.path)),le=[],re=0;re<ie.length;re++)if(ie[re].x!==void 0)for(var Ae=g.call(this,ie[re]),ue=0;ue<Ae.length;ue+=1)le.indexOf(Ae[ue])===-1&&le.push(Ae[ue]);for(var me=0;me<le.length;me++)for(;this.pdf.internal.getNumberOfPages()<le[me];)b.call(this);w(le);for(var ge=le[0],Ee=le[le.length-1],ve=ge;ve<Ee+1;ve++){this.pdf.setPage(ve),this.fillStyle=W,this.strokeStyle=te,this.lineCap=V,this.lineWidth=G,this.lineJoin=q;var Me=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Be=ve===1?this.posY+this.margin[0]:this.margin[0],we=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ne=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],pe=ve===1?0:we+(ve-2)*Ne;if(this.ctx.clip_path.length!==0){var Fe=this.path;X=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(X,this.posX+this.margin[3],-pe+Be+this.ctx.prevPageLastElemOffset),F.call(this,O,!0),this.path=Fe}if(ce=JSON.parse(JSON.stringify(fe)),this.path=v(ce,this.posX+this.margin[3],-pe+Be+this.ctx.prevPageLastElemOffset),H===!1||ve===0){var ke=(ve>ge||ve<Ee)&&m.call(this);ke&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Me,Ne,null).clip().discardPath()),F.call(this,O,H),ke&&this.pdf.restoreGraphicsState()}this.lineWidth=ee}this.path=fe}else this.lineWidth=G,F.call(this,O,H),this.lineWidth=ee},F=function(O,H){if((O!=="stroke"||H||!p.call(this))&&(O==="stroke"||H||!f.call(this))){for(var W,te,V=[],ee=this.path,G=0;G<ee.length;G++){var q=ee[G];switch(q.type){case"begin":V.push({begin:!0});break;case"close":V.push({close:!0});break;case"mt":V.push({start:q,deltas:[],abs:[]});break;case"lt":var X=V.length;if(ee[G-1]&&!isNaN(ee[G-1].x)&&(W=[q.x-ee[G-1].x,q.y-ee[G-1].y],X>0)){for(;X>=0;X--)if(V[X-1].close!==!0&&V[X-1].begin!==!0){V[X-1].deltas.push(W),V[X-1].abs.push(q);break}}break;case"bct":W=[q.x1-ee[G-1].x,q.y1-ee[G-1].y,q.x2-ee[G-1].x,q.y2-ee[G-1].y,q.x-ee[G-1].x,q.y-ee[G-1].y],V[V.length-1].deltas.push(W);break;case"qct":var ce=ee[G-1].x+2/3*(q.x1-ee[G-1].x),fe=ee[G-1].y+2/3*(q.y1-ee[G-1].y),ie=q.x+2/3*(q.x1-q.x),le=q.y+2/3*(q.y1-q.y),re=q.x,Ae=q.y;W=[ce-ee[G-1].x,fe-ee[G-1].y,ie-ee[G-1].x,le-ee[G-1].y,re-ee[G-1].x,Ae-ee[G-1].y],V[V.length-1].deltas.push(W);break;case"arc":V.push({deltas:[],abs:[],arc:!0}),Array.isArray(V[V.length-1].abs)&&V[V.length-1].abs.push(q)}}te=H?null:O==="stroke"?"stroke":"fill";for(var ue=!1,me=0;me<V.length;me++)if(V[me].arc)for(var ge=V[me].abs,Ee=0;Ee<ge.length;Ee++){var ve=ge[Ee];ve.type==="arc"?L.call(this,ve.x,ve.y,ve.radius,ve.startAngle,ve.endAngle,ve.counterclockwise,void 0,H,!ue):D.call(this,ve.x,ve.y),ue=!0}else if(V[me].close===!0)this.pdf.internal.out("h"),ue=!1;else if(V[me].begin!==!0){var Me=V[me].start.x,Be=V[me].start.y;I.call(this,V[me].deltas,Me,Be),ue=!0}te&&P.call(this,te),H&&N.call(this)}},M=function(O){var H=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,W=H*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return O-W;case"top":return O+H-W;case"hanging":return O+H-2*W;case"middle":return O+H/2-W;default:return O}},j=function(O){return O+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};d.prototype.createLinearGradient=function(){var O=function(){};return O.colorStops=[],O.addColorStop=function(H,W){this.colorStops.push([H,W])},O.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},O.isCanvasGradient=!0,O},d.prototype.createPattern=function(){return this.createLinearGradient()},d.prototype.createRadialGradient=function(){return this.createLinearGradient()};var L=function(O,H,W,te,V,ee,G,q,X){for(var ce=x.call(this,W,te,V,ee),fe=0;fe<ce.length;fe++){var ie=ce[fe];fe===0&&(X?z.call(this,ie.x1+O,ie.y1+H):D.call(this,ie.x1+O,ie.y1+H)),E.call(this,O,H,ie.x2,ie.y2,ie.x3,ie.y3,ie.x4,ie.y4)}q?N.call(this):P.call(this,G)},P=function(O){switch(O){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},N=function(){this.pdf.clip(),this.pdf.discardPath()},z=function(O,H){this.pdf.internal.out(r(O)+" "+n(H)+" m")},Q=function(O){var H;switch(O.align){case"right":case"end":H="right";break;case"center":H="center";break;default:H="left"}var W,te,V,ee=this.pdf.getTextDimensions(O.text),G=M.call(this,O.y),q=j.call(this,G)-ee.h,X=this.ctx.transform.applyToPoint(new a(O.x,G));if(this.autoPaging){var ce=this.ctx.transform.decompose(),fe=new c;fe=(fe=(fe=fe.multiply(ce.translate)).multiply(ce.skew)).multiply(ce.scale);for(var ie=this.ctx.transform.applyToRectangle(new s(O.x,G,ee.w,ee.h)),le=fe.applyToRectangle(new s(O.x,q,ee.w,ee.h)),re=g.call(this,le),Ae=[],ue=0;ue<re.length;ue+=1)Ae.indexOf(re[ue])===-1&&Ae.push(re[ue]);w(Ae);for(var me=Ae[0],ge=Ae[Ae.length-1],Ee=me;Ee<ge+1;Ee++){this.pdf.setPage(Ee);var ve=Ee===1?this.posY+this.margin[0]:this.margin[0],Me=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Be=this.pdf.internal.pageSize.height-this.margin[2],we=Be-this.margin[0],Ne=this.pdf.internal.pageSize.width-this.margin[1],pe=Ne-this.margin[3],Fe=Ee===1?0:Me+(Ee-2)*we;if(this.ctx.clip_path.length!==0){var ke=this.path;W=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(W,this.posX+this.margin[3],-1*Fe+ve),F.call(this,"fill",!0),this.path=ke}var Ie=v([JSON.parse(JSON.stringify(le))],this.posX+this.margin[3],-Fe+ve+this.ctx.prevPageLastElemOffset)[0];O.scale>=.01&&(te=this.pdf.internal.getFontSize(),this.pdf.setFontSize(te*O.scale),V=this.lineWidth,this.lineWidth=V*O.scale);var Ke=this.autoPaging!=="text";if(Ke||Ie.y+Ie.h<=Be){if(Ke||Ie.y>=ve&&Ie.x<=Ne){var et=Ke?O.text:this.pdf.splitTextToSize(O.text,O.maxWidth||Ne-Ie.x)[0],Et=v([JSON.parse(JSON.stringify(ie))],this.posX+this.margin[3],-Fe+ve+this.ctx.prevPageLastElemOffset)[0],pt=Ke&&(Ee>me||Ee<ge)&&m.call(this);pt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],pe,we,null).clip().discardPath()),this.pdf.text(et,Et.x,Et.y,{angle:O.angle,align:H,renderingMode:O.renderingMode}),pt&&this.pdf.restoreGraphicsState()}}else Ie.y<Be&&(this.ctx.prevPageLastElemOffset+=Be-Ie.y);O.scale>=.01&&(this.pdf.setFontSize(te),this.lineWidth=V)}}else O.scale>=.01&&(te=this.pdf.internal.getFontSize(),this.pdf.setFontSize(te*O.scale),V=this.lineWidth,this.lineWidth=V*O.scale),this.pdf.text(O.text,X.x+this.posX,X.y+this.posY,{angle:O.angle,align:H,renderingMode:O.renderingMode,maxWidth:O.maxWidth}),O.scale>=.01&&(this.pdf.setFontSize(te),this.lineWidth=V)},D=function(O,H,W,te){W=W||0,te=te||0,this.pdf.internal.out(r(O+W)+" "+n(H+te)+" l")},I=function(O,H,W){return this.pdf.lines(O,H,W,null,null)},E=function(O,H,W,te,V,ee,G,q){this.pdf.internal.out([t(i(W+O)),t(o(te+H)),t(i(V+O)),t(o(ee+H)),t(i(G+O)),t(o(q+H)),"c"].join(" "))},x=function(O,H,W,te){for(var V=2*Math.PI,ee=Math.PI/2;H>W;)H-=V;var G=Math.abs(W-H);G<V&&te&&(G=V-G);for(var q=[],X=te?-1:1,ce=H;G>1e-5;){var fe=ce+X*Math.min(G,ee);q.push(_.call(this,O,ce,fe)),G-=Math.abs(fe-ce),ce=fe}return q},_=function(O,H,W){var te=(W-H)/2,V=O*Math.cos(te),ee=O*Math.sin(te),G=V,q=-ee,X=G*G+q*q,ce=X+G*V+q*ee,fe=4/3*(Math.sqrt(2*X*ce)-ce)/(G*ee-q*V),ie=G-fe*q,le=q+fe*G,re=ie,Ae=-le,ue=te+H,me=Math.cos(ue),ge=Math.sin(ue);return{x1:O*Math.cos(H),y1:O*Math.sin(H),x2:ie*me-le*ge,y2:ie*ge+le*me,x3:re*me-Ae*ge,y3:re*ge+Ae*me,x4:O*Math.cos(W),y4:O*Math.sin(W)}},S=function(O){return 180*O/Math.PI},B=function(O,H,W,te,V,ee){var G=O+.5*(W-O),q=H+.5*(te-H),X=V+.5*(W-V),ce=ee+.5*(te-ee),fe=Math.min(O,V,G,X),ie=Math.max(O,V,G,X),le=Math.min(H,ee,q,ce),re=Math.max(H,ee,q,ce);return new s(fe,le,ie-fe,re-le)},T=function(O,H,W,te,V,ee,G,q){var X,ce,fe,ie,le,re,Ae,ue,me,ge,Ee,ve,Me,Be,we=W-O,Ne=te-H,pe=V-W,Fe=ee-te,ke=G-V,Ie=q-ee;for(ce=0;ce<41;ce++)me=(Ae=(fe=O+(X=ce/40)*we)+X*((le=W+X*pe)-fe))+X*(le+X*(V+X*ke-le)-Ae),ge=(ue=(ie=H+X*Ne)+X*((re=te+X*Fe)-ie))+X*(re+X*(ee+X*Ie-re)-ue),ce==0?(Ee=me,ve=ge,Me=me,Be=ge):(Ee=Math.min(Ee,me),ve=Math.min(ve,ge),Me=Math.max(Me,me),Be=Math.max(Be,ge));return new s(Math.round(Ee),Math.round(ve),Math.round(Me-Ee),Math.round(Be-ve))},U=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var O,H,W=(O=this.ctx.lineDash,H=this.ctx.lineDashOffset,JSON.stringify({lineDash:O,lineDashOffset:H}));this.prevLineDash!==W&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=W)}}})(Er.API),(function(e){var t=function(a){var s,c,l,u,d,h,f,p,m,g;for(c=[],l=0,u=(a+=s="\0\0\0\0".slice(a.length%4||4)).length;u>l;l+=4)(d=(a.charCodeAt(l)<<24)+(a.charCodeAt(l+1)<<16)+(a.charCodeAt(l+2)<<8)+a.charCodeAt(l+3))!==0?(h=(d=((d=((d=((d=(d-(g=d%85))/85)-(m=d%85))/85)-(p=d%85))/85)-(f=d%85))/85)%85,c.push(h+33,f+33,p+33,m+33,g+33)):c.push(122);return(function(b,v){for(var w=v;w>0;w--)b.pop()})(c,s.length),String.fromCharCode.apply(String,c)+"~>"},r=function(a){var s,c,l,u,d,h=String,f="length",p=255,m="charCodeAt",g="slice",b="replace";for(a[g](-2),a=a[g](0,-2)[b](/\s/g,"")[b]("z","!!!!!"),l=[],u=0,d=(a+=s="uuuuu"[g](a[f]%5||5))[f];d>u;u+=5)c=52200625*(a[m](u)-33)+614125*(a[m](u+1)-33)+7225*(a[m](u+2)-33)+85*(a[m](u+3)-33)+(a[m](u+4)-33),l.push(p&c>>24,p&c>>16,p&c>>8,p&c);return(function(v,w){for(var C=w;C>0;C--)v.pop()})(l,s[f]),h.fromCharCode.apply(h,l)},n=function(a){return a.split("").map(function(s){return("0"+s.charCodeAt().toString(16)).slice(-2)}).join("")+">"},i=function(a){var s=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((a=a.replace(/\s/g,"")).indexOf(">")!==-1&&(a=a.substr(0,a.indexOf(">"))),a.length%2&&(a+="0"),s.test(a)===!1)return"";for(var c="",l=0;l<a.length;l+=2)c+=String.fromCharCode("0x"+(a[l]+a[l+1]));return c},o=function(a){for(var s=new Uint8Array(a.length),c=a.length;c--;)s[c]=a.charCodeAt(c);return(s=lB(s)).reduce(function(l,u){return l+String.fromCharCode(u)},"")};e.processDataByFilters=function(a,s){var c=0,l=a||"",u=[];for(typeof(s=s||[])=="string"&&(s=[s]),c=0;c<s.length;c+=1)switch(s[c]){case"ASCII85Decode":case"/ASCII85Decode":l=r(l),u.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":l=t(l),u.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":l=i(l),u.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":l=n(l),u.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":l=o(l),u.push("/FlateDecode");break;default:throw new Error('The filter: "'+s[c]+'" is not implemented')}return{data:l,reverseChain:u.reverse().join(" ")}}})(Er.API),(function(e){e.loadFile=function(t,r,n){return(function(i,o,a){o=o!==!1,a=typeof a=="function"?a:function(){};var s=void 0;try{s=(function(c,l,u){var d=new XMLHttpRequest,h=0,f=function(p){var m=p.length,g=[],b=String.fromCharCode;for(h=0;h<m;h+=1)g.push(b(255&p.charCodeAt(h)));return g.join("")};if(d.open("GET",c,!l),d.overrideMimeType("text/plain; charset=x-user-defined"),l===!1&&(d.onload=function(){d.status===200?u(f(this.responseText)):u(void 0)}),d.send(null),l&&d.status===200)return f(d.responseText)})(i,o,a)}catch{}return s})(t,r,n)},e.loadImageFile=e.loadFile})(Er.API),(function(e){function t(){return(rn.html2canvas?Promise.resolve(rn.html2canvas):Promise.resolve().then(()=>Bze)).catch(function(s){return Promise.reject(new Error("Could not load html2canvas: "+s))}).then(function(s){return s.default?s.default:s})}function r(){return(rn.DOMPurify?Promise.resolve(rn.DOMPurify):TF(()=>import("./purify.es-B-PIlM9I-C9xyuY0Q.js"),[])).catch(function(s){return Promise.reject(new Error("Could not load dompurify: "+s))}).then(function(s){return s.default?s.default:s})}var n=function(s){var c=di(s);return c==="undefined"?"undefined":c==="string"||s instanceof String?"string":c==="number"||s instanceof Number?"number":c==="function"||s instanceof Function?"function":s&&s.constructor===Array?"array":s&&s.nodeType===1?"element":c==="object"?"object":"unknown"},i=function(s,c){var l=document.createElement(s);for(var u in c.className&&(l.className=c.className),c.innerHTML&&c.dompurify&&(l.innerHTML=c.dompurify.sanitize(c.innerHTML)),c.style)l.style[u]=c.style[u];return l},o=function s(c,l){for(var u=c.nodeType===3?document.createTextNode(c.nodeValue):c.cloneNode(!1),d=c.firstChild;d;d=d.nextSibling)l!==!0&&d.nodeType===1&&d.nodeName==="SCRIPT"||u.appendChild(s(d,l));return c.nodeType===1&&(c.nodeName==="CANVAS"?(u.width=c.width,u.height=c.height,u.getContext("2d").drawImage(c,0,0)):c.nodeName!=="TEXTAREA"&&c.nodeName!=="SELECT"||(u.value=c.value),u.addEventListener("load",function(){u.scrollTop=c.scrollTop,u.scrollLeft=c.scrollLeft},!0)),u},a=function s(c){var l=Object.assign(s.convert(Promise.resolve()),JSON.parse(JSON.stringify(s.template))),u=s.convert(Promise.resolve(),l);return(u=u.setProgress(1,s,1,[s])).set(c)};(a.prototype=Object.create(Promise.prototype)).constructor=a,a.convert=function(s,c){return s.__proto__=c||a.prototype,s},a.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"}},a.prototype.from=function(s,c){return this.then(function(){switch(c=c||(function(l){switch(n(l)){case"string":return"string";case"element":return l.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}})(s),c){case"string":return this.then(r).then(function(l){return this.set({src:i("div",{innerHTML:s,dompurify:l})})});case"element":return this.set({src:s});case"canvas":return this.set({canvas:s});case"img":return this.set({img:s});default:return this.error("Unknown source type.")}})},a.prototype.to=function(s){switch(s){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.")}},a.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 s={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},c=o(this.prop.src,this.opt.html2canvas.javascriptEnabled);c.tagName==="BODY"&&(s.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:s}),this.prop.container.appendChild(c),this.prop.container.firstChild.appendChild(i("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"})},a.prototype.toCanvas=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(t).then(function(c){var l=Object.assign({},this.opt.html2canvas);return delete l.onrendered,c(this.prop.container,l)}).then(function(c){(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},a.prototype.toContext2d=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(t).then(function(c){var l=this.opt.jsPDF,u=this.opt.fontFaces,d=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,h=Object.assign({async:!0,allowTaint:!0,scale:d,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 h.onrendered,l.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,l.context2d.posX=this.opt.x,l.context2d.posY=this.opt.y,l.context2d.margin=this.opt.margin,l.context2d.fontFaces=u,u)for(var f=0;f<u.length;++f){var p=u[f],m=p.src.find(function(g){return g.format==="truetype"});m&&l.addFont(m.url,p.ref.name,p.ref.style)}return h.windowHeight=h.windowHeight||0,h.windowHeight=h.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):h.windowHeight,l.context2d.save(!0),c(this.prop.container,h)}).then(function(c){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},a.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var s=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=s})},a.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},a.prototype.output=function(s,c,l){return(l=l||"pdf").toLowerCase()==="img"||l.toLowerCase()==="image"?this.outputImg(s,c):this.outputPdf(s,c)},a.prototype.outputPdf=function(s,c){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(s,c)})},a.prototype.outputImg=function(s){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(s){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 "'+s+'" is not supported.'}})},a.prototype.save=function(s){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(s?{filename:s}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},a.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},a.prototype.set=function(s){if(n(s)!=="object")return this;var c=Object.keys(s||{}).map(function(l){if(l in a.template.prop)return function(){this.prop[l]=s[l]};switch(l){case"margin":return this.setMargin.bind(this,s.margin);case"jsPDF":return function(){return this.opt.jsPDF=s.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,s.pageSize);default:return function(){this.opt[l]=s[l]}}},this);return this.then(function(){return this.thenList(c)})},a.prototype.get=function(s,c){return this.then(function(){var l=s in a.template.prop?this.prop[s]:this.opt[s];return c?c(l):l})},a.prototype.setMargin=function(s){return this.then(function(){switch(n(s)){case"number":s=[s,s,s,s];case"array":if(s.length===2&&(s=[s[0],s[1],s[0],s[1]]),s.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=s}).then(this.setPageSize)},a.prototype.setPageSize=function(s){function c(l,u){return Math.floor(l*u/72*96)}return this.then(function(){(s=s||Er.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(s.inner={width:s.width-this.opt.margin[1]-this.opt.margin[3],height:s.height-this.opt.margin[0]-this.opt.margin[2]},s.inner.px={width:c(s.inner.width,s.k),height:c(s.inner.height,s.k)},s.inner.ratio=s.inner.height/s.inner.width),this.prop.pageSize=s})},a.prototype.setProgress=function(s,c,l,u){return s!=null&&(this.progress.val=s),c!=null&&(this.progress.state=c),l!=null&&(this.progress.n=l),u!=null&&(this.progress.stack=u),this.progress.ratio=this.progress.val/this.progress.state,this},a.prototype.updateProgress=function(s,c,l,u){return this.setProgress(s?this.progress.val+s:null,c||null,l?this.progress.n+l:null,u?this.progress.stack.concat(u):null)},a.prototype.then=function(s,c){var l=this;return this.thenCore(s,c,function(u,d){return l.updateProgress(null,null,1,[u]),Promise.prototype.then.call(this,function(h){return l.updateProgress(null,u),h}).then(u,d).then(function(h){return l.updateProgress(1),h})})},a.prototype.thenCore=function(s,c,l){l=l||Promise.prototype.then;var u=this;s&&(s=s.bind(u)),c&&(c=c.bind(u));var d=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?u:a.convert(Object.assign({},u),Promise.prototype),h=l.call(d,s,c);return a.convert(h,u.__proto__)},a.prototype.thenExternal=function(s,c){return Promise.prototype.then.call(this,s,c)},a.prototype.thenList=function(s){var c=this;return s.forEach(function(l){c=c.thenCore(l)}),c},a.prototype.catch=function(s){s&&(s=s.bind(this));var c=Promise.prototype.catch.call(this,s);return a.convert(c,this)},a.prototype.catchExternal=function(s){return Promise.prototype.catch.call(this,s)},a.prototype.error=function(s){return this.then(function(){throw new Error(s)})},a.prototype.using=a.prototype.set,a.prototype.saveAs=a.prototype.save,a.prototype.export=a.prototype.output,a.prototype.run=a.prototype.then,Er.getPageSize=function(s,c,l){if(di(s)==="object"){var u=s;s=u.orientation,c=u.unit||c,l=u.format||l}c=c||"mm",l=l||"a4",s=(""+(s||"P")).toLowerCase();var d,h=(""+l).toLowerCase(),f={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(c){case"pt":d=1;break;case"mm":d=72/25.4;break;case"cm":d=72/2.54;break;case"in":d=72;break;case"px":d=.75;break;case"pc":case"em":d=12;break;case"ex":d=6;break;default:throw"Invalid unit: "+c}var p,m=0,g=0;if(f.hasOwnProperty(h))m=f[h][1]/d,g=f[h][0]/d;else try{m=l[1],g=l[0]}catch{throw new Error("Invalid format: "+l)}if(s==="p"||s==="portrait")s="p",g>m&&(p=g,g=m,m=p);else{if(s!=="l"&&s!=="landscape")throw"Invalid orientation: "+s;s="l",m>g&&(p=g,g=m,m=p)}return{width:g,height:m,unit:c,k:d,orientation:s}},e.html=function(s,c){(c=c||{}).callback=c.callback||function(){},c.html2canvas=c.html2canvas||{},c.html2canvas.canvas=c.html2canvas.canvas||this.canvas,c.jsPDF=c.jsPDF||this,c.fontFaces=c.fontFaces?c.fontFaces.map(T6):null;var l=new a(c);return c.worker?l:l.from(s).doCallback()}})(Er.API),Er.API.addJS=function(e){return mU=e,this.internal.events.subscribe("postPutResources",function(){Aw=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(Aw+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),gU=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+mU+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){Aw!==void 0&&gU!==void 0&&this.internal.out("/Names <</JavaScript "+Aw+" 0 R>>")}),this},(function(e){var t;e.events.push(["postPutResources",function(){var r=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=r.outline.render().split(/\r\n/),o=0;o<i.length;o++){var a=i[o],s=n.exec(a);if(s!=null){var c=s[1];r.internal.newObjectDeferredBegin(c,!1)}r.internal.write(a)}if(this.outline.createNamedDestinations){var l=this.internal.pages.length,u=[];for(o=0;o<l;o++){var d=r.internal.newObject();u.push(d);var h=r.internal.getPageInfo(o+1);r.internal.write("<< /D["+h.objId+" 0 R /XYZ null null null]>> endobj")}var f=r.internal.newObject();for(r.internal.write("<< /Names [ "),o=0;o<u.length;o++)r.internal.write("(page_"+(o+1)+")"+u[o]+" 0 R");r.internal.write(" ] >>","endobj"),t=r.internal.newObject(),r.internal.write("<< /Dests "+f+" 0 R"),r.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){var r=this;r.outline.root.children.length>0&&(r.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&r.internal.write("/Names "+t+" 0 R"))}]),e.events.push(["initialized",function(){var r=this;r.outline={createNamedDestinations:!1,root:{children:[]}},r.outline.add=function(n,i,o){var a={title:i,options:o,children:[]};return n==null&&(n=this.root),n.children.push(a),a},r.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=r,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},r.outline.genIds_r=function(n){n.id=r.internal.newObjectDeferred();for(var i=0;i<n.children.length;i++)this.genIds_r(n.children[i])},r.outline.renderRoot=function(n){this.objStart(n),this.line("/Type /Outlines"),n.children.length>0&&(this.line("/First "+this.makeRef(n.children[0])),this.line("/Last "+this.makeRef(n.children[n.children.length-1]))),this.line("/Count "+this.count_r({count:0},n)),this.objEnd()},r.outline.renderItems=function(n){for(var i=this.ctx.pdf.internal.getVerticalCoordinateString,o=0;o<n.children.length;o++){var a=n.children[o];this.objStart(a),this.line("/Title "+this.makeString(a.title)),this.line("/Parent "+this.makeRef(n)),o>0&&this.line("/Prev "+this.makeRef(n.children[o-1])),o<n.children.length-1&&this.line("/Next "+this.makeRef(n.children[o+1])),a.children.length>0&&(this.line("/First "+this.makeRef(a.children[0])),this.line("/Last "+this.makeRef(a.children[a.children.length-1])));var s=this.count=this.count_r({count:0},a);if(s>0&&this.line("/Count "+s),a.options&&a.options.pageNumber){var c=r.internal.getPageInfo(a.options.pageNumber);this.line("/Dest ["+c.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var l=0;l<n.children.length;l++)this.renderItems(n.children[l])},r.outline.line=function(n){this.ctx.val+=n+`\r
386
+ `),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+r}};vr.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=vr.internal.getWidth(e),r=vr.internal.getHeight(e),n=Math.min(t,r);return{x1:{x:(t-n)/2,y:(r-n)/2+n},x2:{x:(t-n)/2+n,y:(r-n)/2},x3:{x:(t-n)/2,y:(r-n)/2},x4:{x:(t-n)/2+n,y:(r-n)/2+n}}}},vr.internal.getWidth=function(e){var t=0;return di(e)==="object"&&(t=dU(e.Rect[2])),t},vr.internal.getHeight=function(e){var t=0;return di(e)==="object"&&(t=dU(e.Rect[3])),t};var BIe=Ko.addField=function(e){if(CIe(this,e),!(e instanceof Vu))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};Ko.AcroFormChoiceField=Zm,Ko.AcroFormListBox=Jm,Ko.AcroFormComboBox=e0,Ko.AcroFormEditBox=C5,Ko.AcroFormButton=Ka,Ko.AcroFormPushButton=B5,Ko.AcroFormRadioButton=t0,Ko.AcroFormCheckBox=E5,Ko.AcroFormTextField=KA,Ko.AcroFormPasswordField=M5,Ko.AcroFormAppearance=vr,Ko.AcroForm={ChoiceField:Zm,ListBox:Jm,ComboBox:e0,EditBox:C5,Button:Ka,PushButton:B5,RadioButton:t0,CheckBox:E5,TextField:KA,PasswordField:M5,Appearance:vr},Er.AcroForm={ChoiceField:Zm,ListBox:Jm,ComboBox:e0,EditBox:C5,Button:Ka,PushButton:B5,RadioButton:t0,CheckBox:E5,TextField:KA,PasswordField:M5,Appearance:vr};Er.AcroForm;function BY(e){return e.reduce(function(t,r,n){return t[r]=n,t},{})}(function(e){var t="addImage_";e.__addimage__={};var r="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(z,Q){var D,I,E,x,_,S=r;if((Q=Q||r)==="RGBA"||z.data!==void 0&&z.data instanceof Uint8ClampedArray&&"height"in z&&"width"in z)return"RGBA";if(M(z))for(_ in n)for(E=n[_],D=0;D<E.length;D+=1){for(x=!0,I=0;I<E[D].length;I+=1)if(E[D][I]!==void 0&&E[D][I]!==z[I]){x=!1;break}if(x===!0){S=_;break}}else for(_ in n)for(E=n[_],D=0;D<E.length;D+=1){for(x=!0,I=0;I<E[D].length;I+=1)if(E[D][I]!==void 0&&E[D][I]!==z.charCodeAt(I)){x=!1;break}if(x===!0){S=_;break}}return S===r&&Q!==r&&(S=Q),S},o=function z(Q){for(var D=this.internal.write,I=this.internal.putStream,E=(0,this.internal.getFilters)();E.indexOf("FlateEncode")!==-1;)E.splice(E.indexOf("FlateEncode"),1);Q.objectId=this.internal.newObject();var x=[];if(x.push({key:"Type",value:"/XObject"}),x.push({key:"Subtype",value:"/Image"}),x.push({key:"Width",value:Q.width}),x.push({key:"Height",value:Q.height}),Q.colorSpace===b.INDEXED?x.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(Q.palette.length/3-1)+" "+("sMask"in Q&&Q.sMask!==void 0?Q.objectId+2:Q.objectId+1)+" 0 R]"}):(x.push({key:"ColorSpace",value:"/"+Q.colorSpace}),Q.colorSpace===b.DEVICE_CMYK&&x.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),x.push({key:"BitsPerComponent",value:Q.bitsPerComponent}),"decodeParameters"in Q&&Q.decodeParameters!==void 0&&x.push({key:"DecodeParms",value:"<<"+Q.decodeParameters+">>"}),"transparency"in Q&&Array.isArray(Q.transparency)&&Q.transparency.length>0){for(var _="",S=0,B=Q.transparency.length;S<B;S++)_+=Q.transparency[S]+" "+Q.transparency[S]+" ";x.push({key:"Mask",value:"["+_+"]"})}Q.sMask!==void 0&&x.push({key:"SMask",value:Q.objectId+1+" 0 R"});var T=Q.filter!==void 0?["/"+Q.filter]:void 0;if(I({data:Q.data,additionalKeyValues:x,alreadyAppliedFilters:T,objectId:Q.objectId}),D("endobj"),"sMask"in Q&&Q.sMask!==void 0){var U,O=(U=Q.sMaskBitsPerComponent)!==null&&U!==void 0?U:Q.bitsPerComponent,H={width:Q.width,height:Q.height,colorSpace:"DeviceGray",bitsPerComponent:O,data:Q.sMask};"filter"in Q&&(H.decodeParameters="/Predictor ".concat(Q.predictor," /Colors 1 /BitsPerComponent ").concat(O," /Columns ").concat(Q.width),H.filter=Q.filter),z.call(this,H)}if(Q.colorSpace===b.INDEXED){var W=this.internal.newObject();I({data:L(new Uint8Array(Q.palette)),objectId:W}),D("endobj")}},a=function(){var z=this.internal.collections[t+"images"];for(var Q in z)o.call(this,z[Q])},s=function(){var z,Q=this.internal.collections[t+"images"],D=this.internal.write;for(var I in Q)D("/I"+(z=Q[I]).index,z.objectId,"0","R")},c=function(){this.internal.collections[t+"images"]||(this.internal.collections[t+"images"]={},this.internal.events.subscribe("putResources",a),this.internal.events.subscribe("putXobjectDict",s))},l=function(){var z=this.internal.collections[t+"images"];return c.call(this),z},u=function(){return Object.keys(this.internal.collections[t+"images"]).length},d=function(z){return typeof e["process"+z.toUpperCase()]=="function"},h=function(z){return di(z)==="object"&&z.nodeType===1},f=function(z,Q){if(z.nodeName==="IMG"&&z.hasAttribute("src")){var D=""+z.getAttribute("src");if(D.indexOf("data:image/")===0)return k5(unescape(D).split("base64,").pop());var I=e.loadFile(D,!0);if(I!==void 0)return I}if(z.nodeName==="CANVAS"){if(z.width===0||z.height===0)throw new Error("Given canvas must have data. Canvas width: "+z.width+", height: "+z.height);var E;switch(Q){case"PNG":E="image/png";break;case"WEBP":E="image/webp";break;default:E="image/jpeg"}return k5(z.toDataURL(E,1).split("base64,").pop())}},p=function(z){var Q=this.internal.collections[t+"images"];if(Q){for(var D in Q)if(z===Q[D].alias)return Q[D]}},m=function(z,Q,D){return z||Q||(z=-96,Q=-96),z<0&&(z=-1*D.width*72/z/this.internal.scaleFactor),Q<0&&(Q=-1*D.height*72/Q/this.internal.scaleFactor),z===0&&(z=Q*D.width/D.height),Q===0&&(Q=z*D.height/D.width),[z,Q]},g=function(z,Q,D,I,E,x){var _=m.call(this,D,I,E),S=this.internal.getCoordinateString,B=this.internal.getVerticalCoordinateString,T=l.call(this);if(D=_[0],I=_[1],T[E.index]=E,x){x*=Math.PI/180;var U=Math.cos(x),O=Math.sin(x),H=function(te){return te.toFixed(4)},W=[H(U),H(O),H(-1*O),H(U),0,0,"cm"]}this.internal.write("q"),x?(this.internal.write([1,"0","0",1,S(z),B(Q+I),"cm"].join(" ")),this.internal.write(W.join(" ")),this.internal.write([S(D),"0","0",S(I),"0","0","cm"].join(" "))):this.internal.write([S(D),"0","0",S(I),S(z),B(Q+I),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+E.index+" Do"),this.internal.write("Q")},b=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 v=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},w=e.__addimage__.sHashCode=function(z){var Q,D,I=0;if(typeof z=="string")for(D=z.length,Q=0;Q<D;Q++)I=(I<<5)-I+z.charCodeAt(Q),I|=0;else if(M(z))for(D=z.byteLength/2,Q=0;Q<D;Q++)I=(I<<5)-I+z[Q],I|=0;return I},C=e.__addimage__.validateStringAsBase64=function(z){(z=z||"").toString().trim();var Q=!0;return z.length===0&&(Q=!1),z.length%4!=0&&(Q=!1),/^[A-Za-z0-9+/]+$/.test(z.substr(0,z.length-2))===!1&&(Q=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(z.substr(-2))===!1&&(Q=!1),Q},F=e.__addimage__.extractImageFromDataUrl=function(z){if(z==null||!(z=z.trim()).startsWith("data:"))return null;var Q=z.indexOf(",");return Q<0?null:z.substring(0,Q).trim().endsWith("base64")?z.substring(Q+1):null};e.__addimage__.isArrayBuffer=function(z){return z instanceof ArrayBuffer};var M=e.__addimage__.isArrayBufferView=function(z){return z instanceof Int8Array||z instanceof Uint8Array||z instanceof Uint8ClampedArray||z instanceof Int16Array||z instanceof Uint16Array||z instanceof Int32Array||z instanceof Uint32Array||z instanceof Float32Array||z instanceof Float64Array},j=e.__addimage__.binaryStringToUint8Array=function(z){for(var Q=z.length,D=new Uint8Array(Q),I=0;I<Q;I++)D[I]=z.charCodeAt(I);return D},L=e.__addimage__.arrayBufferToBinaryString=function(z){for(var Q="",D=M(z)?z:new Uint8Array(z),I=0;I<D.length;I+=8192)Q+=String.fromCharCode.apply(null,D.subarray(I,I+8192));return Q};e.addImage=function(){var z,Q,D,I,E,x,_,S,B;if(typeof arguments[1]=="number"?(Q=r,D=arguments[1],I=arguments[2],E=arguments[3],x=arguments[4],_=arguments[5],S=arguments[6],B=arguments[7]):(Q=arguments[1],D=arguments[2],I=arguments[3],E=arguments[4],x=arguments[5],_=arguments[6],S=arguments[7],B=arguments[8]),di(z=arguments[0])==="object"&&!h(z)&&"imageData"in z){var T=z;z=T.imageData,Q=T.format||Q||r,D=T.x||D||0,I=T.y||I||0,E=T.w||T.width||E,x=T.h||T.height||x,_=T.alias||_,S=T.compression||S,B=T.rotation||T.angle||B}var U=this.internal.getFilters();if(S===void 0&&U.indexOf("FlateEncode")!==-1&&(S="SLOW"),isNaN(D)||isNaN(I))throw new Error("Invalid coordinates passed to jsPDF.addImage");c.call(this);var O=P.call(this,z,Q,_,S);return g.call(this,D,I,E,x,O,B),this};var P=function(z,Q,D,I){var E,x,_;if(typeof z=="string"&&i(z)===r){z=unescape(z);var S=N(z,!1);(S!==""||(S=e.loadFile(z,!0))!==void 0)&&(z=S)}if(h(z)&&(z=f(z,Q)),Q=i(z,Q),!d(Q))throw new Error("addImage does not support files of type '"+Q+"', please ensure that a plugin for '"+Q+"' support is added.");if(((_=D)==null||_.length===0)&&(D=(function(B){return typeof B=="string"||M(B)?w(B):M(B.data)?w(B.data):null})(z)),(E=p.call(this,D))||(z instanceof Uint8Array||Q==="RGBA"||(x=z,z=j(z)),E=this["process"+Q.toUpperCase()](z,u.call(this),D,(function(B){return B&&typeof B=="string"&&(B=B.toUpperCase()),B in e.image_compression?B:v.NONE})(I),x)),!E)throw new Error("An unknown error occurred whilst processing the image.");return E},N=e.__addimage__.convertBase64ToBinaryString=function(z,Q){Q=typeof Q!="boolean"||Q;var D,I="";if(typeof z=="string"){var E;D=(E=F(z))!==null&&E!==void 0?E:z;try{I=k5(D)}catch(x){if(Q)throw C(D)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+x.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return I};e.getImageProperties=function(z){var Q,D,I="";if(h(z)&&(z=f(z)),typeof z=="string"&&i(z)===r&&((I=N(z,!1))===""&&(I=e.loadFile(z)||""),z=I),D=i(z),!d(D))throw new Error("addImage does not support files of type '"+D+"', please ensure that a plugin for '"+D+"' support is added.");if(z instanceof Uint8Array||(z=j(z)),!(Q=this["process"+D.toUpperCase()](z)))throw new Error("An unknown error occurred whilst processing the image");return Q.fileType=D,Q}})(Er.API),(function(e){var t=function(r){if(r!==void 0&&r!="")return!0};Er.API.events.push(["addPage",function(r){this.internal.getPageInfo(r.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(r){for(var n,i,o,a=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString,c=this.internal.getPageInfoByObjId(r.objId),l=r.pageContext.annotations,u=!1,d=0;d<l.length&&!u;d++)switch((n=l[d]).type){case"link":(t(n.options.url)||t(n.options.pageNumber))&&(u=!0);break;case"reference":case"text":case"freetext":u=!0}if(u!=0){this.internal.write("/Annots [");for(var h=0;h<l.length;h++){n=l[h];var f=this.internal.pdfEscape,p=this.internal.getEncryptor(r.objId);switch(n.type){case"reference":this.internal.write(" "+n.object.objId+" 0 R ");break;case"text":var m=this.internal.newAdditionalObject(),g=this.internal.newAdditionalObject(),b=this.internal.getEncryptor(m.objId),v=n.title||"Note";o="<</Type /Annot /Subtype /Text "+(i="/Rect ["+a(n.bounds.x)+" "+s(n.bounds.y+n.bounds.h)+" "+a(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y)+"] ")+"/Contents ("+f(b(n.contents))+")",o+=" /Popup "+g.objId+" 0 R",o+=" /P "+c.objId+" 0 R",o+=" /T ("+f(b(v))+") >>",m.content=o;var w=m.objId+" 0 R";o="<</Type /Annot /Subtype /Popup "+(i="/Rect ["+a(n.bounds.x+30)+" "+s(n.bounds.y+n.bounds.h)+" "+a(n.bounds.x+n.bounds.w+30)+" "+s(n.bounds.y)+"] ")+" /Parent "+w,n.open&&(o+=" /Open true"),o+=" >>",g.content=o,this.internal.write(m.objId,"0 R",g.objId,"0 R");break;case"freetext":i="/Rect ["+a(n.bounds.x)+" "+s(n.bounds.y)+" "+a(n.bounds.x+n.bounds.w)+" "+s(n.bounds.y+n.bounds.h)+"] ";var C=n.color||"#000000";o="<</Type /Annot /Subtype /FreeText "+i+"/Contents ("+f(p(n.contents))+")",o+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+C+")",o+=" /Border [0 0 0]",o+=" >>",this.internal.write(o);break;case"link":if(n.options.name){var F=this.annotations._nameMap[n.options.name];n.options.pageNumber=F.page,n.options.top=F.y}else n.options.top||(n.options.top=0);if(i="/Rect ["+n.finalBounds.x+" "+n.finalBounds.y+" "+n.finalBounds.w+" "+n.finalBounds.h+"] ",o="",n.options.url)o="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /A <</S /URI /URI ("+f(p(n.options.url))+") >>";else if(n.options.pageNumber)switch(o="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(n.options.pageNumber).objId+" 0 R",n.options.magFactor=n.options.magFactor||"XYZ",n.options.magFactor){case"Fit":o+=" /Fit]";break;case"FitH":o+=" /FitH "+n.options.top+"]";break;case"FitV":n.options.left=n.options.left||0,o+=" /FitV "+n.options.left+"]";break;default:var M=s(n.options.top);n.options.left=n.options.left||0,n.options.zoom===void 0&&(n.options.zoom=0),o+=" /XYZ "+n.options.left+" "+M+" "+n.options.zoom+"]"}o!=""&&(o+=" >>",this.internal.write(o))}}this.internal.write("]")}}]),e.createAnnotation=function(r){var n=this.internal.getCurrentPageInfo();switch(r.type){case"link":this.link(r.bounds.x,r.bounds.y,r.bounds.w,r.bounds.h,r);break;case"text":case"freetext":n.pageContext.annotations.push(r)}},e.link=function(r,n,i,o,a){var s=this.internal.getCurrentPageInfo(),c=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString;s.pageContext.annotations.push({finalBounds:{x:c(r),y:l(n),w:c(r+i),h:l(n+o)},options:a,type:"link"})},e.textWithLink=function(r,n,i,o){var a,s,c=this.getTextWidth(r),l=this.internal.getLineHeight()/this.internal.scaleFactor;if(o.maxWidth!==void 0){s=o.maxWidth;var u=this.splitTextToSize(r,s).length;a=Math.ceil(l*u)}else s=c,a=l;return this.text(r,n,i,o),i+=.2*l,o.align==="center"&&(n-=c/2),o.align==="right"&&(n-=c),this.link(n,i-l,s,a,o),c},e.getTextWidth=function(r){var n=this.internal.getFontSize();return this.getStringUnitWidth(r)*n/this.internal.scaleFactor}})(Er.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]},r={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}},n={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];e.__arabicParser__={};var o=e.__arabicParser__.isInArabicSubstitutionA=function(m){return t[m.charCodeAt(0)]!==void 0},a=e.__arabicParser__.isArabicLetter=function(m){return typeof m=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(m)},s=e.__arabicParser__.isArabicEndLetter=function(m){return a(m)&&o(m)&&t[m.charCodeAt(0)].length<=2},c=e.__arabicParser__.isArabicAlfLetter=function(m){return a(m)&&i.indexOf(m.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(m){return a(m)&&o(m)&&t[m.charCodeAt(0)].length>=1};var l=e.__arabicParser__.arabicLetterHasFinalForm=function(m){return a(m)&&o(m)&&t[m.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(m){return a(m)&&o(m)&&t[m.charCodeAt(0)].length>=3};var u=e.__arabicParser__.arabicLetterHasMedialForm=function(m){return a(m)&&o(m)&&t[m.charCodeAt(0)].length==4},d=e.__arabicParser__.resolveLigatures=function(m){var g=0,b=r,v="",w=0;for(g=0;g<m.length;g+=1)b[m.charCodeAt(g)]!==void 0?(w++,typeof(b=b[m.charCodeAt(g)])=="number"&&(v+=String.fromCharCode(b),b=r,w=0),g===m.length-1&&(b=r,v+=m.charAt(g-(w-1)),g-=w-1,w=0)):(b=r,v+=m.charAt(g-w),g-=w,w=0);return v};e.__arabicParser__.isArabicDiacritic=function(m){return m!==void 0&&n[m.charCodeAt(0)]!==void 0};var h=e.__arabicParser__.getCorrectForm=function(m,g,b){return a(m)?o(m)===!1?-1:!l(m)||!a(g)&&!a(b)||!a(b)&&s(g)||s(m)&&!a(g)||s(m)&&c(g)||s(m)&&s(g)?0:u(m)&&a(g)&&!s(g)&&a(b)&&l(b)?3:s(m)||!a(b)?1:2:-1},f=function(m){var g=0,b=0,v=0,w="",C="",F="",M=(m=m||"").split("\\s+"),j=[];for(g=0;g<M.length;g+=1){for(j.push(""),b=0;b<M[g].length;b+=1)w=M[g][b],C=M[g][b-1],F=M[g][b+1],a(w)?(v=h(w,C,F),j[g]+=v!==-1?String.fromCharCode(t[w.charCodeAt(0)][v]):w):j[g]+=w;j[g]=d(j[g])}return j.join(" ")},p=e.__arabicParser__.processArabic=e.processArabic=function(){var m,g=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,b=[];if(Array.isArray(g)){var v=0;for(b=[],v=0;v<g.length;v+=1)Array.isArray(g[v])?b.push([f(g[v][0]),g[v][1],g[v][2]]):b.push([f(g[v])]);m=b}else m=f(g);return typeof arguments[0]=="string"?m:(arguments[0].text=m,arguments[0])};e.events.push(["preProcessText",p])})(Er.API),Er.API.autoPrint=function(e){var t;return(e=e||{}).variant=e.variant||"non-conform",e.variant==="javascript"?this.addJS("print({});"):(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")})),this},(function(e){var t=function(){var r=void 0;Object.defineProperty(this,"pdf",{get:function(){return r},set:function(s){r=s}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(s){n=isNaN(s)||Number.isInteger(s)===!1||s<0?150:s,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var i=300;Object.defineProperty(this,"height",{get:function(){return i},set:function(s){i=isNaN(s)||Number.isInteger(s)===!1||s<0?300:s,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=i+1)}});var o=[];Object.defineProperty(this,"childNodes",{get:function(){return o},set:function(s){o=s}});var a={};Object.defineProperty(this,"style",{get:function(){return a},set:function(s){a=s}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(r,n){var i;if((r=r||"2d")!=="2d")return null;for(i in n)this.pdf.context2d.hasOwnProperty(i)&&(this.pdf.context2d[i]=n[i]);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}])})(Er.API),(function(e){var t={left:0,top:0,bottom:0,right:0},r=!1,n=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(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new o,this.internal.__cell__.pages=1},o=function(){var c=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return c},set:function(m){c=m}});var l=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return l},set:function(m){l=m}});var u=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return u},set:function(m){u=m}});var d=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return d},set:function(m){d=m}});var h=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return h},set:function(m){h=m}});var f=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return f},set:function(m){f=m}});var p=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return p},set:function(m){p=m}}),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(c){return n.call(this),this.internal.__cell__.headerFunction=typeof c=="function"?c:void 0,this},e.getTextDimensions=function(c,l){n.call(this);var u=(l=l||{}).fontSize||this.getFontSize(),d=l.font||this.getFont(),h=l.scaleFactor||this.internal.scaleFactor,f=0,p=0,m=0,g=this;if(!Array.isArray(c)&&typeof c!="string"){if(typeof c!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");c=String(c)}var b=l.maxWidth;b>0?typeof c=="string"?c=this.splitTextToSize(c,b):Object.prototype.toString.call(c)==="[object Array]"&&(c=c.reduce(function(w,C){return w.concat(g.splitTextToSize(C,b))},[])):c=Array.isArray(c)?c:[c];for(var v=0;v<c.length;v++)f<(m=this.getStringUnitWidth(c[v],{font:d})*u)&&(f=m);return f!==0&&(p=c.length),{w:f/=h,h:Math.max((p*u*this.getLineHeightFactor()-u*(this.getLineHeightFactor()-1))/h,0)}},e.cellAddPage=function(){n.call(this),this.addPage();var c=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new o(c.left,c.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var a=e.cell=function(){var c;c=arguments[0]instanceof o?arguments[0]:new o(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),n.call(this);var l=this.internal.__cell__.lastCell,u=this.internal.__cell__.padding,d=this.internal.__cell__.margins||t,h=this.internal.__cell__.tableHeaderRow,f=this.internal.__cell__.printHeaders;return l.lineNumber!==void 0&&(l.lineNumber===c.lineNumber?(c.x=(l.x||0)+(l.width||0),c.y=l.y||0):l.y+l.height+c.height+d.bottom>this.getPageHeight()?(this.cellAddPage(),c.y=d.top,f&&h&&(this.printHeaderRow(c.lineNumber,!0),c.y+=h[0].height)):c.y=l.y+l.height||c.y),c.text[0]!==void 0&&(this.rect(c.x,c.y,c.width,c.height,r===!0?"FD":void 0),c.align==="right"?this.text(c.text,c.x+c.width-u,c.y+u,{align:"right",baseline:"top"}):c.align==="center"?this.text(c.text,c.x+c.width/2,c.y+u,{align:"center",baseline:"top",maxWidth:c.width-u-u}):this.text(c.text,c.x+u,c.y+u,{align:"left",baseline:"top",maxWidth:c.width-u-u})),this.internal.__cell__.lastCell=c,this};e.table=function(c,l,u,d,h){if(n.call(this),!u)throw new Error("No data for PDF table.");var f,p,m,g,b=[],v=[],w=[],C={},F={},M=[],j=[],L=(h=h||{}).autoSize||!1,P=h.printHeaders!==!1,N=h.css&&h.css["font-size"]!==void 0?16*h.css["font-size"]:h.fontSize||12,z=h.margins||Object.assign({width:this.getPageWidth()},t),Q=typeof h.padding=="number"?h.padding:3,D=h.headerBackgroundColor||"#c8c8c8",I=h.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=P,this.internal.__cell__.margins=z,this.internal.__cell__.table_font_size=N,this.internal.__cell__.padding=Q,this.internal.__cell__.headerBackgroundColor=D,this.internal.__cell__.headerTextColor=I,this.setFontSize(N),d==null)v=b=Object.keys(u[0]),w=b.map(function(){return"left"});else if(Array.isArray(d)&&di(d[0])==="object")for(b=d.map(function(T){return T.name}),v=d.map(function(T){return T.prompt||T.name||""}),w=d.map(function(T){return T.align||"left"}),f=0;f<d.length;f+=1)F[d[f].name]=.7499990551181103*d[f].width;else Array.isArray(d)&&typeof d[0]=="string"&&(v=b=d,w=b.map(function(){return"left"}));if(L||Array.isArray(d)&&typeof d[0]=="string")for(f=0;f<b.length;f+=1){for(C[g=b[f]]=u.map(function(T){return T[g]}),this.setFont(void 0,"bold"),M.push(this.getTextDimensions(v[f],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),p=C[g],this.setFont(void 0,"normal"),m=0;m<p.length;m+=1)M.push(this.getTextDimensions(p[m],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);F[g]=Math.max.apply(null,M)+Q+Q,M=[]}if(P){var E={};for(f=0;f<b.length;f+=1)E[b[f]]={},E[b[f]].text=v[f],E[b[f]].align=w[f];var x=s.call(this,E,F);j=b.map(function(T){return new o(c,l,F[T],x,E[T].text,void 0,E[T].align)}),this.setTableHeaderRow(j),this.printHeaderRow(1,!1)}var _=d.reduce(function(T,U){return T[U.name]=U.align,T},{});for(f=0;f<u.length;f+=1){"rowStart"in h&&h.rowStart instanceof Function&&h.rowStart({row:f,data:u[f]},this);var S=s.call(this,u[f],F);for(m=0;m<b.length;m+=1){var B=u[f][b[m]];"cellStart"in h&&h.cellStart instanceof Function&&h.cellStart({row:f,col:m,data:B},this),a.call(this,new o(c,l,F[b[m]],S,B,f+2,_[b[m]]))}}return this.internal.__cell__.table_x=c,this.internal.__cell__.table_y=l,this};var s=function(c,l){var u=this.internal.__cell__.padding,d=this.internal.__cell__.table_font_size,h=this.internal.scaleFactor;return Object.keys(c).map(function(f){var p=c[f];return this.splitTextToSize(p.hasOwnProperty("text")?p.text:p,l[f]-u-u)},this).map(function(f){return this.getLineHeightFactor()*f.length*d/h+u+u},this).reduce(function(f,p){return Math.max(f,p)},0)};e.setTableHeaderRow=function(c){n.call(this),this.internal.__cell__.tableHeaderRow=c},e.printHeaderRow=function(c,l){if(n.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var u;if(r=!0,typeof this.internal.__cell__.headerFunction=="function"){var d=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new o(d[0],d[1],d[2],d[3],void 0,-1)}this.setFont(void 0,"bold");for(var h=[],f=0;f<this.internal.__cell__.tableHeaderRow.length;f+=1){u=this.internal.__cell__.tableHeaderRow[f].clone(),l&&(u.y=this.internal.__cell__.margins.top||0,h.push(u)),u.lineNumber=c;var p=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),a.call(this,u),this.setTextColor(p)}h.length>0&&this.setTableHeaderRow(h),this.setFont(void 0,"normal"),r=!1}})(Er.API);var EY={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},MY=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],AB=BY(MY),TY=[100,200,300,400,500,600,700,800,900],EIe=BY(TY);function T6(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),r=(function(o){return EY[o=o||"normal"]?o:"normal"})(e.style),n=(function(o){return o?typeof o=="number"?o>=100&&o<=900&&o%100==0?o:400:/^\d00$/.test(o)?parseInt(o):o==="bold"?700:400:400})(e.weight),i=(function(o){return typeof AB[o=o||"normal"]=="number"?o:"normal"})(e.stretch);return{family:t,style:r,weight:n,stretch:i,src:e.src||[],ref:e.ref||{name:t,style:[i,r,n].join(" ")}}}function fU(e,t,r,n){var i;for(i=r;i>=0&&i<t.length;i+=n)if(e[t[i]])return e[t[i]];for(i=r;i>=0&&i<t.length;i-=n)if(e[t[i]])return e[t[i]]}var MIe={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},hU={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function pU(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function AU(e){return e.trimLeft()}function TIe(e,t){for(var r=0;r<e.length;){if(e.charAt(r)===t)return[e.substring(0,r),e.substring(r+1)];r+=1}return null}function FIe(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 Aw,gU,mU,pm,gw,bU,yU,vU,wU=["times"];function xU(e,t,r,n,i){var o=4,a=SU;switch(i){case Er.API.image_compression.FAST:o=1,a=_U;break;case Er.API.image_compression.MEDIUM:o=6,a=kU;break;case Er.API.image_compression.SLOW:o=9,a=CU}e=(function(c,l,u,d){for(var h,f=c.length/l,p=new Uint8Array(c.length+f),m=[DIe,_U,SU,kU,CU],g=0;g<f;g+=1){var b=g*l,v=c.subarray(b,b+l);if(d)p.set(d(v,u,h),b+g);else{for(var w=m.length,C=[],F=0;F<w;F+=1)C[F]=m[F](v,u,h);var M=RIe(C.concat());p.set(C[M],b+g)}h=v}return p})(e,t,Math.ceil(r*n/8),a);var s=lB(e,{level:o});return Er.API.__addimage__.arrayBufferToBinaryString(s)}function DIe(e){var t=Array.apply([],e);return t.unshift(0),t}function _U(e,t){var r=e.length,n=[];n[0]=1;for(var i=0;i<r;i+=1){var o=e[i-t]||0;n[i+1]=e[i]-o+256&255}return n}function SU(e,t,r){var n=e.length,i=[];i[0]=2;for(var o=0;o<n;o+=1){var a=r&&r[o]||0;i[o+1]=e[o]-a+256&255}return i}function kU(e,t,r){var n=e.length,i=[];i[0]=3;for(var o=0;o<n;o+=1){var a=e[o-t]||0,s=r&&r[o]||0;i[o+1]=e[o]+256-(a+s>>>1)&255}return i}function CU(e,t,r){var n=e.length,i=[];i[0]=4;for(var o=0;o<n;o+=1){var a=IIe(e[o-t]||0,r&&r[o]||0,r&&r[o-t]||0);i[o+1]=e[o]-a+256&255}return i}function IIe(e,t,r){if(e===t&&t===r)return e;var n=Math.abs(t-r),i=Math.abs(e-r),o=Math.abs(e+t-r-r);return n<=i&&n<=o?e:i<=o?t:r}function RIe(e){var t=e.map(function(r){return r.reduce(function(n,i){return n+Math.abs(i)},0)});return t.indexOf(Math.min.apply(null,t))}function F6(e,t,r){var n=t*r,i=Math.floor(n/8),o=16-(n-8*i+r),a=(1<<r)-1;return FY(e,i)>>o&a}function BU(e,t,r,n){var i=r*n,o=Math.floor(i/8),a=16-(i-8*o+n),s=(1<<n)-1,c=(t&s)<<a;(function(l,u,d){if(u+1<l.byteLength)l.setUint16(u,d,!1);else{var h=d>>8&255;l.setUint8(u,h)}})(e,o,FY(e,o)&~(s<<a)&65535|c)}function FY(e,t){return t+1<e.byteLength?e.getUint16(t,!1):e.getUint8(t)<<8}function OIe(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 r=e[t++]|e[t++]<<8,n=e[t++]|e[t++]<<8,i=e[t++],o=i>>7,a=1<<1+(7&i);e[t++],e[t++];var s=null,c=null;o&&(s=t,c=a,t+=3*a);var l=!0,u=[],d=0,h=null,f=0,p=null;for(this.width=r,this.height=n;l&&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,p=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!((z=e[t++])>=0))throw Error("Invalid block size");if(z===0)break;t+=z}break;case 249:if(e[t++]!==4||e[t+4]!==0)throw new Error("Invalid graphics extension block.");var m=e[t++];d=e[t++]|e[t++]<<8,h=e[t++],1&m||(h=null),f=m>>2&7,t++;break;case 254:for(;;){if(!((z=e[t++])>=0))throw Error("Invalid block size");if(z===0)break;t+=z}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var g=e[t++]|e[t++]<<8,b=e[t++]|e[t++]<<8,v=e[t++]|e[t++]<<8,w=e[t++]|e[t++]<<8,C=e[t++],F=C>>6&1,M=1<<1+(7&C),j=s,L=c,P=!1;C>>7&&(P=!0,j=t,L=M,t+=3*M);var N=t;for(t++;;){var z;if(!((z=e[t++])>=0))throw Error("Invalid block size");if(z===0)break;t+=z}u.push({x:g,y:b,width:v,height:w,has_local_palette:P,palette_offset:j,palette_size:L,data_offset:N,data_length:t-N,transparent_index:h,interlaced:!!F,delay:d,disposal:f});break;case 59:l=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return u.length},this.loopCount=function(){return p},this.frameInfo=function(Q){if(Q<0||Q>=u.length)throw new Error("Frame index out of range.");return u[Q]},this.decodeAndBlitFrameBGRA=function(Q,D){var I=this.frameInfo(Q),E=I.width*I.height,x=new Uint8Array(E);EU(e,I.data_offset,x,E);var _=I.palette_offset,S=I.transparent_index;S===null&&(S=256);var B=I.width,T=r-B,U=B,O=4*(I.y*r+I.x),H=4*((I.y+I.height)*r+I.x),W=O,te=4*T;I.interlaced===!0&&(te+=4*r*7);for(var V=8,ee=0,G=x.length;ee<G;++ee){var q=x[ee];if(U===0&&(U=B,(W+=te)>=H&&(te=4*T+4*r*(V-1),W=O+(B+T)*(V<<1),V>>=1)),q===S)W+=4;else{var X=e[_+3*q],ce=e[_+3*q+1],fe=e[_+3*q+2];D[W++]=fe,D[W++]=ce,D[W++]=X,D[W++]=255}--U}},this.decodeAndBlitFrameRGBA=function(Q,D){var I=this.frameInfo(Q),E=I.width*I.height,x=new Uint8Array(E);EU(e,I.data_offset,x,E);var _=I.palette_offset,S=I.transparent_index;S===null&&(S=256);var B=I.width,T=r-B,U=B,O=4*(I.y*r+I.x),H=4*((I.y+I.height)*r+I.x),W=O,te=4*T;I.interlaced===!0&&(te+=4*r*7);for(var V=8,ee=0,G=x.length;ee<G;++ee){var q=x[ee];if(U===0&&(U=B,(W+=te)>=H&&(te=4*T+4*r*(V-1),W=O+(B+T)*(V<<1),V>>=1)),q===S)W+=4;else{var X=e[_+3*q],ce=e[_+3*q+1],fe=e[_+3*q+2];D[W++]=X,D[W++]=ce,D[W++]=fe,D[W++]=255}--U}}}function EU(e,t,r,n){for(var i=e[t++],o=1<<i,a=o+1,s=a+1,c=i+1,l=(1<<c)-1,u=0,d=0,h=0,f=e[t++],p=new Int32Array(4096),m=null;;){for(;u<16&&f!==0;)d|=e[t++]<<u,u+=8,f===1?f=e[t++]:--f;if(u<c)break;var g=d&l;if(d>>=c,u-=c,g!==o){if(g===a)break;for(var b=g<s?g:m,v=0,w=b;w>o;)w=p[w]>>8,++v;var C=w;if(h+v+(b!==g?1:0)>n)return void Xi.log("Warning, gif stream longer than expected.");r[h++]=C;var F=h+=v;for(b!==g&&(r[h++]=C),w=b;v--;)w=p[w],r[--F]=255&w,w>>=8;m!==null&&s<4096&&(p[s++]=m<<8|C,s>=l+1&&c<12&&(++c,l=l<<1|1)),m=g}else s=a+1,l=(1<<(c=i+1))-1,m=null}return h!==n&&Xi.log("Warning, gif stream shorter than expected."),r}function D6(e){var t,r,n,i,o,a=Math.floor,s=new Array(64),c=new Array(64),l=new Array(64),u=new Array(64),d=new Array(65535),h=new Array(65535),f=new Array(64),p=new Array(64),m=[],g=0,b=7,v=new Array(64),w=new Array(64),C=new Array(64),F=new Array(256),M=new Array(2048),j=[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],L=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],P=[0,1,2,3,4,5,6,7,8,9,10,11],N=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],z=[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],Q=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],D=[0,1,2,3,4,5,6,7,8,9,10,11],I=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],E=[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 x(O,H){for(var W=0,te=0,V=new Array,ee=1;ee<=16;ee++){for(var G=1;G<=O[ee];G++)V[H[te]]=[],V[H[te]][0]=W,V[H[te]][1]=ee,te++,W++;W*=2}return V}function _(O){for(var H=O[0],W=O[1]-1;W>=0;)H&1<<W&&(g|=1<<b),W--,--b<0&&(g==255?(S(255),S(0)):S(g),b=7,g=0)}function S(O){m.push(O)}function B(O){S(O>>8&255),S(255&O)}function T(O,H,W,te,V){for(var ee,G=V[0],q=V[240],X=(function(ge,Ee){var ve,Me,Be,we,Ne,pe,Fe,ke,Ie,Ke,et=0;for(Ie=0;Ie<8;++Ie){ve=ge[et],Me=ge[et+1],Be=ge[et+2],we=ge[et+3],Ne=ge[et+4],pe=ge[et+5],Fe=ge[et+6];var Et=ve+(ke=ge[et+7]),pt=ve-ke,at=Me+Fe,rt=Me-Fe,wt=Be+pe,ht=Be-pe,$t=we+Ne,qt=we-Ne,It=Et+$t,gr=Et-$t,Gt=at+wt,Tt=at-wt;ge[et]=It+Gt,ge[et+4]=It-Gt;var hr=.707106781*(Tt+gr);ge[et+2]=gr+hr,ge[et+6]=gr-hr;var Wr=.382683433*((It=qt+ht)-(Tt=rt+pt)),nr=.5411961*It+Wr,Kr=1.306562965*Tt+Wr,nn=.707106781*(Gt=ht+rt),Ft=pt+nn,on=pt-nn;ge[et+5]=on+nr,ge[et+3]=on-nr,ge[et+1]=Ft+Kr,ge[et+7]=Ft-Kr,et+=8}for(et=0,Ie=0;Ie<8;++Ie){ve=ge[et],Me=ge[et+8],Be=ge[et+16],we=ge[et+24],Ne=ge[et+32],pe=ge[et+40],Fe=ge[et+48];var un=ve+(ke=ge[et+56]),xr=ve-ke,Qe=Me+Fe,$e=Me-Fe,ut=Be+pe,Ot=Be-pe,pr=we+Ne,Pt=we-Ne,Jt=un+pr,Zt=un-pr,er=Qe+ut,nt=Qe-ut;ge[et]=Jt+er,ge[et+32]=Jt-er;var kt=.707106781*(nt+Zt);ge[et+16]=Zt+kt,ge[et+48]=Zt-kt;var rr=.382683433*((Jt=Pt+Ot)-(nt=$e+xr)),mn=.5411961*Jt+rr,_n=1.306562965*nt+rr,vi=.707106781*(er=Ot+$e),ri=xr+vi,Ri=xr-vi;ge[et+40]=Ri+mn,ge[et+24]=Ri-mn,ge[et+8]=ri+_n,ge[et+56]=ri-_n,et++}for(Ie=0;Ie<64;++Ie)Ke=ge[Ie]*Ee[Ie],f[Ie]=Ke>0?Ke+.5|0:Ke-.5|0;return f})(O,H),ce=0;ce<64;++ce)p[j[ce]]=X[ce];var fe=p[0]-W;W=p[0],fe==0?_(te[0]):(_(te[h[ee=32767+fe]]),_(d[ee]));for(var ie=63;ie>0&&p[ie]==0;)ie--;if(ie==0)return _(G),W;for(var le,re=1;re<=ie;){for(var Ae=re;p[re]==0&&re<=ie;)++re;var ue=re-Ae;if(ue>=16){le=ue>>4;for(var me=1;me<=le;++me)_(q);ue&=15}ee=32767+p[re],_(V[(ue<<4)+h[ee]]),_(d[ee]),re++}return ie!=63&&_(G),W}function U(O){O=Math.min(Math.max(O,1),100),o!=O&&((function(H){for(var W=[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],te=0;te<64;te++){var V=a((W[te]*H+50)/100);V=Math.min(Math.max(V,1),255),s[j[te]]=V}for(var ee=[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],G=0;G<64;G++){var q=a((ee[G]*H+50)/100);q=Math.min(Math.max(q,1),255),c[j[G]]=q}for(var X=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],ce=0,fe=0;fe<8;fe++)for(var ie=0;ie<8;ie++)l[ce]=1/(s[j[ce]]*X[fe]*X[ie]*8),u[ce]=1/(c[j[ce]]*X[fe]*X[ie]*8),ce++})(O<50?Math.floor(5e3/O):Math.floor(200-2*O)),o=O)}this.encode=function(O,H){H&&U(H),m=new Array,g=0,b=7,B(65496),B(65504),B(16),S(74),S(70),S(73),S(70),S(0),S(1),S(1),S(0),B(1),B(1),S(0),S(0),(function(){B(65499),B(132),S(0);for(var Me=0;Me<64;Me++)S(s[Me]);S(1);for(var Be=0;Be<64;Be++)S(c[Be])})(),(function(Me,Be){B(65472),B(17),S(8),B(Be),B(Me),S(3),S(1),S(17),S(0),S(2),S(17),S(1),S(3),S(17),S(1)})(O.width,O.height),(function(){B(65476),B(418),S(0);for(var Me=0;Me<16;Me++)S(L[Me+1]);for(var Be=0;Be<=11;Be++)S(P[Be]);S(16);for(var we=0;we<16;we++)S(N[we+1]);for(var Ne=0;Ne<=161;Ne++)S(z[Ne]);S(1);for(var pe=0;pe<16;pe++)S(Q[pe+1]);for(var Fe=0;Fe<=11;Fe++)S(D[Fe]);S(17);for(var ke=0;ke<16;ke++)S(I[ke+1]);for(var Ie=0;Ie<=161;Ie++)S(E[Ie])})(),B(65498),B(12),S(3),S(1),S(0),S(2),S(17),S(3),S(17),S(0),S(63),S(0);var W=0,te=0,V=0;g=0,b=7,this.encode.displayName="_encode_";for(var ee,G,q,X,ce,fe,ie,le,re,Ae=O.data,ue=O.width,me=O.height,ge=4*ue,Ee=0;Ee<me;){for(ee=0;ee<ge;){for(ce=ge*Ee+ee,ie=-1,le=0,re=0;re<64;re++)fe=ce+(le=re>>3)*ge+(ie=4*(7&re)),Ee+le>=me&&(fe-=ge*(Ee+1+le-me)),ee+ie>=ge&&(fe-=ee+ie-ge+4),G=Ae[fe++],q=Ae[fe++],X=Ae[fe++],v[re]=(M[G]+M[q+256|0]+M[X+512|0]>>16)-128,w[re]=(M[G+768|0]+M[q+1024|0]+M[X+1280|0]>>16)-128,C[re]=(M[G+1280|0]+M[q+1536|0]+M[X+1792|0]>>16)-128;W=T(v,l,W,t,n),te=T(w,u,te,r,i),V=T(C,u,V,r,i),ee+=32}Ee+=8}if(b>=0){var ve=[];ve[1]=b+1,ve[0]=(1<<b+1)-1,_(ve)}return B(65497),new Uint8Array(m)},e=e||50,(function(){for(var O=String.fromCharCode,H=0;H<256;H++)F[H]=O(H)})(),t=x(L,P),r=x(Q,D),n=x(N,z),i=x(I,E),(function(){for(var O=1,H=2,W=1;W<=15;W++){for(var te=O;te<H;te++)h[32767+te]=W,d[32767+te]=[],d[32767+te][1]=W,d[32767+te][0]=te;for(var V=-(H-1);V<=-O;V++)h[32767+V]=W,d[32767+V]=[],d[32767+V][1]=W,d[32767+V][0]=H-1+V;O<<=1,H<<=1}})(),(function(){for(var O=0;O<256;O++)M[O]=19595*O,M[O+256|0]=38470*O,M[O+512|0]=7471*O+32768,M[O+768|0]=-11059*O,M[O+1024|0]=-21709*O,M[O+1280|0]=32768*O+8421375,M[O+1536|0]=-27439*O,M[O+1792|0]=-5329*O})(),U(e)}function Su(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 MU(e){function t(P){if(!P)throw Error("assert :P")}function r(P,N,z){for(var Q=0;4>Q;Q++)if(P[N+Q]!=z.charCodeAt(Q))return!0;return!1}function n(P,N,z,Q,D){for(var I=0;I<D;I++)P[N+I]=z[Q+I]}function i(P,N,z,Q){for(var D=0;D<Q;D++)P[N+D]=z}function o(P){return new Int32Array(P)}function a(P,N){for(var z=[],Q=0;Q<P;Q++)z.push(new N);return z}function s(P,N){var z=[];return(function Q(D,I,E){for(var x=E[I],_=0;_<x&&(D.push(E.length>I+1?[]:new N),!(E.length<I+1));_++)Q(D[_],I+1,E)})(z,0,P),z}var c=function(){var P=this;function N($,Z){for(var se=1<<Z-1>>>0;$&se;)se>>>=1;return se?($&se-1)+se:$}function z($,Z,se,de,ye){t(!(de%se));do $[Z+(de-=se)]=ye;while(0<de)}function Q($,Z,se,de,ye){if(t(2328>=ye),512>=ye)var xe=o(512);else if((xe=o(ye))==null)return 0;return(function(_e,Ce,Te,Le,Ge,ot){var Oe,We,Je=Ce,yt=1<<Te,tt=o(16),bt=o(16);for(t(Ge!=0),t(Le!=null),t(_e!=null),t(0<Te),We=0;We<Ge;++We){if(15<Le[We])return 0;++tt[Le[We]]}if(tt[0]==Ge)return 0;for(bt[1]=0,Oe=1;15>Oe;++Oe){if(tt[Oe]>1<<Oe)return 0;bt[Oe+1]=bt[Oe]+tt[Oe]}for(We=0;We<Ge;++We)Oe=Le[We],0<Le[We]&&(ot[bt[Oe]++]=We);if(bt[15]==1)return(Le=new D).g=0,Le.value=ot[0],z(_e,Je,1,yt,Le),yt;var _t,Nt=-1,Bt=yt-1,yr=0,lr=1,Zr=1,Ar=1<<Te;for(We=0,Oe=1,Ge=2;Oe<=Te;++Oe,Ge<<=1){if(lr+=Zr<<=1,0>(Zr-=tt[Oe]))return 0;for(;0<tt[Oe];--tt[Oe])(Le=new D).g=Oe,Le.value=ot[We++],z(_e,Je+yr,Ge,Ar,Le),yr=N(yr,Oe)}for(Oe=Te+1,Ge=2;15>=Oe;++Oe,Ge<<=1){if(lr+=Zr<<=1,0>(Zr-=tt[Oe]))return 0;for(;0<tt[Oe];--tt[Oe]){if(Le=new D,(yr&Bt)!=Nt){for(Je+=Ar,_t=1<<(Nt=Oe)-Te;15>Nt&&!(0>=(_t-=tt[Nt]));)++Nt,_t<<=1;yt+=Ar=1<<(_t=Nt-Te),_e[Ce+(Nt=yr&Bt)].g=_t+Te,_e[Ce+Nt].value=Je-Ce-Nt}Le.g=Oe-Te,Le.value=ot[We++],z(_e,Je+(yr>>Te),Ge,Ar,Le),yr=N(yr,Oe)}}return lr!=2*bt[15]-1?0:yt})($,Z,se,de,ye,xe)}function D(){this.value=this.g=0}function I(){this.value=this.g=0}function E(){this.G=a(5,D),this.H=o(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=a(Zu,I)}function x($,Z,se,de){t($!=null),t(Z!=null),t(2147483648>de),$.Ca=254,$.I=0,$.b=-8,$.Ka=0,$.oa=Z,$.pa=se,$.Jd=Z,$.Yc=se+de,$.Zc=4<=de?se+de-4+1:se,G($)}function _($,Z){for(var se=0;0<Z--;)se|=X($,128)<<Z;return se}function S($,Z){var se=_($,Z);return q($)?-se:se}function B($,Z,se,de){var ye,xe=0;for(t($!=null),t(Z!=null),t(4294967288>de),$.Sb=de,$.Ra=0,$.u=0,$.h=0,4<de&&(de=4),ye=0;ye<de;++ye)xe+=Z[se+ye]<<8*ye;$.Ra=xe,$.bb=de,$.oa=Z,$.pa=se}function T($){for(;8<=$.u&&$.bb<$.Sb;)$.Ra>>>=8,$.Ra+=$.oa[$.pa+$.bb]<<bc-8>>>0,++$.bb,$.u-=8;te($)&&($.h=1,$.u=0)}function U($,Z){if(t(0<=Z),!$.h&&Z<=rs){var se=W($)&gs[Z];return $.u+=Z,T($),se}return $.h=1,$.u=0}function O(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function H(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function W($){return $.Ra>>>($.u&bc-1)>>>0}function te($){return t($.bb<=$.Sb),$.h||$.bb==$.Sb&&$.u>bc}function V($,Z){$.u=Z,$.h=te($)}function ee($){$.u>=yc&&(t($.u>=yc),T($))}function G($){t($!=null&&$.oa!=null),$.pa<$.Zc?($.I=($.oa[$.pa++]|$.I<<8)>>>0,$.b+=8):(t($!=null&&$.oa!=null),$.pa<$.Yc?($.b+=8,$.I=$.oa[$.pa++]|$.I<<8):$.Ka?$.b=0:($.I<<=8,$.b+=8,$.Ka=1))}function q($){return _($,1)}function X($,Z){var se=$.Ca;0>$.b&&G($);var de=$.b,ye=se*Z>>>8,xe=($.I>>>de>ye)+0;for(xe?(se-=ye,$.I-=ye+1<<de>>>0):se=ye+1,de=se,ye=0;256<=de;)ye+=8,de>>=8;return de=7^ye+du[de],$.b-=de,$.Ca=(se<<de)-1,xe}function ce($,Z,se){$[Z+0]=se>>24&255,$[Z+1]=se>>16&255,$[Z+2]=se>>8&255,$[Z+3]=255&se}function fe($,Z){return $[Z+0]|$[Z+1]<<8}function ie($,Z){return fe($,Z)|$[Z+2]<<16}function le($,Z){return fe($,Z)|fe($,Z+2)<<16}function re($,Z){var se=1<<Z;return t($!=null),t(0<Z),$.X=o(se),$.X==null?0:($.Mb=32-Z,$.Xa=Z,1)}function Ae($,Z){t($!=null),t(Z!=null),t($.Xa==Z.Xa),n(Z.X,0,$.X,0,1<<Z.Xa)}function ue(){this.X=[],this.Xa=this.Mb=0}function me($,Z,se,de){t(se!=null),t(de!=null);var ye=se[0],xe=de[0];return ye==0&&(ye=($*xe+Z/2)/Z),xe==0&&(xe=(Z*ye+$/2)/$),0>=ye||0>=xe?0:(se[0]=ye,de[0]=xe,1)}function ge($,Z){return $+(1<<Z)-1>>>Z}function Ee($,Z){return((4278255360&$)+(4278255360&Z)>>>0&4278255360)+((16711935&$)+(16711935&Z)>>>0&16711935)>>>0}function ve($,Z){P[Z]=function(se,de,ye,xe,_e,Ce,Te){var Le;for(Le=0;Le<_e;++Le){var Ge=P[$](Ce[Te+Le-1],ye,xe+Le);Ce[Te+Le]=Ee(se[de+Le],Ge)}}}function Me(){this.ud=this.hd=this.jd=0}function Be($,Z){return((4278124286&($^Z))>>>1)+($&Z)>>>0}function we($){return 0<=$&&256>$?$:0>$?0:255<$?255:void 0}function Ne($,Z){return we($+($-Z+.5>>1))}function pe($,Z,se){return Math.abs(Z-se)-Math.abs($-se)}function Fe($,Z,se,de,ye,xe,_e){for(de=xe[_e-1],se=0;se<ye;++se)xe[_e+se]=de=Ee($[Z+se],de)}function ke($,Z,se,de,ye){var xe;for(xe=0;xe<se;++xe){var _e=$[Z+xe],Ce=_e>>8&255,Te=16711935&(Te=(Te=16711935&_e)+((Ce<<16)+Ce));de[ye+xe]=(4278255360&_e)+Te>>>0}}function Ie($,Z){Z.jd=255&$,Z.hd=$>>8&255,Z.ud=$>>16&255}function Ke($,Z,se,de,ye,xe){var _e;for(_e=0;_e<de;++_e){var Ce=Z[se+_e],Te=Ce>>>8,Le=Ce,Ge=255&(Ge=(Ge=Ce>>>16)+(($.jd<<24>>24)*(Te<<24>>24)>>>5));Le=255&(Le=(Le+=($.hd<<24>>24)*(Te<<24>>24)>>>5)+(($.ud<<24>>24)*(Ge<<24>>24)>>>5)),ye[xe+_e]=(4278255360&Ce)+(Ge<<16)+Le}}function et($,Z,se,de,ye){P[Z]=function(xe,_e,Ce,Te,Le,Ge,ot,Oe,We){for(Te=ot;Te<Oe;++Te)for(ot=0;ot<We;++ot)Le[Ge++]=ye(Ce[de(xe[_e++])])},P[$]=function(xe,_e,Ce,Te,Le,Ge,ot){var Oe=8>>xe.b,We=xe.Ea,Je=xe.K[0],yt=xe.w;if(8>Oe)for(xe=(1<<xe.b)-1,yt=(1<<Oe)-1;_e<Ce;++_e){var tt,bt=0;for(tt=0;tt<We;++tt)tt&xe||(bt=de(Te[Le++])),Ge[ot++]=ye(Je[bt&yt]),bt>>=Oe}else P["VP8LMapColor"+se](Te,Le,Je,yt,Ge,ot,_e,Ce,We)}}function Et($,Z,se,de,ye){for(se=Z+se;Z<se;){var xe=$[Z++];de[ye++]=xe>>16&255,de[ye++]=xe>>8&255,de[ye++]=255&xe}}function pt($,Z,se,de,ye){for(se=Z+se;Z<se;){var xe=$[Z++];de[ye++]=xe>>16&255,de[ye++]=xe>>8&255,de[ye++]=255&xe,de[ye++]=xe>>24&255}}function at($,Z,se,de,ye){for(se=Z+se;Z<se;){var xe=(_e=$[Z++])>>16&240|_e>>12&15,_e=240&_e|_e>>28&15;de[ye++]=xe,de[ye++]=_e}}function rt($,Z,se,de,ye){for(se=Z+se;Z<se;){var xe=(_e=$[Z++])>>16&248|_e>>13&7,_e=_e>>5&224|_e>>3&31;de[ye++]=xe,de[ye++]=_e}}function wt($,Z,se,de,ye){for(se=Z+se;Z<se;){var xe=$[Z++];de[ye++]=255&xe,de[ye++]=xe>>8&255,de[ye++]=xe>>16&255}}function ht($,Z,se,de,ye,xe){if(xe==0)for(se=Z+se;Z<se;)ce(de,((xe=$[Z++])[0]>>24|xe[1]>>8&65280|xe[2]<<8&16711680|xe[3]<<24)>>>0),ye+=32;else n(de,ye,$,Z,se)}function $t($,Z){P[Z][0]=P[$+"0"],P[Z][1]=P[$+"1"],P[Z][2]=P[$+"2"],P[Z][3]=P[$+"3"],P[Z][4]=P[$+"4"],P[Z][5]=P[$+"5"],P[Z][6]=P[$+"6"],P[Z][7]=P[$+"7"],P[Z][8]=P[$+"8"],P[Z][9]=P[$+"9"],P[Z][10]=P[$+"10"],P[Z][11]=P[$+"11"],P[Z][12]=P[$+"12"],P[Z][13]=P[$+"13"],P[Z][14]=P[$+"0"],P[Z][15]=P[$+"0"]}function qt($){return $==eA||$==Bg||$==Sh||$==Eg}function It(){this.eb=[],this.size=this.A=this.fb=0}function gr(){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 Gt(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new It,this.f.kb=new gr,this.sd=null}function Tt(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function hr(){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 Wr($){return alert("todo:WebPSamplerProcessPlane"),$.T}function nr($,Z){var se=$.T,de=Z.ba.f.RGBA,ye=de.eb,xe=de.fb+$.ka*de.A,_e=Sa[Z.ba.S],Ce=$.y,Te=$.O,Le=$.f,Ge=$.N,ot=$.ea,Oe=$.W,We=Z.cc,Je=Z.dc,yt=Z.Mc,tt=Z.Nc,bt=$.ka,_t=$.ka+$.T,Nt=$.U,Bt=Nt+1>>1;for(bt==0?_e(Ce,Te,null,null,Le,Ge,ot,Oe,Le,Ge,ot,Oe,ye,xe,null,null,Nt):(_e(Z.ec,Z.fc,Ce,Te,We,Je,yt,tt,Le,Ge,ot,Oe,ye,xe-de.A,ye,xe,Nt),++se);bt+2<_t;bt+=2)We=Le,Je=Ge,yt=ot,tt=Oe,Ge+=$.Rc,Oe+=$.Rc,xe+=2*de.A,_e(Ce,(Te+=2*$.fa)-$.fa,Ce,Te,We,Je,yt,tt,Le,Ge,ot,Oe,ye,xe-de.A,ye,xe,Nt);return Te+=$.fa,$.j+_t<$.o?(n(Z.ec,Z.fc,Ce,Te,Nt),n(Z.cc,Z.dc,Le,Ge,Bt),n(Z.Mc,Z.Nc,ot,Oe,Bt),se--):1&_t||_e(Ce,Te,null,null,Le,Ge,ot,Oe,Le,Ge,ot,Oe,ye,xe+de.A,null,null,Nt),se}function Kr($,Z,se){var de=$.F,ye=[$.J];if(de!=null){var xe=$.U,_e=Z.ba.S,Ce=_e==Jp||_e==Sh;Z=Z.ba.f.RGBA;var Te=[0],Le=$.ka;Te[0]=$.T,$.Kb&&(Le==0?--Te[0]:(--Le,ye[0]-=$.width),$.j+$.ka+$.T==$.o&&(Te[0]=$.o-$.j-Le));var Ge=Z.eb;Le=Z.fb+Le*Z.A,$=Wp(de,ye[0],$.width,xe,Te,Ge,Le+(Ce?0:3),Z.A),t(se==Te),$&&qt(_e)&&af(Ge,Le,Ce,xe,Te,Z.A)}return 0}function nn($){var Z=$.ma,se=Z.ba.S,de=11>se,ye=se==Na||se==il||se==Jp||se==_h||se==12||qt(se);if(Z.memory=null,Z.Ib=null,Z.Jb=null,Z.Nd=null,!uu(Z.Oa,$,ye?11:12))return 0;if(ye&&qt(se)&&Kp(),$.da)alert("todo:use_scaling");else{if(de){if(Z.Ib=Wr,$.Kb){if(se=$.U+1>>1,Z.memory=o($.U+2*se),Z.memory==null)return 0;Z.ec=Z.memory,Z.fc=0,Z.cc=Z.ec,Z.dc=Z.fc+$.U,Z.Mc=Z.cc,Z.Nc=Z.dc+se,Z.Ib=nr,Kp()}}else alert("todo:EmitYUV");ye&&(Z.Jb=Kr,de&&jl())}if(de&&!od){for($=0;256>$;++$)ka[$]=89858*($-128)+Bh>>ul,b3[$]=-22014*($-128)+Bh,Ov[$]=-45773*($-128),Ig[$]=113618*($-128)+Bh>>ul;for($=uf;$<id;++$)Z=76283*($-16)+Bh>>ul,y3[$-uf]=an(Z,255),v3[$-uf]=an(Z+8>>4,15);od=1}return 1}function Ft($){var Z=$.ma,se=$.U,de=$.T;return t(!(1&$.ka)),0>=se||0>=de?0:(se=Z.Ib($,Z),Z.Jb!=null&&Z.Jb($,Z,se),Z.Dc+=se,1)}function on($){$.ma.memory=null}function un($,Z,se,de){return U($,8)!=47?0:(Z[0]=U($,14)+1,se[0]=U($,14)+1,de[0]=U($,1),U($,3)!=0?0:!$.h)}function xr($,Z){if(4>$)return $+1;var se=$-2>>1;return(2+(1&$)<<se)+U(Z,se)+1}function Qe($,Z){return 120<Z?Z-120:1<=(se=((se=al[Z-1])>>4)*$+(8-(15&se)))?se:1;var se}function $e($,Z,se){var de=W(se),ye=$[Z+=255&de].g-8;return 0<ye&&(V(se,se.u+8),de=W(se),Z+=$[Z].value,Z+=de&(1<<ye)-1),V(se,se.u+$[Z].g),$[Z].value}function ut($,Z,se){return se.g+=$.g,se.value+=$.value<<Z>>>0,t(8>=se.g),$.g}function Ot($,Z,se){var de=$.xc;return t((Z=de==0?0:$.vc[$.md*(se>>de)+(Z>>de)])<$.Wb),$.Ya[Z]}function pr($,Z,se,de){var ye=$.ab,xe=$.c*Z,_e=$.C;Z=_e+Z;var Ce=se,Te=de;for(de=$.Ta,se=$.Ua;0<ye--;){var Le=$.gc[ye],Ge=_e,ot=Z,Oe=Ce,We=Te,Je=(Te=de,Ce=se,Le.Ea);switch(t(Ge<ot),t(ot<=Le.nc),Le.hc){case 2:Bo(Oe,We,(ot-Ge)*Je,Te,Ce);break;case 0:var yt=Ge,tt=ot,bt=Te,_t=Ce,Nt=(Ar=Le).Ea;yt==0&&(yh(Oe,We,null,null,1,bt,_t),Fe(Oe,We+1,0,0,Nt-1,bt,_t+1),We+=Nt,_t+=Nt,++yt);for(var Bt=1<<Ar.b,yr=Bt-1,lr=ge(Nt,Ar.b),Zr=Ar.K,Ar=Ar.w+(yt>>Ar.b)*lr;yt<tt;){var Fn=Zr,$i=Ar,hn=1;for(vh(Oe,We,bt,_t-Nt,1,bt,_t);hn<Nt;){var cr=(hn&~yr)+Bt;cr>Nt&&(cr=Nt),(0,fu[Fn[$i++]>>8&15])(Oe,We+ +hn,bt,_t+hn-Nt,cr-hn,bt,_t+hn),hn=cr}We+=Nt,_t+=Nt,++yt&yr||(Ar+=lr)}ot!=Le.nc&&n(Te,Ce-Je,Te,Ce+(ot-Ge-1)*Je,Je);break;case 1:for(Je=Oe,tt=We,Nt=(Oe=Le.Ea)-(_t=Oe&~(bt=(We=1<<Le.b)-1)),yt=ge(Oe,Le.b),Bt=Le.K,Le=Le.w+(Ge>>Le.b)*yt;Ge<ot;){for(yr=Bt,lr=Le,Zr=new Me,Ar=tt+_t,Fn=tt+Oe;tt<Ar;)Ie(yr[lr++],Zr),wh(Zr,Je,tt,We,Te,Ce),tt+=We,Ce+=We;tt<Fn&&(Ie(yr[lr++],Zr),wh(Zr,Je,tt,Nt,Te,Ce),tt+=Nt,Ce+=Nt),++Ge&bt||(Le+=yt)}break;case 3:if(Oe==Te&&We==Ce&&0<Le.b){for(tt=Te,Oe=Je=Ce+(ot-Ge)*Je-(_t=(ot-Ge)*ge(Le.Ea,Le.b)),We=Te,bt=Ce,yt=[],_t=(Nt=_t)-1;0<=_t;--_t)yt[_t]=We[bt+_t];for(_t=Nt-1;0<=_t;--_t)tt[Oe+_t]=yt[_t];xg(Le,Ge,ot,Te,Je,Te,Ce)}else xg(Le,Ge,ot,Oe,We,Te,Ce)}Ce=de,Te=se}Te!=se&&n(de,se,Ce,Te,xe)}function Pt($,Z){var se=$.V,de=$.Ba+$.c*$.C,ye=Z-$.C;if(t(Z<=$.l.o),t(16>=ye),0<ye){var xe=$.l,_e=$.Ta,Ce=$.Ua,Te=xe.width;if(pr($,ye,se,de),ye=Ce=[Ce],t((se=$.C)<(de=Z)),t(xe.v<xe.va),de>xe.o&&(de=xe.o),se<xe.j){var Le=xe.j-se;se=xe.j,ye[0]+=Le*Te}if(se>=de?se=0:(ye[0]+=4*xe.v,xe.ka=se-xe.j,xe.U=xe.va-xe.v,xe.T=de-se,se=1),se){if(Ce=Ce[0],11>(se=$.ca).S){var Ge=se.f.RGBA,ot=(de=se.S,ye=xe.U,xe=xe.T,Le=Ge.eb,Ge.A),Oe=xe;for(Ge=Ge.fb+$.Ma*Ge.A;0<Oe--;){var We=_e,Je=Ce,yt=ye,tt=Le,bt=Ge;switch(de){case kg:xh(We,Je,yt,tt,bt);break;case Na:hu(We,Je,yt,tt,bt);break;case eA:hu(We,Je,yt,tt,bt),af(tt,bt,0,yt,1,0);break;case Cg:nf(We,Je,yt,tt,bt);break;case il:ht(We,Je,yt,tt,bt,1);break;case Bg:ht(We,Je,yt,tt,bt,1),af(tt,bt,0,yt,1,0);break;case Jp:ht(We,Je,yt,tt,bt,0);break;case Sh:ht(We,Je,yt,tt,bt,0),af(tt,bt,1,yt,1,0);break;case _h:pu(We,Je,yt,tt,bt);break;case Eg:pu(We,Je,yt,tt,bt),nl(tt,bt,yt,1,0);break;case Ju:xc(We,Je,yt,tt,bt);break;default:t(0)}Ce+=Te,Ge+=ot}$.Ma+=xe}else alert("todo:EmitRescaledRowsYUVA");t($.Ma<=se.height)}}$.C=Z,t($.C<=$.i)}function Jt($){var Z;if(0<$.ua)return 0;for(Z=0;Z<$.Wb;++Z){var se=$.Ya[Z].G,de=$.Ya[Z].H;if(0<se[1][de[1]+0].g||0<se[2][de[2]+0].g||0<se[3][de[3]+0].g)return 0}return 1}function Zt($,Z,se,de,ye,xe){if($.Z!=0){var _e=$.qd,Ce=$.rd;for(t(mu[$.Z]!=null);Z<se;++Z)mu[$.Z](_e,Ce,de,ye,de,ye,xe),_e=de,Ce=ye,ye+=xe;$.qd=_e,$.rd=Ce}}function er($,Z){var se=$.l.ma,de=se.Z==0||se.Z==1?$.l.j:$.C;if(de=$.C<de?de:$.C,t(Z<=$.l.o),Z>de){var ye=$.l.width,xe=se.ca,_e=se.tb+ye*de,Ce=$.V,Te=$.Ba+$.c*de,Le=$.gc;t($.ab==1),t(Le[0].hc==3),wc(Le[0],de,Z,Ce,Te,xe,_e),Zt(se,de,Z,xe,_e,ye)}$.C=$.Ma=Z}function nt($,Z,se,de,ye,xe,_e){var Ce=$.$/de,Te=$.$%de,Le=$.m,Ge=$.s,ot=se+$.$,Oe=ot;ye=se+de*ye;var We=se+de*xe,Je=280+Ge.ua,yt=$.Pb?Ce:16777216,tt=0<Ge.ua?Ge.Wa:null,bt=Ge.wc,_t=ot<We?Ot(Ge,Te,Ce):null;t($.C<xe),t(We<=ye);var Nt=!1;e:for(;;){for(;Nt||ot<We;){var Bt=0;if(Ce>=yt){var yr=ot-se;t((yt=$).Pb),yt.wd=yt.m,yt.xd=yr,0<yt.s.ua&&Ae(yt.s.Wa,yt.s.vb),yt=Ce+ed}if(Te&bt||(_t=Ot(Ge,Te,Ce)),t(_t!=null),_t.Qb&&(Z[ot]=_t.qb,Nt=!0),!Nt)if(ee(Le),_t.jc){Bt=Le,yr=Z;var lr=ot,Zr=_t.pd[W(Bt)&Zu-1];t(_t.jc),256>Zr.g?(V(Bt,Bt.u+Zr.g),yr[lr]=Zr.value,Bt=0):(V(Bt,Bt.u+Zr.g-256),t(256<=Zr.value),Bt=Zr.value),Bt==0&&(Nt=!0)}else Bt=$e(_t.G[0],_t.H[0],Le);if(Le.h)break;if(Nt||256>Bt){if(!Nt)if(_t.nd)Z[ot]=(_t.qb|Bt<<8)>>>0;else{if(ee(Le),Nt=$e(_t.G[1],_t.H[1],Le),ee(Le),yr=$e(_t.G[2],_t.H[2],Le),lr=$e(_t.G[3],_t.H[3],Le),Le.h)break;Z[ot]=(lr<<24|Nt<<16|Bt<<8|yr)>>>0}if(Nt=!1,++ot,++Te>=de&&(Te=0,++Ce,_e!=null&&Ce<=xe&&!(Ce%16)&&_e($,Ce),tt!=null))for(;Oe<ot;)Bt=Z[Oe++],tt.X[(506832829*Bt&4294967295)>>>tt.Mb]=Bt}else if(280>Bt){if(Bt=xr(Bt-256,Le),yr=$e(_t.G[4],_t.H[4],Le),ee(Le),yr=Qe(de,yr=xr(yr,Le)),Le.h)break;if(ot-se<yr||ye-ot<Bt)break e;for(lr=0;lr<Bt;++lr)Z[ot+lr]=Z[ot+lr-yr];for(ot+=Bt,Te+=Bt;Te>=de;)Te-=de,++Ce,_e!=null&&Ce<=xe&&!(Ce%16)&&_e($,Ce);if(t(ot<=ye),Te&bt&&(_t=Ot(Ge,Te,Ce)),tt!=null)for(;Oe<ot;)Bt=Z[Oe++],tt.X[(506832829*Bt&4294967295)>>>tt.Mb]=Bt}else{if(!(Bt<Je))break e;for(Nt=Bt-280,t(tt!=null);Oe<ot;)Bt=Z[Oe++],tt.X[(506832829*Bt&4294967295)>>>tt.Mb]=Bt;Bt=ot,t(!(Nt>>>(yr=tt).Xa)),Z[Bt]=yr.X[Nt],Nt=!0}Nt||t(Le.h==te(Le))}if($.Pb&&Le.h&&ot<ye)t($.m.h),$.a=5,$.m=$.wd,$.$=$.xd,0<$.s.ua&&Ae($.s.vb,$.s.Wa);else{if(Le.h)break e;_e?.($,Ce>xe?xe:Ce),$.a=0,$.$=ot-se}return 1}return $.a=3,0}function kt($){t($!=null),$.vc=null,$.yc=null,$.Ya=null;var Z=$.Wa;Z!=null&&(Z.X=null),$.vb=null,t($!=null)}function rr(){var $=new Vr;return $==null?null:($.a=0,$.xb=ob,$t("Predictor","VP8LPredictors"),$t("Predictor","VP8LPredictors_C"),$t("PredictorAdd","VP8LPredictorsAdd"),$t("PredictorAdd","VP8LPredictorsAdd_C"),Bo=ke,wh=Ke,xh=Et,hu=pt,pu=at,xc=rt,nf=wt,P.VP8LMapColor32b=vc,P.VP8LMapColor8b=wa,$)}function mn($,Z,se,de,ye){var xe=1,_e=[$],Ce=[Z],Te=de.m,Le=de.s,Ge=null,ot=0;e:for(;;){if(se)for(;xe&&U(Te,1);){var Oe=_e,We=Ce,Je=de,yt=1,tt=Je.m,bt=Je.gc[Je.ab],_t=U(tt,2);if(Je.Oc&1<<_t)xe=0;else{switch(Je.Oc|=1<<_t,bt.hc=_t,bt.Ea=Oe[0],bt.nc=We[0],bt.K=[null],++Je.ab,t(4>=Je.ab),_t){case 0:case 1:bt.b=U(tt,3)+2,yt=mn(ge(bt.Ea,bt.b),ge(bt.nc,bt.b),0,Je,bt.K),bt.K=bt.K[0];break;case 3:var Nt,Bt=U(tt,8)+1,yr=16<Bt?0:4<Bt?1:2<Bt?2:3;if(Oe[0]=ge(bt.Ea,yr),bt.b=yr,Nt=yt=mn(Bt,1,0,Je,bt.K)){var lr,Zr=Bt,Ar=bt,Fn=1<<(8>>Ar.b),$i=o(Fn);if($i==null)Nt=0;else{var hn=Ar.K[0],cr=Ar.w;for($i[0]=Ar.K[0][0],lr=1;lr<1*Zr;++lr)$i[lr]=Ee(hn[cr+lr],$i[lr-1]);for(;lr<4*Fn;++lr)$i[lr]=0;Ar.K[0]=null,Ar.K[0]=$i,Nt=1}}yt=Nt;break;case 2:break;default:t(0)}xe=yt}}if(_e=_e[0],Ce=Ce[0],xe&&U(Te,1)&&!(xe=1<=(ot=U(Te,4))&&11>=ot)){de.a=3;break e}var Vt;if(Vt=xe)t:{var so,jr,yn,hi=de,Zo=_e,Ca=Ce,Ni=ot,Po=se,Ua=hi.m,jo=hi.s,En=[null],Wn=1,lo=0,ii=sl[Ni];r:for(;;){if(Po&&U(Ua,1)){var Jo=U(Ua,3)+2,co=ge(Zo,Jo),Yn=ge(Ca,Jo),To=co*Yn;if(!mn(co,Yn,0,hi,En))break r;for(En=En[0],jo.xc=Jo,so=0;so<To;++so){var pi=En[so]>>8&65535;En[so]=pi,pi>=Wn&&(Wn=pi+1)}}if(Ua.h)break r;for(jr=0;5>jr;++jr){var No=lf[jr];!jr&&0<Ni&&(No+=1<<Ni),lo<No&&(lo=No)}var Uo=a(Wn*ii,D),Ci=Wn,qn=a(Ci,E);if(qn==null)var Qa=null;else t(65536>=Ci),Qa=qn;var mo=o(lo);if(Qa==null||mo==null||Uo==null){hi.a=1;break r}var Ir=Uo;for(so=yn=0;so<Wn;++so){var Rr=Qa[so],Xn=Rr.G,ms=Rr.H,dl=0,is=1,Qo=0;for(jr=0;5>jr;++jr){No=lf[jr],Xn[jr]=Ir,ms[jr]=yn,!jr&&0<Ni&&(No+=1<<Ni);i:{var ad,sd=No,Og=hi,Ui=mo,sb=Ir,lb=yn,Lg=0,bu=Og.m,w3=U(bu,1);if(i(Ui,0,0,sd),w3){var cb=U(bu,1)+1,ub=U(bu,1),Pg=U(bu,ub==0?1:8);Ui[Pg]=1,cb==2&&(Ui[Pg=U(bu,8)]=1);var ca=1}else{var bo=o(19),iA=U(bu,4)+4;if(19<iA){Og.a=3;var ld=0;break i}for(ad=0;ad<iA;++ad)bo[tA[ad]]=U(bu,3);var Mh=void 0,df=void 0,kc=Og,jg=bo,Th=sd,Ng=Ui,Ug=0,yu=kc.m,db=8,fb=a(128,D);n:for(;Q(fb,0,7,jg,19);){if(U(yu,1)){var Lv=2+2*U(yu,3);if((Mh=2+U(yu,Lv))>Th)break n}else Mh=Th;for(df=0;df<Th&&Mh--;){ee(yu);var hb=fb[0+(127&W(yu))];V(yu,yu.u+hb.g);var cd=hb.value;if(16>cd)Ng[df++]=cd,cd!=0&&(db=cd);else{var Pv=cd==16,jv=cd-16,Nv=kh[jv],pb=U(yu,ol[jv])+Nv;if(df+pb>Th)break n;for(var Uv=Pv?db:0;0<pb--;)Ng[df++]=Uv}}Ug=1;break n}Ug||(kc.a=3),ca=Ug}(ca=ca&&!bu.h)&&(Lg=Q(sb,lb,8,Ui,sd)),ca&&Lg!=0?ld=Lg:(Og.a=3,ld=0)}if(ld==0)break r;if(is&&Mg[jr]==1&&(is=Ir[yn].g==0),dl+=Ir[yn].g,yn+=ld,3>=jr){var ff,Qg=mo[0];for(ff=1;ff<No;++ff)mo[ff]>Qg&&(Qg=mo[ff]);Qo+=Qg}}if(Rr.nd=is,Rr.Qb=0,is&&(Rr.qb=(Xn[3][ms[3]+0].value<<24|Xn[1][ms[1]+0].value<<16|Xn[2][ms[2]+0].value)>>>0,dl==0&&256>Xn[0][ms[0]+0].value&&(Rr.Qb=1,Rr.qb+=Xn[0][ms[0]+0].value<<8)),Rr.jc=!Rr.Qb&&6>Qo,Rr.jc){var oA,Cc=Rr;for(oA=0;oA<Zu;++oA){var vu=oA,wu=Cc.pd[vu],Hg=Cc.G[0][Cc.H[0]+vu];256<=Hg.value?(wu.g=Hg.g+256,wu.value=Hg.value):(wu.g=0,wu.value=0,vu>>=ut(Hg,8,wu),vu>>=ut(Cc.G[1][Cc.H[1]+vu],16,wu),vu>>=ut(Cc.G[2][Cc.H[2]+vu],0,wu),ut(Cc.G[3][Cc.H[3]+vu],24,wu))}}}jo.vc=En,jo.Wb=Wn,jo.Ya=Qa,jo.yc=Uo,Vt=1;break t}Vt=0}if(!(xe=Vt)){de.a=3;break e}if(0<ot){if(Le.ua=1<<ot,!re(Le.Wa,ot)){de.a=1,xe=0;break e}}else Le.ua=0;var zg=de,hf=_e,Qv=Ce,Fh=zg.s,Dh=Fh.xc;if(zg.c=hf,zg.i=Qv,Fh.md=ge(hf,Dh),Fh.wc=Dh==0?-1:(1<<Dh)-1,se){de.xb=td;break e}if((Ge=o(_e*Ce))==null){de.a=1,xe=0;break e}xe=(xe=nt(de,Ge,0,_e,Ce,Ce,null))&&!Te.h;break e}return xe?(ye!=null?ye[0]=Ge:(t(Ge==null),t(se)),de.$=0,se||kt(Le)):kt(Le),xe}function _n($,Z){var se=$.c*$.i,de=se+Z+16*Z;return t($.c<=Z),$.V=o(de),$.V==null?($.Ta=null,$.Ua=0,$.a=1,0):($.Ta=$.V,$.Ua=$.Ba+se+Z,1)}function vi($,Z){var se=$.C,de=Z-se,ye=$.V,xe=$.Ba+$.c*se;for(t(Z<=$.l.o);0<de;){var _e=16<de?16:de,Ce=$.l.ma,Te=$.l.width,Le=Te*_e,Ge=Ce.ca,ot=Ce.tb+Te*se,Oe=$.Ta,We=$.Ua;pr($,_e,ye,xe),Ns(Oe,We,Ge,ot,Le),Zt(Ce,se,se+_e,Ge,ot,Te),de-=_e,ye+=_e*$.c,se+=_e}t(se==Z),$.C=$.Ma=Z}function ri(){this.ub=this.yd=this.td=this.Rb=0}function Ri(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Re(){this.Fb=this.Bb=this.Cb=0,this.Zb=o(4),this.Lb=o(4)}function Ze(){this.Yb=(function(){var $=[];return(function Z(se,de,ye){for(var xe=ye[de],_e=0;_e<xe&&(se.push(ye.length>de+1?[]:0),!(ye.length<de+1));_e++)Z(se[_e],de+1,ye)})($,0,[3,11]),$})()}function mt(){this.jb=o(3),this.Wc=s([4,8],Ze),this.Xc=s([4,17],Ze)}function Rt(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new o(4),this.od=new o(4)}function tr(){this.ld=this.La=this.dd=this.tc=0}function jt(){this.Na=this.la=0}function Ut(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function dn(){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 Gr(){this.uc=this.M=this.Nb=0,this.wa=Array(new tr),this.Y=0,this.ya=Array(new dn),this.aa=0,this.l=new Sn}function Xr(){this.y=o(16),this.f=o(8),this.ea=o(8)}function Br(){this.cb=this.a=0,this.sc="",this.m=new O,this.Od=new ri,this.Kc=new Ri,this.ed=new Rt,this.Qa=new Re,this.Ic=this.$c=this.Aa=0,this.D=new Gr,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=a(8,O),this.ia=0,this.pb=a(4,Ut),this.Pa=new mt,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Xr),this.Hd=0,this.rb=Array(new jt),this.sb=0,this.wa=Array(new tr),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 dn),this.L=this.aa=0,this.gd=s([4,2],tr),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 an($,Z){return 0>$?0:$>Z?Z:$}function Sn(){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 bn(){var $=new Br;return $!=null&&($.a=0,$.sc="OK",$.cb=0,$.Xb=0,Us||(Us=Ro)),$}function Mr($,Z,se){return $.a==0&&($.a=Z,$.sc=se,$.cb=0),0}function Ji($,Z,se){return 3<=se&&$[Z+0]==157&&$[Z+1]==1&&$[Z+2]==42}function Oi($,Z){if($==null)return 0;if($.a=0,$.sc="OK",Z==null)return Mr($,2,"null VP8Io passed to VP8GetHeaders()");var se=Z.data,de=Z.w,ye=Z.ha;if(4>ye)return Mr($,7,"Truncated header.");var xe=se[de+0]|se[de+1]<<8|se[de+2]<<16,_e=$.Od;if(_e.Rb=!(1&xe),_e.td=xe>>1&7,_e.yd=xe>>4&1,_e.ub=xe>>5,3<_e.td)return Mr($,3,"Incorrect keyframe parameters.");if(!_e.yd)return Mr($,4,"Frame not displayable.");de+=3,ye-=3;var Ce=$.Kc;if(_e.Rb){if(7>ye)return Mr($,7,"cannot parse picture header");if(!Ji(se,de,ye))return Mr($,3,"Bad code word");Ce.c=16383&(se[de+4]<<8|se[de+3]),Ce.Td=se[de+4]>>6,Ce.i=16383&(se[de+6]<<8|se[de+5]),Ce.Ud=se[de+6]>>6,de+=7,ye-=7,$.za=Ce.c+15>>4,$.Ub=Ce.i+15>>4,Z.width=Ce.c,Z.height=Ce.i,Z.Da=0,Z.j=0,Z.v=0,Z.va=Z.width,Z.o=Z.height,Z.da=0,Z.ib=Z.width,Z.hb=Z.height,Z.U=Z.width,Z.T=Z.height,i((xe=$.Pa).jb,0,255,xe.jb.length),t((xe=$.Qa)!=null),xe.Cb=0,xe.Bb=0,xe.Fb=1,i(xe.Zb,0,0,xe.Zb.length),i(xe.Lb,0,0,xe.Lb)}if(_e.ub>ye)return Mr($,7,"bad partition length");x(xe=$.m,se,de,_e.ub),de+=_e.ub,ye-=_e.ub,_e.Rb&&(Ce.Ld=q(xe),Ce.Kd=q(xe)),Ce=$.Qa;var Te,Le=$.Pa;if(t(xe!=null),t(Ce!=null),Ce.Cb=q(xe),Ce.Cb){if(Ce.Bb=q(xe),q(xe)){for(Ce.Fb=q(xe),Te=0;4>Te;++Te)Ce.Zb[Te]=q(xe)?S(xe,7):0;for(Te=0;4>Te;++Te)Ce.Lb[Te]=q(xe)?S(xe,6):0}if(Ce.Bb)for(Te=0;3>Te;++Te)Le.jb[Te]=q(xe)?_(xe,8):255}else Ce.Bb=0;if(xe.Ka)return Mr($,3,"cannot parse segment header");if((Ce=$.ed).zd=q(xe),Ce.Tb=_(xe,6),Ce.wb=_(xe,3),Ce.Pc=q(xe),Ce.Pc&&q(xe)){for(Le=0;4>Le;++Le)q(xe)&&(Ce.vd[Le]=S(xe,6));for(Le=0;4>Le;++Le)q(xe)&&(Ce.od[Le]=S(xe,6))}if($.L=Ce.Tb==0?0:Ce.zd?1:2,xe.Ka)return Mr($,3,"cannot parse filter header");var Ge=ye;if(ye=Te=de,de=Te+Ge,Ce=Ge,$.Xb=(1<<_($.m,2))-1,Ge<3*(Le=$.Xb))se=7;else{for(Te+=3*Le,Ce-=3*Le,Ge=0;Ge<Le;++Ge){var ot=se[ye+0]|se[ye+1]<<8|se[ye+2]<<16;ot>Ce&&(ot=Ce),x($.Jc[+Ge],se,Te,ot),Te+=ot,Ce-=ot,ye+=3}x($.Jc[+Le],se,Te,Ce),se=Te<de?0:5}if(se!=0)return Mr($,se,"cannot parse partitions");for(se=_(Te=$.m,7),ye=q(Te)?S(Te,4):0,de=q(Te)?S(Te,4):0,Ce=q(Te)?S(Te,4):0,Le=q(Te)?S(Te,4):0,Te=q(Te)?S(Te,4):0,Ge=$.Qa,ot=0;4>ot;++ot){if(Ge.Cb){var Oe=Ge.Zb[ot];Ge.Fb||(Oe+=se)}else{if(0<ot){$.pb[ot]=$.pb[0];continue}Oe=se}var We=$.pb[ot];We.Sc[0]=ll[an(Oe+ye,127)],We.Sc[1]=cl[an(Oe+0,127)],We.Eb[0]=2*ll[an(Oe+de,127)],We.Eb[1]=101581*cl[an(Oe+Ce,127)]>>16,8>We.Eb[1]&&(We.Eb[1]=8),We.Qc[0]=ll[an(Oe+Le,117)],We.Qc[1]=cl[an(Oe+Te,127)],We.lc=Oe+Te}if(!_e.Rb)return Mr($,4,"Not a key frame.");for(q(xe),_e=$.Pa,se=0;4>se;++se){for(ye=0;8>ye;++ye)for(de=0;3>de;++de)for(Ce=0;11>Ce;++Ce)Le=X(xe,Vi[se][ye][de][Ce])?_(xe,8):Rv[se][ye][de][Ce],_e.Wc[se][ye].Yb[de][Ce]=Le;for(ye=0;17>ye;++ye)_e.Xc[se][ye]=_e.Wc[se][In[ye]]}return $.kc=q(xe),$.kc&&($.Bd=_(xe,8)),$.cb=1}function Ro($,Z,se,de,ye,xe,_e){var Ce=Z[ye].Yb[se];for(se=0;16>ye;++ye){if(!X($,Ce[se+0]))return ye;for(;!X($,Ce[se+1]);)if(Ce=Z[++ye].Yb[0],se=0,ye==16)return 16;var Te=Z[ye+1].Yb;if(X($,Ce[se+2])){var Le=$,Ge=0;if(X(Le,(Oe=Ce)[(ot=se)+3]))if(X(Le,Oe[ot+6])){for(Ce=0,ot=2*(Ge=X(Le,Oe[ot+8]))+(Oe=X(Le,Oe[ot+9+Ge])),Ge=0,Oe=Iv[ot];Oe[Ce];++Ce)Ge+=Ge+X(Le,Oe[Ce]);Ge+=3+(8<<ot)}else X(Le,Oe[ot+7])?(Ge=7+2*X(Le,165),Ge+=X(Le,145)):Ge=5+X(Le,159);else Ge=X(Le,Oe[ot+4])?3+X(Le,Oe[ot+5]):2;Ce=Te[2]}else Ge=1,Ce=Te[1];Te=_e+ib[ye],0>(Le=$).b&&G(Le);var ot,Oe=Le.b,We=(ot=Le.Ca>>1)-(Le.I>>Oe)>>31;--Le.b,Le.Ca+=We,Le.Ca|=1,Le.I-=(ot+1&We)<<Oe,xe[Te]=((Ge^We)-We)*de[(0<ye)+0]}return 16}function Rs($){var Z=$.rb[$.sb-1];Z.la=0,Z.Na=0,i($.zc,0,0,$.zc.length),$.ja=0}function Ao($,Z,se,de,ye){ye=$[Z+se+32*de]+(ye>>3),$[Z+se+32*de]=-256&ye?0>ye?0:255:ye}function Li($,Z,se,de,ye,xe){Ao($,Z,0,se,de+ye),Ao($,Z,1,se,de+xe),Ao($,Z,2,se,de-xe),Ao($,Z,3,se,de-ye)}function ki($){return(20091*$>>16)+$}function Mn($,Z,se,de){var ye,xe=0,_e=o(16);for(ye=0;4>ye;++ye){var Ce=$[Z+0]+$[Z+8],Te=$[Z+0]-$[Z+8],Le=(35468*$[Z+4]>>16)-ki($[Z+12]),Ge=ki($[Z+4])+(35468*$[Z+12]>>16);_e[xe+0]=Ce+Ge,_e[xe+1]=Te+Le,_e[xe+2]=Te-Le,_e[xe+3]=Ce-Ge,xe+=4,Z++}for(ye=xe=0;4>ye;++ye)Ce=($=_e[xe+0]+4)+_e[xe+8],Te=$-_e[xe+8],Le=(35468*_e[xe+4]>>16)-ki(_e[xe+12]),Ao(se,de,0,0,Ce+(Ge=ki(_e[xe+4])+(35468*_e[xe+12]>>16))),Ao(se,de,1,0,Te+Le),Ao(se,de,2,0,Te-Le),Ao(se,de,3,0,Ce-Ge),xe++,de+=32}function kn($,Z,se,de){var ye=$[Z+0]+4,xe=35468*$[Z+4]>>16,_e=ki($[Z+4]),Ce=35468*$[Z+1]>>16;Li(se,de,0,ye+_e,$=ki($[Z+1]),Ce),Li(se,de,1,ye+xe,$,Ce),Li(se,de,2,ye-xe,$,Ce),Li(se,de,3,ye-_e,$,Ce)}function hs($,Z,se,de,ye){Mn($,Z,se,de),ye&&Mn($,Z+16,se,de+4)}function oo($,Z,se,de){Au($,Z+0,se,de,1),Au($,Z+32,se,de+128,1)}function fc($,Z,se,de){var ye;for($=$[Z+0]+4,ye=0;4>ye;++ye)for(Z=0;4>Z;++Z)Ao(se,de,Z,ye,$)}function Wo($,Z,se,de){$[Z+0]&&ni($,Z+0,se,de),$[Z+16]&&ni($,Z+16,se,de+4),$[Z+32]&&ni($,Z+32,se,de+128),$[Z+48]&&ni($,Z+48,se,de+128+4)}function Co($,Z,se,de){var ye,xe=o(16);for(ye=0;4>ye;++ye){var _e=$[Z+0+ye]+$[Z+12+ye],Ce=$[Z+4+ye]+$[Z+8+ye],Te=$[Z+4+ye]-$[Z+8+ye],Le=$[Z+0+ye]-$[Z+12+ye];xe[0+ye]=_e+Ce,xe[8+ye]=_e-Ce,xe[4+ye]=Le+Te,xe[12+ye]=Le-Te}for(ye=0;4>ye;++ye)_e=($=xe[0+4*ye]+3)+xe[3+4*ye],Ce=xe[1+4*ye]+xe[2+4*ye],Te=xe[1+4*ye]-xe[2+4*ye],Le=$-xe[3+4*ye],se[de+0]=_e+Ce>>3,se[de+16]=Le+Te>>3,se[de+32]=_e-Ce>>3,se[de+48]=Le-Te>>3,de+=64}function La($,Z,se){var de,ye=Z-32,xe=ja,_e=255-$[ye-1];for(de=0;de<se;++de){var Ce,Te=xe,Le=_e+$[Z-1];for(Ce=0;Ce<se;++Ce)$[Z+Ce]=Te[Le+$[ye+Ce]];Z+=32}}function hc($,Z){La($,Z,4)}function Zc($,Z){La($,Z,8)}function Zs($,Z){La($,Z,16)}function ps($,Z){var se;for(se=0;16>se;++se)n($,Z+32*se,$,Z-32,16)}function Xd($,Z){var se;for(se=16;0<se;--se)i($,Z,$[Z-1],16),Z+=32}function Yo($,Z,se){var de;for(de=0;16>de;++de)i(Z,se+32*de,$,16)}function es($,Z){var se,de=16;for(se=0;16>se;++se)de+=$[Z-1+32*se]+$[Z+se-32];Yo(de>>5,$,Z)}function As($,Z){var se,de=8;for(se=0;16>se;++se)de+=$[Z-1+32*se];Yo(de>>4,$,Z)}function Js($,Z){var se,de=8;for(se=0;16>se;++se)de+=$[Z+se-32];Yo(de>>4,$,Z)}function Pl($,Z){Yo(128,$,Z)}function Tr($,Z,se){return $+2*Z+se+2>>2}function Jc($,Z){var se,de=Z-32;for(de=new Uint8Array([Tr($[de-1],$[de+0],$[de+1]),Tr($[de+0],$[de+1],$[de+2]),Tr($[de+1],$[de+2],$[de+3]),Tr($[de+2],$[de+3],$[de+4])]),se=0;4>se;++se)n($,Z+32*se,de,0,de.length)}function Hp($,Z){var se=$[Z-1],de=$[Z-1+32],ye=$[Z-1+64],xe=$[Z-1+96];ce($,Z+0,16843009*Tr($[Z-1-32],se,de)),ce($,Z+32,16843009*Tr(se,de,ye)),ce($,Z+64,16843009*Tr(de,ye,xe)),ce($,Z+96,16843009*Tr(ye,xe,xe))}function bg($,Z){var se,de=4;for(se=0;4>se;++se)de+=$[Z+se-32]+$[Z-1+32*se];for(de>>=3,se=0;4>se;++se)i($,Z+32*se,de,4)}function Os($,Z){var se=$[Z-1+0],de=$[Z-1+32],ye=$[Z-1+64],xe=$[Z-1-32],_e=$[Z+0-32],Ce=$[Z+1-32],Te=$[Z+2-32],Le=$[Z+3-32];$[Z+0+96]=Tr(de,ye,$[Z-1+96]),$[Z+1+96]=$[Z+0+64]=Tr(se,de,ye),$[Z+2+96]=$[Z+1+64]=$[Z+0+32]=Tr(xe,se,de),$[Z+3+96]=$[Z+2+64]=$[Z+1+32]=$[Z+0+0]=Tr(_e,xe,se),$[Z+3+64]=$[Z+2+32]=$[Z+1+0]=Tr(Ce,_e,xe),$[Z+3+32]=$[Z+2+0]=Tr(Te,Ce,_e),$[Z+3+0]=Tr(Le,Te,Ce)}function ya($,Z){var se=$[Z+1-32],de=$[Z+2-32],ye=$[Z+3-32],xe=$[Z+4-32],_e=$[Z+5-32],Ce=$[Z+6-32],Te=$[Z+7-32];$[Z+0+0]=Tr($[Z+0-32],se,de),$[Z+1+0]=$[Z+0+32]=Tr(se,de,ye),$[Z+2+0]=$[Z+1+32]=$[Z+0+64]=Tr(de,ye,xe),$[Z+3+0]=$[Z+2+32]=$[Z+1+64]=$[Z+0+96]=Tr(ye,xe,_e),$[Z+3+32]=$[Z+2+64]=$[Z+1+96]=Tr(xe,_e,Ce),$[Z+3+64]=$[Z+2+96]=Tr(_e,Ce,Te),$[Z+3+96]=Tr(Ce,Te,Te)}function zp($,Z){var se=$[Z-1+0],de=$[Z-1+32],ye=$[Z-1+64],xe=$[Z-1-32],_e=$[Z+0-32],Ce=$[Z+1-32],Te=$[Z+2-32],Le=$[Z+3-32];$[Z+0+0]=$[Z+1+64]=xe+_e+1>>1,$[Z+1+0]=$[Z+2+64]=_e+Ce+1>>1,$[Z+2+0]=$[Z+3+64]=Ce+Te+1>>1,$[Z+3+0]=Te+Le+1>>1,$[Z+0+96]=Tr(ye,de,se),$[Z+0+64]=Tr(de,se,xe),$[Z+0+32]=$[Z+1+96]=Tr(se,xe,_e),$[Z+1+32]=$[Z+2+96]=Tr(xe,_e,Ce),$[Z+2+32]=$[Z+3+96]=Tr(_e,Ce,Te),$[Z+3+32]=Tr(Ce,Te,Le)}function Zd($,Z){var se=$[Z+0-32],de=$[Z+1-32],ye=$[Z+2-32],xe=$[Z+3-32],_e=$[Z+4-32],Ce=$[Z+5-32],Te=$[Z+6-32],Le=$[Z+7-32];$[Z+0+0]=se+de+1>>1,$[Z+1+0]=$[Z+0+64]=de+ye+1>>1,$[Z+2+0]=$[Z+1+64]=ye+xe+1>>1,$[Z+3+0]=$[Z+2+64]=xe+_e+1>>1,$[Z+0+32]=Tr(se,de,ye),$[Z+1+32]=$[Z+0+96]=Tr(de,ye,xe),$[Z+2+32]=$[Z+1+96]=Tr(ye,xe,_e),$[Z+3+32]=$[Z+2+96]=Tr(xe,_e,Ce),$[Z+3+64]=Tr(_e,Ce,Te),$[Z+3+96]=Tr(Ce,Te,Le)}function Ls($,Z){var se=$[Z-1+0],de=$[Z-1+32],ye=$[Z-1+64],xe=$[Z-1+96];$[Z+0+0]=se+de+1>>1,$[Z+2+0]=$[Z+0+32]=de+ye+1>>1,$[Z+2+32]=$[Z+0+64]=ye+xe+1>>1,$[Z+1+0]=Tr(se,de,ye),$[Z+3+0]=$[Z+1+32]=Tr(de,ye,xe),$[Z+3+32]=$[Z+1+64]=Tr(ye,xe,xe),$[Z+3+64]=$[Z+2+64]=$[Z+0+96]=$[Z+1+96]=$[Z+2+96]=$[Z+3+96]=xe}function Jd($,Z){var se=$[Z-1+0],de=$[Z-1+32],ye=$[Z-1+64],xe=$[Z-1+96],_e=$[Z-1-32],Ce=$[Z+0-32],Te=$[Z+1-32],Le=$[Z+2-32];$[Z+0+0]=$[Z+2+32]=se+_e+1>>1,$[Z+0+32]=$[Z+2+64]=de+se+1>>1,$[Z+0+64]=$[Z+2+96]=ye+de+1>>1,$[Z+0+96]=xe+ye+1>>1,$[Z+3+0]=Tr(Ce,Te,Le),$[Z+2+0]=Tr(_e,Ce,Te),$[Z+1+0]=$[Z+3+32]=Tr(se,_e,Ce),$[Z+1+32]=$[Z+3+64]=Tr(de,se,_e),$[Z+1+64]=$[Z+3+96]=Tr(ye,de,se),$[Z+1+96]=Tr(xe,ye,de)}function pc($,Z){var se;for(se=0;8>se;++se)n($,Z+32*se,$,Z-32,8)}function yg($,Z){var se;for(se=0;8>se;++se)i($,Z,$[Z-1],8),Z+=32}function el($,Z,se){var de;for(de=0;8>de;++de)i(Z,se+32*de,$,8)}function hh($,Z){var se,de=8;for(se=0;8>se;++se)de+=$[Z+se-32]+$[Z-1+32*se];el(de>>4,$,Z)}function ph($,Z){var se,de=4;for(se=0;8>se;++se)de+=$[Z+se-32];el(de>>3,$,Z)}function sa($,Z){var se,de=4;for(se=0;8>se;++se)de+=$[Z-1+32*se];el(de>>3,$,Z)}function Ac($,Z){el(128,$,Z)}function tl($,Z,se){var de=$[Z-se],ye=$[Z+0],xe=3*(ye-de)+gu[1020+$[Z-2*se]-$[Z+se]],_e=Zp[112+(xe+4>>3)];$[Z-se]=ja[255+de+Zp[112+(xe+3>>3)]],$[Z+0]=ja[255+ye-_e]}function eu($,Z,se,de){var ye=$[Z+0],xe=$[Z+se];return xa[255+$[Z-2*se]-$[Z-se]]>de||xa[255+xe-ye]>de}function Ah($,Z,se,de){return 4*xa[255+$[Z-se]-$[Z+0]]+xa[255+$[Z-2*se]-$[Z+se]]<=de}function ef($,Z,se,de,ye){var xe=$[Z-3*se],_e=$[Z-2*se],Ce=$[Z-se],Te=$[Z+0],Le=$[Z+se],Ge=$[Z+2*se],ot=$[Z+3*se];return 4*xa[255+Ce-Te]+xa[255+_e-Le]>de?0:xa[255+$[Z-4*se]-xe]<=ye&&xa[255+xe-_e]<=ye&&xa[255+_e-Ce]<=ye&&xa[255+ot-Ge]<=ye&&xa[255+Ge-Le]<=ye&&xa[255+Le-Te]<=ye}function tu($,Z,se,de){var ye=2*de+1;for(de=0;16>de;++de)Ah($,Z+de,se,ye)&&tl($,Z+de,se)}function ru($,Z,se,de){var ye=2*de+1;for(de=0;16>de;++de)Ah($,Z+de*se,1,ye)&&tl($,Z+de*se,1)}function tf($,Z,se,de){var ye;for(ye=3;0<ye;--ye)tu($,Z+=4*se,se,de)}function qp($,Z,se,de){var ye;for(ye=3;0<ye;--ye)ru($,Z+=4,se,de)}function nu($,Z,se,de,ye,xe,_e,Ce){for(xe=2*xe+1;0<ye--;){if(ef($,Z,se,xe,_e))if(eu($,Z,se,Ce))tl($,Z,se);else{var Te=$,Le=Z,Ge=se,ot=Te[Le-2*Ge],Oe=Te[Le-Ge],We=Te[Le+0],Je=Te[Le+Ge],yt=Te[Le+2*Ge],tt=27*(_t=gu[1020+3*(We-Oe)+gu[1020+ot-Je]])+63>>7,bt=18*_t+63>>7,_t=9*_t+63>>7;Te[Le-3*Ge]=ja[255+Te[Le-3*Ge]+_t],Te[Le-2*Ge]=ja[255+ot+bt],Te[Le-Ge]=ja[255+Oe+tt],Te[Le+0]=ja[255+We-tt],Te[Le+Ge]=ja[255+Je-bt],Te[Le+2*Ge]=ja[255+yt-_t]}Z+=de}}function iu($,Z,se,de,ye,xe,_e,Ce){for(xe=2*xe+1;0<ye--;){if(ef($,Z,se,xe,_e))if(eu($,Z,se,Ce))tl($,Z,se);else{var Te=$,Le=Z,Ge=se,ot=Te[Le-Ge],Oe=Te[Le+0],We=Te[Le+Ge],Je=Zp[112+(4+(yt=3*(Oe-ot))>>3)],yt=Zp[112+(yt+3>>3)],tt=Je+1>>1;Te[Le-2*Ge]=ja[255+Te[Le-2*Ge]+tt],Te[Le-Ge]=ja[255+ot+yt],Te[Le+0]=ja[255+Oe-Je],Te[Le+Ge]=ja[255+We-tt]}Z+=de}}function vg($,Z,se,de,ye,xe){nu($,Z,se,1,16,de,ye,xe)}function ou($,Z,se,de,ye,xe){nu($,Z,1,se,16,de,ye,xe)}function wg($,Z,se,de,ye,xe){var _e;for(_e=3;0<_e;--_e)iu($,Z+=4*se,se,1,16,de,ye,xe)}function oe($,Z,se,de,ye,xe){var _e;for(_e=3;0<_e;--_e)iu($,Z+=4,1,se,16,de,ye,xe)}function be($,Z,se,de,ye,xe,_e,Ce){nu($,Z,ye,1,8,xe,_e,Ce),nu(se,de,ye,1,8,xe,_e,Ce)}function Pe($,Z,se,de,ye,xe,_e,Ce){nu($,Z,1,ye,8,xe,_e,Ce),nu(se,de,1,ye,8,xe,_e,Ce)}function qe($,Z,se,de,ye,xe,_e,Ce){iu($,Z+4*ye,ye,1,8,xe,_e,Ce),iu(se,de+4*ye,ye,1,8,xe,_e,Ce)}function Ye($,Z,se,de,ye,xe,_e,Ce){iu($,Z+4,1,ye,8,xe,_e,Ce),iu(se,de+4,1,ye,8,xe,_e,Ce)}function xt(){this.ba=new Gt,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new hr,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function Dt(){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 mr(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Sr(){this.ua=0,this.Wa=new ue,this.vb=new ue,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new E,this.yc=new D}function Vr(){this.xb=this.a=0,this.l=new Sn,this.ca=new Gt,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new H,this.Pb=0,this.wd=new H,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Sr,this.ab=0,this.gc=a(4,mr),this.Oc=0}function fn(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Sn,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Hn($,Z,se,de,ye,xe,_e){for($=$==null?0:$[Z+0],Z=0;Z<_e;++Z)ye[xe+Z]=$+se[de+Z]&255,$=ye[xe+Z]}function ao($,Z,se,de,ye,xe,_e){var Ce;if($==null)Hn(null,null,se,de,ye,xe,_e);else for(Ce=0;Ce<_e;++Ce)ye[xe+Ce]=$[Z+Ce]+se[de+Ce]&255}function Oo($,Z,se,de,ye,xe,_e){if($==null)Hn(null,null,se,de,ye,xe,_e);else{var Ce,Te=$[Z+0],Le=Te,Ge=Te;for(Ce=0;Ce<_e;++Ce)Le=Ge+(Te=$[Z+Ce])-Le,Ge=se[de+Ce]+(-256&Le?0>Le?0:255:Le)&255,Le=Te,ye[xe+Ce]=Ge}}function Pi($,Z,se,de){var ye=Z.width,xe=Z.o;if(t($!=null&&Z!=null),0>se||0>=de||se+de>xe)return null;if(!$.Cc){if($.ga==null){var _e;if($.ga=new fn,(_e=$.ga==null)||(_e=Z.width*Z.o,t($.Gb.length==0),$.Gb=o(_e),$.Uc=0,$.Gb==null?_e=0:($.mb=$.Gb,$.nb=$.Uc,$.rc=null,_e=1),_e=!_e),!_e){_e=$.ga;var Ce=$.Fa,Te=$.P,Le=$.qc,Ge=$.mb,ot=$.nb,Oe=Te+1,We=Le-1,Je=_e.l;if(t(Ce!=null&&Ge!=null&&Z!=null),mu[0]=null,mu[1]=Hn,mu[2]=ao,mu[3]=Oo,_e.ca=Ge,_e.tb=ot,_e.c=Z.width,_e.i=Z.height,t(0<_e.c&&0<_e.i),1>=Le)Z=0;else if(_e.$a=3&Ce[Te+0],_e.Z=Ce[Te+0]>>2&3,_e.Lc=Ce[Te+0]>>4&3,Te=Ce[Te+0]>>6&3,0>_e.$a||1<_e.$a||4<=_e.Z||1<_e.Lc||Te)Z=0;else if(Je.put=Ft,Je.ac=nn,Je.bc=on,Je.ma=_e,Je.width=Z.width,Je.height=Z.height,Je.Da=Z.Da,Je.v=Z.v,Je.va=Z.va,Je.j=Z.j,Je.o=Z.o,_e.$a)e:{t(_e.$a==1),Z=rr();t:for(;;){if(Z==null){Z=0;break e}if(t(_e!=null),_e.mc=Z,Z.c=_e.c,Z.i=_e.i,Z.l=_e.l,Z.l.ma=_e,Z.l.width=_e.c,Z.l.height=_e.i,Z.a=0,B(Z.m,Ce,Oe,We),!mn(_e.c,_e.i,1,Z,null)||(Z.ab==1&&Z.gc[0].hc==3&&Jt(Z.s)?(_e.ic=1,Ce=Z.c*Z.i,Z.Ta=null,Z.Ua=0,Z.V=o(Ce),Z.Ba=0,Z.V==null?(Z.a=1,Z=0):Z=1):(_e.ic=0,Z=_n(Z,_e.c)),!Z))break t;Z=1;break e}_e.mc=null,Z=0}else Z=We>=_e.c*_e.i;_e=!Z}if(_e)return null;$.ga.Lc!=1?$.Ga=0:de=xe-se}t($.ga!=null),t(se+de<=xe);e:{if(Z=(Ce=$.ga).c,xe=Ce.l.o,Ce.$a==0){if(Oe=$.rc,We=$.Vc,Je=$.Fa,Te=$.P+1+se*Z,Le=$.mb,Ge=$.nb+se*Z,t(Te<=$.P+$.qc),Ce.Z!=0)for(t(mu[Ce.Z]!=null),_e=0;_e<de;++_e)mu[Ce.Z](Oe,We,Je,Te,Le,Ge,Z),Oe=Le,We=Ge,Ge+=Z,Te+=Z;else for(_e=0;_e<de;++_e)n(Le,Ge,Je,Te,Z),Oe=Le,We=Ge,Ge+=Z,Te+=Z;$.rc=Oe,$.Vc=We}else{if(t(Ce.mc!=null),Z=se+de,t((_e=Ce.mc)!=null),t(Z<=_e.i),_e.C>=Z)Z=1;else if(Ce.ic||jl(),Ce.ic){Ce=_e.V,Oe=_e.Ba,We=_e.c;var yt=_e.i,tt=(Je=1,Te=_e.$/We,Le=_e.$%We,Ge=_e.m,ot=_e.s,_e.$),bt=We*yt,_t=We*Z,Nt=ot.wc,Bt=tt<_t?Ot(ot,Le,Te):null;t(tt<=bt),t(Z<=yt),t(Jt(ot));t:for(;;){for(;!Ge.h&&tt<_t;){if(Le&Nt||(Bt=Ot(ot,Le,Te)),t(Bt!=null),ee(Ge),256>(yt=$e(Bt.G[0],Bt.H[0],Ge)))Ce[Oe+tt]=yt,++tt,++Le>=We&&(Le=0,++Te<=Z&&!(Te%16)&&er(_e,Te));else{if(!(280>yt)){Je=0;break t}yt=xr(yt-256,Ge);var yr,lr=$e(Bt.G[4],Bt.H[4],Ge);if(ee(Ge),!(tt>=(lr=Qe(We,lr=xr(lr,Ge)))&&bt-tt>=yt)){Je=0;break t}for(yr=0;yr<yt;++yr)Ce[Oe+tt+yr]=Ce[Oe+tt+yr-lr];for(tt+=yt,Le+=yt;Le>=We;)Le-=We,++Te<=Z&&!(Te%16)&&er(_e,Te);tt<_t&&Le&Nt&&(Bt=Ot(ot,Le,Te))}t(Ge.h==te(Ge))}er(_e,Te>Z?Z:Te);break t}!Je||Ge.h&&tt<bt?(Je=0,_e.a=Ge.h?5:3):_e.$=tt,Z=Je}else Z=nt(_e,_e.V,_e.Ba,_e.c,_e.i,Z,vi);if(!Z){de=0;break e}}se+de>=xe&&($.Cc=1),de=1}if(!de)return null;if($.Cc&&((de=$.ga)!=null&&(de.mc=null),$.ga=null,0<$.Ga))return alert("todo:WebPDequantizeLevels"),null}return $.nb+se*ye}function Xo($,Z,se,de,ye,xe){for(;0<ye--;){var _e,Ce=$,Te=Z+(se?1:0),Le=$,Ge=Z+(se?0:3);for(_e=0;_e<de;++_e){var ot=Le[Ge+4*_e];ot!=255&&(ot*=32897,Ce[Te+4*_e+0]=Ce[Te+4*_e+0]*ot>>23,Ce[Te+4*_e+1]=Ce[Te+4*_e+1]*ot>>23,Ce[Te+4*_e+2]=Ce[Te+4*_e+2]*ot>>23)}Z+=xe}}function Lo($,Z,se,de,ye){for(;0<de--;){var xe;for(xe=0;xe<se;++xe){var _e=$[Z+2*xe+0],Ce=15&(Le=$[Z+2*xe+1]),Te=4369*Ce,Le=(240&Le|Le>>4)*Te>>16;$[Z+2*xe+0]=(240&_e|_e>>4)*Te>>16&240|(15&_e|_e<<4)*Te>>16>>4&15,$[Z+2*xe+1]=240&Le|Ce}Z+=ye}}function va($,Z,se,de,ye,xe,_e,Ce){var Te,Le,Ge=255;for(Le=0;Le<ye;++Le){for(Te=0;Te<de;++Te){var ot=$[Z+Te];xe[_e+4*Te]=ot,Ge&=ot}Z+=se,_e+=Ce}return Ge!=255}function au($,Z,se,de,ye){var xe;for(xe=0;xe<ye;++xe)se[de+xe]=$[Z+xe]>>8}function jl(){af=Xo,nl=Lo,Wp=va,Ns=au}function su($,Z,se){P[$]=function(de,ye,xe,_e,Ce,Te,Le,Ge,ot,Oe,We,Je,yt,tt,bt,_t,Nt){var Bt,yr=Nt-1>>1,lr=Ce[Te+0]|Le[Ge+0]<<16,Zr=ot[Oe+0]|We[Je+0]<<16;t(de!=null);var Ar=3*lr+Zr+131074>>2;for(Z(de[ye+0],255&Ar,Ar>>16,yt,tt),xe!=null&&(Ar=3*Zr+lr+131074>>2,Z(xe[_e+0],255&Ar,Ar>>16,bt,_t)),Bt=1;Bt<=yr;++Bt){var Fn=Ce[Te+Bt]|Le[Ge+Bt]<<16,$i=ot[Oe+Bt]|We[Je+Bt]<<16,hn=lr+Fn+Zr+$i+524296,cr=hn+2*(Fn+Zr)>>3;Ar=cr+lr>>1,lr=(hn=hn+2*(lr+$i)>>3)+Fn>>1,Z(de[ye+2*Bt-1],255&Ar,Ar>>16,yt,tt+(2*Bt-1)*se),Z(de[ye+2*Bt-0],255&lr,lr>>16,yt,tt+(2*Bt-0)*se),xe!=null&&(Ar=hn+Zr>>1,lr=cr+$i>>1,Z(xe[_e+2*Bt-1],255&Ar,Ar>>16,bt,_t+(2*Bt-1)*se),Z(xe[_e+2*Bt+0],255&lr,lr>>16,bt,_t+(2*Bt+0)*se)),lr=Fn,Zr=$i}1&Nt||(Ar=3*lr+Zr+131074>>2,Z(de[ye+Nt-1],255&Ar,Ar>>16,yt,tt+(Nt-1)*se),xe!=null&&(Ar=3*Zr+lr+131074>>2,Z(xe[_e+Nt-1],255&Ar,Ar>>16,bt,_t+(Nt-1)*se)))}}function Kp(){Sa[kg]=cf,Sa[Na]=Ch,Sa[Cg]=ab,Sa[il]=Fg,Sa[Jp]=rd,Sa[_h]=Sc,Sa[Ju]=nd,Sa[eA]=Ch,Sa[Bg]=Fg,Sa[Sh]=rd,Sa[Eg]=Sc}function gh($){return $&-16384?0>$?0:255:$>>Dg}function gc($,Z){return gh((19077*$>>8)+(26149*Z>>8)-14234)}function Nl($,Z,se){return gh((19077*$>>8)-(6419*Z>>8)-(13320*se>>8)+8708)}function rf($,Z){return gh((19077*$>>8)+(33050*Z>>8)-17685)}function lu($,Z,se,de,ye){de[ye+0]=gc($,se),de[ye+1]=Nl($,Z,se),de[ye+2]=rf($,Z)}function la($,Z,se,de,ye){de[ye+0]=rf($,Z),de[ye+1]=Nl($,Z,se),de[ye+2]=gc($,se)}function Yu($,Z,se,de,ye){var xe=Nl($,Z,se);Z=xe<<3&224|rf($,Z)>>3,de[ye+0]=248&gc($,se)|xe>>5,de[ye+1]=Z}function Xu($,Z,se,de,ye){var xe=240&rf($,Z)|15;de[ye+0]=240&gc($,se)|Nl($,Z,se)>>4,de[ye+1]=xe}function mh($,Z,se,de,ye){de[ye+0]=255,lu($,Z,se,de,ye+1)}function mc($,Z,se,de,ye){la($,Z,se,de,ye),de[ye+3]=255}function ts($,Z,se,de,ye){lu($,Z,se,de,ye),de[ye+3]=255}function cu($,Z,se){P[$]=function(de,ye,xe,_e,Ce,Te,Le,Ge,ot){for(var Oe=Ge+(-2&ot)*se;Ge!=Oe;)Z(de[ye+0],xe[_e+0],Ce[Te+0],Le,Ge),Z(de[ye+1],xe[_e+0],Ce[Te+0],Le,Ge+se),ye+=2,++_e,++Te,Ge+=2*se;1&ot&&Z(de[ye+0],xe[_e+0],Ce[Te+0],Le,Ge)}}function bh($,Z,se){return se==0?$==0?Z==0?6:5:Z==0?4:0:se}function Gp($,Z,se,de,ye){switch($>>>30){case 3:Au(Z,se,de,ye,0);break;case 2:Pa(Z,se,de,ye);break;case 1:ni(Z,se,de,ye)}}function Ps($,Z){var se,de,ye=Z.M,xe=Z.Nb,_e=$.oc,Ce=$.pc+40,Te=$.oc,Le=$.pc+584,Ge=$.oc,ot=$.pc+600;for(se=0;16>se;++se)_e[Ce+32*se-1]=129;for(se=0;8>se;++se)Te[Le+32*se-1]=129,Ge[ot+32*se-1]=129;for(0<ye?_e[Ce-1-32]=Te[Le-1-32]=Ge[ot-1-32]=129:(i(_e,Ce-32-1,127,21),i(Te,Le-32-1,127,9),i(Ge,ot-32-1,127,9)),de=0;de<$.za;++de){var Oe=Z.ya[Z.aa+de];if(0<de){for(se=-1;16>se;++se)n(_e,Ce+32*se-4,_e,Ce+32*se+12,4);for(se=-1;8>se;++se)n(Te,Le+32*se-4,Te,Le+32*se+4,4),n(Ge,ot+32*se-4,Ge,ot+32*se+4,4)}var We=$.Gd,Je=$.Hd+de,yt=Oe.ad,tt=Oe.Hc;if(0<ye&&(n(_e,Ce-32,We[Je].y,0,16),n(Te,Le-32,We[Je].f,0,8),n(Ge,ot-32,We[Je].ea,0,8)),Oe.Za){var bt=_e,_t=Ce-32+16;for(0<ye&&(de>=$.za-1?i(bt,_t,We[Je].y[15],4):n(bt,_t,We[Je+1].y,0,4)),se=0;4>se;se++)bt[_t+128+se]=bt[_t+256+se]=bt[_t+384+se]=bt[_t+0+se];for(se=0;16>se;++se,tt<<=2)bt=_e,_t=Ce+Mo[se],go[Oe.Ob[se]](bt,_t),Gp(tt,yt,16*+se,bt,_t)}else if(bt=bh(de,ye,Oe.Ob[0]),ns[bt](_e,Ce),tt!=0)for(se=0;16>se;++se,tt<<=2)Gp(tt,yt,16*+se,_e,Ce+Mo[se]);for(se=Oe.Gc,bt=bh(de,ye,Oe.Dd),zl[bt](Te,Le),zl[bt](Ge,ot),tt=yt,bt=Te,_t=Le,255&(Oe=0|se)&&(170&Oe?rl(tt,256,bt,_t):zn(tt,256,bt,_t)),Oe=Ge,tt=ot,255&(se>>=8)&&(170&se?rl(yt,320,Oe,tt):zn(yt,320,Oe,tt)),ye<$.Ub-1&&(n(We[Je].y,0,_e,Ce+480,16),n(We[Je].f,0,Te,Le+224,8),n(We[Je].ea,0,Ge,ot+224,8)),se=8*xe*$.B,We=$.sa,Je=$.ta+16*de+16*xe*$.R,yt=$.qa,Oe=$.ra+8*de+se,tt=$.Ha,bt=$.Ia+8*de+se,se=0;16>se;++se)n(We,Je+se*$.R,_e,Ce+32*se,16);for(se=0;8>se;++se)n(yt,Oe+se*$.B,Te,Le+32*se,8),n(tt,bt+se*$.B,Ge,ot+32*se,8)}}function Ul($,Z,se,de,ye,xe,_e,Ce,Te){var Le=[0],Ge=[0],ot=0,Oe=Te!=null?Te.kd:0,We=Te??new Dt;if($==null||12>se)return 7;We.data=$,We.w=Z,We.ha=se,Z=[Z],se=[se],We.gb=[We.gb];e:{var Je=Z,yt=se,tt=We.gb;if(t($!=null),t(yt!=null),t(tt!=null),tt[0]=0,12<=yt[0]&&!r($,Je[0],"RIFF")){if(r($,Je[0]+8,"WEBP")){tt=3;break e}var bt=le($,Je[0]+4);if(12>bt||4294967286<bt){tt=3;break e}if(Oe&&bt>yt[0]-8){tt=7;break e}tt[0]=bt,Je[0]+=12,yt[0]-=12}tt=0}if(tt!=0)return tt;for(bt=0<We.gb[0],se=se[0];;){e:{var _t=$;yt=Z,tt=se;var Nt=Le,Bt=Ge,yr=Je=[0];if((Ar=ot=[ot])[0]=0,8>tt[0])tt=7;else{if(!r(_t,yt[0],"VP8X")){if(le(_t,yt[0]+4)!=10){tt=3;break e}if(18>tt[0]){tt=7;break e}var lr=le(_t,yt[0]+8),Zr=1+ie(_t,yt[0]+12);if(2147483648<=Zr*(_t=1+ie(_t,yt[0]+15))){tt=3;break e}yr!=null&&(yr[0]=lr),Nt!=null&&(Nt[0]=Zr),Bt!=null&&(Bt[0]=_t),yt[0]+=18,tt[0]-=18,Ar[0]=1}tt=0}}if(ot=ot[0],Je=Je[0],tt!=0)return tt;if(yt=!!(2&Je),!bt&&ot)return 3;if(xe!=null&&(xe[0]=!!(16&Je)),_e!=null&&(_e[0]=yt),Ce!=null&&(Ce[0]=0),_e=Le[0],Je=Ge[0],ot&&yt&&Te==null){tt=0;break}if(4>se){tt=7;break}if(bt&&ot||!bt&&!ot&&!r($,Z[0],"ALPH")){se=[se],We.na=[We.na],We.P=[We.P],We.Sa=[We.Sa];e:{lr=$,tt=Z,bt=se;var Ar=We.gb;Nt=We.na,Bt=We.P,yr=We.Sa,Zr=22,t(lr!=null),t(bt!=null),_t=tt[0];var Fn=bt[0];for(t(Nt!=null),t(yr!=null),Nt[0]=null,Bt[0]=null,yr[0]=0;;){if(tt[0]=_t,bt[0]=Fn,8>Fn){tt=7;break e}var $i=le(lr,_t+4);if(4294967286<$i){tt=3;break e}var hn=8+$i+1&-2;if(Zr+=hn,0<Ar&&Zr>Ar){tt=3;break e}if(!r(lr,_t,"VP8 ")||!r(lr,_t,"VP8L")){tt=0;break e}if(Fn[0]<hn){tt=7;break e}r(lr,_t,"ALPH")||(Nt[0]=lr,Bt[0]=_t+8,yr[0]=$i),_t+=hn,Fn-=hn}}if(se=se[0],We.na=We.na[0],We.P=We.P[0],We.Sa=We.Sa[0],tt!=0)break}se=[se],We.Ja=[We.Ja],We.xa=[We.xa];e:if(Ar=$,tt=Z,bt=se,Nt=We.gb[0],Bt=We.Ja,yr=We.xa,lr=tt[0],_t=!r(Ar,lr,"VP8 "),Zr=!r(Ar,lr,"VP8L"),t(Ar!=null),t(bt!=null),t(Bt!=null),t(yr!=null),8>bt[0])tt=7;else{if(_t||Zr){if(Ar=le(Ar,lr+4),12<=Nt&&Ar>Nt-12){tt=3;break e}if(Oe&&Ar>bt[0]-8){tt=7;break e}Bt[0]=Ar,tt[0]+=8,bt[0]-=8,yr[0]=Zr}else yr[0]=5<=bt[0]&&Ar[lr+0]==47&&!(Ar[lr+4]>>5),Bt[0]=bt[0];tt=0}if(se=se[0],We.Ja=We.Ja[0],We.xa=We.xa[0],Z=Z[0],tt!=0)break;if(4294967286<We.Ja)return 3;if(Ce==null||yt||(Ce[0]=We.xa?2:1),_e=[_e],Je=[Je],We.xa){if(5>se){tt=7;break}Ce=_e,Oe=Je,yt=xe,$==null||5>se?$=0:5<=se&&$[Z+0]==47&&!($[Z+4]>>5)?(bt=[0],Ar=[0],Nt=[0],B(Bt=new H,$,Z,se),un(Bt,bt,Ar,Nt)?(Ce!=null&&(Ce[0]=bt[0]),Oe!=null&&(Oe[0]=Ar[0]),yt!=null&&(yt[0]=Nt[0]),$=1):$=0):$=0}else{if(10>se){tt=7;break}Ce=Je,$==null||10>se||!Ji($,Z+3,se-3)?$=0:(Oe=$[Z+0]|$[Z+1]<<8|$[Z+2]<<16,yt=16383&($[Z+7]<<8|$[Z+6]),$=16383&($[Z+9]<<8|$[Z+8]),1&Oe||3<(Oe>>1&7)||!(Oe>>4&1)||Oe>>5>=We.Ja||!yt||!$?$=0:(_e&&(_e[0]=yt),Ce&&(Ce[0]=$),$=1))}if(!$||(_e=_e[0],Je=Je[0],ot&&(Le[0]!=_e||Ge[0]!=Je)))return 3;Te!=null&&(Te[0]=We,Te.offset=Z-Te.w,t(4294967286>Z-Te.w),t(Te.offset==Te.ha-se));break}return tt==0||tt==7&&ot&&Te==null?(xe!=null&&(xe[0]|=We.na!=null&&0<We.na.length),de!=null&&(de[0]=_e),ye!=null&&(ye[0]=Je),0):tt}function uu($,Z,se){var de=Z.width,ye=Z.height,xe=0,_e=0,Ce=de,Te=ye;if(Z.Da=$!=null&&0<$.Da,Z.Da&&(Ce=$.cd,Te=$.bd,xe=$.v,_e=$.j,11>se||(xe&=-2,_e&=-2),0>xe||0>_e||0>=Ce||0>=Te||xe+Ce>de||_e+Te>ye))return 0;if(Z.v=xe,Z.j=_e,Z.va=xe+Ce,Z.o=_e+Te,Z.U=Ce,Z.T=Te,Z.da=$!=null&&0<$.da,Z.da){if(!me(Ce,Te,se=[$.ib],xe=[$.hb]))return 0;Z.ib=se[0],Z.hb=xe[0]}return Z.ob=$!=null&&$.ob,Z.Kb=$==null||!$.Sd,Z.da&&(Z.ob=Z.ib<3*de/4&&Z.hb<3*ye/4,Z.Kb=0),1}function Vp($){if($==null)return 2;if(11>$.S){var Z=$.f.RGBA;Z.fb+=($.height-1)*Z.A,Z.A=-Z.A}else Z=$.f.kb,$=$.height,Z.O+=($-1)*Z.fa,Z.fa=-Z.fa,Z.N+=($-1>>1)*Z.Ab,Z.Ab=-Z.Ab,Z.W+=($-1>>1)*Z.Db,Z.Db=-Z.Db,Z.F!=null&&(Z.J+=($-1)*Z.lb,Z.lb=-Z.lb);return 0}function Ql($,Z,se,de){if(de==null||0>=$||0>=Z)return 2;if(se!=null){if(se.Da){var ye=se.cd,xe=se.bd,_e=-2&se.v,Ce=-2&se.j;if(0>_e||0>Ce||0>=ye||0>=xe||_e+ye>$||Ce+xe>Z)return 2;$=ye,Z=xe}if(se.da){if(!me($,Z,ye=[se.ib],xe=[se.hb]))return 2;$=ye[0],Z=xe[0]}}de.width=$,de.height=Z;e:{var Te=de.width,Le=de.height;if($=de.S,0>=Te||0>=Le||!($>=kg&&13>$))$=2;else{if(0>=de.Rd&&de.sd==null){_e=xe=ye=Z=0;var Ge=(Ce=Te*Rg[$])*Le;if(11>$||(xe=(Le+1)/2*(Z=(Te+1)/2),$==12&&(_e=(ye=Te)*Le)),(Le=o(Ge+2*xe+_e))==null){$=1;break e}de.sd=Le,11>$?((Te=de.f.RGBA).eb=Le,Te.fb=0,Te.A=Ce,Te.size=Ge):((Te=de.f.kb).y=Le,Te.O=0,Te.fa=Ce,Te.Fd=Ge,Te.f=Le,Te.N=0+Ge,Te.Ab=Z,Te.Cd=xe,Te.ea=Le,Te.W=0+Ge+xe,Te.Db=Z,Te.Ed=xe,$==12&&(Te.F=Le,Te.J=0+Ge+2*xe),Te.Tc=_e,Te.lb=ye)}if(Z=1,ye=de.S,xe=de.width,_e=de.height,ye>=kg&&13>ye)if(11>ye)$=de.f.RGBA,Z&=(Ce=Math.abs($.A))*(_e-1)+xe<=$.size,Z&=Ce>=xe*Rg[ye],Z&=$.eb!=null;else{$=de.f.kb,Ce=(xe+1)/2,Ge=(_e+1)/2,Te=Math.abs($.fa),Le=Math.abs($.Ab);var ot=Math.abs($.Db),Oe=Math.abs($.lb),We=Oe*(_e-1)+xe;Z&=Te*(_e-1)+xe<=$.Fd,Z&=Le*(Ge-1)+Ce<=$.Cd,Z=(Z&=ot*(Ge-1)+Ce<=$.Ed)&Te>=xe&Le>=Ce&ot>=Ce,Z&=$.y!=null,Z&=$.f!=null,Z&=$.ea!=null,ye==12&&(Z&=Oe>=xe,Z&=We<=$.Tc,Z&=$.F!=null)}else Z=0;$=Z?0:2}}return $!=0||se!=null&&se.fd&&($=Vp(de)),$}var Zu=64,gs=[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],rs=24,bc=32,yc=8,du=[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];ve("Predictor0","PredictorAdd0"),P.Predictor0=function(){return 4278190080},P.Predictor1=function($){return $},P.Predictor2=function($,Z,se){return Z[se+0]},P.Predictor3=function($,Z,se){return Z[se+1]},P.Predictor4=function($,Z,se){return Z[se-1]},P.Predictor5=function($,Z,se){return Be(Be($,Z[se+1]),Z[se+0])},P.Predictor6=function($,Z,se){return Be($,Z[se-1])},P.Predictor7=function($,Z,se){return Be($,Z[se+0])},P.Predictor8=function($,Z,se){return Be(Z[se-1],Z[se+0])},P.Predictor9=function($,Z,se){return Be(Z[se+0],Z[se+1])},P.Predictor10=function($,Z,se){return Be(Be($,Z[se-1]),Be(Z[se+0],Z[se+1]))},P.Predictor11=function($,Z,se){var de=Z[se+0];return 0>=pe(de>>24&255,$>>24&255,(Z=Z[se-1])>>24&255)+pe(de>>16&255,$>>16&255,Z>>16&255)+pe(de>>8&255,$>>8&255,Z>>8&255)+pe(255&de,255&$,255&Z)?de:$},P.Predictor12=function($,Z,se){var de=Z[se+0];return(we(($>>24&255)+(de>>24&255)-((Z=Z[se-1])>>24&255))<<24|we(($>>16&255)+(de>>16&255)-(Z>>16&255))<<16|we(($>>8&255)+(de>>8&255)-(Z>>8&255))<<8|we((255&$)+(255&de)-(255&Z)))>>>0},P.Predictor13=function($,Z,se){var de=Z[se-1];return(Ne(($=Be($,Z[se+0]))>>24&255,de>>24&255)<<24|Ne($>>16&255,de>>16&255)<<16|Ne($>>8&255,de>>8&255)<<8|Ne(255&$,255&de))>>>0};var yh=P.PredictorAdd0;P.PredictorAdd1=Fe,ve("Predictor2","PredictorAdd2"),ve("Predictor3","PredictorAdd3"),ve("Predictor4","PredictorAdd4"),ve("Predictor5","PredictorAdd5"),ve("Predictor6","PredictorAdd6"),ve("Predictor7","PredictorAdd7"),ve("Predictor8","PredictorAdd8"),ve("Predictor9","PredictorAdd9"),ve("Predictor10","PredictorAdd10"),ve("Predictor11","PredictorAdd11"),ve("Predictor12","PredictorAdd12"),ve("Predictor13","PredictorAdd13");var vh=P.PredictorAdd2;et("ColorIndexInverseTransform","MapARGB","32b",function($){return $>>8&255},function($){return $}),et("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function($){return $},function($){return $>>8&255});var Bo,xg=P.ColorIndexInverseTransform,vc=P.MapARGB,wc=P.VP8LColorIndexInverseTransformAlpha,wa=P.MapAlpha,fu=P.VP8LPredictorsAdd=[];fu.length=16,(P.VP8LPredictors=[]).length=16,(P.VP8LPredictorsAdd_C=[]).length=16,(P.VP8LPredictors_C=[]).length=16;var wh,xh,hu,pu,xc,nf,js,Au,Pa,rl,ni,zn,ji,Eo,_c,Hl,of,$p,tb,Tv,Fv,Dv,rb,nb,af,nl,Wp,Ns,sf=o(511),_g=o(2041),Yp=o(225),Xp=o(767),Sg=0,gu=_g,Zp=Yp,ja=Xp,xa=sf,kg=0,Na=1,Cg=2,il=3,Jp=4,_h=5,Ju=6,eA=7,Bg=8,Sh=9,Eg=10,ol=[2,3,7],kh=[3,3,11],lf=[280,256,256,256,40],Mg=[0,1,1,1,0],tA=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],al=[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],sl=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],ed=8,ll=[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],cl=[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],Us=null,Iv=[[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]],ib=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Tg=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Rv=[[[[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]]]],_a=[[[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]]],Vi=[[[[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]]]],In=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],ns=[],go=[],zl=[],td=1,ob=2,mu=[],Sa=[];su("UpsampleRgbLinePair",lu,3),su("UpsampleBgrLinePair",la,3),su("UpsampleRgbaLinePair",ts,4),su("UpsampleBgraLinePair",mc,4),su("UpsampleArgbLinePair",mh,4),su("UpsampleRgba4444LinePair",Xu,2),su("UpsampleRgb565LinePair",Yu,2);var cf=P.UpsampleRgbLinePair,ab=P.UpsampleBgrLinePair,Ch=P.UpsampleRgbaLinePair,Fg=P.UpsampleBgraLinePair,rd=P.UpsampleArgbLinePair,Sc=P.UpsampleRgba4444LinePair,nd=P.UpsampleRgb565LinePair,ul=16,Bh=1<<ul-1,uf=-227,id=482,Dg=6,od=0,ka=o(256),Ig=o(256),Ov=o(256),b3=o(256),y3=o(id-uf),v3=o(id-uf);cu("YuvToRgbRow",lu,3),cu("YuvToBgrRow",la,3),cu("YuvToRgbaRow",ts,4),cu("YuvToBgraRow",mc,4),cu("YuvToArgbRow",mh,4),cu("YuvToRgba4444Row",Xu,2),cu("YuvToRgb565Row",Yu,2);var Mo=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Eh=[0,2,8],rA=[8,7,6,4,4,2,2,2,1,1,1,1],nA=1;this.WebPDecodeRGBA=function($,Z,se,de,ye){var xe=Na,_e=new xt,Ce=new Gt;_e.ba=Ce,Ce.S=xe,Ce.width=[Ce.width],Ce.height=[Ce.height];var Te=Ce.width,Le=Ce.height,Ge=new Tt;if(Ge==null||$==null)var ot=2;else t(Ge!=null),ot=Ul($,Z,se,Ge.width,Ge.height,Ge.Pd,Ge.Qd,Ge.format,null);if(ot!=0?Te=0:(Te!=null&&(Te[0]=Ge.width[0]),Le!=null&&(Le[0]=Ge.height[0]),Te=1),Te){Ce.width=Ce.width[0],Ce.height=Ce.height[0],de!=null&&(de[0]=Ce.width),ye!=null&&(ye[0]=Ce.height);e:{if(de=new Sn,(ye=new Dt).data=$,ye.w=Z,ye.ha=se,ye.kd=1,Z=[0],t(ye!=null),(($=Ul(ye.data,ye.w,ye.ha,null,null,null,Z,null,ye))==0||$==7)&&Z[0]&&($=4),(Z=$)==0){if(t(_e!=null),de.data=ye.data,de.w=ye.w+ye.offset,de.ha=ye.ha-ye.offset,de.put=Ft,de.ac=nn,de.bc=on,de.ma=_e,ye.xa){if(($=rr())==null){_e=1;break e}if((function(Oe,We){var Je=[0],yt=[0],tt=[0];t:for(;;){if(Oe==null)return 0;if(We==null)return Oe.a=2,0;if(Oe.l=We,Oe.a=0,B(Oe.m,We.data,We.w,We.ha),!un(Oe.m,Je,yt,tt)){Oe.a=3;break t}if(Oe.xb=ob,We.width=Je[0],We.height=yt[0],!mn(Je[0],yt[0],1,Oe,null))break t;return 1}return t(Oe.a!=0),0})($,de)){if(de=(Z=Ql(de.width,de.height,_e.Oa,_e.ba))==0){t:{de=$;r:for(;;){if(de==null){de=0;break t}if(t(de.s.yc!=null),t(de.s.Ya!=null),t(0<de.s.Wb),t((se=de.l)!=null),t((ye=se.ma)!=null),de.xb!=0){if(de.ca=ye.ba,de.tb=ye.tb,t(de.ca!=null),!uu(ye.Oa,se,il)){de.a=2;break r}if(!_n(de,se.width)||se.da)break r;if((se.da||qt(de.ca.S))&&jl(),11>de.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),de.ca.f.kb.F!=null&&jl()),de.Pb&&0<de.s.ua&&de.s.vb.X==null&&!re(de.s.vb,de.s.Wa.Xa)){de.a=1;break r}de.xb=0}if(!nt(de,de.V,de.Ba,de.c,de.i,se.o,Pt))break r;ye.Dc=de.Ma,de=1;break t}t(de.a!=0),de=0}de=!de}de&&(Z=$.a)}else Z=$.a}else{if(($=new bn)==null){_e=1;break e}if($.Fa=ye.na,$.P=ye.P,$.qc=ye.Sa,Oi($,de)){if((Z=Ql(de.width,de.height,_e.Oa,_e.ba))==0){if($.Aa=0,se=_e.Oa,t((ye=$)!=null),se!=null){if(0<(Te=0>(Te=se.Md)?0:100<Te?255:255*Te/100)){for(Le=Ge=0;4>Le;++Le)12>(ot=ye.pb[Le]).lc&&(ot.ia=Te*rA[0>ot.lc?0:ot.lc]>>3),Ge|=ot.ia;Ge&&(alert("todo:VP8InitRandom"),ye.ia=1)}ye.Ga=se.Id,100<ye.Ga?ye.Ga=100:0>ye.Ga&&(ye.Ga=0)}(function(Oe,We){if(Oe==null)return 0;if(We==null)return Mr(Oe,2,"NULL VP8Io parameter in VP8Decode().");if(!Oe.cb&&!Oi(Oe,We))return 0;if(t(Oe.cb),We.ac==null||We.ac(We)){We.ob&&(Oe.L=0);var Je=Eh[Oe.L];if(Oe.L==2?(Oe.yb=0,Oe.zb=0):(Oe.yb=We.v-Je>>4,Oe.zb=We.j-Je>>4,0>Oe.yb&&(Oe.yb=0),0>Oe.zb&&(Oe.zb=0)),Oe.Va=We.o+15+Je>>4,Oe.Hb=We.va+15+Je>>4,Oe.Hb>Oe.za&&(Oe.Hb=Oe.za),Oe.Va>Oe.Ub&&(Oe.Va=Oe.Ub),0<Oe.L){var yt=Oe.ed;for(Je=0;4>Je;++Je){var tt;if(Oe.Qa.Cb){var bt=Oe.Qa.Lb[Je];Oe.Qa.Fb||(bt+=yt.Tb)}else bt=yt.Tb;for(tt=0;1>=tt;++tt){var _t=Oe.gd[Je][tt],Nt=bt;if(yt.Pc&&(Nt+=yt.vd[0],tt&&(Nt+=yt.od[0])),0<(Nt=0>Nt?0:63<Nt?63:Nt)){var Bt=Nt;0<yt.wb&&(Bt=4<yt.wb?Bt>>2:Bt>>1)>9-yt.wb&&(Bt=9-yt.wb),1>Bt&&(Bt=1),_t.dd=Bt,_t.tc=2*Nt+Bt,_t.ld=40<=Nt?2:15<=Nt?1:0}else _t.tc=0;_t.La=tt}}}Je=0}else Mr(Oe,6,"Frame setup failed"),Je=Oe.a;if(Je=Je==0){if(Je){Oe.$c=0,0<Oe.Aa||(Oe.Ic=nA);t:{Je=Oe.Ic,yt=4*(Bt=Oe.za);var yr=32*Bt,lr=Bt+1,Zr=0<Oe.L?Bt*(0<Oe.Aa?2:1):0,Ar=(Oe.Aa==2?2:1)*Bt;if((_t=yt+832+(tt=3*(16*Je+Eh[Oe.L])/2*yr)+(bt=Oe.Fa!=null&&0<Oe.Fa.length?Oe.Kc.c*Oe.Kc.i:0))!=_t)Je=0;else{if(_t>Oe.Vb){if(Oe.Vb=0,Oe.Ec=o(_t),Oe.Fc=0,Oe.Ec==null){Je=Mr(Oe,1,"no memory during frame initialization.");break t}Oe.Vb=_t}_t=Oe.Ec,Nt=Oe.Fc,Oe.Ac=_t,Oe.Bc=Nt,Nt+=yt,Oe.Gd=a(yr,Xr),Oe.Hd=0,Oe.rb=a(lr+1,jt),Oe.sb=1,Oe.wa=Zr?a(Zr,tr):null,Oe.Y=0,Oe.D.Nb=0,Oe.D.wa=Oe.wa,Oe.D.Y=Oe.Y,0<Oe.Aa&&(Oe.D.Y+=Bt),t(!0),Oe.oc=_t,Oe.pc=Nt,Nt+=832,Oe.ya=a(Ar,dn),Oe.aa=0,Oe.D.ya=Oe.ya,Oe.D.aa=Oe.aa,Oe.Aa==2&&(Oe.D.aa+=Bt),Oe.R=16*Bt,Oe.B=8*Bt,Bt=(yr=Eh[Oe.L])*Oe.R,yr=yr/2*Oe.B,Oe.sa=_t,Oe.ta=Nt+Bt,Oe.qa=Oe.sa,Oe.ra=Oe.ta+16*Je*Oe.R+yr,Oe.Ha=Oe.qa,Oe.Ia=Oe.ra+8*Je*Oe.B+yr,Oe.$c=0,Nt+=tt,Oe.mb=bt?_t:null,Oe.nb=bt?Nt:null,t(Nt+bt<=Oe.Fc+Oe.Vb),Rs(Oe),i(Oe.Ac,Oe.Bc,0,yt),Je=1}}if(Je){if(We.ka=0,We.y=Oe.sa,We.O=Oe.ta,We.f=Oe.qa,We.N=Oe.ra,We.ea=Oe.Ha,We.Vd=Oe.Ia,We.fa=Oe.R,We.Rc=Oe.B,We.F=null,We.J=0,!Sg){for(Je=-255;255>=Je;++Je)sf[255+Je]=0>Je?-Je:Je;for(Je=-1020;1020>=Je;++Je)_g[1020+Je]=-128>Je?-128:127<Je?127:Je;for(Je=-112;112>=Je;++Je)Yp[112+Je]=-16>Je?-16:15<Je?15:Je;for(Je=-255;510>=Je;++Je)Xp[255+Je]=0>Je?0:255<Je?255:Je;Sg=1}js=Co,Au=hs,rl=oo,ni=fc,zn=Wo,Pa=kn,ji=vg,Eo=ou,_c=be,Hl=Pe,of=wg,$p=oe,tb=qe,Tv=Ye,Fv=tu,Dv=ru,rb=tf,nb=qp,go[0]=bg,go[1]=hc,go[2]=Jc,go[3]=Hp,go[4]=Os,go[5]=zp,go[6]=ya,go[7]=Zd,go[8]=Jd,go[9]=Ls,ns[0]=es,ns[1]=Zs,ns[2]=ps,ns[3]=Xd,ns[4]=As,ns[5]=Js,ns[6]=Pl,zl[0]=hh,zl[1]=Zc,zl[2]=pc,zl[3]=yg,zl[4]=sa,zl[5]=ph,zl[6]=Ac,Je=1}else Je=0}Je&&(Je=(function(Fn,$i){for(Fn.M=0;Fn.M<Fn.Va;++Fn.M){var hn,cr=Fn.Jc[Fn.M&Fn.Xb],Vt=Fn.m,so=Fn;for(hn=0;hn<so.za;++hn){var jr=Vt,yn=so,hi=yn.Ac,Zo=yn.Bc+4*hn,Ca=yn.zc,Ni=yn.ya[yn.aa+hn];if(yn.Qa.Bb?Ni.$b=X(jr,yn.Pa.jb[0])?2+X(jr,yn.Pa.jb[2]):X(jr,yn.Pa.jb[1]):Ni.$b=0,yn.kc&&(Ni.Ad=X(jr,yn.Bd)),Ni.Za=!X(jr,145)+0,Ni.Za){var Po=Ni.Ob,Ua=0;for(yn=0;4>yn;++yn){var jo,En=Ca[0+yn];for(jo=0;4>jo;++jo){En=_a[hi[Zo+jo]][En];for(var Wn=Tg[X(jr,En[0])];0<Wn;)Wn=Tg[2*Wn+X(jr,En[Wn])];En=-Wn,hi[Zo+jo]=En}n(Po,Ua,hi,Zo,4),Ua+=4,Ca[0+yn]=En}}else En=X(jr,156)?X(jr,128)?1:3:X(jr,163)?2:0,Ni.Ob[0]=En,i(hi,Zo,En,4),i(Ca,0,En,4);Ni.Dd=X(jr,142)?X(jr,114)?X(jr,183)?1:3:2:0}if(so.m.Ka)return Mr(Fn,7,"Premature end-of-partition0 encountered.");for(;Fn.ja<Fn.za;++Fn.ja){if(so=cr,jr=(Vt=Fn).rb[Vt.sb-1],hi=Vt.rb[Vt.sb+Vt.ja],hn=Vt.ya[Vt.aa+Vt.ja],Zo=Vt.kc?hn.Ad:0)jr.la=hi.la=0,hn.Za||(jr.Na=hi.Na=0),hn.Hc=0,hn.Gc=0,hn.ia=0;else{var lo,ii;if(jr=hi,hi=so,Zo=Vt.Pa.Xc,Ca=Vt.ya[Vt.aa+Vt.ja],Ni=Vt.pb[Ca.$b],yn=Ca.ad,Po=0,Ua=Vt.rb[Vt.sb-1],En=jo=0,i(yn,Po,0,384),Ca.Za)var Jo=0,co=Zo[3];else{Wn=o(16);var Yn=jr.Na+Ua.Na;if(Yn=Us(hi,Zo[1],Yn,Ni.Eb,0,Wn,0),jr.Na=Ua.Na=(0<Yn)+0,1<Yn)js(Wn,0,yn,Po);else{var To=Wn[0]+3>>3;for(Wn=0;256>Wn;Wn+=16)yn[Po+Wn]=To}Jo=1,co=Zo[0]}var pi=15&jr.la,No=15&Ua.la;for(Wn=0;4>Wn;++Wn){var Uo=1&No;for(To=ii=0;4>To;++To)pi=pi>>1|(Uo=(Yn=Us(hi,co,Yn=Uo+(1&pi),Ni.Sc,Jo,yn,Po))>Jo)<<7,ii=ii<<2|(3<Yn?3:1<Yn?2:yn[Po+0]!=0),Po+=16;pi>>=4,No=No>>1|Uo<<7,jo=(jo<<8|ii)>>>0}for(co=pi,Jo=No>>4,lo=0;4>lo;lo+=2){for(ii=0,pi=jr.la>>4+lo,No=Ua.la>>4+lo,Wn=0;2>Wn;++Wn){for(Uo=1&No,To=0;2>To;++To)Yn=Uo+(1&pi),pi=pi>>1|(Uo=0<(Yn=Us(hi,Zo[2],Yn,Ni.Qc,0,yn,Po)))<<3,ii=ii<<2|(3<Yn?3:1<Yn?2:yn[Po+0]!=0),Po+=16;pi>>=2,No=No>>1|Uo<<5}En|=ii<<4*lo,co|=pi<<4<<lo,Jo|=(240&No)<<lo}jr.la=co,Ua.la=Jo,Ca.Hc=jo,Ca.Gc=En,Ca.ia=43690&En?0:Ni.ia,Zo=!(jo|En)}if(0<Vt.L&&(Vt.wa[Vt.Y+Vt.ja]=Vt.gd[hn.$b][hn.Za],Vt.wa[Vt.Y+Vt.ja].La|=!Zo),so.Ka)return Mr(Fn,7,"Premature end-of-file encountered.")}if(Rs(Fn),Vt=$i,so=1,hn=(cr=Fn).D,jr=0<cr.L&&cr.M>=cr.zb&&cr.M<=cr.Va,cr.Aa==0)t:{if(hn.M=cr.M,hn.uc=jr,Ps(cr,hn),so=1,hn=(ii=cr.D).Nb,jr=(En=Eh[cr.L])*cr.R,hi=En/2*cr.B,Wn=16*hn*cr.R,To=8*hn*cr.B,Zo=cr.sa,Ca=cr.ta-jr+Wn,Ni=cr.qa,yn=cr.ra-hi+To,Po=cr.Ha,Ua=cr.Ia-hi+To,No=(pi=ii.M)==0,jo=pi>=cr.Va-1,cr.Aa==2&&Ps(cr,ii),ii.uc)for(Uo=(Yn=cr).D.M,t(Yn.D.uc),ii=Yn.yb;ii<Yn.Hb;++ii){Jo=ii,co=Uo;var Ci=(qn=(Qo=Yn).D).Nb;lo=Qo.R;var qn=qn.wa[qn.Y+Jo],Qa=Qo.sa,mo=Qo.ta+16*Ci*lo+16*Jo,Ir=qn.dd,Rr=qn.tc;if(Rr!=0)if(t(3<=Rr),Qo.L==1)0<Jo&&Dv(Qa,mo,lo,Rr+4),qn.La&&nb(Qa,mo,lo,Rr),0<co&&Fv(Qa,mo,lo,Rr+4),qn.La&&rb(Qa,mo,lo,Rr);else{var Xn=Qo.B,ms=Qo.qa,dl=Qo.ra+8*Ci*Xn+8*Jo,is=Qo.Ha,Qo=Qo.Ia+8*Ci*Xn+8*Jo;Ci=qn.ld,0<Jo&&(Eo(Qa,mo,lo,Rr+4,Ir,Ci),Hl(ms,dl,is,Qo,Xn,Rr+4,Ir,Ci)),qn.La&&($p(Qa,mo,lo,Rr,Ir,Ci),Tv(ms,dl,is,Qo,Xn,Rr,Ir,Ci)),0<co&&(ji(Qa,mo,lo,Rr+4,Ir,Ci),_c(ms,dl,is,Qo,Xn,Rr+4,Ir,Ci)),qn.La&&(of(Qa,mo,lo,Rr,Ir,Ci),tb(ms,dl,is,Qo,Xn,Rr,Ir,Ci))}}if(cr.ia&&alert("todo:DitherRow"),Vt.put!=null){if(ii=16*pi,pi=16*(pi+1),No?(Vt.y=cr.sa,Vt.O=cr.ta+Wn,Vt.f=cr.qa,Vt.N=cr.ra+To,Vt.ea=cr.Ha,Vt.W=cr.Ia+To):(ii-=En,Vt.y=Zo,Vt.O=Ca,Vt.f=Ni,Vt.N=yn,Vt.ea=Po,Vt.W=Ua),jo||(pi-=En),pi>Vt.o&&(pi=Vt.o),Vt.F=null,Vt.J=null,cr.Fa!=null&&0<cr.Fa.length&&ii<pi&&(Vt.J=Pi(cr,Vt,ii,pi-ii),Vt.F=cr.mb,Vt.F==null&&Vt.F.length==0)){so=Mr(cr,3,"Could not decode alpha data.");break t}ii<Vt.j&&(En=Vt.j-ii,ii=Vt.j,t(!(1&En)),Vt.O+=cr.R*En,Vt.N+=cr.B*(En>>1),Vt.W+=cr.B*(En>>1),Vt.F!=null&&(Vt.J+=Vt.width*En)),ii<pi&&(Vt.O+=Vt.v,Vt.N+=Vt.v>>1,Vt.W+=Vt.v>>1,Vt.F!=null&&(Vt.J+=Vt.v),Vt.ka=ii-Vt.j,Vt.U=Vt.va-Vt.v,Vt.T=pi-ii,so=Vt.put(Vt))}hn+1!=cr.Ic||jo||(n(cr.sa,cr.ta-jr,Zo,Ca+16*cr.R,jr),n(cr.qa,cr.ra-hi,Ni,yn+8*cr.B,hi),n(cr.Ha,cr.Ia-hi,Po,Ua+8*cr.B,hi))}if(!so)return Mr(Fn,6,"Output aborted.")}return 1})(Oe,We)),We.bc!=null&&We.bc(We),Je&=1}return Je?(Oe.cb=0,Je):0})($,de)||(Z=$.a)}}else Z=$.a}Z==0&&_e.Oa!=null&&_e.Oa.fd&&(Z=Vp(_e.ba))}_e=Z}xe=_e!=0?null:11>xe?Ce.f.RGBA.eb:Ce.f.kb.y}else xe=null;return xe};var Rg=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function l(P,N){for(var z="",Q=0;Q<4;Q++)z+=String.fromCharCode(P[N++]);return z}function u(P,N){return P[N+0]|P[N+1]<<8}function d(P,N){return(P[N+0]|P[N+1]<<8|P[N+2]<<16)>>>0}function h(P,N){return(P[N+0]|P[N+1]<<8|P[N+2]<<16|P[N+3]<<24)>>>0}new c;var f=[0],p=[0],m=[],g=new c,b=e,v=(function(P,N){var z={},Q=0,D=!1,I=0,E=0;if(z.frames=[],!(function(O,H){for(var W=0;W<4;W++)if(O[H+W]!="RIFF".charCodeAt(W))return!0;return!1})(P,N)){for(h(P,N+=4),N+=8;N<P.length;){var x=l(P,N),_=h(P,N+=4);N+=4;var S=_+(1&_);switch(x){case"VP8 ":case"VP8L":z.frames[Q]===void 0&&(z.frames[Q]={}),(U=z.frames[Q]).src_off=D?E:N-8,U.src_size=I+_+8,Q++,D&&(D=!1,I=0,E=0);break;case"VP8X":(U=z.header={}).feature_flags=P[N];var B=N+4;U.canvas_width=1+d(P,B),B+=3,U.canvas_height=1+d(P,B),B+=3;break;case"ALPH":D=!0,I=S+8,E=N-8;break;case"ANIM":(U=z.header).bgcolor=h(P,N),B=N+4,U.loop_count=u(P,B),B+=2;break;case"ANMF":var T,U;(U=z.frames[Q]={}).offset_x=2*d(P,N),N+=3,U.offset_y=2*d(P,N),N+=3,U.width=1+d(P,N),N+=3,U.height=1+d(P,N),N+=3,U.duration=d(P,N),N+=3,T=P[N++],U.dispose=1&T,U.blend=T>>1&1}x!="ANMF"&&(N+=S)}return z}})(b,0);v.response=b,v.rgbaoutput=!0,v.dataurl=!1;var w=v.header?v.header:null,C=v.frames?v.frames:null;if(w){w.loop_counter=w.loop_count,f=[w.canvas_height],p=[w.canvas_width];for(var F=0;F<C.length&&C[F].blend!=0;F++);}var M=C[0],j=g.WebPDecodeRGBA(b,M.src_off,M.src_size,p,f);M.rgba=j,M.imgwidth=p[0],M.imgheight=f[0];for(var L=0;L<p[0]*f[0]*4;L++)m[L]=j[L];return this.width=p,this.height=f,this.data=m,this}(function(e){var t,r,n,i,o,a,s,c,l,u=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 c,this.globalCompositeOperation=O.globalCompositeOperation||"normal",this.globalAlpha=O.globalAlpha||1,this.clip_path=O.clip_path||[],this.currentPoint=O.currentPoint||new a,this.miterLimit=O.miterLimit||10,this.lastPoint=O.lastPoint||new a,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 d(this),t=this.internal.f2,r=this.internal.getCoordinateString,n=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,o=this.internal.getVerticalCoordinate,a=this.internal.Point,s=this.internal.Rectangle,c=this.internal.Matrix,l=new u}]);var d=function(O){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var H=O;Object.defineProperty(this,"pdf",{get:function(){return H}});var W=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return W},set:function(re){W=!!re}});var te=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return te},set:function(re){te=!!re}});var V=0;Object.defineProperty(this,"posX",{get:function(){return V},set:function(re){isNaN(re)||(V=re)}});var ee=0;Object.defineProperty(this,"posY",{get:function(){return ee},set:function(re){isNaN(re)||(ee=re)}}),Object.defineProperty(this,"margin",{get:function(){return l.margin},set:function(re){var Ae;typeof re=="number"?Ae=[re,re,re,re]:((Ae=new Array(4))[0]=re[0],Ae[1]=re.length>=2?re[1]:Ae[0],Ae[2]=re.length>=3?re[2]:Ae[0],Ae[3]=re.length>=4?re[3]:Ae[1]),l.margin=Ae}});var G=!1;Object.defineProperty(this,"autoPaging",{get:function(){return G},set:function(re){G=re}});var q=0;Object.defineProperty(this,"lastBreak",{get:function(){return q},set:function(re){q=re}});var X=[];Object.defineProperty(this,"pageBreaks",{get:function(){return X},set:function(re){X=re}}),Object.defineProperty(this,"ctx",{get:function(){return l},set:function(re){re instanceof u&&(l=re)}}),Object.defineProperty(this,"path",{get:function(){return l.path},set:function(re){l.path=re}});var ce=[];Object.defineProperty(this,"ctxStack",{get:function(){return ce},set:function(re){ce=re}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(re){var Ae;Ae=h(re),this.ctx.fillStyle=Ae.style,this.ctx.isFillTransparent=Ae.a===0,this.ctx.fillOpacity=Ae.a,this.pdf.setFillColor(Ae.r,Ae.g,Ae.b,{a:Ae.a}),this.pdf.setTextColor(Ae.r,Ae.g,Ae.b,{a:Ae.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(re){var Ae=h(re);this.ctx.strokeStyle=Ae.style,this.ctx.isStrokeTransparent=Ae.a===0,this.ctx.strokeOpacity=Ae.a,Ae.a===0?this.pdf.setDrawColor(255,255,255):(Ae.a,this.pdf.setDrawColor(Ae.r,Ae.g,Ae.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(re){["butt","round","square"].indexOf(re)!==-1&&(this.ctx.lineCap=re,this.pdf.setLineCap(re))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(re){isNaN(re)||(this.ctx.lineWidth=re,this.pdf.setLineWidth(re))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(re){["bevel","round","miter"].indexOf(re)!==-1&&(this.ctx.lineJoin=re,this.pdf.setLineJoin(re))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(re){isNaN(re)||(this.ctx.miterLimit=re,this.pdf.setMiterLimit(re))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(re){this.ctx.textBaseline=re}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(re){["right","end","center","left","start"].indexOf(re)!==-1&&(this.ctx.textAlign=re)}});var fe=null,ie=null,le=null;Object.defineProperty(this,"fontFaces",{get:function(){return le},set:function(re){fe=null,ie=null,le=re}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(re){var Ae;if(this.ctx.font=re,(Ae=/^\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-z0-9]+?)\s*$/i.exec(re))!==null){var ue=Ae[1];Ae[2];var me=Ae[3],ge=Ae[4];Ae[5];var Ee=Ae[6],ve=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(ge)[2];ge=Math.floor(ve==="px"?parseFloat(ge)*this.pdf.internal.scaleFactor:ve==="em"?parseFloat(ge)*this.pdf.getFontSize():parseFloat(ge)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(ge);var Me=(function(et){var Et,pt,at=[],rt=et.trim();if(rt==="")return wU;if(rt in hU)return[hU[rt]];for(;rt!=="";){switch(pt=null,Et=(rt=AU(rt)).charAt(0)){case'"':case"'":pt=TIe(rt.substring(1),Et);break;default:pt=FIe(rt)}if(pt===null||(at.push(pt[0]),(rt=AU(pt[1]))!==""&&rt.charAt(0)!==","))return wU;rt=rt.replace(/^,/,"")}return at})(Ee);if(this.fontFaces){var Be=(function(et,Et){var pt=et.getFontList(),at=JSON.stringify(pt);if(fe===null||ie!==at){var rt=(function(wt){var ht=[];return Object.keys(wt).forEach(function($t){wt[$t].forEach(function(qt){var It=null;switch(qt){case"bold":It={family:$t,weight:"bold"};break;case"italic":It={family:$t,style:"italic"};break;case"bolditalic":It={family:$t,weight:"bold",style:"italic"};break;case"":case"normal":It={family:$t}}It!==null&&(It.ref={name:$t,style:qt},ht.push(It))})}),ht})(pt);fe=(function(wt){for(var ht={},$t=0;$t<wt.length;++$t){var qt=T6(wt[$t]),It=qt.family,gr=qt.stretch,Gt=qt.style,Tt=qt.weight;ht[It]=ht[It]||{},ht[It][gr]=ht[It][gr]||{},ht[It][gr][Gt]=ht[It][gr][Gt]||{},ht[It][gr][Gt][Tt]=qt}return ht})(rt.concat(Et)),ie=at}return fe})(this.pdf,this.fontFaces),we=Me.map(function(et){return{family:et,stretch:"normal",weight:me,style:ue}}),Ne=(function(et,Et,pt){for(var at=(pt=pt||{}).defaultFontFamily||"times",rt=Object.assign({},MIe,pt.genericFontFamilies||{}),wt=null,ht=null,$t=0;$t<Et.length;++$t)if(rt[(wt=T6(Et[$t])).family]&&(wt.family=rt[wt.family]),et.hasOwnProperty(wt.family)){ht=et[wt.family];break}if(!(ht=ht||et[at]))throw new Error("Could not find a font-family for the rule '"+pU(wt)+"' and default family '"+at+"'.");if(ht=(function(qt,It){if(It[qt])return It[qt];var gr=AB[qt],Gt=gr<=AB.normal?-1:1,Tt=fU(It,MY,gr,Gt);if(!Tt)throw new Error("Could not find a matching font-stretch value for "+qt);return Tt})(wt.stretch,ht),ht=(function(qt,It){if(It[qt])return It[qt];for(var gr=EY[qt],Gt=0;Gt<gr.length;++Gt)if(It[gr[Gt]])return It[gr[Gt]];throw new Error("Could not find a matching font-style for "+qt)})(wt.style,ht),!(ht=(function(qt,It){if(It[qt])return It[qt];if(qt===400&&It[500])return It[500];if(qt===500&&It[400])return It[400];var gr=EIe[qt],Gt=fU(It,TY,gr,qt<400?-1:1);if(!Gt)throw new Error("Could not find a matching font-weight for value "+qt);return Gt})(wt.weight,ht)))throw new Error("Failed to resolve a font for the rule '"+pU(wt)+"'.");return ht})(Be,we);this.pdf.setFont(Ne.ref.name,Ne.ref.style)}else{var pe="";(me==="bold"||parseInt(me,10)>=700||ue==="bold")&&(pe="bold"),ue==="italic"&&(pe+="italic"),pe.length===0&&(pe="normal");for(var Fe="",ke={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"},Ie=0;Ie<Me.length;Ie++){if(this.pdf.internal.getFont(Me[Ie],pe,{noFallback:!0,disableWarning:!0})!==void 0){Fe=Me[Ie];break}if(pe==="bolditalic"&&this.pdf.internal.getFont(Me[Ie],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Fe=Me[Ie],pe="bold";else if(this.pdf.internal.getFont(Me[Ie],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Fe=Me[Ie],pe="normal";break}}if(Fe===""){for(var Ke=0;Ke<Me.length;Ke++)if(ke[Me[Ke]]){Fe=ke[Me[Ke]];break}}Fe=Fe===""?"Times":Fe,this.pdf.setFont(Fe,pe)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(re){this.ctx.globalCompositeOperation=re}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(re){this.ctx.globalAlpha=re}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(re){this.ctx.lineDashOffset=re,U.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(re){this.ctx.lineDash=re,U.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(re){this.ctx.ignoreClearRect=!!re}})};d.prototype.setLineDash=function(O){this.lineDash=O},d.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},d.prototype.fill=function(){C.call(this,"fill",!1)},d.prototype.stroke=function(){C.call(this,"stroke",!1)},d.prototype.beginPath=function(){this.path=[{type:"begin"}]},d.prototype.moveTo=function(O,H){if(isNaN(O)||isNaN(H))throw Xi.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var W=this.ctx.transform.applyToPoint(new a(O,H));this.path.push({type:"mt",x:W.x,y:W.y}),this.ctx.lastPoint=new a(O,H)},d.prototype.closePath=function(){var O=new a(0,0),H=0;for(H=this.path.length-1;H!==-1;H--)if(this.path[H].type==="begin"&&di(this.path[H+1])==="object"&&typeof this.path[H+1].x=="number"){O=new a(this.path[H+1].x,this.path[H+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new a(O.x,O.y)},d.prototype.lineTo=function(O,H){if(isNaN(O)||isNaN(H))throw Xi.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var W=this.ctx.transform.applyToPoint(new a(O,H));this.path.push({type:"lt",x:W.x,y:W.y}),this.ctx.lastPoint=new a(W.x,W.y)},d.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),C.call(this,null,!0)},d.prototype.quadraticCurveTo=function(O,H,W,te){if(isNaN(W)||isNaN(te)||isNaN(O)||isNaN(H))throw Xi.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var V=this.ctx.transform.applyToPoint(new a(W,te)),ee=this.ctx.transform.applyToPoint(new a(O,H));this.path.push({type:"qct",x1:ee.x,y1:ee.y,x:V.x,y:V.y}),this.ctx.lastPoint=new a(V.x,V.y)},d.prototype.bezierCurveTo=function(O,H,W,te,V,ee){if(isNaN(V)||isNaN(ee)||isNaN(O)||isNaN(H)||isNaN(W)||isNaN(te))throw Xi.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var G=this.ctx.transform.applyToPoint(new a(V,ee)),q=this.ctx.transform.applyToPoint(new a(O,H)),X=this.ctx.transform.applyToPoint(new a(W,te));this.path.push({type:"bct",x1:q.x,y1:q.y,x2:X.x,y2:X.y,x:G.x,y:G.y}),this.ctx.lastPoint=new a(G.x,G.y)},d.prototype.arc=function(O,H,W,te,V,ee){if(isNaN(O)||isNaN(H)||isNaN(W)||isNaN(te)||isNaN(V))throw Xi.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(ee=!!ee,!this.ctx.transform.isIdentity){var G=this.ctx.transform.applyToPoint(new a(O,H));O=G.x,H=G.y;var q=this.ctx.transform.applyToPoint(new a(0,W)),X=this.ctx.transform.applyToPoint(new a(0,0));W=Math.sqrt(Math.pow(q.x-X.x,2)+Math.pow(q.y-X.y,2))}Math.abs(V-te)>=2*Math.PI&&(te=0,V=2*Math.PI),this.path.push({type:"arc",x:O,y:H,radius:W,startAngle:te,endAngle:V,counterclockwise:ee})},d.prototype.arcTo=function(O,H,W,te,V){throw new Error("arcTo not implemented.")},d.prototype.rect=function(O,H,W,te){if(isNaN(O)||isNaN(H)||isNaN(W)||isNaN(te))throw Xi.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(O,H),this.lineTo(O+W,H),this.lineTo(O+W,H+te),this.lineTo(O,H+te),this.lineTo(O,H),this.lineTo(O+W,H),this.lineTo(O,H)},d.prototype.fillRect=function(O,H,W,te){if(isNaN(O)||isNaN(H)||isNaN(W)||isNaN(te))throw Xi.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!f.call(this)){var V={};this.lineCap!=="butt"&&(V.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(V.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(O,H,W,te),this.fill(),V.hasOwnProperty("lineCap")&&(this.lineCap=V.lineCap),V.hasOwnProperty("lineJoin")&&(this.lineJoin=V.lineJoin)}},d.prototype.strokeRect=function(O,H,W,te){if(isNaN(O)||isNaN(H)||isNaN(W)||isNaN(te))throw Xi.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");p.call(this)||(this.beginPath(),this.rect(O,H,W,te),this.stroke())},d.prototype.clearRect=function(O,H,W,te){if(isNaN(O)||isNaN(H)||isNaN(W)||isNaN(te))throw Xi.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(O,H,W,te))},d.prototype.save=function(O){O=typeof O!="boolean"||O;for(var H=this.pdf.internal.getCurrentPageInfo().pageNumber,W=0;W<this.pdf.internal.getNumberOfPages();W++)this.pdf.setPage(W+1),this.pdf.internal.out("q");if(this.pdf.setPage(H),O){this.ctx.fontSize=this.pdf.internal.getFontSize();var te=new u(this.ctx);this.ctxStack.push(this.ctx),this.ctx=te}},d.prototype.restore=function(O){O=typeof O!="boolean"||O;for(var H=this.pdf.internal.getCurrentPageInfo().pageNumber,W=0;W<this.pdf.internal.getNumberOfPages();W++)this.pdf.setPage(W+1),this.pdf.internal.out("Q");this.pdf.setPage(H),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)},d.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var h=function(O){var H,W,te,V;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))H=0,W=0,te=0,V=0;else{var ee=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(O);if(ee!==null)H=parseInt(ee[1]),W=parseInt(ee[2]),te=parseInt(ee[3]),V=1;else if((ee=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(O))!==null)H=parseInt(ee[1]),W=parseInt(ee[2]),te=parseInt(ee[3]),V=parseFloat(ee[4]);else{if(V=1,typeof O=="string"&&O.charAt(0)!=="#"){var G=new wY(O);O=G.ok?G.toHex():"#000000"}O.length===4?(H=O.substring(1,2),H+=H,W=O.substring(2,3),W+=W,te=O.substring(3,4),te+=te):(H=O.substring(1,3),W=O.substring(3,5),te=O.substring(5,7)),H=parseInt(H,16),W=parseInt(W,16),te=parseInt(te,16)}}return{r:H,g:W,b:te,a:V,style:O}},f=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},p=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};d.prototype.fillText=function(O,H,W,te){if(isNaN(H)||isNaN(W)||typeof O!="string")throw Xi.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(te=isNaN(te)?void 0:te,!f.call(this)){var V=S(this.ctx.transform.rotation),ee=this.ctx.transform.scaleX;Q.call(this,{text:O,x:H,y:W,scale:ee,angle:V,align:this.textAlign,maxWidth:te})}},d.prototype.strokeText=function(O,H,W,te){if(isNaN(H)||isNaN(W)||typeof O!="string")throw Xi.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!p.call(this)){te=isNaN(te)?void 0:te;var V=S(this.ctx.transform.rotation),ee=this.ctx.transform.scaleX;Q.call(this,{text:O,x:H,y:W,scale:ee,renderingMode:"stroke",angle:V,align:this.textAlign,maxWidth:te})}},d.prototype.measureText=function(O){if(typeof O!="string")throw Xi.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var H=this.pdf,W=this.pdf.internal.scaleFactor,te=H.internal.getFontSize(),V=H.getStringUnitWidth(O)*te/H.internal.scaleFactor;return new function(ee){var G=(ee=ee||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return G}}),this}({width:V*=Math.round(96*W/72*1e4)/1e4})},d.prototype.scale=function(O,H){if(isNaN(O)||isNaN(H))throw Xi.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var W=new c(O,0,0,H,0,0);this.ctx.transform=this.ctx.transform.multiply(W)},d.prototype.rotate=function(O){if(isNaN(O))throw Xi.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var H=new c(Math.cos(O),Math.sin(O),-Math.sin(O),Math.cos(O),0,0);this.ctx.transform=this.ctx.transform.multiply(H)},d.prototype.translate=function(O,H){if(isNaN(O)||isNaN(H))throw Xi.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var W=new c(1,0,0,1,O,H);this.ctx.transform=this.ctx.transform.multiply(W)},d.prototype.transform=function(O,H,W,te,V,ee){if(isNaN(O)||isNaN(H)||isNaN(W)||isNaN(te)||isNaN(V)||isNaN(ee))throw Xi.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var G=new c(O,H,W,te,V,ee);this.ctx.transform=this.ctx.transform.multiply(G)},d.prototype.setTransform=function(O,H,W,te,V,ee){O=isNaN(O)?1:O,H=isNaN(H)?0:H,W=isNaN(W)?0:W,te=isNaN(te)?1:te,V=isNaN(V)?0:V,ee=isNaN(ee)?0:ee,this.ctx.transform=new c(O,H,W,te,V,ee)};var m=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};d.prototype.drawImage=function(O,H,W,te,V,ee,G,q,X){var ce=this.pdf.getImageProperties(O),fe=1,ie=1,le=1,re=1;te!==void 0&&q!==void 0&&(le=q/te,re=X/V,fe=ce.width/te*q/te,ie=ce.height/V*X/V),ee===void 0&&(ee=H,G=W,H=0,W=0),te!==void 0&&q===void 0&&(q=te,X=V),te===void 0&&q===void 0&&(q=ce.width,X=ce.height);var Ae=this.ctx.transform.decompose(),ue=S(Ae.rotate.shx),me=new c,ge=(me=(me=(me=me.multiply(Ae.translate)).multiply(Ae.skew)).multiply(Ae.scale)).applyToRectangle(new s(ee-H*le,G-W*re,te*fe,V*ie));if(this.autoPaging){for(var Ee,ve=g.call(this,ge),Me=[],Be=0;Be<ve.length;Be+=1)Me.indexOf(ve[Be])===-1&&Me.push(ve[Be]);w(Me);for(var we=Me[0],Ne=Me[Me.length-1],pe=we;pe<Ne+1;pe++){this.pdf.setPage(pe);var Fe=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],ke=pe===1?this.posY+this.margin[0]:this.margin[0],Ie=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ke=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],et=pe===1?0:Ie+(pe-2)*Ke;if(this.ctx.clip_path.length!==0){var Et=this.path;Ee=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(Ee,this.posX+this.margin[3],-et+ke+this.ctx.prevPageLastElemOffset),F.call(this,"fill",!0),this.path=Et}var pt=JSON.parse(JSON.stringify(ge));pt=v([pt],this.posX+this.margin[3],-et+ke+this.ctx.prevPageLastElemOffset)[0];var at=(pe>we||pe<Ne)&&m.call(this);at&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Fe,Ke,null).clip().discardPath()),this.pdf.addImage(O,"JPEG",pt.x,pt.y,pt.w,pt.h,null,null,ue),at&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(O,"JPEG",ge.x,ge.y,ge.w,ge.h,null,null,ue)};var g=function(O,H,W){var te=[];H=H||this.pdf.internal.pageSize.width,W=W||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var V=this.posY+this.ctx.prevPageLastElemOffset;switch(O.type){default:case"mt":case"lt":te.push(Math.floor((O.y+V)/W)+1);break;case"arc":te.push(Math.floor((O.y+V-O.radius)/W)+1),te.push(Math.floor((O.y+V+O.radius)/W)+1);break;case"qct":var ee=B(this.ctx.lastPoint.x,this.ctx.lastPoint.y,O.x1,O.y1,O.x,O.y);te.push(Math.floor((ee.y+V)/W)+1),te.push(Math.floor((ee.y+ee.h+V)/W)+1);break;case"bct":var G=T(this.ctx.lastPoint.x,this.ctx.lastPoint.y,O.x1,O.y1,O.x2,O.y2,O.x,O.y);te.push(Math.floor((G.y+V)/W)+1),te.push(Math.floor((G.y+G.h+V)/W)+1);break;case"rect":te.push(Math.floor((O.y+V)/W)+1),te.push(Math.floor((O.y+O.h+V)/W)+1)}for(var q=0;q<te.length;q+=1)for(;this.pdf.internal.getNumberOfPages()<te[q];)b.call(this);return te},b=function(){var O=this.fillStyle,H=this.strokeStyle,W=this.font,te=this.lineCap,V=this.lineWidth,ee=this.lineJoin;this.pdf.addPage(),this.fillStyle=O,this.strokeStyle=H,this.font=W,this.lineCap=te,this.lineWidth=V,this.lineJoin=ee},v=function(O,H,W){for(var te=0;te<O.length;te++)switch(O[te].type){case"bct":O[te].x2+=H,O[te].y2+=W;case"qct":O[te].x1+=H,O[te].y1+=W;default:O[te].x+=H,O[te].y+=W}return O},w=function(O){return O.sort(function(H,W){return H-W})},C=function(O,H){var W=this.fillStyle,te=this.strokeStyle,V=this.lineCap,ee=this.lineWidth,G=Math.abs(ee*this.ctx.transform.scaleX),q=this.lineJoin;if(this.autoPaging){for(var X,ce,fe=JSON.parse(JSON.stringify(this.path)),ie=JSON.parse(JSON.stringify(this.path)),le=[],re=0;re<ie.length;re++)if(ie[re].x!==void 0)for(var Ae=g.call(this,ie[re]),ue=0;ue<Ae.length;ue+=1)le.indexOf(Ae[ue])===-1&&le.push(Ae[ue]);for(var me=0;me<le.length;me++)for(;this.pdf.internal.getNumberOfPages()<le[me];)b.call(this);w(le);for(var ge=le[0],Ee=le[le.length-1],ve=ge;ve<Ee+1;ve++){this.pdf.setPage(ve),this.fillStyle=W,this.strokeStyle=te,this.lineCap=V,this.lineWidth=G,this.lineJoin=q;var Me=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Be=ve===1?this.posY+this.margin[0]:this.margin[0],we=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ne=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],pe=ve===1?0:we+(ve-2)*Ne;if(this.ctx.clip_path.length!==0){var Fe=this.path;X=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(X,this.posX+this.margin[3],-pe+Be+this.ctx.prevPageLastElemOffset),F.call(this,O,!0),this.path=Fe}if(ce=JSON.parse(JSON.stringify(fe)),this.path=v(ce,this.posX+this.margin[3],-pe+Be+this.ctx.prevPageLastElemOffset),H===!1||ve===0){var ke=(ve>ge||ve<Ee)&&m.call(this);ke&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Me,Ne,null).clip().discardPath()),F.call(this,O,H),ke&&this.pdf.restoreGraphicsState()}this.lineWidth=ee}this.path=fe}else this.lineWidth=G,F.call(this,O,H),this.lineWidth=ee},F=function(O,H){if((O!=="stroke"||H||!p.call(this))&&(O==="stroke"||H||!f.call(this))){for(var W,te,V=[],ee=this.path,G=0;G<ee.length;G++){var q=ee[G];switch(q.type){case"begin":V.push({begin:!0});break;case"close":V.push({close:!0});break;case"mt":V.push({start:q,deltas:[],abs:[]});break;case"lt":var X=V.length;if(ee[G-1]&&!isNaN(ee[G-1].x)&&(W=[q.x-ee[G-1].x,q.y-ee[G-1].y],X>0)){for(;X>=0;X--)if(V[X-1].close!==!0&&V[X-1].begin!==!0){V[X-1].deltas.push(W),V[X-1].abs.push(q);break}}break;case"bct":W=[q.x1-ee[G-1].x,q.y1-ee[G-1].y,q.x2-ee[G-1].x,q.y2-ee[G-1].y,q.x-ee[G-1].x,q.y-ee[G-1].y],V[V.length-1].deltas.push(W);break;case"qct":var ce=ee[G-1].x+2/3*(q.x1-ee[G-1].x),fe=ee[G-1].y+2/3*(q.y1-ee[G-1].y),ie=q.x+2/3*(q.x1-q.x),le=q.y+2/3*(q.y1-q.y),re=q.x,Ae=q.y;W=[ce-ee[G-1].x,fe-ee[G-1].y,ie-ee[G-1].x,le-ee[G-1].y,re-ee[G-1].x,Ae-ee[G-1].y],V[V.length-1].deltas.push(W);break;case"arc":V.push({deltas:[],abs:[],arc:!0}),Array.isArray(V[V.length-1].abs)&&V[V.length-1].abs.push(q)}}te=H?null:O==="stroke"?"stroke":"fill";for(var ue=!1,me=0;me<V.length;me++)if(V[me].arc)for(var ge=V[me].abs,Ee=0;Ee<ge.length;Ee++){var ve=ge[Ee];ve.type==="arc"?L.call(this,ve.x,ve.y,ve.radius,ve.startAngle,ve.endAngle,ve.counterclockwise,void 0,H,!ue):D.call(this,ve.x,ve.y),ue=!0}else if(V[me].close===!0)this.pdf.internal.out("h"),ue=!1;else if(V[me].begin!==!0){var Me=V[me].start.x,Be=V[me].start.y;I.call(this,V[me].deltas,Me,Be),ue=!0}te&&P.call(this,te),H&&N.call(this)}},M=function(O){var H=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,W=H*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return O-W;case"top":return O+H-W;case"hanging":return O+H-2*W;case"middle":return O+H/2-W;default:return O}},j=function(O){return O+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};d.prototype.createLinearGradient=function(){var O=function(){};return O.colorStops=[],O.addColorStop=function(H,W){this.colorStops.push([H,W])},O.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},O.isCanvasGradient=!0,O},d.prototype.createPattern=function(){return this.createLinearGradient()},d.prototype.createRadialGradient=function(){return this.createLinearGradient()};var L=function(O,H,W,te,V,ee,G,q,X){for(var ce=x.call(this,W,te,V,ee),fe=0;fe<ce.length;fe++){var ie=ce[fe];fe===0&&(X?z.call(this,ie.x1+O,ie.y1+H):D.call(this,ie.x1+O,ie.y1+H)),E.call(this,O,H,ie.x2,ie.y2,ie.x3,ie.y3,ie.x4,ie.y4)}q?N.call(this):P.call(this,G)},P=function(O){switch(O){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},N=function(){this.pdf.clip(),this.pdf.discardPath()},z=function(O,H){this.pdf.internal.out(r(O)+" "+n(H)+" m")},Q=function(O){var H;switch(O.align){case"right":case"end":H="right";break;case"center":H="center";break;default:H="left"}var W,te,V,ee=this.pdf.getTextDimensions(O.text),G=M.call(this,O.y),q=j.call(this,G)-ee.h,X=this.ctx.transform.applyToPoint(new a(O.x,G));if(this.autoPaging){var ce=this.ctx.transform.decompose(),fe=new c;fe=(fe=(fe=fe.multiply(ce.translate)).multiply(ce.skew)).multiply(ce.scale);for(var ie=this.ctx.transform.applyToRectangle(new s(O.x,G,ee.w,ee.h)),le=fe.applyToRectangle(new s(O.x,q,ee.w,ee.h)),re=g.call(this,le),Ae=[],ue=0;ue<re.length;ue+=1)Ae.indexOf(re[ue])===-1&&Ae.push(re[ue]);w(Ae);for(var me=Ae[0],ge=Ae[Ae.length-1],Ee=me;Ee<ge+1;Ee++){this.pdf.setPage(Ee);var ve=Ee===1?this.posY+this.margin[0]:this.margin[0],Me=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Be=this.pdf.internal.pageSize.height-this.margin[2],we=Be-this.margin[0],Ne=this.pdf.internal.pageSize.width-this.margin[1],pe=Ne-this.margin[3],Fe=Ee===1?0:Me+(Ee-2)*we;if(this.ctx.clip_path.length!==0){var ke=this.path;W=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(W,this.posX+this.margin[3],-1*Fe+ve),F.call(this,"fill",!0),this.path=ke}var Ie=v([JSON.parse(JSON.stringify(le))],this.posX+this.margin[3],-Fe+ve+this.ctx.prevPageLastElemOffset)[0];O.scale>=.01&&(te=this.pdf.internal.getFontSize(),this.pdf.setFontSize(te*O.scale),V=this.lineWidth,this.lineWidth=V*O.scale);var Ke=this.autoPaging!=="text";if(Ke||Ie.y+Ie.h<=Be){if(Ke||Ie.y>=ve&&Ie.x<=Ne){var et=Ke?O.text:this.pdf.splitTextToSize(O.text,O.maxWidth||Ne-Ie.x)[0],Et=v([JSON.parse(JSON.stringify(ie))],this.posX+this.margin[3],-Fe+ve+this.ctx.prevPageLastElemOffset)[0],pt=Ke&&(Ee>me||Ee<ge)&&m.call(this);pt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],pe,we,null).clip().discardPath()),this.pdf.text(et,Et.x,Et.y,{angle:O.angle,align:H,renderingMode:O.renderingMode}),pt&&this.pdf.restoreGraphicsState()}}else Ie.y<Be&&(this.ctx.prevPageLastElemOffset+=Be-Ie.y);O.scale>=.01&&(this.pdf.setFontSize(te),this.lineWidth=V)}}else O.scale>=.01&&(te=this.pdf.internal.getFontSize(),this.pdf.setFontSize(te*O.scale),V=this.lineWidth,this.lineWidth=V*O.scale),this.pdf.text(O.text,X.x+this.posX,X.y+this.posY,{angle:O.angle,align:H,renderingMode:O.renderingMode,maxWidth:O.maxWidth}),O.scale>=.01&&(this.pdf.setFontSize(te),this.lineWidth=V)},D=function(O,H,W,te){W=W||0,te=te||0,this.pdf.internal.out(r(O+W)+" "+n(H+te)+" l")},I=function(O,H,W){return this.pdf.lines(O,H,W,null,null)},E=function(O,H,W,te,V,ee,G,q){this.pdf.internal.out([t(i(W+O)),t(o(te+H)),t(i(V+O)),t(o(ee+H)),t(i(G+O)),t(o(q+H)),"c"].join(" "))},x=function(O,H,W,te){for(var V=2*Math.PI,ee=Math.PI/2;H>W;)H-=V;var G=Math.abs(W-H);G<V&&te&&(G=V-G);for(var q=[],X=te?-1:1,ce=H;G>1e-5;){var fe=ce+X*Math.min(G,ee);q.push(_.call(this,O,ce,fe)),G-=Math.abs(fe-ce),ce=fe}return q},_=function(O,H,W){var te=(W-H)/2,V=O*Math.cos(te),ee=O*Math.sin(te),G=V,q=-ee,X=G*G+q*q,ce=X+G*V+q*ee,fe=4/3*(Math.sqrt(2*X*ce)-ce)/(G*ee-q*V),ie=G-fe*q,le=q+fe*G,re=ie,Ae=-le,ue=te+H,me=Math.cos(ue),ge=Math.sin(ue);return{x1:O*Math.cos(H),y1:O*Math.sin(H),x2:ie*me-le*ge,y2:ie*ge+le*me,x3:re*me-Ae*ge,y3:re*ge+Ae*me,x4:O*Math.cos(W),y4:O*Math.sin(W)}},S=function(O){return 180*O/Math.PI},B=function(O,H,W,te,V,ee){var G=O+.5*(W-O),q=H+.5*(te-H),X=V+.5*(W-V),ce=ee+.5*(te-ee),fe=Math.min(O,V,G,X),ie=Math.max(O,V,G,X),le=Math.min(H,ee,q,ce),re=Math.max(H,ee,q,ce);return new s(fe,le,ie-fe,re-le)},T=function(O,H,W,te,V,ee,G,q){var X,ce,fe,ie,le,re,Ae,ue,me,ge,Ee,ve,Me,Be,we=W-O,Ne=te-H,pe=V-W,Fe=ee-te,ke=G-V,Ie=q-ee;for(ce=0;ce<41;ce++)me=(Ae=(fe=O+(X=ce/40)*we)+X*((le=W+X*pe)-fe))+X*(le+X*(V+X*ke-le)-Ae),ge=(ue=(ie=H+X*Ne)+X*((re=te+X*Fe)-ie))+X*(re+X*(ee+X*Ie-re)-ue),ce==0?(Ee=me,ve=ge,Me=me,Be=ge):(Ee=Math.min(Ee,me),ve=Math.min(ve,ge),Me=Math.max(Me,me),Be=Math.max(Be,ge));return new s(Math.round(Ee),Math.round(ve),Math.round(Me-Ee),Math.round(Be-ve))},U=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var O,H,W=(O=this.ctx.lineDash,H=this.ctx.lineDashOffset,JSON.stringify({lineDash:O,lineDashOffset:H}));this.prevLineDash!==W&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=W)}}})(Er.API),(function(e){var t=function(a){var s,c,l,u,d,h,f,p,m,g;for(c=[],l=0,u=(a+=s="\0\0\0\0".slice(a.length%4||4)).length;u>l;l+=4)(d=(a.charCodeAt(l)<<24)+(a.charCodeAt(l+1)<<16)+(a.charCodeAt(l+2)<<8)+a.charCodeAt(l+3))!==0?(h=(d=((d=((d=((d=(d-(g=d%85))/85)-(m=d%85))/85)-(p=d%85))/85)-(f=d%85))/85)%85,c.push(h+33,f+33,p+33,m+33,g+33)):c.push(122);return(function(b,v){for(var w=v;w>0;w--)b.pop()})(c,s.length),String.fromCharCode.apply(String,c)+"~>"},r=function(a){var s,c,l,u,d,h=String,f="length",p=255,m="charCodeAt",g="slice",b="replace";for(a[g](-2),a=a[g](0,-2)[b](/\s/g,"")[b]("z","!!!!!"),l=[],u=0,d=(a+=s="uuuuu"[g](a[f]%5||5))[f];d>u;u+=5)c=52200625*(a[m](u)-33)+614125*(a[m](u+1)-33)+7225*(a[m](u+2)-33)+85*(a[m](u+3)-33)+(a[m](u+4)-33),l.push(p&c>>24,p&c>>16,p&c>>8,p&c);return(function(v,w){for(var C=w;C>0;C--)v.pop()})(l,s[f]),h.fromCharCode.apply(h,l)},n=function(a){return a.split("").map(function(s){return("0"+s.charCodeAt().toString(16)).slice(-2)}).join("")+">"},i=function(a){var s=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((a=a.replace(/\s/g,"")).indexOf(">")!==-1&&(a=a.substr(0,a.indexOf(">"))),a.length%2&&(a+="0"),s.test(a)===!1)return"";for(var c="",l=0;l<a.length;l+=2)c+=String.fromCharCode("0x"+(a[l]+a[l+1]));return c},o=function(a){for(var s=new Uint8Array(a.length),c=a.length;c--;)s[c]=a.charCodeAt(c);return(s=lB(s)).reduce(function(l,u){return l+String.fromCharCode(u)},"")};e.processDataByFilters=function(a,s){var c=0,l=a||"",u=[];for(typeof(s=s||[])=="string"&&(s=[s]),c=0;c<s.length;c+=1)switch(s[c]){case"ASCII85Decode":case"/ASCII85Decode":l=r(l),u.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":l=t(l),u.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":l=i(l),u.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":l=n(l),u.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":l=o(l),u.push("/FlateDecode");break;default:throw new Error('The filter: "'+s[c]+'" is not implemented')}return{data:l,reverseChain:u.reverse().join(" ")}}})(Er.API),(function(e){e.loadFile=function(t,r,n){return(function(i,o,a){o=o!==!1,a=typeof a=="function"?a:function(){};var s=void 0;try{s=(function(c,l,u){var d=new XMLHttpRequest,h=0,f=function(p){var m=p.length,g=[],b=String.fromCharCode;for(h=0;h<m;h+=1)g.push(b(255&p.charCodeAt(h)));return g.join("")};if(d.open("GET",c,!l),d.overrideMimeType("text/plain; charset=x-user-defined"),l===!1&&(d.onload=function(){d.status===200?u(f(this.responseText)):u(void 0)}),d.send(null),l&&d.status===200)return f(d.responseText)})(i,o,a)}catch{}return s})(t,r,n)},e.loadImageFile=e.loadFile})(Er.API),(function(e){function t(){return(rn.html2canvas?Promise.resolve(rn.html2canvas):Promise.resolve().then(()=>Bze)).catch(function(s){return Promise.reject(new Error("Could not load html2canvas: "+s))}).then(function(s){return s.default?s.default:s})}function r(){return(rn.DOMPurify?Promise.resolve(rn.DOMPurify):TF(()=>import("./purify.es-B-PIlM9I-DuUx4dnf.js"),[])).catch(function(s){return Promise.reject(new Error("Could not load dompurify: "+s))}).then(function(s){return s.default?s.default:s})}var n=function(s){var c=di(s);return c==="undefined"?"undefined":c==="string"||s instanceof String?"string":c==="number"||s instanceof Number?"number":c==="function"||s instanceof Function?"function":s&&s.constructor===Array?"array":s&&s.nodeType===1?"element":c==="object"?"object":"unknown"},i=function(s,c){var l=document.createElement(s);for(var u in c.className&&(l.className=c.className),c.innerHTML&&c.dompurify&&(l.innerHTML=c.dompurify.sanitize(c.innerHTML)),c.style)l.style[u]=c.style[u];return l},o=function s(c,l){for(var u=c.nodeType===3?document.createTextNode(c.nodeValue):c.cloneNode(!1),d=c.firstChild;d;d=d.nextSibling)l!==!0&&d.nodeType===1&&d.nodeName==="SCRIPT"||u.appendChild(s(d,l));return c.nodeType===1&&(c.nodeName==="CANVAS"?(u.width=c.width,u.height=c.height,u.getContext("2d").drawImage(c,0,0)):c.nodeName!=="TEXTAREA"&&c.nodeName!=="SELECT"||(u.value=c.value),u.addEventListener("load",function(){u.scrollTop=c.scrollTop,u.scrollLeft=c.scrollLeft},!0)),u},a=function s(c){var l=Object.assign(s.convert(Promise.resolve()),JSON.parse(JSON.stringify(s.template))),u=s.convert(Promise.resolve(),l);return(u=u.setProgress(1,s,1,[s])).set(c)};(a.prototype=Object.create(Promise.prototype)).constructor=a,a.convert=function(s,c){return s.__proto__=c||a.prototype,s},a.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"}},a.prototype.from=function(s,c){return this.then(function(){switch(c=c||(function(l){switch(n(l)){case"string":return"string";case"element":return l.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}})(s),c){case"string":return this.then(r).then(function(l){return this.set({src:i("div",{innerHTML:s,dompurify:l})})});case"element":return this.set({src:s});case"canvas":return this.set({canvas:s});case"img":return this.set({img:s});default:return this.error("Unknown source type.")}})},a.prototype.to=function(s){switch(s){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.")}},a.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 s={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},c=o(this.prop.src,this.opt.html2canvas.javascriptEnabled);c.tagName==="BODY"&&(s.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:s}),this.prop.container.appendChild(c),this.prop.container.firstChild.appendChild(i("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"})},a.prototype.toCanvas=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(t).then(function(c){var l=Object.assign({},this.opt.html2canvas);return delete l.onrendered,c(this.prop.container,l)}).then(function(c){(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},a.prototype.toContext2d=function(){var s=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(s).then(t).then(function(c){var l=this.opt.jsPDF,u=this.opt.fontFaces,d=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,h=Object.assign({async:!0,allowTaint:!0,scale:d,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 h.onrendered,l.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,l.context2d.posX=this.opt.x,l.context2d.posY=this.opt.y,l.context2d.margin=this.opt.margin,l.context2d.fontFaces=u,u)for(var f=0;f<u.length;++f){var p=u[f],m=p.src.find(function(g){return g.format==="truetype"});m&&l.addFont(m.url,p.ref.name,p.ref.style)}return h.windowHeight=h.windowHeight||0,h.windowHeight=h.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):h.windowHeight,l.context2d.save(!0),c(this.prop.container,h)}).then(function(c){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},a.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var s=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=s})},a.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},a.prototype.output=function(s,c,l){return(l=l||"pdf").toLowerCase()==="img"||l.toLowerCase()==="image"?this.outputImg(s,c):this.outputPdf(s,c)},a.prototype.outputPdf=function(s,c){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(s,c)})},a.prototype.outputImg=function(s){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(s){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 "'+s+'" is not supported.'}})},a.prototype.save=function(s){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(s?{filename:s}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},a.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},a.prototype.set=function(s){if(n(s)!=="object")return this;var c=Object.keys(s||{}).map(function(l){if(l in a.template.prop)return function(){this.prop[l]=s[l]};switch(l){case"margin":return this.setMargin.bind(this,s.margin);case"jsPDF":return function(){return this.opt.jsPDF=s.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,s.pageSize);default:return function(){this.opt[l]=s[l]}}},this);return this.then(function(){return this.thenList(c)})},a.prototype.get=function(s,c){return this.then(function(){var l=s in a.template.prop?this.prop[s]:this.opt[s];return c?c(l):l})},a.prototype.setMargin=function(s){return this.then(function(){switch(n(s)){case"number":s=[s,s,s,s];case"array":if(s.length===2&&(s=[s[0],s[1],s[0],s[1]]),s.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=s}).then(this.setPageSize)},a.prototype.setPageSize=function(s){function c(l,u){return Math.floor(l*u/72*96)}return this.then(function(){(s=s||Er.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(s.inner={width:s.width-this.opt.margin[1]-this.opt.margin[3],height:s.height-this.opt.margin[0]-this.opt.margin[2]},s.inner.px={width:c(s.inner.width,s.k),height:c(s.inner.height,s.k)},s.inner.ratio=s.inner.height/s.inner.width),this.prop.pageSize=s})},a.prototype.setProgress=function(s,c,l,u){return s!=null&&(this.progress.val=s),c!=null&&(this.progress.state=c),l!=null&&(this.progress.n=l),u!=null&&(this.progress.stack=u),this.progress.ratio=this.progress.val/this.progress.state,this},a.prototype.updateProgress=function(s,c,l,u){return this.setProgress(s?this.progress.val+s:null,c||null,l?this.progress.n+l:null,u?this.progress.stack.concat(u):null)},a.prototype.then=function(s,c){var l=this;return this.thenCore(s,c,function(u,d){return l.updateProgress(null,null,1,[u]),Promise.prototype.then.call(this,function(h){return l.updateProgress(null,u),h}).then(u,d).then(function(h){return l.updateProgress(1),h})})},a.prototype.thenCore=function(s,c,l){l=l||Promise.prototype.then;var u=this;s&&(s=s.bind(u)),c&&(c=c.bind(u));var d=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?u:a.convert(Object.assign({},u),Promise.prototype),h=l.call(d,s,c);return a.convert(h,u.__proto__)},a.prototype.thenExternal=function(s,c){return Promise.prototype.then.call(this,s,c)},a.prototype.thenList=function(s){var c=this;return s.forEach(function(l){c=c.thenCore(l)}),c},a.prototype.catch=function(s){s&&(s=s.bind(this));var c=Promise.prototype.catch.call(this,s);return a.convert(c,this)},a.prototype.catchExternal=function(s){return Promise.prototype.catch.call(this,s)},a.prototype.error=function(s){return this.then(function(){throw new Error(s)})},a.prototype.using=a.prototype.set,a.prototype.saveAs=a.prototype.save,a.prototype.export=a.prototype.output,a.prototype.run=a.prototype.then,Er.getPageSize=function(s,c,l){if(di(s)==="object"){var u=s;s=u.orientation,c=u.unit||c,l=u.format||l}c=c||"mm",l=l||"a4",s=(""+(s||"P")).toLowerCase();var d,h=(""+l).toLowerCase(),f={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(c){case"pt":d=1;break;case"mm":d=72/25.4;break;case"cm":d=72/2.54;break;case"in":d=72;break;case"px":d=.75;break;case"pc":case"em":d=12;break;case"ex":d=6;break;default:throw"Invalid unit: "+c}var p,m=0,g=0;if(f.hasOwnProperty(h))m=f[h][1]/d,g=f[h][0]/d;else try{m=l[1],g=l[0]}catch{throw new Error("Invalid format: "+l)}if(s==="p"||s==="portrait")s="p",g>m&&(p=g,g=m,m=p);else{if(s!=="l"&&s!=="landscape")throw"Invalid orientation: "+s;s="l",m>g&&(p=g,g=m,m=p)}return{width:g,height:m,unit:c,k:d,orientation:s}},e.html=function(s,c){(c=c||{}).callback=c.callback||function(){},c.html2canvas=c.html2canvas||{},c.html2canvas.canvas=c.html2canvas.canvas||this.canvas,c.jsPDF=c.jsPDF||this,c.fontFaces=c.fontFaces?c.fontFaces.map(T6):null;var l=new a(c);return c.worker?l:l.from(s).doCallback()}})(Er.API),Er.API.addJS=function(e){return mU=e,this.internal.events.subscribe("postPutResources",function(){Aw=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(Aw+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),gU=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+mU+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){Aw!==void 0&&gU!==void 0&&this.internal.out("/Names <</JavaScript "+Aw+" 0 R>>")}),this},(function(e){var t;e.events.push(["postPutResources",function(){var r=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=r.outline.render().split(/\r\n/),o=0;o<i.length;o++){var a=i[o],s=n.exec(a);if(s!=null){var c=s[1];r.internal.newObjectDeferredBegin(c,!1)}r.internal.write(a)}if(this.outline.createNamedDestinations){var l=this.internal.pages.length,u=[];for(o=0;o<l;o++){var d=r.internal.newObject();u.push(d);var h=r.internal.getPageInfo(o+1);r.internal.write("<< /D["+h.objId+" 0 R /XYZ null null null]>> endobj")}var f=r.internal.newObject();for(r.internal.write("<< /Names [ "),o=0;o<u.length;o++)r.internal.write("(page_"+(o+1)+")"+u[o]+" 0 R");r.internal.write(" ] >>","endobj"),t=r.internal.newObject(),r.internal.write("<< /Dests "+f+" 0 R"),r.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){var r=this;r.outline.root.children.length>0&&(r.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&r.internal.write("/Names "+t+" 0 R"))}]),e.events.push(["initialized",function(){var r=this;r.outline={createNamedDestinations:!1,root:{children:[]}},r.outline.add=function(n,i,o){var a={title:i,options:o,children:[]};return n==null&&(n=this.root),n.children.push(a),a},r.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=r,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},r.outline.genIds_r=function(n){n.id=r.internal.newObjectDeferred();for(var i=0;i<n.children.length;i++)this.genIds_r(n.children[i])},r.outline.renderRoot=function(n){this.objStart(n),this.line("/Type /Outlines"),n.children.length>0&&(this.line("/First "+this.makeRef(n.children[0])),this.line("/Last "+this.makeRef(n.children[n.children.length-1]))),this.line("/Count "+this.count_r({count:0},n)),this.objEnd()},r.outline.renderItems=function(n){for(var i=this.ctx.pdf.internal.getVerticalCoordinateString,o=0;o<n.children.length;o++){var a=n.children[o];this.objStart(a),this.line("/Title "+this.makeString(a.title)),this.line("/Parent "+this.makeRef(n)),o>0&&this.line("/Prev "+this.makeRef(n.children[o-1])),o<n.children.length-1&&this.line("/Next "+this.makeRef(n.children[o+1])),a.children.length>0&&(this.line("/First "+this.makeRef(a.children[0])),this.line("/Last "+this.makeRef(a.children[a.children.length-1])));var s=this.count=this.count_r({count:0},a);if(s>0&&this.line("/Count "+s),a.options&&a.options.pageNumber){var c=r.internal.getPageInfo(a.options.pageNumber);this.line("/Dest ["+c.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var l=0;l<n.children.length;l++)this.renderItems(n.children[l])},r.outline.line=function(n){this.ctx.val+=n+`\r
387
387
  `},r.outline.makeRef=function(n){return n.id+" 0 R"},r.outline.makeString=function(n){return"("+r.internal.pdfEscape(n)+")"},r.outline.objStart=function(n){this.ctx.val+=`\r
388
388
  `+n.id+` 0 obj\r
389
389
  <<\r
@@ -391,7 +391,7 @@ T* `):oe.join(` Tj
391
391
  endobj\r
392
392
  `},r.outline.count_r=function(n,i){for(var o=0;o<i.children.length;o++)n.count++,this.count_r(n,i.children[o]);return n.count}}])})(Er.API),(function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(r,n,i,o,a,s){var c,l=this.decode.DCT_DECODE,u=null;if(typeof r=="string"||this.__addimage__.isArrayBuffer(r)||this.__addimage__.isArrayBufferView(r)){switch(r=a||r,r=this.__addimage__.isArrayBuffer(r)?new Uint8Array(r):r,c=(function(d){for(var h,f=256*d.charCodeAt(4)+d.charCodeAt(5),p=d.length,m={width:0,height:0,numcomponents:1},g=4;g<p;g+=2){if(g+=f,t.indexOf(d.charCodeAt(g+1))!==-1){h=256*d.charCodeAt(g+5)+d.charCodeAt(g+6),m={width:256*d.charCodeAt(g+7)+d.charCodeAt(g+8),height:h,numcomponents:d.charCodeAt(g+9)};break}f=256*d.charCodeAt(g+2)+d.charCodeAt(g+3)}return m})(r=this.__addimage__.isArrayBufferView(r)?this.__addimage__.arrayBufferToBinaryString(r):r),c.numcomponents){case 1:s=this.color_spaces.DEVICE_GRAY;break;case 4:s=this.color_spaces.DEVICE_CMYK;break;case 3:s=this.color_spaces.DEVICE_RGB}u={data:r,width:c.width,height:c.height,colorSpace:s,bitsPerComponent:8,filter:l,index:n,alias:i}}return u}})(Er.API),Er.API.processPNG=function(e,t,r,n){if(this.__addimage__.isArrayBuffer(e)&&(e=new Uint8Array(e)),this.__addimage__.isArrayBufferView(e)){var i,o=pIe(e,{checkCrc:!0}),a=o.width,s=o.height,c=o.channels,l=o.palette,u=o.depth;i=l&&c===1?(function(L){for(var P=L.width,N=L.height,z=L.data,Q=L.palette,D=L.depth,I=!1,E=[],x=[],_=void 0,S=!1,B=0,T=0;T<Q.length;T++){var U=wN(Q[T],4),O=U[0],H=U[1],W=U[2],te=U[3];E.push(O,H,W),te!=null&&(te===0?(B++,x.length<1&&x.push(T)):te<255&&(S=!0))}if(S||B>1){I=!0,x=void 0;var V=P*N;_=new Uint8Array(V);for(var ee=new DataView(z.buffer),G=0;G<V;G++){var q=F6(ee,G,D),X=wN(Q[q],4)[3];_[G]=X}}else B===0&&(x=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:I?8:void 0,colorBytes:z,alphaBytes:_,needSMask:I,palette:E,mask:x}})(o):c===2||c===4?(function(L){for(var P=L.data,N=L.width,z=L.height,Q=L.channels,D=L.depth,I=Q===2?"DeviceGray":"DeviceRGB",E=Q-1,x=N*z,_=E,S=x*_,B=1*x,T=Math.ceil(S*D/8),U=Math.ceil(B*D/8),O=new Uint8Array(T),H=new Uint8Array(U),W=new DataView(P.buffer),te=new DataView(O.buffer),V=new DataView(H.buffer),ee=!1,G=0;G<x;G++){for(var q=G*Q,X=0;X<_;X++)BU(te,F6(W,q+X,D),G*_+X,D);var ce=F6(W,q+_,D);ce<(1<<D)-1&&(ee=!0),BU(V,ce,1*G,D)}return{colorSpace:I,colorsPerPixel:E,sMaskBitsPerComponent:ee?D:void 0,colorBytes:O,alphaBytes:H,needSMask:ee}})(o):(function(L){var P=L.data,N=L.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:N,colorsPerPixel:N==="DeviceGray"?1:3,colorBytes:P instanceof Uint16Array?(function(z){for(var Q=z.length,D=new Uint8Array(2*Q),I=new DataView(D.buffer,D.byteOffset,D.byteLength),E=0;E<Q;E++)I.setUint16(2*E,z[E],!1);return D})(P):P,needSMask:!1}})(o);var d,h,f,p=i,m=p.colorSpace,g=p.colorsPerPixel,b=p.sMaskBitsPerComponent,v=p.colorBytes,w=p.alphaBytes,C=p.needSMask,F=p.palette,M=p.mask,j=null;return n!==Er.API.image_compression.NONE&&typeof lB=="function"?(j=(function(L){var P;switch(L){case Er.API.image_compression.FAST:P=11;break;case Er.API.image_compression.MEDIUM:P=13;break;case Er.API.image_compression.SLOW:P=14;break;default:P=12}return P})(n),d=this.decode.FLATE_DECODE,h="/Predictor ".concat(j," /Colors ").concat(g," /BitsPerComponent ").concat(u," /Columns ").concat(a),e=xU(v,Math.ceil(a*g*u/8),g,u,n),C&&(f=xU(w,Math.ceil(a*b/8),1,b,n))):(d=void 0,h=void 0,e=v,C&&(f=w)),(this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e))&&(e=this.__addimage__.arrayBufferToBinaryString(e)),(f&&this.__addimage__.isArrayBuffer(f)||this.__addimage__.isArrayBufferView(f))&&(f=this.__addimage__.arrayBufferToBinaryString(f)),{alias:r,data:e,index:t,filter:d,decodeParameters:h,transparency:M,palette:F,sMask:f,predictor:j,width:a,height:s,bitsPerComponent:u,sMaskBitsPerComponent:b,colorSpace:m}}},(function(e){e.processGIF89A=function(t,r,n,i){var o=new OIe(t),a=o.width,s=o.height,c=[];o.decodeAndBlitFrameRGBA(0,c);var l={data:c,width:a,height:s},u=new D6(100).encode(l,100);return e.processJPEG.call(this,u,r,n,i)},e.processGIF87A=e.processGIF89A})(Er.API),Su.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 r=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:i,green:n,blue:r,quad:o}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Su.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(r){Xi.log("bit decode error:"+r)}},Su.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),r=t%4;for(e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,i=0;i<t;i++)for(var o=this.datav.getUint8(this.pos++,!0),a=n*this.width*4+8*i*4,s=0;s<8&&8*i+s<this.width;s++){var c=this.palette[o>>7-s&1];this.data[a+4*s]=c.blue,this.data[a+4*s+1]=c.green,this.data[a+4*s+2]=c.red,this.data[a+4*s+3]=255}r!==0&&(this.pos+=4-r)}},Su.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,i=0;i<e;i++){var o=this.datav.getUint8(this.pos++,!0),a=n*this.width*4+2*i*4,s=o>>4,c=15&o,l=this.palette[s];if(this.data[a]=l.blue,this.data[a+1]=l.green,this.data[a+2]=l.red,this.data[a+3]=255,2*i+1>=this.width)break;l=this.palette[c],this.data[a+4]=l.blue,this.data[a+4+1]=l.green,this.data[a+4+2]=l.red,this.data[a+4+3]=255}t!==0&&(this.pos+=4-t)}},Su.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var i=this.datav.getUint8(this.pos++,!0),o=r*this.width*4+4*n;if(i<this.palette.length){var a=this.palette[i];this.data[o]=a.red,this.data[o+1]=a.green,this.data[o+2]=a.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)}},Su.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,i=0;i<this.width;i++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var a=(o&t)/t*255|0,s=(o>>5&t)/t*255|0,c=(o>>10&t)/t*255|0,l=o>>15?255:0,u=n*this.width*4+4*i;this.data[u]=c,this.data[u+1]=s,this.data[u+2]=a,this.data[u+3]=l}this.pos+=e}},Su.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),r=parseInt("111111",2),n=this.height-1;n>=0;n--){for(var i=this.bottom_up?n:this.height-1-n,o=0;o<this.width;o++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(a&t)/t*255|0,c=(a>>5&r)/r*255|0,l=(a>>11)/t*255|0,u=i*this.width*4+4*o;this.data[u]=l,this.data[u+1]=c,this.data[u+2]=s,this.data[u+3]=255}this.pos+=e}},Su.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=t*this.width*4+4*r;this.data[a]=o,this.data[a+1]=i,this.data[a+2]=n,this.data[a+3]=255}this.pos+=this.width%4}},Su.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=t*this.width*4+4*r;this.data[s]=o,this.data[s+1]=i,this.data[s+2]=n,this.data[s+3]=a}},Su.prototype.getData=function(){return this.data},(function(e){e.processBMP=function(t,r,n,i){var o=new Su(t,!1),a=o.width,s=o.height,c={data:o.getData(),width:a,height:s},l=new D6(100).encode(c,100);return e.processJPEG.call(this,l,r,n,i)}})(Er.API),MU.prototype.getData=function(){return this.data},(function(e){e.processWEBP=function(t,r,n,i){var o=new MU(t),a=o.width,s=o.height,c={data:o.getData(),width:a,height:s},l=new D6(100).encode(c,100);return e.processJPEG.call(this,l,r,n,i)}})(Er.API),Er.API.processRGBA=function(e,t,r){for(var n=e.data,i=n.length,o=new Uint8Array(i/4*3),a=new Uint8Array(i/4),s=0,c=0,l=0;l<i;l+=4){var u=n[l],d=n[l+1],h=n[l+2],f=n[l+3];o[s++]=u,o[s++]=d,o[s++]=h,a[c++]=f}var p=this.__addimage__.arrayBufferToBinaryString(o);return{alpha:this.__addimage__.arrayBufferToBinaryString(a),data:p,index:t,alias:r,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},Er.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},pm=Er.API,gw=pm.getCharWidthsArray=function(e,t){var r,n,i=(t=t||{}).font||this.internal.getFont(),o=t.fontSize||this.internal.getFontSize(),a=t.charSpace||this.internal.getCharSpace(),s=t.widths?t.widths:i.metadata.Unicode.widths,c=s.fof?s.fof:1,l=t.kerning?t.kerning:i.metadata.Unicode.kerning,u=l.fof?l.fof:1,d=t.doKerning!==!1,h=0,f=e.length,p=0,m=s[0]||c,g=[];for(r=0;r<f;r++)n=e.charCodeAt(r),typeof i.metadata.widthOfString=="function"?g.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(n))+a*(1e3/o)||0)/1e3):(h=d&&di(l[n])==="object"&&!isNaN(parseInt(l[n][p],10))?l[n][p]/u:0,g.push((s[n]||m)/c+h)),p=n;return g},bU=pm.getStringUnitWidth=function(e,t){var r=(t=t||{}).fontSize||this.internal.getFontSize(),n=t.font||this.internal.getFont(),i=t.charSpace||this.internal.getCharSpace();return pm.processArabic&&(e=pm.processArabic(e)),typeof n.metadata.widthOfString=="function"?n.metadata.widthOfString(e,r,i)/r:gw.apply(this,arguments).reduce(function(o,a){return o+a},0)},yU=function(e,t,r,n){for(var i=[],o=0,a=e.length,s=0;o!==a&&s+t[o]<r;)s+=t[o],o++;i.push(e.slice(0,o));var c=o;for(s=0;o!==a;)s+t[o]>n&&(i.push(e.slice(c,o)),s=0,c=o),s+=t[o],o++;return c!==o&&i.push(e.slice(c,o)),i},vU=function(e,t,r){r||(r={});var n,i,o,a,s,c,l,u=[],d=[u],h=r.textIndent||0,f=0,p=0,m=e.split(" "),g=gw.apply(this,[" ",r])[0];if(c=r.lineIndent===-1?m[0].length+2:r.lineIndent||0){var b=Array(c).join(" "),v=[];m.map(function(C){(C=C.split(/\s*\n/)).length>1?v=v.concat(C.map(function(F,M){return(M&&F.length?`
393
393
  `:"")+F})):v.push(C[0])}),m=v,c=bU.apply(this,[b,r])}for(o=0,a=m.length;o<a;o++){var w=0;if(n=m[o],c&&n[0]==`
394
- `&&(n=n.substr(1),w=1),h+f+(p=(i=gw.apply(this,[n,r])).reduce(function(C,F){return C+F},0))>t||w){if(p>t){for(s=yU.apply(this,[n,i,t-(h+f),t]),u.push(s.shift()),u=[s.pop()];s.length;)d.push([s.shift()]);p=i.slice(n.length-(u[0]?u[0].length:0)).reduce(function(C,F){return C+F},0)}else u=[n];d.push(u),h=p+c,f=g}else u.push(n),h+=f+p,f=g}return l=c?function(C,F){return(F?b:"")+C.join(" ")}:function(C){return C.join(" ")},d.map(l)},pm.splitTextToSize=function(e,t,r){var n,i=(r=r||{}).fontSize||this.internal.getFontSize(),o=(function(u){if(u.widths&&u.kerning)return{widths:u.widths,kerning:u.kerning};var d=this.internal.getFont(u.fontName,u.fontStyle),h="Unicode";return d.metadata[h]?{widths:d.metadata[h].widths||{0:1},kerning:d.metadata[h].kerning||{}}:{font:d.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,r);n=Array.isArray(e)?e:String(e).split(/\r?\n/);var a=1*this.internal.scaleFactor*t/i;o.textIndent=r.textIndent?1*r.textIndent*this.internal.scaleFactor/i:0,o.lineIndent=r.lineIndent;var s,c,l=[];for(s=0,c=n.length;s<c;s++)l=l.concat(vU.apply(this,[n[s],a,o]));return l},(function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="0123456789abcdef",r="klmnopqrstuvwxyz",n={},i={},o=0;o<16;o++)n[r[o]]=t[o],i[t[o]]=r[o];var a=function(h){return"0x"+parseInt(h,10).toString(16)},s=e.__fontmetrics__.compress=function(h){var f,p,m,g,b=["{"];for(var v in h){if(f=h[v],isNaN(parseInt(v,10))?p="'"+v+"'":(v=parseInt(v,10),p=(p=a(v).slice(2)).slice(0,-1)+i[p.slice(-1)]),typeof f=="number")f<0?(m=a(f).slice(3),g="-"):(m=a(f).slice(2),g=""),m=g+m.slice(0,-1)+i[m.slice(-1)];else{if(di(f)!=="object")throw new Error("Don't know what to do with value type "+di(f)+".");m=s(f)}b.push(p+m)}return b.push("}"),b.join("")},c=e.__fontmetrics__.uncompress=function(h){if(typeof h!="string")throw new Error("Invalid argument passed to uncompress.");for(var f,p,m,g,b={},v=1,w=b,C=[],F="",M="",j=h.length-1,L=1;L<j;L+=1)(g=h[L])=="'"?f?(m=f.join(""),f=void 0):f=[]:f?f.push(g):g=="{"?(C.push([w,m]),w={},m=void 0):g=="}"?((p=C.pop())[0][p[1]]=w,m=void 0,w=p[0]):g=="-"?v=-1:m===void 0?n.hasOwnProperty(g)?(F+=n[g],m=parseInt(F,16)*v,v=1,F=""):F+=g:n.hasOwnProperty(g)?(M+=n[g],w[m]=parseInt(M,16)*v,v=1,m=void 0,M=""):M+=g;return b},l={codePages:["WinAnsiEncoding"],WinAnsiEncoding:c("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},u={Unicode:{Courier:l,"Courier-Bold":l,"Courier-BoldOblique":l,"Courier-Oblique":l,Helvetica:l,"Helvetica-Bold":l,"Helvetica-BoldOblique":l,"Helvetica-Oblique":l,"Times-Roman":l,"Times-Bold":l,"Times-BoldItalic":l,"Times-Italic":l}},d={Unicode:{"Courier-Oblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":c("{'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":c("{'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:c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":c("{'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:c("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:c("{'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":c("{'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:c("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":c("{'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":c("{'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":c("{'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(h){var f=h.font,p=d.Unicode[f.postScriptName];p&&(f.metadata.Unicode={},f.metadata.Unicode.widths=p.widths,f.metadata.Unicode.kerning=p.kerning);var m=u.Unicode[f.postScriptName];m&&(f.metadata.Unicode.encoding=m,f.encoding=m.codePages[0])}])})(Er.API),(function(e){var t=function(r){for(var n=r.length,i=new Uint8Array(n),o=0;o<n;o++)i[o]=r.charCodeAt(o);return i};e.API.events.push(["addFont",function(r){var n=void 0,i=r.font,o=r.instance;if(!i.isStandardFont){if(o===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if(typeof(n=o.existsFileInVFS(i.postScriptName)===!1?o.loadFile(i.postScriptName):o.getFileFromVFS(i.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");(function(a,s){s=/^\x00\x01\x00\x00/.test(s)?t(s):t(k5(s)),a.metadata=e.API.TTFFont.open(s),a.metadata.Unicode=a.metadata.Unicode||{encoding:{},kerning:{},widths:[]},a.metadata.glyIdsUsed=[0]})(i,n)}}])})(Er),Er.API.addSvgAsImage=function(e,t,r,n,i,o,a,s){if(isNaN(t)||isNaN(r))throw Xi.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(n)||isNaN(i))throw Xi.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var c=document.createElement("canvas");c.width=n,c.height=i;var l=c.getContext("2d");l.fillStyle="#fff",l.fillRect(0,0,c.width,c.height);var u={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return(rn.canvg?Promise.resolve(rn.canvg):TF(()=>import("./index.es-CZ20QLl2-CDq6AdcU.js"),[])).catch(function(h){return Promise.reject(new Error("Could not load canvg: "+h))}).then(function(h){return h.default?h.default:h}).then(function(h){return h.fromString(l,e,u)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(h){return h.render(u)}).then(function(){d.addImage(c.toDataURL("image/jpeg",1),t,r,n,i,a,s)})},Er.API.putTotalPages=function(e){var t,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),r=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(t,r);return this},Er.API.viewerPreferences=function(e,t){var r;e=e||{},t=t||!1;var n,i,o,a={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}},s=Object.keys(a),c=[],l=0,u=0,d=0;function h(p,m){var g,b=!1;for(g=0;g<p.length;g+=1)p[g]===m&&(b=!0);return b}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(a)),this.internal.viewerpreferences.isSubscribed=!1),r=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var f=s.length;for(d=0;d<f;d+=1)r[s[d]].value=r[s[d]].defaultValue,r[s[d]].explicitSet=!1}if(di(e)==="object"){for(i in e)if(o=e[i],h(s,i)&&o!==void 0){if(r[i].type==="boolean"&&typeof o=="boolean")r[i].value=o;else if(r[i].type==="name"&&h(r[i].valueSet,o))r[i].value=o;else if(r[i].type==="integer"&&Number.isInteger(o))r[i].value=o;else if(r[i].type==="array"){for(l=0;l<o.length;l+=1)if(n=!0,o[l].length===1&&typeof o[l][0]=="number")c.push(String(o[l]-1));else if(o[l].length>1){for(u=0;u<o[l].length;u+=1)typeof o[l][u]!="number"&&(n=!1);n===!0&&c.push([o[l][0]-1,o[l][1]-1].join(" "))}r[i].value="["+c.join(" ")+"]"}else r[i].value=r[i].defaultValue;r[i].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var p,m=[];for(p in r)r[p].explicitSet===!0&&(r[p].type==="name"?m.push("/"+p+" /"+r[p].value):m.push("/"+p+" "+r[p].value));m.length!==0&&this.internal.write(`/ViewerPreferences
394
+ `&&(n=n.substr(1),w=1),h+f+(p=(i=gw.apply(this,[n,r])).reduce(function(C,F){return C+F},0))>t||w){if(p>t){for(s=yU.apply(this,[n,i,t-(h+f),t]),u.push(s.shift()),u=[s.pop()];s.length;)d.push([s.shift()]);p=i.slice(n.length-(u[0]?u[0].length:0)).reduce(function(C,F){return C+F},0)}else u=[n];d.push(u),h=p+c,f=g}else u.push(n),h+=f+p,f=g}return l=c?function(C,F){return(F?b:"")+C.join(" ")}:function(C){return C.join(" ")},d.map(l)},pm.splitTextToSize=function(e,t,r){var n,i=(r=r||{}).fontSize||this.internal.getFontSize(),o=(function(u){if(u.widths&&u.kerning)return{widths:u.widths,kerning:u.kerning};var d=this.internal.getFont(u.fontName,u.fontStyle),h="Unicode";return d.metadata[h]?{widths:d.metadata[h].widths||{0:1},kerning:d.metadata[h].kerning||{}}:{font:d.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,r);n=Array.isArray(e)?e:String(e).split(/\r?\n/);var a=1*this.internal.scaleFactor*t/i;o.textIndent=r.textIndent?1*r.textIndent*this.internal.scaleFactor/i:0,o.lineIndent=r.lineIndent;var s,c,l=[];for(s=0,c=n.length;s<c;s++)l=l.concat(vU.apply(this,[n[s],a,o]));return l},(function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="0123456789abcdef",r="klmnopqrstuvwxyz",n={},i={},o=0;o<16;o++)n[r[o]]=t[o],i[t[o]]=r[o];var a=function(h){return"0x"+parseInt(h,10).toString(16)},s=e.__fontmetrics__.compress=function(h){var f,p,m,g,b=["{"];for(var v in h){if(f=h[v],isNaN(parseInt(v,10))?p="'"+v+"'":(v=parseInt(v,10),p=(p=a(v).slice(2)).slice(0,-1)+i[p.slice(-1)]),typeof f=="number")f<0?(m=a(f).slice(3),g="-"):(m=a(f).slice(2),g=""),m=g+m.slice(0,-1)+i[m.slice(-1)];else{if(di(f)!=="object")throw new Error("Don't know what to do with value type "+di(f)+".");m=s(f)}b.push(p+m)}return b.push("}"),b.join("")},c=e.__fontmetrics__.uncompress=function(h){if(typeof h!="string")throw new Error("Invalid argument passed to uncompress.");for(var f,p,m,g,b={},v=1,w=b,C=[],F="",M="",j=h.length-1,L=1;L<j;L+=1)(g=h[L])=="'"?f?(m=f.join(""),f=void 0):f=[]:f?f.push(g):g=="{"?(C.push([w,m]),w={},m=void 0):g=="}"?((p=C.pop())[0][p[1]]=w,m=void 0,w=p[0]):g=="-"?v=-1:m===void 0?n.hasOwnProperty(g)?(F+=n[g],m=parseInt(F,16)*v,v=1,F=""):F+=g:n.hasOwnProperty(g)?(M+=n[g],w[m]=parseInt(M,16)*v,v=1,m=void 0,M=""):M+=g;return b},l={codePages:["WinAnsiEncoding"],WinAnsiEncoding:c("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},u={Unicode:{Courier:l,"Courier-Bold":l,"Courier-BoldOblique":l,"Courier-Oblique":l,Helvetica:l,"Helvetica-Bold":l,"Helvetica-BoldOblique":l,"Helvetica-Oblique":l,"Times-Roman":l,"Times-Bold":l,"Times-BoldItalic":l,"Times-Italic":l}},d={Unicode:{"Courier-Oblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":c("{'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":c("{'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:c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":c("{'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:c("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:c("{'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":c("{'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:c("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":c("{'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":c("{'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":c("{'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(h){var f=h.font,p=d.Unicode[f.postScriptName];p&&(f.metadata.Unicode={},f.metadata.Unicode.widths=p.widths,f.metadata.Unicode.kerning=p.kerning);var m=u.Unicode[f.postScriptName];m&&(f.metadata.Unicode.encoding=m,f.encoding=m.codePages[0])}])})(Er.API),(function(e){var t=function(r){for(var n=r.length,i=new Uint8Array(n),o=0;o<n;o++)i[o]=r.charCodeAt(o);return i};e.API.events.push(["addFont",function(r){var n=void 0,i=r.font,o=r.instance;if(!i.isStandardFont){if(o===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if(typeof(n=o.existsFileInVFS(i.postScriptName)===!1?o.loadFile(i.postScriptName):o.getFileFromVFS(i.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");(function(a,s){s=/^\x00\x01\x00\x00/.test(s)?t(s):t(k5(s)),a.metadata=e.API.TTFFont.open(s),a.metadata.Unicode=a.metadata.Unicode||{encoding:{},kerning:{},widths:[]},a.metadata.glyIdsUsed=[0]})(i,n)}}])})(Er),Er.API.addSvgAsImage=function(e,t,r,n,i,o,a,s){if(isNaN(t)||isNaN(r))throw Xi.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(n)||isNaN(i))throw Xi.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var c=document.createElement("canvas");c.width=n,c.height=i;var l=c.getContext("2d");l.fillStyle="#fff",l.fillRect(0,0,c.width,c.height);var u={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return(rn.canvg?Promise.resolve(rn.canvg):TF(()=>import("./index.es-CZ20QLl2-B8M44yPZ.js"),[])).catch(function(h){return Promise.reject(new Error("Could not load canvg: "+h))}).then(function(h){return h.default?h.default:h}).then(function(h){return h.fromString(l,e,u)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(h){return h.render(u)}).then(function(){d.addImage(c.toDataURL("image/jpeg",1),t,r,n,i,a,s)})},Er.API.putTotalPages=function(e){var t,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),r=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(t,r);return this},Er.API.viewerPreferences=function(e,t){var r;e=e||{},t=t||!1;var n,i,o,a={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}},s=Object.keys(a),c=[],l=0,u=0,d=0;function h(p,m){var g,b=!1;for(g=0;g<p.length;g+=1)p[g]===m&&(b=!0);return b}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(a)),this.internal.viewerpreferences.isSubscribed=!1),r=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var f=s.length;for(d=0;d<f;d+=1)r[s[d]].value=r[s[d]].defaultValue,r[s[d]].explicitSet=!1}if(di(e)==="object"){for(i in e)if(o=e[i],h(s,i)&&o!==void 0){if(r[i].type==="boolean"&&typeof o=="boolean")r[i].value=o;else if(r[i].type==="name"&&h(r[i].valueSet,o))r[i].value=o;else if(r[i].type==="integer"&&Number.isInteger(o))r[i].value=o;else if(r[i].type==="array"){for(l=0;l<o.length;l+=1)if(n=!0,o[l].length===1&&typeof o[l][0]=="number")c.push(String(o[l]-1));else if(o[l].length>1){for(u=0;u<o[l].length;u+=1)typeof o[l][u]!="number"&&(n=!1);n===!0&&c.push([o[l][0]-1,o[l][1]-1].join(" "))}r[i].value="["+c.join(" ")+"]"}else r[i].value=r[i].defaultValue;r[i].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var p,m=[];for(p in r)r[p].explicitSet===!0&&(r[p].type==="name"?m.push("/"+p+" /"+r[p].value):m.push("/"+p+" "+r[p].value));m.length!==0&&this.internal.write(`/ViewerPreferences
395
395
  <<
396
396
  `+m.join(`
397
397
  `)+`
@@ -630,4 +630,4 @@ Content: ${F.content}
630
630
 
631
631
  `)}
632
632
  `,C=await xA(Fo.ai_prompt,[...f,{role:"system",content:"You are a documentation assistant that provides answers based on provided documentation content."},{role:"user",content:w}],r);a({sender:"Bot",message:C.message,type:"text"}),d(C.isTruncated);return}const b=await xA(Fo.ai_prompt,[...f,{role:"user",content:h}],r);a({sender:"Bot",message:b.message,type:"text"})}catch(h){new wr({transactionName:"lyChat.handleSendMessage",modulesProperties:r,data:h}).logException("handleSendMessage: Failed to send message to AI"),console.error(h),a({sender:"Bot",message:"An error occurred while processing your request. Please try again.",type:"text"})}finally{l(),u(!1)}}},Aqe=(e,t)=>[...e.map(r=>({role:r.sender==="User"?"user":"assistant",content:r.message})),{role:"user",content:t}],gqe=e=>{const{chat:t,addMessageToHistory:r}=e,n=ne.useCallback(i=>{r({sender:"Bot",message:i.message,type:"text"})},[]);return t?K.jsx(Jne,{sender:t.sender,children:K.jsx(uae,{chat:t,children:t.type==="action"&&t.action?K.jsxs(gt,{children:[K.jsx($O,{markdown:t.message}),t.action.map((i,o)=>K.jsx(nie,{children:K.jsx(Cv,{id:i.id,actionID:i.componentID,type:tc.button,dialogContent:i.dialogContent,dynamic_params:i.dynamic_params,fixed_params:i.fixed_params,label:i.label,status:n,disabled:!1,component:i.component})},o))]}):t.fileName?K.jsxs(Yr,{variant:"body1",fontStyle:"italic",children:["File sent successfully: ",t.fileName]}):K.jsx($O,{markdown:t.message})})}):null},mqe=ne.memo(e=>{const{chat:t,addMessageToHistory:r}=e;return K.jsx(gqe,{chat:t,addMessageToHistory:r})});function TZ(e){const{componentProperties:t}=e,{userProperties:r,appsProperties:n,modulesProperties:i}=yi(),[o,a]=ne.useState(""),[s,c]=ne.useState([]),[l,u]=ne.useState(!1),[d,h]=ne.useState(null),[f,p]=ne.useState(!1),[m,g]=ne.useState(!1),[b,v]=ne.useState(!1),[w,C]=ne.useState(!1),F=ne.useRef(!0),M=ne.useRef(null),j=ne.useRef(null),L=ne.useRef(!0),P=100,N=()=>bOe(M),z=ne.useRef(null);ne.useEffect(()=>{F.current&&(F.current=!1,D())},[t.id]);const Q=x=>{let _=ct("ai.error");x instanceof Error?_=x.message:typeof x=="object"&&x!==null&&"response"in x&&(_=x.response?.data?.message||ct("ai.error")),I({sender:"Bot",message:_,type:"text"}),g(!0)},D=async()=>{u(!0),g(!1);try{const x={sender:"Bot",message:(await xA(Fo.ai_welcome,[],i)).message,type:"text"};I(x)}catch(x){new wr({transactionName:"FormsAI.initChat",modulesProperties:i,data:x}).logException("AI: Error fetching bot response"),Q(x)}u(!1)};ne.useEffect(()=>{L.current&&requestAnimationFrame(()=>N())},[s]);const I=x=>{c(_=>[..._,x])},E=async()=>{await FH(n,r,i,o,d,s,I,a,h,N,u,C)};return K.jsxs(hae,{children:[K.jsxs(sae,{elevation:1,ref:M,onScroll:()=>vOe(M,L,p,P),children:[s.map((x,_)=>K.jsx(mqe,{chat:x,addMessageToHistory:I},_)),l&&K.jsx(Wne,{children:K.jsx(cy,{})}),m&&K.jsx(Yne,{children:K.jsx(Lr,{variant:"contained",color:io.error,onClick:async()=>{v(!0),await D(),v(!1)},disabled:b,startIcon:b&&K.jsx(cy,{size:20,color:"inherit"}),children:b?"":ct("ai.tryAgain")})})]}),K.jsx(iqe,{ref:z,disabled:l,userInput:o,onChange:a,selectedFile:d,onFileChange:x=>h(x.target.files?.[0]??null),onRemoveFile:()=>h(null),onSend:E,fileInputRef:j,isTruncated:w,scrollBottom:N,showScrollButton:f,onContinue:async()=>{await FH(n,r,i,"Message truncated, continue",null,s,I,a,h,N,u,C)}})]})}function bqe(e){const{isChatOpen:t,handleCloseChat:r}=e,[n,i]=ne.useState(!1),o=Ii("(max-width: 600px)"),a=ko(),[s,c]=ne.useState(()=>o||a),[l,u]=ne.useState({width:500,height:ba.height}),d=ne.useRef(null),h=ne.useRef(null);ne.useEffect(()=>{(o||a)&&c(!0)},[o,a]);const[{x:f,y:p},m]=Dl(()=>({x:0,y:0})),g=uc(w=>{if(w.event.target===d.current){const C=Math.max(300,w.offset[0]),F=Math.max(200,w.offset[1]);u({width:C,height:F})}else s||h.current&&h.current.contains(w.event.target)&&m.start({x:w.offset[0],y:w.offset[1]})},{from:w=>w.target===d.current?[l.width,l.height]:[f.get(),p.get()]}),b=()=>{s&&!a&&!o&&c(!1),i(w=>!w)},v=()=>{!o&&!a&&c(w=>!w)};return K.jsx(gt,{children:t&&K.jsx(sc,{...g(),style:{x:s?0:f,y:s?0:p,bottom:s?0:10,right:s?0:10,top:s?0:"auto",left:s?0:"auto"},children:K.jsxs(oie,{minimized:n,fullScreen:s,userWidth:s?"100vw":`${l.width}px`,userHeight:s?"100dvh":`${l.height}px`,children:[K.jsxs(Gc,{ref:h,onDoubleClick:v,children:[K.jsx("span",{style:{fontWeight:"bold",fontSize:"1rem"},children:n?"Ly-AI":"Chat with Liberty AI"}),K.jsxs(ac,{children:[!s&&!n&&K.jsx(_i,{"aria-label":"minimize",onClick:b,icon:n?Yie:Wie}),!s&&!n&&K.jsx(_i,{"aria-label":"toggle full screen",onClick:v,icon:s?Wc:$c}),K.jsx(_i,{"aria-label":"close",onClick:r,icon:qd})]})]}),K.jsx(iie,{children:K.jsx(TZ,{componentProperties:{id:9999,componentMode:ir.chat,type:fr.FormsAI,label:"defaultLabel",filters:[],showPreviousButton:!1,isChildren:!1}})}),!s&&K.jsx(Qu,{ref:d})]})})})}var Ln=(e=>(e.key="KEY_ATTRIBUTES",e.parent="MENU_PARENT_ID",e.child="MENU_CHILD_ID",e.id="MENU_ID",e.label="MENU_LABEL",e.component="MENU_COMPONENT",e.componentID="MENU_COMPONENT_ID",e.dynamic_params="DYNAMIC_PARAMS",e.fixed_params="FIXED_PARAMS",e.visible="AUT_RUN",e.content="MENU_CONTENT",e))(Ln||{});function JE(e,t="0",r="0"){let n=[];for(const i of e)if(i[Ln.parent]===t&&i[Ln.child].includes(r)){const o=JE(e,i[Ln.child],i[Ln.key]);o.length&&(i.children=o),n.push(i)}return n}const yqe=async e=>{const{appsProperties:t,userProperties:r,modulesProperties:n}=e;let i=[];i.push({header:"",field:De.id,value:r[De.id],type:"string",operator:"=",defined:!0,rules:null,disabled:!1,values:""});const o=await sr.get({source:ar.Framework,framework_pool:t[je.session]===fo.framework?Yt.getDefaultPool:t[je.pool],query:Yt.getFramework.menus,sessionMode:t[je.session],filters:i,language:r[De.language],modulesProperties:n,jwt_token:t[je.jwt_token]});let a=JE(o.items);return{results:o,tree:a}},vqe=e=>window.open(e,"_blank","noreferrer"),wqe=(e,t,r,n)=>{switch(e){case"admin":n();break;case"documentation":vqe("https://docs.nomana-it.fr/liberty/getting-started/");break;case"lyTools":const i={id:9999,type:fr.FormsTools,label:"Liberty Tools",filters:[],showPreviousButton:!1,componentMode:ir.standard,isChildren:!1};t(e),r(i);break}},xqe=async e=>{const{modulesProperties:t}=e;return await sr.applications(t)},_qe=async e=>await sr.put({source:ar.Query,framework_pool:e.appsProperties[je.pool],query:Yt.getQuery.users,sessionMode:fo.framework,modulesProperties:e.modulesProperties,jwt_token:e.appsProperties[je.jwt_token]},JSON.stringify(e.restData)),Sqe=async e=>{const{updatedUserData:t,userProperties:r,modulesProperties:n}=e;let i={[De.id]:r[De.id],[De.name]:r[De.name],[De.password]:r[De.password],[De.email]:r[De.email],[De.status]:"Y",[De.admin]:r[De.admin],[De.language]:r[De.language],[De.displayMode]:r[De.displayMode],[De.readonly]:r[De.readonly],[De.audit_user]:r[De.id],[De.audit_date]:new Date().toISOString(),[De.dashboard]:r[De.dashboard],[De.theme]:r[De.theme]},o=r[De.password];if(t[De.password]!==void 0&&t[De.password]!==r[De.password]){if(t[De.password]!==t[De.password_confirm])return{status:Xt.error,data:i};o=await sr.encrypt(t[De.password],n)}return i[De.id]=r[De.id],i[De.name]=t[De.name]??r[De.name],i[De.password]=o??r[De.password],i[De.email]=t[De.email]??r[De.email],i[De.status]="Y",i[De.admin]=r[De.admin],i[De.language]=t[De.language]??r[De.language],i[De.displayMode]=t[De.displayMode]??r[De.displayMode],i[De.readonly]=r[De.readonly],i[De.audit_user]=r[De.id],i[De.audit_date]=new Date().toISOString(),i[De.dashboard]=t[De.dashboard]??r[De.dashboard],i[De.theme]=t[De.theme]??r[De.theme],{status:Xt.success,data:i}};function kqe(e){const{selectedIndex:t,setSelectedIndex:r,onMenuSelect:n,onToggleMenusDrawer:i}=e,{userProperties:o,appsProperties:a}=yi(),s=o[De.dashboard]||a[je.dashboard],c=ne.useMemo(()=>({selected:t==="dashboard",onClick:()=>{if(s!=null){const l={id:s,type:fr.FormsDashboard,label:ct("dashboard"),filters:[],showPreviousButton:!1,componentMode:ir.find,isChildren:!1};r("dashboard"),i(),n(l)}},disabled:s==null}),[i,t,r,s,n]);return K.jsx(sy,{variant:"text",fullWidth:!0,...c,startIcon:Hie,children:ct("dashboard")})}function FZ(e){const{item:t,openMenus:r,setOpenMenus:n,selectedIndex:i,setSelectedIndex:o,onMenuSelect:a,onToggleMenusDrawer:s}=e,{[Ln.key]:c,[Ln.componentID]:l,[Ln.component]:u,[Ln.label]:d,[Ln.fixed_params]:h,[Ln.content]:f,menuIcon:p}=t,[m,g]=ne.useState(r.includes(c)),b=ne.useMemo(()=>h?h.split(";").map(M=>{const j=M.split("=");return{header:"",field:j[0],value:j[1],type:"string",operator:"=",defined:!0,rules:"",disabled:!0,values:""}}):[],[h]),v=ne.useCallback(M=>{n(j=>m?j.filter(L=>L!==M):[...j,M]),g(!m)},[m,n]),w=ne.useCallback(M=>{if(l!=null){const j={id:l,type:u,label:d,filters:b,showPreviousButton:!1,componentMode:ir.find,isChildren:!1,content:f};o(M),s(),a(j)}},[s,o,a,l,b,u,d]),C=ne.useMemo(()=>({selected:i===t[Ln.key],onClick:()=>{w(c),v(c)}}),[i,w,v,t]),F=ne.useMemo(()=>Array.isArray(t.children)&&t.children.length>0,[t.children]);return K.jsxs(ne.Fragment,{children:[K.jsxs(Va,{children:[!F&&K.jsx(sy,{variant:"text",fullWidth:!0,...C,startIcon:t.menuIcon,children:K.jsx(G5,{selected:C.selected,children:t[Ln.label]})}),F&&K.jsx(zae,{variant:"text",fullWidth:!0,...C,startIcon:t.menuIcon,endIcon:m?kz:Cz,open:m,children:K.jsx(G5,{selected:C.selected,children:t[Ln.label]})})]},c),F&&K.jsx(C7,{in:m,children:K.jsx(Rp,{padding:!0,children:t.children?.filter(M=>M[Ln.visible]==="Y").map(M=>K.jsx(FZ,{item:M,openMenus:r,setOpenMenus:n,selectedIndex:i,setSelectedIndex:o,onMenuSelect:a,onToggleMenusDrawer:s},M[Ln.key]))})})]})}function Cqe(e){const{openMenus:t,setOpenMenus:r,selectedIndex:n,setSelectedIndex:i,onMenuSelect:o,onToggleMenusDrawer:a}=e,{userProperties:s,appsProperties:c,modulesProperties:l,getMenus:u}=yi(),[d,h]=ne.useState([]),f=ne.useCallback(async()=>{try{const p=u?{results:await u(),tree:JE((await u()).items)}:await yqe({appsProperties:c,userProperties:s,modulesProperties:l});p.results.status===Xt.error&&new wr({transactionName:"DynamicMenus.getMenus",modulesProperties:l,data:p}).logException("Menus: Error fetching menus"),h(p.tree)}catch(p){new wr({transactionName:"DynamicMenus.getMenus",modulesProperties:l,data:p}).logException("Menus: Error fetching menus")}},[c,s]);return ne.useEffect(()=>{f()},[f]),K.jsx(Rp,{padding:!1,children:d.filter(p=>p[Ln.visible]==="Y").map(p=>K.jsx(FZ,{item:p,openMenus:t,setOpenMenus:r,selectedIndex:n,setSelectedIndex:i,onMenuSelect:o,onToggleMenusDrawer:a},p[Ln.key]))})}function DZ(e){const{item:t,openMenus:r,setOpenMenus:n,selectedIndex:i,setSelectedIndex:o,onMenuSelect:a}=e,{userProperties:s,appsProperties:c,session:l}=yi(),[u,d]=ne.useState(r.includes(t[Ln.key])),h=ne.useCallback(g=>{n(b=>u?b.filter(v=>v!==g):[...b,g]),d(!u)},[u,n]),f=ne.useCallback(g=>{wqe(g,o,a,l),["admin","lyAI","lyTools"].includes(g)||h(g)},[o,a,h,c,s]),p=ne.useMemo(()=>({selected:i===t[Ln.key],onClick:()=>f(t[Ln.key])}),[i,t[Ln.key],f]),m=ne.useMemo(()=>Array.isArray(t.children)&&t.children.length>0,[t.children]);return K.jsxs(ne.Fragment,{children:[K.jsxs(Va,{children:[!m&&K.jsx(sy,{variant:"text",fullWidth:!0,...p,startIcon:t.menuIcon,children:K.jsx(G5,{children:t[Ln.label]})}),m&&K.jsx(sy,{variant:"text",fullWidth:!0,...p,startIcon:t.menuIcon,endIcon:u?kz:Cz,children:K.jsx(G5,{children:t[Ln.label]})})]},t[Ln.key]),m&&K.jsx(C7,{in:u,children:K.jsx(Rp,{padding:!1,children:t.children?.map(g=>K.jsx(DZ,{item:g,openMenus:r,setOpenMenus:n,selectedIndex:i,setSelectedIndex:o,onMenuSelect:a},g[Ln.key]))})})]})}function Bqe(e){const{openMenus:t,setOpenMenus:r,selectedIndex:n,setSelectedIndex:i,onMenuSelect:o}=e,{userProperties:a,appsProperties:s}=yi(),c=ne.useMemo(()=>[{[Ln.key]:"documentation",[Ln.label]:"Documentation",menuIcon:Vie,[Ln.visible]:!0,children:[]},{[Ln.key]:"lyTools",[Ln.label]:"Liberty Tools",menuIcon:$ie,[Ln.visible]:!0,children:[]},{[Ln.key]:"admin",[Ln.label]:ct("admin"),menuIcon:Bz,[Ln.visible]:a[De.admin]==="Y",children:[]}],[a,s[je.session]]);return K.jsx(Hae,{padding:!1,children:c.filter(l=>l[Ln.visible]).map(l=>K.jsx(DZ,{item:l,openMenus:t,setOpenMenus:r,selectedIndex:n,setSelectedIndex:i,onMenuSelect:o},l[Ln.key]))})}function Eqe(e){const{isOpen:t,onMenuSelect:r,onToggleMenusDrawer:n}=e,{userProperties:i,appsProperties:o}=yi(),[a,s]=ne.useState([]),[c,l]=ne.useState(null);ne.useEffect(()=>{s([])},[o,i[De.language]]);const u=ne.useCallback(()=>{n()},[n]);return K.jsxs(K.Fragment,{children:[K.jsx(Sie,{open:t,onClick:u}),K.jsx(kie,{open:t,children:K.jsxs(Cie,{children:[K.jsxs(Bie,{children:[K.jsxs(Yr,{variant:"body2",align:"center",component:"a",href:"https://nomana-it.fr/",target:"_blank",rel:"noopener noreferrer",children:["Liberty © Nomana-IT ",new Date().getFullYear(),"."]}),K.jsx(_i,{onClick:u,icon:Fie})]}),K.jsxs(Eie,{children:[K.jsx(fD,{children:K.jsx(kqe,{selectedIndex:c,setSelectedIndex:l,onMenuSelect:r,onToggleMenusDrawer:n})}),K.jsx(Mie,{children:K.jsx(Cqe,{openMenus:a,setOpenMenus:s,selectedIndex:c,setSelectedIndex:l,onMenuSelect:r,onToggleMenusDrawer:n})}),K.jsx(fD,{children:K.jsx(Bqe,{openMenus:a,setOpenMenus:s,selectedIndex:c,setSelectedIndex:l,onMenuSelect:r,onToggleMenusDrawer:n})})]})]})})]})}const Mqe=ne.memo(e=>{const{onToggleChat:t,onToggleDarkMode:r,onToggleUserSettings:n,onSignout:i}=e,{userProperties:o}=yi(),a=k4(),s=o[De.status]===!0;return K.jsxs(Zne,{children:[K.jsx(_i,{"aria-label":"Toggle Dark Mode",onClick:r,icon:a.darkMode?yz:vz}),s&&K.jsx(_i,{onClick:t,icon:Die}),s&&K.jsx(_i,{icon:Iie}),s&&K.jsx(_i,{onClick:n,icon:Oie}),s&&K.jsx(_i,{onClick:i,icon:Rie})]})});function Tqe(e){const{onToggleMenusDrawer:t,onToggleDarkMode:r,onToggleUserSettings:n,onToggleChat:i,onSignout:o}=e,{userProperties:a,appsProperties:s,logout:c,disconnect:l,socket:u}=yi(),d=s[je.name],h=a[De.status]===!0,f=Ii("(max-width: 600px)"),p=ko(),m=()=>{c(),l(),o()};return K.jsxs(_ie,{children:[h&&K.jsx(_i,{onClick:t,icon:Tie,style:{marginLeft:"8px"}}),K.jsxs(xie,{children:[K.jsxs(Xne,{children:[K.jsx(Oz,{width:"32px",height:"32px"}),!f&&!p&&K.jsx(mae,{noWrap:!0,children:d})]}),K.jsx($a,{orientation:"vertical",flexItem:!0}),K.jsx(Mqe,{onToggleChat:i,onToggleDarkMode:r,onToggleUserSettings:n,onSignout:m})]})]})}const Fqe=({onFieldChange:e})=>K.jsx("form",{}),Dqe=e=>{const{onAutocompleteChanged:t,darkMode:r,inputLanguage:n,inputDashboard:i,inputTheme:o,handleButtonClick:a}=e,s=ne.useMemo(()=>[{id:Lf.dark,name:r?"Mode: Dark":"Mode: Light",icon:r?vz:yz}],[r]);return K.jsxs(ne.Fragment,{children:[s.map(c=>K.jsx(Of,{children:K.jsx(zoe,{variant:"contained",endIcon:c.icon,onClick:()=>{a(c.id)},children:c.name},c.id)},c.id)),K.jsx(Of,{children:K.jsx(Fp,{id:De.language,lookupID:Yt.getQuery.lookupLanguage,label:"Language",defaultValue:n??"",disabled:!1,onChange:t,displayWhite:!0,sessionMode:fo.framework},De.language)}),K.jsx(Of,{children:K.jsx(Fp,{id:De.dashboard,lookupID:Yt.getQuery.lookupDashboard,label:"Dashboard",defaultValue:i??"",disabled:!1,onChange:t,displayWhite:!0,fixed_params:"COL_COMPONENT=FormsDashboard",sessionMode:fo.framework},De.dashboard)}),K.jsx(Of,{children:K.jsx(sh,{id:De.theme,enumID:Yt.getQuery.enumTheme,label:"Theme",defaultValue:o??"",disabled:!1,onChange:t,variant:"standard",freeSolo:!0,searchByLabel:!1,sessionMode:fo.framework,overrideQueryPool:Yt.getDefaultPool},De.theme)})]})},Iqe=({userProperties:e,onFieldChange:t})=>K.jsxs(K.Fragment,{children:[K.jsx(Of,{children:K.jsx(Cr,{variant:"standard",defaultValue:e[De.id],required:!0,fullWidth:!0,id:De.id,label:ct("login.userid"),name:"user",autoComplete:"user",disabled:!0,onChange:t})}),K.jsx(Of,{children:K.jsx(Cr,{variant:"standard",defaultValue:e[De.name],required:!0,fullWidth:!0,id:De.name,label:ct("login.username"),name:"user",autoComplete:"user",autoFocus:!0,onChange:t})}),K.jsx(Of,{children:K.jsx(Cr,{variant:"standard",defaultValue:e[De.email],required:!0,fullWidth:!0,id:De.email,label:ct("login.email"),name:"email",autoComplete:"email",onChange:t})}),K.jsx(Of,{children:K.jsx(Cr,{variant:"standard",required:!0,fullWidth:!0,id:De.password,label:ct("login.password"),type:"password",autoComplete:"off",onChange:t})}),K.jsx(Of,{children:K.jsx(Cr,{variant:"standard",required:!0,fullWidth:!0,id:De.password_confirm,label:ct("login.confirm_password"),type:"password",autoComplete:"off",onChange:t})})]}),Rqe=({children:e,value:t,index:r,...n})=>K.jsx(ne.Fragment,{children:K.jsx(p7,{role:"tabpanel",hidden:t!==r,id:`tabpanel-${r}`,"aria-labelledby":`tab-${r}`,...n,children:K.jsx(A7,{children:e})})}),Oqe=e=>{const{openDialog:t,setOpenDialog:r,onToggleDarkMode:n}=e,{userProperties:i,appsProperties:o,modulesProperties:a,login:s}=yi(),c=Ii("(max-width: 600px)"),l=ko(),[u,d]=ne.useState(()=>c||l),[h,f]=ne.useState({width:ba.width,height:ba.height}),p=ne.useRef(null),m=ne.useRef(null),[g,b]=ne.useState({[De.id]:i[De.id],[De.name]:i[De.name],[De.password]:i[De.password],[De.password_confirm]:i[De.password],[De.email]:i[De.email],[De.status]:"Y",[De.admin]:i[De.admin],[De.language]:i[De.language],[De.displayMode]:i[De.displayMode],[De.darkMode]:i[De.darkMode],[De.readonly]:i[De.readonly],[De.dashboard]:i[De.dashboard],[De.theme]:i[De.theme]}),[v,w]=ne.useState(!1),[C,F]=ne.useState("user"),[M,j]=ne.useState({message:"",open:!1}),[L,P]=ne.useState(!1),[N,z]=ne.useState(!1),[Q,D]=ne.useState(null),[I,E]=ne.useState(null),[x,_]=ne.useState(null),[S,B]=ne.useState(i[De.darkMode]);ne.useEffect(()=>{(async()=>i[De.status]&&(w(!0),B(i[De.darkMode]),D(i[De.language]),E(i[De.dashboard]?.toString()||null),_(i[De.theme]?.toString()||null),b({[De.id]:i[De.id],[De.name]:i[De.name],[De.password]:i[De.password],[De.password_confirm]:i[De.password],[De.email]:i[De.email],[De.status]:"Y",[De.admin]:i[De.admin],[De.language]:i[De.language],[De.displayMode]:i[De.displayMode],[De.darkMode]:i[De.darkMode],[De.readonly]:i[De.readonly],[De.dashboard]:i[De.dashboard],[De.theme]:i[De.theme]}),w(!1)))()},[o[je.id],i]);const T=ne.useCallback((ue,me)=>{F(me)},[]),U=ne.useCallback(()=>{const ue=!S;b(me=>({...me,[De.displayMode]:ue?Lf.dark:Lf.light})),n(),z(!0),B(!S)},[S,g,b]),O=ue=>{switch(ue){case Lf.dark:U();break}},H=ne.useCallback(async()=>{try{const ue=await Sqe({updatedUserData:g,userProperties:i,modulesProperties:a});if(ue.status===Xt.error)j({open:!0,message:ct("login.passwordError"),severity:Pr.error});else{const me={restData:ue.data,appsProperties:o,modulesProperties:a},ge=await _qe(me);ge.status===Xt.success?(z(!1),s({[De.status]:!0,[De.id]:ue.data[De.id],[De.name]:ue.data[De.name],[De.email]:ue.data[De.email],[De.password]:ue.data[De.password],[De.admin]:ue.data[De.admin],[De.language]:ue.data[De.language],[De.displayMode]:ue.data[De.displayMode],[De.darkMode]:ue.data[De.displayMode]===Lf.dark,[De.readonly]:ue.data[De.readonly],[De.dashboard]:ue.data[De.dashboard],[De.theme]:ue.data[De.theme]}),j({open:!1,message:""})):(new wr({transactionName:"AppsUser.handleSave",modulesProperties:a,data:ge}).logException("Users: Save User Settings"),j({open:!0,message:ge.items[0].message,severity:Pr.error}))}}catch(ue){new wr({transactionName:"AppsUser.handleSave",modulesProperties:a,data:ue}).logException("Users: Save User Settings"),j({open:!0,message:ct("unexpectedError"),severity:Pr.error})}},[g,o[je.pool],i,s,j,a]),W=ne.useCallback(ue=>{const{id:me,value:ge}=ue.target;b(Ee=>({...Ee,[me]:ge})),z(!0)},[]),te=ne.useCallback(()=>{N?P(!0):r(!t)},[N,r,P]),V=ue=>{const me=ue.id;b(ge=>({...ge,[me]:ue.value})),z(!0)},ee=()=>{j({open:!1,message:""})};ne.useEffect(()=>{(c||l)&&d(!0)},[c,l]);const[{x:G,y:q},X]=Dl(()=>({x:0,y:0})),ce=uc(ue=>{if(ue.event.target===p.current){const me=Math.max(300,ue.offset[0]),ge=Math.max(200,ue.offset[1]);f({width:me,height:ge})}else u||m.current&&m.current.contains(ue.event.target)&&X.start({x:ue.offset[0],y:ue.offset[1]})},{from:ue=>ue.target===p.current?[h.width,h.height]:[G.get(),q.get()]}),fe=()=>{c||d(ue=>!ue)},ie=[{id:"user",label:ct("users_settings"),component:K.jsx(Iqe,{userProperties:i,onFieldChange:W})},{id:"ui",label:ct("ui_settings"),component:K.jsx(Dqe,{onAutocompleteChanged:V,darkMode:S,inputLanguage:Q,inputDashboard:I,inputTheme:x,handleButtonClick:O,appsProperties:o,userProperties:i,modulesProperties:a})},{id:"notification",label:ct("notifications_settings"),component:K.jsx(Fqe,{userProperties:i,onFieldChange:W})}],le=ne.useCallback(()=>{j({open:!1,message:""}),P(!0)},[j,P]),re=ne.useCallback(()=>{j({open:!1,message:""}),P(!1)},[j,P]),Ae=ne.useCallback(()=>{z(!1),b({[De.id]:i[De.id],[De.name]:i[De.name],[De.password]:i[De.password],[De.password_confirm]:i[De.password],[De.email]:i[De.email],[De.status]:"Y",[De.admin]:i[De.admin],[De.language]:i[De.language],[De.displayMode]:i[De.displayMode],[De.darkMode]:i[De.darkMode],[De.readonly]:i[De.readonly],[De.dashboard]:i[De.dashboard],[De.theme]:i[De.theme]}),B(i[De.darkMode]),j({open:!1,message:""}),P(!1),r(!t)},[z,b,i,r,P]);return t?v?K.jsx(lg,{}):Ws.createPortal(K.jsxs(ne.Fragment,{children:[K.jsx(Vc,{}),K.jsxs(sc,{...ce(),style:{x:u?0:G,y:u?0:q,bottom:u?0:"auto",right:u?0:"auto",top:u?0:"50%",left:u?0:"50%"},children:[K.jsx(s0,{open:L,title:ct("dialogs.dataNotSaved"),content:ct("dialogs.confirmCloseDialog"),onClose:le,onDecline:re,onAccept:Ae}),K.jsxs(Kc,{fullScreen:u,userWidth:u?"100vw":`${h.width}px`,userHeight:u?"100dvh":`${h.height}px`,children:[K.jsxs(Gc,{ref:m,onDoubleClick:fe,children:[K.jsx("span",{style:{fontWeight:"bold",fontSize:"1rem",fontVariant:"small-caps"},children:ct(i[De.name])}),K.jsx(ac,{children:K.jsx(_i,{"aria-label":"toggle full screen",onClick:fe,icon:u?Wc:$c})})]}),K.jsx(Tne,{children:K.jsxs(Wf,{elevation:0,children:[K.jsx(Kd,{open:M.open,severity:M.severity,message:M.message,onClose:ee}),K.jsx(v7,{elevation:0,children:K.jsx(z5,{children:K.jsxs(o4,{children:[K.jsx(Lr,{disabled:!1,variant:"outlined",startIcon:Fl,onClick:te,color:N?io.error:io.primary,children:ct("button.cancel")}),K.jsx(Lr,{disabled:!N,variant:"outlined",startIcon:Xy,onClick:H,color:N?io.success:io.primary,children:ct("button.save")})]})})}),K.jsx(S7,{value:C,onChange:T,"aria-label":"settings tabs",children:ie.map(ue=>K.jsx(k7,{id:ue.id,label:ue.label,value:ue.id},ue.id))}),ie.map(ue=>K.jsx(Rqe,{value:C,index:ue.id,children:K.jsx(gt,{children:ue.component})},ue.id))]})})]})]})]}),document.body):null};function qw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}var Lqe={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function XB(e,t){function r(i,o,a){if(!(typeof document>"u")){a=qw({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var c in a)a[c]&&(s+="; "+c,a[c]!==!0&&(s+="="+a[c].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+s}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},s=0;s<o.length;s++){var c=o[s].split("="),l=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(a[u]=e.read(l,u),i===u)break}catch{}}return i?a[i]:a}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",qw({},o,{expires:-1}))},withAttributes:function(i){return XB(this.converter,qw({},this.attributes,i))},withConverter:function(i){return XB(qw({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var IZ=XB(Lqe,{path:"/"});const Pqe=(e,t)=>e.message==="loginError"?(t({open:!0,message:ct("login.loginError"),severity:Pr.error}),!1):e.message==="passwordError"?(t({open:!0,message:ct("login.passwordError"),severity:Pr.error}),!1):!0,jqe=async(e,t,r,n)=>{try{e(!0),await new Promise(o=>setTimeout(o,300));const i=n?await n():await xqe({modulesProperties:r});return i.status===Xt.error&&new wr({transactionName:"loginUtils.getApplications",modulesProperties:r,data:i}).logException("Login: Failed to fetch applications"),t(i.items),i}catch(i){new wr({transactionName:"loginUtils.getApplications",modulesProperties:r,data:i}).logException("Login: Failed to fetch applications"),t([])}finally{e(!1)}},Nqe=e=>{const{userProperties:t,login:r,selectedApplication:n,connect:i,jwt_token:o,socket:a}=e,s={[De.status]:!0,[De.id]:t[De.id],[De.name]:t[De.name],[De.email]:t[De.email],[De.password]:t[De.password],[De.admin]:t[De.admin],[De.language]:t[De.language],[De.displayMode]:t[De.displayMode],[De.darkMode]:t[De.displayMode]===Lf.dark,[De.readonly]:t[De.readonly],[De.dashboard]:t[De.dashboard],[De.theme]:t[De.theme]};IZ.set("applicationId",n[je.id].toString(),{expires:30}),i({[je.id]:n[je.id],[je.pool]:n[je.pool],[je.name]:n[je.name],[je.description]:n[je.description],[je.offset]:n[je.offset],[je.limit]:n[je.limit],[je.version]:n[je.version],[je.session]:fo.session,[je.dashboard]:n[je.dashboard],[je.theme]:n[je.theme],[je.jwt_token]:o}),r(s),a&&Id(a).connect({user:t[De.id],application:n[je.id]})},Uqe=()=>{const{auth:e,modulesProperties:t,login:r,connect:n,socket:i,getApplications:o,getToken:a,getUser:s,getEncryptedText:c}=yi(),[l,u]=ne.useState(!1),[d,h]=ne.useState(null),[f,p]=ne.useState([]),[m,g]=ne.useState({message:"",open:!1});ne.useEffect(()=>{(async()=>{try{const F=IZ.get("applicationId"),M=await jqe(u,p,t,o);if(F){const j=M.items.find(L=>L[je.id]===parseInt(F));j&&h(j)}}catch(F){new wr({transactionName:"AppsLogin.initialize",modulesProperties:t,data:F}).logException("Login: Failed to fetch applications")}})()},[t]);const b=ne.useCallback(F=>{h(F)},[]),v=ne.useCallback(async F=>{F.preventDefault();const M=new FormData(F.currentTarget),j=M.get("user"),L=M.get("password");try{if(e&&!e.isAuthenticated&&!t.login.enabled){g({open:!0,message:ct("login.authRequired"),severity:Pr.error}),e.signinPopup();return}if(!d){g({open:!0,message:ct("login.applicationError"),severity:Pr.error});return}const P=a?await a(t.login.enabled?j:e?.user?.profile.preferred_username,c?await c(L):L):await sr.token(t.login.enabled?j:e?.user?.profile.preferred_username,t.login.enabled?await sr.encrypt(L,t):"",d[je.pool],fo.session,t,t.login.enabled?"database":"oidc");if(!Pqe(P,g))return;const N=s?await s(t.login.enabled?j:e?.user?.profile.preferred_username):await sr.user({user:t.login.enabled?j:e?.user?.profile.preferred_username,pool:d[je.pool],sessionMode:fo.session,modulesProperties:t,jwt_token:P.access_token});if(N.status===Xt.success){let z=N.items[0];if(r&&n){const Q={userProperties:z,login:r,selectedApplication:d,connect:n,jwt_token:P.access_token,socket:i};Nqe(Q)}else g({open:!0,message:"User or Apps properties are not set",severity:Pr.error})}else{const z=N.status==="loginerror"?ct("login.loginError"):ct("login.passwordError");g({open:!0,message:z,severity:Pr.error})}}catch(P){new wr({transactionName:"AppsLogin.handleSubmit",modulesProperties:t,data:P}).logException("Login: Validate and connect application"),g({open:!0,message:"Unexpected error occurred",severity:Pr.error})}},[e,d,t,g]),w=ne.useMemo(()=>f,[f]),C=()=>{g({open:!1,message:""})};return l?K.jsx(lg,{}):K.jsx(vie,{children:K.jsxs(iae,{elevation:3,children:[K.jsx(Oz,{width:"75px",height:"75px"}),K.jsxs(Sae,{noValidate:!0,onSubmit:v,children:[K.jsx(Kd,{open:m.open,severity:m.severity,message:m.message,onClose:C}),t.login&&t.login.enabled&&K.jsxs(ne.Fragment,{children:[K.jsx(uD,{children:K.jsx(AD,{variant:"standard",required:!0,fullWidth:!0,id:"userid",label:ct("login.userid"),name:"user",autoComplete:"user",autoFocus:!0})}),K.jsx(uD,{children:K.jsx(AD,{variant:"standard",required:!0,fullWidth:!0,name:"password",label:ct("login.password"),type:"password",id:"password",autoComplete:"off"})})]}),K.jsx(Q7,{spacing:2,py:2,px:1,columns:{xs:1,sm:2},children:w.map(F=>K.jsx(Jr,{children:K.jsx(Mae,{isSelected:d===F,children:K.jsxs(Hz,{onClick:()=>b(F),children:[K.jsx(Qz,{title:F[je.name]}),K.jsx(_7,{children:F[je.description]})]})})},F[je.id]))}),K.jsx(Hoe,{type:"submit",fullWidth:!0,variant:"contained",children:ct("login.loginButton")})]})]})})},Qqe=({tabs:e,activeTab:t,onTabChange:r,onCloseTab:n})=>{const i=(o,a)=>{a.stopPropagation(),n(o)};return K.jsx(S7,{variant:"scrollable",scrollButtons:!0,value:t,onChange:r,children:e.map(o=>K.jsx(k7,{label:K.jsxs(mie,{children:[o[Qt.component].label,K.jsx(Yoe,{onClick:a=>i(o[Qt.sequence],a),icon:qd,size:Vn.small})]}),value:o[Qt.sequence],id:`tab-${o[Qt.sequence]}`},o[Qt.sequence]))})},Hqe=({children:e,value:t,index:r,...n})=>K.jsx(p7,{role:"tabpanel",hidden:t!==r,id:`tabpanel-${r}`,"aria-labelledby":`tab-${r}`,...n,children:K.jsx(A7,{children:e})}),DH="tab-id-",zqe="-table",qqe="-component",Kqe=e=>{const{initialTab:t}=e,{userProperties:r,appsProperties:n,modulesProperties:i,socket:o}=yi(),[a,s]=ne.useState([]),[c,l]=ne.useState(t?`${DH}${t.type}-${t.id}`:""),u=p=>{const m=`${DH}${p.type}-${p.id}`,g=a.find(b=>b[Qt.component].id===p.id&&b[Qt.component].type===p.type);if(g)l(g[Qt.sequence]);else{const b={[Qt.sequence]:m,[Qt.component]:p};s(v=>[...v,b]),l(m)}},d=p=>{s(m=>{const g=m.filter(b=>b[Qt.sequence]!==p);if(p===c&&g.length>0){const b=g[0][Qt.sequence]||"";l(b)}return g})},h=()=>{s([]),l("")},f=ne.useMemo(()=>a.map(p=>({...p,content:Vqe({component:p[Qt.component],appsProperties:n,userProperties:r,modulesProperties:i,socket:o,children:p[Qt.component].content})})),[a]);return{tabs:a,activeTab:c,addTab:u,closeTab:d,clearTabs:h,setActiveTab:l,memoizedContent:f}},vk=e=>{const{component:t,viewMode:r,appsProperties:n,userProperties:i,modulesProperties:o,socket:a}=e;return K.jsx(tp,{elevation:0,children:K.jsx(Uf,{viewMode:r,displayMode:ec.component,viewGrid:r!==So.list,componentProperties:t,readonly:!1},t.id+qqe)},t.id+zqe)},Gqe=e=>{},Vqe=e=>{const{component:t,appsProperties:r,userProperties:n,modulesProperties:i,socket:o,children:a}=e;switch(t.type){case fr.FormsContent:return a;case fr.FormsTable:const s={component:t,viewMode:So.table,appsProperties:r,userProperties:n,modulesProperties:i,socket:o};return vk(s);case fr.FormsTree:const c={component:t,viewMode:So.tree,appsProperties:r,userProperties:n,modulesProperties:i,socket:o};return vk(c);case fr.FormsList:const l={component:t,viewMode:So.list,appsProperties:r,userProperties:n,modulesProperties:i,socket:o};return vk(l);case fr.FormsDialog:return K.jsx(m3,{componentProperties:t,onClose:Gqe});case fr.FormsUpload:return K.jsx(zE,{componentProperties:t});case fr.FormsChart:return K.jsx(HE,{componentProperties:t});case fr.FormsDashboard:return K.jsx(gX,{componentProperties:t});case fr.FormsAI:return K.jsx(TZ,{componentProperties:t});case fr.FormsTools:return K.jsx(AX,{});default:return null}};function $qe(){const[e,t]=ne.useState(!1),{userProperties:r,appsProperties:n}=yi(),{toggleDarkMode:i}=k4(),[o,a]=ne.useState(!1),[s,c]=ne.useState(!1),{tabs:l,activeTab:u,addTab:d,closeTab:h,setActiveTab:f,memoizedContent:p,clearTabs:m}=Kqe({}),[g,b]=ne.useState(!1),v=()=>{const N=r[De.dashboard]||n[je.dashboard];if(N){const z={id:N,type:fr.FormsDashboard,label:ct("dashboard"),filters:[],showPreviousButton:!1,componentMode:ir.find,isChildren:!1};d(z)}};ne.useEffect(()=>{l.length===0&&g&&(r[De.status]&&v(),b(!1))},[l,g,r[De.status]]),ne.useEffect(()=>{m(),b(!0)},[n[je.session],r[De.status]]);const w=N=>d(N),C=(N,z)=>f(z),F=()=>{i()},M=()=>{t(!e)},j=()=>{a(!o)},L=()=>{c(!s)},P=()=>{c(!1)};return K.jsxs(gie,{children:[K.jsx(y6e,{}),K.jsx(Tqe,{onToggleMenusDrawer:M,onToggleDarkMode:F,onToggleChat:L,onToggleUserSettings:j,onSignout:P}),r[De.status]&&K.jsxs(Zoe,{children:[K.jsx(bqe,{isChatOpen:s,handleCloseChat:L}),K.jsx(Oqe,{openDialog:o,setOpenDialog:j,onToggleDarkMode:F}),K.jsx(Eqe,{onMenuSelect:w,onToggleMenusDrawer:M,isOpen:e}),l.length>0&&K.jsx(Qqe,{tabs:l,activeTab:u,onTabChange:C,onCloseTab:h}),p.map(N=>K.jsx(Hqe,{value:u,index:N[Qt.sequence],children:N.content},N[Qt.sequence]))]}),!r[De.status]&&K.jsx(Joe,{children:K.jsx(Uqe,{})})]})}const Wqe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Yqe={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Xqe=e=>Yqe[e],Zqe=e=>e.replace(Wqe,Xqe);let IH={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Zqe};const Jqe=(e={})=>{IH={...IH,...e}},eKe={type:"3rdParty",init(e){Jqe(e.options.react)}},tKe=ne.createContext();function rKe({i18n:e,defaultNS:t,children:r}){const n=ne.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return ne.createElement(tKe.Provider,{value:n},r)}const{slice:nKe,forEach:iKe}=[];function oKe(e){return iKe.call(nKe.call(arguments,1),t=>{if(t)for(const r in t)e[r]===void 0&&(e[r]=t[r])}),e}function aKe(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(e))}const RH=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,sKe=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},n=encodeURIComponent(t);let i=`${e}=${n}`;if(r.maxAge>0){const o=r.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(o)}`}if(r.domain){if(!RH.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!RH.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(i+="; Partitioned"),i},OH={create(e,t,r,n){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+r*60*1e3)),n&&(i.domain=n),document.cookie=sKe(e,t,i)},read(e){const t=`${e}=`,r=document.cookie.split(";");for(let n=0;n<r.length;n++){let i=r[n];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return i.substring(t.length,i.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var lKe={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return OH.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:r,cookieMinutes:n,cookieDomain:i,cookieOptions:o}=t;r&&typeof document<"u"&&OH.create(r,e,n,i,o)}},cKe={name:"querystring",lookup(e){let{lookupQuerystring:t}=e,r;if(typeof window<"u"){let{search:n}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));const i=n.substring(1).split("&");for(let o=0;o<i.length;o++){const a=i[o].indexOf("=");a>0&&i[o].substring(0,a)===t&&(r=i[o].substring(a+1))}}return r}},uKe={name:"hash",lookup(e){let{lookupHash:t,lookupFromHashIndex:r}=e,n;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const o=i.substring(1);if(t){const a=o.split("&");for(let s=0;s<a.length;s++){const c=a[s].indexOf("=");c>0&&a[s].substring(0,c)===t&&(n=a[s].substring(c+1))}}if(n)return n;if(!n&&r>-1){const a=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof r=="number"?r:0]?.replace("/",""):void 0}}}return n}};let _m=null;const LH=()=>{if(_m!==null)return _m;try{if(_m=typeof window<"u"&&window.localStorage!==null,!_m)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{_m=!1}return _m};var dKe={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&LH())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:r}=t;r&&LH()&&window.localStorage.setItem(r,e)}};let Sm=null;const PH=()=>{if(Sm!==null)return Sm;try{if(Sm=typeof window<"u"&&window.sessionStorage!==null,!Sm)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Sm=!1}return Sm};var fKe={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&PH())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:r}=t;r&&PH()&&window.sessionStorage.setItem(r,e)}},hKe={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:r,userLanguage:n,language:i}=navigator;if(r)for(let o=0;o<r.length;o++)t.push(r[o]);n&&t.push(n),i&&t.push(i)}return t.length>0?t:void 0}},pKe={name:"htmlTag",lookup(e){let{htmlTag:t}=e,r;const n=t||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},AKe={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?r[typeof t=="number"?t:0]?.replace("/",""):void 0}},gKe={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const r=typeof t=="number"?t+1:1,n=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[r]}};let RZ=!1;try{document.cookie,RZ=!0}catch{}const OZ=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];RZ||OZ.splice(1,1);const mKe=()=>({order:OZ,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class LZ{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,r)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=oKe(r,this.options||{},mKe()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(lKe),this.addDetector(cKe),this.addDetector(dKe),this.addDetector(fKe),this.addDetector(hKe),this.addDetector(pKe),this.addDetector(AKe),this.addDetector(gKe),this.addDetector(uKe)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,r=[];return t.forEach(n=>{if(this.detectors[n]){let i=this.detectors[n].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(r=r.concat(i))}}),r=r.filter(n=>n!=null&&!aKe(n)).map(n=>this.options.convertDetectedLanguage(n)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||r.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(t,this.options)}))}}LZ.type="languageDetector";const bKe="Loading...",yKe="Content copied to clipboard: ",vKe="Content read from clipboard: ",wKe="Unexpected Error, please contact your admin",xKe="Data saved successfully",_Ke="Task executed successfully: ",SKe="Task is running...",kKe="Task canceled",CKe="Your changes are not saved, please cancel or save",BKe="UI Settings",EKe="User Settings",MKe="Notifications Settings",TKe="Dashboard",FKe="Sign out",DKe="Framework",IKe="Links",RKe={userid:"User ID",username:"Full Name",password:"Password",confirm_password:"Confirm Password",email:"Email",application:"Application",loginError:"Invalid Login",passwordError:"Invalid Password",applicationError:"Application not selected",authRequired:"Authentication required",loginButton:"Sign in",signin:"Sign in",connected:"Connected",anonymous:"Anonymous",mode:"Admin",loading:"Get list of available applications"},OKe={label:"Filters",operator:{eq:"equals",like:"contains",sup:">=",inf:"<="}},LKe={help:"Table Properties",confirm:"Confirmation",no_results:"No results found",rows:"Rows",search:"Search...",findSelect:"Search & Select: ",component:"Component: ",id:"Table ID: ",description:"Description: ",query:"Query ID: ",delete:"Are you sure you want to delete this row? This action is irreversible and will permanently remove this data.",SelectedRowsError:"No rows selected",MultipleRowsError:"You should select only one row",FilterDefinitionError:"Filters for contextual menus are incorrectly set, please check definition",copyToClipboard:"Failed to copy to clipboard: ",pasteFromClipoard:"Failed to read from clipboard: "},PKe={help:"Dialog Properties",mappingError:"Check your dialog definition, some columns in the query are not mapped :",component:"Component: ",id:"Form ID: ",mode:"Mode: ",saveDialog:"Please close the dialog before moving to another application",dataNotSaved:"Data not saved",confirmCloseDialog:"Data are not saved, are you sure you want to cancel? Unsaved data will be lost",runTask:"Run task",confirmRunTask:"Do you want to execute the task? ",export:{allColumns:"All",visibleColumns:"Visible",selectedRows:"Selected",allRows:"All",visibleRows:"Visible",csv:"Export to CSV",excel:"Export to Excel",pdf:"Export to PDF",columnId:"Column ID",columnName:"Column Name",options:"Export options",header:"Columns Header",columns:"Columns",rows:"Rows"}},jKe={confirm:"Do you want to execute the task? ",run:"Run",cancel:"Cancel",params:"Parameters: "},NKe={apply:"Apply",reset:"Reset",cancel:"Cancel",yes:"Yes",no:"No",help:"Help",back:"Back to previous",filters:{title:"Filters",add:"Add Filter",remove_all:"Remove All"},density:"Density",columns:"Columns",displayMode:{table:"Table View",tree:"Tree View",chart:"Chart View"},dialogsMode:{add:"Add",edit:"Edit",copy:"Copy",delete:"Delete",reorder:"Reorder Lines",edit_lines:"Edit table"},about:"About",download:"Data export",upload:"Data import",save:"Save",save_close:"Save and close",add_value:"Add",scroll_top:"Scroll to top",discard:"Discard",copy:"Copy",paste:"Paste",autosize:"Autosize",close:"Close",image:"Switch to: Image",text:"Switch to: Text",import:"Import",open:"Open",sort_asc:"Sort Ascending",sort_desc:"Sort Descending",sort_clear:"Clear Sorting",pin_column:"Pin Column",unpin_column:"Unpin Column",pin_left:"Pin Left",pin_right:"Pin Right",autosize_column:"Autosize Column",autosize_all_columns:"Autosize All Columns",group_by:"Group By",ungroup_by:"Ungroup",hide_column:"Hide Column",manage_columns:"Manage Columns",properties:"Properties"},UKe={hello:"Hello",error:"AI is not responding, please try later",message:"Message Liberty AI"},QKe={size:"File is too large. Please select a file smaller than 5 MB.",type:"Invalid file type. Please select a valid file.",success:"File uploaded successfully"},HKe={message:"Type a message..."},zKe={help:"Column Properties",dictionary:"Dictionary ID: ",target:"Database ID: ",name:"Column Name: ",type:"Column Type: ",rules:"Rules: ",rulesValues:"Rules ID: "},qKe={loading:bKe,copyToClipboard:yKe,pasteFromClipoard:vKe,unexpectedError:wKe,save_ok:xKe,run_ok:_Ke,run_now:SKe,run_cancel:kKe,save_ko:CKe,ui_settings:BKe,users_settings:EKe,notifications_settings:MKe,dashboard:TKe,signout:FKe,admin:DKe,links:IKe,login:RKe,filters:OKe,tables:LKe,dialogs:PKe,tasks:jKe,button:NKe,ai:UKe,files:QKe,chat:HKe,columns:zKe},KKe="Chargement...",GKe="Contenu copié dans le presse papier",VKe="Contenu collé depuis le presse papier",$Ke="Erreur inconnue, veuillez contacter votre administrateur",WKe="Données enregistrées avec succès",YKe="Exécution réussie",XKe="Tâche en cours d'exécution...",ZKe="Exécution annulée",JKe="Vos modifications ne sont pas enregistrées, veuillez annuler ou sauvegarder",e8e="Paramètres Affichage",t8e="Paramètres utilisateur",r8e="Paramètres de notification",n8e="Tableau de bord",i8e="Déconnexion",o8e="admin",a8e="Liens",s8e={userid:"Identifiant utilisateur",username:"Nom complet",password:"Mot de passe",confirm_password:"Confirmer le mot de passe",email:"Email",application:"Application",loginError:"Connexion invalide",passwordError:"Mot de passe invalide",applicationError:"Application non sélectionnée",authRequired:"Authentification requise",loginButton:"Connexion",signin:"Se connecter",connected:"Connecté",anonymous:"Anonyme",mode:"Administrateur",loading:"Chargement de la liste des applications"},l8e={label:"Filtres",operator:{eq:"égal à",like:"contient",sup:">=",inf:"<="}},c8e={help:"Propriétés de la table",confirm:"Confirmation",rows:"Lignes",no_results:"Aucun résultat trouvé",search:"Rechercher...",findSelect:"Rechercher et sélectionner : ",component:"Composant : ",id:"ID de la table : ",description:"Description : ",query:"ID de la requête : ",delete:"Êtes-vous sûr de vouloir supprimer cette ligne ? Cette action est irréversible et supprimera définitivement ces données.",SelectedRowsError:"Aucune ligne sélectionnée",MultipleRowsError:"Vous devez sélectionner une seule ligne",FilterDefinitionError:"Les filtres des menus contextuels sont mal définis, veuillez vérifier la définition",copyToClipboard:"Échec de la copie dans le presse-papier : ",pasteFromClipoard:"Échec de la lecture du presse-papier : "},u8e={help:"Propriétés du dialogue",mappingError:"Vérifiez la définition de votre dialogue, certaines colonnes dans la requête ne sont pas mappées :",component:"Composant : ",id:"ID du formulaire : ",mode:"Mode : ",saveDialog:"Veuillez fermer le dialogue avant de passer à une autre application",dataNotSaved:"Données non enregistrées",confirmCloseDialog:"Les données ne sont pas enregistrées, êtes-vous sûr de vouloir annuler ? Les données non enregistrées seront perdues",runTask:"Exécuter la tâche",confirmRunTask:"Voulez-vous exécuter la tâche ? ",export:{allColumns:"Toutes",visibleColumns:"Visibles",selectedRows:"Sélectionnées",allRows:"Toutes",visibleRows:"Visibles",csv:"Exporter en CSV",excel:"Exporter en Excel",pdf:"Exporter en PDF",columnId:"ID de colonne",columnName:"Nom de colonne",options:"Options d'exportation",header:"En-tête de colonnes",columns:"Colonnes",rows:"Lignes"}},d8e={confirm:"Voulez-vous exécuter la tâche ? ",run:"Exécuter",cancel:"Annuler",params:"Paramètres : "},f8e={apply:"Appliquer",reset:"Réinitialiser",cancel:"Annuler",yes:"Oui",no:"Non",help:"Aide",back:"Retour au précédent",filters:{title:"Filtres",add:"Ajouter Filtre",remove_all:"Tout supprimer"},density:"Densité",columns:"Colonnes",displayMode:{table:"Vue Tableau",tree:"Vue Arborescente",chart:"Vue Graphique"},dialogsMode:{add:"Ajouter",edit:"Modifier",copy:"Copier",delete:"Supprimer",reorder:"Réorganiser les lignes",edit_lines:"Modifier la table"},about:"À propos",download:"Exportation de données",upload:"Importation de données",save:"Enregistrer",save_close:"Enregistrer et fermer",add_value:"Ajouter",scroll_top:"Défiler vers le haut",discard:"Abandonner",copy:"Copier",paste:"Coller",autosize:"Ajuster automatiquement",close:"Fermer",image:"Mode: Image",text:"Mode: Text",import:"Import",open:"Ouvrir",sort_asc:"Tri Croissant",sort_desc:"Tri Décroissant",sort_clear:"Effacer le tri",pin_column:"Épingler la colonne",unpin_column:"Détacher la colonne",pin_left:"Épingler à gauche",pin_right:"Épingler à droite",autosize_column:"Ajuster la colonne",autosize_all_columns:"Ajuster toutes les colonnes",group_by:"Grouper",ungroup_by:"Dégrouper",hide_column:"Masquer la colonne",manage_columns:"Gérer les colonnes",properties:"Propriétés"},h8e={hello:"Bonjour",error:"L'IA ne répond pas, veuillez réesayer ultérieurement",message:"Message Liberty AI"},p8e={size:"Le fichier est trop volumineux. Veuillez sélectionner un fichier de moins de 5 Mo.",type:"Type de fichier invalide. Veuillez sélectionner un fichier valide.",success:"Fichier téléchargé avec succès."},A8e={message:"Ecrire un message..."},g8e={help:"Propriétés de la colonne",dictionary:"ID du dictionnaire: ",target:"ID base de données: ",name:"Nom de la colonne: ",type:"Type de colonne: ",rules:"Règles: ",rulesValues:"Valeurs ID: "},m8e={loading:KKe,copyToClipboard:GKe,pasteFromClipoard:VKe,unexpectedError:$Ke,save_ok:WKe,run_ok:YKe,run_now:XKe,run_cancel:ZKe,save_ko:JKe,ui_settings:e8e,users_settings:t8e,notifications_settings:r8e,dashboard:n8e,signout:i8e,admin:o8e,links:a8e,login:s8e,filters:l8e,tables:c8e,dialogs:u8e,tasks:d8e,button:f8e,ai:h8e,files:p8e,chat:A8e,columns:g8e},b8e={en:{translation:qKe},fr:{translation:m8e}};Ja.use(LZ).use(eKe);Ja.init({resources:b8e,detection:{order:["path","navigator"]},fallbackLng:"en",debug:!1});Ja.t;class y8e extends ne.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,r){console.error("Error caught by ErrorBoundary:",t,r),Qn()&&T4(t)}render(){return this.state.hasError?this.props.fallback||K.jsx(gt,{children:"An unexpected error has occurred."}):this.props.children}}const v8e=({children:e})=>K.jsx(rKe,{i18n:Ja,children:e}),w8e="/assets/background_ly-VdfFMP8a.jpg",x8e=e=>{const{userProperties:t,appsProperties:r,modulesProperties:n}=e,[i,o]=ne.useState([]),a=t?.[De.theme]||r?.[je.theme]||"liberty",s=[{header:"",field:"THM_NAME",value:a,type:"text",operator:"=",defined:!0,rules:null,disabled:!1,values:""}],c=(u,d)=>{const h={};return u.forEach(({TCL_KEY:f,TCL_LIGHT:p,TCL_DARK:m})=>{const g=d?m:p,b=f.split(".");b.length>1?(h[b[0]]||(h[b[0]]={}),h[b[0]][b[1]]=g):h[f]=g}),h};return ne.useEffect(()=>{(async()=>{try{const d=await sr.themes(n,s,Yt.getDefaultPool);o(d.items)}catch(d){console.error("Error fetching theme colors:",d)}})()},[a,n,r,t]),{theme:u=>{const d=c(i,u);return{palette:{mode:u?"dark":"light",primary:{main:typeof d.primary=="string"?d.primary:u?"#607d8b":"#1976d2"},secondary:{main:typeof d.secondary=="string"?d.secondary:u?"#ffc107":"#1976d2"},text:{primary:u?"rgba(255, 255, 255, 0.87)":"rgba(0, 0, 0, 0.87)",secondary:u?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.6)",disabled:u?"rgba(255, 255, 255, 0.38)":"rgba(0, 0, 0, 0.38)"},background:{default:u?"#121212":"#ffffff",paper:u?"#1d1d1d":"#ffffff"},divider:u?"rgba(255, 255, 255, 0.12)":"rgba(0, 0, 0, 0.12)",action:{hover:u?"rgba(255, 255, 255, 0.05)":"rgba(0, 0, 0, 0.05)",selected:u?"rgba(255, 255, 255, 0.16)":"rgba(0, 0, 0, 0.08)",disabled:u?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.26)"},grey:{100:u?"#e0e0e0":"#f5f5f5",200:u?"#c7c7c7":"#eeeeee",300:u?"#a4a4a4":"#e0e0e0",400:u?"#8f8f8f":"#bdbdbd",500:u?"#757575":"#9e9e9e",600:u?"#626262":"#757575",700:u?"#515151":"#616161",800:u?"#3a3a3a":"#424242"}},background:{default:typeof d.background=="string"?d.background??(u?"linear-gradient(to left, #2C5364, #203A43, #0F2027)":"linear-gradient(to left, #a1c4fd, #c2e9fb)"):"linear-gradient(to left, #2C5364, #203A43, #0F2027)",loginPage:u?"linear-gradient(to right, rgba(44, 83, 100, 0.7), rgba(32, 58, 67, 0.7), rgba(15, 32, 39, 0.7))":"linear-gradient(to right, rgba(161, 196, 253, 0.7), rgba(194, 233, 251, 0.7))",loginImage:`url(${w8e})`},backgroundShades:{light:{start:"#e0e0e0",middle:"#f5f5f5"},dark:{start:"#424242",middle:"#303030"}},color:{default:typeof d.color=="string"?d.color:u?"#E1D9D1":"#333333"},spacing:h=>`${8*h}px`,shadows:["none","0px 1px 3px rgba(0,0,0,0.2)","0px 3px 6px rgba(0,0,0,0.3)"]}}}};function _8e(){const{userProperties:e,appsProperties:t,modulesProperties:r}=yi(),{theme:n}=x8e({appsProperties:t,userProperties:e,modulesProperties:r});return Ff.jsx(m0e,{customTheme:n,children:Ff.jsx($qe,{})})}class E1 extends Error{}E1.prototype.name="InvalidTokenError";function S8e(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function k8e(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return S8e(t)}catch{return atob(t)}}function C8e(e,t){if(typeof e!="string")throw new E1("Invalid token specified: must be a string");t||(t={});const r=t.header===!0?0:1,n=e.split(".")[r];if(typeof n!="string")throw new E1(`Invalid token specified: missing part #${r+1}`);let i;try{i=k8e(n)}catch(o){throw new E1(`Invalid token specified: invalid base64 for part #${r+1} (${o.message})`)}try{return JSON.parse(i)}catch(o){throw new E1(`Invalid token specified: invalid json for part #${r+1} (${o.message})`)}}var B8e={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},xd,_d,Zx=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(Zx||{});(e=>{function t(){xd=3,_d=B8e}e.reset=t;function r(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");xd=i}e.setLevel=r;function n(i){_d=i}e.setLogger=n})(Zx||(Zx={}));var $n=class yd{constructor(t){this._name=t}debug(...t){xd>=4&&_d.debug(yd._format(this._name,this._method),...t)}info(...t){xd>=3&&_d.info(yd._format(this._name,this._method),...t)}warn(...t){xd>=2&&_d.warn(yd._format(this._name,this._method),...t)}error(...t){xd>=1&&_d.error(yd._format(this._name,this._method),...t)}throw(t){throw this.error(t),t}create(t){const r=Object.create(this);return r._method=t,r.debug("begin"),r}static createStatic(t,r){const n=new yd(`${t}.${r}`);return n.debug("begin"),n}static _format(t,r){const n=`[${t}]`;return r?`${n} ${r}:`:n}static debug(t,...r){xd>=4&&_d.debug(yd._format(t),...r)}static info(t,...r){xd>=3&&_d.info(yd._format(t),...r)}static warn(t,...r){xd>=2&&_d.warn(yd._format(t),...r)}static error(t,...r){xd>=1&&_d.error(yd._format(t),...r)}};Zx.reset();var Wy=class{static decode(e){try{return C8e(e)}catch(t){throw $n.error("JwtUtils.decode",t),t}}static async generateSignedJwt(e,t,r){const n=ga.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e))),i=ga.encodeBase64Url(new TextEncoder().encode(JSON.stringify(t))),o=`${n}.${i}`,a=await window.crypto.subtle.sign({name:"ECDSA",hash:{name:"SHA-256"}},r,new TextEncoder().encode(o)),s=ga.encodeBase64Url(new Uint8Array(a));return`${o}.${s}`}static async generateSignedJwtWithHmac(e,t,r){const n=ga.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e))),i=ga.encodeBase64Url(new TextEncoder().encode(JSON.stringify(t))),o=`${n}.${i}`,a=await window.crypto.subtle.sign("HMAC",r,new TextEncoder().encode(o)),s=ga.encodeBase64Url(new Uint8Array(a));return`${o}.${s}`}},E8e="10000000-1000-4000-8000-100000000000",ZB=e=>btoa([...new Uint8Array(e)].map(t=>String.fromCharCode(t)).join("")),PZ=class Bu{static _randomWord(){const t=new Uint32Array(1);return crypto.getRandomValues(t),t[0]}static generateUUIDv4(){return E8e.replace(/[018]/g,r=>(+r^Bu._randomWord()&15>>+r/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Bu.generateUUIDv4()+Bu.generateUUIDv4()+Bu.generateUUIDv4()}static async generateCodeChallenge(t){if(!crypto.subtle)throw new Error("Crypto.subtle is available only in secure contexts (HTTPS).");try{const n=new TextEncoder().encode(t),i=await crypto.subtle.digest("SHA-256",n);return ZB(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(r){throw $n.error("CryptoUtils.generateCodeChallenge",r),r}}static generateBasicAuth(t,r){const i=new TextEncoder().encode([t,r].join(":"));return ZB(i)}static async hash(t,r){const n=new TextEncoder().encode(r),i=await crypto.subtle.digest(t,n);return new Uint8Array(i)}static async customCalculateJwkThumbprint(t){let r;switch(t.kty){case"RSA":r={e:t.e,kty:t.kty,n:t.n};break;case"EC":r={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":r={crv:t.crv,kty:t.kty,x:t.x};break;case"oct":r={crv:t.k,kty:t.kty};break;default:throw new Error("Unknown jwk type")}const n=await Bu.hash("SHA-256",JSON.stringify(r));return Bu.encodeBase64Url(n)}static async generateDPoPProof({url:t,accessToken:r,httpMethod:n,keyPair:i,nonce:o}){let a,s;const c={jti:window.crypto.randomUUID(),htm:n??"GET",htu:t,iat:Math.floor(Date.now()/1e3)};r&&(a=await Bu.hash("SHA-256",r),s=Bu.encodeBase64Url(a),c.ath=s),o&&(c.nonce=o);try{const l=await crypto.subtle.exportKey("jwk",i.publicKey),u={alg:"ES256",typ:"dpop+jwt",jwk:{crv:l.crv,kty:l.kty,x:l.x,y:l.y}};return await Wy.generateSignedJwt(u,c,i.privateKey)}catch(l){throw l instanceof TypeError?new Error(`Error exporting dpop public key: ${l.message}`):l}}static async generateDPoPJkt(t){try{const r=await crypto.subtle.exportKey("jwk",t.publicKey);return await Bu.customCalculateJwkThumbprint(r)}catch(r){throw r instanceof TypeError?new Error(`Could not retrieve dpop keys from storage: ${r.message}`):r}}static async generateDPoPKeys(){return await window.crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign","verify"])}static async generateClientAssertionJwt(t,r,n,i="HS256"){const o=Math.floor(Date.now()/1e3),a={alg:i,typ:"JWT"},s={iss:t,sub:t,aud:n,jti:Bu.generateUUIDv4(),exp:o+300,iat:o},l={HS256:"SHA-256",HS384:"SHA-384",HS512:"SHA-512"}[i];if(!l)throw new Error(`Unsupported algorithm: ${i}. Supported algorithms are: HS256, HS384, HS512`);const u=new TextEncoder,d=await crypto.subtle.importKey("raw",u.encode(r),{name:"HMAC",hash:l},!1,["sign"]);return await Wy.generateSignedJwtWithHmac(a,s,d)}};PZ.encodeBase64Url=e=>ZB(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");var ga=PZ,ap=class{constructor(t){this._name=t,this._callbacks=[],this._logger=new $n(`Event('${this._name}')`)}addHandler(t){return this._callbacks.push(t),()=>this.removeHandler(t)}removeHandler(t){const r=this._callbacks.lastIndexOf(t);r>=0&&this._callbacks.splice(r,1)}async raise(...t){this._logger.debug("raise:",...t);for(const r of this._callbacks)await r(...t)}},jH=class{static center({...e}){var t,r,n;return e.width==null&&(e.width=(t=[800,720,600,480].find(i=>i<=window.outerWidth/1.618))!=null?t:360),(r=e.left)!=null||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),e.height!=null&&((n=e.top)!=null||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,r])=>`${t}=${typeof r!="boolean"?r:r?"yes":"no"}`).join(",")}},lh=class P5 extends ap{constructor(){super(...arguments),this._logger=new $n(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const t=this._expiration-P5.getEpochTime();this._logger.debug("timer completes in",t),this._expiration<=P5.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(t){const r=this._logger.create("init");t=Math.max(Math.floor(t),1);const n=P5.getEpochTime()+t;if(this.expiration===n&&this._timerHandle){r.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),r.debug("using duration",t),this._expiration=n;const i=Math.min(t,5);this._timerHandle=setInterval(this._callback,i*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},JB=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const n=new URL(e,"http://127.0.0.1")[t==="fragment"?"hash":"search"];return new URLSearchParams(n.slice(1))}},B0=";",og=class extends Error{constructor(e,t){var r,n,i;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw $n.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=(r=e.error_description)!=null?r:null,this.error_uri=(n=e.error_uri)!=null?n:null,this.state=e.userState,this.session_state=(i=e.session_state)!=null?i:null,this.url_state=e.url_state}},eM=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},M8e=class{constructor(e){this._logger=new $n("AccessTokenEvents"),this._expiringTimer=new lh("Access token expiring"),this._expiredTimer=new lh("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}async load(e){const t=this._logger.create("load");if(e.access_token&&e.expires_in!==void 0){const r=e.expires_in;if(t.debug("access token present, remaining duration:",r),r>0){let i=r-this._expiringNotificationTimeInSeconds;i<=0&&(i=1),t.debug("registering expiring timer, raising in",i,"seconds"),this._expiringTimer.init(i)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const n=r+1;t.debug("registering expired timer, raising in",n,"seconds"),this._expiredTimer.init(n)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}async unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},T8e=class{constructor(e,t,r,n,i){this._callback=e,this._client_id=t,this._intervalInSeconds=n,this._stopOnError=i,this._logger=new $n("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=a=>{a.origin===this._frame_origin&&a.source===this._frame.contentWindow&&(a.data==="error"?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):a.data==="changed"?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(a.data+" message from check session op iframe"))};const o=new URL(r);this._frame_origin=o.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=o.href}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const t=()=>{!this._frame.contentWindow||!this._session_state||this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,this._intervalInSeconds*1e3)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},jZ=class{constructor(){this._logger=new $n("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},e7=class extends Error{constructor(e,t){super(t),this.name="ErrorDPoPNonce",this.nonce=e}},tM=class{constructor(e=[],t=null,r={}){this._jwtHandler=t,this._extraHeaders=r,this._logger=new $n("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:r,...n}=t;if(!r)return await fetch(e,n);const i=new AbortController,o=setTimeout(()=>i.abort(),r*1e3);try{return await fetch(e,{...t,signal:i.signal})}catch(a){throw a instanceof DOMException&&a.name==="AbortError"?new eM("Network timed out"):a}finally{clearTimeout(o)}}async getJson(e,{token:t,credentials:r,timeoutInSeconds:n}={}){const i=this._logger.create("getJson"),o={Accept:this._contentTypes.join(", ")};t&&(i.debug("token passed, setting Authorization header"),o.Authorization="Bearer "+t),this._appendExtraHeaders(o);let a;try{i.debug("url:",e),a=await this.fetchWithTimeout(e,{method:"GET",headers:o,timeoutInSeconds:n,credentials:r})}catch(l){throw i.error("Network Error"),l}i.debug("HTTP response received, status",a.status);const s=a.headers.get("Content-Type");if(s&&!this._contentTypes.find(l=>s.startsWith(l))&&i.throw(new Error(`Invalid response Content-Type: ${s??"undefined"}, from URL: ${e}`)),a.ok&&this._jwtHandler&&s?.startsWith("application/jwt"))return await this._jwtHandler(await a.text());let c;try{c=await a.json()}catch(l){throw i.error("Error parsing JSON response",l),a.ok?l:new Error(`${a.statusText} (${a.status})`)}if(!a.ok)throw i.error("Error from server:",c),c.error?new og(c):new Error(`${a.statusText} (${a.status}): ${JSON.stringify(c)}`);return c}async postForm(e,{body:t,basicAuth:r,timeoutInSeconds:n,initCredentials:i,extraHeaders:o}){const a=this._logger.create("postForm"),s={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded",...o};r!==void 0&&(s.Authorization="Basic "+r),this._appendExtraHeaders(s);let c;try{a.debug("url:",e),c=await this.fetchWithTimeout(e,{method:"POST",headers:s,body:t,timeoutInSeconds:n,credentials:i})}catch(h){throw a.error("Network error"),h}a.debug("HTTP response received, status",c.status);const l=c.headers.get("Content-Type");if(l&&!this._contentTypes.find(h=>l.startsWith(h)))throw new Error(`Invalid response Content-Type: ${l??"undefined"}, from URL: ${e}`);const u=await c.text();let d={};if(u)try{d=JSON.parse(u)}catch(h){throw a.error("Error parsing JSON response",h),c.ok?h:new Error(`${c.statusText} (${c.status})`)}if(!c.ok){if(a.error("Error from server:",d),c.headers.has("dpop-nonce")){const h=c.headers.get("dpop-nonce");throw new e7(h,`${JSON.stringify(d)}`)}throw d.error?new og(d,t):new Error(`${c.statusText} (${c.status}): ${JSON.stringify(d)}`)}return d}_appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),r=Object.keys(this._extraHeaders),n=["accept","content-type"],i=["authorization"];r.length!==0&&r.forEach(o=>{if(n.includes(o.toLocaleLowerCase())){t.warn("Protected header could not be set",o,n);return}if(i.includes(o.toLocaleLowerCase())&&Object.keys(e).includes(o)){t.warn("Header could not be overridden",o,i);return}const a=typeof this._extraHeaders[o]=="function"?this._extraHeaders[o]():this._extraHeaders[o];a&&a!==""&&(e[o]=a)})}},F8e=class{constructor(e){this._settings=e,this._logger=new $n("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new tM(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},t,this._settings.metadataSeed),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){const r=this._logger.create(`_getMetadataProperty('${e}')`),n=await this.getMetadata();if(r.debug("resolved"),n[e]===void 0){if(t===!0){r.warn("Metadata does not contain optional property");return}r.throw(new Error("Metadata does not contain property "+e))}return n[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);const r=await this._jsonService.getJson(t,{timeoutInSeconds:this._settings.requestTimeoutInSeconds});if(e.debug("got key set",r),!Array.isArray(r.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=r.keys,this._signingKeys}},NZ=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new $n("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){return this._logger.create(`get('${e}')`),e=this._prefix+e,await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,t=[];for(let r=0;r<e;r++){const n=await this._store.key(r);n&&n.indexOf(this._prefix)===0&&t.push(n.substr(this._prefix.length))}return t}},D8e="code",I8e="openid",R8e="client_secret_post",O8e=900,t7=class{constructor({authority:e,metadataUrl:t,metadata:r,signingKeys:n,metadataSeed:i,client_id:o,client_secret:a,response_type:s=D8e,scope:c=I8e,redirect_uri:l,post_logout_redirect_uri:u,client_authentication:d=R8e,token_endpoint_auth_signing_alg:h="HS256",prompt:f,display:p,max_age:m,ui_locales:g,acr_values:b,resource:v,response_mode:w,filterProtocolClaims:C=!0,loadUserInfo:F=!1,requestTimeoutInSeconds:M,staleStateAgeInSeconds:j=O8e,mergeClaimsStrategy:L={array:"replace"},disablePKCE:P=!1,stateStore:N,revokeTokenAdditionalContentTypes:z,fetchRequestCredentials:Q,refreshTokenAllowedScope:D,extraQueryParams:I={},extraTokenParams:E={},extraHeaders:x={},dpop:_,omitScopeWhenRequesting:S=!1}){var B;if(this.authority=e,t?this.metadataUrl=t:(this.metadataUrl=e,e&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=r,this.metadataSeed=i,this.signingKeys=n,this.client_id=o,this.client_secret=a,this.response_type=s,this.scope=c,this.redirect_uri=l,this.post_logout_redirect_uri=u,this.client_authentication=d,this.token_endpoint_auth_signing_alg=h,this.prompt=f,this.display=p,this.max_age=m,this.ui_locales=g,this.acr_values=b,this.resource=v,this.response_mode=w,this.filterProtocolClaims=C??!0,this.loadUserInfo=!!F,this.staleStateAgeInSeconds=j,this.mergeClaimsStrategy=L,this.omitScopeWhenRequesting=S,this.disablePKCE=!!P,this.revokeTokenAdditionalContentTypes=z,this.fetchRequestCredentials=Q||"same-origin",this.requestTimeoutInSeconds=M,N)this.stateStore=N;else{const T=typeof window<"u"?window.localStorage:new jZ;this.stateStore=new NZ({store:T})}if(this.refreshTokenAllowedScope=D,this.extraQueryParams=I,this.extraTokenParams=E,this.extraHeaders=x,this.dpop=_,this.dpop&&!((B=this.dpop)!=null&&B.store))throw new Error("A DPoPStore is required when dpop is enabled")}},L8e=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new $n("UserInfoService"),this._getClaimsFromJwt=async r=>{const n=this._logger.create("_getClaimsFromJwt");try{const i=Wy.decode(r);return n.debug("JWT decoding successful"),i}catch(i){throw n.error("Error parsing JWT response"),i}},this._jsonService=new tM(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){const t=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const r=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",r);const n=await this._jsonService.getJson(r,{token:e,credentials:this._settings.fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return t.debug("got claims",n),n}},UZ=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new $n("TokenClient"),this._jsonService=new tM(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:r=this._settings.client_id,client_secret:n=this._settings.client_secret,extraHeaders:i,...o}){const a=this._logger.create("exchangeCode");r||a.throw(new Error("A client_id is required")),t||a.throw(new Error("A redirect_uri is required")),o.code||a.throw(new Error("A code is required"));const s=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[d,h]of Object.entries(o))h!=null&&s.set(d,h);if((this._settings.client_authentication==="client_secret_basic"||this._settings.client_authentication==="client_secret_jwt")&&n==null)throw a.throw(new Error("A client_secret is required")),null;let c;const l=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":c=ga.generateBasicAuth(r,n);break;case"client_secret_post":s.append("client_id",r),n&&s.append("client_secret",n);break;case"client_secret_jwt":{const d=await ga.generateClientAssertionJwt(r,n,l,this._settings.token_endpoint_auth_signing_alg);s.append("client_id",r),s.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),s.append("client_assertion",d);break}}a.debug("got token endpoint");const u=await this._jsonService.postForm(l,{body:s,basicAuth:c,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:i});return a.debug("got response"),u}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:r=this._settings.client_secret,scope:n=this._settings.scope,...i}){const o=this._logger.create("exchangeCredentials");t||o.throw(new Error("A client_id is required"));const a=new URLSearchParams({grant_type:e});this._settings.omitScopeWhenRequesting||a.set("scope",n);for(const[u,d]of Object.entries(i))d!=null&&a.set(u,d);if((this._settings.client_authentication==="client_secret_basic"||this._settings.client_authentication==="client_secret_jwt")&&r==null)throw o.throw(new Error("A client_secret is required")),null;let s;const c=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":s=ga.generateBasicAuth(t,r);break;case"client_secret_post":a.append("client_id",t),r&&a.append("client_secret",r);break;case"client_secret_jwt":{const u=await ga.generateClientAssertionJwt(t,r,c,this._settings.token_endpoint_auth_signing_alg);a.append("client_id",t),a.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),a.append("client_assertion",u);break}}o.debug("got token endpoint");const l=await this._jsonService.postForm(c,{body:a,basicAuth:s,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),l}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:r=this._settings.client_secret,timeoutInSeconds:n,extraHeaders:i,...o}){const a=this._logger.create("exchangeRefreshToken");t||a.throw(new Error("A client_id is required")),o.refresh_token||a.throw(new Error("A refresh_token is required"));const s=new URLSearchParams({grant_type:e});for(const[d,h]of Object.entries(o))Array.isArray(h)?h.forEach(f=>s.append(d,f)):h!=null&&s.set(d,h);if((this._settings.client_authentication==="client_secret_basic"||this._settings.client_authentication==="client_secret_jwt")&&r==null)throw a.throw(new Error("A client_secret is required")),null;let c;const l=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":c=ga.generateBasicAuth(t,r);break;case"client_secret_post":s.append("client_id",t),r&&s.append("client_secret",r);break;case"client_secret_jwt":{const d=await ga.generateClientAssertionJwt(t,r,l,this._settings.token_endpoint_auth_signing_alg);s.append("client_id",t),s.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),s.append("client_assertion",d);break}}a.debug("got token endpoint");const u=await this._jsonService.postForm(l,{body:s,basicAuth:c,timeoutInSeconds:n,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:i});return a.debug("got response"),u}async revoke(e){var t;const r=this._logger.create("revoke");e.token||r.throw(new Error("A token is required"));const n=await this._metadataService.getRevocationEndpoint(!1);r.debug(`got revocation endpoint, revoking ${(t=e.token_type_hint)!=null?t:"default token type"}`);const i=new URLSearchParams;for(const[o,a]of Object.entries(e))a!=null&&i.set(o,a);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(n,{body:i,timeoutInSeconds:this._settings.requestTimeoutInSeconds}),r.debug("got response")}},P8e=class{constructor(e,t,r){this._settings=e,this._metadataService=t,this._claimsService=r,this._logger=new $n("ResponseValidator"),this._userInfoService=new L8e(this._settings,this._metadataService),this._tokenClient=new UZ(this._settings,this._metadataService)}async validateSigninResponse(e,t,r){const n=this._logger.create("validateSigninResponse");this._processSigninState(e,t),n.debug("state processed"),await this._processCode(e,t,r),n.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t?.skipUserInfo,e.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(e,t){const r=this._logger.create("validateCredentialsResponse"),n=e.isOpenId&&!!e.id_token;n&&this._validateIdTokenAttributes(e),r.debug("tokens validated"),await this._processClaims(e,t,n),r.debug("claims processed")}async validateRefreshResponse(e,t){var r,n;const i=this._logger.create("validateRefreshResponse");e.userState=t.data,(r=e.session_state)!=null||(e.session_state=t.session_state),(n=e.scope)!=null||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),i.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const o=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,o),i.debug("claims processed")}validateSignoutResponse(e,t){const r=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&r.throw(new Error("State does not match")),r.debug("state validated"),e.userState=t.data,e.error)throw r.warn("Response was error",e.error),new og(e)}_processSigninState(e,t){var r;const n=this._logger.create("_processSigninState");if(t.id!==e.state&&n.throw(new Error("State does not match")),t.client_id||n.throw(new Error("No client_id on state")),t.authority||n.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&n.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&n.throw(new Error("client_id mismatch on settings vs. signin state")),n.debug("state validated"),e.userState=t.data,e.url_state=t.url_state,(r=e.scope)!=null||(e.scope=t.scope),e.error)throw n.warn("Response was error",e.error),new og(e);t.code_verifier&&!e.code&&n.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,r=!0){const n=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token){n.debug("not loading user info");return}n.debug("loading user info");const i=await this._userInfoService.getClaims(e.access_token);n.debug("user info claims received from user info endpoint"),r&&i.sub!==e.profile.sub&&n.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(i)),n.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t,r){const n=this._logger.create("_processCode");if(e.code){n.debug("Validating code");const i=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,extraHeaders:r,...t.extraTokenParams});Object.assign(e,i)}else n.debug("No code to process")}_validateIdTokenAttributes(e,t){var r;const n=this._logger.create("_validateIdTokenAttributes");n.debug("decoding ID Token JWT");const i=Wy.decode((r=e.id_token)!=null?r:"");if(i.sub||n.throw(new Error("ID Token is missing a subject claim")),t){const o=Wy.decode(t);i.sub!==o.sub&&n.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==o.auth_time&&n.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==o.azp&&n.throw(new Error("azp in id_token does not match original azp")),!i.azp&&o.azp&&n.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=i}},Jx=class r7{constructor(t){this.id=t.id||ga.generateUUIDv4(),this.data=t.data,t.created&&t.created>0?this.created=t.created:this.created=lh.getEpochTime(),this.request_type=t.request_type,this.url_state=t.url_state}toStorageString(){return new $n("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(t){return $n.createStatic("State","fromStorageString"),Promise.resolve(new r7(JSON.parse(t)))}static async clearStaleState(t,r){const n=$n.createStatic("State","clearStaleState"),i=lh.getEpochTime()-r,o=await t.getAllKeys();n.debug("got keys",o);for(let a=0;a<o.length;a++){const s=o[a],c=await t.get(s);let l=!1;if(c)try{const u=await r7.fromStorageString(c);n.debug("got item from key:",s,u.created),u.created<=i&&(l=!0)}catch(u){n.error("Error parsing state for key:",s,u),l=!0}else n.debug("no item in storage for key:",s),l=!0;l&&(n.debug("removed item for key:",s),t.remove(s))}}},QZ=class n7 extends Jx{constructor(t){super(t),this.code_verifier=t.code_verifier,this.code_challenge=t.code_challenge,this.authority=t.authority,this.client_id=t.client_id,this.redirect_uri=t.redirect_uri,this.scope=t.scope,this.client_secret=t.client_secret,this.extraTokenParams=t.extraTokenParams,this.response_mode=t.response_mode,this.skipUserInfo=t.skipUserInfo}static async create(t){const r=t.code_verifier===!0?ga.generateCodeVerifier():t.code_verifier||void 0,n=r?await ga.generateCodeChallenge(r):void 0;return new n7({...t,code_verifier:r,code_challenge:n})}toStorageString(){return new $n("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo})}static fromStorageString(t){$n.createStatic("SigninState","fromStorageString");const r=JSON.parse(t);return n7.create(r)}},HZ=class zZ{constructor(t){this.url=t.url,this.state=t.state}static async create({url:t,authority:r,client_id:n,redirect_uri:i,response_type:o,scope:a,state_data:s,response_mode:c,request_type:l,client_secret:u,nonce:d,url_state:h,resource:f,skipUserInfo:p,extraQueryParams:m,extraTokenParams:g,disablePKCE:b,dpopJkt:v,omitScopeWhenRequesting:w,...C}){if(!t)throw this._logger.error("create: No url passed"),new Error("url");if(!n)throw this._logger.error("create: No client_id passed"),new Error("client_id");if(!i)throw this._logger.error("create: No redirect_uri passed"),new Error("redirect_uri");if(!o)throw this._logger.error("create: No response_type passed"),new Error("response_type");if(!a)throw this._logger.error("create: No scope passed"),new Error("scope");if(!r)throw this._logger.error("create: No authority passed"),new Error("authority");const F=await QZ.create({data:s,request_type:l,url_state:h,code_verifier:!b,client_id:n,authority:r,redirect_uri:i,response_mode:c,client_secret:u,scope:a,extraTokenParams:g,skipUserInfo:p}),M=new URL(t);M.searchParams.append("client_id",n),M.searchParams.append("redirect_uri",i),M.searchParams.append("response_type",o),w||M.searchParams.append("scope",a),d&&M.searchParams.append("nonce",d),v&&M.searchParams.append("dpop_jkt",v);let j=F.id;h&&(j=`${j}${B0}${h}`),M.searchParams.append("state",j),F.code_challenge&&(M.searchParams.append("code_challenge",F.code_challenge),M.searchParams.append("code_challenge_method","S256")),f&&(Array.isArray(f)?f:[f]).forEach(P=>M.searchParams.append("resource",P));for(const[L,P]of Object.entries({response_mode:c,...C,...m}))P!=null&&M.searchParams.append(L,P.toString());return new zZ({url:M.href,state:F})}};HZ._logger=new $n("SigninRequest");var j8e=HZ,N8e="openid",wk=class{constructor(e){if(this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.state){const t=decodeURIComponent(this.state).split(B0);this.state=t[0],t.length>1&&(this.url_state=t.slice(1).join(B0))}this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-lh.getEpochTime()}set expires_in(e){typeof e=="string"&&(e=Number(e)),e!==void 0&&e>=0&&(this.expires_at=Math.floor(e)+lh.getEpochTime())}get isOpenId(){var e;return((e=this.scope)==null?void 0:e.split(" ").includes(N8e))||!!this.id_token}},U8e=class{constructor({url:e,state_data:t,id_token_hint:r,post_logout_redirect_uri:n,extraQueryParams:i,request_type:o,client_id:a,url_state:s}){if(this._logger=new $n("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const c=new URL(e);if(r&&c.searchParams.append("id_token_hint",r),a&&c.searchParams.append("client_id",a),n&&(c.searchParams.append("post_logout_redirect_uri",n),t||s)){this.state=new Jx({data:t,request_type:o,url_state:s});let l=this.state.id;s&&(l=`${l}${B0}${s}`),c.searchParams.append("state",l)}for(const[l,u]of Object.entries({...i}))u!=null&&c.searchParams.append(l,u.toString());this.url=c.href}},Q8e=class{constructor(e){if(this.state=e.get("state"),this.state){const t=decodeURIComponent(this.state).split(B0);this.state=t[0],t.length>1&&(this.url_state=t.slice(1).join(B0))}this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}},H8e=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],z8e=["sub","iss","aud","exp","iat"],q8e=class{constructor(e){this._settings=e,this._logger=new $n("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let r;Array.isArray(this._settings.filterProtocolClaims)?r=this._settings.filterProtocolClaims:r=H8e;for(const n of r)z8e.includes(n)||delete t[n]}return t}mergeClaims(e,t){const r={...e};for(const[n,i]of Object.entries(t))if(r[n]!==i)if(Array.isArray(r[n])||Array.isArray(i))if(this._settings.mergeClaimsStrategy.array=="replace")r[n]=i;else{const o=Array.isArray(r[n])?r[n]:[r[n]];for(const a of Array.isArray(i)?i:[i])o.includes(a)||o.push(a);r[n]=o}else typeof r[n]=="object"&&typeof i=="object"?r[n]=this.mergeClaims(r[n],i):r[n]=i;return r}},qZ=class{constructor(e,t){this.keys=e,this.nonce=t}},K8e=class{constructor(e,t){this._logger=new $n("OidcClient"),this.settings=e instanceof t7?e:new t7(e),this.metadataService=t??new F8e(this.settings),this._claimsService=new q8e(this.settings),this._validator=new P8e(this.settings,this.metadataService,this._claimsService),this._tokenClient=new UZ(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:r,request_type:n,id_token_hint:i,login_hint:o,skipUserInfo:a,nonce:s,url_state:c,response_type:l=this.settings.response_type,scope:u=this.settings.scope,redirect_uri:d=this.settings.redirect_uri,prompt:h=this.settings.prompt,display:f=this.settings.display,max_age:p=this.settings.max_age,ui_locales:m=this.settings.ui_locales,acr_values:g=this.settings.acr_values,resource:b=this.settings.resource,response_mode:v=this.settings.response_mode,extraQueryParams:w=this.settings.extraQueryParams,extraTokenParams:C=this.settings.extraTokenParams,dpopJkt:F,omitScopeWhenRequesting:M=this.settings.omitScopeWhenRequesting}){const j=this._logger.create("createSigninRequest");if(l!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const L=await this.metadataService.getAuthorizationEndpoint();j.debug("Received authorization endpoint",L);const P=await j8e.create({url:L,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:d,response_type:l,scope:u,state_data:e,url_state:c,prompt:h,display:f,max_age:p,ui_locales:m,id_token_hint:i,login_hint:o,acr_values:g,dpopJkt:F,resource:b,request:t,request_uri:r,extraQueryParams:w,extraTokenParams:C,request_type:n,response_mode:v,client_secret:this.settings.client_secret,skipUserInfo:a,nonce:s,disablePKCE:this.settings.disablePKCE,omitScopeWhenRequesting:M});await this.clearStaleState();const N=P.state;return await this.settings.stateStore.set(N.id,N.toStorageString()),P}async readSigninResponseState(e,t=!1){const r=this._logger.create("readSigninResponseState"),n=new wk(JB.readParams(e,this.settings.response_mode));if(!n.state)throw r.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[t?"remove":"get"](n.state);if(!i)throw r.throw(new Error("No matching state found in storage")),null;return{state:await QZ.fromStorageString(i),response:n}}async processSigninResponse(e,t,r=!0){const n=this._logger.create("processSigninResponse"),{state:i,response:o}=await this.readSigninResponseState(e,r);if(n.debug("received state from storage; validating response"),this.settings.dpop&&this.settings.dpop.store){const a=await this.getDpopProof(this.settings.dpop.store);t={...t,DPoP:a}}try{await this._validator.validateSigninResponse(o,i,t)}catch(a){if(a instanceof e7&&this.settings.dpop){const s=await this.getDpopProof(this.settings.dpop.store,a.nonce);t.DPoP=s,await this._validator.validateSigninResponse(o,i,t)}else throw a}return o}async getDpopProof(e,t){let r,n;return(await e.getAllKeys()).includes(this.settings.client_id)?(n=await e.get(this.settings.client_id),n.nonce!==t&&t&&(n.nonce=t,await e.set(this.settings.client_id,n))):(r=await ga.generateDPoPKeys(),n=new qZ(r,t),await e.set(this.settings.client_id,n)),await ga.generateDPoPProof({url:await this.metadataService.getTokenEndpoint(!1),httpMethod:"POST",keyPair:n.keys,nonce:n.nonce})}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:r=!1,extraTokenParams:n={}}){const i=await this._tokenClient.exchangeCredentials({username:e,password:t,...n}),o=new wk(new URLSearchParams);return Object.assign(o,i),await this._validator.validateCredentialsResponse(o,r),o}async useRefreshToken({state:e,redirect_uri:t,resource:r,timeoutInSeconds:n,extraHeaders:i,extraTokenParams:o}){var a;const s=this._logger.create("useRefreshToken");let c;if(this.settings.refreshTokenAllowedScope===void 0)c=e.scope;else{const d=this.settings.refreshTokenAllowedScope.split(" ");c=(((a=e.scope)==null?void 0:a.split(" "))||[]).filter(f=>d.includes(f)).join(" ")}if(this.settings.dpop&&this.settings.dpop.store){const d=await this.getDpopProof(this.settings.dpop.store);i={...i,DPoP:d}}let l;try{l=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:c,redirect_uri:t,resource:r,timeoutInSeconds:n,extraHeaders:i,...o})}catch(d){if(d instanceof e7&&this.settings.dpop)i.DPoP=await this.getDpopProof(this.settings.dpop.store,d.nonce),l=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:c,redirect_uri:t,resource:r,timeoutInSeconds:n,extraHeaders:i,...o});else throw d}const u=new wk(new URLSearchParams);return Object.assign(u,l),s.debug("validating response",u),await this._validator.validateRefreshResponse(u,{...e,scope:c}),u}async createSignoutRequest({state:e,id_token_hint:t,client_id:r,request_type:n,url_state:i,post_logout_redirect_uri:o=this.settings.post_logout_redirect_uri,extraQueryParams:a=this.settings.extraQueryParams}={}){const s=this._logger.create("createSignoutRequest"),c=await this.metadataService.getEndSessionEndpoint();if(!c)throw s.throw(new Error("No end session endpoint")),null;s.debug("Received end session endpoint",c),!r&&o&&!t&&(r=this.settings.client_id);const l=new U8e({url:c,id_token_hint:t,client_id:r,post_logout_redirect_uri:o,state_data:e,extraQueryParams:a,request_type:n,url_state:i});await this.clearStaleState();const u=l.state;return u&&(s.debug("Signout request has state to persist"),await this.settings.stateStore.set(u.id,u.toStorageString())),l}async readSignoutResponseState(e,t=!1){const r=this._logger.create("readSignoutResponseState"),n=new Q8e(JB.readParams(e,this.settings.response_mode));if(!n.state){if(r.debug("No state in response"),n.error)throw r.warn("Response was error:",n.error),new og(n);return{state:void 0,response:n}}const i=await this.settings.stateStore[t?"remove":"get"](n.state);if(!i)throw r.throw(new Error("No matching state found in storage")),null;return{state:await Jx.fromStorageString(i),response:n}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:r,response:n}=await this.readSignoutResponseState(e,!0);return r?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(n,r)):t.debug("No state from storage; skipping response validation"),n}clearStaleState(){return this._logger.create("clearStaleState"),Jx.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}},G8e=class{constructor(e){this._userManager=e,this._logger=new $n("SessionMonitor"),this._start=async t=>{const r=t.session_state;if(!r)return;const n=this._logger.create("_start");if(t.profile?(this._sub=t.profile.sub,n.debug("session_state",r,", sub",this._sub)):(this._sub=void 0,n.debug("session_state",r,", anonymous user")),this._checkSessionIFrame){this._checkSessionIFrame.start(r);return}try{const i=await this._userManager.metadataService.getCheckSessionIframe();if(i){n.debug("initializing check session iframe");const o=this._userManager.settings.client_id,a=this._userManager.settings.checkSessionIntervalInSeconds,s=this._userManager.settings.stopCheckSessionOnError,c=new T8e(this._callback,o,i,a,s);await c.load(),this._checkSessionIFrame=c,c.start(r)}else n.warn("no check session iframe found in the metadata")}catch(i){n.error("Error from getCheckSessionIframe:",i instanceof Error?i.message:i)}},this._stop=()=>{const t=this._logger.create("_stop");if(this._sub=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const r=setInterval(async()=>{clearInterval(r);try{const n=await this._userManager.querySessionStatus();if(n){const i={session_state:n.session_state,profile:n.sub?{sub:n.sub}:null};this._start(i)}}catch(n){t.error("error from querySessionStatus",n instanceof Error?n.message:n)}},1e3)}},this._callback=async()=>{const t=this._logger.create("_callback");try{const r=await this._userManager.querySessionStatus();let n=!0;r&&this._checkSessionIFrame?r.sub===this._sub?(n=!1,this._checkSessionIFrame.start(r.session_state),t.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",r.session_state),await this._userManager.events._raiseUserSessionChanged()):t.debug("different subject signed into OP",r.sub):t.debug("subject no longer signed into OP"),n?this._sub?await this._userManager.events._raiseUserSignedOut():await this._userManager.events._raiseUserSignedIn():t.debug("no change in session detected, no event to raise")}catch(r){this._sub&&(t.debug("Error calling queryCurrentSigninSession; raising signed out event",r),await this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(t=>{this._logger.error(t)})}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const t=await this._userManager.querySessionStatus();if(t){const r={session_state:t.session_state,profile:t.sub?{sub:t.sub}:null};this._start(r)}}}},xk=class KZ{constructor(t){var r;this.id_token=t.id_token,this.session_state=(r=t.session_state)!=null?r:null,this.access_token=t.access_token,this.refresh_token=t.refresh_token,this.token_type=t.token_type,this.scope=t.scope,this.profile=t.profile,this.expires_at=t.expires_at,this.state=t.userState,this.url_state=t.url_state}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-lh.getEpochTime()}set expires_in(t){t!==void 0&&(this.expires_at=Math.floor(t)+lh.getEpochTime())}get expired(){const t=this.expires_in;if(t!==void 0)return t<=0}get scopes(){var t,r;return(r=(t=this.scope)==null?void 0:t.split(" "))!=null?r:[]}toStorageString(){return new $n("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(t){return $n.createStatic("User","fromStorageString"),new KZ(JSON.parse(t))}},NH="oidc-client",GZ=class{constructor(){this._abort=new ap("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const t=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);const{url:r,keepOpen:n}=await new Promise((i,o)=>{const a=c=>{var l;const u=c.data,d=(l=e.scriptOrigin)!=null?l:window.location.origin;if(!(c.origin!==d||u?.source!==NH)){try{const h=JB.readParams(u.url,e.response_mode).get("state");if(h||t.warn("no state found in response url"),c.source!==this._window&&h!==e.state)return}catch{this._dispose(),o(new Error("Invalid response from window"))}i(u)}};window.addEventListener("message",a,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",a,!1));const s=new BroadcastChannel(`oidc-client-popup-${e.state}`);s.addEventListener("message",a,!1),this._disposeHandlers.add(()=>s.close()),this._disposeHandlers.add(this._abort.addHandler(c=>{this._dispose(),o(c)}))});return t.debug("got response from window"),this._dispose(),n||this.close(),{url:r}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,r=!1,n=window.location.origin){const i={source:NH,url:t,keepOpen:r},o=new $n("_notifyParent");if(e)o.debug("With parent. Using parent.postMessage."),e.postMessage(i,n);else{o.debug("No parent. Using BroadcastChannel.");const a=new URL(t).searchParams.get("state");if(!a)throw new Error("No parent and no state in URL. Can't complete notification.");const s=new BroadcastChannel(`oidc-client-popup-${a}`);s.postMessage(i),s.close()}}},VZ={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},$Z="_blank",V8e=60,$8e=2,WZ=10,W8e=class extends t7{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:r=e.post_logout_redirect_uri,popupWindowFeatures:n=VZ,popupWindowTarget:i=$Z,redirectMethod:o="assign",redirectTarget:a="self",iframeNotifyParentOrigin:s=e.iframeNotifyParentOrigin,iframeScriptOrigin:c=e.iframeScriptOrigin,requestTimeoutInSeconds:l,silent_redirect_uri:u=e.redirect_uri,silentRequestTimeoutInSeconds:d,automaticSilentRenew:h=!0,validateSubOnSilentRenew:f=!0,includeIdTokenInSilentRenew:p=!1,monitorSession:m=!1,monitorAnonymousSession:g=!1,checkSessionIntervalInSeconds:b=$8e,query_status_response_type:v="code",stopCheckSessionOnError:w=!0,revokeTokenTypes:C=["access_token","refresh_token"],revokeTokensOnSignout:F=!1,includeIdTokenInSilentSignout:M=!1,accessTokenExpiringNotificationTimeInSeconds:j=V8e,userStore:L}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=r,this.popupWindowFeatures=n,this.popupWindowTarget=i,this.redirectMethod=o,this.redirectTarget=a,this.iframeNotifyParentOrigin=s,this.iframeScriptOrigin=c,this.silent_redirect_uri=u,this.silentRequestTimeoutInSeconds=d||l||WZ,this.automaticSilentRenew=h,this.validateSubOnSilentRenew=f,this.includeIdTokenInSilentRenew=p,this.monitorSession=m,this.monitorAnonymousSession=g,this.checkSessionIntervalInSeconds=b,this.stopCheckSessionOnError=w,this.query_status_response_type=v,this.revokeTokenTypes=C,this.revokeTokensOnSignout=F,this.includeIdTokenInSilentSignout=M,this.accessTokenExpiringNotificationTimeInSeconds=j,L)this.userStore=L;else{const P=typeof window<"u"?window.sessionStorage:new jZ;this.userStore=new NZ({store:P})}}},UH=class YZ extends GZ{constructor({silentRequestTimeoutInSeconds:t=WZ}){super(),this._logger=new $n("IFrameWindow"),this._timeoutInSeconds=t,this._frame=YZ.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const t=window.document.createElement("iframe");return t.style.visibility="hidden",t.style.position="fixed",t.style.left="-1000px",t.style.top="0",t.width="0",t.height="0",window.document.body.appendChild(t),t}async navigate(t){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const r=setTimeout(()=>void this._abort.raise(new eM("IFrame timed out without a response")),this._timeoutInSeconds*1e3);return this._disposeHandlers.add(()=>clearTimeout(r)),await super.navigate(t)}close(){var t;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",r=>{var n;const i=r.target;(n=i.parentNode)==null||n.removeChild(i),this._abort.raise(new Error("IFrame removed from DOM"))},!0),(t=this._frame.contentWindow)==null||t.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(t,r){return super._notifyParent(window.parent,t,!1,r)}},Y8e=class{constructor(e){this._settings=e,this._logger=new $n("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new UH({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),UH.notifyParent(e,this._settings.iframeNotifyParentOrigin)}},X8e=500,Z8e=1e3,QH=class extends GZ{constructor({popupWindowTarget:e=$Z,popupWindowFeatures:t={},popupSignal:r,popupAbortOnClose:n}){super(),this._logger=new $n("PopupWindow");const i=jH.center({...VZ,...t});this._window=window.open(void 0,e,jH.serialize(i)),this.abortOnClose=!!n,r&&r.addEventListener("abort",()=>{var o;this._abort.raise(new Error((o=r.reason)!=null?o:"Popup aborted"))}),t.closePopupWindowAfterInSeconds&&t.closePopupWindowAfterInSeconds>0&&setTimeout(()=>{if(!this._window||typeof this._window.closed!="boolean"||this._window.closed){this._abort.raise(new Error("Popup blocked by user"));return}this.close()},t.closePopupWindowAfterInSeconds*Z8e)}async navigate(e){var t;(t=this._window)==null||t.focus();const r=setInterval(()=>{(!this._window||this._window.closed)&&(this._logger.debug("Popup closed by user or isolated by redirect"),n(),this._disposeHandlers.delete(n),this.abortOnClose&&this._abort.raise(new Error("Popup closed by user")))},X8e),n=()=>clearInterval(r);return this._disposeHandlers.add(n),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,t){super._notifyParent(window.opener,e,t),!t&&!window.opener&&window.close()}},J8e=class{constructor(e){this._settings=e,this._logger=new $n("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget,popupSignal:r,popupAbortOnClose:n}){return new QH({popupWindowFeatures:e,popupWindowTarget:t,popupSignal:r,popupAbortOnClose:n})}async callback(e,{keepOpen:t=!1}){this._logger.create("callback"),QH.notifyOpener(e,t)}},eGe=class{constructor(e){this._settings=e,this._logger=new $n("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var r;this._logger.create("prepare");let n=window.self;t==="top"&&(n=(r=window.top)!=null?r:window.self);const i=n.location[e].bind(n.location);let o;return{navigate:async a=>(this._logger.create("navigate"),await new Promise((c,l)=>{o=l,window.addEventListener("pageshow",()=>c(window.location.href)),i(a.url)})),close:()=>{this._logger.create("close"),o?.(new Error("Redirect aborted")),n.stop()}}}async callback(){}},tGe=class extends M8e{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new $n("UserManagerEvents"),this._userLoaded=new ap("User loaded"),this._userUnloaded=new ap("User unloaded"),this._silentRenewError=new ap("Silent renew error"),this._userSignedIn=new ap("User signed in"),this._userSignedOut=new ap("User signed out"),this._userSessionChanged=new ap("User session changed")}async load(e,t=!0){await super.load(e),t&&await this._userLoaded.raise(e)}async unload(){await super.unload(),await this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}async _raiseSilentRenewError(e){await this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}async _raiseUserSignedIn(){await this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}async _raiseUserSignedOut(){await this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}async _raiseUserSessionChanged(){await this._userSessionChanged.raise()}},rGe=class{constructor(e){this._userManager=e,this._logger=new $n("SilentRenewService"),this._isStarted=!1,this._retryTimer=new lh("Retry Silent Renew"),this._tokenExpiring=async()=>{const t=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),t.debug("silent token renewal successful")}catch(r){if(r instanceof eM){t.warn("ErrorTimeout from signinSilent:",r,"retry in 5s"),this._retryTimer.init(5);return}t.error("Error from signinSilent:",r),await this._userManager.events._raiseSilentRenewError(r)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},nGe=class{constructor(e){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.data=e.state}},iGe=class{constructor(e,t,r,n){this._logger=new $n("UserManager"),this.settings=new W8e(e),this._client=new K8e(e),this._redirectNavigator=t??new eGe(this.settings),this._popupNavigator=r??new J8e(this.settings),this._iframeNavigator=n??new Y8e(this.settings),this._events=new tGe(this.settings),this._silentRenewService=new rGe(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new G8e(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(e=!1){const t=this._logger.create("getUser"),r=await this._loadUser();return r?(t.info("user loaded"),await this._events.load(r,e),r):(t.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),await this._events.unload()}async signinRedirect(e={}){var t;this._logger.create("signinRedirect");const{redirectMethod:r,...n}=e;let i;(t=this.settings.dpop)!=null&&t.bind_authorization_code&&(i=await this.generateDPoPJkt(this.settings.dpop));const o=await this._redirectNavigator.prepare({redirectMethod:r});await this._signinStart({request_type:"si:r",dpopJkt:i,...n},o)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),r=await this._signinEnd(e);return r.profile&&r.profile.sub?t.info("success, signed in subject",r.profile.sub):t.info("no subject"),r}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:r=!1}){const n=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:r,extraTokenParams:this.settings.extraTokenParams});n.debug("got signin response");const o=await this._buildUser(i);return o.profile&&o.profile.sub?n.info("success, signed in subject",o.profile.sub):n.info("no subject"),o}async signinPopup(e={}){var t;const r=this._logger.create("signinPopup");let n;(t=this.settings.dpop)!=null&&t.bind_authorization_code&&(n=await this.generateDPoPJkt(this.settings.dpop));const{popupWindowFeatures:i,popupWindowTarget:o,popupSignal:a,popupAbortOnClose:s,...c}=e,l=this.settings.popup_redirect_uri;l||r.throw(new Error("No popup_redirect_uri configured"));const u=await this._popupNavigator.prepare({popupWindowFeatures:i,popupWindowTarget:o,popupSignal:a,popupAbortOnClose:s}),d=await this._signin({request_type:"si:p",redirect_uri:l,display:"popup",dpopJkt:n,...c},u);return d&&(d.profile&&d.profile.sub?r.info("success, signed in subject",d.profile.sub):r.info("no subject")),d}async signinPopupCallback(e=window.location.href,t=!1){const r=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),r.info("success")}async signinSilent(e={}){var t,r;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:i,...o}=e;let a=await this._loadUser();if(!e.forceIframeAuth&&a?.refresh_token){n.debug("using refresh token");const d=new nGe(a);return await this._useRefreshToken({state:d,redirect_uri:o.redirect_uri,resource:o.resource,extraTokenParams:o.extraTokenParams,timeoutInSeconds:i})}let s;(t=this.settings.dpop)!=null&&t.bind_authorization_code&&(s=await this.generateDPoPJkt(this.settings.dpop));const c=this.settings.silent_redirect_uri;c||n.throw(new Error("No silent_redirect_uri configured"));let l;a&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",a.profile.sub),l=a.profile.sub);const u=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:i});return a=await this._signin({request_type:"si:s",redirect_uri:c,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?a?.id_token:void 0,dpopJkt:s,...o},u,l),a&&((r=a.profile)!=null&&r.sub?n.info("success, signed in subject",a.profile.sub):n.info("no subject")),a}async _useRefreshToken(e){const t=await this._client.useRefreshToken({timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds,...e}),r=new xk({...e.state,...t});return await this.storeUser(r),await this._events.load(r),r}async signinSilentCallback(e=window.location.href){const t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){const{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":await this.signinPopupCallback(e);break;case"si:s":await this.signinSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async signoutCallback(e=window.location.href,t=!1){const{state:r}=await this._client.readSignoutResponseState(e);if(r)switch(r.request_type){case"so:r":return await this.signoutRedirectCallback(e);case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(e={}){const t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:r,...n}=e,i=this.settings.silent_redirect_uri;i||t.throw(new Error("No silent_redirect_uri configured"));const o=await this._loadUser(),a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r}),s=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o?.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...n},a);try{const c={},l=await this._client.processSigninResponse(s.url,c);return t.debug("got signin response"),l.session_state&&l.profile.sub?(t.info("success for subject",l.profile.sub),{session_state:l.session_state,sub:l.profile.sub}):(t.info("success, user not authenticated"),null)}catch(c){if(this.settings.monitorAnonymousSession&&c instanceof og)switch(c.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:c.session_state}}throw c}}async _signin(e,t,r){const n=await this._signinStart(e,t);return await this._signinEnd(n.url,r)}async _signinStart(e,t){const r=this._logger.create("_signinStart");try{const n=await this._client.createSigninRequest(e);return r.debug("got signin request"),await t.navigate({url:n.url,state:n.state.id,response_mode:n.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(n){throw r.debug("error after preparing navigator, closing navigator window"),t.close(),n}}async _signinEnd(e,t){const r=this._logger.create("_signinEnd"),n={},i=await this._client.processSigninResponse(e,n);return r.debug("got signin response"),await this._buildUser(i,t)}async _buildUser(e,t){const r=this._logger.create("_buildUser"),n=new xk(e);if(t){if(t!==n.profile.sub)throw r.debug("current user does not match user returned from signin. sub from signin:",n.profile.sub),new og({...e,error:"login_required"});r.debug("current user matches user returned from signin")}return await this.storeUser(n),r.debug("user stored"),await this._events.load(n),n}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:r,...n}=e,i=await this._redirectNavigator.prepare({redirectMethod:r});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...n},i),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),r=await this._signoutEnd(e);return t.info("success"),r}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:r,popupWindowTarget:n,popupSignal:i,...o}=e,a=this.settings.popup_post_logout_redirect_uri,s=await this._popupNavigator.prepare({popupWindowFeatures:r,popupWindowTarget:n,popupSignal:i});await this._signout({request_type:"so:p",post_logout_redirect_uri:a,state:a==null?void 0:{},...o},s),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){const r=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),r.info("success")}async _signout(e,t){const r=await this._signoutStart(e,t);return await this._signoutEnd(r.url)}async _signoutStart(e={},t){var r;const n=this._logger.create("_signoutStart");try{const i=await this._loadUser();n.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const o=e.id_token_hint||i&&i.id_token;o&&(n.debug("setting id_token_hint in signout request"),e.id_token_hint=o),await this.removeUser(),n.debug("user removed, creating signout request");const a=await this._client.createSignoutRequest(e);return n.debug("got signout request"),await t.navigate({url:a.url,state:(r=a.state)==null?void 0:r.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(i){throw n.debug("error after preparing navigator, closing navigator window"),t.close(),i}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),r=await this._client.processSignoutResponse(e);return t.debug("got signout response"),r}async signoutSilent(e={}){var t;const r=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:n,...i}=e,o=this.settings.includeIdTokenInSilentSignout?(t=await this._loadUser())==null?void 0:t.id_token:void 0,a=this.settings.popup_post_logout_redirect_uri,s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n});await this._signout({request_type:"so:s",post_logout_redirect_uri:a,id_token_hint:o,...i},s),r.info("success")}async signoutSilentCallback(e=window.location.href){const t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){const t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){const r=this._logger.create("_revokeInternal");if(!e)return;const n=t.filter(i=>typeof e[i]=="string");if(!n.length){r.debug("no need to revoke due to no token(s)");return}for(const i of n)await this._client.revokeToken(e[i],i),r.info(`${i} revoked successfully`),i!=="access_token"&&(e[i]=null);await this.storeUser(e),r.debug("user stored"),await this._events.load(e)}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),xk.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const r=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,r)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey),this.settings.dpop&&await this.settings.dpop.store.remove(this.settings.client_id)}async clearStaleState(){await this._client.clearStaleState()}async dpopProof(e,t,r,n){var i,o;const a=await((o=(i=this.settings.dpop)==null?void 0:i.store)==null?void 0:o.get(this.settings.client_id));if(a)return await ga.generateDPoPProof({url:e,accessToken:t?.access_token,httpMethod:r,keyPair:a.keys,nonce:n})}async generateDPoPJkt(e){let t=await e.store.get(this.settings.client_id);if(!t){const r=await ga.generateDPoPKeys();t=new qZ(r),await e.store.set(this.settings.client_id,t)}return await ga.generateDPoPJkt(t.keys)}},rM=ze.createContext(void 0);rM.displayName="AuthContext";var oGe={isLoading:!0,isAuthenticated:!1},aGe=(e,t)=>{switch(t.type){case"INITIALISED":case"USER_LOADED":return{...e,user:t.user,isLoading:!1,isAuthenticated:t.user?!t.user.expired:!1,error:void 0};case"USER_SIGNED_OUT":case"USER_UNLOADED":return{...e,user:void 0,isAuthenticated:!1};case"NAVIGATOR_INIT":return{...e,isLoading:!0,activeNavigator:t.method};case"NAVIGATOR_CLOSE":return{...e,isLoading:!1,activeNavigator:void 0};case"ERROR":{const r=t.error;return r.toString=()=>`${r.name}: ${r.message}`,{...e,isLoading:!1,error:r}}default:{const r=new TypeError(`unknown type ${t.type}`),n={name:r.name,message:r.message,innerError:r,stack:r.stack,source:"unknown"};return n.toString=()=>`${n.name}: ${n.message}`,{...e,isLoading:!1,error:n}}}},sGe=(e=window.location)=>{let t=new URLSearchParams(e.search);return!!((t.get("code")||t.get("error"))&&t.get("state")||(t=new URLSearchParams(e.hash.replace("#","?")),(t.get("code")||t.get("error"))&&t.get("state")))},lGe=nM("signinCallback","Sign-in failed"),cGe=nM("signoutCallback","Sign-out failed"),uGe=nM("renewSilent","Renew silent failed");function XZ(e,t){return{name:_k(e,"name",()=>"Error"),message:_k(e,"message",()=>t),stack:_k(e,"stack",()=>new Error().stack),innerError:e}}function nM(e,t){return r=>({...XZ(r,t),source:e})}function _k(e,t,r){if(e&&typeof e=="object"){const n=e[t];if(typeof n=="string")return n}return r()}var dGe=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],fGe=["signinPopup","signinSilent","signinRedirect","signinResourceOwnerCredentials","signoutPopup","signoutRedirect","signoutSilent"],HH=e=>()=>{throw new Error(`UserManager#${e} was called from an unsupported context. If this is a server-rendered page, defer this call with useEffect() or pass a custom UserManager implementation.`)},zH=typeof window>"u"?null:iGe,hGe=e=>{const{children:t,onSigninCallback:r,skipSigninCallback:n,matchSignoutCallback:i,onSignoutCallback:o,onRemoveUser:a,userManager:s=null,...c}=e,[l]=ze.useState(()=>s??(zH?new zH(c):{settings:c})),[u,d]=ze.useReducer(aGe,oGe),h=ze.useMemo(()=>Object.assign({settings:l.settings,events:l.events},Object.fromEntries(dGe.map(g=>{var b,v;return[g,(v=(b=l[g])==null?void 0:b.bind(l))!=null?v:HH(g)]})),Object.fromEntries(fGe.map(g=>[g,l[g]?async b=>{d({type:"NAVIGATOR_INIT",method:g});try{return await l[g](b)}catch(v){return d({type:"ERROR",error:{...XZ(v,`Unknown error while executing ${g}(...).`),source:g,args:b}}),null}finally{d({type:"NAVIGATOR_CLOSE"})}}:HH(g)]))),[l]),f=ze.useRef(!1);ze.useEffect(()=>{!l||f.current||(f.current=!0,(async()=>{try{let g=null;sGe()&&!n&&(g=await l.signinCallback(),r&&await r(g)),g=g||await l.getUser(),d({type:"INITIALISED",user:g})}catch(g){d({type:"ERROR",error:lGe(g)})}try{if(i&&i(l.settings)){const g=await l.signoutCallback();o&&await o(g)}}catch(g){d({type:"ERROR",error:cGe(g)})}})())},[l,n,r,o,i]),ze.useEffect(()=>{if(!l)return;const g=C=>{d({type:"USER_LOADED",user:C})};l.events.addUserLoaded(g);const b=()=>{d({type:"USER_UNLOADED"})};l.events.addUserUnloaded(b);const v=()=>{d({type:"USER_SIGNED_OUT"})};l.events.addUserSignedOut(v);const w=C=>{d({type:"ERROR",error:uGe(C)})};return l.events.addSilentRenewError(w),()=>{l.events.removeUserLoaded(g),l.events.removeUserUnloaded(b),l.events.removeUserSignedOut(v),l.events.removeSilentRenewError(w)}},[l]);const p=ze.useCallback(async()=>{await l.removeUser(),a&&await a()},[l,a]),m=ze.useMemo(()=>({...u,...h,removeUser:p}),[u,h,p]);return ze.createElement(rM.Provider,{value:m},t)},pGe=()=>{const e=ze.useContext(rM);return e||console.warn("AuthProvider context is undefined, please verify you are calling useAuth() as child of a <AuthProvider> component."),e};const AGe={authority:window.location.origin+"/oidc/realms/Liberty",client_id:"liberty-framework",redirect_uri:window.location.origin};pee.createRoot(document.getElementById("root")).render(Ff.jsx(ze.StrictMode,{children:Ff.jsx(hGe,{...AGe,children:Ff.jsx(h6e,{useAuth:pGe,children:Ff.jsx(y8e,{fallback:Ff.jsx(gt,{children:"An error has occurred"}),children:Ff.jsx(v8e,{children:Ff.jsx(_8e,{})})})})})}));export{Ys as S,An as j,mK as s};
633
- //# sourceMappingURL=index-DX25oU_G.js.map
633
+ //# sourceMappingURL=index-DNBDt6-C.js.map